diff options
-rw-r--r-- | arch/arm/plat-mxc/devices/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-imx-i2c.c | 29 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/devices-common.h | 5 |
4 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig index 09e91dde63ab..c50a7d60a0bc 100644 --- a/arch/arm/plat-mxc/devices/Kconfig +++ b/arch/arm/plat-mxc/devices/Kconfig | |||
@@ -1,2 +1,5 @@ | |||
1 | config IMX_HAVE_PLATFORM_IMX_I2C | ||
2 | bool | ||
3 | |||
1 | config IMX_HAVE_PLATFORM_MXC_NAND | 4 | config IMX_HAVE_PLATFORM_MXC_NAND |
2 | bool | 5 | bool |
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile index e314533a61b9..4a2b2dec131e 100644 --- a/arch/arm/plat-mxc/devices/Makefile +++ b/arch/arm/plat-mxc/devices/Makefile | |||
@@ -1 +1,2 @@ | |||
1 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o | ||
1 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o | 2 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o |
diff --git a/arch/arm/plat-mxc/devices/platform-imx-i2c.c b/arch/arm/plat-mxc/devices/platform-imx-i2c.c new file mode 100644 index 000000000000..d0af9f7d8aed --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-imx-i2c.c | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/devices-common.h> | ||
10 | |||
11 | struct platform_device *__init imx_add_imx_i2c(int id, | ||
12 | resource_size_t iobase, resource_size_t iosize, int irq, | ||
13 | const struct imxi2c_platform_data *pdata) | ||
14 | { | ||
15 | struct resource res[] = { | ||
16 | { | ||
17 | .start = iobase, | ||
18 | .end = iobase + iosize - 1, | ||
19 | .flags = IORESOURCE_MEM, | ||
20 | }, { | ||
21 | .start = irq, | ||
22 | .end = irq, | ||
23 | .flags = IORESOURCE_IRQ, | ||
24 | }, | ||
25 | }; | ||
26 | |||
27 | return imx_add_platform_device("imx-i2c", id, res, ARRAY_SIZE(res), | ||
28 | pdata, sizeof(*pdata)); | ||
29 | } | ||
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h index d5f121a5604b..8388f9086e68 100644 --- a/arch/arm/plat-mxc/include/mach/devices-common.h +++ b/arch/arm/plat-mxc/include/mach/devices-common.h | |||
@@ -14,6 +14,11 @@ struct platform_device *imx_add_platform_device(const char *name, int id, | |||
14 | const struct resource *res, unsigned int num_resources, | 14 | const struct resource *res, unsigned int num_resources, |
15 | const void *data, size_t size_data); | 15 | const void *data, size_t size_data); |
16 | 16 | ||
17 | #include <mach/i2c.h> | ||
18 | struct platform_device *__init imx_add_imx_i2c(int id, | ||
19 | resource_size_t iobase, resource_size_t iosize, int irq, | ||
20 | const struct imxi2c_platform_data *pdata); | ||
21 | |||
17 | #include <mach/mxc_nand.h> | 22 | #include <mach/mxc_nand.h> |
18 | struct platform_device *__init imx_add_mxc_nand_v1(resource_size_t iobase, | 23 | struct platform_device *__init imx_add_mxc_nand_v1(resource_size_t iobase, |
19 | int irq, const struct mxc_nand_platform_data *pdata); | 24 | int irq, const struct mxc_nand_platform_data *pdata); |