diff options
author | Uwe Kleine-König | 2010-11-11 11:57:21 +0100 |
---|---|---|
committer | Uwe Kleine-König | 2010-11-17 10:01:40 +0100 |
commit | e7c74b343091e0c6b7bb67c12f9f7fb345aa6a50 (patch) | |
tree | 08b808dad98c3b098eaa49c6588b6b16d46d7bd8 /arch/arm/plat-mxc/devices/platform-imxdi_rtc.c | |
parent | ARM: mx25: dynamically allocate imx-keypad devices (diff) | |
download | kernel-qcow2-linux-e7c74b343091e0c6b7bb67c12f9f7fb345aa6a50.tar.gz kernel-qcow2-linux-e7c74b343091e0c6b7bb67c12f9f7fb345aa6a50.tar.xz kernel-qcow2-linux-e7c74b343091e0c6b7bb67c12f9f7fb345aa6a50.zip |
ARM: mx25: dynamically allocate imxdi_rtc devices
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc/devices/platform-imxdi_rtc.c')
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-imxdi_rtc.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c b/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c new file mode 100644 index 000000000000..387f65032c1d --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2010 Pengutronix + * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License version 2 as published by the + * Free Software Foundation. + */ +#include <asm/sizes.h> +#include <mach/hardware.h> +#include <mach/devices-common.h> + +#define imx_imxdi_rtc_data_entry_single(soc) \ + { \ + .iobase = soc ## _DRYICE_BASE_ADDR, \ + .irq = soc ## _INT_DRYICE, \ + } + +#ifdef CONFIG_ARCH_MX25 +const struct imx_imxdi_rtc_data imx25_imxdi_rtc_data __initconst = + imx_imxdi_rtc_data_entry_single(MX25); +#endif /* ifdef CONFIG_ARCH_MX25 */ + +struct platform_device *__init imx_add_imxdi_rtc( + const struct imx_imxdi_rtc_data *data) +{ + struct resource res[] = { + { + .start = data->iobase, + .end = data->iobase + SZ_16K, + .flags = IORESOURCE_MEM, + }, { + .start = data->irq, + .end = data->irq, + .flags = IORESOURCE_IRQ, + }, + }; + + return imx_add_platform_device("imxdi_rtc", 0, + res, ARRAY_SIZE(res), NULL, 0); +} |