Re: [PATCH] iio: adc: add support for ADC0832 8-bit ADC chips

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

 



2016-02-01 0:18 GMT+09:00 Akinobu Mita <akinobu.mita@xxxxxxxxx>:
>>> +static int adc0831_adc_conversion(struct adc083x *adc)
>>> +{
>>> +     struct spi_device *spi = adc->spi;
>>> +     int ret;
>>> +
>>> +     ret = spi_read(spi, &adc->rx_buf, 2);
>>> +     if (ret)
>>> +             return ret;
>>> +
>>> +     return (adc->rx_buf[0] << 2) | (adc->rx_buf[1] >> 6);
>>> +}

I tested with ADC0831 and found that the last line should be:

        /*
         * Skip TRI-STATE and a leading zero
         */
        return (adc->rx_buf[0] << 2 & 0xff) | (adc->rx_buf[1] >> 6);
--
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