Re: [PATCH v4 2/3] iio: adc: ad7191: add AD7191

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

 



> 
> 
> > +
> > +static const struct iio_chan_spec ad7191_channels[] = {
> > +	{
> > +		.type = IIO_TEMP,
> > +		.address = AD7191_CH_TEMP,
> > +		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
> > +				      BIT(IIO_CHAN_INFO_OFFSET),
> > +		.info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ),
> > +		.info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ),  
> 
> Should this one be info_mask_separate?
> 
> Since this is a multiplexed ADC and not simelutaneous sampling, I would expect
> that if the ORD pins are set to 10Hz (0.1s period), then a buffered read with
> all channels enabled would take 0.3s to do the 3 samples (effective sample rate
> of 3.33Hz), but if only one channel was enabled in the buffer, then it only
> takes 0.1s to do all of the samples (effective sample rate is 10Hz).
> 
> The iio convention is to use info_mask_separate for the sampling_frequency
> attribute to indicate that the rate only applies to each individual channel
> and not the combined rate to do one "set" of samples for all enabled channels.
> 
> A sampling_frequency attribute that was shared_by_all would mean that on each
> period equivlent to this rate, all samples are read no matter how many channels
> were enabled for a buffered read.

I think this device channel selection is onehot.  As such only one channel
is ever enabled at a time. See num_slots in ad_sigma_delta
which is set to 1 if not specified. We could argue that maybe one day the
infrastructure will be added to make that code deal with dynamic channel 
changes, settling time and all that mess though so maybe it should be
separate even though it makes no difference today.

Jonathan





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux