linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Andrew Jeffery" <andrew@aj.id.au>
To: "Pavel Machek" <pavel@ucw.cz>, "Joel Stanley" <joel@jms.id.au>
Cc: "Linus Walleij" <linus.walleij@linaro.org>,
	"Cédric Le Goater" <clg@kaod.org>,
	linux-leds@vger.kernel.org,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	"Linux ARM" <linux-arm-kernel@lists.infradead.org>,
	linux-aspeed <linux-aspeed@lists.ozlabs.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>
Subject: Re: [PATCH 0/2] leds: pca955x: Expose GPIOs for all pins
Date: Thu, 03 Mar 2022 11:00:11 +1030	[thread overview]
Message-ID: <a42db25f-33af-4232-9acd-815f7b116c71@www.fastmail.com> (raw)
In-Reply-To: <20220302085432.GA11054@duo.ucw.cz>



On Wed, 2 Mar 2022, at 19:24, Pavel Machek wrote:
> Hi!
>
>> > > Without these patches the driver limits the number of pins exposed on
>> > > the gpiochip to the number of pins specified as GPIO in the devicetree,
>> > > but doesn't map between the GPIO and pin number spaces. The result is
>> > > that specifying offset or interleaved GPIOs in the devicetree gives
>> > > unexpected behaviour in userspace.
>> > >
>> > > By always exposing all pins as GPIOs the patches resolve the lack of
>> > > mapping between GPIO offsets and pins on the package in the driver by
>> > > ensuring we always have a 1-to-1 mapping.
>> > >
>> > > The issue is primarily addressed by patch 1/2. Patch 2/2 makes it
>> > > possible to not expose any pins as LEDs (and therefore make them all
>> > > accessible as GPIOs). This has a follow-on effect of allowing the driver
>> > > to bind to a device instantiated at runtime without requiring a
>> > > description in the devicetree.
>> > >
>> > > I've tested the series under qemu to inspect the various interactions
>> > > between LEDs vs GPIOs as well as conflicting GPIO requests.
>> 
>> > > Please review!
>> >
>> > This is simpler than the 'ngpio' business we had before.
>> >
>> > Reviewed-by: Cédric Le Goater <clg@kaod.org>
>> 
>> I saw that you recently merged some LED patches. I was wondering if
>> you could consider this series for v5.18. It still applies cleanly,
>> and we've been running it for a while now, so it's very well tested.
>
> Thanks, applied. I must say this is really ninja-mutant driver, but I
> see no better way.
>
> +++ b/drivers/leds/leds-pca955x.c
> @@ -429,7 +429,7 @@ pca955x_get_pdata(struct i2c_client *client, struct 
> pca955x_chipdef *chip)
>         int count;
>
> This really should be unsigned. Care to fix/submit a patch?

I'll send a fix.

Andrew

      reply	other threads:[~2022-03-03  0:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-21  4:39 [PATCH 0/2] leds: pca955x: Expose GPIOs for all pins Andrew Jeffery
2021-09-21  4:39 ` [PATCH 1/2] leds: pca955x: Make the gpiochip always expose " Andrew Jeffery
2021-11-01  2:07   ` Andrew Jeffery
2021-11-09 11:03   ` Linus Walleij
2021-11-16  2:44     ` Joel Stanley
2021-09-21  4:39 ` [PATCH 2/2] leds: pca955x: Allow zero LEDs to be specified Andrew Jeffery
2021-09-21 12:10 ` [PATCH 0/2] leds: pca955x: Expose GPIOs for all pins Andy Shevchenko
2021-09-23 21:48 ` Linus Walleij
2021-09-24  3:49 ` Joel Stanley
     [not found] ` <d2b85ad7-aef7-6088-03f5-cbd6e0bcab5d@kaod.org>
2022-02-21  7:33   ` Joel Stanley
2022-03-02  8:54     ` Pavel Machek
2022-03-03  0:30       ` Andrew Jeffery [this message]

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=a42db25f-33af-4232-9acd-815f7b116c71@www.fastmail.com \
    --to=andrew@aj.id.au \
    --cc=andy.shevchenko@gmail.com \
    --cc=clg@kaod.org \
    --cc=devicetree@vger.kernel.org \
    --cc=joel@jms.id.au \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.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).