MFD: ti_tscadc: Disable TSC config registers in adc mode
AFE Pen Ctrl and TouchScreen transistors enabling is not required when only ADC mode is being used, so check for availability of TSC driver before accessing control register. Signed-off-by: Patil, Rachna <rachna@ti.com> Acked-by: Vaibhav Hiremath <hvaibhav@ti.com> Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Родитель
efe3126afc
Коммит
b5f8b7632c
|
@ -204,12 +204,13 @@ static int ti_tscadc_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
/* Set the control register bits */
|
/* Set the control register bits */
|
||||||
ctrl = CNTRLREG_STEPCONFIGWRT |
|
ctrl = CNTRLREG_STEPCONFIGWRT |
|
||||||
CNTRLREG_TSCENB |
|
CNTRLREG_STEPID;
|
||||||
CNTRLREG_STEPID |
|
if (tsc_wires > 0)
|
||||||
CNTRLREG_4WIRE;
|
ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB;
|
||||||
tscadc_writel(tscadc, REG_CTRL, ctrl);
|
tscadc_writel(tscadc, REG_CTRL, ctrl);
|
||||||
|
|
||||||
/* Set register bits for Idle Config Mode */
|
/* Set register bits for Idle Config Mode */
|
||||||
|
if (tsc_wires > 0)
|
||||||
tscadc_idle_config(tscadc);
|
tscadc_idle_config(tscadc);
|
||||||
|
|
||||||
/* Enable the TSC module enable bit */
|
/* Enable the TSC module enable bit */
|
||||||
|
@ -290,9 +291,12 @@ static int tscadc_resume(struct device *dev)
|
||||||
pm_runtime_get_sync(dev);
|
pm_runtime_get_sync(dev);
|
||||||
|
|
||||||
/* context restore */
|
/* context restore */
|
||||||
ctrl = CNTRLREG_STEPCONFIGWRT | CNTRLREG_TSCENB |
|
ctrl = CNTRLREG_STEPCONFIGWRT | CNTRLREG_STEPID;
|
||||||
CNTRLREG_STEPID | CNTRLREG_4WIRE;
|
if (tscadc_dev->tsc_cell != -1)
|
||||||
|
ctrl |= CNTRLREG_TSCENB | CNTRLREG_4WIRE;
|
||||||
tscadc_writel(tscadc_dev, REG_CTRL, ctrl);
|
tscadc_writel(tscadc_dev, REG_CTRL, ctrl);
|
||||||
|
|
||||||
|
if (tscadc_dev->tsc_cell != -1)
|
||||||
tscadc_idle_config(tscadc_dev);
|
tscadc_idle_config(tscadc_dev);
|
||||||
am335x_tsc_se_update(tscadc_dev);
|
am335x_tsc_se_update(tscadc_dev);
|
||||||
restore = tscadc_readl(tscadc_dev, REG_CTRL);
|
restore = tscadc_readl(tscadc_dev, REG_CTRL);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче