Re: [PATCH 2/2] iio: adc: New driver for AD7280A Lithium Ion Battery Monitoring System

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

 



>>>>> +
>>>>> +static int ad7280_read_raw(struct iio_dev *dev_info,
>>>>> +                        struct iio_chan_spec const *chan,
>>>>> +                        int *val,
>>>>> +                        int *val2,
>>>>> +                        long m)
>>>>> +{
>>>>> +     struct ad7280_state *st = iio_priv(dev_info);
>>>>> +     unsigned int scale_uv;
>>>>> +     int ret;
>>>>> +
>>>>> +     switch (m) {
>>>>> +     case 0:
>>>>> +             mutex_lock(&dev_info->mlock);
>>>>> +             switch (chan->type) {
>>>>> +             case IIO_IN:
>>>>> +                     ret = ad7280_read_channel(st, chan->address>>   8,
>>>>> +                                               chan->address&   0xFF);
>>>>> +                     break;
>>>>> +             case IIO_IN_DIFF:
>>>>> +                     ret = ad7280_read_all_channels(st, st->scan_cnt, NULL);
>>>> Err... Really need some explanation for what this channel is!
>>> Voltage across all cells.
>> Fair enough. So are the other voltages not differential as well? (across a given
>> cell rather than referred to a base voltage)
>> ...
> Yes technically seen they are all differential.
> 
Any cost in setting them up as such then?

in1-in0
in2-in1 etc
+
inX-in0 for your summed one?

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