aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-ab8500.c10
-rw-r--r--drivers/rtc/rtc-mxc.c5
-rw-r--r--drivers/rtc/rtc-spear.c2
-rw-r--r--drivers/rtc/rtc-twl.c2
4 files changed, 13 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c
index 4bcf9ca2818a..370889d0489b 100644
--- a/drivers/rtc/rtc-ab8500.c
+++ b/drivers/rtc/rtc-ab8500.c
@@ -17,6 +17,7 @@
17#include <linux/mfd/abx500.h> 17#include <linux/mfd/abx500.h>
18#include <linux/mfd/abx500/ab8500.h> 18#include <linux/mfd/abx500/ab8500.h>
19#include <linux/delay.h> 19#include <linux/delay.h>
20#include <linux/of.h>
20 21
21#define AB8500_RTC_SOFF_STAT_REG 0x00 22#define AB8500_RTC_SOFF_STAT_REG 0x00
22#define AB8500_RTC_CC_CONF_REG 0x01 23#define AB8500_RTC_CC_CONF_REG 0x01
@@ -422,7 +423,7 @@ static int __devinit ab8500_rtc_probe(struct platform_device *pdev)
422 } 423 }
423 424
424 err = request_threaded_irq(irq, NULL, rtc_alarm_handler, 425 err = request_threaded_irq(irq, NULL, rtc_alarm_handler,
425 IRQF_NO_SUSPEND, "ab8500-rtc", rtc); 426 IRQF_NO_SUSPEND | IRQF_ONESHOT, "ab8500-rtc", rtc);
426 if (err < 0) { 427 if (err < 0) {
427 rtc_device_unregister(rtc); 428 rtc_device_unregister(rtc);
428 return err; 429 return err;
@@ -430,7 +431,6 @@ static int __devinit ab8500_rtc_probe(struct platform_device *pdev)
430 431
431 platform_set_drvdata(pdev, rtc); 432 platform_set_drvdata(pdev, rtc);
432 433
433
434 err = ab8500_sysfs_rtc_register(&pdev->dev); 434 err = ab8500_sysfs_rtc_register(&pdev->dev);
435 if (err) { 435 if (err) {
436 dev_err(&pdev->dev, "sysfs RTC failed to register\n"); 436 dev_err(&pdev->dev, "sysfs RTC failed to register\n");
@@ -454,10 +454,16 @@ static int __devexit ab8500_rtc_remove(struct platform_device *pdev)
454 return 0; 454 return 0;
455} 455}
456 456
457static const struct of_device_id ab8500_rtc_match[] = {
458 { .compatible = "stericsson,ab8500-rtc", },
459 {}
460};
461
457static struct platform_driver ab8500_rtc_driver = { 462static struct platform_driver ab8500_rtc_driver = {
458 .driver = { 463 .driver = {
459 .name = "ab8500-rtc", 464 .name = "ab8500-rtc",
460 .owner = THIS_MODULE, 465 .owner = THIS_MODULE,
466 .of_match_table = ab8500_rtc_match,
461 }, 467 },
462 .probe = ab8500_rtc_probe, 468 .probe = ab8500_rtc_probe,
463 .remove = __devexit_p(ab8500_rtc_remove), 469 .remove = __devexit_p(ab8500_rtc_remove),
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index 5e1d64ee5228..e3e50d69baf8 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -202,10 +202,11 @@ static irqreturn_t mxc_rtc_interrupt(int irq, void *dev_id)
202 struct platform_device *pdev = dev_id; 202 struct platform_device *pdev = dev_id;
203 struct rtc_plat_data *pdata = platform_get_drvdata(pdev); 203 struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
204 void __iomem *ioaddr = pdata->ioaddr; 204 void __iomem *ioaddr = pdata->ioaddr;
205 unsigned long flags;
205 u32 status; 206 u32 status;
206 u32 events = 0; 207 u32 events = 0;
207 208
208 spin_lock_irq(&pdata->rtc->irq_lock); 209 spin_lock_irqsave(&pdata->rtc->irq_lock, flags);
209 status = readw(ioaddr + RTC_RTCISR) & readw(ioaddr + RTC_RTCIENR); 210 status = readw(ioaddr + RTC_RTCISR) & readw(ioaddr + RTC_RTCIENR);
210 /* clear interrupt sources */ 211 /* clear interrupt sources */
211 writew(status, ioaddr + RTC_RTCISR); 212 writew(status, ioaddr + RTC_RTCISR);
@@ -224,7 +225,7 @@ static irqreturn_t mxc_rtc_interrupt(int irq, void *dev_id)
224 events |= (RTC_PF | RTC_IRQF); 225 events |= (RTC_PF | RTC_IRQF);
225 226
226 rtc_update_irq(pdata->rtc, 1, events); 227 rtc_update_irq(pdata->rtc, 1, events);
227 spin_unlock_irq(&pdata->rtc->irq_lock); 228 spin_unlock_irqrestore(&pdata->rtc->irq_lock, flags);
228 229
229 return IRQ_HANDLED; 230 return IRQ_HANDLED;
230} 231}
diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c
index 1f76320e545b..e2785479113c 100644
--- a/drivers/rtc/rtc-spear.c
+++ b/drivers/rtc/rtc-spear.c
@@ -458,12 +458,12 @@ static int __devexit spear_rtc_remove(struct platform_device *pdev)
458 clk_disable(config->clk); 458 clk_disable(config->clk);
459 clk_put(config->clk); 459 clk_put(config->clk);
460 iounmap(config->ioaddr); 460 iounmap(config->ioaddr);
461 kfree(config);
462 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 461 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
463 if (res) 462 if (res)
464 release_mem_region(res->start, resource_size(res)); 463 release_mem_region(res->start, resource_size(res));
465 platform_set_drvdata(pdev, NULL); 464 platform_set_drvdata(pdev, NULL);
466 rtc_device_unregister(config->rtc); 465 rtc_device_unregister(config->rtc);
466 kfree(config);
467 467
468 return 0; 468 return 0;
469} 469}
diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
index 258abeabf624..c5d06fe83bba 100644
--- a/drivers/rtc/rtc-twl.c
+++ b/drivers/rtc/rtc-twl.c
@@ -510,7 +510,7 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev)
510 } 510 }
511 511
512 ret = request_threaded_irq(irq, NULL, twl_rtc_interrupt, 512 ret = request_threaded_irq(irq, NULL, twl_rtc_interrupt,
513 IRQF_TRIGGER_RISING, 513 IRQF_TRIGGER_RISING | IRQF_ONESHOT,
514 dev_name(&rtc->dev), rtc); 514 dev_name(&rtc->dev), rtc);
515 if (ret < 0) { 515 if (ret < 0) {
516 dev_err(&pdev->dev, "IRQ is not free.\n"); 516 dev_err(&pdev->dev, "IRQ is not free.\n");