rtc-s3c.c (f838bad1b3be8ca0c785ee0e0c570dfda74cf377) rtc-s3c.c (2a4e2b8780c6df42b19c053243dada7fa4d311ee)
1/* drivers/rtc/rtc-s3c.c
2 *
3 * Copyright (c) 2004,2006 Simtec Electronics
4 * Ben Dooks, <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 54 unchanged lines hidden (view full) ---

63 return IRQ_HANDLED;
64}
65
66/* Update control registers */
67static void s3c_rtc_setaie(int to)
68{
69 unsigned int tmp;
70
1/* drivers/rtc/rtc-s3c.c
2 *
3 * Copyright (c) 2004,2006 Simtec Electronics
4 * Ben Dooks, <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 54 unchanged lines hidden (view full) ---

63 return IRQ_HANDLED;
64}
65
66/* Update control registers */
67static void s3c_rtc_setaie(int to)
68{
69 unsigned int tmp;
70
71 pr_debug("%s: aie=%d\n", __FUNCTION__, to);
71 pr_debug("%s: aie=%d\n", __func__, to);
72
73 tmp = readb(s3c_rtc_base + S3C2410_RTCALM) & ~S3C2410_RTCALM_ALMEN;
74
75 if (to)
76 tmp |= S3C2410_RTCALM_ALMEN;
77
78 writeb(tmp, s3c_rtc_base + S3C2410_RTCALM);
79}
80
81static void s3c_rtc_setpie(int to)
82{
83 unsigned int tmp;
84
72
73 tmp = readb(s3c_rtc_base + S3C2410_RTCALM) & ~S3C2410_RTCALM_ALMEN;
74
75 if (to)
76 tmp |= S3C2410_RTCALM_ALMEN;
77
78 writeb(tmp, s3c_rtc_base + S3C2410_RTCALM);
79}
80
81static void s3c_rtc_setpie(int to)
82{
83 unsigned int tmp;
84
85 pr_debug("%s: pie=%d\n", __FUNCTION__, to);
85 pr_debug("%s: pie=%d\n", __func__, to);
86
87 spin_lock_irq(&s3c_rtc_pie_lock);
88 tmp = readb(s3c_rtc_base + S3C2410_TICNT) & ~S3C2410_TICNT_ENABLE;
89
90 if (to)
91 tmp |= S3C2410_TICNT_ENABLE;
92
93 writeb(tmp, s3c_rtc_base + S3C2410_TICNT);

--- 358 unchanged lines hidden (view full) ---

452}
453
454static int s3c_rtc_probe(struct platform_device *pdev)
455{
456 struct rtc_device *rtc;
457 struct resource *res;
458 int ret;
459
86
87 spin_lock_irq(&s3c_rtc_pie_lock);
88 tmp = readb(s3c_rtc_base + S3C2410_TICNT) & ~S3C2410_TICNT_ENABLE;
89
90 if (to)
91 tmp |= S3C2410_TICNT_ENABLE;
92
93 writeb(tmp, s3c_rtc_base + S3C2410_TICNT);

--- 358 unchanged lines hidden (view full) ---

452}
453
454static int s3c_rtc_probe(struct platform_device *pdev)
455{
456 struct rtc_device *rtc;
457 struct resource *res;
458 int ret;
459
460 pr_debug("%s: probe=%p\n", __FUNCTION__, pdev);
460 pr_debug("%s: probe=%p\n", __func__, pdev);
461
462 /* find the IRQs */
463
464 s3c_rtc_tickno = platform_get_irq(pdev, 1);
465 if (s3c_rtc_tickno < 0) {
466 dev_err(&pdev->dev, "no irq for rtc tick\n");
467 return -ENOENT;
468 }

--- 127 unchanged lines hidden ---
461
462 /* find the IRQs */
463
464 s3c_rtc_tickno = platform_get_irq(pdev, 1);
465 if (s3c_rtc_tickno < 0) {
466 dev_err(&pdev->dev, "no irq for rtc tick\n");
467 return -ENOENT;
468 }

--- 127 unchanged lines hidden ---