diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2018-07-16 17:41:45 +0300 |
---|---|---|
committer | Eduardo Valentin <edubezval@gmail.com> | 2018-07-28 00:43:03 +0300 |
commit | 931d3c5db42c935c7fcf119e844176ca5dcae326 (patch) | |
tree | f19f4a62193fe7468e4621e4101d38bab4150d3d /drivers/thermal | |
parent | 8d98761a6fc1eeee7232471c5285665fc7ecaa23 (diff) | |
download | linux-931d3c5db42c935c7fcf119e844176ca5dcae326.tar.xz |
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>
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/armada_thermal.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c index 4c88d70f09e5..de1d1c6b1975 100644 --- a/drivers/thermal/armada_thermal.c +++ b/drivers/thermal/armada_thermal.c @@ -103,16 +103,13 @@ static void armadaxp_init_sensor(struct platform_device *pdev, reg = readl_relaxed(priv->control1); reg |= PMU_TDC0_OTF_CAL_MASK; - writel(reg, priv->control1); /* Reference calibration value */ reg &= ~PMU_TDC0_REF_CAL_CNT_MASK; reg |= (0xf1 << PMU_TDC0_REF_CAL_CNT_OFFS); - writel(reg, priv->control1); /* Reset the sensor */ - reg = readl_relaxed(priv->control1); - writel((reg | PMU_TDC0_SW_RST_MASK), priv->control1); + reg |= PMU_TDC0_SW_RST_MASK; writel(reg, priv->control1); @@ -129,14 +126,13 @@ static void armada370_init_sensor(struct platform_device *pdev, reg = readl_relaxed(priv->control1); reg |= PMU_TDC0_OTF_CAL_MASK; - writel(reg, priv->control1); /* Reference calibration value */ reg &= ~PMU_TDC0_REF_CAL_CNT_MASK; reg |= (0xf1 << PMU_TDC0_REF_CAL_CNT_OFFS); - writel(reg, priv->control1); reg &= ~PMU_TDC0_START_CAL_MASK; + writel(reg, priv->control1); msleep(10); |