aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-vt8500.c
diff options
context:
space:
mode:
authorAlexey Charkov <alchark@gmail.com>2011-06-22 17:20:13 -0400
committerJohn Stultz <john.stultz@linaro.org>2011-06-23 19:11:39 -0400
commit03ad2d501e7189245bf6bf9dfc2a30511dd50602 (patch)
treeaea77f0264d8d634085e9da892c6460876d8240b /drivers/rtc/rtc-vt8500.c
parente08f6d4131ab964420f0bcabecc68d75fb49df79 (diff)
rtc: vt8500: Fix build error & cleanup rtc_class_ops->update_irq_enable()
Now that the generic code handles UIE mode irqs via periodic alarm interrupts, no one calls the rtc_class_ops->update_irq_enable() method anymore. Further the rtc_class_ops doesn't have a update_irq_enable element anymore, so this causes a build error. This patch removes the driver hooks and implementations of update_irq_enable and the associated setup. [wsa: updated commit-message and removed update_irq_enable-function, too] [jstultz: improve commit message, clarifying build issue] Signed-off-by: Alexey Charkov <alchark@gmail.com> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'drivers/rtc/rtc-vt8500.c')
-rw-r--r--drivers/rtc/rtc-vt8500.c45
1 files changed, 3 insertions, 42 deletions
diff --git a/drivers/rtc/rtc-vt8500.c b/drivers/rtc/rtc-vt8500.c
index b8bc862903a..efd6066b5cd 100644
--- a/drivers/rtc/rtc-vt8500.c
+++ b/drivers/rtc/rtc-vt8500.c
@@ -78,7 +78,6 @@ struct vt8500_rtc {
78 void __iomem *regbase; 78 void __iomem *regbase;
79 struct resource *res; 79 struct resource *res;
80 int irq_alarm; 80 int irq_alarm;
81 int irq_hz;
82 struct rtc_device *rtc; 81 struct rtc_device *rtc;
83 spinlock_t lock; /* Protects this structure */ 82 spinlock_t lock; /* Protects this structure */
84}; 83};
@@ -100,10 +99,6 @@ static irqreturn_t vt8500_rtc_irq(int irq, void *dev_id)
100 if (isr & 1) 99 if (isr & 1)
101 events |= RTC_AF | RTC_IRQF; 100 events |= RTC_AF | RTC_IRQF;
102 101
103 /* Only second/minute interrupts are supported */
104 if (isr & 2)
105 events |= RTC_UF | RTC_IRQF;
106
107 rtc_update_irq(vt8500_rtc->rtc, 1, events); 102 rtc_update_irq(vt8500_rtc->rtc, 1, events);
108 103
109 return IRQ_HANDLED; 104 return IRQ_HANDLED;
@@ -199,27 +194,12 @@ static int vt8500_alarm_irq_enable(struct device *dev, unsigned int enabled)
199 return 0; 194 return 0;
200} 195}
201 196
202static int vt8500_update_irq_enable(struct device *dev, unsigned int enabled)
203{
204 struct vt8500_rtc *vt8500_rtc = dev_get_drvdata(dev);
205 unsigned long tmp = readl(vt8500_rtc->regbase + VT8500_RTC_CR);
206
207 if (enabled)
208 tmp |= VT8500_RTC_CR_SM_SEC | VT8500_RTC_CR_SM_ENABLE;
209 else
210 tmp &= ~VT8500_RTC_CR_SM_ENABLE;
211
212 writel(tmp, vt8500_rtc->regbase + VT8500_RTC_CR);
213 return 0;
214}
215
216static const struct rtc_class_ops vt8500_rtc_ops = { 197static const struct rtc_class_ops vt8500_rtc_ops = {
217 .read_time = vt8500_rtc_read_time, 198 .read_time = vt8500_rtc_read_time,
218 .set_time = vt8500_rtc_set_time, 199 .set_time = vt8500_rtc_set_time,
219 .read_alarm = vt8500_rtc_read_alarm, 200 .read_alarm = vt8500_rtc_read_alarm,
220 .set_alarm = vt8500_rtc_set_alarm, 201 .set_alarm = vt8500_rtc_set_alarm,
221 .alarm_irq_enable = vt8500_alarm_irq_enable, 202 .alarm_irq_enable = vt8500_alarm_irq_enable,
222 .update_irq_enable = vt8500_update_irq_enable,
223}; 203};
224 204
225static int __devinit vt8500_rtc_probe(struct platform_device *pdev) 205static int __devinit vt8500_rtc_probe(struct platform_device *pdev)
@@ -248,13 +228,6 @@ static int __devinit vt8500_rtc_probe(struct platform_device *pdev)
248 goto err_free; 228 goto err_free;
249 } 229 }
250 230
251 vt8500_rtc->irq_hz = platform_get_irq(pdev, 1);
252 if (vt8500_rtc->irq_hz < 0) {
253 dev_err(&pdev->dev, "No 1Hz IRQ resource defined\n");
254 ret = -ENXIO;
255 goto err_free;
256 }
257
258 vt8500_rtc->res = request_mem_region(vt8500_rtc->res->start, 231 vt8500_rtc->res = request_mem_region(vt8500_rtc->res->start,
259 resource_size(vt8500_rtc->res), 232 resource_size(vt8500_rtc->res),
260 "vt8500-rtc"); 233 "vt8500-rtc");
@@ -272,9 +245,8 @@ static int __devinit vt8500_rtc_probe(struct platform_device *pdev)
272 goto err_release; 245 goto err_release;
273 } 246 }
274 247
275 /* Enable the second/minute interrupt generation and enable RTC */ 248 /* Enable RTC and set it to 24-hour mode */
276 writel(VT8500_RTC_CR_ENABLE | VT8500_RTC_CR_24H 249 writel(VT8500_RTC_CR_ENABLE | VT8500_RTC_CR_24H,
277 | VT8500_RTC_CR_SM_ENABLE | VT8500_RTC_CR_SM_SEC,
278 vt8500_rtc->regbase + VT8500_RTC_CR); 250 vt8500_rtc->regbase + VT8500_RTC_CR);
279 251
280 vt8500_rtc->rtc = rtc_device_register("vt8500-rtc", &pdev->dev, 252 vt8500_rtc->rtc = rtc_device_register("vt8500-rtc", &pdev->dev,
@@ -286,26 +258,16 @@ static int __devinit vt8500_rtc_probe(struct platform_device *pdev)
286 goto err_unmap; 258 goto err_unmap;
287 } 259 }
288 260
289 ret = request_irq(vt8500_rtc->irq_hz, vt8500_rtc_irq, 0,
290 "rtc 1Hz", vt8500_rtc);
291 if (ret < 0) {
292 dev_err(&pdev->dev, "can't get irq %i, err %d\n",
293 vt8500_rtc->irq_hz, ret);
294 goto err_unreg;
295 }
296
297 ret = request_irq(vt8500_rtc->irq_alarm, vt8500_rtc_irq, 0, 261 ret = request_irq(vt8500_rtc->irq_alarm, vt8500_rtc_irq, 0,
298 "rtc alarm", vt8500_rtc); 262 "rtc alarm", vt8500_rtc);
299 if (ret < 0) { 263 if (ret < 0) {
300 dev_err(&pdev->dev, "can't get irq %i, err %d\n", 264 dev_err(&pdev->dev, "can't get irq %i, err %d\n",
301 vt8500_rtc->irq_alarm, ret); 265 vt8500_rtc->irq_alarm, ret);
302 goto err_free_hz; 266 goto err_unreg;
303 } 267 }
304 268
305 return 0; 269 return 0;
306 270
307err_free_hz:
308 free_irq(vt8500_rtc->irq_hz, vt8500_rtc);
309err_unreg: 271err_unreg:
310 rtc_device_unregister(vt8500_rtc->rtc); 272 rtc_device_unregister(vt8500_rtc->rtc);
311err_unmap: 273err_unmap:
@@ -323,7 +285,6 @@ static int __devexit vt8500_rtc_remove(struct platform_device *pdev)
323 struct vt8500_rtc *vt8500_rtc = platform_get_drvdata(pdev); 285 struct vt8500_rtc *vt8500_rtc = platform_get_drvdata(pdev);
324 286
325 free_irq(vt8500_rtc->irq_alarm, vt8500_rtc); 287 free_irq(vt8500_rtc->irq_alarm, vt8500_rtc);
326 free_irq(vt8500_rtc->irq_hz, vt8500_rtc);
327 288
328 rtc_device_unregister(vt8500_rtc->rtc); 289 rtc_device_unregister(vt8500_rtc->rtc);
329 290