blob: d2cdb9823a1573225c9f61c18ed4513fb8cb8126 [file] [log] [blame]
Rajeev Kumar0942a712011-05-26 16:25:09 -07001/*
2 * drivers/rtc/rtc-spear.c
3 *
4 * Copyright (C) 2010 ST Microelectronics
5 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12#include <linux/bcd.h>
13#include <linux/clk.h>
14#include <linux/delay.h>
15#include <linux/init.h>
16#include <linux/io.h>
17#include <linux/irq.h>
18#include <linux/module.h>
Viresh Kumar0108c4f2012-05-29 15:07:35 -070019#include <linux/of.h>
Rajeev Kumar0942a712011-05-26 16:25:09 -070020#include <linux/platform_device.h>
21#include <linux/rtc.h>
22#include <linux/slab.h>
23#include <linux/spinlock.h>
24
25/* RTC registers */
26#define TIME_REG 0x00
27#define DATE_REG 0x04
28#define ALARM_TIME_REG 0x08
29#define ALARM_DATE_REG 0x0C
30#define CTRL_REG 0x10
31#define STATUS_REG 0x14
32
33/* TIME_REG & ALARM_TIME_REG */
34#define SECONDS_UNITS (0xf<<0) /* seconds units position */
35#define SECONDS_TENS (0x7<<4) /* seconds tens position */
36#define MINUTES_UNITS (0xf<<8) /* minutes units position */
37#define MINUTES_TENS (0x7<<12) /* minutes tens position */
38#define HOURS_UNITS (0xf<<16) /* hours units position */
39#define HOURS_TENS (0x3<<20) /* hours tens position */
40
41/* DATE_REG & ALARM_DATE_REG */
42#define DAYS_UNITS (0xf<<0) /* days units position */
43#define DAYS_TENS (0x3<<4) /* days tens position */
44#define MONTHS_UNITS (0xf<<8) /* months units position */
45#define MONTHS_TENS (0x1<<12) /* months tens position */
46#define YEARS_UNITS (0xf<<16) /* years units position */
47#define YEARS_TENS (0xf<<20) /* years tens position */
48#define YEARS_HUNDREDS (0xf<<24) /* years hundereds position */
49#define YEARS_MILLENIUMS (0xf<<28) /* years millenium position */
50
51/* MASK SHIFT TIME_REG & ALARM_TIME_REG*/
52#define SECOND_SHIFT 0x00 /* seconds units */
53#define MINUTE_SHIFT 0x08 /* minutes units position */
54#define HOUR_SHIFT 0x10 /* hours units position */
55#define MDAY_SHIFT 0x00 /* Month day shift */
56#define MONTH_SHIFT 0x08 /* Month shift */
57#define YEAR_SHIFT 0x10 /* Year shift */
58
59#define SECOND_MASK 0x7F
60#define MIN_MASK 0x7F
61#define HOUR_MASK 0x3F
62#define DAY_MASK 0x3F
63#define MONTH_MASK 0x7F
64#define YEAR_MASK 0xFFFF
65
66/* date reg equal to time reg, for debug only */
67#define TIME_BYP (1<<9)
68#define INT_ENABLE (1<<31) /* interrupt enable */
69
70/* STATUS_REG */
71#define CLK_UNCONNECTED (1<<0)
72#define PEND_WR_TIME (1<<2)
73#define PEND_WR_DATE (1<<3)
74#define LOST_WR_TIME (1<<4)
75#define LOST_WR_DATE (1<<5)
76#define RTC_INT_MASK (1<<31)
77#define STATUS_BUSY (PEND_WR_TIME | PEND_WR_DATE)
78#define STATUS_FAIL (LOST_WR_TIME | LOST_WR_DATE)
79
80struct spear_rtc_config {
Viresh Kumaree6c54c2012-03-23 15:02:30 -070081 struct rtc_device *rtc;
Rajeev Kumar0942a712011-05-26 16:25:09 -070082 struct clk *clk;
83 spinlock_t lock;
84 void __iomem *ioaddr;
Deepak Sikricd0e08a2012-03-23 15:02:29 -070085 unsigned int irq_wake;
Rajeev Kumar0942a712011-05-26 16:25:09 -070086};
87
88static inline void spear_rtc_clear_interrupt(struct spear_rtc_config *config)
89{
90 unsigned int val;
91 unsigned long flags;
92
93 spin_lock_irqsave(&config->lock, flags);
94 val = readl(config->ioaddr + STATUS_REG);
95 val |= RTC_INT_MASK;
96 writel(val, config->ioaddr + STATUS_REG);
97 spin_unlock_irqrestore(&config->lock, flags);
98}
99
100static inline void spear_rtc_enable_interrupt(struct spear_rtc_config *config)
101{
102 unsigned int val;
103
104 val = readl(config->ioaddr + CTRL_REG);
105 if (!(val & INT_ENABLE)) {
106 spear_rtc_clear_interrupt(config);
107 val |= INT_ENABLE;
108 writel(val, config->ioaddr + CTRL_REG);
109 }
110}
111
112static inline void spear_rtc_disable_interrupt(struct spear_rtc_config *config)
113{
114 unsigned int val;
115
116 val = readl(config->ioaddr + CTRL_REG);
117 if (val & INT_ENABLE) {
118 val &= ~INT_ENABLE;
119 writel(val, config->ioaddr + CTRL_REG);
120 }
121}
122
123static inline int is_write_complete(struct spear_rtc_config *config)
124{
125 int ret = 0;
126 unsigned long flags;
127
128 spin_lock_irqsave(&config->lock, flags);
129 if ((readl(config->ioaddr + STATUS_REG)) & STATUS_FAIL)
130 ret = -EIO;
131 spin_unlock_irqrestore(&config->lock, flags);
132
133 return ret;
134}
135
136static void rtc_wait_not_busy(struct spear_rtc_config *config)
137{
138 int status, count = 0;
139 unsigned long flags;
140
141 /* Assuming BUSY may stay active for 80 msec) */
142 for (count = 0; count < 80; count++) {
143 spin_lock_irqsave(&config->lock, flags);
144 status = readl(config->ioaddr + STATUS_REG);
145 spin_unlock_irqrestore(&config->lock, flags);
146 if ((status & STATUS_BUSY) == 0)
147 break;
148 /* check status busy, after each msec */
149 msleep(1);
150 }
151}
152
153static irqreturn_t spear_rtc_irq(int irq, void *dev_id)
154{
Viresh Kumaree6c54c2012-03-23 15:02:30 -0700155 struct spear_rtc_config *config = dev_id;
Rajeev Kumar0942a712011-05-26 16:25:09 -0700156 unsigned long flags, events = 0;
157 unsigned int irq_data;
158
159 spin_lock_irqsave(&config->lock, flags);
160 irq_data = readl(config->ioaddr + STATUS_REG);
161 spin_unlock_irqrestore(&config->lock, flags);
162
163 if ((irq_data & RTC_INT_MASK)) {
164 spear_rtc_clear_interrupt(config);
165 events = RTC_IRQF | RTC_AF;
Viresh Kumaree6c54c2012-03-23 15:02:30 -0700166 rtc_update_irq(config->rtc, 1, events);
Rajeev Kumar0942a712011-05-26 16:25:09 -0700167 return IRQ_HANDLED;
168 } else
169 return IRQ_NONE;
170
171}
172
173static int tm2bcd(struct rtc_time *tm)
174{
175 if (rtc_valid_tm(tm) != 0)
176 return -EINVAL;
177 tm->tm_sec = bin2bcd(tm->tm_sec);
178 tm->tm_min = bin2bcd(tm->tm_min);
179 tm->tm_hour = bin2bcd(tm->tm_hour);
180 tm->tm_mday = bin2bcd(tm->tm_mday);
181 tm->tm_mon = bin2bcd(tm->tm_mon + 1);
182 tm->tm_year = bin2bcd(tm->tm_year);
183
184 return 0;
185}
186
187static void bcd2tm(struct rtc_time *tm)
188{
189 tm->tm_sec = bcd2bin(tm->tm_sec);
190 tm->tm_min = bcd2bin(tm->tm_min);
191 tm->tm_hour = bcd2bin(tm->tm_hour);
192 tm->tm_mday = bcd2bin(tm->tm_mday);
193 tm->tm_mon = bcd2bin(tm->tm_mon) - 1;
194 /* epoch == 1900 */
195 tm->tm_year = bcd2bin(tm->tm_year);
196}
197
198/*
199 * spear_rtc_read_time - set the time
200 * @dev: rtc device in use
201 * @tm: holds date and time
202 *
203 * This function read time and date. On success it will return 0
204 * otherwise -ve error is returned.
205 */
206static int spear_rtc_read_time(struct device *dev, struct rtc_time *tm)
207{
Viresh Kumaree6c54c2012-03-23 15:02:30 -0700208 struct spear_rtc_config *config = dev_get_drvdata(dev);
Rajeev Kumar0942a712011-05-26 16:25:09 -0700209 unsigned int time, date;
210
211 /* we don't report wday/yday/isdst ... */
212 rtc_wait_not_busy(config);
213
214 time = readl(config->ioaddr + TIME_REG);
215 date = readl(config->ioaddr + DATE_REG);
216 tm->tm_sec = (time >> SECOND_SHIFT) & SECOND_MASK;
217 tm->tm_min = (time >> MINUTE_SHIFT) & MIN_MASK;
218 tm->tm_hour = (time >> HOUR_SHIFT) & HOUR_MASK;
219 tm->tm_mday = (date >> MDAY_SHIFT) & DAY_MASK;
220 tm->tm_mon = (date >> MONTH_SHIFT) & MONTH_MASK;
221 tm->tm_year = (date >> YEAR_SHIFT) & YEAR_MASK;
222
223 bcd2tm(tm);
224 return 0;
225}
226
227/*
228 * spear_rtc_set_time - set the time
229 * @dev: rtc device in use
230 * @tm: holds date and time
231 *
232 * This function set time and date. On success it will return 0
233 * otherwise -ve error is returned.
234 */
235static int spear_rtc_set_time(struct device *dev, struct rtc_time *tm)
236{
Viresh Kumaree6c54c2012-03-23 15:02:30 -0700237 struct spear_rtc_config *config = dev_get_drvdata(dev);
Lars-Peter Clausena16e8392012-10-04 17:14:01 -0700238 unsigned int time, date;
Rajeev Kumar0942a712011-05-26 16:25:09 -0700239
240 if (tm2bcd(tm) < 0)
241 return -EINVAL;
242
243 rtc_wait_not_busy(config);
244 time = (tm->tm_sec << SECOND_SHIFT) | (tm->tm_min << MINUTE_SHIFT) |
245 (tm->tm_hour << HOUR_SHIFT);
246 date = (tm->tm_mday << MDAY_SHIFT) | (tm->tm_mon << MONTH_SHIFT) |
247 (tm->tm_year << YEAR_SHIFT);
248 writel(time, config->ioaddr + TIME_REG);
249 writel(date, config->ioaddr + DATE_REG);
Rajeev Kumar0942a712011-05-26 16:25:09 -0700250
Lars-Peter Clausena16e8392012-10-04 17:14:01 -0700251 return is_write_complete(config);
Rajeev Kumar0942a712011-05-26 16:25:09 -0700252}
253
254/*
255 * spear_rtc_read_alarm - read the alarm time
256 * @dev: rtc device in use
257 * @alm: holds alarm date and time
258 *
259 * This function read alarm time and date. On success it will return 0
260 * otherwise -ve error is returned.
261 */
262static int spear_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
263{
Viresh Kumaree6c54c2012-03-23 15:02:30 -0700264 struct spear_rtc_config *config = dev_get_drvdata(dev);
Rajeev Kumar0942a712011-05-26 16:25:09 -0700265 unsigned int time, date;
266
267 rtc_wait_not_busy(config);
268
269 time = readl(config->ioaddr + ALARM_TIME_REG);
270 date = readl(config->ioaddr + ALARM_DATE_REG);
271 alm->time.tm_sec = (time >> SECOND_SHIFT) & SECOND_MASK;
272 alm->time.tm_min = (time >> MINUTE_SHIFT) & MIN_MASK;
273 alm->time.tm_hour = (time >> HOUR_SHIFT) & HOUR_MASK;
274 alm->time.tm_mday = (date >> MDAY_SHIFT) & DAY_MASK;
275 alm->time.tm_mon = (date >> MONTH_SHIFT) & MONTH_MASK;
276 alm->time.tm_year = (date >> YEAR_SHIFT) & YEAR_MASK;
277
278 bcd2tm(&alm->time);
279 alm->enabled = readl(config->ioaddr + CTRL_REG) & INT_ENABLE;
280
281 return 0;
282}
283
284/*
285 * spear_rtc_set_alarm - set the alarm time
286 * @dev: rtc device in use
287 * @alm: holds alarm date and time
288 *
289 * This function set alarm time and date. On success it will return 0
290 * otherwise -ve error is returned.
291 */
292static int spear_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
293{
Viresh Kumaree6c54c2012-03-23 15:02:30 -0700294 struct spear_rtc_config *config = dev_get_drvdata(dev);
Lars-Peter Clausena16e8392012-10-04 17:14:01 -0700295 unsigned int time, date;
296 int err;
Rajeev Kumar0942a712011-05-26 16:25:09 -0700297
298 if (tm2bcd(&alm->time) < 0)
299 return -EINVAL;
300
301 rtc_wait_not_busy(config);
302
303 time = (alm->time.tm_sec << SECOND_SHIFT) | (alm->time.tm_min <<
304 MINUTE_SHIFT) | (alm->time.tm_hour << HOUR_SHIFT);
305 date = (alm->time.tm_mday << MDAY_SHIFT) | (alm->time.tm_mon <<
306 MONTH_SHIFT) | (alm->time.tm_year << YEAR_SHIFT);
307
308 writel(time, config->ioaddr + ALARM_TIME_REG);
309 writel(date, config->ioaddr + ALARM_DATE_REG);
310 err = is_write_complete(config);
311 if (err < 0)
312 return err;
313
314 if (alm->enabled)
315 spear_rtc_enable_interrupt(config);
316 else
317 spear_rtc_disable_interrupt(config);
318
319 return 0;
320}
Shiraz Hashim131f8b72012-03-23 15:02:29 -0700321
322static int spear_alarm_irq_enable(struct device *dev, unsigned int enabled)
323{
Viresh Kumaree6c54c2012-03-23 15:02:30 -0700324 struct spear_rtc_config *config = dev_get_drvdata(dev);
Shiraz Hashim131f8b72012-03-23 15:02:29 -0700325 int ret = 0;
326
327 spear_rtc_clear_interrupt(config);
328
329 switch (enabled) {
330 case 0:
331 /* alarm off */
332 spear_rtc_disable_interrupt(config);
333 break;
334 case 1:
335 /* alarm on */
336 spear_rtc_enable_interrupt(config);
337 break;
338 default:
339 ret = -EINVAL;
340 break;
341 }
342
343 return ret;
344}
345
Rajeev Kumar0942a712011-05-26 16:25:09 -0700346static struct rtc_class_ops spear_rtc_ops = {
347 .read_time = spear_rtc_read_time,
348 .set_time = spear_rtc_set_time,
349 .read_alarm = spear_rtc_read_alarm,
350 .set_alarm = spear_rtc_set_alarm,
Shiraz Hashim131f8b72012-03-23 15:02:29 -0700351 .alarm_irq_enable = spear_alarm_irq_enable,
Rajeev Kumar0942a712011-05-26 16:25:09 -0700352};
353
Greg Kroah-Hartman5a167f42012-12-21 13:09:38 -0800354static int spear_rtc_probe(struct platform_device *pdev)
Rajeev Kumar0942a712011-05-26 16:25:09 -0700355{
356 struct resource *res;
Rajeev Kumar0942a712011-05-26 16:25:09 -0700357 struct spear_rtc_config *config;
Lars-Peter Clausena16e8392012-10-04 17:14:01 -0700358 int status = 0;
Rajeev Kumar0942a712011-05-26 16:25:09 -0700359 int irq;
360
361 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
362 if (!res) {
363 dev_err(&pdev->dev, "no resource defined\n");
364 return -EBUSY;
365 }
Rajeev Kumar0942a712011-05-26 16:25:09 -0700366
Viresh Kumarbdaa2c62012-12-17 16:02:29 -0800367 config = devm_kzalloc(&pdev->dev, sizeof(*config), GFP_KERNEL);
Jingoo Han681acc92014-04-03 14:49:46 -0700368 if (!config)
Viresh Kumarbdaa2c62012-12-17 16:02:29 -0800369 return -ENOMEM;
Rajeev Kumar0942a712011-05-26 16:25:09 -0700370
Viresh Kumarbdaa2c62012-12-17 16:02:29 -0800371 /* alarm irqs */
372 irq = platform_get_irq(pdev, 0);
373 if (irq < 0) {
374 dev_err(&pdev->dev, "no update irq?\n");
375 return irq;
Rajeev Kumar0942a712011-05-26 16:25:09 -0700376 }
377
Viresh Kumarbdaa2c62012-12-17 16:02:29 -0800378 status = devm_request_irq(&pdev->dev, irq, spear_rtc_irq, 0, pdev->name,
379 config);
380 if (status) {
381 dev_err(&pdev->dev, "Alarm interrupt IRQ%d already claimed\n",
382 irq);
383 return status;
384 }
385
Thierry Reding8cbce1e2013-01-21 11:09:17 +0100386 config->ioaddr = devm_ioremap_resource(&pdev->dev, res);
387 if (IS_ERR(config->ioaddr))
388 return PTR_ERR(config->ioaddr);
Viresh Kumarbdaa2c62012-12-17 16:02:29 -0800389
390 config->clk = devm_clk_get(&pdev->dev, NULL);
391 if (IS_ERR(config->clk))
392 return PTR_ERR(config->clk);
393
Deepak Sikri93d78392012-12-17 16:02:32 -0800394 status = clk_prepare_enable(config->clk);
Rajeev Kumar0942a712011-05-26 16:25:09 -0700395 if (status < 0)
Viresh Kumarbdaa2c62012-12-17 16:02:29 -0800396 return status;
Rajeev Kumar0942a712011-05-26 16:25:09 -0700397
398 spin_lock_init(&config->lock);
Viresh Kumaree6c54c2012-03-23 15:02:30 -0700399 platform_set_drvdata(pdev, config);
Rajeev Kumar0942a712011-05-26 16:25:09 -0700400
Jingoo Han246b1a92013-04-29 16:19:13 -0700401 config->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
402 &spear_rtc_ops, THIS_MODULE);
Viresh Kumaree6c54c2012-03-23 15:02:30 -0700403 if (IS_ERR(config->rtc)) {
Rajeev Kumar0942a712011-05-26 16:25:09 -0700404 dev_err(&pdev->dev, "can't register RTC device, err %ld\n",
Viresh Kumaree6c54c2012-03-23 15:02:30 -0700405 PTR_ERR(config->rtc));
406 status = PTR_ERR(config->rtc);
Viresh Kumarbdaa2c62012-12-17 16:02:29 -0800407 goto err_disable_clock;
Rajeev Kumar0942a712011-05-26 16:25:09 -0700408 }
409
Deepak Sikric9f5c7e2012-12-17 16:02:34 -0800410 config->rtc->uie_unsupported = 1;
411
Rajeev Kumar0942a712011-05-26 16:25:09 -0700412 if (!device_can_wakeup(&pdev->dev))
413 device_init_wakeup(&pdev->dev, 1);
414
415 return 0;
416
Rajeev Kumar0942a712011-05-26 16:25:09 -0700417err_disable_clock:
Deepak Sikri93d78392012-12-17 16:02:32 -0800418 clk_disable_unprepare(config->clk);
Rajeev Kumar0942a712011-05-26 16:25:09 -0700419
420 return status;
421}
422
Greg Kroah-Hartman5a167f42012-12-21 13:09:38 -0800423static int spear_rtc_remove(struct platform_device *pdev)
Rajeev Kumar0942a712011-05-26 16:25:09 -0700424{
Viresh Kumaree6c54c2012-03-23 15:02:30 -0700425 struct spear_rtc_config *config = platform_get_drvdata(pdev);
Rajeev Kumar0942a712011-05-26 16:25:09 -0700426
Viresh Kumarbdaa2c62012-12-17 16:02:29 -0800427 spear_rtc_disable_interrupt(config);
Deepak Sikri93d78392012-12-17 16:02:32 -0800428 clk_disable_unprepare(config->clk);
Viresh Kumarbdaa2c62012-12-17 16:02:29 -0800429 device_init_wakeup(&pdev->dev, 0);
Rajeev Kumar0942a712011-05-26 16:25:09 -0700430
431 return 0;
432}
433
Jingoo Hanb086e392013-04-29 16:21:02 -0700434#ifdef CONFIG_PM_SLEEP
435static int spear_rtc_suspend(struct device *dev)
Rajeev Kumar0942a712011-05-26 16:25:09 -0700436{
Jingoo Hanb086e392013-04-29 16:21:02 -0700437 struct platform_device *pdev = to_platform_device(dev);
Viresh Kumaree6c54c2012-03-23 15:02:30 -0700438 struct spear_rtc_config *config = platform_get_drvdata(pdev);
Rajeev Kumar0942a712011-05-26 16:25:09 -0700439 int irq;
440
441 irq = platform_get_irq(pdev, 0);
Deepak Sikricd0e08a2012-03-23 15:02:29 -0700442 if (device_may_wakeup(&pdev->dev)) {
443 if (!enable_irq_wake(irq))
444 config->irq_wake = 1;
445 } else {
Rajeev Kumar0942a712011-05-26 16:25:09 -0700446 spear_rtc_disable_interrupt(config);
447 clk_disable(config->clk);
448 }
449
450 return 0;
451}
452
Jingoo Hanb086e392013-04-29 16:21:02 -0700453static int spear_rtc_resume(struct device *dev)
Rajeev Kumar0942a712011-05-26 16:25:09 -0700454{
Jingoo Hanb086e392013-04-29 16:21:02 -0700455 struct platform_device *pdev = to_platform_device(dev);
Viresh Kumaree6c54c2012-03-23 15:02:30 -0700456 struct spear_rtc_config *config = platform_get_drvdata(pdev);
Rajeev Kumar0942a712011-05-26 16:25:09 -0700457 int irq;
458
459 irq = platform_get_irq(pdev, 0);
460
Deepak Sikricd0e08a2012-03-23 15:02:29 -0700461 if (device_may_wakeup(&pdev->dev)) {
462 if (config->irq_wake) {
463 disable_irq_wake(irq);
464 config->irq_wake = 0;
465 }
466 } else {
Rajeev Kumar0942a712011-05-26 16:25:09 -0700467 clk_enable(config->clk);
468 spear_rtc_enable_interrupt(config);
469 }
470
471 return 0;
472}
Rajeev Kumar0942a712011-05-26 16:25:09 -0700473#endif
474
Jingoo Hanb086e392013-04-29 16:21:02 -0700475static SIMPLE_DEV_PM_OPS(spear_rtc_pm_ops, spear_rtc_suspend, spear_rtc_resume);
476
Rajeev Kumar0942a712011-05-26 16:25:09 -0700477static void spear_rtc_shutdown(struct platform_device *pdev)
478{
Viresh Kumaree6c54c2012-03-23 15:02:30 -0700479 struct spear_rtc_config *config = platform_get_drvdata(pdev);
Rajeev Kumar0942a712011-05-26 16:25:09 -0700480
481 spear_rtc_disable_interrupt(config);
482 clk_disable(config->clk);
483}
484
Viresh Kumar0108c4f2012-05-29 15:07:35 -0700485#ifdef CONFIG_OF
486static const struct of_device_id spear_rtc_id_table[] = {
487 { .compatible = "st,spear600-rtc" },
488 {}
489};
490MODULE_DEVICE_TABLE(of, spear_rtc_id_table);
491#endif
492
Rajeev Kumar0942a712011-05-26 16:25:09 -0700493static struct platform_driver spear_rtc_driver = {
494 .probe = spear_rtc_probe,
Greg Kroah-Hartman5a167f42012-12-21 13:09:38 -0800495 .remove = spear_rtc_remove,
Rajeev Kumar0942a712011-05-26 16:25:09 -0700496 .shutdown = spear_rtc_shutdown,
497 .driver = {
498 .name = "rtc-spear",
Jingoo Hanb086e392013-04-29 16:21:02 -0700499 .pm = &spear_rtc_pm_ops,
Viresh Kumar0108c4f2012-05-29 15:07:35 -0700500 .of_match_table = of_match_ptr(spear_rtc_id_table),
Rajeev Kumar0942a712011-05-26 16:25:09 -0700501 },
502};
503
Axel Lin0c4eae62012-01-10 15:10:48 -0800504module_platform_driver(spear_rtc_driver);
Rajeev Kumar0942a712011-05-26 16:25:09 -0700505
506MODULE_ALIAS("platform:rtc-spear");
507MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>");
508MODULE_DESCRIPTION("ST SPEAr Realtime Clock Driver (RTC)");
509MODULE_LICENSE("GPL");