aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/ti_am335x_tscadc.c
diff options
context:
space:
mode:
authorVignesh R <vigneshr@ti.com>2014-09-01 02:31:06 -0400
committerLee Jones <lee.jones@linaro.org>2014-09-26 03:15:50 -0400
commit6ac734d2242949f41eb1346ca0fd4ed010c937aa (patch)
tree36f4d04a4bd6479a2310d8cc87d17888353993ec /drivers/mfd/ti_am335x_tscadc.c
parenta654f81640caa0bb648b0e45b792ba846c9bb02d (diff)
mfd: ti_am335x_tscadc: Fix TSC operation after ADC continouous mode
After enabling and disabling ADC continuous mode via sysfs, ts_print_raw fails to return any data. This is because when ADC is configured for continuous mode, it disables touch screen steps.These steps are not re-enabled when ADC continuous mode is disabled. Therefore existing values of REG_SE needs to be cached before enabling continuous mode and disabling touch screen steps and enabling ADC steps. The cached value are to be restored to REG_SE once ADC is disabled. Fixes: 7ca6740cd1cd ("mfd: input: iio: ti_amm335x: Rework TSC/ADC synchronization") Cc: stable@vger.kernel.org # v3.13+ Signed-off-by: Vignesh R <vigneshr@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/ti_am335x_tscadc.c')
-rw-r--r--drivers/mfd/ti_am335x_tscadc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
index dd4bf5816221..8b119ce20b93 100644
--- a/drivers/mfd/ti_am335x_tscadc.c
+++ b/drivers/mfd/ti_am335x_tscadc.c
@@ -53,7 +53,7 @@ void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tsadc, u32 val)
53 unsigned long flags; 53 unsigned long flags;
54 54
55 spin_lock_irqsave(&tsadc->reg_lock, flags); 55 spin_lock_irqsave(&tsadc->reg_lock, flags);
56 tsadc->reg_se_cache = val; 56 tsadc->reg_se_cache |= val;
57 if (tsadc->adc_waiting) 57 if (tsadc->adc_waiting)
58 wake_up(&tsadc->reg_se_wait); 58 wake_up(&tsadc->reg_se_wait);
59 else if (!tsadc->adc_in_use) 59 else if (!tsadc->adc_in_use)
@@ -96,6 +96,7 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc)
96void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val) 96void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val)
97{ 97{
98 spin_lock_irq(&tsadc->reg_lock); 98 spin_lock_irq(&tsadc->reg_lock);
99 tsadc->reg_se_cache |= val;
99 am335x_tscadc_need_adc(tsadc); 100 am335x_tscadc_need_adc(tsadc);
100 101
101 tscadc_writel(tsadc, REG_SE, val); 102 tscadc_writel(tsadc, REG_SE, val);