Re: [PATCH v3] gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 27, 2020 at 12:08:46PM +0300, Andy Shevchenko wrote:
> On Wed, May 27, 2020 at 07:46:55AM +0200, Linus Walleij wrote:
> > On Tue, May 26, 2020 at 7:12 PM Andy Shevchenko
> > <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > 
> > > +static int pca953x_acpi_get_irq(struct device *dev)
> > > +{
> > > +       int pin, ret;
> > > +
> > > +       pin = pca953x_acpi_find_pin(dev);
> > > +       if (pin < 0)
> > > +               return pin;
> > > +
> > > +       dev_info(dev, "Applying ACPI interrupt quirk (GPIO %d)\n", pin);
> > > +
> > > +       if (!gpio_is_valid(pin))
> > > +               return -EINVAL;
> > > +
> > > +       ret = gpio_request(pin, "pca953x interrupt");
> > > +       if (ret)
> > > +               return ret;
> > 
> > So would it work to do
> > gpiochip_request_own_desc() here in some form?
> 
> It would but it will be wrong. We don't request own pin, we request pin from
> upper GPIO (IRQ) chip.
> 
> > I.e. can you figure out the hardware offset number?
> 
> That's what this quirk basically does, it takes it from ACPI.

Ah, sorry, I meant absolute number. We can, of course, calculate an offset, but
then it will have hard coded number no better than hard coded from ACPI table.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux