Re: [PATCH v3 3/5] iio: accel: mma9551: Add support to get irqs directly from fwnode

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

 



On Sun, Dec 5, 2021 at 9:57 PM Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
>
> 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()

> 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.

So, this conversion would probably make it impossible to use this
device in the ACPI case.

See also this discussion:
https://lore.kernel.org/lkml/20211109200840.135019-1-puranjay12@xxxxxxxxx/T/#u

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux