thermal/spear_thermal: replace readl/writel with lighter _relaxed variants
authorViresh Kumar <viresh.kumar@st.com>
Wed, 21 Mar 2012 19:55:03 +0000 (12:55 -0700)
committerLen Brown <len.brown@intel.com>
Thu, 22 Mar 2012 05:06:43 +0000 (01:06 -0400)
readl/writel versions for ARM contain memory barrier instruction for
synchronizing DMA buffers.  These are not required at least on this
module.  So use lighter _relaxed variants.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/thermal/spear_thermal.c

index 880bf289aa64d050a67fb15e5bc74b915e62786d..be94413b95a3c75040935fc20bd4388b98ff1b56 100644 (file)
@@ -46,7 +46,7 @@ static inline int thermal_get_temp(struct thermal_zone_device *thermal,
         * Data are ready to be read after 628 usec from POWERDOWN signal
         * (PDN) = 1
         */
-       *temp = (readl(stdev->thermal_base) & 0x7F) * MD_FACTOR;
+       *temp = (readl_relaxed(stdev->thermal_base) & 0x7F) * MD_FACTOR;
        return 0;
 }
 
@@ -63,8 +63,8 @@ static int spear_thermal_suspend(struct device *dev)
        unsigned int actual_mask = 0;
 
        /* Disable SPEAr Thermal Sensor */
-       actual_mask = readl(stdev->thermal_base);
-       writel(actual_mask & ~stdev->flags, stdev->thermal_base);
+       actual_mask = readl_relaxed(stdev->thermal_base);
+       writel_relaxed(actual_mask & ~stdev->flags, stdev->thermal_base);
 
        clk_disable(stdev->clk);
        dev_info(dev, "Suspended.\n");
@@ -87,8 +87,8 @@ static int spear_thermal_resume(struct device *dev)
        }
 
        /* Enable SPEAr Thermal Sensor */
-       actual_mask = readl(stdev->thermal_base);
-       writel(actual_mask | stdev->flags, stdev->thermal_base);
+       actual_mask = readl_relaxed(stdev->thermal_base);
+       writel_relaxed(actual_mask | stdev->flags, stdev->thermal_base);
 
        dev_info(dev, "Resumed.\n");
 
@@ -145,7 +145,7 @@ static int spear_thermal_probe(struct platform_device *pdev)
        }
 
        stdev->flags = pdata->thermal_flags;
-       writel(stdev->flags, stdev->thermal_base);
+       writel_relaxed(stdev->flags, stdev->thermal_base);
 
        spear_thermal = thermal_zone_device_register("spear_thermal", 0,
                                stdev, &ops, 0, 0, 0, 0);
@@ -180,8 +180,8 @@ static int spear_thermal_exit(struct platform_device *pdev)
        platform_set_drvdata(pdev, NULL);
 
        /* Disable SPEAr Thermal Sensor */
-       actual_mask = readl(stdev->thermal_base);
-       writel(actual_mask & ~stdev->flags, stdev->thermal_base);
+       actual_mask = readl_relaxed(stdev->thermal_base);
+       writel_relaxed(actual_mask & ~stdev->flags, stdev->thermal_base);
 
        clk_disable(stdev->clk);
        clk_put(stdev->clk);