iio: adc: ad7380: fix SPI offload trigger rate#2982
iio: adc: ad7380: fix SPI offload trigger rate#2982machschmitt merged 1 commit intoanalogdevicesinc:mainfrom
Conversation
Add a special case to double the SPI offload trigger rate when all channels of a single-ended chip are enabled in a buffered read. The single-ended chips in the AD738x family can only do simultaneous sampling of half their channels and have a multiplexer to allow reading the other half. To comply with the IIO definition of sampling_frequency, we need to trigger twice as often when the sequencer is enabled to so that both banks can be read in a single sample period. Fixes: bbeaec8 ("iio: ad7380: add support for SPI offload") Signed-off-by: David Lechner <dlechner@baylibre.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> (cherry picked from commit 6327573)
machschmitt
left a comment
There was a problem hiding this comment.
I think the rationale for this patch is correct.
Though, shouldn't we also call spi_offload_trigger_validate() to allow the underlying trigger source to be adjusted (e.g. PWM period update)?
I see this has been accepted for the upstream kernel so, even if the fix needs a fix, I see no reason to diverge from IIO tree in this case.
|
That is a thoughtful question to ask. 😄 I considered that, but in this function, we call Calling |
Ah, makes sense.
Yeah, it will apply the PWM waveform anyway on |
This is backporting a fix that was just accepted upstream.
PR Description
Add a special case to double the SPI offload trigger rate when all channels of a single-ended chip are enabled in a buffered read.
The single-ended chips in the AD738x family can only do simultaneous sampling of half their channels and have a multiplexer to allow reading the other half. To comply with the IIO definition of sampling_frequency, we need to trigger twice as often when the sequencer is enabled to so that both banks can be read in a single sample period.
Fixes: bbeaec8 ("iio: ad7380: add support for SPI offload")
Cc: Stable@vger.kernel.org
(cherry picked from commit 6327573)
PR Type
PR Checklist