Commit 25b15d04 authored by Miquel Raynal's avatar Miquel Raynal Committed by Lee Jones

mfd: ti_am335x_tscadc: Always provide an idle configuration

The idle register is valid no matter if the touchscreen is used or not,
let's always configure it.
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-21-miquel.raynal@bootlin.com
parent 7c605802
...@@ -221,16 +221,16 @@ static int ti_tscadc_probe(struct platform_device *pdev) ...@@ -221,16 +221,16 @@ static int ti_tscadc_probe(struct platform_device *pdev)
ctrl = CNTRLREG_STEPCONFIGWRT | CNTRLREG_STEPID; ctrl = CNTRLREG_STEPCONFIGWRT | CNTRLREG_STEPID;
regmap_write(tscadc->regmap, REG_CTRL, ctrl); regmap_write(tscadc->regmap, REG_CTRL, ctrl);
/* Set register bits for Idle Config Mode */
if (tsc_wires > 0) { if (tsc_wires > 0) {
tscadc->tsc_wires = tsc_wires; tscadc->tsc_wires = tsc_wires;
if (tsc_wires == 5) if (tsc_wires == 5)
ctrl |= CNTRLREG_5WIRE | CNTRLREG_TSCENB; ctrl |= CNTRLREG_5WIRE | CNTRLREG_TSCENB;
else else
ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB; ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB;
tscadc_idle_config(tscadc);
} }
tscadc_idle_config(tscadc);
/* Enable the TSC module enable bit */ /* Enable the TSC module enable bit */
ctrl |= CNTRLREG_TSCSSENB; ctrl |= CNTRLREG_TSCSSENB;
regmap_write(tscadc->regmap, REG_CTRL, ctrl); regmap_write(tscadc->regmap, REG_CTRL, ctrl);
...@@ -321,8 +321,10 @@ static int __maybe_unused tscadc_resume(struct device *dev) ...@@ -321,8 +321,10 @@ static int __maybe_unused tscadc_resume(struct device *dev)
ctrl |= CNTRLREG_5WIRE | CNTRLREG_TSCENB; ctrl |= CNTRLREG_5WIRE | CNTRLREG_TSCENB;
else else
ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB; ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB;
tscadc_idle_config(tscadc);
} }
tscadc_idle_config(tscadc);
ctrl |= CNTRLREG_TSCSSENB; ctrl |= CNTRLREG_TSCSSENB;
regmap_write(tscadc->regmap, REG_CTRL, ctrl); regmap_write(tscadc->regmap, REG_CTRL, ctrl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment