Commit 378ce74b authored by Linus Walleij's avatar Linus Walleij Committed by Russell King

ARM: 5787/1: U300 COH 901 331 fixes

This will fix some small issues with the COH 901 331 RTC driver:
- Interrupt is disabled after alarm so that we don't fire
  multiple interrupts.
- We return 0 from the coh901331_alarm_irq_enable() ridding
  a compile warning.
- We alter the name in the U300 device registry to match that
  of the driver so they sucessfully resolve.
Signed-off-by: default avatarLinus Walleij <linus.walleij@stericsson.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 927585f6
...@@ -408,7 +408,7 @@ static struct platform_device keypad_device = { ...@@ -408,7 +408,7 @@ static struct platform_device keypad_device = {
}; };
static struct platform_device rtc_device = { static struct platform_device rtc_device = {
.name = "rtc0", .name = "rtc-coh901331",
.id = -1, .id = -1,
.num_resources = ARRAY_SIZE(rtc_resources), .num_resources = ARRAY_SIZE(rtc_resources),
.resource = rtc_resources, .resource = rtc_resources,
......
...@@ -58,7 +58,16 @@ static irqreturn_t coh901331_interrupt(int irq, void *data) ...@@ -58,7 +58,16 @@ static irqreturn_t coh901331_interrupt(int irq, void *data)
clk_enable(rtap->clk); clk_enable(rtap->clk);
/* Ack IRQ */ /* Ack IRQ */
writel(1, rtap->virtbase + COH901331_IRQ_EVENT); writel(1, rtap->virtbase + COH901331_IRQ_EVENT);
/*
* Disable the interrupt. This is necessary because
* the RTC lives on a lower-clocked line and will
* not release the IRQ line until after a few (slower)
* clock cycles. The interrupt will be re-enabled when
* a new alarm is set anyway.
*/
writel(0, rtap->virtbase + COH901331_IRQ_MASK);
clk_disable(rtap->clk); clk_disable(rtap->clk);
/* Set alarm flag */ /* Set alarm flag */
rtc_update_irq(rtap->rtc, 1, RTC_AF); rtc_update_irq(rtap->rtc, 1, RTC_AF);
...@@ -128,6 +137,8 @@ static int coh901331_alarm_irq_enable(struct device *dev, unsigned int enabled) ...@@ -128,6 +137,8 @@ static int coh901331_alarm_irq_enable(struct device *dev, unsigned int enabled)
else else
writel(0, rtap->virtbase + COH901331_IRQ_MASK); writel(0, rtap->virtbase + COH901331_IRQ_MASK);
clk_disable(rtap->clk); clk_disable(rtap->clk);
return 0;
} }
static struct rtc_class_ops coh901331_ops = { static struct rtc_class_ops coh901331_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment