Skip to contentSkip to conversation

mfd: ti_am335x_tscadc: fix TSC resume

PATCH Applied Sebastian Andrzej Siewior 2 participants 2 messages Sep 8, 2014 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: ti_am335x_tscadc: fix TSC resume

In the resume path, the ADC invokes am335x_tsc_se_set_cache() with 0 as the steps argument if continous mode is not in use. This in turn disables all steps and so the TSC is not working until one ADC sampling is performed.

This patch fixes it by writing the current cached mask instead of the passed steps.

Fixes 7ca6740cd1cd ("mfd: input: iio: ti_amm335x: Rework TSC/ADCA

synchronization")

---
 drivers/mfd/ti_am335x_tscadc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/ti_am335x_tscadc.c +1 -1
index e3076afe6b3c..e87a2485468f 100644
@@ -58,7 +58,7 @@ void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tsadc, u32 val)
 	if (tsadc->adc_waiting)
 		wake_up(&tsadc->reg_se_wait);
 	else if (!tsadc->adc_in_use)
-		tscadc_writel(tsadc, REG_SE, val);
+		tscadc_writel(tsadc, REG_SE, tsadc->reg_se_cache);
 
 	spin_unlock_irqrestore(&tsadc->reg_lock, flags);
 }
Signature · 1 line
2.1.0
Applied
#1 lore raw
Quoted 8 lines · Sebastian Andrzej Siewior

In the resume path, the ADC invokes am335x_tsc_se_set_cache() with 0 as the steps argument if continous mode is not in use. This in turn disables all steps and so the TSC is not working until one ADC sampling is performed.

This patch fixes it by writing the current cached mask instead of the passed steps.

Quoted 7 lines
Fixes 7ca6740cd1cd ("mfd: input: iio: ti_amm335x: Rework TSC/ADCA

synchronization")

---
 drivers/mfd/ti_am335x_tscadc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Quoted 13 lines
drivers/mfd/ti_am335x_tscadc.c +1 -1
index e3076afe6b3c..e87a2485468f 100644
@@ -58,7 +58,7 @@ void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tsadc, u32 val)
 	if (tsadc->adc_waiting)
 		wake_up(&tsadc->reg_se_wait);
 	else if (!tsadc->adc_in_use)
-		tscadc_writel(tsadc, REG_SE, val);
+		tscadc_writel(tsadc, REG_SE, tsadc->reg_se_cache);
 
 	spin_unlock_irqrestore(&tsadc->reg_lock, flags);
 }
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog