Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp874403imj; Fri, 15 Feb 2019 08:12:48 -0800 (PST) X-Google-Smtp-Source: AHgI3IYVnCA0kLLKii9FAb1AclUJKndqrOdEzZeIY2OW3i3GKBiRjGPZ/NltfeqsP821wKcFIMIP X-Received: by 2002:a63:4384:: with SMTP id q126mr6024726pga.160.1550247168741; Fri, 15 Feb 2019 08:12:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550247168; cv=none; d=google.com; s=arc-20160816; b=nq3M9dV5Jd2bp7d/QhBQa8I30bpvVamL5QUDe3piK01KVfI03iuBn0cPQgtDs0ghNs KxyVS6vV7RTpX6iEWaS93N5fARvikDbEvvsK4FArQqMKTu2ezpjwEmKDAjI5RBjrMAlY JhVxZDrDSUxjJXIoLub94YzLaoJpHZWH4Snm4OpJqDo2JxbFfBU8FYhWoPT6LljfBrAj VLyXN3HetC1MdV1pRJefLUhWyoubkUAlTg6Ch8rngSgknTAWKwIUBbTgpemHMxUxhEJM 2S80pWj76h/klSzg/ClVNrbN36tq57zaj6I7cYX0Mci1Qq49hCIjHGRo4DuQz8opXi4Q z5UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=d0X/2SLhkBN6bMSaI0fQ752E9aGOvHk3rpwevbXvvPQ=; b=Io/K+RjmQyzBiLTNq7NwHUVPmwZCe7kPHTwPyChmJtFwOWmGdd8o87qOm8qX0eY6eU Gwv7/o3mP73PhgbL2RlisTLyprPHID3AeG51LXMinAtuqskCEVZsE31sg+AVwBtRy0FR jJLdv5T3BolPYUbcOdCzd4CPKu6yqPapaiW+iAdBsK5aKSnPJAiLuG6LBZU394JZtHHY Dv7Ie7kyzBO3N+psTZjaTBLuE4ufdQsfiHMW2Bxz3hUHSITGcpMujjkvN5UbNAJR6tER PkkEGJ+YqfoE/ksyGbdXM2NS9loxbMqiee76okP0pSKAopMqTBcEt0dc1MuvIX1l2E6M Sicw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b26si769964pgl.539.2019.02.15.08.12.32; Fri, 15 Feb 2019 08:12:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394534AbfBOLu7 (ORCPT + 99 others); Fri, 15 Feb 2019 06:50:59 -0500 Received: from olimex.com ([184.105.72.32]:52088 "EHLO olimex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394523AbfBOLu6 (ORCPT ); Fri, 15 Feb 2019 06:50:58 -0500 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) Cc: Stefan Mavrodiev 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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>; + }; + }; -- 2.17.1