rtc-mv.c (c899445f9783309ac73073282d4c0ae27f51fa9a) | rtc-mv.c (2f6e5f9458646263d3d9ffadd5e11e3d8d15a7d0) |
---|---|
1/* 2 * Driver for the RTC in Marvell SoCs. 3 * 4 * This file is licensed under the terms of the GNU General Public 5 * License version 2. This program is licensed "as is" without any 6 * warranty of any kind, whether express or implied. 7 */ 8 9#include <linux/init.h> 10#include <linux/kernel.h> 11#include <linux/rtc.h> 12#include <linux/bcd.h> 13#include <linux/io.h> 14#include <linux/platform_device.h> | 1/* 2 * Driver for the RTC in Marvell SoCs. 3 * 4 * This file is licensed under the terms of the GNU General Public 5 * License version 2. This program is licensed "as is" without any 6 * warranty of any kind, whether express or implied. 7 */ 8 9#include <linux/init.h> 10#include <linux/kernel.h> 11#include <linux/rtc.h> 12#include <linux/bcd.h> 13#include <linux/io.h> 14#include <linux/platform_device.h> |
15#include <linux/of.h> | |
16#include <linux/delay.h> 17#include <linux/gfp.h> 18#include <linux/module.h> 19 20 21#define RTC_TIME_REG_OFFS 0 22#define RTC_SECONDS_OFFS 0 23#define RTC_MINUTES_OFFS 8 --- 245 unchanged lines hidden (view full) --- 269 pdata->rtc = rtc_device_register(pdev->name, &pdev->dev, 270 &mv_rtc_ops, THIS_MODULE); 271 if (IS_ERR(pdata->rtc)) 272 return PTR_ERR(pdata->rtc); 273 274 if (pdata->irq >= 0) { 275 writel(0, pdata->ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS); 276 if (devm_request_irq(&pdev->dev, pdata->irq, mv_rtc_interrupt, | 15#include <linux/delay.h> 16#include <linux/gfp.h> 17#include <linux/module.h> 18 19 20#define RTC_TIME_REG_OFFS 0 21#define RTC_SECONDS_OFFS 0 22#define RTC_MINUTES_OFFS 8 --- 245 unchanged lines hidden (view full) --- 268 pdata->rtc = rtc_device_register(pdev->name, &pdev->dev, 269 &mv_rtc_ops, THIS_MODULE); 270 if (IS_ERR(pdata->rtc)) 271 return PTR_ERR(pdata->rtc); 272 273 if (pdata->irq >= 0) { 274 writel(0, pdata->ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS); 275 if (devm_request_irq(&pdev->dev, pdata->irq, mv_rtc_interrupt, |
277 IRQF_DISABLED | IRQF_SHARED, | 276 IRQF_SHARED, |
278 pdev->name, pdata) < 0) { 279 dev_warn(&pdev->dev, "interrupt not available.\n"); 280 pdata->irq = -1; 281 } 282 } 283 284 return 0; 285} --- 4 unchanged lines hidden (view full) --- 290 291 if (pdata->irq >= 0) 292 device_init_wakeup(&pdev->dev, 0); 293 294 rtc_device_unregister(pdata->rtc); 295 return 0; 296} 297 | 277 pdev->name, pdata) < 0) { 278 dev_warn(&pdev->dev, "interrupt not available.\n"); 279 pdata->irq = -1; 280 } 281 } 282 283 return 0; 284} --- 4 unchanged lines hidden (view full) --- 289 290 if (pdata->irq >= 0) 291 device_init_wakeup(&pdev->dev, 0); 292 293 rtc_device_unregister(pdata->rtc); 294 return 0; 295} 296 |
298#ifdef CONFIG_OF 299static struct of_device_id rtc_mv_of_match_table[] = { 300 { .compatible = "mrvl,orion-rtc", }, 301 {} 302}; 303#endif 304 | |
305static struct platform_driver mv_rtc_driver = { 306 .remove = __exit_p(mv_rtc_remove), 307 .driver = { 308 .name = "rtc-mv", 309 .owner = THIS_MODULE, | 297static struct platform_driver mv_rtc_driver = { 298 .remove = __exit_p(mv_rtc_remove), 299 .driver = { 300 .name = "rtc-mv", 301 .owner = THIS_MODULE, |
310 .of_match_table = of_match_ptr(rtc_mv_of_match_table), | |
311 }, 312}; 313 314static __init int mv_init(void) 315{ 316 return platform_driver_probe(&mv_rtc_driver, mv_rtc_probe); 317} 318 --- 12 unchanged lines hidden --- | 302 }, 303}; 304 305static __init int mv_init(void) 306{ 307 return platform_driver_probe(&mv_rtc_driver, mv_rtc_probe); 308} 309 --- 12 unchanged lines hidden --- |