Skip to content

Commit f87b076

Browse files
dumitruceclanjic23
authored andcommitted
iio: adc: ad7173: document sampling frequency behaviour
The ADCs supported by this driver feature a sequencer that read in a loop all the enabled chanels. When setting the individual sampling frequency for each channel and enabling multiple channels, the effective of each channel will be lower than the actual set value. Document this behaviour in a comment. Reviewed-by: Nuno Sa <nuno.sa@analog.com> Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20240607-ad4111-v7-8-97e3855900a0@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 0f360d4 commit f87b076

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

drivers/iio/adc/ad7173.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,21 @@ static int ad7173_write_raw(struct iio_dev *indio_dev,
732732
return ret;
733733

734734
switch (info) {
735+
/*
736+
* This attribute sets the sampling frequency for each channel individually.
737+
* There are no issues for raw or buffered reads of an individual channel.
738+
*
739+
* When multiple channels are enabled in buffered mode, the effective
740+
* sampling rate of a channel is lowered in correlation to the number
741+
* of channels enabled and the sampling rate of the other channels.
742+
*
743+
* Example: 3 channels enabled with rates CH1:6211sps CH2,CH3:10sps
744+
* While the reading of CH1 takes only 0.16ms, the reading of CH2 and CH3
745+
* will take 100ms each.
746+
*
747+
* This will cause the reading of CH1 to be actually done once every
748+
* 200.16ms, an effective rate of 4.99sps.
749+
*/
735750
case IIO_CHAN_INFO_SAMP_FREQ:
736751
freq = val * MILLI + val2 / MILLI;
737752
for (i = st->info->odr_start_value; i < st->info->num_sinc5_data_rates - 1; i++)

0 commit comments

Comments
 (0)