linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Andrew Jeffery" <andrew@aj.id.au>
To: "Andy Shevchenko" <andy.shevchenko@gmail.com>
Cc: "linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Joel Stanley" <joel@jms.id.au>, "Pavel Machek" <pavel@ucw.cz>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-aspeed@lists.ozlabs.org" <linux-aspeed@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 0/6] leds: Fix pca955x GPIO pin mappings
Date: Wed, 28 Jul 2021 15:13:24 +0930	[thread overview]
Message-ID: <d019990e-a725-4ef5-bb54-aadee9d18b86@www.fastmail.com> (raw)
In-Reply-To: <CAHp75VeQML7njMZ6x8kC-ZJVexC1xJ6n1cB3JneVMAVfuOJgWw@mail.gmail.com>



On Fri, 23 Jul 2021, at 17:45, Andy Shevchenko wrote:
> 
> 
> On Friday, July 23, 2021, Andrew Jeffery <andrew@aj.id.au> wrote:
> > Hello,
> > 
> > This series does a bunch of crimes, so it's an RFC. I'm cross-posting to the
> > pinctrl/GPIO and LEDs lists because the PCA955x devices impact all of them. What
> > needs fixing is the leds-pca955x driver's failure to map the GPIO numberspace to
> > the pin numberspace of the PCA955x devices. The series solves that by
> > implementing pinctrl and pinmux in the leds-pca955x driver.
> > 
> > Things I'm unsure about:
> > 
> > 1. Patch 1: The pinctrl_gpio_as_pin() API feels a bit dirty, not sure what
> >    others thoughts are on that (Linus?).
> > 
> > 2. Patch 2: I've added a new callback to hook the entirety of the pinctrl map
> >    parsing rather than supplying a subnode-specific callback. This was necessary
> >    to handle the PCA955x devicetree binding in a backwards compatible way.
> > 
> > 3. Patch 4: The PCA955x devices don't actually have any pinmux hardware, but the
> >    properties of the pinctrl/pinmux subsystems in the kernel map nicely onto the
> >    problem we have. But it's quite a bit of code...
> > 
> > 4. Patch 6: I also lost a bunch of time to overlooking the get_group_pins()
> >    callback for pinctrl, and it seems odd to me that it isn't required.
> > 
> > Please review!
> 
> 
> Sounds like a hack.

Yes, possibly. Feedback like this is why I sent the series as an RFC.

> I was briefly looking into patches 1-4 and suddenly 
> realized that the fix can be similar as in PCA9685 (PWM), I.e. we 
> always have chips for the entire pin space and one may map them 
> accordingly, requested in one realm (LED) in the other (GPIO) 
> automatically is BUSY. Or I missed the point?

No, you haven't missed the point. I will look at the PCA9685 driver.

That said, my goal was to implement the behaviour intended by the 
existing binding (i.e. fix a bug). However, userspace would never have 
got the results it expected with the existing driver implementation, so 
I guess you could argue that no such (useful) userspace exists. Given 
that, we could adopt the strategy of always defining a gpiochip 
covering the whole pin space, and parts of the devicetree binding just 
become redundant.

Andrew

  parent reply	other threads:[~2021-07-28  5:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23  7:58 [RFC PATCH 0/6] leds: Fix pca955x GPIO pin mappings Andrew Jeffery
2021-07-23  7:58 ` [RFC PATCH 1/6] pinctrl: Add pinctrl_gpio_as_pin() Andrew Jeffery
2021-08-10 13:34   ` Linus Walleij
2021-08-11  0:24     ` Andrew Jeffery
2021-07-23  7:58 ` [RFC PATCH 2/6] pinctrl: Add hook for device-specific map parsing Andrew Jeffery
2021-07-23  7:58 ` [RFC PATCH 3/6] leds: pca955x: Relocate chipdef-related descriptors Andrew Jeffery
2021-07-23  7:58 ` [RFC PATCH 4/6] leds: pca955x: Use pinctrl to map GPIOs to pins Andrew Jeffery
2021-08-10 13:54   ` Linus Walleij
2021-08-11  0:19     ` Andrew Jeffery
2021-07-23  7:58 ` [RFC PATCH 5/6] ARM: dts: rainier: Add presence-detect and fault indictor GPIO expander Andrew Jeffery
2021-07-23  7:58 ` [RFC PATCH 6/6] pinctrl: Check get_group_pins callback on init Andrew Jeffery
     [not found] ` <CAHp75VeQML7njMZ6x8kC-ZJVexC1xJ6n1cB3JneVMAVfuOJgWw@mail.gmail.com>
2021-07-28  5:43   ` Andrew Jeffery [this message]
2021-07-28  9:13     ` [RFC PATCH 0/6] leds: Fix pca955x GPIO pin mappings Andy Shevchenko
2021-07-29  0:38       ` Andrew Jeffery
2021-07-29  7:40         ` Andy Shevchenko
2021-08-03  4:07           ` Andrew Jeffery
2021-08-03 10:33             ` Andy Shevchenko
2021-08-04  4:55               ` Andrew Jeffery

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=d019990e-a725-4ef5-bb54-aadee9d18b86@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).