From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Rob Herring <robh@kernel.org>, Stefan Mavrodiev <stefan@olimex.com>
Cc: Pavel Machek <pavel@ucw.cz>, Mark Rutland <mark.rutland@arm.com>,
Chen-Yu Tsai <wens@csie.org>,
Maxime Ripard <maxime.ripard@bootlin.com>,
Lee Jones <lee.jones@linaro.org>,
"open list:LED SUBSYSTEM" <linux-leds@vger.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
"open list:X-POWERS MULTIFUNCTION PMIC DEVICE DRIVERS"
<linux-kernel@vger.kernel.org>,
"moderated list:ARM/Allwinner sunXi SoC support"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 3/8] dt-bindings: leds: Add binding for axp20x-led device driver
Date: Sat, 23 Feb 2019 14:02:32 +0100 [thread overview]
Message-ID: <07d9d8f2-6263-8966-19da-ecaa761b3db9@gmail.com> (raw)
In-Reply-To: <20190222195109.GA17753@bogus>
On 2/22/19 8:51 PM, Rob Herring wrote:
> On Fri, Feb 15, 2019 at 01:50:08PM +0200, Stefan Mavrodiev wrote:
>> This adds the devicetree bindings for charge led indicator found
>> on most of X-Powers AXP20X PMICs.
>>
>> Signed-off-by: Stefan Mavrodiev <stefan@olimex.com>
>> ---
>> .../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 {
>
> What's the 0 for? A unit address without a reg property is not valid.
It was done on my request, but now I see it was an omission.
Since this node describes a LED controller, then it should
be called "led-controller".
>> + compatible = "x-powers,axp20x-led";
>> + status = "okay";
And below part should be in a child node.
Stefan, please compare
Documentation/devicetree/bindings/leds/common.txt and
other LED bindings.
>> + label = "axp20x:yellow:chgled";
Moreover "axp20x:" part should be removed from here added in the driver.
Please refer to drivers/leds/leds-cr0014114.c on how we
do that now.
>> + 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
>>
>
--
Best regards,
Jacek Anaszewski
next prev parent reply other threads:[~2019-02-23 13:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-15 11:50 [PATCH v2 0/8] leds: Add AXP20X CHGLED Stefan Mavrodiev
2019-02-15 11:50 ` [PATCH v2 1/8] leds: Add support for " Stefan Mavrodiev
2019-02-15 14:07 ` Stefan Mavrodiev
2019-02-15 15:57 ` Maxime Ripard
2019-02-15 18:32 ` Pavel Machek
2019-02-19 7:42 ` Stefan Mavrodiev
2019-02-15 11:50 ` [PATCH v2 2/8] mfd: axp20x: Add axp20x-led cell Stefan Mavrodiev
2019-03-25 10:01 ` Lee Jones
2019-02-15 11:50 ` [PATCH v2 3/8] dt-bindings: leds: Add binding for axp20x-led device driver Stefan Mavrodiev
2019-02-22 19:51 ` Rob Herring
2019-02-23 13:02 ` Jacek Anaszewski [this message]
2019-02-15 11:50 ` [PATCH v2 4/8] arm64: dts: allwinner: axp803: add charge led node Stefan Mavrodiev
2019-02-15 11:50 ` [PATCH v2 5/8] arm64: dts: allwinner: Enable AXP803 CHGLED for Olimex boards Stefan Mavrodiev
2019-02-15 18:49 ` Pavel Machek
2019-02-19 7:43 ` Stefan Mavrodiev
2019-02-15 11:50 ` [PATCH v2 6/8] arm: dts: axpxx: add charge led node Stefan Mavrodiev
2019-02-15 11:50 ` [PATCH v2 7/8] ARM: dts: sun7i: Enable AXP209 CHGLED for Olimex boards Stefan Mavrodiev
2019-02-15 11:50 ` [PATCH v2 8/8] ARM: dts: sun8i: a33: Enable AXP223 CHGLED for A33-OLinuXino Stefan Mavrodiev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=07d9d8f2-6263-8966-19da-ecaa761b3db9@gmail.com \
--to=jacek.anaszewski@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maxime.ripard@bootlin.com \
--cc=pavel@ucw.cz \
--cc=robh@kernel.org \
--cc=stefan@olimex.com \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).