linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Naresh Solanki <naresh.solanki@9elements.com>
Cc: Pavel Machek <pavel@ucw.cz>,
	Patrick Rudolph <patrick.rudolph@9elements.com>,
	linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org
Subject: Re: [PATCH v5] leds: max597x: Add support for max597x
Date: Fri, 21 Apr 2023 08:19:21 +0100	[thread overview]
Message-ID: <20230421071921.GI996918@google.com> (raw)
In-Reply-To: <40b72025-16a8-1af5-d69f-659d37cdeab9@9elements.com>

On Thu, 20 Apr 2023, Naresh Solanki wrote:

> Hi Lee,
> 
> On 20-04-2023 07:24 pm, Lee Jones wrote:
> > On Thu, 20 Apr 2023, Naresh Solanki wrote:
> > 
> > > Hi Lee,
> > > 
> > > On 20-04-2023 05:20 pm, Lee Jones wrote:
> > > > On Mon, 17 Apr 2023, Naresh Solanki wrote:
> > > > 
> > > > > From: Patrick Rudolph <patrick.rudolph@9elements.com>
> > > > > 
> > > > > max597x is hot swap controller with indicator LED support.
> > > > > This driver uses DT property to configure led during boot time &
> > > > > also provide the LED control in sysfs.
> > > > > 
> > > > > DTS example:
> > > > >       i2c {
> > > > >           #address-cells = <1>;
> > > > >           #size-cells = <0>;
> > > > >           regulator@3a {
> > > > >               compatible = "maxim,max5978";
> > > > >               reg = <0x3a>;
> > > > >               vss1-supply = <&p3v3>;
> > > > > 
> > > > >               regulators {
> > > > >                   sw0_ref_0: sw0 {
> > > > >                       shunt-resistor-micro-ohms = <12000>;
> > > > >                   };
> > > > >               };
> > > > > 
> > > > >               leds {
> > > > >                   #address-cells = <1>;
> > > > >                   #size-cells = <0>;
> > > > >                   led@0 {
> > > > >                       reg = <0>;
> > > > >                       label = "ssd0:green";
> > > > >                       default-state = "on";
> > > > >                   };
> > > > >                   led@1 {
> > > > >                       reg = <1>;
> > > > >                       label = "ssd1:green";
> > > > >                       default-state = "on";
> > > > >                   };
> > > > >               };
> > > > >           };
> > > > >       };
> > > > 
> > > > Where is the DT binding document for this?
> https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git/tree/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml?h=for-mfd-next

You need to update it.  It is different to the one you supplied here.

> > > > > Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
> > > > > Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com>
> > > > > ...
> > > > > Changes in V5:
> > > > > - Update commit message
> > > > > - Fix comments
> > > > > - Add necessary new line
> > > > > Changes in V4:
> > > > > - Remove unwanted preinitialise
> > > > > - Remove unneeded line breaks
> > > > > - Fix variable name to avoid confusion
> > > > > - Update module description to mention LED driver.
> > > > > Changes in V3:
> > > > > - Remove of_node_put as its handled by for loop
> > > > > - Print error if an LED fails to register.
> > > > > - Update driver name in Kconfig description
> > > > > - Remove unneeded variable assignment
> > > > > - Use devm_led_classdev_register to reget led
> > > > > Changes in V2:
> > > > > - Fix regmap update
> > > > > - Remove devm_kfree
> > > > > - Remove default-state
> > > > > - Add example dts in commit message
> > > > > - Fix whitespace in Kconfig
> > > > > - Fix comment
> > > > > ---
> > > > >    drivers/leds/Kconfig        |  11 ++++
> > > > >    drivers/leds/Makefile       |   1 +
> > > > >    drivers/leds/leds-max597x.c | 115 ++++++++++++++++++++++++++++++++++++
> > > > >    3 files changed, 127 insertions(+)
> > > > >    create mode 100644 drivers/leds/leds-max597x.c

[...]

> > > > +	led_node = of_get_child_by_name(np, "leds");
> > > > > +	if (!led_node)
> > > > > +		return -ENODEV;
> > 
> > It's odd for a device to be referring to itself as the "child".
> As this is leaf driver, LED specific info is present in "leds" node in DT.

I'm aware of the architecture.

If you give the LEDs driver it's own compatible you don't need to keep
doing this self->parent->child level-jumping craziness to obtain
resources.

-- 
Lee Jones [李琼斯]

  reply	other threads:[~2023-04-21  7:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-17  9:40 [PATCH v5] leds: max597x: Add support for max597x Naresh Solanki
2023-04-20 11:50 ` Lee Jones
2023-04-20 12:19   ` Naresh Solanki
2023-04-20 13:54     ` Lee Jones
2023-04-20 17:20       ` Naresh Solanki
2023-04-21  7:19         ` Lee Jones [this message]
2023-04-24  9:40           ` Naresh Solanki
2023-04-26  9:21             ` Naresh Solanki

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=20230421071921.GI996918@google.com \
    --to=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=naresh.solanki@9elements.com \
    --cc=patrick.rudolph@9elements.com \
    --cc=pavel@ucw.cz \
    /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).