提交 fb61f862 编写于 作者: L Linus Walleij

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: NLinus Walleij <linus.walleij@linaro.org>
上级 d0e639c9
...@@ -93,6 +93,14 @@ int __init integrator_init(bool is_cp) ...@@ -93,6 +93,14 @@ int __init integrator_init(bool is_cp)
static DEFINE_RAW_SPINLOCK(cm_lock); 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. * cm_control - update the CM_CTRL register.
* @mask: bits to change * @mask: bits to change
......
/* /*
* update the core module control register. * access the core module control register.
*/ */
u32 cm_get(void);
void cm_control(u32, u32); void cm_control(u32, u32);
#define CM_CTRL __io_address(INTEGRATOR_HDR_CTRL) #define CM_CTRL __io_address(INTEGRATOR_HDR_CTRL)
......
...@@ -78,7 +78,7 @@ static void cm_led_set(struct led_classdev *cdev, ...@@ -78,7 +78,7 @@ static void cm_led_set(struct led_classdev *cdev,
static enum led_brightness cm_led_get(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; return (reg & CM_CTRL_LED) ? LED_FULL : LED_OFF;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册