Patch v2.
(a) Use iio_priv() for private data rather than allocating data
(b) Support raw and scale inferface for iio consumer
(c) Make inline function for lp8788_adc_read_raw()
(d) For better readability, use fixed number for shift and mask
rather than getting bits from channel scan type
(e) C
On 08/10/2012 08:06 AM, Kim, Milo wrote:
> Patch v2.
> (a) Use iio_priv() for private data rather than allocating data
> (b) Support raw and scale inferface for iio consumer
> (c) Make inline function for lp8788_adc_read_raw()
> (d) For better readability, use fixed number for shift and mask
>
On 08/10/2012 09:06 AM, Kim, Milo wrote:
> [...]
> + switch (mask) {
> + case IIO_CHAN_INFO_RAW:
> + *val = result;
> + return IIO_VAL_INT;
> + case IIO_CHAN_INFO_SCALE:
> + *val = adc_const[id] * ((result * 1000 + 500) / 1000);
This looks wrong. The
> > + switch (mask) {
> > + case IIO_CHAN_INFO_RAW:
> > + *val = result;
> > + return IIO_VAL_INT;
> > + case IIO_CHAN_INFO_SCALE:
> > + *val = adc_const[id] * ((result * 1000 + 500) / 1000);
>
> This looks wrong. The IIO_CHAN_INFO_SCALE attribute is the factor
"Kim, Milo" wrote:
>> > + switch (mask) {
>> > + case IIO_CHAN_INFO_RAW:
>> > + *val = result;
>> > + return IIO_VAL_INT;
>> > + case IIO_CHAN_INFO_SCALE:
>> > + *val = adc_const[id] * ((result * 1000 + 500) / 1000);
>>
>> This looks wrong. The IIO_CHAN_INFO_SCALE
5 matches
Mail list logo