Re: [PATCH 23/24] staging:iio:ad799x replaces IIO_ST macro with explicit entries to struct scan_type

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

 



On 12/16/13 08:53, Lars-Peter Clausen wrote:
> On 12/11/2013 07:45 PM, Jonathan Cameron wrote:
>> IIO_ST is going away as it is a pain to maintain. As an i2c driver, multi byte
>> words will be read by the driver in the native cpu endianness.
> 
> Are you sure about this? As far as I understand it the I2C message will be
> read byte by byte. The device sends the MSB first, so I think it should be
> IIO_BE.

Gah. I just spent 5 minutes writing an essay on the fact it was an smbus
word read call, only to realise I was looking at the wrong function and
this is done with a block read.  Doh.  You are quite right!  I'll
switch this one to IIO_BE.


> 
>>
>> Signed-off-by: Jonathan Cameron <jic23@xxxxxxxxxx>
>> ---
>>  drivers/staging/iio/adc/ad799x_core.c | 8 +++++++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/iio/adc/ad799x_core.c b/drivers/staging/iio/adc/ad799x_core.c
>> index 5ea36410f716..45e64d8bf29b 100644
>> --- a/drivers/staging/iio/adc/ad799x_core.c
>> +++ b/drivers/staging/iio/adc/ad799x_core.c
>> @@ -409,7 +409,13 @@ static const struct iio_event_spec ad799x_events[] = {
>>  	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
>>  	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
>>  	.scan_index = (_index), \
>> -	.scan_type = IIO_ST('u', _realbits, 16, 12 - (_realbits)), \
>> +	.scan_type = { \
>> +		.sign = 'u', \
>> +		.realbits = (_realbits), \
>> +		.storagebits = 16, \
>> +		.shift = 12 - (_realbits), \
>> +		.endianness = IIO_CPU, \
>> +		}, \
>>  	.event_spec = _ev_spec, \
>>  	.num_event_specs = _num_ev_spec, \
>>  }
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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