2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-25 21:54:06 +08:00
linux-next/include/linux/mfd
Sebastian Andrzej Siewior 7ca6740cd1 mfd: input: iio: ti_amm335x: Rework TSC/ADC synchronization
The ADC driver always programs all possible ADC values and discards
them except for the value IIO asked for. On the am335x-evm the driver
programs four values and it takes 500us to gather them. Reducing the number
of conversations down to the (required) one also reduces the busy loop down
to 125us.

This leads to another error, namely the FIFOCOUNT register is sometimes
(like one out of 10 attempts) not updated in time leading to EBUSY.
The next read has the FIFOCOUNT register updated.
Checking for the ADCSTAT register for being idle isn't a good choice either.
The problem is that if TSC is used at the same time, the HW completes the
conversation for ADC *and* before the driver noticed it, the HW begins to
perform a TSC conversation and so the driver never seen the HW idle. The
next time we would have two values in the FIFO but since the driver reads
everything we always see the current one.
So instead of polling for the IDLE bit in ADCStatus register, we should
check the FIFOCOUNT register. It should be one instead of zero because we
request one value.

This change in turn leads to another error. Sometimes if TSC & ADC are
used together the TSC starts generating interrupts even if nobody
actually touched the touchscreen. The interrupts seem valid because TSC's
FIFO is filled with values for each channel of the TSC. This condition stops
after a few ADC reads but will occur again. Not good.

On top of this (even without the changes I just mentioned) there is a ADC
& TSC lockup condition which was reported to me by Jeff Lance including the
following test case:
A busy loop of "cat /sys/bus/iio/devices/iio\:device0/in_voltage4_raw"
and a mug on touch screen. With this setup, the hardware will lockup after
something between 20 minutes and it could take up to a couple of hours.
During that lockup, the ADCSTAT register says 0x30 (or 0x70) which means
STEP_ID = IDLE and FSM_BUSY = yes. That means the hardware says that it is
idle and busy at the same time which is an invalid condition.

For all this reasons I decided to rework this TSC/ADC part and add a
handshake / synchronization here:
First the ADC signals that it needs the HW and writes a 0 mask into the
SE register. The HW (if active) will complete the current conversation
and become idle. The TSC driver will gather the values from the FIFO
(woken up by an interrupt) and won't "enable" another conversation.
Instead it will wake up the ADC driver which is already waiting. The ADC
driver will start "its" conversation and once it is done, it will
enable the TSC steps so the TSC will work again.

After this rework I haven't observed the lockup so far. Plus the busy
loop has been reduced from 500us to 125us.

