]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: integrator: get the CM control register by proxy
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 10 Oct 2013 12:11:18 +0000 (14:11 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 16 Oct 2013 12:09:31 +0000 (14:09 +0200)
The CM_CTRL register was accessed directly from the LED driver,
which does not work now that we get the base for the register
from the device tree. Add an accessor function to do this and
make the LED driver compile again.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/arm/mach-integrator/core.c
arch/arm/mach-integrator/include/mach/cm.h
arch/arm/mach-integrator/leds.c

index 4cdfd7365925f76ce9c1b8b021ce16b566855397..c07c821fb6b3c8121d90995b67f06dfb27f7a03a 100644 (file)
@@ -93,6 +93,14 @@ int __init integrator_init(bool is_cp)
 
 static DEFINE_RAW_SPINLOCK(cm_lock);
 
+/**
+ * cm_get - get the value from the CM_CTRL register
+ */
+u32 cm_get(void)
+{
+       return readl(cm_base + INTEGRATOR_HDR_CTRL_OFFSET);
+}
+
 /**
  * cm_control - update the CM_CTRL register.
  * @mask: bits to change
index 202e6a57f1006a3b1ae820d4f229007131bbee84..ae6085f1db197cea704dad462ab2662ca5c76f52 100644 (file)
@@ -1,6 +1,7 @@
 /*
- * update the core module control register.
+ * access the core module control register.
  */
+u32 cm_get(void);
 void cm_control(u32, u32);
 
 #define CM_CTRL        __io_address(INTEGRATOR_HDR_CTRL)
index 7a7f6d3273bf165b515eb8c4454731848ef661f0..ed82535845f7b1ab1bdaea3eb173be2c0fd61639 100644 (file)
@@ -78,7 +78,7 @@ static void cm_led_set(struct led_classdev *cdev,
 
 static enum led_brightness cm_led_get(struct led_classdev *cdev)
 {
-       u32 reg = readl(CM_CTRL);
+       u32 reg = cm_get();
 
        return (reg & CM_CTRL_LED) ? LED_FULL : LED_OFF;
 }