Re: [PATCH v12 2/2] iio: adc: ad7173: add AD7173 driver

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

 



On Mon, 22 Jan 2024 12:02:35 +0200
Ceclan Dumitru <mitrutzceclan@xxxxxxxxx> 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






[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