1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2010-2011 Pengutronix
4 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
6 #include "../hardware.h"
7 #include "devices-common.h"
9 #define imx_mxc_rtc_data_entry_single(soc, _devid) \
12 .iobase = soc ## _RTC_BASE_ADDR, \
13 .irq = soc ## _INT_RTC, \
16 #ifdef CONFIG_SOC_IMX31
17 const struct imx_mxc_rtc_data imx31_mxc_rtc_data __initconst
=
18 imx_mxc_rtc_data_entry_single(MX31
, "imx21-rtc");
19 #endif /* ifdef CONFIG_SOC_IMX31 */
21 #ifdef CONFIG_SOC_IMX35
22 const struct imx_mxc_rtc_data imx35_mxc_rtc_data __initconst
=
23 imx_mxc_rtc_data_entry_single(MX35
, "imx21-rtc");
24 #endif /* ifdef CONFIG_SOC_IMX35 */
26 struct platform_device
*__init
imx_add_mxc_rtc(
27 const struct imx_mxc_rtc_data
*data
)
29 struct resource res
[] = {
31 .start
= data
->iobase
,
32 .end
= data
->iobase
+ SZ_16K
- 1,
33 .flags
= IORESOURCE_MEM
,
37 .flags
= IORESOURCE_IRQ
,
41 return imx_add_platform_device(data
->devid
, -1,
42 res
, ARRAY_SIZE(res
), NULL
, 0);