diff options
Diffstat (limited to 'drivers/rtc/rtc-mxc.c')
-rw-r--r-- | drivers/rtc/rtc-mxc.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c index 0b06c1e03fd5..39e41fbdf08b 100644 --- a/drivers/rtc/rtc-mxc.c +++ b/drivers/rtc/rtc-mxc.c | |||
@@ -55,12 +55,6 @@ static const u32 PIE_BIT_DEF[MAX_PIE_NUM][2] = { | |||
55 | { MAX_PIE_FREQ, RTC_SAM7_BIT }, | 55 | { MAX_PIE_FREQ, RTC_SAM7_BIT }, |
56 | }; | 56 | }; |
57 | 57 | ||
58 | /* Those are the bits from a classic RTC we want to mimic */ | ||
59 | #define RTC_IRQF 0x80 /* any of the following 3 is active */ | ||
60 | #define RTC_PF 0x40 /* Periodic interrupt */ | ||
61 | #define RTC_AF 0x20 /* Alarm interrupt */ | ||
62 | #define RTC_UF 0x10 /* Update interrupt for 1Hz RTC */ | ||
63 | |||
64 | #define MXC_RTC_TIME 0 | 58 | #define MXC_RTC_TIME 0 |
65 | #define MXC_RTC_ALARM 1 | 59 | #define MXC_RTC_ALARM 1 |
66 | 60 | ||
@@ -274,12 +268,6 @@ static int mxc_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) | |||
274 | return 0; | 268 | return 0; |
275 | } | 269 | } |
276 | 270 | ||
277 | static int mxc_rtc_update_irq_enable(struct device *dev, unsigned int enabled) | ||
278 | { | ||
279 | mxc_rtc_irq_enable(dev, RTC_1HZ_BIT, enabled); | ||
280 | return 0; | ||
281 | } | ||
282 | |||
283 | /* | 271 | /* |
284 | * This function reads the current RTC time into tm in Gregorian date. | 272 | * This function reads the current RTC time into tm in Gregorian date. |
285 | */ | 273 | */ |
@@ -368,7 +356,6 @@ static struct rtc_class_ops mxc_rtc_ops = { | |||
368 | .read_alarm = mxc_rtc_read_alarm, | 356 | .read_alarm = mxc_rtc_read_alarm, |
369 | .set_alarm = mxc_rtc_set_alarm, | 357 | .set_alarm = mxc_rtc_set_alarm, |
370 | .alarm_irq_enable = mxc_rtc_alarm_irq_enable, | 358 | .alarm_irq_enable = mxc_rtc_alarm_irq_enable, |
371 | .update_irq_enable = mxc_rtc_update_irq_enable, | ||
372 | }; | 359 | }; |
373 | 360 | ||
374 | static int __init mxc_rtc_probe(struct platform_device *pdev) | 361 | static int __init mxc_rtc_probe(struct platform_device *pdev) |
@@ -425,14 +412,6 @@ static int __init mxc_rtc_probe(struct platform_device *pdev) | |||
425 | goto exit_put_clk; | 412 | goto exit_put_clk; |
426 | } | 413 | } |
427 | 414 | ||
428 | rtc = rtc_device_register(pdev->name, &pdev->dev, &mxc_rtc_ops, | ||
429 | THIS_MODULE); | ||
430 | if (IS_ERR(rtc)) { | ||
431 | ret = PTR_ERR(rtc); | ||
432 | goto exit_put_clk; | ||
433 | } | ||
434 | |||
435 | pdata->rtc = rtc; | ||
436 | platform_set_drvdata(pdev, pdata); | 415 | platform_set_drvdata(pdev, pdata); |
437 | 416 | ||
438 | /* Configure and enable the RTC */ | 417 | /* Configure and enable the RTC */ |
@@ -445,8 +424,19 @@ static int __init mxc_rtc_probe(struct platform_device *pdev) | |||
445 | pdata->irq = -1; | 424 | pdata->irq = -1; |
446 | } | 425 | } |
447 | 426 | ||
427 | rtc = rtc_device_register(pdev->name, &pdev->dev, &mxc_rtc_ops, | ||
428 | THIS_MODULE); | ||
429 | if (IS_ERR(rtc)) { | ||
430 | ret = PTR_ERR(rtc); | ||
431 | goto exit_clr_drvdata; | ||
432 | } | ||
433 | |||
434 | pdata->rtc = rtc; | ||
435 | |||
448 | return 0; | 436 | return 0; |
449 | 437 | ||
438 | exit_clr_drvdata: | ||
439 | platform_set_drvdata(pdev, NULL); | ||
450 | exit_put_clk: | 440 | exit_put_clk: |
451 | clk_disable(pdata->clk); | 441 | clk_disable(pdata->clk); |
452 | clk_put(pdata->clk); | 442 | clk_put(pdata->clk); |