From: Jan Kardell Date: Thu, 6 Nov 2014 22:18:00 +0000 (+0000) Subject: iio: ti_am335x_adc: Fix: Use same step id at FIFOs both ends X-Git-Tag: upstream/snapshot3+hdmi~2125 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0753fc78d15d62e10cec887a2745166054ee9dc;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git iio: ti_am335x_adc: Fix: Use same step id at FIFOs both ends commit baa3c65298c089a9014b4e523a14ec2885cca1bc upstream. Since AI lines could be selected at will (linux-3.11) the sending and receiving ends of the FIFO does not agree about what step is used for a line. It only works if the last lines are used, like 5,6,7, and fails if ie 2,4,6 is selected in DT. Signed-off-by: Jan Kardell Tested-by: Zubair Lutfullah Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index 31e786e..63b2bb6 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c @@ -375,7 +375,7 @@ static int tiadc_read_raw(struct iio_dev *indio_dev, return -EAGAIN; } } - map_val = chan->channel + TOTAL_CHANNELS; + map_val = adc_dev->channel_step[chan->scan_index]; /* * We check the complete FIFO. We programmed just one entry but in case