From patchwork Fri Feb 15 11:50:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Mavrodiev X-Patchwork-Id: 10814855 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 10AFC14E1 for ; Fri, 15 Feb 2019 11:51:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB13C2EE58 for ; Fri, 15 Feb 2019 11:51:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D72D52EE80; Fri, 15 Feb 2019 11:51:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5C3FB2EE7D for ; Fri, 15 Feb 2019 11:51:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=4ErN4RxL++SmtUQ32rFmF435wCPdUe6VubWnKqCmS7Y=; b=kzgrdYJeqvpPObSkhLDLB+miWl XqJmsvJHkcJ3e+KZm6G1Bd62tAvbiSZp/tAba0xKZBipGzhiWJXm8pzCDA4telDUjnh9rBSc1C3yQ H9Z2tmD+MWivk2ThVbGCoiIVl4xjZlKa7r4VmckVS43XZAGUj2PhA0pG4eTmr7DSkv46KJetWQuDt CNFHV3R1EHBK/bpuBxwTrBM+9hPwy4mhOBeN1RjgvcL9rVmd64xE8jN+MpINiul6+PDBjFR3XADU0 1o7wz3r9dvNBTk33bS2IwVX3yVR7w1nOk41ke5oHg3pLuAJ322kug8uwbVsedxE8lWzt81YHg34lO 1xZNbQjQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1guc1z-0008I0-5P; Fri, 15 Feb 2019 11:51:47 +0000 Received: from olimex.com ([184.105.72.32]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1guc1G-0007XA-MK for linux-arm-kernel@lists.infradead.org; Fri, 15 Feb 2019 11:51:14 +0000 Received: from localhost.localdomain ([195.238.85.143]) by olimex.com with ESMTPSA (ECDHE-RSA-AES128-GCM-SHA256:TLSv1.2:Kx=ECDH:Au=RSA:Enc=AESGCM(128):Mac=AEAD) (SMTP-AUTH username stefan@olimex.com, mechanism PLAIN) for ; Fri, 15 Feb 2019 03:50:45 -0800 From: Stefan Mavrodiev To: Jacek Anaszewski , Pavel Machek , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Lee Jones , linux-leds@vger.kernel.org (open list:LED SUBSYSTEM), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-kernel@vger.kernel.org (open list:X-POWERS MULTIFUNCTION PMIC DEVICE DRIVERS), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Allwinner sunXi SoC support) Subject: [PATCH v2 3/8] dt-bindings: leds: Add binding for axp20x-led device driver Date: Fri, 15 Feb 2019 13:50:08 +0200 Message-Id: <20190215115013.11098-4-stefan@olimex.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190215115013.11098-1-stefan@olimex.com> References: <20190215115013.11098-1-stefan@olimex.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190215_035103_289267_6183C07F X-CRM114-Status: GOOD ( 10.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Mavrodiev MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This adds the devicetree bindings for charge led indicator found on most of X-Powers AXP20X PMICs. Signed-off-by: Stefan Mavrodiev --- .../devicetree/bindings/leds/leds-axp20x.txt | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-axp20x.txt diff --git a/Documentation/devicetree/bindings/leds/leds-axp20x.txt b/Documentation/devicetree/bindings/leds/leds-axp20x.txt new file mode 100644 index 000000000000..5a83ad06796d --- /dev/null +++ b/Documentation/devicetree/bindings/leds/leds-axp20x.txt @@ -0,0 +1,74 @@ +Device Tree Bindings for LED support on X-Powers PMIC + +Most of the X-Powers PMICs have integrated battery charger with LED indicator. +The output is open-drain, so the state is either high-Z or output-low. The +driver is a subnode of AXP20X MFD driver, since it uses shared bus with all +other cells. +The LED can be controlled either manually or automatically. Then in automatic +(controlled by the charger) there are two indication modes: + +Mode-A +====== +- output-low: Charging +- high-Z Not charging +- 1Hz flashing: Abnormal alarm +- 4Hz flashing Overvoltage alarm + +Mode-B +====== +- output-low: Battery full +- high-Z Not charging +- 1Hz flashing: Charging +- 4Hz flashing Overvoltage or abnormal alarm + +The control and the mode can be changed from sysfs. + +For AXP20X MFD bindings see: +Documentation/devicetree/bindings/mfd/axp20x.txt + +Required properties: +- compatible : Must be "x-powers,axp20x-led" + +Supported common LED properties, see ./common.txt for more informationn +- label : See Documentation/devicetree/bindings/leds/common.txt +- linux,default-trigger : See Documentation/devicetree/bindings/leds/common.txt +- default-state: See Documentation/devicetree/bindings/leds/common.txt + +Optional properties: +- x-powers,charger-mode: 0 for Mode-A, 1 for Mode-B + If omitted, then the control is set to manual mode. + On invalid value, Mode-A is used. + + +Example: + + axp803: pmic@3a3 { + compatible = "x-powers,axp803"; + + ... + + led@0 { + compatible = "x-powers,axp20x-led"; + status = "okay"; + + label = "axp20x:yellow:chgled"; + linux,default-trigger = "timer"; + default-state = "on"; + }; + }; + +or + + axp803: pmic@3a3 { + compatible = "x-powers,axp803"; + + ... + + led@0 { + compatible = "x-powers,axp20x-led"; + status = "okay"; + + label = "axp20x:yellow:chgled"; + x-powers,charger-mode = <1>; + }; + };