diff options
Diffstat (limited to 'arch/arm/plat-mxc')
-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-mxc_w1.c | 50 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/devices-common.h | 6 |
4 files changed, 60 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig index 9aa6f3ea9012..fb664670c101 100644 --- a/arch/arm/plat-mxc/devices/Kconfig +++ b/arch/arm/plat-mxc/devices/Kconfig | |||
@@ -25,5 +25,8 @@ config IMX_HAVE_PLATFORM_IMX_UART | |||
25 | config IMX_HAVE_PLATFORM_MXC_NAND | 25 | config IMX_HAVE_PLATFORM_MXC_NAND |
26 | bool | 26 | bool |
27 | 27 | ||
28 | config IMX_HAVE_PLATFORM_MXC_W1 | ||
29 | bool | ||
30 | |||
28 | config IMX_HAVE_PLATFORM_SPI_IMX | 31 | config IMX_HAVE_PLATFORM_SPI_IMX |
29 | bool | 32 | bool |
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile index 45aefeb283ba..1d7d39201622 100644 --- a/arch/arm/plat-mxc/devices/Makefile +++ b/arch/arm/plat-mxc/devices/Makefile | |||
@@ -7,4 +7,5 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o | |||
7 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o | 7 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o |
8 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o | 8 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o |
9 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o | 9 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o |
10 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o | ||
10 | obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o | 11 | obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o |
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_w1.c b/arch/arm/plat-mxc/devices/platform-mxc_w1.c new file mode 100644 index 000000000000..1355237391fc --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-mxc_w1.c | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * Copyright (C) 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/hardware.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | #define imx_mxc_w1_data_entry_single(soc) \ | ||
13 | { \ | ||
14 | .iobase = soc ## _OWIRE_BASE_ADDR, \ | ||
15 | } | ||
16 | |||
17 | #ifdef CONFIG_SOC_IMX21 | ||
18 | const struct imx_mxc_w1_data imx21_mxc_w1_data __initconst = | ||
19 | imx_mxc_w1_data_entry_single(MX21); | ||
20 | #endif /* ifdef CONFIG_SOC_IMX21 */ | ||
21 | |||
22 | #ifdef CONFIG_SOC_IMX27 | ||
23 | const struct imx_mxc_w1_data imx27_mxc_w1_data __initconst = | ||
24 | imx_mxc_w1_data_entry_single(MX27); | ||
25 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
26 | |||
27 | #ifdef CONFIG_ARCH_MX31 | ||
28 | const struct imx_mxc_w1_data imx31_mxc_w1_data __initconst = | ||
29 | imx_mxc_w1_data_entry_single(MX31); | ||
30 | #endif /* ifdef CONFIG_ARCH_MX31 */ | ||
31 | |||
32 | #ifdef CONFIG_ARCH_MX35 | ||
33 | const struct imx_mxc_w1_data imx35_mxc_w1_data __initconst = | ||
34 | imx_mxc_w1_data_entry_single(MX35); | ||
35 | #endif /* ifdef CONFIG_ARCH_MX35 */ | ||
36 | |||
37 | struct platform_device *__init imx_add_mxc_w1( | ||
38 | const struct imx_mxc_w1_data *data) | ||
39 | { | ||
40 | struct resource res[] = { | ||
41 | { | ||
42 | .start = data->iobase, | ||
43 | .end = data->iobase + SZ_4K - 1, | ||
44 | .flags = IORESOURCE_MEM, | ||
45 | }, | ||
46 | }; | ||
47 | |||
48 | return imx_add_platform_device("mxc_w1", 0, | ||
49 | res, ARRAY_SIZE(res), NULL, 0); | ||
50 | } | ||
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h index 8c6896fd1e5f..431e0ef4a832 100644 --- a/arch/arm/plat-mxc/include/mach/devices-common.h +++ b/arch/arm/plat-mxc/include/mach/devices-common.h | |||
@@ -99,6 +99,12 @@ struct platform_device *__init imx_add_mxc_nand( | |||
99 | const struct imx_mxc_nand_data *data, | 99 | const struct imx_mxc_nand_data *data, |
100 | const struct mxc_nand_platform_data *pdata); | 100 | const struct mxc_nand_platform_data *pdata); |
101 | 101 | ||
102 | struct imx_mxc_w1_data { | ||
103 | resource_size_t iobase; | ||
104 | }; | ||
105 | struct platform_device *__init imx_add_mxc_w1( | ||
106 | const struct imx_mxc_w1_data *data); | ||
107 | |||
102 | #include <mach/spi.h> | 108 | #include <mach/spi.h> |
103 | struct imx_spi_imx_data { | 109 | struct imx_spi_imx_data { |
104 | const char *devid; | 110 | const char *devid; |