aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-integrator
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-10-10 08:11:18 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-10-16 08:09:31 -0400
commitfb61f8622369aad275a4e3487b8aeec7a571fdde (patch)
tree0bd297dbd8b79f6918326782a40a86a55c5c3322 /arch/arm/mach-integrator
parentd0e639c9e06d44e713170031fe05fb60ebe680af (diff)
ARM: integrator: get the CM control register by proxy
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>
Diffstat (limited to 'arch/arm/mach-integrator')
-rw-r--r--arch/arm/mach-integrator/core.c8
-rw-r--r--arch/arm/mach-integrator/include/mach/cm.h3
-rw-r--r--arch/arm/mach-integrator/leds.c2
3 files changed, 11 insertions, 2 deletions
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index 4cdfd7365925..c07c821fb6b3 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -94,6 +94,14 @@ int __init integrator_init(bool is_cp)
94static DEFINE_RAW_SPINLOCK(cm_lock); 94static DEFINE_RAW_SPINLOCK(cm_lock);
95 95
96/** 96/**
97 * cm_get - get the value from the CM_CTRL register
98 */
99u32 cm_get(void)
100{
101 return readl(cm_base + INTEGRATOR_HDR_CTRL_OFFSET);
102}
103
104/**
97 * cm_control - update the CM_CTRL register. 105 * cm_control - update the CM_CTRL register.
98 * @mask: bits to change 106 * @mask: bits to change
99 * @set: bits to set 107 * @set: bits to set
diff --git a/arch/arm/mach-integrator/include/mach/cm.h b/arch/arm/mach-integrator/include/mach/cm.h
index 202e6a57f100..ae6085f1db19 100644
--- a/arch/arm/mach-integrator/include/mach/cm.h
+++ b/arch/arm/mach-integrator/include/mach/cm.h
@@ -1,6 +1,7 @@
1/* 1/*
2 * update the core module control register. 2 * access the core module control register.
3 */ 3 */
4u32 cm_get(void);
4void cm_control(u32, u32); 5void cm_control(u32, u32);
5 6
6#define CM_CTRL __io_address(INTEGRATOR_HDR_CTRL) 7#define CM_CTRL __io_address(INTEGRATOR_HDR_CTRL)
diff --git a/arch/arm/mach-integrator/leds.c b/arch/arm/mach-integrator/leds.c
index 7a7f6d3273bf..ed82535845f7 100644
--- a/arch/arm/mach-integrator/leds.c
+++ b/arch/arm/mach-integrator/leds.c
@@ -78,7 +78,7 @@ static void cm_led_set(struct led_classdev *cdev,
78 78
79static enum led_brightness cm_led_get(struct led_classdev *cdev) 79static enum led_brightness cm_led_get(struct led_classdev *cdev)
80{ 80{
81 u32 reg = readl(CM_CTRL); 81 u32 reg = cm_get();
82 82
83 return (reg & CM_CTRL_LED) ? LED_FULL : LED_OFF; 83 return (reg & CM_CTRL_LED) ? LED_FULL : LED_OFF;
84} 84}