All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: Re: [PATCH v3] gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2
Date: Wed, 27 May 2020 12:08:46 +0300	[thread overview]
Message-ID: <20200527090846.GE1634618@smile.fi.intel.com> (raw)
In-Reply-To: <CACRpkdY8yXJUcWBG2ACHPmu4-+h4fY7Fuvbn69sFny2uZNrQmw@mail.gmail.com>

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@linux.intel.com> 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.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2020-05-27  9:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26 17:12 [PATCH v3] gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2 Andy Shevchenko
2020-05-27  5:46 ` Linus Walleij
2020-05-27  9:08   ` Andy Shevchenko [this message]
2020-05-27  9:13     ` Andy Shevchenko
2020-05-27 11:27 ` Mika Westerberg
2020-05-27 13:28   ` Andy Shevchenko

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=20200527090846.GE1634618@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.