提交 b5f8b763 编写于 作者: P Patil, Rachna 提交者: Samuel Ortiz

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: NPatil, Rachna <rachna@ti.com>
Acked-by: NVaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: NZubair Lutfullah <zubair.lutfullah@gmail.com>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 efe3126a
...@@ -204,13 +204,14 @@ static int ti_tscadc_probe(struct platform_device *pdev) ...@@ -204,13 +204,14 @@ 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 */
tscadc_idle_config(tscadc); if (tsc_wires > 0)
tscadc_idle_config(tscadc);
/* Enable the TSC module enable bit */ /* Enable the TSC module enable bit */
ctrl = tscadc_readl(tscadc, REG_CTRL); ctrl = tscadc_readl(tscadc, REG_CTRL);
...@@ -290,10 +291,13 @@ static int tscadc_resume(struct device *dev) ...@@ -290,10 +291,13 @@ 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);
tscadc_idle_config(tscadc_dev);
if (tscadc_dev->tsc_cell != -1)
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);
tscadc_writel(tscadc_dev, REG_CTRL, tscadc_writel(tscadc_dev, REG_CTRL,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册