Re: [PATCH 03/16] staging:iio:adc:ad799x fix incorrect setting of configuration register on single channel read.

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

 



On 09/26/11 08:24, Hennerich, Michael wrote:
> Jonathan Cameron wrote on 2011-09-23:
>> It is a bit mask whereas current code treats it as a straight value.
> 
> That's a NAK.
> See MODE 2 - COMMAND MODE: Table 26. Address Pointer Byte.
> 
> On the AD7998 and AD7997 the channel is a straight value and not a mask.
Ah, my mistake, I thought we were using the configuration register to setup
the scan. Didn't notice you could tell the chip to ignore that and do a read
of a single channel.

Obviously, will drop this one.
> 
>>
>> Signed-off-by: Jonathan Cameron <jic23@xxxxxxxxx>
>> ---
>>  drivers/staging/iio/adc/ad799x_core.c |    3 ++-
>>  1 files changed, 2 insertions(+), 1 deletions(-)
>> diff --git a/drivers/staging/iio/adc/ad799x_core.c
>> b/drivers/staging/iio/adc/ad799x_core.c index 975a3f7..3b5f8be 100644
>> --- a/drivers/staging/iio/adc/ad799x_core.c +++
>> b/drivers/staging/iio/adc/ad799x_core.c @@ -123,7 +123,8 @@ static int
>> ad799x_scan_direct(struct ad799x_state *st, unsigned ch)
>>               break;
>>       case ad7997:
>>       case ad7998:
>> -             cmd = (ch << AD799X_CHANNEL_SHIFT) | AD7997_8_READ_SINGLE;
>> +             cmd = ((1 << ch) << AD799X_CHANNEL_SHIFT) |
>> +                     AD7997_8_READ_SINGLE;
>>               break;
>>       default:
>>               return -EINVAL;
> 
> Greetings,
> Michael
> 
> --
> Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
> Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
> Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret Seif
> 
> 
> 

--
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