aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-wm8350.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-14 13:02:35 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-14 13:02:35 -0500
commit76b8f82cde2d9c13ef0c9a9aa2581b9b30b68e8c (patch)
treef94b370b95051b4a7b3c272b4b2ee20091e1b746 /drivers/rtc/rtc-wm8350.c
parentaf853e631db12a97363c8c3b727d153bd2cb346b (diff)
parent9da66539281b5e15afc4a4739014c8923059d894 (diff)
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (58 commits) mfd: Add twl6030 regulator subdevices regulator: Add support for twl6030 regulators rtc: Add twl6030 RTC support mfd: Add support for twl6030 irq framework mfd: Rename twl4030_ routines in twl-regulator.c mfd: Rename twl4030_ routines in rtc-twl.c mfd: Rename all twl4030_i2c* mfd: Rename twl4030* driver files to enable re-use mfd: Clarify twl4030 return value for read and write mfd: Add all twl4030 regulators to the twl4030 mfd driver mfd: Don't set mc13783 ADREFMODE for touch conversions mfd: Remove ezx-pcap defines for custom led gpio encoding mfd: Near complete mc13783 rewrite mfd: Remove build time warning for WM835x register default tables mfd: Force I2C to be built in when building WM831x mfd: Don't allow wm831x to be built as a module mfd: Fix incorrect error check for wm8350-core mfd: Fix twl4030 warning gpiolib: Implement gpio_to_irq() for wm831x mfd: Remove default selection of AB4500 ...
Diffstat (limited to 'drivers/rtc/rtc-wm8350.c')
-rw-r--r--drivers/rtc/rtc-wm8350.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/rtc/rtc-wm8350.c b/drivers/rtc/rtc-wm8350.c
index c91edc572eb6..f16486635a8e 100644
--- a/drivers/rtc/rtc-wm8350.c
+++ b/drivers/rtc/rtc-wm8350.c
@@ -315,9 +315,9 @@ static int wm8350_rtc_update_irq_enable(struct device *dev,
315 return 0; 315 return 0;
316} 316}
317 317
318static void wm8350_rtc_alarm_handler(struct wm8350 *wm8350, int irq, 318static irqreturn_t wm8350_rtc_alarm_handler(int irq, void *data)
319 void *data)
320{ 319{
320 struct wm8350 *wm8350 = data;
321 struct rtc_device *rtc = wm8350->rtc.rtc; 321 struct rtc_device *rtc = wm8350->rtc.rtc;
322 int ret; 322 int ret;
323 323
@@ -330,14 +330,18 @@ static void wm8350_rtc_alarm_handler(struct wm8350 *wm8350, int irq,
330 dev_err(&(wm8350->rtc.pdev->dev), 330 dev_err(&(wm8350->rtc.pdev->dev),
331 "Failed to disable alarm: %d\n", ret); 331 "Failed to disable alarm: %d\n", ret);
332 } 332 }
333
334 return IRQ_HANDLED;
333} 335}
334 336
335static void wm8350_rtc_update_handler(struct wm8350 *wm8350, int irq, 337static irqreturn_t wm8350_rtc_update_handler(int irq, void *data)
336 void *data)
337{ 338{
339 struct wm8350 *wm8350 = data;
338 struct rtc_device *rtc = wm8350->rtc.rtc; 340 struct rtc_device *rtc = wm8350->rtc.rtc;
339 341
340 rtc_update_irq(rtc, 1, RTC_IRQF | RTC_UF); 342 rtc_update_irq(rtc, 1, RTC_IRQF | RTC_UF);
343
344 return IRQ_HANDLED;
341} 345}
342 346
343static const struct rtc_class_ops wm8350_rtc_ops = { 347static const struct rtc_class_ops wm8350_rtc_ops = {
@@ -455,15 +459,14 @@ static int wm8350_rtc_probe(struct platform_device *pdev)
455 return ret; 459 return ret;
456 } 460 }
457 461
458 wm8350_mask_irq(wm8350, WM8350_IRQ_RTC_SEC);
459 wm8350_mask_irq(wm8350, WM8350_IRQ_RTC_PER);
460
461 wm8350_register_irq(wm8350, WM8350_IRQ_RTC_SEC, 462 wm8350_register_irq(wm8350, WM8350_IRQ_RTC_SEC,
462 wm8350_rtc_update_handler, NULL); 463 wm8350_rtc_update_handler, 0,
464 "RTC Seconds", wm8350);
465 wm8350_mask_irq(wm8350, WM8350_IRQ_RTC_SEC);
463 466
464 wm8350_register_irq(wm8350, WM8350_IRQ_RTC_ALM, 467 wm8350_register_irq(wm8350, WM8350_IRQ_RTC_ALM,
465 wm8350_rtc_alarm_handler, NULL); 468 wm8350_rtc_alarm_handler, 0,
466 wm8350_unmask_irq(wm8350, WM8350_IRQ_RTC_ALM); 469 "RTC Alarm", wm8350);
467 470
468 return 0; 471 return 0;
469} 472}
@@ -473,8 +476,6 @@ static int __devexit wm8350_rtc_remove(struct platform_device *pdev)
473 struct wm8350 *wm8350 = platform_get_drvdata(pdev); 476 struct wm8350 *wm8350 = platform_get_drvdata(pdev);
474 struct wm8350_rtc *wm_rtc = &wm8350->rtc; 477 struct wm8350_rtc *wm_rtc = &wm8350->rtc;
475 478
476 wm8350_mask_irq(wm8350, WM8350_IRQ_RTC_SEC);
477
478 wm8350_free_irq(wm8350, WM8350_IRQ_RTC_SEC); 479 wm8350_free_irq(wm8350, WM8350_IRQ_RTC_SEC);
479 wm8350_free_irq(wm8350, WM8350_IRQ_RTC_ALM); 480 wm8350_free_irq(wm8350, WM8350_IRQ_RTC_ALM);
480 481