diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 18:15:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 18:15:27 -0400 |
commit | 42cd71bf1e3a081b3150018bbf448cb6c8a844a5 (patch) | |
tree | 4a5d2eb0444255e4ad827a76dbd1417dd3876db6 /arch/arm/plat-mxc/devices | |
parent | f5039935ac685b3b9b8c13fbc33cac8643dee32e (diff) | |
parent | 9a55d9752d8abfc62f1ab05ccc790d22a0c8e7c0 (diff) |
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (137 commits)
ARM: bcmring: convert to use sp804 clockevents
ARM: bcmring: convert to sp804 clocksource
ARM: 6912/1: bcmring: Add clkdev table in init_early
clockevents: ARM sp804: obtain sp804 timer rate via clks
clockevents: ARM sp804: allow clockevent name to be specified
clocksource: ARM sp804: obtain sp804 timer rate via clks
clocksource: ARM sp804: allow clocksource name to be specified
clocksource: convert OMAP1 to 32-bit down counting clocksource
clocksource: convert MXS timrotv2 to 32-bit down counting clocksource
clocksource: convert SPEAr platforms 16-bit up counting clocksource
clocksource: convert Integrator/AP 16-bit down counting clocksource
clocksource: convert W90x900 24-bit down counting clocksource
clocksource: convert ARM 32-bit down counting clocksources
clocksource: convert ARM 32-bit up counting clocksources
clocksource: add common mmio clocksource
ARM: update sa1100 to reflect PXA updates
ARM: omap1: convert to using readl/writel instead of volatile struct
ARM: omap1: delete useless interrupt handler
ARM: s5p: consolidate selection of timer register
ARM: 6939/1: fix missing 'cpu_relax()' declaration
...
Diffstat (limited to 'arch/arm/plat-mxc/devices')
-rw-r--r-- | arch/arm/plat-mxc/devices/Kconfig | 7 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-ipu-core.c | 129 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-mxc_rtc.c | 40 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-spi_imx.c | 2 |
5 files changed, 178 insertions, 2 deletions
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig index b9ab1d58b5e7..bd294add932c 100644 --- a/arch/arm/plat-mxc/devices/Kconfig +++ b/arch/arm/plat-mxc/devices/Kconfig | |||
@@ -24,7 +24,6 @@ config IMX_HAVE_PLATFORM_IMXDI_RTC | |||
24 | 24 | ||
25 | config IMX_HAVE_PLATFORM_IMX_FB | 25 | config IMX_HAVE_PLATFORM_IMX_FB |
26 | bool | 26 | bool |
27 | select HAVE_FB_IMX | ||
28 | 27 | ||
29 | config IMX_HAVE_PLATFORM_IMX_I2C | 28 | config IMX_HAVE_PLATFORM_IMX_I2C |
30 | bool | 29 | bool |
@@ -41,6 +40,9 @@ config IMX_HAVE_PLATFORM_IMX_UART | |||
41 | config IMX_HAVE_PLATFORM_IMX_UDC | 40 | config IMX_HAVE_PLATFORM_IMX_UDC |
42 | bool | 41 | bool |
43 | 42 | ||
43 | config IMX_HAVE_PLATFORM_IPU_CORE | ||
44 | bool | ||
45 | |||
44 | config IMX_HAVE_PLATFORM_MX1_CAMERA | 46 | config IMX_HAVE_PLATFORM_MX1_CAMERA |
45 | bool | 47 | bool |
46 | 48 | ||
@@ -63,6 +65,9 @@ config IMX_HAVE_PLATFORM_MXC_RNGA | |||
63 | bool | 65 | bool |
64 | select ARCH_HAS_RNGA | 66 | select ARCH_HAS_RNGA |
65 | 67 | ||
68 | config IMX_HAVE_PLATFORM_MXC_RTC | ||
69 | bool | ||
70 | |||
66 | config IMX_HAVE_PLATFORM_MXC_W1 | 71 | config IMX_HAVE_PLATFORM_MXC_W1 |
67 | bool | 72 | bool |
68 | 73 | ||
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile index 75cd2ece9053..ad2922acf480 100644 --- a/arch/arm/plat-mxc/devices/Makefile +++ b/arch/arm/plat-mxc/devices/Makefile | |||
@@ -12,6 +12,7 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_KEYPAD) += platform-imx-keypad.o | |||
12 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o | 12 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o |
13 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o | 13 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o |
14 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o | 14 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o |
15 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IPU_CORE) += platform-ipu-core.o | ||
15 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MX1_CAMERA) += platform-mx1-camera.o | 16 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MX1_CAMERA) += platform-mx1-camera.o |
16 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA) += platform-mx2-camera.o | 17 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA) += platform-mx2-camera.o |
17 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI) += platform-mxc-ehci.o | 18 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI) += platform-mxc-ehci.o |
@@ -19,6 +20,7 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o | |||
19 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o | 20 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o |
20 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_PWM) += platform-mxc_pwm.o | 21 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_PWM) += platform-mxc_pwm.o |
21 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RNGA) += platform-mxc_rnga.o | 22 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RNGA) += platform-mxc_rnga.o |
23 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RTC) += platform-mxc_rtc.o | ||
22 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o | 24 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o |
23 | obj-$(CONFIG_IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX) += platform-sdhci-esdhc-imx.o | 25 | obj-$(CONFIG_IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX) += platform-sdhci-esdhc-imx.o |
24 | obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o | 26 | obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o |
diff --git a/arch/arm/plat-mxc/devices/platform-ipu-core.c b/arch/arm/plat-mxc/devices/platform-ipu-core.c new file mode 100644 index 000000000000..edf65034aea5 --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-ipu-core.c | |||
@@ -0,0 +1,129 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 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_ipu_core_entry_single(soc) \ | ||
13 | { \ | ||
14 | .iobase = soc ## _IPU_CTRL_BASE_ADDR, \ | ||
15 | .synirq = soc ## _INT_IPU_SYN, \ | ||
16 | .errirq = soc ## _INT_IPU_ERR, \ | ||
17 | } | ||
18 | |||
19 | #ifdef CONFIG_SOC_IMX31 | ||
20 | const struct imx_ipu_core_data imx31_ipu_core_data __initconst = | ||
21 | imx_ipu_core_entry_single(MX31); | ||
22 | #endif | ||
23 | |||
24 | #ifdef CONFIG_SOC_IMX35 | ||
25 | const struct imx_ipu_core_data imx35_ipu_core_data __initconst = | ||
26 | imx_ipu_core_entry_single(MX35); | ||
27 | #endif | ||
28 | |||
29 | static struct platform_device *imx_ipu_coredev __initdata; | ||
30 | |||
31 | struct platform_device *__init imx_add_ipu_core( | ||
32 | const struct imx_ipu_core_data *data, | ||
33 | const struct ipu_platform_data *pdata) | ||
34 | { | ||
35 | /* The resource order is important! */ | ||
36 | struct resource res[] = { | ||
37 | { | ||
38 | .start = data->iobase, | ||
39 | .end = data->iobase + 0x5f, | ||
40 | .flags = IORESOURCE_MEM, | ||
41 | }, { | ||
42 | .start = data->iobase + 0x88, | ||
43 | .end = data->iobase + 0xb3, | ||
44 | .flags = IORESOURCE_MEM, | ||
45 | }, { | ||
46 | .start = data->synirq, | ||
47 | .end = data->synirq, | ||
48 | .flags = IORESOURCE_IRQ, | ||
49 | }, { | ||
50 | .start = data->errirq, | ||
51 | .end = data->errirq, | ||
52 | .flags = IORESOURCE_IRQ, | ||
53 | }, | ||
54 | }; | ||
55 | |||
56 | return imx_ipu_coredev = imx_add_platform_device("ipu-core", -1, | ||
57 | res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); | ||
58 | } | ||
59 | |||
60 | struct platform_device *__init imx_alloc_mx3_camera( | ||
61 | const struct imx_ipu_core_data *data, | ||
62 | const struct mx3_camera_pdata *pdata) | ||
63 | { | ||
64 | struct resource res[] = { | ||
65 | { | ||
66 | .start = data->iobase + 0x60, | ||
67 | .end = data->iobase + 0x87, | ||
68 | .flags = IORESOURCE_MEM, | ||
69 | }, | ||
70 | }; | ||
71 | int ret = -ENOMEM; | ||
72 | struct platform_device *pdev; | ||
73 | |||
74 | if (IS_ERR_OR_NULL(imx_ipu_coredev)) | ||
75 | return ERR_PTR(-ENODEV); | ||
76 | |||
77 | pdev = platform_device_alloc("mx3-camera", 0); | ||
78 | if (!pdev) | ||
79 | goto err; | ||
80 | |||
81 | pdev->dev.dma_mask = kmalloc(sizeof(*pdev->dev.dma_mask), GFP_KERNEL); | ||
82 | if (!pdev->dev.dma_mask) | ||
83 | goto err; | ||
84 | |||
85 | *pdev->dev.dma_mask = DMA_BIT_MASK(32); | ||
86 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
87 | |||
88 | ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res)); | ||
89 | if (ret) | ||
90 | goto err; | ||
91 | |||
92 | if (pdata) { | ||
93 | struct mx3_camera_pdata *copied_pdata; | ||
94 | |||
95 | ret = platform_device_add_data(pdev, pdata, sizeof(*pdata)); | ||
96 | if (ret) { | ||
97 | err: | ||
98 | kfree(pdev->dev.dma_mask); | ||
99 | platform_device_put(pdev); | ||
100 | return ERR_PTR(-ENODEV); | ||
101 | } | ||
102 | copied_pdata = dev_get_platdata(&pdev->dev); | ||
103 | copied_pdata->dma_dev = &imx_ipu_coredev->dev; | ||
104 | } | ||
105 | |||
106 | return pdev; | ||
107 | } | ||
108 | |||
109 | struct platform_device *__init imx_add_mx3_sdc_fb( | ||
110 | const struct imx_ipu_core_data *data, | ||
111 | struct mx3fb_platform_data *pdata) | ||
112 | { | ||
113 | struct resource res[] = { | ||
114 | { | ||
115 | .start = data->iobase + 0xb4, | ||
116 | .end = data->iobase + 0x1bf, | ||
117 | .flags = IORESOURCE_MEM, | ||
118 | }, | ||
119 | }; | ||
120 | |||
121 | if (IS_ERR_OR_NULL(imx_ipu_coredev)) | ||
122 | return ERR_PTR(-ENODEV); | ||
123 | |||
124 | pdata->dma_dev = &imx_ipu_coredev->dev; | ||
125 | |||
126 | return imx_add_platform_device_dmamask("mx3_sdc_fb", -1, | ||
127 | res, ARRAY_SIZE(res), pdata, sizeof(*pdata), | ||
128 | DMA_BIT_MASK(32)); | ||
129 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_rtc.c b/arch/arm/plat-mxc/devices/platform-mxc_rtc.c new file mode 100644 index 000000000000..16d0ec4df5f6 --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-mxc_rtc.c | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010-2011 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_rtc_data_entry_single(soc) \ | ||
13 | { \ | ||
14 | .iobase = soc ## _RTC_BASE_ADDR, \ | ||
15 | .irq = soc ## _INT_RTC, \ | ||
16 | } | ||
17 | |||
18 | #ifdef CONFIG_SOC_IMX31 | ||
19 | const struct imx_mxc_rtc_data imx31_mxc_rtc_data __initconst = | ||
20 | imx_mxc_rtc_data_entry_single(MX31); | ||
21 | #endif /* ifdef CONFIG_SOC_IMX31 */ | ||
22 | |||
23 | struct platform_device *__init imx_add_mxc_rtc( | ||
24 | const struct imx_mxc_rtc_data *data) | ||
25 | { | ||
26 | struct resource res[] = { | ||
27 | { | ||
28 | .start = data->iobase, | ||
29 | .end = data->iobase + SZ_16K - 1, | ||
30 | .flags = IORESOURCE_MEM, | ||
31 | }, { | ||
32 | .start = data->irq, | ||
33 | .end = data->irq, | ||
34 | .flags = IORESOURCE_IRQ, | ||
35 | }, | ||
36 | }; | ||
37 | |||
38 | return imx_add_platform_device("mxc_rtc", -1, | ||
39 | res, ARRAY_SIZE(res), NULL, 0); | ||
40 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-spi_imx.c b/arch/arm/plat-mxc/devices/platform-spi_imx.c index f4a60ab6763b..f97eb3615b2c 100644 --- a/arch/arm/plat-mxc/devices/platform-spi_imx.c +++ b/arch/arm/plat-mxc/devices/platform-spi_imx.c | |||
@@ -80,7 +80,7 @@ const struct imx_spi_imx_data imx35_cspi_data[] __initconst = { | |||
80 | 80 | ||
81 | #ifdef CONFIG_SOC_IMX51 | 81 | #ifdef CONFIG_SOC_IMX51 |
82 | const struct imx_spi_imx_data imx51_cspi_data __initconst = | 82 | const struct imx_spi_imx_data imx51_cspi_data __initconst = |
83 | imx_spi_imx_data_entry_single(MX51, CSPI, "imx51-cspi", 0, , SZ_4K); | 83 | imx_spi_imx_data_entry_single(MX51, CSPI, "imx51-cspi", 2, , SZ_4K); |
84 | 84 | ||
85 | const struct imx_spi_imx_data imx51_ecspi_data[] __initconst = { | 85 | const struct imx_spi_imx_data imx51_ecspi_data[] __initconst = { |
86 | #define imx51_ecspi_data_entry(_id, _hwid) \ | 86 | #define imx51_ecspi_data_entry(_id, _hwid) \ |