Skip to content

Commit 931d3c5

Browse files
miquelraynalEduardo Valentin
authored andcommitted
thermal: armada: remove useless register accesses
Prepare the migration to use regmaps by first simplifying the initialization functions: avoid unnecessary write/read cycles on configuration registers. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
1 parent 8d98761 commit 931d3c5

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/thermal/armada_thermal.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,13 @@ static void armadaxp_init_sensor(struct platform_device *pdev,
103103

104104
reg = readl_relaxed(priv->control1);
105105
reg |= PMU_TDC0_OTF_CAL_MASK;
106-
writel(reg, priv->control1);
107106

108107
/* Reference calibration value */
109108
reg &= ~PMU_TDC0_REF_CAL_CNT_MASK;
110109
reg |= (0xf1 << PMU_TDC0_REF_CAL_CNT_OFFS);
111-
writel(reg, priv->control1);
112110

113111
/* Reset the sensor */
114-
reg = readl_relaxed(priv->control1);
115-
writel((reg | PMU_TDC0_SW_RST_MASK), priv->control1);
112+
reg |= PMU_TDC0_SW_RST_MASK;
116113

117114
writel(reg, priv->control1);
118115

@@ -129,14 +126,13 @@ static void armada370_init_sensor(struct platform_device *pdev,
129126

130127
reg = readl_relaxed(priv->control1);
131128
reg |= PMU_TDC0_OTF_CAL_MASK;
132-
writel(reg, priv->control1);
133129

134130
/* Reference calibration value */
135131
reg &= ~PMU_TDC0_REF_CAL_CNT_MASK;
136132
reg |= (0xf1 << PMU_TDC0_REF_CAL_CNT_OFFS);
137-
writel(reg, priv->control1);
138133

139134
reg &= ~PMU_TDC0_START_CAL_MASK;
135+
140136
writel(reg, priv->control1);
141137

142138
msleep(10);

0 commit comments

Comments
 (0)