Bipolar analog input samples need to be munged from two's-complement format to the unsigned offset format that comedi expects. Currently this driver uses a bitmap in the private data to determine if the sample being acquired is bipolar. The comedi_async 'cur_chan' is used to test the bit in the bitmap in the ai_read_n() function. The 'cur_chan' is never incremented so all the bit tests are using the first channel in the chanlist. Patch 1 fixes this. Patch 2 removes the bitmap and uses the comedi_is_bipolar() helper to determine if the sample needs to be munged. H Hartley Sweeten (2): staging: comedi: rtd520: fix ai_read_n() async->cur_chan use staging: comedi: rtd520: remove private data 'chan_is_bipolar' member drivers/staging/comedi/drivers/rtd520.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) -- 2.0.3 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel