From: Jonathan Cameron <jic23@jic23.retrosnub.co.uk>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: linux-iio <linux-iio@vger.kernel.org>,
Alexandru Ardelean <aardelean@deviqon.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH v3 3/5] iio: accel: mma9551: Add support to get irqs directly from fwnode
Date: Mon, 6 Dec 2021 19:18:29 +0000 [thread overview]
Message-ID: <20211206191804.443def0b@jic23-huawei> (raw)
In-Reply-To: <CAHp75VfGLaTnV67uNf2_n7203_viC6wmayMNk2+gCHAQ2=tnBw@mail.gmail.com>
On Sun, 5 Dec 2021 22:39:07 +0200
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> On Sun, Dec 5, 2021 at 9:57 PM Jonathan Cameron <jic23@kernel.org> wrote:
> >
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > Note the interrupt type should be specified by firmware, not the driver
> > so that is also dropped.
> >
> > Drop previous gpio based retrieval method. Whilst in theory this
> > might cause problems with direction if anyone is using ACPI GioIo().
>
> GpioIo()
My proofreading fails me again...
>
> > As Andy described in v1, such a situation would typically reflect
> > a pin that is actually used in both directions (not true here)
> > or missdesigned ACPI tables.
>
> ...
>
> > - gpio = devm_gpiod_get_index(dev, NULL, i, GPIOD_IN);
> > - if (IS_ERR(gpio)) {
> > - dev_err(dev, "acpi gpio get index failed\n");
> > - return PTR_ERR(gpio);
> > - }
> > -
> > - ret = gpiod_to_irq(gpio);
> > - if (ret < 0)
>
> > + ret = fwnode_irq_get(dev_fwnode(dev), i);
> > + if (ret)
> > return ret;
>
> I don't remember why we decided that this gonna work, because
> fwnode_irq_get() is not an equivalent to the above, more precisely in
> ACPI case it only covers the GSIs (Global System Interrupts) which in
> such case may or may not be GPIOs. On x86 it's usually direct IOxAPIC
> ones.
This isn't accessed as a GPIO, but I kind of assume someone was using
it with one given this code.
I think I misread what you'd written in reply to v1.
Thanks for the explanation.
>
> So, this conversion would probably make it impossible to use this
> device in the ACPI case.
oops :)
>
> See also this discussion:
> https://lore.kernel.org/lkml/20211109200840.135019-1-puranjay12@gmail.com/T/#u
>
I'd not made the connection that the non named one was also missing most
of the ways it could be specified. Ah well, this will take a little while
to get a test framework in place to poke at it properly. Maybe one for
a bored moment over the festive season.
Jonathan
next prev parent reply other threads:[~2021-12-06 19:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-05 20:02 [PATCH v3 0/5] iio: accel: mma9551/mma9553 Cleanup and update Jonathan Cameron
2021-12-05 20:02 ` [PATCH v3 1/5] iio: accel: mma9551/mma9553: Drop explicit ACPI match support Jonathan Cameron
2021-12-05 20:02 ` [PATCH v3 2/5] iio: accel: mma9551/mma9553: Simplify pm logic Jonathan Cameron
2021-12-05 20:02 ` [PATCH v3 3/5] iio: accel: mma9551: Add support to get irqs directly from fwnode Jonathan Cameron
2021-12-05 20:39 ` Andy Shevchenko
2021-12-06 19:18 ` Jonathan Cameron [this message]
2021-12-05 20:02 ` [PATCH v3 4/5] iio: accel: mma9551: Use devm managed functions to tidy up probe() Jonathan Cameron
2021-12-05 20:02 ` [PATCH v3 5/5] iio: accel: mma9553: " Jonathan Cameron
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=20211206191804.443def0b@jic23-huawei \
--to=jic23@jic23.retrosnub.co.uk \
--cc=Jonathan.Cameron@huawei.com \
--cc=aardelean@deviqon.com \
--cc=andy.shevchenko@gmail.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.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