aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-mv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-mv.c')
-rw-r--r--drivers/rtc/rtc-mv.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index bcca47298554..60627a764514 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -169,25 +169,19 @@ static int mv_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
169 return 0; 169 return 0;
170} 170}
171 171
172static int mv_rtc_ioctl(struct device *dev, unsigned int cmd, 172static int mv_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
173 unsigned long arg)
174{ 173{
175 struct platform_device *pdev = to_platform_device(dev); 174 struct platform_device *pdev = to_platform_device(dev);
176 struct rtc_plat_data *pdata = platform_get_drvdata(pdev); 175 struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
177 void __iomem *ioaddr = pdata->ioaddr; 176 void __iomem *ioaddr = pdata->ioaddr;
178 177
179 if (pdata->irq < 0) 178 if (pdata->irq < 0)
180 return -ENOIOCTLCMD; /* fall back into rtc-dev's emulation */ 179 return -EINVAL; /* fall back into rtc-dev's emulation */
181 switch (cmd) { 180
182 case RTC_AIE_OFF: 181 if (enabled)
183 writel(0, ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS);
184 break;
185 case RTC_AIE_ON:
186 writel(1, ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS); 182 writel(1, ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS);
187 break; 183 else
188 default: 184 writel(0, ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS);
189 return -ENOIOCTLCMD;
190 }
191 return 0; 185 return 0;
192} 186}
193 187
@@ -216,7 +210,7 @@ static const struct rtc_class_ops mv_rtc_alarm_ops = {
216 .set_time = mv_rtc_set_time, 210 .set_time = mv_rtc_set_time,
217 .read_alarm = mv_rtc_read_alarm, 211 .read_alarm = mv_rtc_read_alarm,
218 .set_alarm = mv_rtc_set_alarm, 212 .set_alarm = mv_rtc_set_alarm,
219 .ioctl = mv_rtc_ioctl, 213 .alarm_irq_enable = mv_rtc_alarm_irq_enable,
220}; 214};
221 215
222static int __devinit mv_rtc_probe(struct platform_device *pdev) 216static int __devinit mv_rtc_probe(struct platform_device *pdev)