linux-stable/drivers/iio
Sebastian Andrzej Siewior 8c896308fe input: ti_am335x_adc: use only FIFO0 and clean up a little
The driver programs a threshold of "coordinate_readouts" say 5. The
REG_FIFO0THR registers says it should it be programmed to "threshold
minus one". The driver does not expect just 5 coordinates but 5 * 2 + 2.
Multiplied by two because 5 for X and 5 for Y and plus 2 because we have
two Z.
The whole thing kind of works because It reads the 5 coordinates for X
and Y from FIFO0 and FIFO1 and the last element in each FIFO is ignored
within the loop and read later.
Nothing guaranties that FIFO1 is ready by the time it is read. In fact I
could see that that FIFO1 reaturns for Y channels 8,9, 10, 12, 6 and for
Y channel 7 for Z. The problem is that channel 7 and channel 12 got
somehow mixed up.
The other Problem is that FIFO1 is also used by the IIO part leading to
wrong results if both (tsc & adc) are used.

The patch tries to clean up the whole thing a little:
- Remove the +1 and -1 in REG_STEPCONFIG, REG_STEPDELAY and its counter
  part in the for loop. This is just confusing.

- Use only FIFO0 in TSC. The fifo has space for 64 entries so should be
  fine.

- Read the whole FIFO in one function and check the channel.

- in case we dawdle around, make sure we only read a multiple of our
  coordinate set. On the second interrupt we will cleanup the remaining
  enties.

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2013-06-12 18:50:22 +02:00
..
accel iio:trigger: Introduce iio_tigger_{set,get}_drvdata 2013-03-25 21:06:09 +00:00
adc input: ti_am335x_adc: use only FIFO0 and clean up a little 2013-06-12 18:50:22 +02:00
amplifiers iio:amplifiers:ad8366 move to info_mask_(shared_by_type/separate) 2013-03-17 19:49:30 +00:00
common iio:common:st: added disable function after read info raw data 2013-05-22 22:14:58 +01:00
dac iio: dac: Fix build error when CONFIG_SPI_MASTER=y && CONFIG_I2C=m 2013-05-22 22:14:58 +01:00
frequency iio:freq:ad9523 move to info_mask_(shared_by_type/separate) 2013-03-17 19:49:34 +00:00
gyro iio:trigger: Introduce iio_tigger_{set,get}_drvdata 2013-03-25 21:06:09 +00:00
imu iio:trigger: Introduce iio_tigger_{set,get}_drvdata 2013-03-25 21:06:09 +00:00
light iio:light:vcnl4000 move to info_mask_(shared_by_type/separate) 2013-03-17 19:49:37 +00:00
magnetometer iio:magnetometer:ak8975 move driver out of staging 2013-04-02 18:36:47 +01:00
buffer_cb.c iio: Update iio_channel_get_all and iio_channel_get_all_cb API 2013-02-02 11:58:46 +00:00
iio_core.h iio: Add OF support 2013-03-16 10:17:59 +00:00
iio_core_trigger.h
industrialio-buffer.c staging:iio: Add support for multiple buffers 2012-11-10 10:17:21 +00:00
industrialio-core.c iio:core drop info_mask from struct iio_info 2013-03-17 19:49:44 +00:00
industrialio-event.c iio: events: Make iio_push_event() IRQ context save 2013-03-17 20:04:45 +00:00
industrialio-trigger.c iio: tweak language in industrialio-trigger comments 2013-02-06 18:40:05 +00:00
industrialio-triggered-buffer.c iio: Add helper function for initializing triggered buffers 2012-06-18 17:26:09 -07:00
inkern.c iio: Add OF support 2013-03-16 10:17:59 +00:00
Kconfig staging:iio: Move adis library out of staging 2012-11-19 22:22:12 +00:00
kfifo_buf.c staging:iio: Remove noop call to __iio_update_buffer 2013-01-31 17:56:44 +00:00
Makefile staging:iio: Move adis library out of staging 2012-11-19 22:22:12 +00:00