aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/ti_am335x_tscadc.c
diff options
context:
space:
mode:
authorPatil, Rachna <rachna@ti.com>2013-07-20 12:27:34 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2013-07-30 20:04:40 -0400
commitb5f8b7632c4fc43d42a715a1658588acc24115a9 (patch)
tree2d82a4f718fca95e3cd50b8472bec8dbe0c9c44c /drivers/mfd/ti_am335x_tscadc.c
parentefe3126afce32e3100af3029a80701d47e1b6999 (diff)
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>
Diffstat (limited to 'drivers/mfd/ti_am335x_tscadc.c')
-rw-r--r--drivers/mfd/ti_am335x_tscadc.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
index e0852ecbc767..cd74d594c563 100644
--- a/drivers/mfd/ti_am335x_tscadc.c
+++ b/drivers/mfd/ti_am335x_tscadc.c
@@ -204,13 +204,14 @@ static int ti_tscadc_probe(struct platform_device *pdev)
204 204
205 /* Set the control register bits */ 205 /* Set the control register bits */
206 ctrl = CNTRLREG_STEPCONFIGWRT | 206 ctrl = CNTRLREG_STEPCONFIGWRT |
207 CNTRLREG_TSCENB | 207 CNTRLREG_STEPID;
208 CNTRLREG_STEPID | 208 if (tsc_wires > 0)
209 CNTRLREG_4WIRE; 209 ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB;
210 tscadc_writel(tscadc, REG_CTRL, ctrl); 210 tscadc_writel(tscadc, REG_CTRL, ctrl);
211 211
212 /* Set register bits for Idle Config Mode */ 212 /* Set register bits for Idle Config Mode */
213 tscadc_idle_config(tscadc); 213 if (tsc_wires > 0)
214 tscadc_idle_config(tscadc);
214 215
215 /* Enable the TSC module enable bit */ 216 /* Enable the TSC module enable bit */
216 ctrl = tscadc_readl(tscadc, REG_CTRL); 217 ctrl = tscadc_readl(tscadc, REG_CTRL);
@@ -290,10 +291,13 @@ static int tscadc_resume(struct device *dev)
290 pm_runtime_get_sync(dev); 291 pm_runtime_get_sync(dev);
291 292
292 /* context restore */ 293 /* context restore */
293 ctrl = CNTRLREG_STEPCONFIGWRT | CNTRLREG_TSCENB | 294 ctrl = CNTRLREG_STEPCONFIGWRT | CNTRLREG_STEPID;
294 CNTRLREG_STEPID | CNTRLREG_4WIRE; 295 if (tscadc_dev->tsc_cell != -1)
296 ctrl |= CNTRLREG_TSCENB | CNTRLREG_4WIRE;
295 tscadc_writel(tscadc_dev, REG_CTRL, ctrl); 297 tscadc_writel(tscadc_dev, REG_CTRL, ctrl);
296 tscadc_idle_config(tscadc_dev); 298
299 if (tscadc_dev->tsc_cell != -1)
300 tscadc_idle_config(tscadc_dev);
297 am335x_tsc_se_update(tscadc_dev); 301 am335x_tsc_se_update(tscadc_dev);
298 restore = tscadc_readl(tscadc_dev, REG_CTRL); 302 restore = tscadc_readl(tscadc_dev, REG_CTRL);
299 tscadc_writel(tscadc_dev, REG_CTRL, 303 tscadc_writel(tscadc_dev, REG_CTRL,