David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 1 | /* |
| 2 | * TI OMAP1 Real Time Clock interface for Linux |
| 3 | * |
| 4 | * Copyright (C) 2003 MontaVista Software, Inc. |
| 5 | * Author: George G. Davis <gdavis@mvista.com> or <source@mvista.com> |
| 6 | * |
| 7 | * Copyright (C) 2006 David Brownell (new RTC framework) |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU General Public License |
| 11 | * as published by the Free Software Foundation; either version |
| 12 | * 2 of the License, or (at your option) any later version. |
| 13 | */ |
| 14 | |
| 15 | #include <linux/kernel.h> |
| 16 | #include <linux/init.h> |
| 17 | #include <linux/module.h> |
| 18 | #include <linux/ioport.h> |
| 19 | #include <linux/delay.h> |
| 20 | #include <linux/rtc.h> |
| 21 | #include <linux/bcd.h> |
| 22 | #include <linux/platform_device.h> |
Afzal Mohammed | 9e0344d | 2012-12-17 16:02:15 -0800 | [diff] [blame] | 23 | #include <linux/of.h> |
| 24 | #include <linux/of_device.h> |
Vaibhav Hiremath | fc9bd90 | 2012-12-17 16:02:18 -0800 | [diff] [blame] | 25 | #include <linux/pm_runtime.h> |
Sachin Kamat | 4b30c9f | 2013-07-03 15:06:00 -0700 | [diff] [blame] | 26 | #include <linux/io.h> |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 27 | |
| 28 | /* The OMAP1 RTC is a year/month/day/hours/minutes/seconds BCD clock |
| 29 | * with century-range alarm matching, driven by the 32kHz clock. |
| 30 | * |
| 31 | * The main user-visible ways it differs from PC RTCs are by omitting |
| 32 | * "don't care" alarm fields and sub-second periodic IRQs, and having |
| 33 | * an autoadjust mechanism to calibrate to the true oscillator rate. |
| 34 | * |
| 35 | * Board-specific wiring options include using split power mode with |
| 36 | * RTC_OFF_NOFF used as the reset signal (so the RTC won't be reset), |
| 37 | * and wiring RTC_WAKE_INT (so the RTC alarm can wake the system from |
Sekhar Nori | fa5b078 | 2010-10-27 15:33:05 -0700 | [diff] [blame] | 38 | * low power modes) for OMAP1 boards (OMAP-L138 has this built into |
| 39 | * the SoC). See the BOARD-SPECIFIC CUSTOMIZATION comment. |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 40 | */ |
| 41 | |
Afzal Mohammed | cab1458 | 2012-12-17 16:02:11 -0800 | [diff] [blame] | 42 | #define DRIVER_NAME "omap_rtc" |
| 43 | |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 44 | /* RTC registers */ |
| 45 | #define OMAP_RTC_SECONDS_REG 0x00 |
| 46 | #define OMAP_RTC_MINUTES_REG 0x04 |
| 47 | #define OMAP_RTC_HOURS_REG 0x08 |
| 48 | #define OMAP_RTC_DAYS_REG 0x0C |
| 49 | #define OMAP_RTC_MONTHS_REG 0x10 |
| 50 | #define OMAP_RTC_YEARS_REG 0x14 |
| 51 | #define OMAP_RTC_WEEKS_REG 0x18 |
| 52 | |
| 53 | #define OMAP_RTC_ALARM_SECONDS_REG 0x20 |
| 54 | #define OMAP_RTC_ALARM_MINUTES_REG 0x24 |
| 55 | #define OMAP_RTC_ALARM_HOURS_REG 0x28 |
| 56 | #define OMAP_RTC_ALARM_DAYS_REG 0x2c |
| 57 | #define OMAP_RTC_ALARM_MONTHS_REG 0x30 |
| 58 | #define OMAP_RTC_ALARM_YEARS_REG 0x34 |
| 59 | |
| 60 | #define OMAP_RTC_CTRL_REG 0x40 |
| 61 | #define OMAP_RTC_STATUS_REG 0x44 |
| 62 | #define OMAP_RTC_INTERRUPTS_REG 0x48 |
| 63 | |
| 64 | #define OMAP_RTC_COMP_LSB_REG 0x4c |
| 65 | #define OMAP_RTC_COMP_MSB_REG 0x50 |
| 66 | #define OMAP_RTC_OSC_REG 0x54 |
| 67 | |
Afzal Mohammed | cab1458 | 2012-12-17 16:02:11 -0800 | [diff] [blame] | 68 | #define OMAP_RTC_KICK0_REG 0x6c |
| 69 | #define OMAP_RTC_KICK1_REG 0x70 |
| 70 | |
Hebbar Gururaja | 8af750e | 2013-09-11 14:24:18 -0700 | [diff] [blame] | 71 | #define OMAP_RTC_IRQWAKEEN 0x7c |
| 72 | |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 73 | /* OMAP_RTC_CTRL_REG bit fields: */ |
Sekhar Nori | 92adb96 | 2014-06-06 14:36:05 -0700 | [diff] [blame] | 74 | #define OMAP_RTC_CTRL_SPLIT BIT(7) |
| 75 | #define OMAP_RTC_CTRL_DISABLE BIT(6) |
| 76 | #define OMAP_RTC_CTRL_SET_32_COUNTER BIT(5) |
| 77 | #define OMAP_RTC_CTRL_TEST BIT(4) |
| 78 | #define OMAP_RTC_CTRL_MODE_12_24 BIT(3) |
| 79 | #define OMAP_RTC_CTRL_AUTO_COMP BIT(2) |
| 80 | #define OMAP_RTC_CTRL_ROUND_30S BIT(1) |
| 81 | #define OMAP_RTC_CTRL_STOP BIT(0) |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 82 | |
| 83 | /* OMAP_RTC_STATUS_REG bit fields: */ |
Sekhar Nori | 92adb96 | 2014-06-06 14:36:05 -0700 | [diff] [blame] | 84 | #define OMAP_RTC_STATUS_POWER_UP BIT(7) |
| 85 | #define OMAP_RTC_STATUS_ALARM BIT(6) |
| 86 | #define OMAP_RTC_STATUS_1D_EVENT BIT(5) |
| 87 | #define OMAP_RTC_STATUS_1H_EVENT BIT(4) |
| 88 | #define OMAP_RTC_STATUS_1M_EVENT BIT(3) |
| 89 | #define OMAP_RTC_STATUS_1S_EVENT BIT(2) |
| 90 | #define OMAP_RTC_STATUS_RUN BIT(1) |
| 91 | #define OMAP_RTC_STATUS_BUSY BIT(0) |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 92 | |
| 93 | /* OMAP_RTC_INTERRUPTS_REG bit fields: */ |
Sekhar Nori | 92adb96 | 2014-06-06 14:36:05 -0700 | [diff] [blame] | 94 | #define OMAP_RTC_INTERRUPTS_IT_ALARM BIT(3) |
| 95 | #define OMAP_RTC_INTERRUPTS_IT_TIMER BIT(2) |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 96 | |
Sekhar Nori | cd914bb | 2014-06-06 14:36:06 -0700 | [diff] [blame] | 97 | /* OMAP_RTC_OSC_REG bit fields: */ |
| 98 | #define OMAP_RTC_OSC_32KCLK_EN BIT(6) |
| 99 | |
Hebbar Gururaja | 8af750e | 2013-09-11 14:24:18 -0700 | [diff] [blame] | 100 | /* OMAP_RTC_IRQWAKEEN bit fields: */ |
Sekhar Nori | 92adb96 | 2014-06-06 14:36:05 -0700 | [diff] [blame] | 101 | #define OMAP_RTC_IRQWAKEEN_ALARM_WAKEEN BIT(1) |
Hebbar Gururaja | 8af750e | 2013-09-11 14:24:18 -0700 | [diff] [blame] | 102 | |
Afzal Mohammed | cab1458 | 2012-12-17 16:02:11 -0800 | [diff] [blame] | 103 | /* OMAP_RTC_KICKER values */ |
| 104 | #define KICK0_VALUE 0x83e70b13 |
| 105 | #define KICK1_VALUE 0x95a4f1e0 |
| 106 | |
Sekhar Nori | 92adb96 | 2014-06-06 14:36:05 -0700 | [diff] [blame] | 107 | #define OMAP_RTC_HAS_KICKER BIT(0) |
Afzal Mohammed | cab1458 | 2012-12-17 16:02:11 -0800 | [diff] [blame] | 108 | |
Hebbar Gururaja | 8af750e | 2013-09-11 14:24:18 -0700 | [diff] [blame] | 109 | /* |
| 110 | * Few RTC IP revisions has special WAKE-EN Register to enable Wakeup |
| 111 | * generation for event Alarm. |
| 112 | */ |
Sekhar Nori | 92adb96 | 2014-06-06 14:36:05 -0700 | [diff] [blame] | 113 | #define OMAP_RTC_HAS_IRQWAKEEN BIT(1) |
Hebbar Gururaja | 8af750e | 2013-09-11 14:24:18 -0700 | [diff] [blame] | 114 | |
Sekhar Nori | cd914bb | 2014-06-06 14:36:06 -0700 | [diff] [blame] | 115 | /* |
| 116 | * Some RTC IP revisions (like those in AM335x and DRA7x) need |
| 117 | * the 32KHz clock to be explicitly enabled. |
| 118 | */ |
| 119 | #define OMAP_RTC_HAS_32KCLK_EN BIT(2) |
| 120 | |
Mark A. Greer | 8cfde8c | 2009-12-15 16:46:11 -0800 | [diff] [blame] | 121 | static void __iomem *rtc_base; |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 122 | |
Afzal Mohammed | cab1458 | 2012-12-17 16:02:11 -0800 | [diff] [blame] | 123 | #define rtc_read(addr) readb(rtc_base + (addr)) |
| 124 | #define rtc_write(val, addr) writeb(val, rtc_base + (addr)) |
| 125 | |
| 126 | #define rtc_writel(val, addr) writel(val, rtc_base + (addr)) |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 127 | |
| 128 | |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 129 | /* we rely on the rtc framework to handle locking (rtc->ops_lock), |
| 130 | * so the only other requirement is that register accesses which |
| 131 | * require BUSY to be clear are made with IRQs locally disabled |
| 132 | */ |
| 133 | static void rtc_wait_not_busy(void) |
| 134 | { |
| 135 | int count = 0; |
| 136 | u8 status; |
| 137 | |
| 138 | /* BUSY may stay active for 1/32768 second (~30 usec) */ |
| 139 | for (count = 0; count < 50; count++) { |
| 140 | status = rtc_read(OMAP_RTC_STATUS_REG); |
| 141 | if ((status & (u8)OMAP_RTC_STATUS_BUSY) == 0) |
| 142 | break; |
| 143 | udelay(1); |
| 144 | } |
| 145 | /* now we have ~15 usec to read/write various registers */ |
| 146 | } |
| 147 | |
David Brownell | ab6a2d7 | 2007-05-08 00:33:30 -0700 | [diff] [blame] | 148 | static irqreturn_t rtc_irq(int irq, void *rtc) |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 149 | { |
| 150 | unsigned long events = 0; |
| 151 | u8 irq_data; |
| 152 | |
| 153 | irq_data = rtc_read(OMAP_RTC_STATUS_REG); |
| 154 | |
| 155 | /* alarm irq? */ |
| 156 | if (irq_data & OMAP_RTC_STATUS_ALARM) { |
| 157 | rtc_write(OMAP_RTC_STATUS_ALARM, OMAP_RTC_STATUS_REG); |
| 158 | events |= RTC_IRQF | RTC_AF; |
| 159 | } |
| 160 | |
| 161 | /* 1/sec periodic/update irq? */ |
| 162 | if (irq_data & OMAP_RTC_STATUS_1S_EVENT) |
| 163 | events |= RTC_IRQF | RTC_UF; |
| 164 | |
David Brownell | ab6a2d7 | 2007-05-08 00:33:30 -0700 | [diff] [blame] | 165 | rtc_update_irq(rtc, 1, events); |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 166 | |
| 167 | return IRQ_HANDLED; |
| 168 | } |
| 169 | |
John Stultz | 16380c1 | 2011-02-02 17:02:41 -0800 | [diff] [blame] | 170 | static int omap_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) |
| 171 | { |
Lokesh Vutla | ab7f580 | 2014-06-06 14:36:12 -0700 | [diff] [blame] | 172 | u8 reg, irqwake_reg = 0; |
| 173 | struct platform_device *pdev = to_platform_device(dev); |
| 174 | const struct platform_device_id *id_entry = |
| 175 | platform_get_device_id(pdev); |
John Stultz | 16380c1 | 2011-02-02 17:02:41 -0800 | [diff] [blame] | 176 | |
| 177 | local_irq_disable(); |
| 178 | rtc_wait_not_busy(); |
| 179 | reg = rtc_read(OMAP_RTC_INTERRUPTS_REG); |
Lokesh Vutla | ab7f580 | 2014-06-06 14:36:12 -0700 | [diff] [blame] | 180 | if (id_entry->driver_data & OMAP_RTC_HAS_IRQWAKEEN) |
| 181 | irqwake_reg = rtc_read(OMAP_RTC_IRQWAKEEN); |
| 182 | |
| 183 | if (enabled) { |
John Stultz | 16380c1 | 2011-02-02 17:02:41 -0800 | [diff] [blame] | 184 | reg |= OMAP_RTC_INTERRUPTS_IT_ALARM; |
Lokesh Vutla | ab7f580 | 2014-06-06 14:36:12 -0700 | [diff] [blame] | 185 | irqwake_reg |= OMAP_RTC_IRQWAKEEN_ALARM_WAKEEN; |
| 186 | } else { |
John Stultz | 16380c1 | 2011-02-02 17:02:41 -0800 | [diff] [blame] | 187 | reg &= ~OMAP_RTC_INTERRUPTS_IT_ALARM; |
Lokesh Vutla | ab7f580 | 2014-06-06 14:36:12 -0700 | [diff] [blame] | 188 | irqwake_reg &= ~OMAP_RTC_IRQWAKEEN_ALARM_WAKEEN; |
| 189 | } |
John Stultz | 16380c1 | 2011-02-02 17:02:41 -0800 | [diff] [blame] | 190 | rtc_wait_not_busy(); |
| 191 | rtc_write(reg, OMAP_RTC_INTERRUPTS_REG); |
Lokesh Vutla | ab7f580 | 2014-06-06 14:36:12 -0700 | [diff] [blame] | 192 | if (id_entry->driver_data & OMAP_RTC_HAS_IRQWAKEEN) |
| 193 | rtc_write(irqwake_reg, OMAP_RTC_IRQWAKEEN); |
John Stultz | 16380c1 | 2011-02-02 17:02:41 -0800 | [diff] [blame] | 194 | local_irq_enable(); |
| 195 | |
| 196 | return 0; |
| 197 | } |
| 198 | |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 199 | /* this hardware doesn't support "don't care" alarm fields */ |
| 200 | static int tm2bcd(struct rtc_time *tm) |
| 201 | { |
| 202 | if (rtc_valid_tm(tm) != 0) |
| 203 | return -EINVAL; |
| 204 | |
Adrian Bunk | fe20ba7 | 2008-10-18 20:28:41 -0700 | [diff] [blame] | 205 | tm->tm_sec = bin2bcd(tm->tm_sec); |
| 206 | tm->tm_min = bin2bcd(tm->tm_min); |
| 207 | tm->tm_hour = bin2bcd(tm->tm_hour); |
| 208 | tm->tm_mday = bin2bcd(tm->tm_mday); |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 209 | |
Adrian Bunk | fe20ba7 | 2008-10-18 20:28:41 -0700 | [diff] [blame] | 210 | tm->tm_mon = bin2bcd(tm->tm_mon + 1); |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 211 | |
| 212 | /* epoch == 1900 */ |
| 213 | if (tm->tm_year < 100 || tm->tm_year > 199) |
| 214 | return -EINVAL; |
Adrian Bunk | fe20ba7 | 2008-10-18 20:28:41 -0700 | [diff] [blame] | 215 | tm->tm_year = bin2bcd(tm->tm_year - 100); |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 216 | |
| 217 | return 0; |
| 218 | } |
| 219 | |
| 220 | static void bcd2tm(struct rtc_time *tm) |
| 221 | { |
Adrian Bunk | fe20ba7 | 2008-10-18 20:28:41 -0700 | [diff] [blame] | 222 | tm->tm_sec = bcd2bin(tm->tm_sec); |
| 223 | tm->tm_min = bcd2bin(tm->tm_min); |
| 224 | tm->tm_hour = bcd2bin(tm->tm_hour); |
| 225 | tm->tm_mday = bcd2bin(tm->tm_mday); |
| 226 | tm->tm_mon = bcd2bin(tm->tm_mon) - 1; |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 227 | /* epoch == 1900 */ |
Adrian Bunk | fe20ba7 | 2008-10-18 20:28:41 -0700 | [diff] [blame] | 228 | tm->tm_year = bcd2bin(tm->tm_year) + 100; |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | |
| 232 | static int omap_rtc_read_time(struct device *dev, struct rtc_time *tm) |
| 233 | { |
| 234 | /* we don't report wday/yday/isdst ... */ |
| 235 | local_irq_disable(); |
| 236 | rtc_wait_not_busy(); |
| 237 | |
| 238 | tm->tm_sec = rtc_read(OMAP_RTC_SECONDS_REG); |
| 239 | tm->tm_min = rtc_read(OMAP_RTC_MINUTES_REG); |
| 240 | tm->tm_hour = rtc_read(OMAP_RTC_HOURS_REG); |
| 241 | tm->tm_mday = rtc_read(OMAP_RTC_DAYS_REG); |
| 242 | tm->tm_mon = rtc_read(OMAP_RTC_MONTHS_REG); |
| 243 | tm->tm_year = rtc_read(OMAP_RTC_YEARS_REG); |
| 244 | |
| 245 | local_irq_enable(); |
| 246 | |
| 247 | bcd2tm(tm); |
| 248 | return 0; |
| 249 | } |
| 250 | |
| 251 | static int omap_rtc_set_time(struct device *dev, struct rtc_time *tm) |
| 252 | { |
| 253 | if (tm2bcd(tm) < 0) |
| 254 | return -EINVAL; |
| 255 | local_irq_disable(); |
| 256 | rtc_wait_not_busy(); |
| 257 | |
| 258 | rtc_write(tm->tm_year, OMAP_RTC_YEARS_REG); |
| 259 | rtc_write(tm->tm_mon, OMAP_RTC_MONTHS_REG); |
| 260 | rtc_write(tm->tm_mday, OMAP_RTC_DAYS_REG); |
| 261 | rtc_write(tm->tm_hour, OMAP_RTC_HOURS_REG); |
| 262 | rtc_write(tm->tm_min, OMAP_RTC_MINUTES_REG); |
| 263 | rtc_write(tm->tm_sec, OMAP_RTC_SECONDS_REG); |
| 264 | |
| 265 | local_irq_enable(); |
| 266 | |
| 267 | return 0; |
| 268 | } |
| 269 | |
| 270 | static int omap_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) |
| 271 | { |
| 272 | local_irq_disable(); |
| 273 | rtc_wait_not_busy(); |
| 274 | |
| 275 | alm->time.tm_sec = rtc_read(OMAP_RTC_ALARM_SECONDS_REG); |
| 276 | alm->time.tm_min = rtc_read(OMAP_RTC_ALARM_MINUTES_REG); |
| 277 | alm->time.tm_hour = rtc_read(OMAP_RTC_ALARM_HOURS_REG); |
| 278 | alm->time.tm_mday = rtc_read(OMAP_RTC_ALARM_DAYS_REG); |
| 279 | alm->time.tm_mon = rtc_read(OMAP_RTC_ALARM_MONTHS_REG); |
| 280 | alm->time.tm_year = rtc_read(OMAP_RTC_ALARM_YEARS_REG); |
| 281 | |
| 282 | local_irq_enable(); |
| 283 | |
| 284 | bcd2tm(&alm->time); |
David Brownell | a2db8df | 2006-12-13 00:35:08 -0800 | [diff] [blame] | 285 | alm->enabled = !!(rtc_read(OMAP_RTC_INTERRUPTS_REG) |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 286 | & OMAP_RTC_INTERRUPTS_IT_ALARM); |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 287 | |
| 288 | return 0; |
| 289 | } |
| 290 | |
| 291 | static int omap_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) |
| 292 | { |
Lokesh Vutla | ab7f580 | 2014-06-06 14:36:12 -0700 | [diff] [blame] | 293 | u8 reg, irqwake_reg = 0; |
| 294 | struct platform_device *pdev = to_platform_device(dev); |
| 295 | const struct platform_device_id *id_entry = |
| 296 | platform_get_device_id(pdev); |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 297 | |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 298 | if (tm2bcd(&alm->time) < 0) |
| 299 | return -EINVAL; |
| 300 | |
| 301 | local_irq_disable(); |
| 302 | rtc_wait_not_busy(); |
| 303 | |
| 304 | rtc_write(alm->time.tm_year, OMAP_RTC_ALARM_YEARS_REG); |
| 305 | rtc_write(alm->time.tm_mon, OMAP_RTC_ALARM_MONTHS_REG); |
| 306 | rtc_write(alm->time.tm_mday, OMAP_RTC_ALARM_DAYS_REG); |
| 307 | rtc_write(alm->time.tm_hour, OMAP_RTC_ALARM_HOURS_REG); |
| 308 | rtc_write(alm->time.tm_min, OMAP_RTC_ALARM_MINUTES_REG); |
| 309 | rtc_write(alm->time.tm_sec, OMAP_RTC_ALARM_SECONDS_REG); |
| 310 | |
| 311 | reg = rtc_read(OMAP_RTC_INTERRUPTS_REG); |
Lokesh Vutla | ab7f580 | 2014-06-06 14:36:12 -0700 | [diff] [blame] | 312 | if (id_entry->driver_data & OMAP_RTC_HAS_IRQWAKEEN) |
| 313 | irqwake_reg = rtc_read(OMAP_RTC_IRQWAKEEN); |
| 314 | |
| 315 | if (alm->enabled) { |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 316 | reg |= OMAP_RTC_INTERRUPTS_IT_ALARM; |
Lokesh Vutla | ab7f580 | 2014-06-06 14:36:12 -0700 | [diff] [blame] | 317 | irqwake_reg |= OMAP_RTC_IRQWAKEEN_ALARM_WAKEEN; |
| 318 | } else { |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 319 | reg &= ~OMAP_RTC_INTERRUPTS_IT_ALARM; |
Lokesh Vutla | ab7f580 | 2014-06-06 14:36:12 -0700 | [diff] [blame] | 320 | irqwake_reg &= ~OMAP_RTC_IRQWAKEEN_ALARM_WAKEEN; |
| 321 | } |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 322 | rtc_write(reg, OMAP_RTC_INTERRUPTS_REG); |
Lokesh Vutla | ab7f580 | 2014-06-06 14:36:12 -0700 | [diff] [blame] | 323 | if (id_entry->driver_data & OMAP_RTC_HAS_IRQWAKEEN) |
| 324 | rtc_write(irqwake_reg, OMAP_RTC_IRQWAKEEN); |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 325 | |
| 326 | local_irq_enable(); |
| 327 | |
| 328 | return 0; |
| 329 | } |
| 330 | |
| 331 | static struct rtc_class_ops omap_rtc_ops = { |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 332 | .read_time = omap_rtc_read_time, |
| 333 | .set_time = omap_rtc_set_time, |
| 334 | .read_alarm = omap_rtc_read_alarm, |
| 335 | .set_alarm = omap_rtc_set_alarm, |
John Stultz | 16380c1 | 2011-02-02 17:02:41 -0800 | [diff] [blame] | 336 | .alarm_irq_enable = omap_rtc_alarm_irq_enable, |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 337 | }; |
| 338 | |
| 339 | static int omap_rtc_alarm; |
| 340 | static int omap_rtc_timer; |
| 341 | |
Hebbar Gururaja | 8af750e | 2013-09-11 14:24:18 -0700 | [diff] [blame] | 342 | #define OMAP_RTC_DATA_AM3352_IDX 1 |
| 343 | #define OMAP_RTC_DATA_DA830_IDX 2 |
Afzal Mohammed | 9e0344d | 2012-12-17 16:02:15 -0800 | [diff] [blame] | 344 | |
Afzal Mohammed | cab1458 | 2012-12-17 16:02:11 -0800 | [diff] [blame] | 345 | static struct platform_device_id omap_rtc_devtype[] = { |
| 346 | { |
| 347 | .name = DRIVER_NAME, |
Hebbar Gururaja | 8af750e | 2013-09-11 14:24:18 -0700 | [diff] [blame] | 348 | }, |
| 349 | [OMAP_RTC_DATA_AM3352_IDX] = { |
| 350 | .name = "am3352-rtc", |
Sekhar Nori | cd914bb | 2014-06-06 14:36:06 -0700 | [diff] [blame] | 351 | .driver_data = OMAP_RTC_HAS_KICKER | OMAP_RTC_HAS_IRQWAKEEN | |
| 352 | OMAP_RTC_HAS_32KCLK_EN, |
Hebbar Gururaja | 8af750e | 2013-09-11 14:24:18 -0700 | [diff] [blame] | 353 | }, |
| 354 | [OMAP_RTC_DATA_DA830_IDX] = { |
Afzal Mohammed | cab1458 | 2012-12-17 16:02:11 -0800 | [diff] [blame] | 355 | .name = "da830-rtc", |
| 356 | .driver_data = OMAP_RTC_HAS_KICKER, |
| 357 | }, |
| 358 | {}, |
| 359 | }; |
| 360 | MODULE_DEVICE_TABLE(platform, omap_rtc_devtype); |
| 361 | |
Afzal Mohammed | 9e0344d | 2012-12-17 16:02:15 -0800 | [diff] [blame] | 362 | static const struct of_device_id omap_rtc_of_match[] = { |
| 363 | { .compatible = "ti,da830-rtc", |
| 364 | .data = &omap_rtc_devtype[OMAP_RTC_DATA_DA830_IDX], |
| 365 | }, |
Hebbar Gururaja | 8af750e | 2013-09-11 14:24:18 -0700 | [diff] [blame] | 366 | { .compatible = "ti,am3352-rtc", |
| 367 | .data = &omap_rtc_devtype[OMAP_RTC_DATA_AM3352_IDX], |
| 368 | }, |
Afzal Mohammed | 9e0344d | 2012-12-17 16:02:15 -0800 | [diff] [blame] | 369 | {}, |
| 370 | }; |
| 371 | MODULE_DEVICE_TABLE(of, omap_rtc_of_match); |
| 372 | |
David Brownell | 71fc822 | 2008-07-23 21:30:38 -0700 | [diff] [blame] | 373 | static int __init omap_rtc_probe(struct platform_device *pdev) |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 374 | { |
Vishwanathrao Badarkhe, Manish | 3765e8f | 2013-04-29 16:20:04 -0700 | [diff] [blame] | 375 | struct resource *res; |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 376 | struct rtc_device *rtc; |
| 377 | u8 reg, new_ctrl; |
Afzal Mohammed | cab1458 | 2012-12-17 16:02:11 -0800 | [diff] [blame] | 378 | const struct platform_device_id *id_entry; |
Afzal Mohammed | 9e0344d | 2012-12-17 16:02:15 -0800 | [diff] [blame] | 379 | const struct of_device_id *of_id; |
Johan Hovold | 437b37a | 2014-12-10 15:52:40 -0800 | [diff] [blame] | 380 | int ret; |
Afzal Mohammed | 9e0344d | 2012-12-17 16:02:15 -0800 | [diff] [blame] | 381 | |
| 382 | of_id = of_match_device(omap_rtc_of_match, &pdev->dev); |
| 383 | if (of_id) |
| 384 | pdev->id_entry = of_id->data; |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 385 | |
Sekhar Nori | 337b600 | 2014-06-06 14:36:04 -0700 | [diff] [blame] | 386 | id_entry = platform_get_device_id(pdev); |
| 387 | if (!id_entry) { |
| 388 | dev_err(&pdev->dev, "no matching device entry\n"); |
| 389 | return -ENODEV; |
| 390 | } |
| 391 | |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 392 | omap_rtc_timer = platform_get_irq(pdev, 0); |
Johan Hovold | 437b37a | 2014-12-10 15:52:40 -0800 | [diff] [blame] | 393 | if (omap_rtc_timer <= 0) |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 394 | return -ENOENT; |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 395 | |
| 396 | omap_rtc_alarm = platform_get_irq(pdev, 1); |
Johan Hovold | 437b37a | 2014-12-10 15:52:40 -0800 | [diff] [blame] | 397 | if (omap_rtc_alarm <= 0) |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 398 | return -ENOENT; |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 399 | |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 400 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
Vishwanathrao Badarkhe, Manish | 3765e8f | 2013-04-29 16:20:04 -0700 | [diff] [blame] | 401 | rtc_base = devm_ioremap_resource(&pdev->dev, res); |
| 402 | if (IS_ERR(rtc_base)) |
| 403 | return PTR_ERR(rtc_base); |
Mark A. Greer | 8cfde8c | 2009-12-15 16:46:11 -0800 | [diff] [blame] | 404 | |
Vaibhav Hiremath | fc9bd90 | 2012-12-17 16:02:18 -0800 | [diff] [blame] | 405 | /* Enable the clock/module so that we can access the registers */ |
| 406 | pm_runtime_enable(&pdev->dev); |
| 407 | pm_runtime_get_sync(&pdev->dev); |
| 408 | |
Sekhar Nori | 337b600 | 2014-06-06 14:36:04 -0700 | [diff] [blame] | 409 | if (id_entry->driver_data & OMAP_RTC_HAS_KICKER) { |
Afzal Mohammed | cab1458 | 2012-12-17 16:02:11 -0800 | [diff] [blame] | 410 | rtc_writel(KICK0_VALUE, OMAP_RTC_KICK0_REG); |
| 411 | rtc_writel(KICK1_VALUE, OMAP_RTC_KICK1_REG); |
| 412 | } |
| 413 | |
Johan Hovold | 1ed8b5d | 2014-12-10 15:52:36 -0800 | [diff] [blame] | 414 | /* |
| 415 | * disable interrupts |
| 416 | * |
| 417 | * NOTE: ALARM2 is not cleared on AM3352 if rtc_write (writeb) is used |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 418 | */ |
Johan Hovold | 1ed8b5d | 2014-12-10 15:52:36 -0800 | [diff] [blame] | 419 | rtc_writel(0, OMAP_RTC_INTERRUPTS_REG); |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 420 | |
Sekhar Nori | cd914bb | 2014-06-06 14:36:06 -0700 | [diff] [blame] | 421 | /* enable RTC functional clock */ |
Johan Hovold | 44c63a5 | 2014-12-10 15:52:30 -0800 | [diff] [blame] | 422 | if (id_entry->driver_data & OMAP_RTC_HAS_32KCLK_EN) { |
| 423 | reg = rtc_read(OMAP_RTC_OSC_REG); |
| 424 | rtc_writel(reg | OMAP_RTC_OSC_32KCLK_EN, OMAP_RTC_OSC_REG); |
| 425 | } |
Sekhar Nori | cd914bb | 2014-06-06 14:36:06 -0700 | [diff] [blame] | 426 | |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 427 | /* clear old status */ |
| 428 | reg = rtc_read(OMAP_RTC_STATUS_REG); |
| 429 | if (reg & (u8) OMAP_RTC_STATUS_POWER_UP) { |
Johan Hovold | 397b630 | 2014-12-10 15:52:49 -0800 | [diff] [blame^] | 430 | dev_info(&pdev->dev, "RTC power up reset detected\n"); |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 431 | rtc_write(OMAP_RTC_STATUS_POWER_UP, OMAP_RTC_STATUS_REG); |
| 432 | } |
| 433 | if (reg & (u8) OMAP_RTC_STATUS_ALARM) |
| 434 | rtc_write(OMAP_RTC_STATUS_ALARM, OMAP_RTC_STATUS_REG); |
| 435 | |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 436 | /* On boards with split power, RTC_ON_NOFF won't reset the RTC */ |
| 437 | reg = rtc_read(OMAP_RTC_CTRL_REG); |
| 438 | if (reg & (u8) OMAP_RTC_CTRL_STOP) |
Johan Hovold | 397b630 | 2014-12-10 15:52:49 -0800 | [diff] [blame^] | 439 | dev_info(&pdev->dev, "already running\n"); |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 440 | |
| 441 | /* force to 24 hour mode */ |
Daniel Glöckner | 12b3e03 | 2011-08-03 16:21:02 -0700 | [diff] [blame] | 442 | new_ctrl = reg & (OMAP_RTC_CTRL_SPLIT|OMAP_RTC_CTRL_AUTO_COMP); |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 443 | new_ctrl |= OMAP_RTC_CTRL_STOP; |
| 444 | |
| 445 | /* BOARD-SPECIFIC CUSTOMIZATION CAN GO HERE: |
| 446 | * |
Sekhar Nori | fa5b078 | 2010-10-27 15:33:05 -0700 | [diff] [blame] | 447 | * - Device wake-up capability setting should come through chip |
| 448 | * init logic. OMAP1 boards should initialize the "wakeup capable" |
| 449 | * flag in the platform device if the board is wired right for |
| 450 | * being woken up by RTC alarm. For OMAP-L138, this capability |
| 451 | * is built into the SoC by the "Deep Sleep" capability. |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 452 | * |
| 453 | * - Boards wired so RTC_ON_nOFF is used as the reset signal, |
| 454 | * rather than nPWRON_RESET, should forcibly enable split |
| 455 | * power mode. (Some chip errata report that RTC_CTRL_SPLIT |
| 456 | * is write-only, and always reads as zero...) |
| 457 | */ |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 458 | |
| 459 | if (new_ctrl & (u8) OMAP_RTC_CTRL_SPLIT) |
Johan Hovold | 397b630 | 2014-12-10 15:52:49 -0800 | [diff] [blame^] | 460 | dev_info(&pdev->dev, "split power mode\n"); |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 461 | |
| 462 | if (reg != new_ctrl) |
| 463 | rtc_write(new_ctrl, OMAP_RTC_CTRL_REG); |
| 464 | |
Johan Hovold | 4390ce0 | 2014-12-10 15:52:43 -0800 | [diff] [blame] | 465 | device_init_wakeup(&pdev->dev, true); |
| 466 | |
| 467 | rtc = devm_rtc_device_register(&pdev->dev, pdev->name, |
| 468 | &omap_rtc_ops, THIS_MODULE); |
| 469 | if (IS_ERR(rtc)) { |
| 470 | ret = PTR_ERR(rtc); |
| 471 | goto err; |
| 472 | } |
| 473 | platform_set_drvdata(pdev, rtc); |
| 474 | |
| 475 | /* handle periodic and alarm irqs */ |
| 476 | ret = devm_request_irq(&pdev->dev, omap_rtc_timer, rtc_irq, 0, |
| 477 | dev_name(&rtc->dev), rtc); |
| 478 | if (ret) |
| 479 | goto err; |
| 480 | |
| 481 | if (omap_rtc_timer != omap_rtc_alarm) { |
| 482 | ret = devm_request_irq(&pdev->dev, omap_rtc_alarm, rtc_irq, 0, |
| 483 | dev_name(&rtc->dev), rtc); |
| 484 | if (ret) |
| 485 | goto err; |
| 486 | } |
| 487 | |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 488 | return 0; |
| 489 | |
Johan Hovold | 437b37a | 2014-12-10 15:52:40 -0800 | [diff] [blame] | 490 | err: |
Johan Hovold | 7ecd9a3 | 2014-12-10 15:52:33 -0800 | [diff] [blame] | 491 | device_init_wakeup(&pdev->dev, false); |
Sekhar Nori | 337b600 | 2014-06-06 14:36:04 -0700 | [diff] [blame] | 492 | if (id_entry->driver_data & OMAP_RTC_HAS_KICKER) |
Afzal Mohammed | cab1458 | 2012-12-17 16:02:11 -0800 | [diff] [blame] | 493 | rtc_writel(0, OMAP_RTC_KICK0_REG); |
Vaibhav Hiremath | fc9bd90 | 2012-12-17 16:02:18 -0800 | [diff] [blame] | 494 | pm_runtime_put_sync(&pdev->dev); |
| 495 | pm_runtime_disable(&pdev->dev); |
Johan Hovold | 437b37a | 2014-12-10 15:52:40 -0800 | [diff] [blame] | 496 | |
| 497 | return ret; |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 498 | } |
| 499 | |
David Brownell | 71fc822 | 2008-07-23 21:30:38 -0700 | [diff] [blame] | 500 | static int __exit omap_rtc_remove(struct platform_device *pdev) |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 501 | { |
Afzal Mohammed | cab1458 | 2012-12-17 16:02:11 -0800 | [diff] [blame] | 502 | const struct platform_device_id *id_entry = |
| 503 | platform_get_device_id(pdev); |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 504 | |
| 505 | device_init_wakeup(&pdev->dev, 0); |
| 506 | |
| 507 | /* leave rtc running, but disable irqs */ |
| 508 | rtc_write(0, OMAP_RTC_INTERRUPTS_REG); |
| 509 | |
Sekhar Nori | 337b600 | 2014-06-06 14:36:04 -0700 | [diff] [blame] | 510 | if (id_entry->driver_data & OMAP_RTC_HAS_KICKER) |
Afzal Mohammed | cab1458 | 2012-12-17 16:02:11 -0800 | [diff] [blame] | 511 | rtc_writel(0, OMAP_RTC_KICK0_REG); |
Vaibhav Hiremath | fc9bd90 | 2012-12-17 16:02:18 -0800 | [diff] [blame] | 512 | |
| 513 | /* Disable the clock/module */ |
| 514 | pm_runtime_put_sync(&pdev->dev); |
| 515 | pm_runtime_disable(&pdev->dev); |
| 516 | |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 517 | return 0; |
| 518 | } |
| 519 | |
Jingoo Han | 04ebc35 | 2013-04-29 16:21:01 -0700 | [diff] [blame] | 520 | #ifdef CONFIG_PM_SLEEP |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 521 | static u8 irqstat; |
| 522 | |
Jingoo Han | 04ebc35 | 2013-04-29 16:21:01 -0700 | [diff] [blame] | 523 | static int omap_rtc_suspend(struct device *dev) |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 524 | { |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 525 | irqstat = rtc_read(OMAP_RTC_INTERRUPTS_REG); |
| 526 | |
| 527 | /* FIXME the RTC alarm is not currently acting as a wakeup event |
Hebbar Gururaja | 8af750e | 2013-09-11 14:24:18 -0700 | [diff] [blame] | 528 | * source on some platforms, and in fact this enable() call is just |
| 529 | * saving a flag that's never used... |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 530 | */ |
Lokesh Vutla | ab7f580 | 2014-06-06 14:36:12 -0700 | [diff] [blame] | 531 | if (device_may_wakeup(dev)) |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 532 | enable_irq_wake(omap_rtc_alarm); |
Lokesh Vutla | ab7f580 | 2014-06-06 14:36:12 -0700 | [diff] [blame] | 533 | else |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 534 | rtc_write(0, OMAP_RTC_INTERRUPTS_REG); |
| 535 | |
Vaibhav Hiremath | fc9bd90 | 2012-12-17 16:02:18 -0800 | [diff] [blame] | 536 | /* Disable the clock/module */ |
Jingoo Han | 04ebc35 | 2013-04-29 16:21:01 -0700 | [diff] [blame] | 537 | pm_runtime_put_sync(dev); |
Vaibhav Hiremath | fc9bd90 | 2012-12-17 16:02:18 -0800 | [diff] [blame] | 538 | |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 539 | return 0; |
| 540 | } |
| 541 | |
Jingoo Han | 04ebc35 | 2013-04-29 16:21:01 -0700 | [diff] [blame] | 542 | static int omap_rtc_resume(struct device *dev) |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 543 | { |
Vaibhav Hiremath | fc9bd90 | 2012-12-17 16:02:18 -0800 | [diff] [blame] | 544 | /* Enable the clock/module so that we can access the registers */ |
Jingoo Han | 04ebc35 | 2013-04-29 16:21:01 -0700 | [diff] [blame] | 545 | pm_runtime_get_sync(dev); |
Vaibhav Hiremath | fc9bd90 | 2012-12-17 16:02:18 -0800 | [diff] [blame] | 546 | |
Lokesh Vutla | ab7f580 | 2014-06-06 14:36:12 -0700 | [diff] [blame] | 547 | if (device_may_wakeup(dev)) |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 548 | disable_irq_wake(omap_rtc_alarm); |
Lokesh Vutla | ab7f580 | 2014-06-06 14:36:12 -0700 | [diff] [blame] | 549 | else |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 550 | rtc_write(irqstat, OMAP_RTC_INTERRUPTS_REG); |
Lokesh Vutla | ab7f580 | 2014-06-06 14:36:12 -0700 | [diff] [blame] | 551 | |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 552 | return 0; |
| 553 | } |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 554 | #endif |
| 555 | |
Jingoo Han | 04ebc35 | 2013-04-29 16:21:01 -0700 | [diff] [blame] | 556 | static SIMPLE_DEV_PM_OPS(omap_rtc_pm_ops, omap_rtc_suspend, omap_rtc_resume); |
| 557 | |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 558 | static void omap_rtc_shutdown(struct platform_device *pdev) |
| 559 | { |
| 560 | rtc_write(0, OMAP_RTC_INTERRUPTS_REG); |
| 561 | } |
| 562 | |
Kay Sievers | ad28a07 | 2008-04-10 21:29:25 -0700 | [diff] [blame] | 563 | MODULE_ALIAS("platform:omap_rtc"); |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 564 | static struct platform_driver omap_rtc_driver = { |
David Brownell | 71fc822 | 2008-07-23 21:30:38 -0700 | [diff] [blame] | 565 | .remove = __exit_p(omap_rtc_remove), |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 566 | .shutdown = omap_rtc_shutdown, |
| 567 | .driver = { |
Afzal Mohammed | cab1458 | 2012-12-17 16:02:11 -0800 | [diff] [blame] | 568 | .name = DRIVER_NAME, |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 569 | .owner = THIS_MODULE, |
Jingoo Han | 04ebc35 | 2013-04-29 16:21:01 -0700 | [diff] [blame] | 570 | .pm = &omap_rtc_pm_ops, |
Sachin Kamat | 616b734 | 2013-11-12 15:10:55 -0800 | [diff] [blame] | 571 | .of_match_table = omap_rtc_of_match, |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 572 | }, |
Afzal Mohammed | cab1458 | 2012-12-17 16:02:11 -0800 | [diff] [blame] | 573 | .id_table = omap_rtc_devtype, |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 574 | }; |
| 575 | |
Jingoo Han | 09c5a36 | 2013-04-29 16:18:46 -0700 | [diff] [blame] | 576 | module_platform_driver_probe(omap_rtc_driver, omap_rtc_probe); |
David Brownell | db68b18 | 2006-12-06 20:38:36 -0800 | [diff] [blame] | 577 | |
| 578 | MODULE_AUTHOR("George G. Davis (and others)"); |
| 579 | MODULE_LICENSE("GPL"); |