Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6854666imu; Thu, 31 Jan 2019 00:26:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN7mHka4ePzBhwhRND6FuyS/EYYoOcYeb4orGdi0ku2VhHUrJctbVRDusjIo+iro7aM1eLzP X-Received: by 2002:a63:fc49:: with SMTP id r9mr30004806pgk.209.1548923168630; Thu, 31 Jan 2019 00:26:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548923168; cv=none; d=google.com; s=arc-20160816; b=rGZAQlcidSMHOU3x6jomZouFDlKDLdj1+o0VwXeFDoKbco43+98zV9lwgMVtEQtEqJ w2cBibIIqJUUzYa1/eSaHF9vdCCAHmfzMXGQMGnYiH5ROAIp7VDiIqZHdFBlZtSpwYQj CuJWWtJfDU6g0a+5ykCkC+9HI2KLTp2w+UOkRGznFdgVk8bRC0J1QFBbWOvAotKGoipW FryC5Ti5b3NFVJII//uE59YepWQWQcnxPXaP4Z8+ACBs+LrdN2zge7WRRqe9AJmSKqAj tgyr4+AMgQpFY6YipCD0RPd6JwXYqZhIo+y7SFOKxyHO5JKs/uGbrAlZYCZyQWYFikLJ YE+w== 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=QjQw2yJqPc6FDc6fvqoPdyhnGiF0fHb1MKDoVD9BzV0=; b=R5Sbi4D0KiTVL3dFNm2+SJmPtHYeEoYr9xxdM6UJK5XWfvPqxlxqfDCxamMKzUbFCo taxfONEUA5hb5hUFSdNbNmpo2OooMef4m9Bv5jGSdgartob5v5RlvXjkwYQnYug6JxcT I54/5QDg7npmlphvcqyITodA4XaAXoGjPfg+EPfZ5/W+tUd0fGwwTRbE+xNgrnuhP2mP sbomAnYg8B7AuTYBzRQANnHF5K1LJi/pIh4eXzYvMBdErnOc+64QnGWBTMcnThh/uzbU phinM9DS51MOl83jUSzs0dGbw9LC/fyM8RQ9tj/+j+T4dgy1aUKKQbyp3jG5n2Nct0F6 y+fg== 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 k6si3571014pgr.500.2019.01.31.00.25.53; Thu, 31 Jan 2019 00:26:08 -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 S1731684AbfAaIZg (ORCPT + 99 others); Thu, 31 Jan 2019 03:25:36 -0500 Received: from olimex.com ([184.105.72.32]:51507 "EHLO olimex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725961AbfAaIZf (ORCPT ); Thu, 31 Jan 2019 03:25:35 -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 ; Thu, 31 Jan 2019 00:25:29 -0800 From: Stefan Mavrodiev To: Jacek Anaszewski , Pavel Machek , Rob Herring , Mark Rutland , Chen-Yu Tsai , 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) Cc: Stefan Mavrodiev Subject: [PATCH 3/5] dt-bindings: leds: Add binding for axp20x-led device driver Date: Thu, 31 Jan 2019 10:23:05 +0200 Message-Id: <20190131082308.22522-3-stefan@olimex.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190131082308.22522-1-stefan@olimex.com> References: <20190131082308.22522-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..73fae22ffe29 --- /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 subnode of AXP20X MFD driver, since it uses shared bus with all +other cells. +The LED can be controlled either manually or automatic. 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 leds properties, see ./common.txt for more information: +- label : sets LED label. If omitted, dt device node is used +- linux,default-trigger : See +- default-state: + +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"; + + ... + + axp20x-led { + 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"; + + ... + + axp20x-led { + compatible = "x-powers,axp20x-led"; + status = "okay"; + + label = "axp20x:yellow:chgled"; + x-powers,charger-mode = "mode-b"; + }; + }; -- 2.17.1