aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-omap.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-omap.c')
-rw-r--r--drivers/rtc/rtc-omap.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index e72b523c79a5..b4dbf3a319b3 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -143,8 +143,6 @@ omap_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
143 u8 reg; 143 u8 reg;
144 144
145 switch (cmd) { 145 switch (cmd) {
146 case RTC_AIE_OFF:
147 case RTC_AIE_ON:
148 case RTC_UIE_OFF: 146 case RTC_UIE_OFF:
149 case RTC_UIE_ON: 147 case RTC_UIE_ON:
150 break; 148 break;
@@ -156,13 +154,6 @@ omap_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
156 rtc_wait_not_busy(); 154 rtc_wait_not_busy();
157 reg = rtc_read(OMAP_RTC_INTERRUPTS_REG); 155 reg = rtc_read(OMAP_RTC_INTERRUPTS_REG);
158 switch (cmd) { 156 switch (cmd) {
159 /* AIE = Alarm Interrupt Enable */
160 case RTC_AIE_OFF:
161 reg &= ~OMAP_RTC_INTERRUPTS_IT_ALARM;
162 break;
163 case RTC_AIE_ON:
164 reg |= OMAP_RTC_INTERRUPTS_IT_ALARM;
165 break;
166 /* UIE = Update Interrupt Enable (1/second) */ 157 /* UIE = Update Interrupt Enable (1/second) */
167 case RTC_UIE_OFF: 158 case RTC_UIE_OFF:
168 reg &= ~OMAP_RTC_INTERRUPTS_IT_TIMER; 159 reg &= ~OMAP_RTC_INTERRUPTS_IT_TIMER;
@@ -182,6 +173,24 @@ omap_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
182#define omap_rtc_ioctl NULL 173#define omap_rtc_ioctl NULL
183#endif 174#endif
184 175
176static int omap_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
177{
178 u8 reg;
179
180 local_irq_disable();
181 rtc_wait_not_busy();
182 reg = rtc_read(OMAP_RTC_INTERRUPTS_REG);
183 if (enabled)
184 reg |= OMAP_RTC_INTERRUPTS_IT_ALARM;
185 else
186 reg &= ~OMAP_RTC_INTERRUPTS_IT_ALARM;
187 rtc_wait_not_busy();
188 rtc_write(reg, OMAP_RTC_INTERRUPTS_REG);
189 local_irq_enable();
190
191 return 0;
192}
193
185/* this hardware doesn't support "don't care" alarm fields */ 194/* this hardware doesn't support "don't care" alarm fields */
186static int tm2bcd(struct rtc_time *tm) 195static int tm2bcd(struct rtc_time *tm)
187{ 196{
@@ -309,6 +318,7 @@ static struct rtc_class_ops omap_rtc_ops = {
309 .set_time = omap_rtc_set_time, 318 .set_time = omap_rtc_set_time,
310 .read_alarm = omap_rtc_read_alarm, 319 .read_alarm = omap_rtc_read_alarm,
311 .set_alarm = omap_rtc_set_alarm, 320 .set_alarm = omap_rtc_set_alarm,
321 .alarm_irq_enable = omap_rtc_alarm_irq_enable,
312}; 322};
313 323
314static int omap_rtc_alarm; 324static int omap_rtc_alarm;