[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240122110902.00004357@Huawei.com>
Date: Mon, 22 Jan 2024 11:09:02 +0000
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Ceclan Dumitru <mitrutzceclan@...il.com>
CC: Jonathan Cameron <jic23@...nel.org>, <linus.walleij@...aro.org>,
<brgl@...ev.pl>, <andy@...nel.org>, <linux-gpio@...r.kernel.org>, "Lars-Peter
Clausen" <lars@...afoo.de>, Rob Herring <robh+dt@...nel.org>, "Krzysztof
Kozlowski" <krzysztof.kozlowski+dt@...aro.org>, Conor Dooley
<conor+dt@...nel.org>, Michael Walle <michael@...le.cc>, Andy Shevchenko
<andy.shevchenko@...il.com>, Arnd Bergmann <arnd@...db.de>, ChiaEn Wu
<chiaen_wu@...htek.com>, Niklas Schnelle <schnelle@...ux.ibm.com>, Leonard
Göhrs <l.goehrs@...gutronix.de>, Mike Looijmans
<mike.looijmans@...ic.nl>, Haibo Chen <haibo.chen@....com>, Hugo Villeneuve
<hvilleneuve@...onoff.com>, David Lechner <dlechner@...libre.com>, "Ceclan
Dumitru" <dumitru.ceclan@...log.com>, <linux-iio@...r.kernel.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v12 2/2] iio: adc: ad7173: add AD7173 driver
On Mon, 22 Jan 2024 12:02:35 +0200
Ceclan Dumitru <mitrutzceclan@...il.com> wrote:
> On 1/21/24 17:50, Jonathan Cameron wrote:
> >> + ret = devm_ad_sd_setup_buffer_and_trigger(dev, indio_dev);
> > If the error interrupt is provided either first, or as the only interrupt
> > this is going to use the wrong one.
> >
> > Probably need to have a variant of that which takes an explicit irq so that
> > figuring out which irq is relevant becomes a driver problem rather than the
> > library having a go based on spi->irq.
>
> Would it be acceptable to check if spi->irq interrupt number is equal to
> fwnode_irq_get_byname(dev_fwnode(dev), "rdy")?
That would be a good start and probably cover most cases.
>
> If not, a message could be passed that specifies either that "rdy" is
> needed or that it must be placed first.
If you are mandating the order, that should possibly be reflected in the binding.
If this was hard to fix, I'd be fine with leaving for when someone runs into
a case where they have it ordered the other way around, but given it seems simple
to fix up probably better to just do it and avoid having to remember anything
about it later.
>
>
> Another alternative would be adding irq to ad_sigma_delta_info so a
> driver could specify the desired interrupt to be used for conversions.
>
That works. Make it optional so if value is 0 use spi->irq as before so
that you don't need to modify the other drivers.
Jonathan
Powered by blists - more mailing lists