Thread (88 messages) 88 messages, 4 authors, 2021-09-05

Lifecycle

  1. Posted Miquel Raynal <miquel.raynal@bootlin.com>

[PATCH 27/40] mfd: ti_am335x_tscadc: Move control register configuration

From: Miquel Raynal <miquel.raynal@bootlin.com>
Date: 2021-08-25 15:34:58
Also in: linux-clk, linux-devicetree, linux-iio, linux-omap
Subsystem: multifunction devices (mfd), the rest · Maintainers: Lee Jones, Linus Torvalds

The datasheet states that most of the configuration should be set in the
control register in the first place, before actually enabling the
hardware. So far only half of the configuration was made in the first
step, which does not make really sense and would complicating the code
when introducing support for the am437x hardware.

Let's move that register write a bit below to enclose more configuration.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mfd/ti_am335x_tscadc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
index a40091830cea..1a30610dc65f 100644
--- a/drivers/mfd/ti_am335x_tscadc.c
+++ b/drivers/mfd/ti_am335x_tscadc.c
@@ -224,7 +224,6 @@ static	int ti_tscadc_probe(struct platform_device *pdev)
 	tscadc->ctrl = CNTRLREG_STEPID;
 	if (tscadc->data->has_tsc) {
 		tscadc->ctrl |= CNTRLREG_TSC_STEPCONFIGWRT;
-		regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl);
 		if (use_tsc) {
 			tscadc->ctrl |= CNTRLREG_TSC_ENB;
 			if (tscmag_wires == 5)
@@ -235,6 +234,8 @@ static	int ti_tscadc_probe(struct platform_device *pdev)
 
 	}
 
+	regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl);
+
 	tscadc_idle_config(tscadc);
 
 	/* Enable the TSC module enable bit */
-- 
2.27.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help