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

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

From: Jonathan Cameron <jic23@kernel.org>
Date: 2021-08-30 14:00:15
Also in: linux-clk, linux-devicetree, linux-iio, linux-input

On Wed, 25 Aug 2021 17:25:05 +0200
Miquel Raynal [off-list ref] wrote:
The datasheet states that most of the configuration should be set in the
control register in the first place, before actually enabling the
hardware.
Reference always good. 
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>
Looks fine to me otherwise.
quoted hunk ↗ jump to hunk
---
 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 */
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help