Thomas Gleixner | d2912cb | 2019-06-04 10:11:33 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 2 | /* |
Guan Xuetao | 2809e80 | 2011-05-26 16:43:27 +0800 | [diff] [blame] | 3 | * RTC driver code specific to PKUnity SoC and UniCore ISA |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 4 | * |
| 5 | * Maintained by GUAN Xue-tao <gxt@mprc.pku.edu.cn> |
| 6 | * Copyright (C) 2001-2010 Guan Xuetao |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #include <linux/module.h> |
| 10 | #include <linux/fs.h> |
| 11 | #include <linux/string.h> |
| 12 | #include <linux/init.h> |
| 13 | #include <linux/platform_device.h> |
| 14 | #include <linux/interrupt.h> |
| 15 | #include <linux/rtc.h> |
| 16 | #include <linux/bcd.h> |
| 17 | #include <linux/clk.h> |
| 18 | #include <linux/log2.h> |
| 19 | #include <linux/slab.h> |
| 20 | #include <linux/uaccess.h> |
| 21 | #include <linux/io.h> |
| 22 | |
| 23 | #include <asm/irq.h> |
| 24 | #include <mach/hardware.h> |
| 25 | |
| 26 | static struct resource *puv3_rtc_mem; |
| 27 | |
| 28 | static int puv3_rtc_alarmno = IRQ_RTCAlarm; |
| 29 | static int puv3_rtc_tickno = IRQ_RTC; |
| 30 | |
| 31 | static DEFINE_SPINLOCK(puv3_rtc_pie_lock); |
| 32 | |
| 33 | /* IRQ Handlers */ |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 34 | static irqreturn_t puv3_rtc_alarmirq(int irq, void *id) |
| 35 | { |
| 36 | struct rtc_device *rdev = id; |
| 37 | |
GuanXuetao | e5abf78 | 2011-02-26 21:21:18 +0800 | [diff] [blame] | 38 | writel(readl(RTC_RTSR) | RTC_RTSR_AL, RTC_RTSR); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 39 | rtc_update_irq(rdev, 1, RTC_AF | RTC_IRQF); |
| 40 | return IRQ_HANDLED; |
| 41 | } |
| 42 | |
| 43 | static irqreturn_t puv3_rtc_tickirq(int irq, void *id) |
| 44 | { |
| 45 | struct rtc_device *rdev = id; |
| 46 | |
GuanXuetao | e5abf78 | 2011-02-26 21:21:18 +0800 | [diff] [blame] | 47 | writel(readl(RTC_RTSR) | RTC_RTSR_HZ, RTC_RTSR); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 48 | rtc_update_irq(rdev, 1, RTC_PF | RTC_IRQF); |
| 49 | return IRQ_HANDLED; |
| 50 | } |
| 51 | |
| 52 | /* Update control registers */ |
Sangjung Woo | 1fbc4c4 | 2013-11-12 15:11:00 -0800 | [diff] [blame] | 53 | static void puv3_rtc_setaie(struct device *dev, int to) |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 54 | { |
| 55 | unsigned int tmp; |
| 56 | |
Sangjung Woo | 1fbc4c4 | 2013-11-12 15:11:00 -0800 | [diff] [blame] | 57 | dev_dbg(dev, "%s: aie=%d\n", __func__, to); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 58 | |
GuanXuetao | e5abf78 | 2011-02-26 21:21:18 +0800 | [diff] [blame] | 59 | tmp = readl(RTC_RTSR) & ~RTC_RTSR_ALE; |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 60 | |
| 61 | if (to) |
| 62 | tmp |= RTC_RTSR_ALE; |
| 63 | |
GuanXuetao | e5abf78 | 2011-02-26 21:21:18 +0800 | [diff] [blame] | 64 | writel(tmp, RTC_RTSR); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | static int puv3_rtc_setpie(struct device *dev, int enabled) |
| 68 | { |
| 69 | unsigned int tmp; |
| 70 | |
Chen Gang | c863810 | 2014-05-03 13:07:57 +0800 | [diff] [blame] | 71 | dev_dbg(dev, "%s: pie=%d\n", __func__, enabled); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 72 | |
| 73 | spin_lock_irq(&puv3_rtc_pie_lock); |
GuanXuetao | e5abf78 | 2011-02-26 21:21:18 +0800 | [diff] [blame] | 74 | tmp = readl(RTC_RTSR) & ~RTC_RTSR_HZE; |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 75 | |
| 76 | if (enabled) |
| 77 | tmp |= RTC_RTSR_HZE; |
| 78 | |
GuanXuetao | e5abf78 | 2011-02-26 21:21:18 +0800 | [diff] [blame] | 79 | writel(tmp, RTC_RTSR); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 80 | spin_unlock_irq(&puv3_rtc_pie_lock); |
| 81 | |
| 82 | return 0; |
| 83 | } |
| 84 | |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 85 | /* Time read/write */ |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 86 | static int puv3_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) |
| 87 | { |
Alexandre Belloni | 0155b54 | 2020-03-06 02:02:39 +0100 | [diff] [blame] | 88 | rtc_time64_to_tm(readl(RTC_RCNR), rtc_tm); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 89 | |
Andy Shevchenko | b2db0a2 | 2018-12-04 23:23:21 +0200 | [diff] [blame] | 90 | dev_dbg(dev, "read time %ptRr\n", rtc_tm); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 91 | |
| 92 | return 0; |
| 93 | } |
| 94 | |
| 95 | static int puv3_rtc_settime(struct device *dev, struct rtc_time *tm) |
| 96 | { |
Andy Shevchenko | b2db0a2 | 2018-12-04 23:23:21 +0200 | [diff] [blame] | 97 | dev_dbg(dev, "set time %ptRr\n", tm); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 98 | |
Alexandre Belloni | 0155b54 | 2020-03-06 02:02:39 +0100 | [diff] [blame] | 99 | writel(rtc_tm_to_time64(tm), RTC_RCNR); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 100 | |
| 101 | return 0; |
| 102 | } |
| 103 | |
| 104 | static int puv3_rtc_getalarm(struct device *dev, struct rtc_wkalrm *alrm) |
| 105 | { |
| 106 | struct rtc_time *alm_tm = &alrm->time; |
| 107 | |
Alexandre Belloni | 0155b54 | 2020-03-06 02:02:39 +0100 | [diff] [blame] | 108 | rtc_time64_to_tm(readl(RTC_RTAR), alm_tm); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 109 | |
GuanXuetao | e5abf78 | 2011-02-26 21:21:18 +0800 | [diff] [blame] | 110 | alrm->enabled = readl(RTC_RTSR) & RTC_RTSR_ALE; |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 111 | |
Andy Shevchenko | b2db0a2 | 2018-12-04 23:23:21 +0200 | [diff] [blame] | 112 | dev_dbg(dev, "read alarm: %d, %ptRr\n", alrm->enabled, alm_tm); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 113 | |
| 114 | return 0; |
| 115 | } |
| 116 | |
| 117 | static int puv3_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) |
| 118 | { |
| 119 | struct rtc_time *tm = &alrm->time; |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 120 | |
Andy Shevchenko | b2db0a2 | 2018-12-04 23:23:21 +0200 | [diff] [blame] | 121 | dev_dbg(dev, "set alarm: %d, %ptRr\n", alrm->enabled, tm); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 122 | |
Alexandre Belloni | 0155b54 | 2020-03-06 02:02:39 +0100 | [diff] [blame] | 123 | writel(rtc_tm_to_time64(tm), RTC_RTAR); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 124 | |
Chen Gang | 73fa540 | 2014-05-03 13:09:02 +0800 | [diff] [blame] | 125 | puv3_rtc_setaie(dev, alrm->enabled); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 126 | |
| 127 | if (alrm->enabled) |
| 128 | enable_irq_wake(puv3_rtc_alarmno); |
| 129 | else |
| 130 | disable_irq_wake(puv3_rtc_alarmno); |
| 131 | |
| 132 | return 0; |
| 133 | } |
| 134 | |
| 135 | static int puv3_rtc_proc(struct device *dev, struct seq_file *seq) |
| 136 | { |
| 137 | seq_printf(seq, "periodic_IRQ\t: %s\n", |
GuanXuetao | e5abf78 | 2011-02-26 21:21:18 +0800 | [diff] [blame] | 138 | (readl(RTC_RTSR) & RTC_RTSR_HZE) ? "yes" : "no"); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 139 | return 0; |
| 140 | } |
| 141 | |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 142 | static const struct rtc_class_ops puv3_rtcops = { |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 143 | .read_time = puv3_rtc_gettime, |
| 144 | .set_time = puv3_rtc_settime, |
| 145 | .read_alarm = puv3_rtc_getalarm, |
| 146 | .set_alarm = puv3_rtc_setalarm, |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 147 | .proc = puv3_rtc_proc, |
| 148 | }; |
| 149 | |
Jingoo Han | 5936fdb | 2013-04-29 16:21:02 -0700 | [diff] [blame] | 150 | static void puv3_rtc_enable(struct device *dev, int en) |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 151 | { |
| 152 | if (!en) { |
GuanXuetao | e5abf78 | 2011-02-26 21:21:18 +0800 | [diff] [blame] | 153 | writel(readl(RTC_RTSR) & ~RTC_RTSR_HZE, RTC_RTSR); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 154 | } else { |
| 155 | /* re-enable the device, and check it is ok */ |
GuanXuetao | e5abf78 | 2011-02-26 21:21:18 +0800 | [diff] [blame] | 156 | if ((readl(RTC_RTSR) & RTC_RTSR_HZE) == 0) { |
Jingoo Han | 5936fdb | 2013-04-29 16:21:02 -0700 | [diff] [blame] | 157 | dev_info(dev, "rtc disabled, re-enabling\n"); |
GuanXuetao | e5abf78 | 2011-02-26 21:21:18 +0800 | [diff] [blame] | 158 | writel(readl(RTC_RTSR) | RTC_RTSR_HZE, RTC_RTSR); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 159 | } |
| 160 | } |
| 161 | } |
| 162 | |
Greg Kroah-Hartman | 5a167f4 | 2012-12-21 13:09:38 -0800 | [diff] [blame] | 163 | static int puv3_rtc_remove(struct platform_device *dev) |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 164 | { |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 165 | puv3_rtc_setpie(&dev->dev, 0); |
Sangjung Woo | 1fbc4c4 | 2013-11-12 15:11:00 -0800 | [diff] [blame] | 166 | puv3_rtc_setaie(&dev->dev, 0); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 167 | |
| 168 | release_resource(puv3_rtc_mem); |
| 169 | kfree(puv3_rtc_mem); |
| 170 | |
| 171 | return 0; |
| 172 | } |
| 173 | |
Greg Kroah-Hartman | 5a167f4 | 2012-12-21 13:09:38 -0800 | [diff] [blame] | 174 | static int puv3_rtc_probe(struct platform_device *pdev) |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 175 | { |
| 176 | struct rtc_device *rtc; |
| 177 | struct resource *res; |
| 178 | int ret; |
| 179 | |
Sangjung Woo | 1fbc4c4 | 2013-11-12 15:11:00 -0800 | [diff] [blame] | 180 | dev_dbg(&pdev->dev, "%s: probe=%p\n", __func__, pdev); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 181 | |
| 182 | /* find the IRQs */ |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 183 | puv3_rtc_tickno = platform_get_irq(pdev, 1); |
Stephen Boyd | faac910 | 2019-07-30 11:15:39 -0700 | [diff] [blame] | 184 | if (puv3_rtc_tickno < 0) |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 185 | return -ENOENT; |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 186 | |
| 187 | puv3_rtc_alarmno = platform_get_irq(pdev, 0); |
Stephen Boyd | faac910 | 2019-07-30 11:15:39 -0700 | [diff] [blame] | 188 | if (puv3_rtc_alarmno < 0) |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 189 | return -ENOENT; |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 190 | |
Sangjung Woo | 1fbc4c4 | 2013-11-12 15:11:00 -0800 | [diff] [blame] | 191 | dev_dbg(&pdev->dev, "PKUnity_rtc: tick irq %d, alarm irq %d\n", |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 192 | puv3_rtc_tickno, puv3_rtc_alarmno); |
| 193 | |
Alexandre Belloni | 5539ba5 | 2017-08-22 11:48:41 +0200 | [diff] [blame] | 194 | rtc = devm_rtc_allocate_device(&pdev->dev); |
| 195 | if (IS_ERR(rtc)) |
| 196 | return PTR_ERR(rtc); |
| 197 | |
Alexandre Belloni | 60d3455 | 2017-08-22 11:59:07 +0200 | [diff] [blame] | 198 | ret = devm_request_irq(&pdev->dev, puv3_rtc_alarmno, puv3_rtc_alarmirq, |
| 199 | 0, "pkunity-rtc alarm", rtc); |
| 200 | if (ret) { |
| 201 | dev_err(&pdev->dev, "IRQ%d error %d\n", puv3_rtc_alarmno, ret); |
| 202 | return ret; |
| 203 | } |
| 204 | |
| 205 | ret = devm_request_irq(&pdev->dev, puv3_rtc_tickno, puv3_rtc_tickirq, |
| 206 | 0, "pkunity-rtc tick", rtc); |
| 207 | if (ret) { |
| 208 | dev_err(&pdev->dev, "IRQ%d error %d\n", puv3_rtc_tickno, ret); |
| 209 | return ret; |
| 210 | } |
| 211 | |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 212 | /* get the memory region */ |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 213 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 214 | if (res == NULL) { |
| 215 | dev_err(&pdev->dev, "failed to get memory region resource\n"); |
| 216 | return -ENOENT; |
| 217 | } |
| 218 | |
Joe Perches | 28f65c11 | 2011-06-09 09:13:32 -0700 | [diff] [blame] | 219 | puv3_rtc_mem = request_mem_region(res->start, resource_size(res), |
| 220 | pdev->name); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 221 | |
| 222 | if (puv3_rtc_mem == NULL) { |
| 223 | dev_err(&pdev->dev, "failed to reserve memory region\n"); |
| 224 | ret = -ENOENT; |
| 225 | goto err_nores; |
| 226 | } |
| 227 | |
Jingoo Han | 5936fdb | 2013-04-29 16:21:02 -0700 | [diff] [blame] | 228 | puv3_rtc_enable(&pdev->dev, 1); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 229 | |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 230 | /* register RTC and exit */ |
Alexandre Belloni | 5539ba5 | 2017-08-22 11:48:41 +0200 | [diff] [blame] | 231 | rtc->ops = &puv3_rtcops; |
Alexandre Belloni | a04b3b9 | 2020-03-06 02:02:38 +0100 | [diff] [blame] | 232 | rtc->range_max = U32_MAX; |
Alexandre Belloni | 5539ba5 | 2017-08-22 11:48:41 +0200 | [diff] [blame] | 233 | ret = rtc_register_device(rtc); |
Alexandre Belloni | 44c638c | 2019-08-19 00:00:41 +0200 | [diff] [blame] | 234 | if (ret) |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 235 | goto err_nortc; |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 236 | |
| 237 | /* platform setup code should have handled this; sigh */ |
| 238 | if (!device_can_wakeup(&pdev->dev)) |
| 239 | device_init_wakeup(&pdev->dev, 1); |
| 240 | |
| 241 | platform_set_drvdata(pdev, rtc); |
| 242 | return 0; |
| 243 | |
| 244 | err_nortc: |
Jingoo Han | 5936fdb | 2013-04-29 16:21:02 -0700 | [diff] [blame] | 245 | puv3_rtc_enable(&pdev->dev, 0); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 246 | release_resource(puv3_rtc_mem); |
| 247 | |
| 248 | err_nores: |
| 249 | return ret; |
| 250 | } |
| 251 | |
Jingoo Han | 5936fdb | 2013-04-29 16:21:02 -0700 | [diff] [blame] | 252 | #ifdef CONFIG_PM_SLEEP |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 253 | static int ticnt_save; |
| 254 | |
Jingoo Han | 5936fdb | 2013-04-29 16:21:02 -0700 | [diff] [blame] | 255 | static int puv3_rtc_suspend(struct device *dev) |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 256 | { |
| 257 | /* save RTAR for anyone using periodic interrupts */ |
GuanXuetao | e5abf78 | 2011-02-26 21:21:18 +0800 | [diff] [blame] | 258 | ticnt_save = readl(RTC_RTAR); |
Jingoo Han | 5936fdb | 2013-04-29 16:21:02 -0700 | [diff] [blame] | 259 | puv3_rtc_enable(dev, 0); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 260 | return 0; |
| 261 | } |
| 262 | |
Jingoo Han | 5936fdb | 2013-04-29 16:21:02 -0700 | [diff] [blame] | 263 | static int puv3_rtc_resume(struct device *dev) |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 264 | { |
Jingoo Han | 5936fdb | 2013-04-29 16:21:02 -0700 | [diff] [blame] | 265 | puv3_rtc_enable(dev, 1); |
GuanXuetao | e5abf78 | 2011-02-26 21:21:18 +0800 | [diff] [blame] | 266 | writel(ticnt_save, RTC_RTAR); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 267 | return 0; |
| 268 | } |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 269 | #endif |
| 270 | |
Jingoo Han | 5936fdb | 2013-04-29 16:21:02 -0700 | [diff] [blame] | 271 | static SIMPLE_DEV_PM_OPS(puv3_rtc_pm_ops, puv3_rtc_suspend, puv3_rtc_resume); |
| 272 | |
Guan Xuetao | b3a0aa3 | 2011-12-28 09:24:29 +0800 | [diff] [blame] | 273 | static struct platform_driver puv3_rtc_driver = { |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 274 | .probe = puv3_rtc_probe, |
Greg Kroah-Hartman | 5a167f4 | 2012-12-21 13:09:38 -0800 | [diff] [blame] | 275 | .remove = puv3_rtc_remove, |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 276 | .driver = { |
| 277 | .name = "PKUnity-v3-RTC", |
Jingoo Han | 5936fdb | 2013-04-29 16:21:02 -0700 | [diff] [blame] | 278 | .pm = &puv3_rtc_pm_ops, |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 279 | } |
| 280 | }; |
| 281 | |
Guan Xuetao | b3a0aa3 | 2011-12-28 09:24:29 +0800 | [diff] [blame] | 282 | module_platform_driver(puv3_rtc_driver); |
GuanXuetao | 02b2ee1 | 2011-01-15 18:19:03 +0800 | [diff] [blame] | 283 | |
| 284 | MODULE_DESCRIPTION("RTC Driver for the PKUnity v3 chip"); |
| 285 | MODULE_AUTHOR("Hu Dongliang"); |
| 286 | MODULE_LICENSE("GPL v2"); |