public inbox for linux-arm-msm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Shawn Guo <shawn.guo@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Jeffrey Hugo <jhugo@codeaurora.org>,
	linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] gpiolib: acpi: support override broken GPIO number in ACPI table
Date: Fri, 5 Mar 2021 12:10:20 +0200	[thread overview]
Message-ID: <YEIDjF7B/1gEyuUe@smile.fi.intel.com> (raw)
In-Reply-To: <YEIDNJXlmBbVtLa3@smile.fi.intel.com>

On Fri, Mar 05, 2021 at 12:08:52PM +0200, Andy Shevchenko wrote:
> On Fri, Mar 05, 2021 at 10:10:50AM +0100, Hans de Goede wrote:
> > On 3/5/21 2:14 AM, Shawn Guo wrote:
> > > On Thu, Mar 04, 2021 at 08:32:14PM +0100, Hans de Goede wrote:
> > >> On 3/3/21 10:47 AM, Andy Shevchenko wrote:
> 
> ...
> 
> > > So we reach a consensus that this is not the right solution for Lenovo
> > > Flex 5G. But what about for Andy's Galileo Gen 2 case, where the GPIO
> > > number in ACPI is truly broken?
> > 
> > Well if the ACPI table truely simply has a wrong number in it, like in
> > this case, then we clearly need a workaround.
> > 
> > >   ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2")
> > 
> > And we have one in place, so I'm not sure what the question is?
> > 
> > I guess the question is of your generic GPIO renumber patch would not
> > be a better answer to that ?
> > 
> > IMHO no, we want to keep quirks out of the core as much as possible,
> > for example the code which Andy added a quirk to is build as a module
> > in the generic Fedora distro kernel, so for most users the code will
> > not be loaded into memory. Where as if we add it to the core it would
> > use up extra memory for everyone.
> 
> I guess Shawn is referring to my rework of that quirk [1] due to found a flaw
> in the upstreamed variant. I agree, that this is not ideal, but TL;DR: it less
> invasive even to the upstreamed approach and it has no use of any hard coded
> numbering schemes. The Galileo Gen 2 is "broken" in an *understandable* way,
> i.e. ACPI designers put an absolute GPIO numbers (there are two SoC based GPIO
> controllers: SCH and DesignWare which numbers starts at 0) instead of be

"...at 0 and 8 respectively)"

> relative. For the time being only one device has a driver that needs such GPIO
> number, but as I explained in the cover letter, to support it as a quirk I have
> to copy ~10% of the existing (in gpiolib-acpi.c) code.
> 
> I'm all ears for better approach!
> 
> [1]: https://lore.kernel.org/linux-gpio/20210225163320.71267-1-andriy.shevchenko@linux.intel.com/T/#u
> 
> > Also if, in the future, we were to ever add a generic GPIO renumber quirk
> > mechanism to the core, then your code would need more work. Because to be
> > truely generic it would need to remap one gpiochip-name:pin-number on
> > another gpiochip-name:pin-number pair. There might very well be a case
> > with multiple gpiochips with pin number 32 being referenced in the DSDT
> > and where we need to remap one of those 32-s to a different number
> > (or possibly even to a different chip + number).
> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
> 

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2021-03-05 10:13 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-26  3:39 [PATCH] gpiolib: acpi: support override broken GPIO number in ACPI table Shawn Guo
2021-02-26  9:12 ` Andy Shevchenko
2021-02-26  9:39   ` Shawn Guo
2021-02-26 10:57     ` Andy Shevchenko
2021-02-26 11:19       ` Andy Shevchenko
2021-02-27  3:19         ` Shawn Guo
2021-03-01 12:17           ` Andy Shevchenko
2021-03-02  0:27             ` Shawn Guo
2021-03-02 12:21               ` Andy Shevchenko
2021-03-03  5:02                 ` Jeffrey Hugo
2021-03-03  8:06                   ` Andy Shevchenko
2021-03-03  8:45                     ` Shawn Guo
2021-03-03  9:42                       ` Andy Shevchenko
2021-03-03 17:08                     ` Jeffrey Hugo
2021-03-03  9:43                   ` Shawn Guo
2021-03-03 15:10                     ` Jeffrey Hugo
2021-03-03 15:57                       ` Bjorn Andersson
2021-03-03 17:32                         ` Andy Shevchenko
2021-03-04  6:37                         ` Shawn Guo
2021-03-04  6:59                           ` Shawn Guo
2021-02-27  3:46       ` Shawn Guo
2021-03-01 12:19         ` Andy Shevchenko
2021-03-02  0:44           ` Shawn Guo
2021-03-02 10:36             ` Andy Shevchenko
2021-03-03  9:47 ` Andy Shevchenko
2021-03-04 19:32   ` Hans de Goede
2021-03-04 20:16     ` Andy Shevchenko
2021-03-05  1:14     ` Shawn Guo
2021-03-05  9:10       ` Hans de Goede
2021-03-05 10:08         ` Andy Shevchenko
2021-03-05 10:10           ` Andy Shevchenko [this message]
2021-03-05 11:26         ` Shawn Guo
2021-03-05 12:12           ` Hans de Goede

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=YEIDjF7B/1gEyuUe@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=hdegoede@redhat.com \
    --cc=jhugo@codeaurora.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=shawn.guo@linaro.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