The continues-read mode remains unchanged.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-07 08:45:00 +00:00
..
abx500 For the 3.11 merge we only have one new MFD driver for the Kontron PLD. 2013-07-10 11:10:27 -07:00
arizona mfd: arizona: Correct register definition for FLL2_SYNC_BW 2013-10-23 16:21:09 +01:00
da9052 mfd: da9052: Avoid multiwrite mode due to silicon errata 2013-10-23 16:20:32 +01:00
da9055
da9063 mfd: da9063: Add IRQ support 2013-08-20 03:16:00 +02:00
pcf50633
pm8xxx
samsung rtc: s5m-rtc: add real-time clock driver for s5m8767 2013-11-13 12:09:31 +09:00
syscon PCI changes for the v3.13 merge window: 2013-11-14 14:02:00 +09:00
wm831x
wm8350
wm8994 mfd: wm8994: Remove unused irq_lock 2013-10-23 16:20:41 +01:00
88pm80x.h mfd: 88pm800: Add regulator sub device 2013-06-18 09:41:12 +02:00
88pm860x.h
aat2870.h
ab3100.h
abx500.h ab8500_{bmdata,fg}: Add const attributes to some data arrays 2013-04-16 17:34:36 -07:00
adp5520.h
as3711.h
as3722.h mfd: Add support for ams AS3722 PMIC 2013-10-23 16:22:33 +01:00
asic3.h
core.h For the 3.13 merge window we have a couple of new drivers for the AMS 2013-11-15 16:37:40 -08:00
cros_ec_commands.h mfd: Add ChromeOS EC messages header 2013-04-05 11:20:13 +02:00
cros_ec.h mfd: Add ChromeOS EC implementation 2013-04-05 11:20:13 +02:00
da903x.h
davinci_voicecodec.h mfd: davinci_voicecodec: Provide a regmap for register I/O 2013-09-02 10:27:49 +02:00
db8500-prcmu.h ARM: ux500: move PM-related PRCMU functions to machine 2013-04-08 13:57:53 +02:00
dbx500-prcmu.h mfd: dbx500-prcmu: Move PRCMU numerical clock identifiers into DT include file 2013-09-26 11:04:12 +02:00
ds1wm.h
ezx-pcap.h
htc-egpio.h
htc-pasic3.h
intel_msic.h
janz.h
kempld.h mfd: Kontron PLD mfd driver 2013-06-24 13:48:22 +02:00
lm3533.h
lp8788-isink.h
lp8788.h
lpc_ich.h
max8907.h
max8925.h
max8997-private.h
max8997.h
max8998-private.h mfd: max8998: Add support for Device Tree 2013-06-30 23:30:04 +02:00
max8998.h mfd: max8998: Add support for Device Tree 2013-06-30 23:30:04 +02:00
max77686-private.h
max77686.h
max77693-private.h mfd: max77693: Remove device wakeup from driver 2013-10-23 16:21:26 +01:00
max77693.h mfd: max77693: Remove device wakeup from driver 2013-10-23 16:21:26 +01:00
mc13xxx.h mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function 2013-10-23 16:21:24 +01:00
mc13783.h
mc13892.h
mcp.h mfd: mcp: Add missing linux/device.h header 2013-07-31 02:04:47 +02:00
menelaus.h
palmas.h For the 3.12 merge window we have one new driver for the DA9063 PMIC 2013-09-07 20:14:19 -07:00
rc5t583.h
rdc321x.h
retu.h mfd: retu: Add Tahvo support 2013-04-19 00:45:20 +02:00
rtsx_common.h mfd: rtsx: Copyright modifications 2013-08-20 10:22:01 +02:00
rtsx_pci.h mfd: rtsx: Modify rts5249_optimize_phy 2013-10-23 16:20:59 +01:00
si476x-core.h treewide: Fix common typo in "identify" 2013-10-14 15:31:06 +02:00
si476x-platform.h mfd: si476x: Add header files and Kbuild plumbing 2013-04-19 18:38:13 +02:00
si476x-reports.h mfd: si476x: Add header files and Kbuild plumbing 2013-04-19 18:38:13 +02:00
smsc.h
sta2x11-mfd.h
stmpe.h mfd: support stmpe1801 18 bits enhanced port expander 2013-04-09 14:15:58 +02:00
stw481x.h mfd: Add STw481x driver 2013-10-23 16:21:12 +01:00
syscon.h mfd: syscon: Return -ENOSYS if CONFIG_MFD_SYSCON is not enabled 2013-10-23 16:22:35 +01:00
t7l66xb.h
tc3589x.h
tc6387xb.h
tc6393xb.h
ti_am335x_tscadc.h mfd: input: iio: ti_amm335x: Rework TSC/ADC synchronization 2014-01-07 08:45:00 +00:00
ti_ssp.h
tmio.h Revert "mmc: tmio-mmc: Remove .set_pwr() callback from platform data" 2013-09-06 07:29:05 -04:00
tps6105x.h
tps6507x.h Input: tps6507x-ts - convert to polled input device infrastructure 2013-07-01 11:38:41 -07:00
tps6586x.h
tps65090.h For 3.10 we have a few new MFD drivers for: 2013-05-05 17:36:20 -07:00
tps65217.h regulator: tps65217: Convert to use linear ranges 2013-08-30 15:26:03 +01:00
tps65910.h
tps65912.h
tps80031.h
twl4030-audio.h
twl6040.h Merge branch 'topic/for-asoc' 2013-09-02 10:31:08 +02:00
ucb1x00.h mfd: ucb1x00: Explicitely include linux/device.h 2013-07-31 02:04:52 +02:00
viperboard.h
wl1273-core.h
wm8400-audio.h
wm8400-private.h
wm8400.h