Commit 931d3c5d authored by Miquel Raynal's avatar Miquel Raynal Committed by Eduardo Valentin

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: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
parent 8d98761a
...@@ -103,16 +103,13 @@ static void armadaxp_init_sensor(struct platform_device *pdev, ...@@ -103,16 +103,13 @@ static void armadaxp_init_sensor(struct platform_device *pdev,
reg = readl_relaxed(priv->control1); reg = readl_relaxed(priv->control1);
reg |= PMU_TDC0_OTF_CAL_MASK; reg |= PMU_TDC0_OTF_CAL_MASK;
writel(reg, priv->control1);
/* Reference calibration value */ /* Reference calibration value */
reg &= ~PMU_TDC0_REF_CAL_CNT_MASK; reg &= ~PMU_TDC0_REF_CAL_CNT_MASK;
reg |= (0xf1 << PMU_TDC0_REF_CAL_CNT_OFFS); reg |= (0xf1 << PMU_TDC0_REF_CAL_CNT_OFFS);
writel(reg, priv->control1);
/* Reset the sensor */ /* Reset the sensor */
reg = readl_relaxed(priv->control1); reg |= PMU_TDC0_SW_RST_MASK;
writel((reg | PMU_TDC0_SW_RST_MASK), priv->control1);
writel(reg, priv->control1); writel(reg, priv->control1);
...@@ -129,14 +126,13 @@ static void armada370_init_sensor(struct platform_device *pdev, ...@@ -129,14 +126,13 @@ static void armada370_init_sensor(struct platform_device *pdev,
reg = readl_relaxed(priv->control1); reg = readl_relaxed(priv->control1);
reg |= PMU_TDC0_OTF_CAL_MASK; reg |= PMU_TDC0_OTF_CAL_MASK;
writel(reg, priv->control1);
/* Reference calibration value */ /* Reference calibration value */
reg &= ~PMU_TDC0_REF_CAL_CNT_MASK; reg &= ~PMU_TDC0_REF_CAL_CNT_MASK;
reg |= (0xf1 << PMU_TDC0_REF_CAL_CNT_OFFS); reg |= (0xf1 << PMU_TDC0_REF_CAL_CNT_OFFS);
writel(reg, priv->control1);
reg &= ~PMU_TDC0_START_CAL_MASK; reg &= ~PMU_TDC0_START_CAL_MASK;
writel(reg, priv->control1); writel(reg, priv->control1);
msleep(10); msleep(10);
......
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