From: "Duje Mihanović" <duje.mihanovic@skole.hr>
To: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Lee Jones <lee@kernel.org>, Jingoo Han <jingoohan1@gmail.com>,
Pavel Machek <pavel@ucw.cz>, Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>, Helge Deller <deller@gmx.de>,
Linus Walleij <linus.walleij@linaro.org>,
Karel Balej <balejk@matfyz.cz>,
~postmarketos/upstreaming@lists.sr.ht,
phone-devel@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH v3 1/3] leds: ktd2692: move ExpressWire code to library
Date: Mon, 22 Jan 2024 17:24:51 +0100 [thread overview]
Message-ID: <5907190.MhkbZ0Pkbq@radijator> (raw)
In-Reply-To: <20240122101926.GA8596@aspen.lan>
On Monday, January 22, 2024 11:19:26 AM CET Daniel Thompson wrote:
> On Sat, Jan 20, 2024 at 10:26:43PM +0100, Duje Mihanović wrote:
> > diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> > index 6292fddcc55c..d29b6823e7d1 100644
> > --- a/drivers/leds/Kconfig
> > +++ b/drivers/leds/Kconfig
> > @@ -181,6 +181,9 @@ config LEDS_EL15203000
> >
> > To compile this driver as a module, choose M here: the module
> > will be called leds-el15203000.
> >
> > +config LEDS_EXPRESSWIRE
> > + bool
> > +
>
> Shouldn't there be a "select GPIOLIB" here? It seems odd to make the
> clients responsible for the dependencies.
>
> BTW there seems to be very little consistency across the kernel between
> "depends on GPIOLIB" and "select GPIOLIB".. but select is marginally
> more popular (283 vs. 219 in the kernel I checked).
I believe a "select" would be more appropriate here unless these backlights
should be hidden if GPIOLIB is disabled. The catch with "select" is that there
seems to be no way to throw in the "|| COMPILE_TEST" other GPIO-based
backlights have and I'm not sure what to do about that.
> > diff --git a/drivers/leds/flash/leds-ktd2692.c
> > b/drivers/leds/flash/leds-ktd2692.c index 598eee5daa52..8c17de3d621f
100644
> > --- a/drivers/leds/flash/leds-ktd2692.c
> > +++ b/drivers/leds/flash/leds-ktd2692.c
> >
> > <snip>
> > static void ktd2692_expresswire_write(struct ktd2692_context *led, u8
> > value)
> > {
> >
> > int i;
> >
> > - ktd2692_expresswire_start(led);
> > + expresswire_start(&led->props);
> >
> > for (i = 7; i >= 0; i--)
> >
> > - ktd2692_expresswire_set_bit(led, value & BIT(i));
> > - ktd2692_expresswire_end(led);
> > + expresswire_set_bit(&led->props, value & BIT(i));
> > + expresswire_end(&led->props);
> >
> > }
>
> Is there any reason not to have an expresswire_write_u8() method in the
> library code? It is a concept that appears in both drivers.
Not really, I'll add it in v4.
Regards,
--
Duje
next prev parent reply other threads:[~2024-01-22 16:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-20 21:26 [PATCH v3 0/3] Kinetic ExpressWire library and KTD2801 backlight driver Duje Mihanović
2024-01-20 21:26 ` [PATCH v3 1/3] leds: ktd2692: move ExpressWire code to library Duje Mihanović
2024-01-21 14:35 ` Linus Walleij
2024-01-21 15:06 ` Duje Mihanović
2024-01-22 10:19 ` Daniel Thompson
2024-01-22 16:24 ` Duje Mihanović [this message]
2024-01-22 16:50 ` Daniel Thompson
2024-01-22 16:57 ` Duje Mihanović
2024-01-22 17:26 ` Duje Mihanović
2024-01-22 17:50 ` Daniel Thompson
2024-01-22 18:13 ` Duje Mihanović
2024-01-20 21:26 ` [PATCH v3 2/3] dt-bindings: backlight: add Kinetic KTD2801 binding Duje Mihanović
2024-01-20 21:26 ` [PATCH v3 3/3] backlight: Add Kinetic KTD2801 backlight support Duje Mihanović
2024-01-21 14:37 ` Linus Walleij
2024-01-22 10:28 ` Daniel Thompson
2024-01-22 16:24 ` Duje Mihanović
2024-01-22 16:51 ` Daniel Thompson
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=5907190.MhkbZ0Pkbq@radijator \
--to=duje.mihanovic@skole.hr \
--cc=balejk@matfyz.cz \
--cc=conor+dt@kernel.org \
--cc=daniel.thompson@linaro.org \
--cc=deller@gmx.de \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jingoohan1@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lee@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=phone-devel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/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).