Skip to content

Commit

Permalink
mfd: ti_am335x_tscadc: Fix TSC operation after ADC continouous mode
Browse files Browse the repository at this point in the history
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: 7ca6740 ("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>
  • Loading branch information
Vignesh R authored and Lee Jones committed Sep 26, 2014
1 parent a654f81 commit 6ac734d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mfd/ti_am335x_tscadc.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tsadc, u32 val)
unsigned long flags;

spin_lock_irqsave(&tsadc->reg_lock, flags);
tsadc->reg_se_cache = val;
tsadc->reg_se_cache |= val;
if (tsadc->adc_waiting)
wake_up(&tsadc->reg_se_wait);
else if (!tsadc->adc_in_use)
Expand Down Expand Up @@ -96,6 +96,7 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc)
void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val)
{
spin_lock_irq(&tsadc->reg_lock);
tsadc->reg_se_cache |= val;
am335x_tscadc_need_adc(tsadc);

tscadc_writel(tsadc, REG_SE, val);
Expand Down

0 comments on commit 6ac734d

Please sign in to comment.