From patchwork Thu Dec 5 15:44:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matheus Castello X-Patchwork-Id: 1204685 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=castello.eng.br Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=castello.eng.br header.i=@castello.eng.br header.b="KFPZkvkv"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47TLGx1T1mz9sPJ for ; Fri, 6 Dec 2019 03:08:09 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730033AbfLEQII (ORCPT ); Thu, 5 Dec 2019 11:08:08 -0500 Received: from gateway30.websitewelcome.com ([50.116.127.1]:36670 "EHLO gateway30.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729964AbfLEQII (ORCPT ); Thu, 5 Dec 2019 11:08:08 -0500 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 0476A6CEE for ; Thu, 5 Dec 2019 09:44:32 -0600 (CST) Received: from br164.hostgator.com.br ([192.185.176.180]) by cmsmtp with SMTP id ctItiPOSjiJ43ctItirFdB; Thu, 05 Dec 2019 09:44:32 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=castello.eng.br; s=default; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Kono/osY8LIAISwNgMpURkYC4W/4gFk0QH7aAaQbSh4=; b=KFPZkvkv3OWyCyMPD6wcT7unhC 6aEdRcRYif0kIHhl0yXyKrMY0hNpFsLqZU+CGUJ72XPDGmA/z0S68k4QpNmw3eFyojrDCpCm4KDg9 RE3dD8aremRzo2tpfiHf/SQdqpw8UnxUTxoScV0BVsbOvOMQS+EZsyqjv81tRdnJa7jF0J4+GI51G WQHoL6FVUyhm1jhXfydD+1KYUiXeakCrC5eCWoAMYVnRD28432aYw2Ol0jOTWQTci4PEb2ENaRyCR fBxa7ucU20kx9IIWzJ1J2T21gWbVVlG/O8Rv/zXCxmm44uZZC8CO1cxdLdQQx5vqPj1AwSfuYSmX9 cPiukfrA==; Received: from [191.31.196.215] (port=35544 helo=castello.bz.toradex.local) by br164.hostgator.com.br with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1ictIs-001jEH-US; Thu, 05 Dec 2019 12:44:31 -0300 From: Matheus Castello To: sre@kernel.org, krzk@kernel.org, robh+dt@kernel.org Cc: mark.rutland@arm.com, cw00.choi@samsung.com, b.zolnierkie@samsung.com, lee.jones@linaro.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Matheus Castello Subject: [PATCH v8 0/5] power: supply: MAX17040: Add IRQ for low level and alert SOC changes Date: Thu, 5 Dec 2019 12:44:05 -0300 Message-Id: <20191205154410.29462-1-matheus@castello.eng.br> X-Mailer: git-send-email 2.24.0.rc2 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - br164.hostgator.com.br X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - castello.eng.br X-BWhitelist: no X-Source-IP: 191.31.196.215 X-Source-L: No X-Exim-ID: 1ictIs-001jEH-US X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (castello.bz.toradex.local) [191.31.196.215]:35544 X-Source-Auth: matheus@castello.eng.br X-Email-Count: 2 X-Source-Cap: Y2FzdGUyNDg7Y2FzdGUyNDg7YnIxNjQuaG9zdGdhdG9yLmNvbS5icg== X-Local-Domain: yes Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This series add IRQ handler for low level SOC alert, define a devicetree binding attribute to configure the alert level threshold and check for changes in SOC and power supply status for send uevents. Max17043/17044 have a pin for alert host about low level state of charge and this alert can be configured in a threshold from 1% up to 32% of SOC. Thanks Krzysztof Kozlowski, Lee Jones, Rob Herring and Sebastian Reichel for your time reviewing it. Changes since v7: (Suggested by Sebastian Reichel) - Fix unrelated change - Use device_property_read_u32() and simplify the code - Check the irq and of_device_is_compatible in the first patch Changes since v6: (Suggested by Lee Jones) - Use relative paths in documentation Matheus Castello (5): power: supply: max17040: Add IRQ handler for low SOC alert dt-bindings: power: supply: Max17040: Add DT bindings for max17040 fuel gauge devicetree: mfd: max14577: Add reference to max14040_battery.txt descriptions power: supply: max17040: Config alert SOC low level threshold from FDT power: supply: max17040: Send uevent in SOC and status change .../devicetree/bindings/mfd/max14577.txt | 2 + .../power/supply/max17040_battery.txt | 33 +++++ drivers/power/supply/max17040_battery.c | 130 +++++++++++++++++- 3 files changed, 161 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/power/supply/max17040_battery.txt Reviewed-by: Krzysztof Kozlowski --- 2.24.0.rc2