Re: [PATCH 3/4] iio: accel: bmc150: Make it possible to configure INT2 instead of INT1

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

 



On Mon, Jul 19, 2021 at 6:11 PM Stephan Gerhold <stephan@xxxxxxxxxxx> wrote:
> On Mon, Jul 19, 2021 at 06:01:01PM +0300, Andy Shevchenko wrote:
> > On Mon, Jul 19, 2021 at 5:07 PM Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
> > > On Mon, Jul 19, 2021 at 1:26 PM Stephan Gerhold <stephan@xxxxxxxxxxx> wrote:

...

> > > >  #include <linux/acpi.h>
> > > > +#include <linux/of_irq.h>
> > > (...)
> > > > +       irq_info = bmc150_accel_interrupts_int1;
> > > > +       if (irq == of_irq_get_byname(dev->of_node, "INT2"))
> > > > +               irq_info = bmc150_accel_interrupts_int2;
> > >
> > > This looks a bit DT-specific, but I don't see that ACPI has
> > > named IRQs so I don't know what to do about it either.
> >
> > Yeah, we only have so far the (de facto) established way of naming
> > GPIO based IRQs, and not IOxAPIC ones.
> >
> > > What does platform_get_irq_byname() do on ACPI systems?
> >
> > See above.
> >
> > > If there is no obvious fix I would leave it like this until the
> > > first ACPI used needing this comes along, but I think maybe
> > > Andy has suggestions.
> >
> > The platform_get_irq_byname() should do something similar that has
> > been done in platform_get_irq() WRT ACPI.
> > Here for sure the platform_get_irq_byname() or its optional variant
> > should be used.
>
> I don't think there is a platform device here, we only have the
> i2c_client or spi_device. That's why I didn't use
> platform_get_irq_byname(). :)
>
> Is there something equivalent for I2C/SPI drivers?

Not yet. You probably need to supply some code there to allow
multi-IRQ devices (in resource provider agnostic way).

You need to provide fwnode_get_irq_byname() to be similar with
https://elixir.bootlin.com/linux/latest/source/drivers/base/property.c#L1010

Then use it in the drivers.

And/or integrate into frameworks somehow (something in between the
lines: https://elixir.bootlin.com/linux/latest/source/drivers/i2c/i2c-core-base.c#L461).

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux