1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Registration of Cobalt RTC platform device.
5 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
7 #include <linux/errno.h>
8 #include <linux/init.h>
9 #include <linux/ioport.h>
10 #include <linux/mc146818rtc.h>
11 #include <linux/platform_device.h>
13 static struct resource cobalt_rtc_resource
[] __initdata
= {
17 .flags
= IORESOURCE_IO
,
22 .flags
= IORESOURCE_IRQ
,
26 static __init
int cobalt_rtc_add(void)
28 struct platform_device
*pdev
;
31 pdev
= platform_device_alloc("rtc_cmos", -1);
35 retval
= platform_device_add_resources(pdev
, cobalt_rtc_resource
,
36 ARRAY_SIZE(cobalt_rtc_resource
));
40 retval
= platform_device_add(pdev
);
47 platform_device_put(pdev
);
51 device_initcall(cobalt_rtc_add
);