* [PATCH 00/34] i.MX multi-platform support
@ 2012-09-17 5:34 Shawn Guo
2012-09-17 5:34 ` [PATCH 01/34] ARM: imx: include board headers in the same folder Shawn Guo
` (35 more replies)
0 siblings, 36 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
The series enables multi-platform support for imx. Since the required
frameworks (clk, pwm) and spare_irq have already been adopted on imx,
the series is all about cleaning up mach/* headers. Along with the
changes, arch/arm/plat-mxc gets merged into arch/arm/mach-imx.
It's based on a bunch of branches (works from others), Rob's initial
multi-platform series, Arnd's platform-data and smp_ops (Marc's) and
imx 3.7 material (Sascha and myself).
It's available on branch below.
git://git.linaro.org/people/shawnguo/linux-2.6.git imx/multi-platform
It's been tested on imx5 and imx6, and only compile-tested on imx2 and
imx3, so testing on imx2/3 are appreciated.
Subsystem maintainers,
I plan to send the whole series via arm-soc tree at the end of 3.7
merge window when all dependant bits hit mainline. Please have a
look at the patches you get copied and provide ACKs if the changes
are good. Thanks.
Shawn Guo (34):
ARM: imx: include board headers in the same folder
ASoC: mx27vis: retrieve gpio numbers from platform_data
ARM: imx: move iomux drivers and headers into mach-imx
ARM: imx: remove unnecessary inclusion from device-imx*.h
ARM: imx: move platform device code into mach-imx
ARM: imx: merge plat-mxc into mach-imx
ARM: imx: include common.h rather than mach/common.h
ARM: imx: ARM: imx: include cpuidle.h rather than mach/cpuidle.h
ARM: imx: include iim.h rather than mach/iim.h
ARM: imx: include iram.h rather than mach/iram.h
ARM: imx: include ulpi.h rather than mach/ulpi.h
media: mx1_camera: remove the driver
ARM: imx: remove mach/dma-mx1-mx2.h
dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h
dma: imx-sdma: remove unneeded mach/hardware.h inclusion
ASoC: imx-ssi: remove unneeded mach/hardware.h inclusion
usb: ehci-mxc: remove unneeded mach/hardware.h inclusion
video: mx3fb: remove unneeded mach/hardware.h inclusion
watchdog: imx2_wdt: remove unneeded mach/hardware.h inclusion
i2c: imx: remove mach/hardware.h inclusion
mtd: mxc_nand: remove mach/hardware.h inclusion
rtc: mxc_rtc: remove mach/hardware.h inclusion
dma: imx-dma: use devm_kzalloc and devm_request_irq
dma: imx-dma: retrieve MEM and IRQ from resources
dma: imx-dma: remove mach/hardware.h inclusion
media: mx2_camera: remove dead code in mx2_camera_add_device
media: mx2_camera: use managed functions to clean up code
media: mx2_camera: remove mach/hardware.h inclusion
mmc: mxcmmc: remove mach/hardware.h inclusion
video: imxfb: remove mach/hardware.h inclusion
ARM: imx: move debug macros to include/debug
ARM: imx: include hardware.h rather than mach/hardware.h
ARM: imx: remove header file mach/irqs.h
ARM: imx: enable multi-platform build
.../devicetree/bindings/i2c/fsl-imx-i2c.txt | 4 +-
arch/arm/Kconfig | 15 +-
arch/arm/Kconfig.debug | 8 +
arch/arm/Makefile | 1 -
arch/arm/boot/dts/imx27.dtsi | 4 +-
arch/arm/boot/dts/imx51.dtsi | 4 +-
arch/arm/boot/dts/imx53.dtsi | 6 +-
arch/arm/boot/dts/imx6q.dtsi | 6 +-
.../mach/debug-macro.S => include/debug/imx.S} | 33 +-
arch/arm/{plat-mxc => mach-imx}/3ds_debugboard.c | 2 +-
.../include/mach => mach-imx}/3ds_debugboard.h | 0
arch/arm/mach-imx/Kconfig | 86 ++
arch/arm/mach-imx/Makefile | 23 +-
arch/arm/{plat-mxc => mach-imx}/avic.c | 5 +-
.../include/mach => mach-imx}/board-mx31lilly.h | 0
.../include/mach => mach-imx}/board-mx31lite.h | 0
.../include/mach => mach-imx}/board-mx31moboard.h | 0
.../include/mach => mach-imx}/board-pcm038.h | 0
arch/arm/mach-imx/clk-imx1.c | 15 +-
arch/arm/mach-imx/clk-imx21.c | 14 +-
arch/arm/mach-imx/clk-imx25.c | 26 +-
arch/arm/mach-imx/clk-imx27.c | 36 +-
arch/arm/mach-imx/clk-imx31.c | 21 +-
arch/arm/mach-imx/clk-imx35.c | 13 +-
arch/arm/mach-imx/clk-imx51-imx53.c | 15 +-
arch/arm/mach-imx/clk-imx6q.c | 3 +-
arch/arm/mach-imx/clk-pllv1.c | 4 +-
.../{plat-mxc/include/mach => mach-imx}/common.h | 0
arch/arm/mach-imx/cpu-imx25.c | 5 +-
arch/arm/mach-imx/cpu-imx27.c | 2 +-
arch/arm/mach-imx/cpu-imx31.c | 7 +-
arch/arm/mach-imx/cpu-imx35.c | 5 +-
arch/arm/mach-imx/cpu-imx5.c | 3 +-
arch/arm/{plat-mxc => mach-imx}/cpu.c | 3 +-
arch/arm/mach-imx/cpu_op-mx51.c | 3 +-
arch/arm/{plat-mxc => mach-imx}/cpufreq.c | 3 +-
arch/arm/{plat-mxc => mach-imx}/cpuidle.c | 0
.../{plat-mxc/include/mach => mach-imx}/cpuidle.h | 0
arch/arm/mach-imx/devices-imx1.h | 3 +-
arch/arm/mach-imx/devices-imx21.h | 3 +-
arch/arm/mach-imx/devices-imx25.h | 3 +-
arch/arm/mach-imx/devices-imx27.h | 3 +-
arch/arm/mach-imx/devices-imx31.h | 3 +-
arch/arm/mach-imx/devices-imx35.h | 3 +-
arch/arm/mach-imx/devices-imx50.h | 3 +-
arch/arm/mach-imx/devices-imx51.h | 3 +-
arch/arm/{plat-mxc => mach-imx}/devices/Kconfig | 3 -
arch/arm/{plat-mxc => mach-imx}/devices/Makefile | 3 +-
.../mach => mach-imx/devices}/devices-common.h | 19 +-
arch/arm/{plat-mxc => mach-imx/devices}/devices.c | 1 -
.../devices/platform-ahci-imx.c | 5 +-
.../{plat-mxc => mach-imx}/devices/platform-fec.c | 5 +-
.../devices/platform-flexcan.c | 4 +-
.../devices/platform-fsl-usb2-udc.c | 5 +-
.../devices/platform-gpio-mxc.c | 2 +-
.../devices/platform-gpio_keys.c | 5 +-
.../devices/platform-imx-dma.c | 23 +-
.../devices/platform-imx-fb.c | 16 +-
.../devices/platform-imx-i2c.c | 31 +-
.../devices/platform-imx-keypad.c | 4 +-
.../devices/platform-imx-ssi.c | 4 +-
.../devices/platform-imx-uart.c | 4 +-
.../devices/platform-imx2-wdt.c | 5 +-
.../devices/platform-imx21-hcd.c | 4 +-
.../devices/platform-imx_udc.c | 4 +-
.../devices/platform-imxdi_rtc.c | 5 +-
.../devices/platform-ipu-core.c | 5 +-
.../devices/platform-mx2-camera.c | 16 +-
.../devices/platform-mxc-ehci.c | 5 +-
.../devices/platform-mxc-mmc.c | 20 +-
.../devices/platform-mxc_nand.c | 25 +-
.../devices/platform-mxc_pwm.c | 4 +-
.../devices/platform-mxc_rnga.c | 4 +-
.../devices/platform-mxc_rtc.c | 13 +-
.../devices/platform-mxc_w1.c | 4 +-
.../devices/platform-pata_imx.c | 4 +-
.../devices/platform-sdhci-esdhc-imx.c | 5 +-
.../devices/platform-spi_imx.c | 4 +-
arch/arm/mach-imx/ehci-imx25.c | 4 +-
arch/arm/mach-imx/ehci-imx27.c | 4 +-
arch/arm/mach-imx/ehci-imx31.c | 4 +-
arch/arm/mach-imx/ehci-imx35.c | 4 +-
arch/arm/mach-imx/ehci-imx5.c | 4 +-
arch/arm/{plat-mxc => mach-imx}/epit.c | 6 +-
.../include/mach => mach-imx}/eukrea-baseboards.h | 0
arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | 7 +-
arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c | 8 +-
arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c | 7 +-
arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c | 7 +-
.../{plat-mxc/include/mach => mach-imx}/hardware.h | 26 +-
arch/arm/mach-imx/hotplug.c | 3 +-
arch/arm/{plat-mxc/include/mach => mach-imx}/iim.h | 0
arch/arm/mach-imx/imx27-dt.c | 11 +-
arch/arm/mach-imx/imx31-dt.c | 5 +-
arch/arm/mach-imx/imx51-dt.c | 9 +-
arch/arm/mach-imx/include/mach/dma-mx1-mx2.h | 10 -
arch/arm/mach-imx/iomux-imx31.c | 5 +-
.../include/mach => mach-imx}/iomux-mx1.h | 2 +-
.../include/mach => mach-imx}/iomux-mx21.h | 4 +-
.../include/mach => mach-imx}/iomux-mx25.h | 2 +-
.../include/mach => mach-imx}/iomux-mx27.h | 4 +-
.../include/mach => mach-imx}/iomux-mx2x.h | 0
.../include/mach => mach-imx}/iomux-mx3.h | 0
.../include/mach => mach-imx}/iomux-mx35.h | 2 +-
.../include/mach => mach-imx}/iomux-mx50.h | 2 +-
.../include/mach => mach-imx}/iomux-mx51.h | 2 +-
arch/arm/{plat-mxc => mach-imx}/iomux-v1.c | 5 +-
.../{plat-mxc/include/mach => mach-imx}/iomux-v1.h | 0
arch/arm/{plat-mxc => mach-imx}/iomux-v3.c | 5 +-
.../{plat-mxc/include/mach => mach-imx}/iomux-v3.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/iram.h | 0
arch/arm/{plat-mxc => mach-imx}/iram_alloc.c | 3 +-
arch/arm/{plat-mxc => mach-imx}/irq-common.c | 0
arch/arm/{plat-mxc => mach-imx}/irq-common.h | 3 +
arch/arm/mach-imx/lluart.c | 3 +-
arch/arm/mach-imx/mach-apf9328.c | 7 +-
arch/arm/mach-imx/mach-armadillo5x0.c | 9 +-
arch/arm/mach-imx/mach-bug.c | 7 +-
arch/arm/mach-imx/mach-cpuimx27.c | 11 +-
arch/arm/mach-imx/mach-cpuimx35.c | 9 +-
arch/arm/mach-imx/mach-cpuimx51sd.c | 9 +-
arch/arm/mach-imx/mach-eukrea_cpuimx25.c | 10 +-
arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 48 +-
arch/arm/mach-imx/mach-imx27ipcam.c | 6 +-
arch/arm/mach-imx/mach-imx27lite.c | 6 +-
arch/arm/mach-imx/mach-imx53.c | 11 +-
arch/arm/mach-imx/mach-imx6q.c | 6 +-
arch/arm/mach-imx/mach-kzm_arm11_01.c | 7 +-
arch/arm/mach-imx/mach-mx1ads.c | 7 +-
arch/arm/mach-imx/mach-mx21ads.c | 6 +-
arch/arm/mach-imx/mach-mx25_3ds.c | 8 +-
arch/arm/mach-imx/mach-mx27_3ds.c | 10 +-
arch/arm/mach-imx/mach-mx27ads.c | 6 +-
arch/arm/mach-imx/mach-mx31_3ds.c | 12 +-
arch/arm/mach-imx/mach-mx31ads.c | 5 +-
arch/arm/mach-imx/mach-mx31lilly.c | 11 +-
arch/arm/mach-imx/mach-mx31lite.c | 11 +-
arch/arm/mach-imx/mach-mx31moboard.c | 14 +-
arch/arm/mach-imx/mach-mx35_3ds.c | 8 +-
arch/arm/mach-imx/mach-mx50_rdp.c | 7 +-
arch/arm/mach-imx/mach-mx51_3ds.c | 9 +-
arch/arm/mach-imx/mach-mx51_babbage.c | 7 +-
arch/arm/mach-imx/mach-mxt_td60.c | 6 +-
arch/arm/mach-imx/mach-pca100.c | 8 +-
arch/arm/mach-imx/mach-pcm037.c | 8 +-
arch/arm/mach-imx/mach-pcm037_eet.c | 5 +-
arch/arm/mach-imx/mach-pcm038.c | 13 +-
arch/arm/mach-imx/mach-pcm043.c | 9 +-
arch/arm/mach-imx/mach-qong.c | 6 +-
arch/arm/mach-imx/mach-scb9328.c | 7 +-
arch/arm/mach-imx/mach-vpr200.c | 7 +-
arch/arm/mach-imx/mm-imx1.c | 9 +-
arch/arm/mach-imx/mm-imx21.c | 12 +-
arch/arm/mach-imx/mm-imx25.c | 10 +-
arch/arm/mach-imx/mm-imx27.c | 12 +-
arch/arm/mach-imx/mm-imx3.c | 9 +-
arch/arm/mach-imx/mm-imx5.c | 8 +-
arch/arm/mach-imx/mx1-camera-fiq-ksym.c | 18 -
arch/arm/mach-imx/mx1-camera-fiq.S | 35 -
arch/arm/{plat-mxc/include/mach => mach-imx}/mx1.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx21.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx25.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx27.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx2x.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx31.h | 0
arch/arm/mach-imx/mx31lilly-db.c | 9 +-
arch/arm/mach-imx/mx31lite-db.c | 9 +-
arch/arm/mach-imx/mx31moboard-devboard.c | 9 +-
arch/arm/mach-imx/mx31moboard-marxbot.c | 9 +-
arch/arm/mach-imx/mx31moboard-smartbot.c | 11 +-
.../arm/{plat-mxc/include/mach => mach-imx}/mx35.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx3x.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx50.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx51.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx53.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx6q.h | 0
arch/arm/{plat-mxc/include/mach => mach-imx}/mxc.h | 0
arch/arm/mach-imx/pcm970-baseboard.c | 7 +-
arch/arm/mach-imx/platsmp.c | 5 +-
arch/arm/mach-imx/pm-imx27.c | 3 +-
arch/arm/mach-imx/pm-imx3.c | 7 +-
arch/arm/mach-imx/pm-imx5.c | 7 +-
arch/arm/mach-imx/pm-imx6q.c | 5 +-
arch/arm/{plat-mxc => mach-imx}/ssi-fiq-ksym.c | 0
arch/arm/{plat-mxc => mach-imx}/ssi-fiq.S | 0
arch/arm/{plat-mxc => mach-imx}/system.c | 5 +-
arch/arm/{plat-mxc => mach-imx}/time.c | 5 +-
arch/arm/{plat-mxc => mach-imx}/tzic.c | 6 +-
arch/arm/{plat-mxc => mach-imx}/ulpi.c | 2 +-
.../arm/{plat-mxc/include/mach => mach-imx}/ulpi.h | 0
arch/arm/plat-mxc/Kconfig | 89 --
arch/arm/plat-mxc/Makefile | 24 -
arch/arm/plat-mxc/devices/platform-mx1-camera.c | 42 -
arch/arm/plat-mxc/include/mach/irqs.h | 21 -
arch/arm/plat-mxc/include/mach/timex.h | 22 -
arch/arm/plat-mxc/include/mach/uncompress.h | 132 ---
drivers/dma/imx-dma.c | 137 +--
drivers/dma/imx-sdma.c | 1 -
drivers/dma/ipu/ipu_idmac.c | 3 +-
drivers/dma/ipu/ipu_irq.c | 3 +-
drivers/i2c/busses/i2c-imx.c | 40 +-
drivers/media/video/Kconfig | 12 -
drivers/media/video/Makefile | 1 -
drivers/media/video/mx1_camera.c | 889 --------------------
drivers/media/video/mx2_camera.c | 240 +++---
drivers/media/video/mx3_camera.c | 2 +-
drivers/mmc/host/mxcmmc.c | 31 +-
drivers/mtd/nand/mxc_nand.c | 86 +-
drivers/rtc/rtc-mxc.c | 34 +-
drivers/usb/host/ehci-mxc.c | 1 -
drivers/video/imxfb.c | 38 +-
drivers/video/mx3fb.c | 3 +-
drivers/watchdog/imx2_wdt.c | 1 -
.../mach/ipu.h => include/linux/dma/ipu-dma.h | 6 +-
include/linux/platform_data/asoc-mx27vis.h | 11 +
include/linux/platform_data/camera-mx1.h | 35 -
sound/soc/fsl/imx-pcm-fiq.c | 3 +-
sound/soc/fsl/imx-ssi.c | 1 -
sound/soc/fsl/mx27vis-aic32x4.c | 42 +-
219 files changed, 1149 insertions(+), 2170 deletions(-)
rename arch/arm/{plat-mxc/include/mach/debug-macro.S => include/debug/imx.S} (59%)
rename arch/arm/{plat-mxc => mach-imx}/3ds_debugboard.c (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/3ds_debugboard.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/avic.c (98%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/board-mx31lilly.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/board-mx31lite.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/board-mx31moboard.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/board-pcm038.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/common.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/cpu.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/cpufreq.c (99%)
rename arch/arm/{plat-mxc => mach-imx}/cpuidle.c (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/cpuidle.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/devices/Kconfig (96%)
rename arch/arm/{plat-mxc => mach-imx}/devices/Makefile (96%)
rename arch/arm/{plat-mxc/include/mach => mach-imx/devices}/devices-common.h (96%)
rename arch/arm/{plat-mxc => mach-imx/devices}/devices.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-ahci-imx.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-fec.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-flexcan.c (96%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-fsl-usb2-udc.c (96%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-gpio-mxc.c (96%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-gpio_keys.c (94%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-dma.c (63%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-fb.c (79%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-i2c.c (77%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-keypad.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-ssi.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-uart.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx2-wdt.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx21-hcd.c (94%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx_udc.c (96%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imxdi_rtc.c (94%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-ipu-core.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mx2-camera.c (83%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc-ehci.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc-mmc.c (76%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc_nand.c (74%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc_pwm.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc_rnga.c (95%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc_rtc.c (77%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc_w1.c (95%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-pata_imx.c (96%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-sdhci-esdhc-imx.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-spi_imx.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/epit.c (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/eukrea-baseboards.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/hardware.h (94%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iim.h (100%)
delete mode 100644 arch/arm/mach-imx/include/mach/dma-mx1-mx2.h
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx1.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx21.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx25.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx27.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx2x.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx3.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx35.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx50.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx51.h (99%)
rename arch/arm/{plat-mxc => mach-imx}/iomux-v1.c (98%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-v1.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/iomux-v3.c (97%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-v3.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iram.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/iram_alloc.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/irq-common.c (100%)
rename arch/arm/{plat-mxc => mach-imx}/irq-common.h (94%)
delete mode 100644 arch/arm/mach-imx/mx1-camera-fiq-ksym.c
delete mode 100644 arch/arm/mach-imx/mx1-camera-fiq.S
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx1.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx21.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx25.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx27.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx2x.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx31.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx35.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx3x.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx50.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx51.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx53.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx6q.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mxc.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/ssi-fiq-ksym.c (100%)
rename arch/arm/{plat-mxc => mach-imx}/ssi-fiq.S (100%)
rename arch/arm/{plat-mxc => mach-imx}/system.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/time.c (99%)
rename arch/arm/{plat-mxc => mach-imx}/tzic.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/ulpi.c (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/ulpi.h (100%)
delete mode 100644 arch/arm/plat-mxc/Kconfig
delete mode 100644 arch/arm/plat-mxc/Makefile
delete mode 100644 arch/arm/plat-mxc/devices/platform-mx1-camera.c
delete mode 100644 arch/arm/plat-mxc/include/mach/irqs.h
delete mode 100644 arch/arm/plat-mxc/include/mach/timex.h
delete mode 100644 arch/arm/plat-mxc/include/mach/uncompress.h
delete mode 100644 drivers/media/video/mx1_camera.c
rename arch/arm/plat-mxc/include/mach/ipu.h => include/linux/dma/ipu-dma.h (97%)
create mode 100644 include/linux/platform_data/asoc-mx27vis.h
delete mode 100644 include/linux/platform_data/camera-mx1.h
--
1.7.9.5
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 01/34] ARM: imx: include board headers in the same folder
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 02/34] ASoC: mx27vis: retrieve gpio numbers from platform_data Shawn Guo
` (34 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
The headers that are only used by board files do not necessarily
need to be in plat-mxc/include/mach. Move them to the same place
as those board files.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
.../include/mach => mach-imx}/3ds_debugboard.h | 0
.../include/mach => mach-imx}/board-mx31lilly.h | 0
.../include/mach => mach-imx}/board-mx31lite.h | 0
.../include/mach => mach-imx}/board-mx31moboard.h | 0
.../include/mach => mach-imx}/board-pcm038.h | 0
.../include/mach => mach-imx}/eukrea-baseboards.h | 0
arch/arm/mach-imx/mach-cpuimx27.c | 2 +-
arch/arm/mach-imx/mach-cpuimx35.c | 2 +-
arch/arm/mach-imx/mach-cpuimx51sd.c | 2 +-
arch/arm/mach-imx/mach-eukrea_cpuimx25.c | 2 +-
arch/arm/mach-imx/mach-mx27_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx31_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx31lilly.c | 2 +-
arch/arm/mach-imx/mach-mx31lite.c | 2 +-
arch/arm/mach-imx/mach-mx31moboard.c | 2 +-
arch/arm/mach-imx/mach-mx35_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx51_3ds.c | 2 +-
arch/arm/mach-imx/mach-pcm038.c | 2 +-
arch/arm/mach-imx/mx31lilly-db.c | 2 +-
arch/arm/mach-imx/mx31lite-db.c | 2 +-
arch/arm/mach-imx/mx31moboard-smartbot.c | 2 +-
21 files changed, 15 insertions(+), 15 deletions(-)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/3ds_debugboard.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/board-mx31lilly.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/board-mx31lite.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/board-mx31moboard.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/board-pcm038.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/eukrea-baseboards.h (100%)
diff --git a/arch/arm/plat-mxc/include/mach/3ds_debugboard.h b/arch/arm/mach-imx/3ds_debugboard.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/3ds_debugboard.h
rename to arch/arm/mach-imx/3ds_debugboard.h
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31lilly.h b/arch/arm/mach-imx/board-mx31lilly.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/board-mx31lilly.h
rename to arch/arm/mach-imx/board-mx31lilly.h
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31lite.h b/arch/arm/mach-imx/board-mx31lite.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/board-mx31lite.h
rename to arch/arm/mach-imx/board-mx31lite.h
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31moboard.h b/arch/arm/mach-imx/board-mx31moboard.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/board-mx31moboard.h
rename to arch/arm/mach-imx/board-mx31moboard.h
diff --git a/arch/arm/plat-mxc/include/mach/board-pcm038.h b/arch/arm/mach-imx/board-pcm038.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/board-pcm038.h
rename to arch/arm/mach-imx/board-pcm038.h
diff --git a/arch/arm/plat-mxc/include/mach/eukrea-baseboards.h b/arch/arm/mach-imx/eukrea-baseboards.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/eukrea-baseboards.h
rename to arch/arm/mach-imx/eukrea-baseboards.h
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c
index 2bb9e18..1734320 100644
--- a/arch/arm/mach-imx/mach-cpuimx27.c
+++ b/arch/arm/mach-imx/mach-cpuimx27.c
@@ -34,13 +34,13 @@
#include <asm/mach/time.h>
#include <asm/mach/map.h>
-#include <mach/eukrea-baseboards.h>
#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/iomux-mx27.h>
#include <mach/ulpi.h>
#include "devices-imx27.h"
+#include "eukrea-baseboards.h"
static const int eukrea_cpuimx27_pins[] __initconst = {
/* UART1 */
diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c
index d49b0ec..0abfcb4 100644
--- a/arch/arm/mach-imx/mach-cpuimx35.c
+++ b/arch/arm/mach-imx/mach-cpuimx35.c
@@ -37,12 +37,12 @@
#include <asm/mach/time.h>
#include <asm/mach/map.h>
-#include <mach/eukrea-baseboards.h>
#include <mach/hardware.h>
#include <mach/common.h>
#include <mach/iomux-mx35.h>
#include "devices-imx35.h"
+#include "eukrea-baseboards.h"
static const struct imxuart_platform_data uart_pdata __initconst = {
.flags = IMXUART_HAVE_RTSCTS,
diff --git a/arch/arm/mach-imx/mach-cpuimx51sd.c b/arch/arm/mach-imx/mach-cpuimx51sd.c
index b87cc49..6cb3887 100644
--- a/arch/arm/mach-imx/mach-cpuimx51sd.c
+++ b/arch/arm/mach-imx/mach-cpuimx51sd.c
@@ -26,7 +26,6 @@
#include <linux/spi/spi.h>
#include <linux/can/platform/mcp251x.h>
-#include <mach/eukrea-baseboards.h>
#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/iomux-mx51.h>
@@ -38,6 +37,7 @@
#include "devices-imx51.h"
#include "cpu_op-mx51.h"
+#include "eukrea-baseboards.h"
#define USBH1_RST IMX_GPIO_NR(2, 28)
#define ETH_RST IMX_GPIO_NR(2, 31)
diff --git a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
index 017bbb70..4eab1d7 100644
--- a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
+++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
@@ -27,7 +27,6 @@
#include <linux/usb/otg.h>
#include <linux/usb/ulpi.h>
-#include <mach/eukrea-baseboards.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -39,6 +38,7 @@
#include <mach/iomux-mx25.h>
#include "devices-imx25.h"
+#include "eukrea-baseboards.h"
static const struct imxuart_platform_data uart_pdata __initconst = {
.flags = IMXUART_HAVE_RTSCTS,
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index 05996f3..c69df6c 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -40,8 +40,8 @@
#include <mach/common.h>
#include <mach/iomux-mx27.h>
#include <mach/ulpi.h>
-#include <mach/3ds_debugboard.h>
+#include "3ds_debugboard.h"
#include "devices-imx27.h"
#define SD1_EN_GPIO IMX_GPIO_NR(2, 25)
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c
index 8915f93..6750443 100644
--- a/arch/arm/mach-imx/mach-mx31_3ds.c
+++ b/arch/arm/mach-imx/mach-mx31_3ds.c
@@ -39,9 +39,9 @@
#include <asm/memblock.h>
#include <mach/common.h>
#include <mach/iomux-mx3.h>
-#include <mach/3ds_debugboard.h>
#include <mach/ulpi.h>
+#include "3ds_debugboard.h"
#include "devices-imx31.h"
static int mx31_3ds_pins[] = {
diff --git a/arch/arm/mach-imx/mach-mx31lilly.c b/arch/arm/mach-imx/mach-mx31lilly.c
index 34b9bf0..2be500a 100644
--- a/arch/arm/mach-imx/mach-mx31lilly.c
+++ b/arch/arm/mach-imx/mach-mx31lilly.c
@@ -45,9 +45,9 @@
#include <mach/hardware.h>
#include <mach/common.h>
#include <mach/iomux-mx3.h>
-#include <mach/board-mx31lilly.h>
#include <mach/ulpi.h>
+#include "board-mx31lilly.h"
#include "devices-imx31.h"
/*
diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c
index c8785b3..1704308 100644
--- a/arch/arm/mach-imx/mach-mx31lite.c
+++ b/arch/arm/mach-imx/mach-mx31lite.c
@@ -41,10 +41,10 @@
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/board-mx31lite.h>
#include <mach/iomux-mx3.h>
#include <mach/ulpi.h>
+#include "board-mx31lite.h"
#include "devices-imx31.h"
/*
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c
index 459e754..2290d30 100644
--- a/arch/arm/mach-imx/mach-mx31moboard.c
+++ b/arch/arm/mach-imx/mach-mx31moboard.c
@@ -42,13 +42,13 @@
#include <asm/mach/time.h>
#include <asm/mach/map.h>
#include <asm/memblock.h>
-#include <mach/board-mx31moboard.h>
#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/iomux-mx3.h>
#include <mach/ulpi.h>
#include <linux/platform_data/asoc-imx-ssi.h>
+#include "board-mx31moboard.h"
#include "devices-imx31.h"
static unsigned int moboard_pins[] = {
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c
index 504983c..aac59b0 100644
--- a/arch/arm/mach-imx/mach-mx35_3ds.c
+++ b/arch/arm/mach-imx/mach-mx35_3ds.c
@@ -46,11 +46,11 @@
#include <mach/hardware.h>
#include <mach/common.h>
#include <mach/iomux-mx35.h>
-#include <mach/3ds_debugboard.h>
#include <video/platform_lcd.h>
#include <media/soc_camera.h>
+#include "3ds_debugboard.h"
#include "devices-imx35.h"
#define GPIO_MC9S08DZ60_GPS_ENABLE 0
diff --git a/arch/arm/mach-imx/mach-mx51_3ds.c b/arch/arm/mach-imx/mach-mx51_3ds.c
index 9ee84a4..4e84f80 100644
--- a/arch/arm/mach-imx/mach-mx51_3ds.c
+++ b/arch/arm/mach-imx/mach-mx51_3ds.c
@@ -22,8 +22,8 @@
#include <mach/hardware.h>
#include <mach/common.h>
#include <mach/iomux-mx51.h>
-#include <mach/3ds_debugboard.h>
+#include "3ds_debugboard.h"
#include "devices-imx51.h"
#define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28)
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c
index 95f49d93..ad329d5 100644
--- a/arch/arm/mach-imx/mach-pcm038.c
+++ b/arch/arm/mach-imx/mach-pcm038.c
@@ -33,12 +33,12 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/board-pcm038.h>
#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/iomux-mx27.h>
#include <mach/ulpi.h>
+#include "board-pcm038.h"
#include "devices-imx27.h"
static const int pcm038_pins[] __initconst = {
diff --git a/arch/arm/mach-imx/mx31lilly-db.c b/arch/arm/mach-imx/mx31lilly-db.c
index 29e890f..f2acf22 100644
--- a/arch/arm/mach-imx/mx31lilly-db.c
+++ b/arch/arm/mach-imx/mx31lilly-db.c
@@ -33,8 +33,8 @@
#include <mach/hardware.h>
#include <mach/common.h>
#include <mach/iomux-mx3.h>
-#include <mach/board-mx31lilly.h>
+#include "board-mx31lilly.h"
#include "devices-imx31.h"
/*
diff --git a/arch/arm/mach-imx/mx31lite-db.c b/arch/arm/mach-imx/mx31lite-db.c
index 83d17d9..fe4048d 100644
--- a/arch/arm/mach-imx/mx31lite-db.c
+++ b/arch/arm/mach-imx/mx31lite-db.c
@@ -34,8 +34,8 @@
#include <mach/hardware.h>
#include <mach/common.h>
#include <mach/iomux-mx3.h>
-#include <mach/board-mx31lite.h>
+#include "board-mx31lite.h"
#include "devices-imx31.h"
/*
diff --git a/arch/arm/mach-imx/mx31moboard-smartbot.c b/arch/arm/mach-imx/mx31moboard-smartbot.c
index fabb801..fc8d178 100644
--- a/arch/arm/mach-imx/mx31moboard-smartbot.c
+++ b/arch/arm/mach-imx/mx31moboard-smartbot.c
@@ -26,11 +26,11 @@
#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/iomux-mx3.h>
-#include <mach/board-mx31moboard.h>
#include <mach/ulpi.h>
#include <media/soc_camera.h>
+#include "board-mx31moboard.h"
#include "devices-imx31.h"
static unsigned int smartbot_pins[] = {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 02/34] ASoC: mx27vis: retrieve gpio numbers from platform_data
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
2012-09-17 5:34 ` [PATCH 01/34] ARM: imx: include board headers in the same folder Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 9:19 ` javier Martin
2012-09-17 11:07 ` Mark Brown
2012-09-17 5:34 ` [PATCH 03/34] ARM: imx: move iomux drivers and headers into mach-imx Shawn Guo
` (33 subsequent siblings)
35 siblings, 2 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
Rather than including mach/iomux-mx27.h to define gpio numbers and set
up the pins, the patch moves all these into machine code and has the
gpio numbers passed to driver via platform_data. As the result, we
can remove the mach/iomux-mx27.h inclusion from driver.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Javier Martin <javier.martin@vista-silicon.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel at alsa-project.org
---
arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 42 ++++++++++++++++++++++++++-
include/linux/platform_data/asoc-mx27vis.h | 11 +++++++
sound/soc/fsl/mx27vis-aic32x4.c | 42 +++++++++++++--------------
3 files changed, 72 insertions(+), 23 deletions(-)
create mode 100644 include/linux/platform_data/asoc-mx27vis.h
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index f264ddd..5627229 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -33,6 +33,7 @@
#include <linux/dma-mapping.h>
#include <linux/leds.h>
#include <linux/memblock.h>
+#include <linux/platform_data/asoc-mx27vis.h>
#include <media/soc_camera.h>
#include <sound/tlv320aic32x4.h>
#include <asm/mach-types.h>
@@ -58,6 +59,11 @@
#define EXPBOARD_BIT1 (GPIO_PORTD + 27)
#define EXPBOARD_BIT0 (GPIO_PORTD + 28)
+#define AMP_GAIN_0 (GPIO_PORTF + 9)
+#define AMP_GAIN_1 (GPIO_PORTF + 8)
+#define AMP_MUTE_SDL (GPIO_PORTE + 5)
+#define AMP_MUTE_SDR (GPIO_PORTF + 7)
+
static const int visstrim_m10_pins[] __initconst = {
/* UART1 (console) */
PE12_PF_UART1_TXD,
@@ -139,6 +145,11 @@ static const int visstrim_m10_pins[] __initconst = {
EXPBOARD_BIT2 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
EXPBOARD_BIT1 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
EXPBOARD_BIT0 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
+ /* Audio AMP control */
+ AMP_GAIN_0 | GPIO_GPIO | GPIO_OUT,
+ AMP_GAIN_1 | GPIO_GPIO | GPIO_OUT,
+ AMP_MUTE_SDL | GPIO_GPIO | GPIO_OUT,
+ AMP_MUTE_SDR | GPIO_GPIO | GPIO_OUT,
};
static struct gpio visstrim_m10_version_gpios[] = {
@@ -166,6 +177,26 @@ static const struct gpio visstrim_m10_gpios[] __initconst = {
.flags = GPIOF_DIR_OUT | GPIOF_INIT_LOW,
.label = "usbotg_cs",
},
+ {
+ .gpio = AMP_GAIN_0,
+ .flags = GPIOF_DIR_OUT,
+ .label = "amp-gain-0",
+ },
+ {
+ .gpio = AMP_GAIN_1,
+ .flags = GPIOF_DIR_OUT,
+ .label = "amp-gain-1",
+ },
+ {
+ .gpio = AMP_MUTE_SDL,
+ .flags = GPIOF_DIR_OUT,
+ .label = "amp-mute-sdl",
+ },
+ {
+ .gpio = AMP_MUTE_SDR,
+ .flags = GPIOF_DIR_OUT,
+ .label = "amp-mute-sdr",
+ },
};
/* Camera */
@@ -405,6 +436,14 @@ static const struct imx_ssi_platform_data visstrim_m10_ssi_pdata __initconst = {
.flags = IMX_SSI_DMA | IMX_SSI_SYN,
};
+/* Audio */
+static const struct snd_mx27vis_platform_data snd_mx27vis_pdata __initconst = {
+ .amp_gain0_gpio = AMP_GAIN_0,
+ .amp_gain1_gpio = AMP_GAIN_1,
+ .amp_mutel_gpio = AMP_MUTE_SDL,
+ .amp_muter_gpio = AMP_MUTE_SDR,
+};
+
static void __init visstrim_m10_revision(void)
{
int exp_version = 0;
@@ -463,7 +502,8 @@ static void __init visstrim_m10_board_init(void)
imx27_add_fec(NULL);
imx_add_gpio_keys(&visstrim_gpio_keys_platform_data);
platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
- imx_add_platform_device("mx27vis", 0, NULL, 0, NULL, 0);
+ imx_add_platform_device("mx27vis", 0, NULL, 0, &snd_mx27vis_pdata,
+ sizeof(snd_mx27vis_pdata));
platform_device_register_resndata(NULL, "soc-camera-pdrv", 0, NULL, 0,
&iclink_tvp5150, sizeof(iclink_tvp5150));
gpio_led_register_device(0, &visstrim_m10_led_data);
diff --git a/include/linux/platform_data/asoc-mx27vis.h b/include/linux/platform_data/asoc-mx27vis.h
new file mode 100644
index 0000000..409adcd
--- /dev/null
+++ b/include/linux/platform_data/asoc-mx27vis.h
@@ -0,0 +1,11 @@
+#ifndef __PLATFORM_DATA_ASOC_MX27VIS_H
+#define __PLATFORM_DATA_ASOC_MX27VIS_H
+
+struct snd_mx27vis_platform_data {
+ int amp_gain0_gpio;
+ int amp_gain1_gpio;
+ int amp_mutel_gpio;
+ int amp_muter_gpio;
+};
+
+#endif /* __PLATFORM_DATA_ASOC_MX27VIS_H */
diff --git a/sound/soc/fsl/mx27vis-aic32x4.c b/sound/soc/fsl/mx27vis-aic32x4.c
index f6d04ad..2b76877 100644
--- a/sound/soc/fsl/mx27vis-aic32x4.c
+++ b/sound/soc/fsl/mx27vis-aic32x4.c
@@ -26,13 +26,13 @@
#include <linux/device.h>
#include <linux/i2c.h>
#include <linux/gpio.h>
+#include <linux/platform_data/asoc-mx27vis.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/tlv.h>
#include <asm/mach-types.h>
-#include <mach/iomux-mx27.h>
#include "../codecs/tlv320aic32x4.h"
#include "imx-ssi.h"
@@ -41,20 +41,12 @@
#define MX27VIS_AMP_GAIN 0
#define MX27VIS_AMP_MUTE 1
-#define MX27VIS_PIN_G0 (GPIO_PORTF + 9)
-#define MX27VIS_PIN_G1 (GPIO_PORTF + 8)
-#define MX27VIS_PIN_SDL (GPIO_PORTE + 5)
-#define MX27VIS_PIN_SDR (GPIO_PORTF + 7)
-
static int mx27vis_amp_gain;
static int mx27vis_amp_mute;
-
-static const int mx27vis_amp_pins[] = {
- MX27VIS_PIN_G0 | GPIO_GPIO | GPIO_OUT,
- MX27VIS_PIN_G1 | GPIO_GPIO | GPIO_OUT,
- MX27VIS_PIN_SDL | GPIO_GPIO | GPIO_OUT,
- MX27VIS_PIN_SDR | GPIO_GPIO | GPIO_OUT,
-};
+static int mx27vis_amp_gain0_gpio;
+static int mx27vis_amp_gain1_gpio;
+static int mx27vis_amp_mutel_gpio;
+static int mx27vis_amp_muter_gpio;
static int mx27vis_aic32x4_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
@@ -109,13 +101,13 @@ static int mx27vis_amp_set(struct snd_kcontrol *kcontrol,
switch (reg) {
case MX27VIS_AMP_GAIN:
- gpio_set_value(MX27VIS_PIN_G0, value & 1);
- gpio_set_value(MX27VIS_PIN_G1, value >> 1);
+ gpio_set_value(mx27vis_amp_gain0_gpio, value & 1);
+ gpio_set_value(mx27vis_amp_gain1_gpio, value >> 1);
mx27vis_amp_gain = value;
break;
case MX27VIS_AMP_MUTE:
- gpio_set_value(MX27VIS_PIN_SDL, value & 1);
- gpio_set_value(MX27VIS_PIN_SDR, value >> 1);
+ gpio_set_value(mx27vis_amp_mutel_gpio, value & 1);
+ gpio_set_value(mx27vis_amp_muter_gpio, value >> 1);
mx27vis_amp_mute = value;
break;
}
@@ -190,8 +182,19 @@ static struct snd_soc_card mx27vis_aic32x4 = {
static int __devinit mx27vis_aic32x4_probe(struct platform_device *pdev)
{
+ struct snd_mx27vis_platform_data *pdata = pdev->dev.platform_data;
int ret;
+ if (!pdata) {
+ dev_err(&pdev->dev, "No platform data supplied\n");
+ return -EINVAL;
+ }
+
+ mx27vis_amp_gain0_gpio = pdata->amp_gain0_gpio;
+ mx27vis_amp_gain1_gpio = pdata->amp_gain1_gpio;
+ mx27vis_amp_mutel_gpio = pdata->amp_mutel_gpio;
+ mx27vis_amp_muter_gpio = pdata->amp_muter_gpio;
+
mx27vis_aic32x4.dev = &pdev->dev;
ret = snd_soc_register_card(&mx27vis_aic32x4);
if (ret) {
@@ -213,11 +216,6 @@ static int __devinit mx27vis_aic32x4_probe(struct platform_device *pdev)
IMX_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_HPCR1_SSI0)
);
- ret = mxc_gpio_setup_multiple_pins(mx27vis_amp_pins,
- ARRAY_SIZE(mx27vis_amp_pins), "MX27VIS_AMP");
- if (ret)
- printk(KERN_ERR "ASoC: unable to setup gpios\n");
-
return ret;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 03/34] ARM: imx: move iomux drivers and headers into mach-imx
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
2012-09-17 5:34 ` [PATCH 01/34] ARM: imx: include board headers in the same folder Shawn Guo
2012-09-17 5:34 ` [PATCH 02/34] ASoC: mx27vis: retrieve gpio numbers from platform_data Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 04/34] ARM: imx: remove unnecessary inclusion from device-imx*.h Shawn Guo
` (32 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
The board files in mach-imx are the only users of iomux drivers and
headers. Move them into mach-imx from plat-mxc.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
arch/arm/mach-imx/Kconfig | 6 ++++++
arch/arm/mach-imx/Makefile | 3 +++
arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | 2 +-
arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c | 2 +-
arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c | 2 +-
arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c | 2 +-
arch/arm/mach-imx/iomux-imx31.c | 3 ++-
.../include/mach => mach-imx}/iomux-mx1.h | 2 +-
.../include/mach => mach-imx}/iomux-mx21.h | 4 ++--
.../include/mach => mach-imx}/iomux-mx25.h | 2 +-
.../include/mach => mach-imx}/iomux-mx27.h | 4 ++--
.../include/mach => mach-imx}/iomux-mx2x.h | 0
.../include/mach => mach-imx}/iomux-mx3.h | 0
.../include/mach => mach-imx}/iomux-mx35.h | 2 +-
.../include/mach => mach-imx}/iomux-mx50.h | 2 +-
.../include/mach => mach-imx}/iomux-mx51.h | 2 +-
arch/arm/{plat-mxc => mach-imx}/iomux-v1.c | 3 ++-
.../{plat-mxc/include/mach => mach-imx}/iomux-v1.h | 0
arch/arm/{plat-mxc => mach-imx}/iomux-v3.c | 3 ++-
.../{plat-mxc/include/mach => mach-imx}/iomux-v3.h | 0
arch/arm/mach-imx/mach-apf9328.c | 2 +-
arch/arm/mach-imx/mach-armadillo5x0.c | 2 +-
arch/arm/mach-imx/mach-bug.c | 2 +-
arch/arm/mach-imx/mach-cpuimx27.c | 2 +-
arch/arm/mach-imx/mach-cpuimx35.c | 2 +-
arch/arm/mach-imx/mach-cpuimx51sd.c | 2 +-
arch/arm/mach-imx/mach-eukrea_cpuimx25.c | 2 +-
arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 2 +-
arch/arm/mach-imx/mach-imx27ipcam.c | 2 +-
arch/arm/mach-imx/mach-imx27lite.c | 2 +-
arch/arm/mach-imx/mach-kzm_arm11_01.c | 2 +-
arch/arm/mach-imx/mach-mx1ads.c | 2 +-
arch/arm/mach-imx/mach-mx21ads.c | 2 +-
arch/arm/mach-imx/mach-mx25_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx27_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx27ads.c | 2 +-
arch/arm/mach-imx/mach-mx31_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx31ads.c | 2 +-
arch/arm/mach-imx/mach-mx31lilly.c | 2 +-
arch/arm/mach-imx/mach-mx31lite.c | 2 +-
arch/arm/mach-imx/mach-mx31moboard.c | 2 +-
arch/arm/mach-imx/mach-mx35_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx50_rdp.c | 2 +-
arch/arm/mach-imx/mach-mx51_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx51_babbage.c | 2 +-
arch/arm/mach-imx/mach-mxt_td60.c | 2 +-
arch/arm/mach-imx/mach-pca100.c | 2 +-
arch/arm/mach-imx/mach-pcm037.c | 2 +-
arch/arm/mach-imx/mach-pcm037_eet.c | 2 +-
arch/arm/mach-imx/mach-pcm038.c | 2 +-
arch/arm/mach-imx/mach-pcm043.c | 2 +-
arch/arm/mach-imx/mach-qong.c | 2 +-
arch/arm/mach-imx/mach-scb9328.c | 2 +-
arch/arm/mach-imx/mach-vpr200.c | 2 +-
arch/arm/mach-imx/mm-imx1.c | 3 ++-
arch/arm/mach-imx/mm-imx21.c | 3 ++-
arch/arm/mach-imx/mm-imx25.c | 3 ++-
arch/arm/mach-imx/mm-imx27.c | 3 ++-
arch/arm/mach-imx/mm-imx3.c | 2 +-
arch/arm/mach-imx/mm-imx5.c | 3 ++-
arch/arm/mach-imx/mx31lilly-db.c | 2 +-
arch/arm/mach-imx/mx31lite-db.c | 2 +-
arch/arm/mach-imx/mx31moboard-devboard.c | 2 +-
arch/arm/mach-imx/mx31moboard-marxbot.c | 2 +-
arch/arm/mach-imx/mx31moboard-smartbot.c | 2 +-
arch/arm/mach-imx/pcm970-baseboard.c | 2 +-
arch/arm/plat-mxc/Kconfig | 6 ------
arch/arm/plat-mxc/Makefile | 2 --
68 files changed, 79 insertions(+), 70 deletions(-)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx1.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx21.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx25.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx27.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx2x.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx3.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx35.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx50.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx51.h (99%)
rename arch/arm/{plat-mxc => mach-imx}/iomux-v1.c (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-v1.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/iomux-v3.c (98%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-v3.h (100%)
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 3a2042f..5c161cc 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -7,6 +7,12 @@ config HAVE_IMX_MMDC
config HAVE_IMX_SRC
bool
+config IMX_HAVE_IOMUX_V1
+ bool
+
+config ARCH_MXC_IOMUX_V3
+ bool
+
config ARCH_MX1
bool
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 895754a..5025a9d 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -15,6 +15,9 @@ obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o mm-imx5.o clk-imx51-imx53.o ehci-imx5.o $(i
obj-$(CONFIG_COMMON_CLK) += clk-pllv1.o clk-pllv2.o clk-pllv3.o clk-gate2.o \
clk-pfd.o clk-busy.o clk.o
+obj-$(CONFIG_IMX_HAVE_IOMUX_V1) += iomux-v1.o
+obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o
+
# Support for CMOS sensor interface
obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o
diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
index fd3177f..3962dcd 100644
--- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
@@ -30,10 +30,10 @@
#include <asm/mach/arch.h>
#include <mach/common.h>
-#include <mach/iomux-mx27.h>
#include <mach/hardware.h>
#include "devices-imx27.h"
+#include "iomux-mx27.h"
static const int eukrea_mbimx27_pins[] __initconst = {
/* UART2 */
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
index dfd2da8..5901f0a 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
@@ -27,13 +27,13 @@
#include <video/platform_lcd.h>
#include <mach/hardware.h>
-#include <mach/iomux-mx25.h>
#include <mach/common.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <mach/mx25.h>
#include "devices-imx25.h"
+#include "iomux-mx25.h"
static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
/* LCD */
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
index 6e9dd12..44e9ce5 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
@@ -38,9 +38,9 @@
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/iomux-mx35.h>
#include "devices-imx35.h"
+#include "iomux-mx35.h"
static const struct fb_videomode fb_modedb[] = {
{
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
index 96a24b7..3e45726 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
@@ -38,9 +38,9 @@
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/iomux-mx51.h>
#include "devices-imx51.h"
+#include "iomux-mx51.h"
static iomux_v3_cfg_t eukrea_mbimxsd51_pads[] = {
/* LED */
diff --git a/arch/arm/mach-imx/iomux-imx31.c b/arch/arm/mach-imx/iomux-imx31.c
index 82bd440..7c3ba2b 100644
--- a/arch/arm/mach-imx/iomux-imx31.c
+++ b/arch/arm/mach-imx/iomux-imx31.c
@@ -23,7 +23,8 @@
#include <linux/io.h>
#include <linux/kernel.h>
#include <mach/hardware.h>
-#include <mach/iomux-mx3.h>
+
+#include "iomux-mx3.h"
/*
* IOMUX register (base) addresses
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx1.h b/arch/arm/mach-imx/iomux-mx1.h
similarity index 99%
rename from arch/arm/plat-mxc/include/mach/iomux-mx1.h
rename to arch/arm/mach-imx/iomux-mx1.h
index 6b1507c..95f4681 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx1.h
+++ b/arch/arm/mach-imx/iomux-mx1.h
@@ -18,7 +18,7 @@
#ifndef __MACH_IOMUX_MX1_H__
#define __MACH_IOMUX_MX1_H__
-#include <mach/iomux-v1.h>
+#include "iomux-v1.h"
#define PA0_AIN_SPI2_CLK (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 0)
#define PA0_AF_ETMTRACESYNC (GPIO_PORTA | GPIO_AF | 0)
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx21.h b/arch/arm/mach-imx/iomux-mx21.h
similarity index 99%
rename from arch/arm/plat-mxc/include/mach/iomux-mx21.h
rename to arch/arm/mach-imx/iomux-mx21.h
index 1495dfd..a70cffc 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx21.h
+++ b/arch/arm/mach-imx/iomux-mx21.h
@@ -18,8 +18,8 @@
#ifndef __MACH_IOMUX_MX21_H__
#define __MACH_IOMUX_MX21_H__
-#include <mach/iomux-mx2x.h>
-#include <mach/iomux-v1.h>
+#include "iomux-mx2x.h"
+#include "iomux-v1.h"
/* Primary GPIO pin functions */
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx25.h b/arch/arm/mach-imx/iomux-mx25.h
similarity index 99%
rename from arch/arm/plat-mxc/include/mach/iomux-mx25.h
rename to arch/arm/mach-imx/iomux-mx25.h
index c61ec0f..be51e83 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx25.h
+++ b/arch/arm/mach-imx/iomux-mx25.h
@@ -19,7 +19,7 @@
#ifndef __MACH_IOMUX_MX25_H__
#define __MACH_IOMUX_MX25_H__
-#include <mach/iomux-v3.h>
+#include "iomux-v3.h"
/*
* IOMUX/PAD Bit field definitions
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx27.h b/arch/arm/mach-imx/iomux-mx27.h
similarity index 99%
rename from arch/arm/plat-mxc/include/mach/iomux-mx27.h
rename to arch/arm/mach-imx/iomux-mx27.h
index d9f9a6e..218e99e 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx27.h
+++ b/arch/arm/mach-imx/iomux-mx27.h
@@ -19,8 +19,8 @@
#ifndef __MACH_IOMUX_MX27_H__
#define __MACH_IOMUX_MX27_H__
-#include <mach/iomux-mx2x.h>
-#include <mach/iomux-v1.h>
+#include "iomux-mx2x.h"
+#include "iomux-v1.h"
/* Primary GPIO pin functions */
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx2x.h b/arch/arm/mach-imx/iomux-mx2x.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/iomux-mx2x.h
rename to arch/arm/mach-imx/iomux-mx2x.h
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx3.h b/arch/arm/mach-imx/iomux-mx3.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/iomux-mx3.h
rename to arch/arm/mach-imx/iomux-mx3.h
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx35.h b/arch/arm/mach-imx/iomux-mx35.h
similarity index 99%
rename from arch/arm/plat-mxc/include/mach/iomux-mx35.h
rename to arch/arm/mach-imx/iomux-mx35.h
index 3117c18..90bfa6b 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx35.h
+++ b/arch/arm/mach-imx/iomux-mx35.h
@@ -19,7 +19,7 @@
#ifndef __MACH_IOMUX_MX35_H__
#define __MACH_IOMUX_MX35_H__
-#include <mach/iomux-v3.h>
+#include "iomux-v3.h"
/*
* The naming convention for the pad modes is MX35_PAD_<padname>__<padmode>
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx50.h b/arch/arm/mach-imx/iomux-mx50.h
similarity index 99%
rename from arch/arm/plat-mxc/include/mach/iomux-mx50.h
rename to arch/arm/mach-imx/iomux-mx50.h
index 98e7fd0..00f56e0 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx50.h
+++ b/arch/arm/mach-imx/iomux-mx50.h
@@ -19,7 +19,7 @@
#ifndef __MACH_IOMUX_MX50_H__
#define __MACH_IOMUX_MX50_H__
-#include <mach/iomux-v3.h>
+#include "iomux-v3.h"
#define MX50_ELCDIF_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_DSE_HIGH)
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx51.h b/arch/arm/mach-imx/iomux-mx51.h
similarity index 99%
rename from arch/arm/plat-mxc/include/mach/iomux-mx51.h
rename to arch/arm/mach-imx/iomux-mx51.h
index 2623e7a..75bbcc4 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx51.h
+++ b/arch/arm/mach-imx/iomux-mx51.h
@@ -13,7 +13,7 @@
#ifndef __MACH_IOMUX_MX51_H__
#define __MACH_IOMUX_MX51_H__
-#include <mach/iomux-v3.h>
+#include "iomux-v3.h"
#define __NA_ 0x000
diff --git a/arch/arm/plat-mxc/iomux-v1.c b/arch/arm/mach-imx/iomux-v1.c
similarity index 99%
rename from arch/arm/plat-mxc/iomux-v1.c
rename to arch/arm/mach-imx/iomux-v1.c
index 1f73963..2ac5580 100644
--- a/arch/arm/plat-mxc/iomux-v1.c
+++ b/arch/arm/mach-imx/iomux-v1.c
@@ -30,7 +30,8 @@
#include <mach/hardware.h>
#include <asm/mach/map.h>
-#include <mach/iomux-v1.h>
+
+#include "iomux-v1.h"
static void __iomem *imx_iomuxv1_baseaddr;
static unsigned imx_iomuxv1_numports;
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v1.h b/arch/arm/mach-imx/iomux-v1.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/iomux-v1.h
rename to arch/arm/mach-imx/iomux-v1.h
diff --git a/arch/arm/plat-mxc/iomux-v3.c b/arch/arm/mach-imx/iomux-v3.c
similarity index 98%
rename from arch/arm/plat-mxc/iomux-v3.c
rename to arch/arm/mach-imx/iomux-v3.c
index 99a9cdb..de1459c 100644
--- a/arch/arm/plat-mxc/iomux-v3.c
+++ b/arch/arm/mach-imx/iomux-v3.c
@@ -27,7 +27,8 @@
#include <mach/hardware.h>
#include <asm/mach/map.h>
-#include <mach/iomux-v3.h>
+
+#include "iomux-v3.h"
static void __iomem *base;
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v3.h b/arch/arm/mach-imx/iomux-v3.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/iomux-v3.h
rename to arch/arm/mach-imx/iomux-v3.h
diff --git a/arch/arm/mach-imx/mach-apf9328.c b/arch/arm/mach-imx/mach-apf9328.c
index 7b99a79..b24f4b6 100644
--- a/arch/arm/mach-imx/mach-apf9328.c
+++ b/arch/arm/mach-imx/mach-apf9328.c
@@ -27,9 +27,9 @@
#include <mach/common.h>
#include <mach/hardware.h>
-#include <mach/iomux-mx1.h>
#include "devices-imx1.h"
+#include "iomux-mx1.h"
static const int apf9328_pins[] __initconst = {
/* UART1 */
diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c
index 2c6ab32..6915e4a 100644
--- a/arch/arm/mach-imx/mach-armadillo5x0.c
+++ b/arch/arm/mach-imx/mach-armadillo5x0.c
@@ -49,11 +49,11 @@
#include <asm/mach/map.h>
#include <mach/common.h>
-#include <mach/iomux-mx3.h>
#include <mach/ulpi.h>
#include "devices-imx31.h"
#include "crmregs-imx3.h"
+#include "iomux-mx3.h"
static int armadillo5x0_pins[] = {
/* UART1 */
diff --git a/arch/arm/mach-imx/mach-bug.c b/arch/arm/mach-imx/mach-bug.c
index 9a98977..55b71d1 100644
--- a/arch/arm/mach-imx/mach-bug.c
+++ b/arch/arm/mach-imx/mach-bug.c
@@ -19,7 +19,6 @@
#include <linux/init.h>
#include <linux/platform_device.h>
-#include <mach/iomux-mx3.h>
#include <mach/hardware.h>
#include <mach/common.h>
@@ -28,6 +27,7 @@
#include <asm/mach-types.h>
#include "devices-imx31.h"
+#include "iomux-mx3.h"
static const struct imxuart_platform_data uart_pdata __initconst = {
.flags = IMXUART_HAVE_RTSCTS,
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c
index 1734320..0a05eab 100644
--- a/arch/arm/mach-imx/mach-cpuimx27.c
+++ b/arch/arm/mach-imx/mach-cpuimx27.c
@@ -36,11 +36,11 @@
#include <mach/common.h>
#include <mach/hardware.h>
-#include <mach/iomux-mx27.h>
#include <mach/ulpi.h>
#include "devices-imx27.h"
#include "eukrea-baseboards.h"
+#include "iomux-mx27.h"
static const int eukrea_cpuimx27_pins[] __initconst = {
/* UART1 */
diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c
index 0abfcb4..132243b 100644
--- a/arch/arm/mach-imx/mach-cpuimx35.c
+++ b/arch/arm/mach-imx/mach-cpuimx35.c
@@ -39,10 +39,10 @@
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/iomux-mx35.h>
#include "devices-imx35.h"
#include "eukrea-baseboards.h"
+#include "iomux-mx35.h"
static const struct imxuart_platform_data uart_pdata __initconst = {
.flags = IMXUART_HAVE_RTSCTS,
diff --git a/arch/arm/mach-imx/mach-cpuimx51sd.c b/arch/arm/mach-imx/mach-cpuimx51sd.c
index 6cb3887..3c2ceed 100644
--- a/arch/arm/mach-imx/mach-cpuimx51sd.c
+++ b/arch/arm/mach-imx/mach-cpuimx51sd.c
@@ -28,7 +28,6 @@
#include <mach/common.h>
#include <mach/hardware.h>
-#include <mach/iomux-mx51.h>
#include <asm/setup.h>
#include <asm/mach-types.h>
@@ -38,6 +37,7 @@
#include "devices-imx51.h"
#include "cpu_op-mx51.h"
#include "eukrea-baseboards.h"
+#include "iomux-mx51.h"
#define USBH1_RST IMX_GPIO_NR(2, 28)
#define ETH_RST IMX_GPIO_NR(2, 31)
diff --git a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
index 4eab1d7..7dece34 100644
--- a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
+++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
@@ -35,10 +35,10 @@
#include <asm/mach/map.h>
#include <mach/common.h>
#include <mach/mx25.h>
-#include <mach/iomux-mx25.h>
#include "devices-imx25.h"
#include "eukrea-baseboards.h"
+#include "iomux-mx25.h"
static const struct imxuart_platform_data uart_pdata __initconst = {
.flags = IMXUART_HAVE_RTSCTS,
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index 5627229..c85735a 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -42,9 +42,9 @@
#include <asm/system_info.h>
#include <mach/common.h>
#include <mach/hardware.h>
-#include <mach/iomux-mx27.h>
#include "devices-imx27.h"
+#include "iomux-mx27.h"
#define TVP5150_RSTN (GPIO_PORTC + 18)
#define TVP5150_PWDN (GPIO_PORTC + 19)
diff --git a/arch/arm/mach-imx/mach-imx27ipcam.c b/arch/arm/mach-imx/mach-imx27ipcam.c
index 7381387..4e2dcd3c1 100644
--- a/arch/arm/mach-imx/mach-imx27ipcam.c
+++ b/arch/arm/mach-imx/mach-imx27ipcam.c
@@ -19,9 +19,9 @@
#include <asm/mach/time.h>
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/iomux-mx27.h>
#include "devices-imx27.h"
+#include "iomux-mx27.h"
static const int mx27ipcam_pins[] __initconst = {
/* UART1 */
diff --git a/arch/arm/mach-imx/mach-imx27lite.c b/arch/arm/mach-imx/mach-imx27lite.c
index 1f45b91..49be646 100644
--- a/arch/arm/mach-imx/mach-imx27lite.c
+++ b/arch/arm/mach-imx/mach-imx27lite.c
@@ -22,9 +22,9 @@
#include <asm/mach/map.h>
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/iomux-mx27.h>
#include "devices-imx27.h"
+#include "iomux-mx27.h"
static const int mx27lite_pins[] __initconst = {
/* UART1 */
diff --git a/arch/arm/mach-imx/mach-kzm_arm11_01.c b/arch/arm/mach-imx/mach-kzm_arm11_01.c
index 8dc9d3e..b68db42 100644
--- a/arch/arm/mach-imx/mach-kzm_arm11_01.c
+++ b/arch/arm/mach-imx/mach-kzm_arm11_01.c
@@ -38,9 +38,9 @@
#include <mach/common.h>
#include <mach/hardware.h>
-#include <mach/iomux-mx3.h>
#include "devices-imx31.h"
+#include "iomux-mx3.h"
#define KZM_ARM11_IO_ADDRESS(x) (IOMEM( \
IMX_IO_P2V_MODULE(x, MX31_CS4) ?: \
diff --git a/arch/arm/mach-imx/mach-mx1ads.c b/arch/arm/mach-imx/mach-mx1ads.c
index 667f359..e9e2401 100644
--- a/arch/arm/mach-imx/mach-mx1ads.c
+++ b/arch/arm/mach-imx/mach-mx1ads.c
@@ -25,9 +25,9 @@
#include <mach/common.h>
#include <mach/hardware.h>
-#include <mach/iomux-mx1.h>
#include "devices-imx1.h"
+#include "iomux-mx1.h"
static const int mx1ads_pins[] __initconst = {
/* UART1 */
diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c
index ed22e3f..0df370a 100644
--- a/arch/arm/mach-imx/mach-mx21ads.c
+++ b/arch/arm/mach-imx/mach-mx21ads.c
@@ -24,9 +24,9 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/mach/map.h>
-#include <mach/iomux-mx21.h>
#include "devices-imx21.h"
+#include "iomux-mx21.h"
/*
* Memory-mapped I/O on MX21ADS base board
diff --git a/arch/arm/mach-imx/mach-mx25_3ds.c b/arch/arm/mach-imx/mach-mx25_3ds.c
index ce247fd..4e741c5 100644
--- a/arch/arm/mach-imx/mach-mx25_3ds.c
+++ b/arch/arm/mach-imx/mach-mx25_3ds.c
@@ -39,9 +39,9 @@
#include <asm/mach/map.h>
#include <mach/common.h>
#include <mach/mx25.h>
-#include <mach/iomux-mx25.h>
#include "devices-imx25.h"
+#include "iomux-mx25.h"
#define MX25PDK_CAN_PWDN IMX_GPIO_NR(4, 6)
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index c69df6c..8a89555 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -38,11 +38,11 @@
#include <asm/mach/time.h>
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/iomux-mx27.h>
#include <mach/ulpi.h>
#include "3ds_debugboard.h"
#include "devices-imx27.h"
+#include "iomux-mx27.h"
#define SD1_EN_GPIO IMX_GPIO_NR(2, 25)
#define OTG_PHY_RESET_GPIO IMX_GPIO_NR(2, 23)
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index 7dc59ba..50b5d04 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -27,9 +27,9 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/mach/map.h>
-#include <mach/iomux-mx27.h>
#include "devices-imx27.h"
+#include "iomux-mx27.h"
/*
* Base address of PBC controller, CS4
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c
index 6750443..d38b696e 100644
--- a/arch/arm/mach-imx/mach-mx31_3ds.c
+++ b/arch/arm/mach-imx/mach-mx31_3ds.c
@@ -38,11 +38,11 @@
#include <asm/mach/map.h>
#include <asm/memblock.h>
#include <mach/common.h>
-#include <mach/iomux-mx3.h>
#include <mach/ulpi.h>
#include "3ds_debugboard.h"
#include "devices-imx31.h"
+#include "iomux-mx3.h"
static int mx31_3ds_pins[] = {
/* UART1 */
diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c
index d37f480..3d95d03 100644
--- a/arch/arm/mach-imx/mach-mx31ads.c
+++ b/arch/arm/mach-imx/mach-mx31ads.c
@@ -29,7 +29,6 @@
#include <asm/memory.h>
#include <asm/mach/map.h>
#include <mach/common.h>
-#include <mach/iomux-mx3.h>
#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1
#include <linux/mfd/wm8350/audio.h>
@@ -38,6 +37,7 @@
#endif
#include "devices-imx31.h"
+#include "iomux-mx3.h"
/* Base address of PBC controller */
#define PBC_BASE_ADDRESS MX31_CS4_BASE_ADDR_VIRT
diff --git a/arch/arm/mach-imx/mach-mx31lilly.c b/arch/arm/mach-imx/mach-mx31lilly.c
index 2be500a..ae2dc78 100644
--- a/arch/arm/mach-imx/mach-mx31lilly.c
+++ b/arch/arm/mach-imx/mach-mx31lilly.c
@@ -44,11 +44,11 @@
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/iomux-mx3.h>
#include <mach/ulpi.h>
#include "board-mx31lilly.h"
#include "devices-imx31.h"
+#include "iomux-mx3.h"
/*
* This file contains module-specific initialization routines for LILLY-1131.
diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c
index 1704308..dc85c25 100644
--- a/arch/arm/mach-imx/mach-mx31lite.c
+++ b/arch/arm/mach-imx/mach-mx31lite.c
@@ -41,11 +41,11 @@
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/iomux-mx3.h>
#include <mach/ulpi.h>
#include "board-mx31lite.h"
#include "devices-imx31.h"
+#include "iomux-mx3.h"
/*
* This file contains the module-specific initialization routines.
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c
index 2290d30..6c2e058 100644
--- a/arch/arm/mach-imx/mach-mx31moboard.c
+++ b/arch/arm/mach-imx/mach-mx31moboard.c
@@ -44,12 +44,12 @@
#include <asm/memblock.h>
#include <mach/common.h>
#include <mach/hardware.h>
-#include <mach/iomux-mx3.h>
#include <mach/ulpi.h>
#include <linux/platform_data/asoc-imx-ssi.h>
#include "board-mx31moboard.h"
#include "devices-imx31.h"
+#include "iomux-mx3.h"
static unsigned int moboard_pins[] = {
/* UART0 */
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c
index aac59b0..63d7a76 100644
--- a/arch/arm/mach-imx/mach-mx35_3ds.c
+++ b/arch/arm/mach-imx/mach-mx35_3ds.c
@@ -45,13 +45,13 @@
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/iomux-mx35.h>
#include <video/platform_lcd.h>
#include <media/soc_camera.h>
#include "3ds_debugboard.h"
#include "devices-imx35.h"
+#include "iomux-mx35.h"
#define GPIO_MC9S08DZ60_GPS_ENABLE 0
#define GPIO_MC9S08DZ60_HDD_ENABLE 4
diff --git a/arch/arm/mach-imx/mach-mx50_rdp.c b/arch/arm/mach-imx/mach-mx50_rdp.c
index 42b66e8..4762a3f 100644
--- a/arch/arm/mach-imx/mach-mx50_rdp.c
+++ b/arch/arm/mach-imx/mach-mx50_rdp.c
@@ -26,7 +26,6 @@
#include <mach/common.h>
#include <mach/hardware.h>
-#include <mach/iomux-mx50.h>
#include <asm/irq.h>
#include <asm/setup.h>
@@ -35,6 +34,7 @@
#include <asm/mach/time.h>
#include "devices-imx50.h"
+#include "iomux-mx50.h"
#define FEC_EN IMX_GPIO_NR(6, 23)
#define FEC_RESET_B IMX_GPIO_NR(4, 12)
diff --git a/arch/arm/mach-imx/mach-mx51_3ds.c b/arch/arm/mach-imx/mach-mx51_3ds.c
index 4e84f80..4eb4299 100644
--- a/arch/arm/mach-imx/mach-mx51_3ds.c
+++ b/arch/arm/mach-imx/mach-mx51_3ds.c
@@ -21,10 +21,10 @@
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/iomux-mx51.h>
#include "3ds_debugboard.h"
#include "devices-imx51.h"
+#include "iomux-mx51.h"
#define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28)
diff --git a/arch/arm/mach-imx/mach-mx51_babbage.c b/arch/arm/mach-imx/mach-mx51_babbage.c
index 7b31cbd..20e6b9e 100644
--- a/arch/arm/mach-imx/mach-mx51_babbage.c
+++ b/arch/arm/mach-imx/mach-mx51_babbage.c
@@ -22,7 +22,6 @@
#include <mach/common.h>
#include <mach/hardware.h>
-#include <mach/iomux-mx51.h>
#include <asm/setup.h>
#include <asm/mach-types.h>
@@ -31,6 +30,7 @@
#include "devices-imx51.h"
#include "cpu_op-mx51.h"
+#include "iomux-mx51.h"
#define BABBAGE_USB_HUB_RESET IMX_GPIO_NR(1, 7)
#define BABBAGE_USBH1_STP IMX_GPIO_NR(1, 27)
diff --git a/arch/arm/mach-imx/mach-mxt_td60.c b/arch/arm/mach-imx/mach-mxt_td60.c
index 0bf6d30..b5c036a 100644
--- a/arch/arm/mach-imx/mach-mxt_td60.c
+++ b/arch/arm/mach-imx/mach-mxt_td60.c
@@ -28,10 +28,10 @@
#include <asm/mach/time.h>
#include <asm/mach/map.h>
#include <linux/gpio.h>
-#include <mach/iomux-mx27.h>
#include <linux/i2c/pca953x.h>
#include "devices-imx27.h"
+#include "iomux-mx27.h"
static const int mxt_td60_pins[] __initconst = {
/* UART0 */
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c
index de8516b..42f407b 100644
--- a/arch/arm/mach-imx/mach-pca100.c
+++ b/arch/arm/mach-imx/mach-pca100.c
@@ -34,11 +34,11 @@
#include <asm/mach-types.h>
#include <mach/common.h>
#include <mach/hardware.h>
-#include <mach/iomux-mx27.h>
#include <asm/mach/time.h>
#include <mach/ulpi.h>
#include "devices-imx27.h"
+#include "iomux-mx27.h"
#define OTG_PHY_CS_GPIO (GPIO_PORTB + 23)
#define USBH2_PHY_CS_GPIO (GPIO_PORTB + 24)
diff --git a/arch/arm/mach-imx/mach-pcm037.c b/arch/arm/mach-imx/mach-pcm037.c
index e3c4513..0bdec55 100644
--- a/arch/arm/mach-imx/mach-pcm037.c
+++ b/arch/arm/mach-imx/mach-pcm037.c
@@ -44,10 +44,10 @@
#include <asm/memblock.h>
#include <mach/common.h>
#include <mach/hardware.h>
-#include <mach/iomux-mx3.h>
#include <mach/ulpi.h>
#include "devices-imx31.h"
+#include "iomux-mx3.h"
#include "pcm037.h"
static enum pcm037_board_variant pcm037_instance = PCM037_PCM970;
diff --git a/arch/arm/mach-imx/mach-pcm037_eet.c b/arch/arm/mach-imx/mach-pcm037_eet.c
index 11ffa81..727dd63 100644
--- a/arch/arm/mach-imx/mach-pcm037_eet.c
+++ b/arch/arm/mach-imx/mach-pcm037_eet.c
@@ -12,12 +12,12 @@
#include <linux/spi/spi.h>
#include <mach/common.h>
-#include <mach/iomux-mx3.h>
#include <asm/mach-types.h>
#include "pcm037.h"
#include "devices-imx31.h"
+#include "iomux-mx3.h"
static unsigned int pcm037_eet_pins[] = {
/* Reserve and hardwire GPIO 57 high - S6E63D6 chipselect */
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c
index ad329d5..288838c 100644
--- a/arch/arm/mach-imx/mach-pcm038.c
+++ b/arch/arm/mach-imx/mach-pcm038.c
@@ -35,11 +35,11 @@
#include <mach/common.h>
#include <mach/hardware.h>
-#include <mach/iomux-mx27.h>
#include <mach/ulpi.h>
#include "board-pcm038.h"
#include "devices-imx27.h"
+#include "iomux-mx27.h"
static const int pcm038_pins[] __initconst = {
/* UART1 */
diff --git a/arch/arm/mach-imx/mach-pcm043.c b/arch/arm/mach-imx/mach-pcm043.c
index e4bd438..051e883 100644
--- a/arch/arm/mach-imx/mach-pcm043.c
+++ b/arch/arm/mach-imx/mach-pcm043.c
@@ -35,10 +35,10 @@
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/iomux-mx35.h>
#include <mach/ulpi.h>
#include "devices-imx35.h"
+#include "iomux-mx35.h"
static const struct fb_videomode fb_modedb[] = {
{
diff --git a/arch/arm/mach-imx/mach-qong.c b/arch/arm/mach-imx/mach-qong.c
index fb25fbd..c85425f 100644
--- a/arch/arm/mach-imx/mach-qong.c
+++ b/arch/arm/mach-imx/mach-qong.c
@@ -29,9 +29,9 @@
#include <mach/common.h>
#include <asm/page.h>
#include <asm/setup.h>
-#include <mach/iomux-mx3.h>
#include "devices-imx31.h"
+#include "iomux-mx3.h"
/* FPGA defines */
#define QONG_FPGA_VERSION(major, minor, rev) \
diff --git a/arch/arm/mach-imx/mach-scb9328.c b/arch/arm/mach-imx/mach-scb9328.c
index 67ff38e..7528bb2 100644
--- a/arch/arm/mach-imx/mach-scb9328.c
+++ b/arch/arm/mach-imx/mach-scb9328.c
@@ -22,9 +22,9 @@
#include <mach/common.h>
#include <mach/hardware.h>
-#include <mach/iomux-mx1.h>
#include "devices-imx1.h"
+#include "iomux-mx1.h"
/*
* This scb9328 has a 32MiB flash
diff --git a/arch/arm/mach-imx/mach-vpr200.c b/arch/arm/mach-imx/mach-vpr200.c
index 39eb796..37fff61 100644
--- a/arch/arm/mach-imx/mach-vpr200.c
+++ b/arch/arm/mach-imx/mach-vpr200.c
@@ -30,13 +30,13 @@
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/iomux-mx35.h>
#include <linux/i2c.h>
#include <linux/i2c/at24.h>
#include <linux/mfd/mc13xxx.h>
#include "devices-imx35.h"
+#include "iomux-mx35.h"
#define GPIO_LCDPWR IMX_GPIO_NR(1, 2)
#define GPIO_PMIC_INT IMX_GPIO_NR(2, 0)
diff --git a/arch/arm/mach-imx/mm-imx1.c b/arch/arm/mach-imx/mm-imx1.c
index 6d60d51..af61242 100644
--- a/arch/arm/mach-imx/mm-imx1.c
+++ b/arch/arm/mach-imx/mm-imx1.c
@@ -24,7 +24,8 @@
#include <mach/common.h>
#include <mach/hardware.h>
-#include <mach/iomux-v1.h>
+
+#include "iomux-v1.h"
static struct map_desc imx_io_desc[] __initdata = {
imx_map_entry(MX1, IO, MT_DEVICE),
diff --git a/arch/arm/mach-imx/mm-imx21.c b/arch/arm/mach-imx/mm-imx21.c
index d056dad..5fda681 100644
--- a/arch/arm/mach-imx/mm-imx21.c
+++ b/arch/arm/mach-imx/mm-imx21.c
@@ -26,7 +26,8 @@
#include <mach/devices-common.h>
#include <asm/pgtable.h>
#include <asm/mach/map.h>
-#include <mach/iomux-v1.h>
+
+#include "iomux-v1.h"
/* MX21 memory map definition */
static struct map_desc imx21_io_desc[] __initdata = {
diff --git a/arch/arm/mach-imx/mm-imx25.c b/arch/arm/mach-imx/mm-imx25.c
index f3f5c65..47bde02 100644
--- a/arch/arm/mach-imx/mm-imx25.c
+++ b/arch/arm/mach-imx/mm-imx25.c
@@ -28,7 +28,8 @@
#include <mach/devices-common.h>
#include <mach/hardware.h>
#include <mach/mx25.h>
-#include <mach/iomux-v3.h>
+
+#include "iomux-v3.h"
/*
* This table defines static virtual address mappings for I/O regions.
diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c
index e7e24af..8d8133e 100644
--- a/arch/arm/mach-imx/mm-imx27.c
+++ b/arch/arm/mach-imx/mm-imx27.c
@@ -26,7 +26,8 @@
#include <mach/devices-common.h>
#include <asm/pgtable.h>
#include <asm/mach/map.h>
-#include <mach/iomux-v1.h>
+
+#include "iomux-v1.h"
/* MX27 memory map definition */
static struct map_desc imx27_io_desc[] __initdata = {
diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c
index 9d2c843..87fb8644 100644
--- a/arch/arm/mach-imx/mm-imx3.c
+++ b/arch/arm/mach-imx/mm-imx3.c
@@ -29,9 +29,9 @@
#include <mach/common.h>
#include <mach/devices-common.h>
#include <mach/hardware.h>
-#include <mach/iomux-v3.h>
#include "crmregs-imx3.h"
+#include "iomux-v3.h"
void __iomem *mx3_ccm_base;
diff --git a/arch/arm/mach-imx/mm-imx5.c b/arch/arm/mach-imx/mm-imx5.c
index acb0aad..b721b79 100644
--- a/arch/arm/mach-imx/mm-imx5.c
+++ b/arch/arm/mach-imx/mm-imx5.c
@@ -21,7 +21,8 @@
#include <mach/hardware.h>
#include <mach/common.h>
#include <mach/devices-common.h>
-#include <mach/iomux-v3.h>
+
+#include "iomux-v3.h"
/*
* Define the MX50 memory map.
diff --git a/arch/arm/mach-imx/mx31lilly-db.c b/arch/arm/mach-imx/mx31lilly-db.c
index f2acf22..d364d52 100644
--- a/arch/arm/mach-imx/mx31lilly-db.c
+++ b/arch/arm/mach-imx/mx31lilly-db.c
@@ -32,10 +32,10 @@
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/iomux-mx3.h>
#include "board-mx31lilly.h"
#include "devices-imx31.h"
+#include "iomux-mx3.h"
/*
* This file contains board-specific initialization routines for the
diff --git a/arch/arm/mach-imx/mx31lite-db.c b/arch/arm/mach-imx/mx31lite-db.c
index fe4048d..944f7a8 100644
--- a/arch/arm/mach-imx/mx31lite-db.c
+++ b/arch/arm/mach-imx/mx31lite-db.c
@@ -33,10 +33,10 @@
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/iomux-mx3.h>
#include "board-mx31lite.h"
#include "devices-imx31.h"
+#include "iomux-mx3.h"
/*
* This file contains board-specific initialization routines for the
diff --git a/arch/arm/mach-imx/mx31moboard-devboard.c b/arch/arm/mach-imx/mx31moboard-devboard.c
index cc285e5..3dfb344 100644
--- a/arch/arm/mach-imx/mx31moboard-devboard.c
+++ b/arch/arm/mach-imx/mx31moboard-devboard.c
@@ -23,11 +23,11 @@
#include <linux/usb/otg.h>
#include <mach/common.h>
-#include <mach/iomux-mx3.h>
#include <mach/hardware.h>
#include <mach/ulpi.h>
#include "devices-imx31.h"
+#include "iomux-mx3.h"
static unsigned int devboard_pins[] = {
/* UART1 */
diff --git a/arch/arm/mach-imx/mx31moboard-marxbot.c b/arch/arm/mach-imx/mx31moboard-marxbot.c
index 135c90e..21cb93e 100644
--- a/arch/arm/mach-imx/mx31moboard-marxbot.c
+++ b/arch/arm/mach-imx/mx31moboard-marxbot.c
@@ -26,12 +26,12 @@
#include <mach/common.h>
#include <mach/hardware.h>
-#include <mach/iomux-mx3.h>
#include <mach/ulpi.h>
#include <media/soc_camera.h>
#include "devices-imx31.h"
+#include "iomux-mx3.h"
static unsigned int marxbot_pins[] = {
/* SDHC2 */
diff --git a/arch/arm/mach-imx/mx31moboard-smartbot.c b/arch/arm/mach-imx/mx31moboard-smartbot.c
index fc8d178..318be44 100644
--- a/arch/arm/mach-imx/mx31moboard-smartbot.c
+++ b/arch/arm/mach-imx/mx31moboard-smartbot.c
@@ -25,13 +25,13 @@
#include <mach/common.h>
#include <mach/hardware.h>
-#include <mach/iomux-mx3.h>
#include <mach/ulpi.h>
#include <media/soc_camera.h>
#include "board-mx31moboard.h"
#include "devices-imx31.h"
+#include "iomux-mx3.h"
static unsigned int smartbot_pins[] = {
/* UART1 */
diff --git a/arch/arm/mach-imx/pcm970-baseboard.c b/arch/arm/mach-imx/pcm970-baseboard.c
index 9917e2f..8e45807 100644
--- a/arch/arm/mach-imx/pcm970-baseboard.c
+++ b/arch/arm/mach-imx/pcm970-baseboard.c
@@ -24,10 +24,10 @@
#include <asm/mach/arch.h>
#include <mach/common.h>
-#include <mach/iomux-mx27.h>
#include <mach/hardware.h>
#include "devices-imx27.h"
+#include "iomux-mx27.h"
static const int pcm970_pins[] __initconst = {
/* SDHC */
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index baf9064..2450a98 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -76,12 +76,6 @@ config MXC_ULPI
config ARCH_HAS_RNGA
bool
-config IMX_HAVE_IOMUX_V1
- bool
-
-config ARCH_MXC_IOMUX_V3
- bool
-
config IRAM_ALLOC
bool
select GENERIC_ALLOCATOR
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile
index 149237e..7cc047c 100644
--- a/arch/arm/plat-mxc/Makefile
+++ b/arch/arm/plat-mxc/Makefile
@@ -8,8 +8,6 @@ obj-y := time.o devices.o cpu.o system.o irq-common.o
obj-$(CONFIG_MXC_TZIC) += tzic.o
obj-$(CONFIG_MXC_AVIC) += avic.o
-obj-$(CONFIG_IMX_HAVE_IOMUX_V1) += iomux-v1.o
-obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o
obj-$(CONFIG_IRAM_ALLOC) += iram_alloc.o
obj-$(CONFIG_MXC_ULPI) += ulpi.o
obj-$(CONFIG_MXC_USE_EPIT) += epit.o
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 04/34] ARM: imx: remove unnecessary inclusion from device-imx*.h
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (2 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 03/34] ARM: imx: move iomux drivers and headers into mach-imx Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 05/34] ARM: imx: move platform device code into mach-imx Shawn Guo
` (31 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
There is no need for device-imx*.h to include <soc>.h. Remove them
and fix one indirect inclusion in mach-mx31ads.c.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
arch/arm/mach-imx/devices-imx1.h | 1 -
arch/arm/mach-imx/devices-imx21.h | 1 -
arch/arm/mach-imx/devices-imx25.h | 1 -
arch/arm/mach-imx/devices-imx27.h | 1 -
arch/arm/mach-imx/devices-imx31.h | 1 -
arch/arm/mach-imx/devices-imx35.h | 1 -
arch/arm/mach-imx/devices-imx50.h | 1 -
arch/arm/mach-imx/devices-imx51.h | 1 -
arch/arm/mach-imx/mach-mx31ads.c | 1 +
9 files changed, 1 insertion(+), 8 deletions(-)
diff --git a/arch/arm/mach-imx/devices-imx1.h b/arch/arm/mach-imx/devices-imx1.h
index 3aad1e7..eb2603b 100644
--- a/arch/arm/mach-imx/devices-imx1.h
+++ b/arch/arm/mach-imx/devices-imx1.h
@@ -6,7 +6,6 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/mx1.h>
#include <mach/devices-common.h>
extern const struct imx_imx_fb_data imx1_imx_fb_data;
diff --git a/arch/arm/mach-imx/devices-imx21.h b/arch/arm/mach-imx/devices-imx21.h
index 93ece55..e2014da 100644
--- a/arch/arm/mach-imx/devices-imx21.h
+++ b/arch/arm/mach-imx/devices-imx21.h
@@ -6,7 +6,6 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/mx21.h>
#include <mach/devices-common.h>
extern const struct imx_imx21_hcd_data imx21_imx21_hcd_data;
diff --git a/arch/arm/mach-imx/devices-imx25.h b/arch/arm/mach-imx/devices-imx25.h
index f8e03dd..29e9706 100644
--- a/arch/arm/mach-imx/devices-imx25.h
+++ b/arch/arm/mach-imx/devices-imx25.h
@@ -6,7 +6,6 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/mx25.h>
#include <mach/devices-common.h>
extern const struct imx_fec_data imx25_fec_data;
diff --git a/arch/arm/mach-imx/devices-imx27.h b/arch/arm/mach-imx/devices-imx27.h
index 436c572..1c85b57 100644
--- a/arch/arm/mach-imx/devices-imx27.h
+++ b/arch/arm/mach-imx/devices-imx27.h
@@ -6,7 +6,6 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/mx27.h>
#include <mach/devices-common.h>
extern const struct imx_fec_data imx27_fec_data;
diff --git a/arch/arm/mach-imx/devices-imx31.h b/arch/arm/mach-imx/devices-imx31.h
index 8b2ceb4..20565f9 100644
--- a/arch/arm/mach-imx/devices-imx31.h
+++ b/arch/arm/mach-imx/devices-imx31.h
@@ -6,7 +6,6 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/mx31.h>
#include <mach/devices-common.h>
extern const struct imx_fsl_usb2_udc_data imx31_fsl_usb2_udc_data;
diff --git a/arch/arm/mach-imx/devices-imx35.h b/arch/arm/mach-imx/devices-imx35.h
index c3e9f20..e45b5cb 100644
--- a/arch/arm/mach-imx/devices-imx35.h
+++ b/arch/arm/mach-imx/devices-imx35.h
@@ -6,7 +6,6 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/mx35.h>
#include <mach/devices-common.h>
extern const struct imx_fec_data imx35_fec_data;
diff --git a/arch/arm/mach-imx/devices-imx50.h b/arch/arm/mach-imx/devices-imx50.h
index 7216667..1615a6a 100644
--- a/arch/arm/mach-imx/devices-imx50.h
+++ b/arch/arm/mach-imx/devices-imx50.h
@@ -18,7 +18,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include <mach/mx50.h>
#include <mach/devices-common.h>
extern const struct imx_imx_uart_1irq_data imx50_imx_uart_data[];
diff --git a/arch/arm/mach-imx/devices-imx51.h b/arch/arm/mach-imx/devices-imx51.h
index 9f17187..f448104 100644
--- a/arch/arm/mach-imx/devices-imx51.h
+++ b/arch/arm/mach-imx/devices-imx51.h
@@ -6,7 +6,6 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/mx51.h>
#include <mach/devices-common.h>
extern const struct imx_fec_data imx51_fec_data;
diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c
index 3d95d03..156a23e 100644
--- a/arch/arm/mach-imx/mach-mx31ads.c
+++ b/arch/arm/mach-imx/mach-mx31ads.c
@@ -29,6 +29,7 @@
#include <asm/memory.h>
#include <asm/mach/map.h>
#include <mach/common.h>
+#include <mach/hardware.h>
#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1
#include <linux/mfd/wm8350/audio.h>
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 05/34] ARM: imx: move platform device code into mach-imx
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (3 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 04/34] ARM: imx: remove unnecessary inclusion from device-imx*.h Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 06/34] ARM: imx: merge plat-mxc " Shawn Guo
` (30 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
It moves platform device code from plat-mxc into mach-imx. Along with
that, header devices-common.h gets moved from plat-mxc/include/mach/
into mach-imx/devices/.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
arch/arm/mach-imx/Kconfig | 2 ++
arch/arm/mach-imx/Makefile | 2 ++
arch/arm/mach-imx/devices-imx1.h | 2 +-
arch/arm/mach-imx/devices-imx21.h | 2 +-
arch/arm/mach-imx/devices-imx25.h | 2 +-
arch/arm/mach-imx/devices-imx27.h | 2 +-
arch/arm/mach-imx/devices-imx31.h | 2 +-
arch/arm/mach-imx/devices-imx35.h | 2 +-
arch/arm/mach-imx/devices-imx50.h | 2 +-
arch/arm/mach-imx/devices-imx51.h | 2 +-
arch/arm/{plat-mxc => mach-imx}/devices/Kconfig | 0
arch/arm/{plat-mxc => mach-imx}/devices/Makefile | 2 ++
.../mach => mach-imx/devices}/devices-common.h | 0
arch/arm/{plat-mxc => mach-imx/devices}/devices.c | 0
.../devices/platform-ahci-imx.c | 2 +-
.../{plat-mxc => mach-imx}/devices/platform-fec.c | 2 +-
.../devices/platform-flexcan.c | 2 +-
.../devices/platform-fsl-usb2-udc.c | 2 +-
.../devices/platform-gpio-mxc.c | 2 +-
.../devices/platform-gpio_keys.c | 2 +-
.../devices/platform-imx-dma.c | 2 +-
.../devices/platform-imx-fb.c | 2 +-
.../devices/platform-imx-i2c.c | 2 +-
.../devices/platform-imx-keypad.c | 2 +-
.../devices/platform-imx-ssi.c | 2 +-
.../devices/platform-imx-uart.c | 2 +-
.../devices/platform-imx2-wdt.c | 2 +-
.../devices/platform-imx21-hcd.c | 2 +-
.../devices/platform-imx_udc.c | 2 +-
.../devices/platform-imxdi_rtc.c | 2 +-
.../devices/platform-ipu-core.c | 2 +-
.../devices/platform-mx1-camera.c | 2 +-
.../devices/platform-mx2-camera.c | 2 +-
.../devices/platform-mxc-ehci.c | 2 +-
.../devices/platform-mxc-mmc.c | 2 +-
.../devices/platform-mxc_nand.c | 2 +-
.../devices/platform-mxc_pwm.c | 2 +-
.../devices/platform-mxc_rnga.c | 2 +-
.../devices/platform-mxc_rtc.c | 2 +-
.../devices/platform-mxc_w1.c | 2 +-
.../devices/platform-pata_imx.c | 2 +-
.../devices/platform-sdhci-esdhc-imx.c | 2 +-
.../devices/platform-spi_imx.c | 2 +-
arch/arm/mach-imx/mm-imx21.c | 2 +-
arch/arm/mach-imx/mm-imx25.c | 2 +-
arch/arm/mach-imx/mm-imx27.c | 2 +-
arch/arm/mach-imx/mm-imx3.c | 2 +-
arch/arm/mach-imx/mm-imx5.c | 2 +-
arch/arm/mach-imx/pm-imx3.c | 2 +-
arch/arm/plat-mxc/Kconfig | 2 --
arch/arm/plat-mxc/Makefile | 4 +---
51 files changed, 50 insertions(+), 48 deletions(-)
rename arch/arm/{plat-mxc => mach-imx}/devices/Kconfig (100%)
rename arch/arm/{plat-mxc => mach-imx}/devices/Makefile (98%)
rename arch/arm/{plat-mxc/include/mach => mach-imx/devices}/devices-common.h (100%)
rename arch/arm/{plat-mxc => mach-imx/devices}/devices.c (100%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-ahci-imx.c (99%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-fec.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-flexcan.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-fsl-usb2-udc.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-gpio-mxc.c (96%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-gpio_keys.c (96%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-dma.c (96%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-fb.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-i2c.c (99%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-keypad.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-ssi.c (99%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-uart.c (99%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx2-wdt.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx21-hcd.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx_udc.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imxdi_rtc.c (96%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-ipu-core.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mx1-camera.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mx2-camera.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc-ehci.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc-mmc.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc_nand.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc_pwm.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc_rnga.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc_rtc.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc_w1.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-pata_imx.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-sdhci-esdhc-imx.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-spi_imx.c (99%)
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 5c161cc..ad522b6 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -772,3 +772,5 @@ config SOC_IMX6Q
This enables support for Freescale i.MX6 Quad processor.
endif
+
+source "arch/arm/mach-imx/devices/Kconfig"
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 5025a9d..257893e 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -92,3 +92,5 @@ obj-$(CONFIG_MACH_MX50_RDP) += mach-mx50_rdp.o
obj-$(CONFIG_MACH_IMX51_DT) += imx51-dt.o
obj-$(CONFIG_SOC_IMX53) += mach-imx53.o
+
+obj-y += devices/
diff --git a/arch/arm/mach-imx/devices-imx1.h b/arch/arm/mach-imx/devices-imx1.h
index eb2603b..f9b5afc 100644
--- a/arch/arm/mach-imx/devices-imx1.h
+++ b/arch/arm/mach-imx/devices-imx1.h
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/devices-common.h>
+#include "devices/devices-common.h"
extern const struct imx_imx_fb_data imx1_imx_fb_data;
#define imx1_add_imx_fb(pdata) \
diff --git a/arch/arm/mach-imx/devices-imx21.h b/arch/arm/mach-imx/devices-imx21.h
index e2014da..bd93932 100644
--- a/arch/arm/mach-imx/devices-imx21.h
+++ b/arch/arm/mach-imx/devices-imx21.h
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/devices-common.h>
+#include "devices/devices-common.h"
extern const struct imx_imx21_hcd_data imx21_imx21_hcd_data;
#define imx21_add_imx21_hcd(pdata) \
diff --git a/arch/arm/mach-imx/devices-imx25.h b/arch/arm/mach-imx/devices-imx25.h
index 29e9706..0d2922b 100644
--- a/arch/arm/mach-imx/devices-imx25.h
+++ b/arch/arm/mach-imx/devices-imx25.h
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/devices-common.h>
+#include "devices/devices-common.h"
extern const struct imx_fec_data imx25_fec_data;
#define imx25_add_fec(pdata) \
diff --git a/arch/arm/mach-imx/devices-imx27.h b/arch/arm/mach-imx/devices-imx27.h
index 1c85b57..7d41e28 100644
--- a/arch/arm/mach-imx/devices-imx27.h
+++ b/arch/arm/mach-imx/devices-imx27.h
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/devices-common.h>
+#include "devices/devices-common.h"
extern const struct imx_fec_data imx27_fec_data;
#define imx27_add_fec(pdata) \
diff --git a/arch/arm/mach-imx/devices-imx31.h b/arch/arm/mach-imx/devices-imx31.h
index 20565f9..e8d1611 100644
--- a/arch/arm/mach-imx/devices-imx31.h
+++ b/arch/arm/mach-imx/devices-imx31.h
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/devices-common.h>
+#include "devices/devices-common.h"
extern const struct imx_fsl_usb2_udc_data imx31_fsl_usb2_udc_data;
#define imx31_add_fsl_usb2_udc(pdata) \
diff --git a/arch/arm/mach-imx/devices-imx35.h b/arch/arm/mach-imx/devices-imx35.h
index e45b5cb..e2675f1 100644
--- a/arch/arm/mach-imx/devices-imx35.h
+++ b/arch/arm/mach-imx/devices-imx35.h
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/devices-common.h>
+#include "devices/devices-common.h"
extern const struct imx_fec_data imx35_fec_data;
#define imx35_add_fec(pdata) \
diff --git a/arch/arm/mach-imx/devices-imx50.h b/arch/arm/mach-imx/devices-imx50.h
index 1615a6a..2c29039 100644
--- a/arch/arm/mach-imx/devices-imx50.h
+++ b/arch/arm/mach-imx/devices-imx50.h
@@ -18,7 +18,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include <mach/devices-common.h>
+#include "devices/devices-common.h"
extern const struct imx_imx_uart_1irq_data imx50_imx_uart_data[];
#define imx50_add_imx_uart(id, pdata) \
diff --git a/arch/arm/mach-imx/devices-imx51.h b/arch/arm/mach-imx/devices-imx51.h
index f448104..deee5ba 100644
--- a/arch/arm/mach-imx/devices-imx51.h
+++ b/arch/arm/mach-imx/devices-imx51.h
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/devices-common.h>
+#include "devices/devices-common.h"
extern const struct imx_fec_data imx51_fec_data;
#define imx51_add_fec(pdata) \
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/mach-imx/devices/Kconfig
similarity index 100%
rename from arch/arm/plat-mxc/devices/Kconfig
rename to arch/arm/mach-imx/devices/Kconfig
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/mach-imx/devices/Makefile
similarity index 98%
rename from arch/arm/plat-mxc/devices/Makefile
rename to arch/arm/mach-imx/devices/Makefile
index c11ac84..ff22ed1 100644
--- a/arch/arm/plat-mxc/devices/Makefile
+++ b/arch/arm/mach-imx/devices/Makefile
@@ -1,3 +1,5 @@
+obj-y := devices.o
+
obj-$(CONFIG_IMX_HAVE_PLATFORM_FEC) += platform-fec.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_FSL_USB2_UDC) += platform-fsl-usb2-udc.o
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/devices-common.h
rename to arch/arm/mach-imx/devices/devices-common.h
diff --git a/arch/arm/plat-mxc/devices.c b/arch/arm/mach-imx/devices/devices.c
similarity index 100%
rename from arch/arm/plat-mxc/devices.c
rename to arch/arm/mach-imx/devices/devices.c
diff --git a/arch/arm/plat-mxc/devices/platform-ahci-imx.c b/arch/arm/mach-imx/devices/platform-ahci-imx.c
similarity index 99%
rename from arch/arm/plat-mxc/devices/platform-ahci-imx.c
rename to arch/arm/mach-imx/devices/platform-ahci-imx.c
index ade4a1c..bf7f46d 100644
--- a/arch/arm/plat-mxc/devices/platform-ahci-imx.c
+++ b/arch/arm/mach-imx/devices/platform-ahci-imx.c
@@ -25,7 +25,7 @@
#include <linux/dma-mapping.h>
#include <asm/sizes.h>
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_ahci_imx_data_entry_single(soc, _devid) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-fec.c b/arch/arm/mach-imx/devices/platform-fec.c
similarity index 98%
rename from arch/arm/plat-mxc/devices/platform-fec.c
rename to arch/arm/mach-imx/devices/platform-fec.c
index 0bae44e..e62114f 100644
--- a/arch/arm/plat-mxc/devices/platform-fec.c
+++ b/arch/arm/mach-imx/devices/platform-fec.c
@@ -9,7 +9,7 @@
#include <linux/dma-mapping.h>
#include <asm/sizes.h>
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_fec_data_entry_single(soc, _devid) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-flexcan.c b/arch/arm/mach-imx/devices/platform-flexcan.c
similarity index 98%
rename from arch/arm/plat-mxc/devices/platform-flexcan.c
rename to arch/arm/mach-imx/devices/platform-flexcan.c
index 4e8497a..e776d8e 100644
--- a/arch/arm/plat-mxc/devices/platform-flexcan.c
+++ b/arch/arm/mach-imx/devices/platform-flexcan.c
@@ -6,7 +6,7 @@
* Free Software Foundation.
*/
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_flexcan_data_entry_single(soc, _id, _hwid, _size) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c b/arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c
similarity index 98%
rename from arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c
rename to arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c
index 848038f..6ecccf9 100644
--- a/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c
+++ b/arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c
@@ -8,7 +8,7 @@
*/
#include <linux/dma-mapping.h>
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_fsl_usb2_udc_data_entry_single(soc) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-gpio-mxc.c b/arch/arm/mach-imx/devices/platform-gpio-mxc.c
similarity index 96%
rename from arch/arm/plat-mxc/devices/platform-gpio-mxc.c
rename to arch/arm/mach-imx/devices/platform-gpio-mxc.c
index a7919a2..26483fa 100644
--- a/arch/arm/plat-mxc/devices/platform-gpio-mxc.c
+++ b/arch/arm/mach-imx/devices/platform-gpio-mxc.c
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/devices-common.h>
+#include "devices-common.h"
struct platform_device *__init mxc_register_gpio(char *name, int id,
resource_size_t iobase, resource_size_t iosize, int irq, int irq_high)
diff --git a/arch/arm/plat-mxc/devices/platform-gpio_keys.c b/arch/arm/mach-imx/devices/platform-gpio_keys.c
similarity index 96%
rename from arch/arm/plat-mxc/devices/platform-gpio_keys.c
rename to arch/arm/mach-imx/devices/platform-gpio_keys.c
index 1c53a53..3f87279 100644
--- a/arch/arm/plat-mxc/devices/platform-gpio_keys.c
+++ b/arch/arm/mach-imx/devices/platform-gpio_keys.c
@@ -17,7 +17,7 @@
*/
#include <asm/sizes.h>
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
struct platform_device *__init imx_add_gpio_keys(
const struct gpio_keys_platform_data *pdata)
diff --git a/arch/arm/plat-mxc/devices/platform-imx-dma.c b/arch/arm/mach-imx/devices/platform-imx-dma.c
similarity index 96%
rename from arch/arm/plat-mxc/devices/platform-imx-dma.c
rename to arch/arm/mach-imx/devices/platform-imx-dma.c
index 7fa7e9c..c35c99d 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-dma.c
+++ b/arch/arm/mach-imx/devices/platform-imx-dma.c
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/devices-common.h>
+#include "devices-common.h"
struct platform_device __init __maybe_unused *imx_add_imx_dma(void)
{
diff --git a/arch/arm/plat-mxc/devices/platform-imx-fb.c b/arch/arm/mach-imx/devices/platform-imx-fb.c
similarity index 98%
rename from arch/arm/plat-mxc/devices/platform-imx-fb.c
rename to arch/arm/mach-imx/devices/platform-imx-fb.c
index 2b0b5e0..4e6f857 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-fb.c
+++ b/arch/arm/mach-imx/devices/platform-imx-fb.c
@@ -8,7 +8,7 @@
*/
#include <linux/dma-mapping.h>
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_imx_fb_data_entry_single(soc, _size) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-imx-i2c.c b/arch/arm/mach-imx/devices/platform-imx-i2c.c
similarity index 99%
rename from arch/arm/plat-mxc/devices/platform-imx-i2c.c
rename to arch/arm/mach-imx/devices/platform-imx-i2c.c
index 19ad580..e0c7d62 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-i2c.c
+++ b/arch/arm/mach-imx/devices/platform-imx-i2c.c
@@ -7,7 +7,7 @@
* Free Software Foundation.
*/
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_imx_i2c_data_entry_single(soc, _id, _hwid, _size) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-imx-keypad.c b/arch/arm/mach-imx/devices/platform-imx-keypad.c
similarity index 98%
rename from arch/arm/plat-mxc/devices/platform-imx-keypad.c
rename to arch/arm/mach-imx/devices/platform-imx-keypad.c
index 479c3e9..371b1e6 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-keypad.c
+++ b/arch/arm/mach-imx/devices/platform-imx-keypad.c
@@ -7,7 +7,7 @@
* Free Software Foundation.
*/
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_imx_keypad_data_entry_single(soc, _size) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-imx-ssi.c b/arch/arm/mach-imx/devices/platform-imx-ssi.c
similarity index 99%
rename from arch/arm/plat-mxc/devices/platform-imx-ssi.c
rename to arch/arm/mach-imx/devices/platform-imx-ssi.c
index 21c6f30..bf0c5e4 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-ssi.c
+++ b/arch/arm/mach-imx/devices/platform-imx-ssi.c
@@ -7,7 +7,7 @@
* Free Software Foundation.
*/
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_imx_ssi_data_entry(soc, _id, _hwid, _size) \
[_id] = { \
diff --git a/arch/arm/plat-mxc/devices/platform-imx-uart.c b/arch/arm/mach-imx/devices/platform-imx-uart.c
similarity index 99%
rename from arch/arm/plat-mxc/devices/platform-imx-uart.c
rename to arch/arm/mach-imx/devices/platform-imx-uart.c
index d390f00..e6132f2 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-uart.c
+++ b/arch/arm/mach-imx/devices/platform-imx-uart.c
@@ -7,7 +7,7 @@
* Free Software Foundation.
*/
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_imx_uart_3irq_data_entry(soc, _id, _hwid, _size) \
[_id] = { \
diff --git a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c b/arch/arm/mach-imx/devices/platform-imx2-wdt.c
similarity index 98%
rename from arch/arm/plat-mxc/devices/platform-imx2-wdt.c
rename to arch/arm/mach-imx/devices/platform-imx2-wdt.c
index 5e07ef2..729c191 100644
--- a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
+++ b/arch/arm/mach-imx/devices/platform-imx2-wdt.c
@@ -8,7 +8,7 @@
*/
#include <asm/sizes.h>
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_imx2_wdt_data_entry_single(soc, _id, _hwid, _size) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-imx21-hcd.c b/arch/arm/mach-imx/devices/platform-imx21-hcd.c
similarity index 97%
rename from arch/arm/plat-mxc/devices/platform-imx21-hcd.c
rename to arch/arm/mach-imx/devices/platform-imx21-hcd.c
index 5770a42..18b9963 100644
--- a/arch/arm/plat-mxc/devices/platform-imx21-hcd.c
+++ b/arch/arm/mach-imx/devices/platform-imx21-hcd.c
@@ -7,7 +7,7 @@
* Free Software Foundation.
*/
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_imx21_hcd_data_entry_single(soc) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-imx_udc.c b/arch/arm/mach-imx/devices/platform-imx_udc.c
similarity index 98%
rename from arch/arm/plat-mxc/devices/platform-imx_udc.c
rename to arch/arm/mach-imx/devices/platform-imx_udc.c
index 6fd675d..75aee0b 100644
--- a/arch/arm/plat-mxc/devices/platform-imx_udc.c
+++ b/arch/arm/mach-imx/devices/platform-imx_udc.c
@@ -7,7 +7,7 @@
* Free Software Foundation.
*/
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_imx_udc_data_entry_single(soc, _size) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c b/arch/arm/mach-imx/devices/platform-imxdi_rtc.c
similarity index 96%
rename from arch/arm/plat-mxc/devices/platform-imxdi_rtc.c
rename to arch/arm/mach-imx/devices/platform-imxdi_rtc.c
index 805336f..e4b22eb 100644
--- a/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c
+++ b/arch/arm/mach-imx/devices/platform-imxdi_rtc.c
@@ -8,7 +8,7 @@
*/
#include <asm/sizes.h>
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_imxdi_rtc_data_entry_single(soc) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-ipu-core.c b/arch/arm/mach-imx/devices/platform-ipu-core.c
similarity index 98%
rename from arch/arm/plat-mxc/devices/platform-ipu-core.c
rename to arch/arm/mach-imx/devices/platform-ipu-core.c
index d1e33cc..dc0e837 100644
--- a/arch/arm/plat-mxc/devices/platform-ipu-core.c
+++ b/arch/arm/mach-imx/devices/platform-ipu-core.c
@@ -8,7 +8,7 @@
*/
#include <linux/dma-mapping.h>
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_ipu_core_entry_single(soc) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-mx1-camera.c b/arch/arm/mach-imx/devices/platform-mx1-camera.c
similarity index 97%
rename from arch/arm/plat-mxc/devices/platform-mx1-camera.c
rename to arch/arm/mach-imx/devices/platform-mx1-camera.c
index edcc581..756b0e6 100644
--- a/arch/arm/plat-mxc/devices/platform-mx1-camera.c
+++ b/arch/arm/mach-imx/devices/platform-mx1-camera.c
@@ -7,7 +7,7 @@
* Free Software Foundation.
*/
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_mx1_camera_data_entry_single(soc, _size) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-mx2-camera.c b/arch/arm/mach-imx/devices/platform-mx2-camera.c
similarity index 98%
rename from arch/arm/plat-mxc/devices/platform-mx2-camera.c
rename to arch/arm/mach-imx/devices/platform-mx2-camera.c
index 11eace9..9ad5b2d 100644
--- a/arch/arm/plat-mxc/devices/platform-mx2-camera.c
+++ b/arch/arm/mach-imx/devices/platform-mx2-camera.c
@@ -7,7 +7,7 @@
* Free Software Foundation.
*/
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_mx2_camera_data_entry_single(soc) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-mxc-ehci.c b/arch/arm/mach-imx/devices/platform-mxc-ehci.c
similarity index 98%
rename from arch/arm/plat-mxc/devices/platform-mxc-ehci.c
rename to arch/arm/mach-imx/devices/platform-mxc-ehci.c
index 35851d8..27c8171 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc-ehci.c
+++ b/arch/arm/mach-imx/devices/platform-mxc-ehci.c
@@ -8,7 +8,7 @@
*/
#include <linux/dma-mapping.h>
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_mxc_ehci_data_entry_single(soc, _id, hs) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-mxc-mmc.c b/arch/arm/mach-imx/devices/platform-mxc-mmc.c
similarity index 98%
rename from arch/arm/plat-mxc/devices/platform-mxc-mmc.c
rename to arch/arm/mach-imx/devices/platform-mxc-mmc.c
index 540d3a7..ce90ab0 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc-mmc.c
+++ b/arch/arm/mach-imx/devices/platform-mxc-mmc.c
@@ -8,7 +8,7 @@
*/
#include <linux/dma-mapping.h>
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_mxc_mmc_data_entry_single(soc, _id, _hwid, _size) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_nand.c b/arch/arm/mach-imx/devices/platform-mxc_nand.c
similarity index 98%
rename from arch/arm/plat-mxc/devices/platform-mxc_nand.c
rename to arch/arm/mach-imx/devices/platform-mxc_nand.c
index 1568f39..eb73b82 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_nand.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_nand.c
@@ -8,7 +8,7 @@
*/
#include <asm/sizes.h>
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_mxc_nand_data_entry_single(soc, _size) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_pwm.c b/arch/arm/mach-imx/devices/platform-mxc_pwm.c
similarity index 98%
rename from arch/arm/plat-mxc/devices/platform-mxc_pwm.c
rename to arch/arm/mach-imx/devices/platform-mxc_pwm.c
index b0c4ae2..a0551bf 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_pwm.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_pwm.c
@@ -7,7 +7,7 @@
* Free Software Foundation.
*/
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_mxc_pwm_data_entry_single(soc, _id, _hwid, _size) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_rnga.c b/arch/arm/mach-imx/devices/platform-mxc_rnga.c
similarity index 97%
rename from arch/arm/plat-mxc/devices/platform-mxc_rnga.c
rename to arch/arm/mach-imx/devices/platform-mxc_rnga.c
index b4b7612..37bb23c 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_rnga.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_rnga.c
@@ -7,7 +7,7 @@
* Free Software Foundation.
*/
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
struct imx_mxc_rnga_data {
resource_size_t iobase;
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_rtc.c b/arch/arm/mach-imx/devices/platform-mxc_rtc.c
similarity index 97%
rename from arch/arm/plat-mxc/devices/platform-mxc_rtc.c
rename to arch/arm/mach-imx/devices/platform-mxc_rtc.c
index a5c9ad5..daaf979 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_rtc.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_rtc.c
@@ -7,7 +7,7 @@
* Free Software Foundation.
*/
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_mxc_rtc_data_entry_single(soc) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_w1.c b/arch/arm/mach-imx/devices/platform-mxc_w1.c
similarity index 97%
rename from arch/arm/plat-mxc/devices/platform-mxc_w1.c
rename to arch/arm/mach-imx/devices/platform-mxc_w1.c
index 96fa5ea..5f972c6 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_w1.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_w1.c
@@ -7,7 +7,7 @@
* Free Software Foundation.
*/
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_mxc_w1_data_entry_single(soc) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-pata_imx.c b/arch/arm/mach-imx/devices/platform-pata_imx.c
similarity index 98%
rename from arch/arm/plat-mxc/devices/platform-pata_imx.c
rename to arch/arm/mach-imx/devices/platform-pata_imx.c
index 70e2f2a..3627ec8d 100644
--- a/arch/arm/plat-mxc/devices/platform-pata_imx.c
+++ b/arch/arm/mach-imx/devices/platform-pata_imx.c
@@ -4,7 +4,7 @@
* Free Software Foundation.
*/
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_pata_imx_data_entry_single(soc, _size) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c b/arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c
similarity index 98%
rename from arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
rename to arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c
index 3793e47..772ba2d 100644
--- a/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
+++ b/arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c
@@ -7,8 +7,8 @@
*/
#include <mach/hardware.h>
-#include <mach/devices-common.h>
#include <linux/platform_data/mmc-esdhc-imx.h>
+#include "devices-common.h"
#define imx_sdhci_esdhc_imx_data_entry_single(soc, _devid, _id, hwid) \
{ \
diff --git a/arch/arm/plat-mxc/devices/platform-spi_imx.c b/arch/arm/mach-imx/devices/platform-spi_imx.c
similarity index 99%
rename from arch/arm/plat-mxc/devices/platform-spi_imx.c
rename to arch/arm/mach-imx/devices/platform-spi_imx.c
index 9c50c14..63a116b 100644
--- a/arch/arm/plat-mxc/devices/platform-spi_imx.c
+++ b/arch/arm/mach-imx/devices/platform-spi_imx.c
@@ -7,7 +7,7 @@
* Free Software Foundation.
*/
#include <mach/hardware.h>
-#include <mach/devices-common.h>
+#include "devices-common.h"
#define imx_spi_imx_data_entry_single(soc, type, _devid, _id, hwid, _size) \
{ \
diff --git a/arch/arm/mach-imx/mm-imx21.c b/arch/arm/mach-imx/mm-imx21.c
index 5fda681..79d94aa 100644
--- a/arch/arm/mach-imx/mm-imx21.c
+++ b/arch/arm/mach-imx/mm-imx21.c
@@ -23,10 +23,10 @@
#include <linux/pinctrl/machine.h>
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/devices-common.h>
#include <asm/pgtable.h>
#include <asm/mach/map.h>
+#include "devices/devices-common.h"
#include "iomux-v1.h"
/* MX21 memory map definition */
diff --git a/arch/arm/mach-imx/mm-imx25.c b/arch/arm/mach-imx/mm-imx25.c
index 47bde02..c8ea3aa 100644
--- a/arch/arm/mach-imx/mm-imx25.c
+++ b/arch/arm/mach-imx/mm-imx25.c
@@ -25,10 +25,10 @@
#include <asm/mach/map.h>
#include <mach/common.h>
-#include <mach/devices-common.h>
#include <mach/hardware.h>
#include <mach/mx25.h>
+#include "devices/devices-common.h"
#include "iomux-v3.h"
/*
diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c
index 8d8133e..6d91808 100644
--- a/arch/arm/mach-imx/mm-imx27.c
+++ b/arch/arm/mach-imx/mm-imx27.c
@@ -23,10 +23,10 @@
#include <linux/pinctrl/machine.h>
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/devices-common.h>
#include <asm/pgtable.h>
#include <asm/mach/map.h>
+#include "devices/devices-common.h"
#include "iomux-v1.h"
/* MX27 memory map definition */
diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c
index 87fb8644..6a5d4e4 100644
--- a/arch/arm/mach-imx/mm-imx3.c
+++ b/arch/arm/mach-imx/mm-imx3.c
@@ -27,10 +27,10 @@
#include <asm/mach/map.h>
#include <mach/common.h>
-#include <mach/devices-common.h>
#include <mach/hardware.h>
#include "crmregs-imx3.h"
+#include "devices/devices-common.h"
#include "iomux-v3.h"
void __iomem *mx3_ccm_base;
diff --git a/arch/arm/mach-imx/mm-imx5.c b/arch/arm/mach-imx/mm-imx5.c
index b721b79..cc1423c 100644
--- a/arch/arm/mach-imx/mm-imx5.c
+++ b/arch/arm/mach-imx/mm-imx5.c
@@ -20,8 +20,8 @@
#include <mach/hardware.h>
#include <mach/common.h>
-#include <mach/devices-common.h>
+#include "devices/devices-common.h"
#include "iomux-v3.h"
/*
diff --git a/arch/arm/mach-imx/pm-imx3.c b/arch/arm/mach-imx/pm-imx3.c
index 822103b..884dc94 100644
--- a/arch/arm/mach-imx/pm-imx3.c
+++ b/arch/arm/mach-imx/pm-imx3.c
@@ -11,8 +11,8 @@
#include <linux/io.h>
#include <mach/common.h>
#include <mach/hardware.h>
-#include <mach/devices-common.h>
#include "crmregs-imx3.h"
+#include "devices/devices-common.h"
/*
* Set cpu low power mode before WFI instruction. This function is called
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index 2450a98..9ecaf06 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -1,7 +1,5 @@
if ARCH_MXC
-source "arch/arm/plat-mxc/devices/Kconfig"
-
menu "Freescale MXC Implementations"
choice
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile
index 7cc047c..e33d2d1 100644
--- a/arch/arm/plat-mxc/Makefile
+++ b/arch/arm/plat-mxc/Makefile
@@ -3,7 +3,7 @@
#
# Common support
-obj-y := time.o devices.o cpu.o system.o irq-common.o
+obj-y := time.o cpu.o system.o irq-common.o
obj-$(CONFIG_MXC_TZIC) += tzic.o
obj-$(CONFIG_MXC_AVIC) += avic.o
@@ -18,5 +18,3 @@ ifdef CONFIG_SND_IMX_SOC
obj-y += ssi-fiq.o
obj-y += ssi-fiq-ksym.o
endif
-
-obj-y += devices/
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 06/34] ARM: imx: merge plat-mxc into mach-imx
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (4 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 05/34] ARM: imx: move platform device code into mach-imx Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-18 8:08 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 07/34] ARM: imx: include common.h rather than mach/common.h Shawn Guo
` (29 subsequent siblings)
35 siblings, 1 reply; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
It's really unnecessary to have plat-mxc, and let's merge it into
mach-imx. It's pretty much just a bunch of file renaming and
Kconfig/Makefile merge.
To make the change less invasive, we keep using Kconfig symbol
CONFIG_ARCH_MXC for mach-imx sub-architecture.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
arch/arm/Kconfig | 2 +-
arch/arm/Makefile | 1 -
arch/arm/{plat-mxc => mach-imx}/3ds_debugboard.c | 0
arch/arm/mach-imx/Kconfig | 80 +++++++++++++++++++
arch/arm/mach-imx/Makefile | 17 ++++
arch/arm/{plat-mxc => mach-imx}/avic.c | 0
arch/arm/{plat-mxc => mach-imx}/cpu.c | 0
arch/arm/{plat-mxc => mach-imx}/cpufreq.c | 0
arch/arm/{plat-mxc => mach-imx}/cpuidle.c | 0
arch/arm/{plat-mxc => mach-imx}/epit.c | 0
.../{plat-mxc => mach-imx}/include/mach/common.h | 0
.../{plat-mxc => mach-imx}/include/mach/cpuidle.h | 0
.../include/mach/debug-macro.S | 0
.../{plat-mxc => mach-imx}/include/mach/hardware.h | 0
arch/arm/{plat-mxc => mach-imx}/include/mach/iim.h | 0
arch/arm/{plat-mxc => mach-imx}/include/mach/ipu.h | 0
.../arm/{plat-mxc => mach-imx}/include/mach/iram.h | 0
.../arm/{plat-mxc => mach-imx}/include/mach/irqs.h | 0
arch/arm/{plat-mxc => mach-imx}/include/mach/mx1.h | 0
.../arm/{plat-mxc => mach-imx}/include/mach/mx21.h | 0
.../arm/{plat-mxc => mach-imx}/include/mach/mx25.h | 0
.../arm/{plat-mxc => mach-imx}/include/mach/mx27.h | 0
.../arm/{plat-mxc => mach-imx}/include/mach/mx2x.h | 0
.../arm/{plat-mxc => mach-imx}/include/mach/mx31.h | 0
.../arm/{plat-mxc => mach-imx}/include/mach/mx35.h | 0
.../arm/{plat-mxc => mach-imx}/include/mach/mx3x.h | 0
.../arm/{plat-mxc => mach-imx}/include/mach/mx50.h | 0
.../arm/{plat-mxc => mach-imx}/include/mach/mx51.h | 0
.../arm/{plat-mxc => mach-imx}/include/mach/mx53.h | 0
.../arm/{plat-mxc => mach-imx}/include/mach/mx6q.h | 0
arch/arm/{plat-mxc => mach-imx}/include/mach/mxc.h | 0
.../{plat-mxc => mach-imx}/include/mach/timex.h | 0
.../arm/{plat-mxc => mach-imx}/include/mach/ulpi.h | 0
.../include/mach/uncompress.h | 0
arch/arm/{plat-mxc => mach-imx}/iram_alloc.c | 0
arch/arm/{plat-mxc => mach-imx}/irq-common.c | 0
arch/arm/{plat-mxc => mach-imx}/irq-common.h | 0
arch/arm/{plat-mxc => mach-imx}/ssi-fiq-ksym.c | 0
arch/arm/{plat-mxc => mach-imx}/ssi-fiq.S | 0
arch/arm/{plat-mxc => mach-imx}/system.c | 0
arch/arm/{plat-mxc => mach-imx}/time.c | 0
arch/arm/{plat-mxc => mach-imx}/tzic.c | 0
arch/arm/{plat-mxc => mach-imx}/ulpi.c | 0
arch/arm/plat-mxc/Kconfig | 81 --------------------
arch/arm/plat-mxc/Makefile | 20 -----
45 files changed, 98 insertions(+), 103 deletions(-)
rename arch/arm/{plat-mxc => mach-imx}/3ds_debugboard.c (100%)
rename arch/arm/{plat-mxc => mach-imx}/avic.c (100%)
rename arch/arm/{plat-mxc => mach-imx}/cpu.c (100%)
rename arch/arm/{plat-mxc => mach-imx}/cpufreq.c (100%)
rename arch/arm/{plat-mxc => mach-imx}/cpuidle.c (100%)
rename arch/arm/{plat-mxc => mach-imx}/epit.c (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/common.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/cpuidle.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/debug-macro.S (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/hardware.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/iim.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/ipu.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/iram.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/irqs.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/mx1.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/mx21.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/mx25.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/mx27.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/mx2x.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/mx31.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/mx35.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/mx3x.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/mx50.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/mx51.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/mx53.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/mx6q.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/mxc.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/timex.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/ulpi.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/include/mach/uncompress.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/iram_alloc.c (100%)
rename arch/arm/{plat-mxc => mach-imx}/irq-common.c (100%)
rename arch/arm/{plat-mxc => mach-imx}/irq-common.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/ssi-fiq-ksym.c (100%)
rename arch/arm/{plat-mxc => mach-imx}/ssi-fiq.S (100%)
rename arch/arm/{plat-mxc => mach-imx}/system.c (100%)
rename arch/arm/{plat-mxc => mach-imx}/time.c (100%)
rename arch/arm/{plat-mxc => mach-imx}/tzic.c (100%)
rename arch/arm/{plat-mxc => mach-imx}/ulpi.c (100%)
delete mode 100644 arch/arm/plat-mxc/Kconfig
delete mode 100644 arch/arm/plat-mxc/Makefile
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0ac5032..1d73bbc 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1051,7 +1051,7 @@ source "arch/arm/mach-msm/Kconfig"
source "arch/arm/mach-mv78xx0/Kconfig"
-source "arch/arm/plat-mxc/Kconfig"
+source "arch/arm/mach-imx/Kconfig"
source "arch/arm/mach-mxs/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 5f3c55a..d7840cc 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -196,7 +196,6 @@ machine-$(CONFIG_ARCH_ZYNQ) += zynq
# Platform directory name. This list is sorted alphanumerically
# by CONFIG_* macro name.
-plat-$(CONFIG_ARCH_MXC) += mxc
plat-$(CONFIG_ARCH_OMAP) += omap
plat-$(CONFIG_ARCH_S3C64XX) += samsung
plat-$(CONFIG_ARCH_ZYNQ) += versatile
diff --git a/arch/arm/plat-mxc/3ds_debugboard.c b/arch/arm/mach-imx/3ds_debugboard.c
similarity index 100%
rename from arch/arm/plat-mxc/3ds_debugboard.c
rename to arch/arm/mach-imx/3ds_debugboard.c
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index ad522b6..b8f0f7d 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -1,3 +1,54 @@
+if ARCH_MXC
+
+config MXC_IRQ_PRIOR
+ bool "Use IRQ priority"
+ help
+ Select this if you want to use prioritized IRQ handling.
+ This feature prevents higher priority ISR to be interrupted
+ by lower priority IRQ even IRQF_DISABLED flag is not set.
+ This may be useful in embedded applications, where are strong
+ requirements for timing.
+ Say N here, unless you have a specialized requirement.
+
+config MXC_TZIC
+ bool
+
+config MXC_AVIC
+ bool
+
+config MXC_DEBUG_BOARD
+ bool "Enable MXC debug board(for 3-stack)"
+ help
+ The debug board is an integral part of the MXC 3-stack(PDK)
+ platforms, it can be attached or removed from the peripheral
+ board. On debug board, several debug devices(ethernet, UART,
+ buttons, LEDs and JTAG) are implemented. Between the MCU and
+ these devices, a CPLD is added as a bridge which performs
+ data/address de-multiplexing and decode, signal level shift,
+ interrupt control and various board functions.
+
+config HAVE_EPIT
+ bool
+
+config MXC_USE_EPIT
+ bool "Use EPIT instead of GPT"
+ depends on HAVE_EPIT
+ help
+ Use EPIT as the system timer on systems that have it. Normally you
+ don't have a reason to do so as the EPIT has the same features and
+ uses the same clocks as the GPT. Anyway, on some systems the GPT
+ may be in use for other purposes.
+
+config MXC_ULPI
+ bool
+
+config ARCH_HAS_RNGA
+ bool
+
+config IRAM_ALLOC
+ bool
+ select GENERIC_ALLOCATOR
+
config HAVE_IMX_GPC
bool
@@ -110,6 +161,20 @@ config SOC_IMX51
select PINCTRL
select PINCTRL_IMX51
+menu "Freescale MXC Implementations"
+
+choice
+ prompt "Freescale CPU family:"
+ default ARCH_IMX_V6_V7
+
+config ARCH_IMX_V4_V5
+ bool "i.MX1, i.MX21, i.MX25, i.MX27"
+ select AUTO_ZRELADDR if !ZBOOT_ROM
+ select ARM_PATCH_PHYS_VIRT
+ help
+ This enables support for systems based on the Freescale i.MX ARMv4
+ and ARMv5 SoCs
+
if ARCH_IMX_V4_V5
comment "MX1 platforms:"
@@ -390,6 +455,15 @@ config MACH_IMX27_DT
endif
+config ARCH_IMX_V6_V7
+ bool "i.MX3, i.MX5, i.MX6"
+ select AUTO_ZRELADDR if !ZBOOT_ROM
+ select ARM_PATCH_PHYS_VIRT
+ select MIGHT_HAVE_CACHE_L2X0
+ help
+ This enables support for systems based on the Freescale i.MX3, i.MX5
+ and i.MX6 family.
+
if ARCH_IMX_V6_V7
comment "MX31 platforms:"
@@ -773,4 +847,10 @@ config SOC_IMX6Q
endif
+endchoice
+
+endmenu
+
source "arch/arm/mach-imx/devices/Kconfig"
+
+endif
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 257893e..fe47b71 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -1,3 +1,5 @@
+obj-y := time.o cpu.o system.o irq-common.o
+
obj-$(CONFIG_SOC_IMX1) += clk-imx1.o mm-imx1.o
obj-$(CONFIG_SOC_IMX21) += clk-imx21.o mm-imx21.o
@@ -18,6 +20,21 @@ obj-$(CONFIG_COMMON_CLK) += clk-pllv1.o clk-pllv2.o clk-pllv3.o clk-gate2.o \
obj-$(CONFIG_IMX_HAVE_IOMUX_V1) += iomux-v1.o
obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o
+obj-$(CONFIG_MXC_TZIC) += tzic.o
+obj-$(CONFIG_MXC_AVIC) += avic.o
+
+obj-$(CONFIG_IRAM_ALLOC) += iram_alloc.o
+obj-$(CONFIG_MXC_ULPI) += ulpi.o
+obj-$(CONFIG_MXC_USE_EPIT) += epit.o
+obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o
+obj-$(CONFIG_CPU_FREQ_IMX) += cpufreq.o
+obj-$(CONFIG_CPU_IDLE) += cpuidle.o
+
+ifdef CONFIG_SND_IMX_SOC
+obj-y += ssi-fiq.o
+obj-y += ssi-fiq-ksym.o
+endif
+
# Support for CMOS sensor interface
obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o
diff --git a/arch/arm/plat-mxc/avic.c b/arch/arm/mach-imx/avic.c
similarity index 100%
rename from arch/arm/plat-mxc/avic.c
rename to arch/arm/mach-imx/avic.c
diff --git a/arch/arm/plat-mxc/cpu.c b/arch/arm/mach-imx/cpu.c
similarity index 100%
rename from arch/arm/plat-mxc/cpu.c
rename to arch/arm/mach-imx/cpu.c
diff --git a/arch/arm/plat-mxc/cpufreq.c b/arch/arm/mach-imx/cpufreq.c
similarity index 100%
rename from arch/arm/plat-mxc/cpufreq.c
rename to arch/arm/mach-imx/cpufreq.c
diff --git a/arch/arm/plat-mxc/cpuidle.c b/arch/arm/mach-imx/cpuidle.c
similarity index 100%
rename from arch/arm/plat-mxc/cpuidle.c
rename to arch/arm/mach-imx/cpuidle.c
diff --git a/arch/arm/plat-mxc/epit.c b/arch/arm/mach-imx/epit.c
similarity index 100%
rename from arch/arm/plat-mxc/epit.c
rename to arch/arm/mach-imx/epit.c
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/mach-imx/include/mach/common.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/common.h
rename to arch/arm/mach-imx/include/mach/common.h
diff --git a/arch/arm/plat-mxc/include/mach/cpuidle.h b/arch/arm/mach-imx/include/mach/cpuidle.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/cpuidle.h
rename to arch/arm/mach-imx/include/mach/cpuidle.h
diff --git a/arch/arm/plat-mxc/include/mach/debug-macro.S b/arch/arm/mach-imx/include/mach/debug-macro.S
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/debug-macro.S
rename to arch/arm/mach-imx/include/mach/debug-macro.S
diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/mach-imx/include/mach/hardware.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/hardware.h
rename to arch/arm/mach-imx/include/mach/hardware.h
diff --git a/arch/arm/plat-mxc/include/mach/iim.h b/arch/arm/mach-imx/include/mach/iim.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/iim.h
rename to arch/arm/mach-imx/include/mach/iim.h
diff --git a/arch/arm/plat-mxc/include/mach/ipu.h b/arch/arm/mach-imx/include/mach/ipu.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/ipu.h
rename to arch/arm/mach-imx/include/mach/ipu.h
diff --git a/arch/arm/plat-mxc/include/mach/iram.h b/arch/arm/mach-imx/include/mach/iram.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/iram.h
rename to arch/arm/mach-imx/include/mach/iram.h
diff --git a/arch/arm/plat-mxc/include/mach/irqs.h b/arch/arm/mach-imx/include/mach/irqs.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/irqs.h
rename to arch/arm/mach-imx/include/mach/irqs.h
diff --git a/arch/arm/plat-mxc/include/mach/mx1.h b/arch/arm/mach-imx/include/mach/mx1.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/mx1.h
rename to arch/arm/mach-imx/include/mach/mx1.h
diff --git a/arch/arm/plat-mxc/include/mach/mx21.h b/arch/arm/mach-imx/include/mach/mx21.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/mx21.h
rename to arch/arm/mach-imx/include/mach/mx21.h
diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/mach-imx/include/mach/mx25.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/mx25.h
rename to arch/arm/mach-imx/include/mach/mx25.h
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/mach-imx/include/mach/mx27.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/mx27.h
rename to arch/arm/mach-imx/include/mach/mx27.h
diff --git a/arch/arm/plat-mxc/include/mach/mx2x.h b/arch/arm/mach-imx/include/mach/mx2x.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/mx2x.h
rename to arch/arm/mach-imx/include/mach/mx2x.h
diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/mach-imx/include/mach/mx31.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/mx31.h
rename to arch/arm/mach-imx/include/mach/mx31.h
diff --git a/arch/arm/plat-mxc/include/mach/mx35.h b/arch/arm/mach-imx/include/mach/mx35.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/mx35.h
rename to arch/arm/mach-imx/include/mach/mx35.h
diff --git a/arch/arm/plat-mxc/include/mach/mx3x.h b/arch/arm/mach-imx/include/mach/mx3x.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/mx3x.h
rename to arch/arm/mach-imx/include/mach/mx3x.h
diff --git a/arch/arm/plat-mxc/include/mach/mx50.h b/arch/arm/mach-imx/include/mach/mx50.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/mx50.h
rename to arch/arm/mach-imx/include/mach/mx50.h
diff --git a/arch/arm/plat-mxc/include/mach/mx51.h b/arch/arm/mach-imx/include/mach/mx51.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/mx51.h
rename to arch/arm/mach-imx/include/mach/mx51.h
diff --git a/arch/arm/plat-mxc/include/mach/mx53.h b/arch/arm/mach-imx/include/mach/mx53.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/mx53.h
rename to arch/arm/mach-imx/include/mach/mx53.h
diff --git a/arch/arm/plat-mxc/include/mach/mx6q.h b/arch/arm/mach-imx/include/mach/mx6q.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/mx6q.h
rename to arch/arm/mach-imx/include/mach/mx6q.h
diff --git a/arch/arm/plat-mxc/include/mach/mxc.h b/arch/arm/mach-imx/include/mach/mxc.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/mxc.h
rename to arch/arm/mach-imx/include/mach/mxc.h
diff --git a/arch/arm/plat-mxc/include/mach/timex.h b/arch/arm/mach-imx/include/mach/timex.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/timex.h
rename to arch/arm/mach-imx/include/mach/timex.h
diff --git a/arch/arm/plat-mxc/include/mach/ulpi.h b/arch/arm/mach-imx/include/mach/ulpi.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/ulpi.h
rename to arch/arm/mach-imx/include/mach/ulpi.h
diff --git a/arch/arm/plat-mxc/include/mach/uncompress.h b/arch/arm/mach-imx/include/mach/uncompress.h
similarity index 100%
rename from arch/arm/plat-mxc/include/mach/uncompress.h
rename to arch/arm/mach-imx/include/mach/uncompress.h
diff --git a/arch/arm/plat-mxc/iram_alloc.c b/arch/arm/mach-imx/iram_alloc.c
similarity index 100%
rename from arch/arm/plat-mxc/iram_alloc.c
rename to arch/arm/mach-imx/iram_alloc.c
diff --git a/arch/arm/plat-mxc/irq-common.c b/arch/arm/mach-imx/irq-common.c
similarity index 100%
rename from arch/arm/plat-mxc/irq-common.c
rename to arch/arm/mach-imx/irq-common.c
diff --git a/arch/arm/plat-mxc/irq-common.h b/arch/arm/mach-imx/irq-common.h
similarity index 100%
rename from arch/arm/plat-mxc/irq-common.h
rename to arch/arm/mach-imx/irq-common.h
diff --git a/arch/arm/plat-mxc/ssi-fiq-ksym.c b/arch/arm/mach-imx/ssi-fiq-ksym.c
similarity index 100%
rename from arch/arm/plat-mxc/ssi-fiq-ksym.c
rename to arch/arm/mach-imx/ssi-fiq-ksym.c
diff --git a/arch/arm/plat-mxc/ssi-fiq.S b/arch/arm/mach-imx/ssi-fiq.S
similarity index 100%
rename from arch/arm/plat-mxc/ssi-fiq.S
rename to arch/arm/mach-imx/ssi-fiq.S
diff --git a/arch/arm/plat-mxc/system.c b/arch/arm/mach-imx/system.c
similarity index 100%
rename from arch/arm/plat-mxc/system.c
rename to arch/arm/mach-imx/system.c
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/mach-imx/time.c
similarity index 100%
rename from arch/arm/plat-mxc/time.c
rename to arch/arm/mach-imx/time.c
diff --git a/arch/arm/plat-mxc/tzic.c b/arch/arm/mach-imx/tzic.c
similarity index 100%
rename from arch/arm/plat-mxc/tzic.c
rename to arch/arm/mach-imx/tzic.c
diff --git a/arch/arm/plat-mxc/ulpi.c b/arch/arm/mach-imx/ulpi.c
similarity index 100%
rename from arch/arm/plat-mxc/ulpi.c
rename to arch/arm/mach-imx/ulpi.c
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
deleted file mode 100644
index 9ecaf06..0000000
--- a/arch/arm/plat-mxc/Kconfig
+++ /dev/null
@@ -1,81 +0,0 @@
-if ARCH_MXC
-
-menu "Freescale MXC Implementations"
-
-choice
- prompt "Freescale CPU family:"
- default ARCH_IMX_V6_V7
-
-config ARCH_IMX_V4_V5
- bool "i.MX1, i.MX21, i.MX25, i.MX27"
- select AUTO_ZRELADDR if !ZBOOT_ROM
- select ARM_PATCH_PHYS_VIRT
- help
- This enables support for systems based on the Freescale i.MX ARMv4
- and ARMv5 SoCs
-
-config ARCH_IMX_V6_V7
- bool "i.MX3, i.MX5, i.MX6"
- select AUTO_ZRELADDR if !ZBOOT_ROM
- select ARM_PATCH_PHYS_VIRT
- select MIGHT_HAVE_CACHE_L2X0
- help
- This enables support for systems based on the Freescale i.MX3, i.MX5
- and i.MX6 family.
-
-endchoice
-
-source "arch/arm/mach-imx/Kconfig"
-
-endmenu
-
-config MXC_IRQ_PRIOR
- bool "Use IRQ priority"
- help
- Select this if you want to use prioritized IRQ handling.
- This feature prevents higher priority ISR to be interrupted
- by lower priority IRQ even IRQF_DISABLED flag is not set.
- This may be useful in embedded applications, where are strong
- requirements for timing.
- Say N here, unless you have a specialized requirement.
-
-config MXC_TZIC
- bool
-
-config MXC_AVIC
- bool
-
-config MXC_DEBUG_BOARD
- bool "Enable MXC debug board(for 3-stack)"
- help
- The debug board is an integral part of the MXC 3-stack(PDK)
- platforms, it can be attached or removed from the peripheral
- board. On debug board, several debug devices(ethernet, UART,
- buttons, LEDs and JTAG) are implemented. Between the MCU and
- these devices, a CPLD is added as a bridge which performs
- data/address de-multiplexing and decode, signal level shift,
- interrupt control and various board functions.
-
-config HAVE_EPIT
- bool
-
-config MXC_USE_EPIT
- bool "Use EPIT instead of GPT"
- depends on HAVE_EPIT
- help
- Use EPIT as the system timer on systems that have it. Normally you
- don't have a reason to do so as the EPIT has the same features and
- uses the same clocks as the GPT. Anyway, on some systems the GPT
- may be in use for other purposes.
-
-config MXC_ULPI
- bool
-
-config ARCH_HAS_RNGA
- bool
-
-config IRAM_ALLOC
- bool
- select GENERIC_ALLOCATOR
-
-endif
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile
deleted file mode 100644
index e33d2d1..0000000
--- a/arch/arm/plat-mxc/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Makefile for the linux kernel.
-#
-
-# Common support
-obj-y := time.o cpu.o system.o irq-common.o
-
-obj-$(CONFIG_MXC_TZIC) += tzic.o
-obj-$(CONFIG_MXC_AVIC) += avic.o
-
-obj-$(CONFIG_IRAM_ALLOC) += iram_alloc.o
-obj-$(CONFIG_MXC_ULPI) += ulpi.o
-obj-$(CONFIG_MXC_USE_EPIT) += epit.o
-obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o
-obj-$(CONFIG_CPU_FREQ_IMX) += cpufreq.o
-obj-$(CONFIG_CPU_IDLE) += cpuidle.o
-ifdef CONFIG_SND_IMX_SOC
-obj-y += ssi-fiq.o
-obj-y += ssi-fiq-ksym.o
-endif
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 07/34] ARM: imx: include common.h rather than mach/common.h
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (5 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 06/34] ARM: imx: merge plat-mxc " Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 08/34] ARM: imx: ARM: imx: include cpuidle.h rather than mach/cpuidle.h Shawn Guo
` (28 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
Rename mach-imx/include/mach/common.h to mach-imx/common.h and update
all users to include common.h rather than mach/common.h.
It also removes an unneeded inclusion to common.h in
mach-imx/devices/devices.c.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
arch/arm/mach-imx/avic.c | 2 +-
arch/arm/mach-imx/clk-imx1.c | 3 ++-
arch/arm/mach-imx/clk-imx21.c | 3 ++-
arch/arm/mach-imx/clk-imx25.c | 3 ++-
arch/arm/mach-imx/clk-imx27.c | 3 ++-
arch/arm/mach-imx/clk-imx31.c | 2 +-
arch/arm/mach-imx/clk-imx35.c | 2 +-
arch/arm/mach-imx/clk-imx51-imx53.c | 2 +-
arch/arm/mach-imx/clk-imx6q.c | 3 ++-
arch/arm/mach-imx/clk-pllv1.c | 2 +-
arch/arm/mach-imx/{include/mach => }/common.h | 0
arch/arm/mach-imx/cpu-imx31.c | 3 ++-
arch/arm/mach-imx/devices/devices.c | 1 -
arch/arm/mach-imx/epit.c | 3 ++-
arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | 2 +-
arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c | 2 +-
arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c | 2 +-
arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c | 2 +-
arch/arm/mach-imx/hotplug.c | 3 ++-
arch/arm/mach-imx/imx27-dt.c | 3 ++-
arch/arm/mach-imx/imx31-dt.c | 3 ++-
arch/arm/mach-imx/imx51-dt.c | 3 ++-
arch/arm/mach-imx/mach-apf9328.c | 2 +-
arch/arm/mach-imx/mach-armadillo5x0.c | 2 +-
arch/arm/mach-imx/mach-bug.c | 2 +-
arch/arm/mach-imx/mach-cpuimx27.c | 2 +-
arch/arm/mach-imx/mach-cpuimx35.c | 2 +-
arch/arm/mach-imx/mach-cpuimx51sd.c | 2 +-
arch/arm/mach-imx/mach-eukrea_cpuimx25.c | 2 +-
arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 2 +-
arch/arm/mach-imx/mach-imx27ipcam.c | 2 +-
arch/arm/mach-imx/mach-imx27lite.c | 2 +-
arch/arm/mach-imx/mach-imx53.c | 3 ++-
arch/arm/mach-imx/mach-imx6q.c | 2 +-
arch/arm/mach-imx/mach-kzm_arm11_01.c | 2 +-
arch/arm/mach-imx/mach-mx1ads.c | 2 +-
arch/arm/mach-imx/mach-mx21ads.c | 2 +-
arch/arm/mach-imx/mach-mx25_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx27_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx27ads.c | 2 +-
arch/arm/mach-imx/mach-mx31_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx31ads.c | 2 +-
arch/arm/mach-imx/mach-mx31lilly.c | 2 +-
arch/arm/mach-imx/mach-mx31lite.c | 2 +-
arch/arm/mach-imx/mach-mx31moboard.c | 2 +-
arch/arm/mach-imx/mach-mx35_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx50_rdp.c | 2 +-
arch/arm/mach-imx/mach-mx51_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx51_babbage.c | 2 +-
arch/arm/mach-imx/mach-mxt_td60.c | 2 +-
arch/arm/mach-imx/mach-pca100.c | 2 +-
arch/arm/mach-imx/mach-pcm037.c | 2 +-
arch/arm/mach-imx/mach-pcm037_eet.c | 3 +--
arch/arm/mach-imx/mach-pcm038.c | 2 +-
arch/arm/mach-imx/mach-pcm043.c | 2 +-
arch/arm/mach-imx/mach-qong.c | 2 +-
arch/arm/mach-imx/mach-scb9328.c | 2 +-
arch/arm/mach-imx/mach-vpr200.c | 2 +-
arch/arm/mach-imx/mm-imx1.c | 2 +-
arch/arm/mach-imx/mm-imx21.c | 2 +-
arch/arm/mach-imx/mm-imx25.c | 2 +-
arch/arm/mach-imx/mm-imx27.c | 2 +-
arch/arm/mach-imx/mm-imx3.c | 2 +-
arch/arm/mach-imx/mm-imx5.c | 2 +-
arch/arm/mach-imx/mx31lilly-db.c | 2 +-
arch/arm/mach-imx/mx31lite-db.c | 2 +-
arch/arm/mach-imx/mx31moboard-devboard.c | 2 +-
arch/arm/mach-imx/mx31moboard-marxbot.c | 2 +-
arch/arm/mach-imx/mx31moboard-smartbot.c | 2 +-
arch/arm/mach-imx/pcm970-baseboard.c | 2 +-
arch/arm/mach-imx/platsmp.c | 3 ++-
arch/arm/mach-imx/pm-imx3.c | 3 ++-
arch/arm/mach-imx/pm-imx5.c | 3 ++-
arch/arm/mach-imx/pm-imx6q.c | 3 ++-
arch/arm/mach-imx/system.c | 3 ++-
arch/arm/mach-imx/time.c | 3 ++-
arch/arm/mach-imx/tzic.c | 2 +-
77 files changed, 93 insertions(+), 77 deletions(-)
rename arch/arm/mach-imx/{include/mach => }/common.h (100%)
diff --git a/arch/arm/mach-imx/avic.c b/arch/arm/mach-imx/avic.c
index cbd55c3..204fd94 100644
--- a/arch/arm/mach-imx/avic.c
+++ b/arch/arm/mach-imx/avic.c
@@ -22,12 +22,12 @@
#include <linux/irqdomain.h>
#include <linux/io.h>
#include <linux/of.h>
-#include <mach/common.h>
#include <asm/mach/irq.h>
#include <asm/exception.h>
#include <mach/hardware.h>
#include <mach/irqs.h>
+#include "common.h"
#include "irq-common.h"
#define AVIC_INTCNTL 0x00 /* int control reg */
diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
index 516ddee..b5f90cc 100644
--- a/arch/arm/mach-imx/clk-imx1.c
+++ b/arch/arm/mach-imx/clk-imx1.c
@@ -23,8 +23,9 @@
#include <linux/err.h>
#include <mach/hardware.h>
-#include <mach/common.h>
+
#include "clk.h"
+#include "common.h"
/* CCM register addresses */
#define IO_ADDR_CCM(off) (MX1_IO_ADDRESS(MX1_CCM_BASE_ADDR + (off)))
diff --git a/arch/arm/mach-imx/clk-imx21.c b/arch/arm/mach-imx/clk-imx21.c
index cf65148..fbee6a4 100644
--- a/arch/arm/mach-imx/clk-imx21.c
+++ b/arch/arm/mach-imx/clk-imx21.c
@@ -26,8 +26,9 @@
#include <linux/err.h>
#include <mach/hardware.h>
-#include <mach/common.h>
+
#include "clk.h"
+#include "common.h"
#define IO_ADDR_CCM(off) (MX21_IO_ADDRESS(MX21_CCM_BASE_ADDR + (off)))
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
index 4431a62..9841ff9 100644
--- a/arch/arm/mach-imx/clk-imx25.c
+++ b/arch/arm/mach-imx/clk-imx25.c
@@ -25,9 +25,10 @@
#include <linux/err.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include <mach/mx25.h>
+
#include "clk.h"
+#include "common.h"
#define CRM_BASE MX25_IO_ADDRESS(MX25_CRM_BASE_ADDR)
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index f69ca46..7b6fd13 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -6,9 +6,10 @@
#include <linux/clk-provider.h>
#include <linux/of.h>
-#include <mach/common.h>
#include <mach/hardware.h>
+
#include "clk.h"
+#include "common.h"
#define IO_ADDR_CCM(off) (MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR + (off)))
diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c
index 1253af2..a4c298a 100644
--- a/arch/arm/mach-imx/clk-imx31.c
+++ b/arch/arm/mach-imx/clk-imx31.c
@@ -24,9 +24,9 @@
#include <mach/hardware.h>
#include <mach/mx31.h>
-#include <mach/common.h>
#include "clk.h"
+#include "common.h"
#include "crmregs-imx3.h"
static const char *mcu_main_sel[] = { "spll", "mpll", };
diff --git a/arch/arm/mach-imx/clk-imx35.c b/arch/arm/mach-imx/clk-imx35.c
index 177259b..ba26bf3 100644
--- a/arch/arm/mach-imx/clk-imx35.c
+++ b/arch/arm/mach-imx/clk-imx35.c
@@ -15,10 +15,10 @@
#include <linux/err.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include "crmregs-imx3.h"
#include "clk.h"
+#include "common.h"
struct arm_ahb_div {
unsigned char arm, ahb, sel;
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
index e5165a8..0ad4f8f 100644
--- a/arch/arm/mach-imx/clk-imx51-imx53.c
+++ b/arch/arm/mach-imx/clk-imx51-imx53.c
@@ -15,10 +15,10 @@
#include <linux/err.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include "crm-regs-imx5.h"
#include "clk.h"
+#include "common.h"
/* Low-power Audio Playback Mode clock */
static const char *lp_apm_sel[] = { "osc", };
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index 32fdf73..a2161cb 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -19,8 +19,9 @@
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
-#include <mach/common.h>
+
#include "clk.h"
+#include "common.h"
#define CCGR0 0x68
#define CCGR1 0x6c
diff --git a/arch/arm/mach-imx/clk-pllv1.c b/arch/arm/mach-imx/clk-pllv1.c
index 02be731..02f9013 100644
--- a/arch/arm/mach-imx/clk-pllv1.c
+++ b/arch/arm/mach-imx/clk-pllv1.c
@@ -4,10 +4,10 @@
#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/err.h>
-#include <mach/common.h>
#include <mach/hardware.h>
#include "clk.h"
+#include "common.h"
/**
* pll v1
diff --git a/arch/arm/mach-imx/include/mach/common.h b/arch/arm/mach-imx/common.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/common.h
rename to arch/arm/mach-imx/common.h
diff --git a/arch/arm/mach-imx/cpu-imx31.c b/arch/arm/mach-imx/cpu-imx31.c
index 3f2345f..9d3a91c 100644
--- a/arch/arm/mach-imx/cpu-imx31.c
+++ b/arch/arm/mach-imx/cpu-imx31.c
@@ -13,7 +13,8 @@
#include <linux/io.h>
#include <mach/hardware.h>
#include <mach/iim.h>
-#include <mach/common.h>
+
+#include "common.h"
static int mx31_cpu_rev = -1;
diff --git a/arch/arm/mach-imx/devices/devices.c b/arch/arm/mach-imx/devices/devices.c
index 4d55a7a..9301e07 100644
--- a/arch/arm/mach-imx/devices/devices.c
+++ b/arch/arm/mach-imx/devices/devices.c
@@ -21,7 +21,6 @@
#include <linux/init.h>
#include <linux/err.h>
#include <linux/platform_device.h>
-#include <mach/common.h>
struct device mxc_aips_bus = {
.init_name = "mxc_aips",
diff --git a/arch/arm/mach-imx/epit.c b/arch/arm/mach-imx/epit.c
index 88726f4..76720f5 100644
--- a/arch/arm/mach-imx/epit.c
+++ b/arch/arm/mach-imx/epit.c
@@ -54,7 +54,8 @@
#include <mach/hardware.h>
#include <asm/mach/time.h>
-#include <mach/common.h>
+
+#include "common.h"
static struct clock_event_device clockevent_epit;
static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED;
diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
index 3962dcd..c29e2c5 100644
--- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
@@ -29,9 +29,9 @@
#include <asm/mach/arch.h>
-#include <mach/common.h>
#include <mach/hardware.h>
+#include "common.h"
#include "devices-imx27.h"
#include "iomux-mx27.h"
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
index 5901f0a..fd7112e 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
@@ -27,11 +27,11 @@
#include <video/platform_lcd.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <mach/mx25.h>
+#include "common.h"
#include "devices-imx25.h"
#include "iomux-mx25.h"
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
index 44e9ce5..01b5996 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
@@ -37,8 +37,8 @@
#include <asm/mach/map.h>
#include <mach/hardware.h>
-#include <mach/common.h>
+#include "common.h"
#include "devices-imx35.h"
#include "iomux-mx35.h"
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
index 3e45726..17245a4 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
@@ -37,8 +37,8 @@
#include <asm/mach/map.h>
#include <mach/hardware.h>
-#include <mach/common.h>
+#include "common.h"
#include "devices-imx51.h"
#include "iomux-mx51.h"
diff --git a/arch/arm/mach-imx/hotplug.c b/arch/arm/mach-imx/hotplug.c
index b07b778..3dec962 100644
--- a/arch/arm/mach-imx/hotplug.c
+++ b/arch/arm/mach-imx/hotplug.c
@@ -13,7 +13,8 @@
#include <linux/errno.h>
#include <asm/cacheflush.h>
#include <asm/cp15.h>
-#include <mach/common.h>
+
+#include "common.h"
static inline void cpu_enter_lowpower(void)
{
diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c
index e80d523..83c56fb 100644
--- a/arch/arm/mach-imx/imx27-dt.c
+++ b/arch/arm/mach-imx/imx27-dt.c
@@ -14,9 +14,10 @@
#include <linux/of_platform.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/common.h>
#include <mach/mx27.h>
+#include "common.h"
+
static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = {
OF_DEV_AUXDATA("fsl,imx27-uart", MX27_UART1_BASE_ADDR, "imx21-uart.0", NULL),
OF_DEV_AUXDATA("fsl,imx27-uart", MX27_UART2_BASE_ADDR, "imx21-uart.1", NULL),
diff --git a/arch/arm/mach-imx/imx31-dt.c b/arch/arm/mach-imx/imx31-dt.c
index a68ba20..408afcc 100644
--- a/arch/arm/mach-imx/imx31-dt.c
+++ b/arch/arm/mach-imx/imx31-dt.c
@@ -14,9 +14,10 @@
#include <linux/of_platform.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/common.h>
#include <mach/mx31.h>
+#include "common.h"
+
static const struct of_dev_auxdata imx31_auxdata_lookup[] __initconst = {
OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART1_BASE_ADDR,
"imx21-uart.0", NULL),
diff --git a/arch/arm/mach-imx/imx51-dt.c b/arch/arm/mach-imx/imx51-dt.c
index f233b4b..e105f12 100644
--- a/arch/arm/mach-imx/imx51-dt.c
+++ b/arch/arm/mach-imx/imx51-dt.c
@@ -15,9 +15,10 @@
#include <linux/of_platform.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/common.h>
#include <mach/mx51.h>
+#include "common.h"
+
/*
* Lookup table for attaching a specific name and platform_data pointer to
* devices as they get created by of_platform_populate(). Ideally this table
diff --git a/arch/arm/mach-imx/mach-apf9328.c b/arch/arm/mach-imx/mach-apf9328.c
index b24f4b6..a0b4c3f 100644
--- a/arch/arm/mach-imx/mach-apf9328.c
+++ b/arch/arm/mach-imx/mach-apf9328.c
@@ -25,9 +25,9 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/common.h>
#include <mach/hardware.h>
+#include "common.h"
#include "devices-imx1.h"
#include "iomux-mx1.h"
diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c
index 6915e4a..f8421e9 100644
--- a/arch/arm/mach-imx/mach-armadillo5x0.c
+++ b/arch/arm/mach-imx/mach-armadillo5x0.c
@@ -48,9 +48,9 @@
#include <asm/memory.h>
#include <asm/mach/map.h>
-#include <mach/common.h>
#include <mach/ulpi.h>
+#include "common.h"
#include "devices-imx31.h"
#include "crmregs-imx3.h"
#include "iomux-mx3.h"
diff --git a/arch/arm/mach-imx/mach-bug.c b/arch/arm/mach-imx/mach-bug.c
index 55b71d1..b98e982 100644
--- a/arch/arm/mach-imx/mach-bug.c
+++ b/arch/arm/mach-imx/mach-bug.c
@@ -20,12 +20,12 @@
#include <linux/platform_device.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include <asm/mach/time.h>
#include <asm/mach/arch.h>
#include <asm/mach-types.h>
+#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c
index 0a05eab..271528b 100644
--- a/arch/arm/mach-imx/mach-cpuimx27.c
+++ b/arch/arm/mach-imx/mach-cpuimx27.c
@@ -34,10 +34,10 @@
#include <asm/mach/time.h>
#include <asm/mach/map.h>
-#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/ulpi.h>
+#include "common.h"
#include "devices-imx27.h"
#include "eukrea-baseboards.h"
#include "iomux-mx27.h"
diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c
index 132243b..86d4ac9 100644
--- a/arch/arm/mach-imx/mach-cpuimx35.c
+++ b/arch/arm/mach-imx/mach-cpuimx35.c
@@ -38,8 +38,8 @@
#include <asm/mach/map.h>
#include <mach/hardware.h>
-#include <mach/common.h>
+#include "common.h"
#include "devices-imx35.h"
#include "eukrea-baseboards.h"
#include "iomux-mx35.h"
diff --git a/arch/arm/mach-imx/mach-cpuimx51sd.c b/arch/arm/mach-imx/mach-cpuimx51sd.c
index 3c2ceed..58ad093 100644
--- a/arch/arm/mach-imx/mach-cpuimx51sd.c
+++ b/arch/arm/mach-imx/mach-cpuimx51sd.c
@@ -26,7 +26,6 @@
#include <linux/spi/spi.h>
#include <linux/can/platform/mcp251x.h>
-#include <mach/common.h>
#include <mach/hardware.h>
#include <asm/setup.h>
@@ -34,6 +33,7 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
+#include "common.h"
#include "devices-imx51.h"
#include "cpu_op-mx51.h"
#include "eukrea-baseboards.h"
diff --git a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
index 7dece34..e754b0c 100644
--- a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
+++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
@@ -33,9 +33,9 @@
#include <asm/mach/time.h>
#include <asm/memory.h>
#include <asm/mach/map.h>
-#include <mach/common.h>
#include <mach/mx25.h>
+#include "common.h"
#include "devices-imx25.h"
#include "eukrea-baseboards.h"
#include "iomux-mx25.h"
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index c85735a..31e30a2 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -40,9 +40,9 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/system_info.h>
-#include <mach/common.h>
#include <mach/hardware.h>
+#include "common.h"
#include "devices-imx27.h"
#include "iomux-mx27.h"
diff --git a/arch/arm/mach-imx/mach-imx27ipcam.c b/arch/arm/mach-imx/mach-imx27ipcam.c
index 4e2dcd3c1..725a87f 100644
--- a/arch/arm/mach-imx/mach-imx27ipcam.c
+++ b/arch/arm/mach-imx/mach-imx27ipcam.c
@@ -18,8 +18,8 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <mach/hardware.h>
-#include <mach/common.h>
+#include "common.h"
#include "devices-imx27.h"
#include "iomux-mx27.h"
diff --git a/arch/arm/mach-imx/mach-imx27lite.c b/arch/arm/mach-imx/mach-imx27lite.c
index 49be646..ec46030 100644
--- a/arch/arm/mach-imx/mach-imx27lite.c
+++ b/arch/arm/mach-imx/mach-imx27lite.c
@@ -21,8 +21,8 @@
#include <asm/mach/time.h>
#include <asm/mach/map.h>
#include <mach/hardware.h>
-#include <mach/common.h>
+#include "common.h"
#include "devices-imx27.h"
#include "iomux-mx27.h"
diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c
index 29711e9..aaa90a7 100644
--- a/arch/arm/mach-imx/mach-imx53.c
+++ b/arch/arm/mach-imx/mach-imx53.c
@@ -19,9 +19,10 @@
#include <linux/of_platform.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/common.h>
#include <mach/mx53.h>
+#include "common.h"
+
/*
* Lookup table for attaching a specific name and platform_data pointer to
* devices as they get created by of_platform_populate(). Ideally this table
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 36979d3..96d817b 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -32,10 +32,10 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/system_misc.h>
-#include <mach/common.h>
#include <mach/cpuidle.h>
#include <mach/hardware.h>
+#include "common.h"
void imx6q_restart(char mode, const char *cmd)
{
diff --git a/arch/arm/mach-imx/mach-kzm_arm11_01.c b/arch/arm/mach-imx/mach-kzm_arm11_01.c
index b68db42..73334b8 100644
--- a/arch/arm/mach-imx/mach-kzm_arm11_01.c
+++ b/arch/arm/mach-imx/mach-kzm_arm11_01.c
@@ -36,9 +36,9 @@
#include <asm/mach/map.h>
#include <asm/mach/time.h>
-#include <mach/common.h>
#include <mach/hardware.h>
+#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
diff --git a/arch/arm/mach-imx/mach-mx1ads.c b/arch/arm/mach-imx/mach-mx1ads.c
index e9e2401..8be62f3 100644
--- a/arch/arm/mach-imx/mach-mx1ads.c
+++ b/arch/arm/mach-imx/mach-mx1ads.c
@@ -23,9 +23,9 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/common.h>
#include <mach/hardware.h>
+#include "common.h"
#include "devices-imx1.h"
#include "iomux-mx1.h"
diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c
index 0df370a..99adc9f 100644
--- a/arch/arm/mach-imx/mach-mx21ads.c
+++ b/arch/arm/mach-imx/mach-mx21ads.c
@@ -18,13 +18,13 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/physmap.h>
#include <linux/gpio.h>
-#include <mach/common.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/mach/map.h>
+#include "common.h"
#include "devices-imx21.h"
#include "iomux-mx21.h"
diff --git a/arch/arm/mach-imx/mach-mx25_3ds.c b/arch/arm/mach-imx/mach-mx25_3ds.c
index 4e741c5..5a17dd6 100644
--- a/arch/arm/mach-imx/mach-mx25_3ds.c
+++ b/arch/arm/mach-imx/mach-mx25_3ds.c
@@ -37,9 +37,9 @@
#include <asm/mach/time.h>
#include <asm/memory.h>
#include <asm/mach/map.h>
-#include <mach/common.h>
#include <mach/mx25.h>
+#include "common.h"
#include "devices-imx25.h"
#include "iomux-mx25.h"
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index 8a89555..5f78bb2 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -37,10 +37,10 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include <mach/ulpi.h>
#include "3ds_debugboard.h"
+#include "common.h"
#include "devices-imx27.h"
#include "iomux-mx27.h"
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index 50b5d04..beb281c 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -21,13 +21,13 @@
#include <linux/mtd/physmap.h>
#include <linux/i2c.h>
#include <linux/irq.h>
-#include <mach/common.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/mach/map.h>
+#include "common.h"
#include "devices-imx27.h"
#include "iomux-mx27.h"
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c
index d38b696e..ee6a3f3 100644
--- a/arch/arm/mach-imx/mach-mx31_3ds.c
+++ b/arch/arm/mach-imx/mach-mx31_3ds.c
@@ -37,10 +37,10 @@
#include <asm/memory.h>
#include <asm/mach/map.h>
#include <asm/memblock.h>
-#include <mach/common.h>
#include <mach/ulpi.h>
#include "3ds_debugboard.h"
+#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c
index 156a23e..1fab27a 100644
--- a/arch/arm/mach-imx/mach-mx31ads.c
+++ b/arch/arm/mach-imx/mach-mx31ads.c
@@ -28,7 +28,6 @@
#include <asm/mach/time.h>
#include <asm/memory.h>
#include <asm/mach/map.h>
-#include <mach/common.h>
#include <mach/hardware.h>
#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1
@@ -37,6 +36,7 @@
#include <linux/mfd/wm8350/pmic.h>
#endif
+#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
diff --git a/arch/arm/mach-imx/mach-mx31lilly.c b/arch/arm/mach-imx/mach-mx31lilly.c
index ae2dc78..15d26a0 100644
--- a/arch/arm/mach-imx/mach-mx31lilly.c
+++ b/arch/arm/mach-imx/mach-mx31lilly.c
@@ -43,10 +43,10 @@
#include <asm/mach/map.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include <mach/ulpi.h>
#include "board-mx31lilly.h"
+#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c
index dc85c25..c5f8665 100644
--- a/arch/arm/mach-imx/mach-mx31lite.c
+++ b/arch/arm/mach-imx/mach-mx31lite.c
@@ -40,10 +40,10 @@
#include <asm/setup.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include <mach/ulpi.h>
#include "board-mx31lite.h"
+#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c
index 6c2e058..955275b 100644
--- a/arch/arm/mach-imx/mach-mx31moboard.c
+++ b/arch/arm/mach-imx/mach-mx31moboard.c
@@ -42,12 +42,12 @@
#include <asm/mach/time.h>
#include <asm/mach/map.h>
#include <asm/memblock.h>
-#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/ulpi.h>
#include <linux/platform_data/asoc-imx-ssi.h>
#include "board-mx31moboard.h"
+#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c
index 63d7a76..ee7d037 100644
--- a/arch/arm/mach-imx/mach-mx35_3ds.c
+++ b/arch/arm/mach-imx/mach-mx35_3ds.c
@@ -44,12 +44,12 @@
#include <asm/memblock.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include <video/platform_lcd.h>
#include <media/soc_camera.h>
#include "3ds_debugboard.h"
+#include "common.h"
#include "devices-imx35.h"
#include "iomux-mx35.h"
diff --git a/arch/arm/mach-imx/mach-mx50_rdp.c b/arch/arm/mach-imx/mach-mx50_rdp.c
index 4762a3f..4a3e98e 100644
--- a/arch/arm/mach-imx/mach-mx50_rdp.c
+++ b/arch/arm/mach-imx/mach-mx50_rdp.c
@@ -24,7 +24,6 @@
#include <linux/delay.h>
#include <linux/io.h>
-#include <mach/common.h>
#include <mach/hardware.h>
#include <asm/irq.h>
@@ -33,6 +32,7 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
+#include "common.h"
#include "devices-imx50.h"
#include "iomux-mx50.h"
diff --git a/arch/arm/mach-imx/mach-mx51_3ds.c b/arch/arm/mach-imx/mach-mx51_3ds.c
index 4eb4299..476c759 100644
--- a/arch/arm/mach-imx/mach-mx51_3ds.c
+++ b/arch/arm/mach-imx/mach-mx51_3ds.c
@@ -20,9 +20,9 @@
#include <asm/mach/time.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include "3ds_debugboard.h"
+#include "common.h"
#include "devices-imx51.h"
#include "iomux-mx51.h"
diff --git a/arch/arm/mach-imx/mach-mx51_babbage.c b/arch/arm/mach-imx/mach-mx51_babbage.c
index 20e6b9e..383948a 100644
--- a/arch/arm/mach-imx/mach-mx51_babbage.c
+++ b/arch/arm/mach-imx/mach-mx51_babbage.c
@@ -20,7 +20,6 @@
#include <linux/spi/flash.h>
#include <linux/spi/spi.h>
-#include <mach/common.h>
#include <mach/hardware.h>
#include <asm/setup.h>
@@ -28,6 +27,7 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
+#include "common.h"
#include "devices-imx51.h"
#include "cpu_op-mx51.h"
#include "iomux-mx51.h"
diff --git a/arch/arm/mach-imx/mach-mxt_td60.c b/arch/arm/mach-imx/mach-mxt_td60.c
index b5c036a..f1cbe03 100644
--- a/arch/arm/mach-imx/mach-mxt_td60.c
+++ b/arch/arm/mach-imx/mach-mxt_td60.c
@@ -21,7 +21,6 @@
#include <linux/mtd/physmap.h>
#include <linux/i2c.h>
#include <linux/irq.h>
-#include <mach/common.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -30,6 +29,7 @@
#include <linux/gpio.h>
#include <linux/i2c/pca953x.h>
+#include "common.h"
#include "devices-imx27.h"
#include "iomux-mx27.h"
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c
index 42f407b..826d326bd 100644
--- a/arch/arm/mach-imx/mach-pca100.c
+++ b/arch/arm/mach-imx/mach-pca100.c
@@ -32,11 +32,11 @@
#include <asm/mach/arch.h>
#include <asm/mach-types.h>
-#include <mach/common.h>
#include <mach/hardware.h>
#include <asm/mach/time.h>
#include <mach/ulpi.h>
+#include "common.h"
#include "devices-imx27.h"
#include "iomux-mx27.h"
diff --git a/arch/arm/mach-imx/mach-pcm037.c b/arch/arm/mach-imx/mach-pcm037.c
index 0bdec55..59d2274 100644
--- a/arch/arm/mach-imx/mach-pcm037.c
+++ b/arch/arm/mach-imx/mach-pcm037.c
@@ -42,10 +42,10 @@
#include <asm/mach/time.h>
#include <asm/mach/map.h>
#include <asm/memblock.h>
-#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/ulpi.h>
+#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
#include "pcm037.h"
diff --git a/arch/arm/mach-imx/mach-pcm037_eet.c b/arch/arm/mach-imx/mach-pcm037_eet.c
index 727dd63..8fd8255 100644
--- a/arch/arm/mach-imx/mach-pcm037_eet.c
+++ b/arch/arm/mach-imx/mach-pcm037_eet.c
@@ -11,11 +11,10 @@
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
-#include <mach/common.h>
-
#include <asm/mach-types.h>
#include "pcm037.h"
+#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c
index 288838c..9ebc248 100644
--- a/arch/arm/mach-imx/mach-pcm038.c
+++ b/arch/arm/mach-imx/mach-pcm038.c
@@ -33,11 +33,11 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/ulpi.h>
#include "board-pcm038.h"
+#include "common.h"
#include "devices-imx27.h"
#include "iomux-mx27.h"
diff --git a/arch/arm/mach-imx/mach-pcm043.c b/arch/arm/mach-imx/mach-pcm043.c
index 051e883..285ac8b 100644
--- a/arch/arm/mach-imx/mach-pcm043.c
+++ b/arch/arm/mach-imx/mach-pcm043.c
@@ -34,9 +34,9 @@
#include <asm/mach/map.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include <mach/ulpi.h>
+#include "common.h"
#include "devices-imx35.h"
#include "iomux-mx35.h"
diff --git a/arch/arm/mach-imx/mach-qong.c b/arch/arm/mach-imx/mach-qong.c
index c85425f..962988a 100644
--- a/arch/arm/mach-imx/mach-qong.c
+++ b/arch/arm/mach-imx/mach-qong.c
@@ -26,10 +26,10 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/mach/map.h>
-#include <mach/common.h>
#include <asm/page.h>
#include <asm/setup.h>
+#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
diff --git a/arch/arm/mach-imx/mach-scb9328.c b/arch/arm/mach-imx/mach-scb9328.c
index 7528bb2..c491756 100644
--- a/arch/arm/mach-imx/mach-scb9328.c
+++ b/arch/arm/mach-imx/mach-scb9328.c
@@ -20,9 +20,9 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/common.h>
#include <mach/hardware.h>
+#include "common.h"
#include "devices-imx1.h"
#include "iomux-mx1.h"
diff --git a/arch/arm/mach-imx/mach-vpr200.c b/arch/arm/mach-imx/mach-vpr200.c
index 37fff61..288a920 100644
--- a/arch/arm/mach-imx/mach-vpr200.c
+++ b/arch/arm/mach-imx/mach-vpr200.c
@@ -29,12 +29,12 @@
#include <asm/mach/time.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include <linux/i2c.h>
#include <linux/i2c/at24.h>
#include <linux/mfd/mc13xxx.h>
+#include "common.h"
#include "devices-imx35.h"
#include "iomux-mx35.h"
diff --git a/arch/arm/mach-imx/mm-imx1.c b/arch/arm/mach-imx/mm-imx1.c
index af61242..118aa92 100644
--- a/arch/arm/mach-imx/mm-imx1.c
+++ b/arch/arm/mach-imx/mm-imx1.c
@@ -22,9 +22,9 @@
#include <asm/mach/map.h>
-#include <mach/common.h>
#include <mach/hardware.h>
+#include "common.h"
#include "iomux-v1.h"
static struct map_desc imx_io_desc[] __initdata = {
diff --git a/arch/arm/mach-imx/mm-imx21.c b/arch/arm/mach-imx/mm-imx21.c
index 79d94aa..0c24556 100644
--- a/arch/arm/mach-imx/mm-imx21.c
+++ b/arch/arm/mach-imx/mm-imx21.c
@@ -22,10 +22,10 @@
#include <linux/init.h>
#include <linux/pinctrl/machine.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include <asm/pgtable.h>
#include <asm/mach/map.h>
+#include "common.h"
#include "devices/devices-common.h"
#include "iomux-v1.h"
diff --git a/arch/arm/mach-imx/mm-imx25.c b/arch/arm/mach-imx/mm-imx25.c
index c8ea3aa..a08a960 100644
--- a/arch/arm/mach-imx/mm-imx25.c
+++ b/arch/arm/mach-imx/mm-imx25.c
@@ -24,10 +24,10 @@
#include <asm/pgtable.h>
#include <asm/mach/map.h>
-#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/mx25.h>
+#include "common.h"
#include "devices/devices-common.h"
#include "iomux-v3.h"
diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c
index 6d91808..3241314 100644
--- a/arch/arm/mach-imx/mm-imx27.c
+++ b/arch/arm/mach-imx/mm-imx27.c
@@ -22,10 +22,10 @@
#include <linux/init.h>
#include <linux/pinctrl/machine.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include <asm/pgtable.h>
#include <asm/mach/map.h>
+#include "common.h"
#include "devices/devices-common.h"
#include "iomux-v1.h"
diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c
index 6a5d4e4..3e2ed2a 100644
--- a/arch/arm/mach-imx/mm-imx3.c
+++ b/arch/arm/mach-imx/mm-imx3.c
@@ -26,9 +26,9 @@
#include <asm/hardware/cache-l2x0.h>
#include <asm/mach/map.h>
-#include <mach/common.h>
#include <mach/hardware.h>
+#include "common.h"
#include "crmregs-imx3.h"
#include "devices/devices-common.h"
#include "iomux-v3.h"
diff --git a/arch/arm/mach-imx/mm-imx5.c b/arch/arm/mach-imx/mm-imx5.c
index cc1423c..d9ef24b 100644
--- a/arch/arm/mach-imx/mm-imx5.c
+++ b/arch/arm/mach-imx/mm-imx5.c
@@ -19,8 +19,8 @@
#include <asm/mach/map.h>
#include <mach/hardware.h>
-#include <mach/common.h>
+#include "common.h"
#include "devices/devices-common.h"
#include "iomux-v3.h"
diff --git a/arch/arm/mach-imx/mx31lilly-db.c b/arch/arm/mach-imx/mx31lilly-db.c
index d364d52..8cdcf0f 100644
--- a/arch/arm/mach-imx/mx31lilly-db.c
+++ b/arch/arm/mach-imx/mx31lilly-db.c
@@ -31,9 +31,9 @@
#include <asm/mach/map.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include "board-mx31lilly.h"
+#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
diff --git a/arch/arm/mach-imx/mx31lite-db.c b/arch/arm/mach-imx/mx31lite-db.c
index 944f7a8..c9eb91c 100644
--- a/arch/arm/mach-imx/mx31lite-db.c
+++ b/arch/arm/mach-imx/mx31lite-db.c
@@ -32,9 +32,9 @@
#include <asm/mach/map.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include "board-mx31lite.h"
+#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
diff --git a/arch/arm/mach-imx/mx31moboard-devboard.c b/arch/arm/mach-imx/mx31moboard-devboard.c
index 3dfb344..527f173 100644
--- a/arch/arm/mach-imx/mx31moboard-devboard.c
+++ b/arch/arm/mach-imx/mx31moboard-devboard.c
@@ -22,10 +22,10 @@
#include <linux/usb/otg.h>
-#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/ulpi.h>
+#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
diff --git a/arch/arm/mach-imx/mx31moboard-marxbot.c b/arch/arm/mach-imx/mx31moboard-marxbot.c
index 21cb93e..4679309 100644
--- a/arch/arm/mach-imx/mx31moboard-marxbot.c
+++ b/arch/arm/mach-imx/mx31moboard-marxbot.c
@@ -24,12 +24,12 @@
#include <linux/usb/otg.h>
-#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/ulpi.h>
#include <media/soc_camera.h>
+#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
diff --git a/arch/arm/mach-imx/mx31moboard-smartbot.c b/arch/arm/mach-imx/mx31moboard-smartbot.c
index 318be44..afb4d05 100644
--- a/arch/arm/mach-imx/mx31moboard-smartbot.c
+++ b/arch/arm/mach-imx/mx31moboard-smartbot.c
@@ -23,13 +23,13 @@
#include <linux/usb/otg.h>
#include <linux/usb/ulpi.h>
-#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/ulpi.h>
#include <media/soc_camera.h>
#include "board-mx31moboard.h"
+#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
diff --git a/arch/arm/mach-imx/pcm970-baseboard.c b/arch/arm/mach-imx/pcm970-baseboard.c
index 8e45807..c491f59 100644
--- a/arch/arm/mach-imx/pcm970-baseboard.c
+++ b/arch/arm/mach-imx/pcm970-baseboard.c
@@ -23,9 +23,9 @@
#include <asm/mach/arch.h>
-#include <mach/common.h>
#include <mach/hardware.h>
+#include "common.h"
#include "devices-imx27.h"
#include "iomux-mx27.h"
diff --git a/arch/arm/mach-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c
index 2ac43e1..6147be2 100644
--- a/arch/arm/mach-imx/platsmp.c
+++ b/arch/arm/mach-imx/platsmp.c
@@ -16,9 +16,10 @@
#include <asm/smp_scu.h>
#include <asm/hardware/gic.h>
#include <asm/mach/map.h>
-#include <mach/common.h>
#include <mach/hardware.h>
+#include "common.h"
+
static void __iomem *scu_base;
static struct map_desc scu_io_desc __initdata = {
diff --git a/arch/arm/mach-imx/pm-imx3.c b/arch/arm/mach-imx/pm-imx3.c
index 884dc94..e509be0 100644
--- a/arch/arm/mach-imx/pm-imx3.c
+++ b/arch/arm/mach-imx/pm-imx3.c
@@ -9,8 +9,9 @@
* http://www.gnu.org/copyleft/gpl.html
*/
#include <linux/io.h>
-#include <mach/common.h>
#include <mach/hardware.h>
+
+#include "common.h"
#include "crmregs-imx3.h"
#include "devices/devices-common.h"
diff --git a/arch/arm/mach-imx/pm-imx5.c b/arch/arm/mach-imx/pm-imx5.c
index 19621ed1..9fead8c 100644
--- a/arch/arm/mach-imx/pm-imx5.c
+++ b/arch/arm/mach-imx/pm-imx5.c
@@ -16,9 +16,10 @@
#include <asm/cacheflush.h>
#include <asm/system_misc.h>
#include <asm/tlbflush.h>
-#include <mach/common.h>
#include <mach/cpuidle.h>
#include <mach/hardware.h>
+
+#include "common.h"
#include "crm-regs-imx5.h"
/*
diff --git a/arch/arm/mach-imx/pm-imx6q.c b/arch/arm/mach-imx/pm-imx6q.c
index f7b0c2b..05618af 100644
--- a/arch/arm/mach-imx/pm-imx6q.c
+++ b/arch/arm/mach-imx/pm-imx6q.c
@@ -18,9 +18,10 @@
#include <asm/proc-fns.h>
#include <asm/suspend.h>
#include <asm/hardware/cache-l2x0.h>
-#include <mach/common.h>
#include <mach/hardware.h>
+#include "common.h"
+
extern unsigned long phys_l2x0_saved_regs;
static int imx6q_suspend_finish(unsigned long val)
diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c
index 3da78cf..bbd80f2 100644
--- a/arch/arm/mach-imx/system.c
+++ b/arch/arm/mach-imx/system.c
@@ -23,11 +23,12 @@
#include <linux/delay.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include <asm/system_misc.h>
#include <asm/proc-fns.h>
#include <asm/mach-types.h>
+#include "common.h"
+
static void __iomem *wdog_base;
/*
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
index a17abcf..8ee6f36 100644
--- a/arch/arm/mach-imx/time.c
+++ b/arch/arm/mach-imx/time.c
@@ -30,7 +30,8 @@
#include <mach/hardware.h>
#include <asm/sched_clock.h>
#include <asm/mach/time.h>
-#include <mach/common.h>
+
+#include "common.h"
/*
* There are 2 versions of the timer hardware on Freescale MXC hardware.
diff --git a/arch/arm/mach-imx/tzic.c b/arch/arm/mach-imx/tzic.c
index 3ed1adb..6134e96 100644
--- a/arch/arm/mach-imx/tzic.c
+++ b/arch/arm/mach-imx/tzic.c
@@ -22,9 +22,9 @@
#include <asm/exception.h>
#include <mach/hardware.h>
-#include <mach/common.h>
#include <mach/irqs.h>
+#include "common.h"
#include "irq-common.h"
/*
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 08/34] ARM: imx: ARM: imx: include cpuidle.h rather than mach/cpuidle.h
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (6 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 07/34] ARM: imx: include common.h rather than mach/common.h Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 09/34] ARM: imx: include iim.h rather than mach/iim.h Shawn Guo
` (27 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
Rename mach-imx/include/mach/cpuidle.h to mach-imx/cpuidle.h, and
update users to include cpuidle.h rather than mach/cpuidle.h.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
arch/arm/mach-imx/{include/mach => }/cpuidle.h | 0
arch/arm/mach-imx/mach-imx6q.c | 2 +-
arch/arm/mach-imx/pm-imx5.c | 2 +-
3 files changed, 2 insertions(+), 2 deletions(-)
rename arch/arm/mach-imx/{include/mach => }/cpuidle.h (100%)
diff --git a/arch/arm/mach-imx/include/mach/cpuidle.h b/arch/arm/mach-imx/cpuidle.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/cpuidle.h
rename to arch/arm/mach-imx/cpuidle.h
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 96d817b..b74f02f 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -32,10 +32,10 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/system_misc.h>
-#include <mach/cpuidle.h>
#include <mach/hardware.h>
#include "common.h"
+#include "cpuidle.h"
void imx6q_restart(char mode, const char *cmd)
{
diff --git a/arch/arm/mach-imx/pm-imx5.c b/arch/arm/mach-imx/pm-imx5.c
index 9fead8c..a614702 100644
--- a/arch/arm/mach-imx/pm-imx5.c
+++ b/arch/arm/mach-imx/pm-imx5.c
@@ -16,10 +16,10 @@
#include <asm/cacheflush.h>
#include <asm/system_misc.h>
#include <asm/tlbflush.h>
-#include <mach/cpuidle.h>
#include <mach/hardware.h>
#include "common.h"
+#include "cpuidle.h"
#include "crm-regs-imx5.h"
/*
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 09/34] ARM: imx: include iim.h rather than mach/iim.h
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (7 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 08/34] ARM: imx: ARM: imx: include cpuidle.h rather than mach/cpuidle.h Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 10/34] ARM: imx: include iram.h rather than mach/iram.h Shawn Guo
` (26 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
Rename mach-imx/include/mach/iim.h to mach-imx/iim.h, and update users
to include iim.h rather than mach/iim.h.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
arch/arm/mach-imx/cpu-imx25.c | 3 ++-
arch/arm/mach-imx/cpu-imx31.c | 2 +-
arch/arm/mach-imx/cpu-imx35.c | 3 ++-
arch/arm/mach-imx/{include/mach => }/iim.h | 0
4 files changed, 5 insertions(+), 3 deletions(-)
rename arch/arm/mach-imx/{include/mach => }/iim.h (100%)
diff --git a/arch/arm/mach-imx/cpu-imx25.c b/arch/arm/mach-imx/cpu-imx25.c
index 6914bcb..79d4d1c 100644
--- a/arch/arm/mach-imx/cpu-imx25.c
+++ b/arch/arm/mach-imx/cpu-imx25.c
@@ -12,7 +12,8 @@
#include <linux/module.h>
#include <linux/io.h>
#include <mach/hardware.h>
-#include <mach/iim.h>
+
+#include "iim.h"
static int mx25_cpu_rev = -1;
diff --git a/arch/arm/mach-imx/cpu-imx31.c b/arch/arm/mach-imx/cpu-imx31.c
index 9d3a91c..51c938f 100644
--- a/arch/arm/mach-imx/cpu-imx31.c
+++ b/arch/arm/mach-imx/cpu-imx31.c
@@ -12,9 +12,9 @@
#include <linux/module.h>
#include <linux/io.h>
#include <mach/hardware.h>
-#include <mach/iim.h>
#include "common.h"
+#include "iim.h"
static int mx31_cpu_rev = -1;
diff --git a/arch/arm/mach-imx/cpu-imx35.c b/arch/arm/mach-imx/cpu-imx35.c
index 846e46e..8b36d3a 100644
--- a/arch/arm/mach-imx/cpu-imx35.c
+++ b/arch/arm/mach-imx/cpu-imx35.c
@@ -11,7 +11,8 @@
#include <linux/module.h>
#include <linux/io.h>
#include <mach/hardware.h>
-#include <mach/iim.h>
+
+#include "iim.h"
static int mx35_cpu_rev = -1;
diff --git a/arch/arm/mach-imx/include/mach/iim.h b/arch/arm/mach-imx/iim.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/iim.h
rename to arch/arm/mach-imx/iim.h
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 10/34] ARM: imx: include iram.h rather than mach/iram.h
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (8 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 09/34] ARM: imx: include iim.h rather than mach/iim.h Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 11/34] ARM: imx: include ulpi.h rather than mach/ulpi.h Shawn Guo
` (25 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
Rename mach-imx/include/mach/iram.h to mach-imx/iram.h, and update users
to include iram.h rather than mach/iram.h.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
arch/arm/mach-imx/{include/mach => }/iram.h | 0
arch/arm/mach-imx/iram_alloc.c | 3 ++-
2 files changed, 2 insertions(+), 1 deletion(-)
rename arch/arm/mach-imx/{include/mach => }/iram.h (100%)
diff --git a/arch/arm/mach-imx/include/mach/iram.h b/arch/arm/mach-imx/iram.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/iram.h
rename to arch/arm/mach-imx/iram.h
diff --git a/arch/arm/mach-imx/iram_alloc.c b/arch/arm/mach-imx/iram_alloc.c
index 074c386..6c80424 100644
--- a/arch/arm/mach-imx/iram_alloc.c
+++ b/arch/arm/mach-imx/iram_alloc.c
@@ -22,7 +22,8 @@
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/genalloc.h>
-#include <mach/iram.h>
+
+#include "iram.h"
static unsigned long iram_phys_base;
static void __iomem *iram_virt_base;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 11/34] ARM: imx: include ulpi.h rather than mach/ulpi.h
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (9 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 10/34] ARM: imx: include iram.h rather than mach/iram.h Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 12/34] media: mx1_camera: remove the driver Shawn Guo
` (24 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
Rename mach-imx/include/mach/ulpi.h to mach-imx/ulpi.h, and update
users to include ulpi.h rather than mach/ulpi.h.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
arch/arm/mach-imx/mach-armadillo5x0.c | 3 +--
arch/arm/mach-imx/mach-cpuimx27.c | 2 +-
arch/arm/mach-imx/mach-mx27_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx31_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx31lilly.c | 2 +-
arch/arm/mach-imx/mach-mx31lite.c | 2 +-
arch/arm/mach-imx/mach-mx31moboard.c | 2 +-
arch/arm/mach-imx/mach-pca100.c | 2 +-
arch/arm/mach-imx/mach-pcm037.c | 2 +-
arch/arm/mach-imx/mach-pcm038.c | 2 +-
arch/arm/mach-imx/mach-pcm043.c | 2 +-
arch/arm/mach-imx/mx31moboard-devboard.c | 2 +-
arch/arm/mach-imx/mx31moboard-marxbot.c | 2 +-
arch/arm/mach-imx/mx31moboard-smartbot.c | 2 +-
arch/arm/mach-imx/ulpi.c | 2 +-
arch/arm/mach-imx/{include/mach => }/ulpi.h | 0
16 files changed, 15 insertions(+), 16 deletions(-)
rename arch/arm/mach-imx/{include/mach => }/ulpi.h (100%)
diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c
index f8421e9..ea8731f 100644
--- a/arch/arm/mach-imx/mach-armadillo5x0.c
+++ b/arch/arm/mach-imx/mach-armadillo5x0.c
@@ -48,12 +48,11 @@
#include <asm/memory.h>
#include <asm/mach/map.h>
-#include <mach/ulpi.h>
-
#include "common.h"
#include "devices-imx31.h"
#include "crmregs-imx3.h"
#include "iomux-mx3.h"
+#include "ulpi.h"
static int armadillo5x0_pins[] = {
/* UART1 */
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c
index 271528b..37571f3 100644
--- a/arch/arm/mach-imx/mach-cpuimx27.c
+++ b/arch/arm/mach-imx/mach-cpuimx27.c
@@ -35,12 +35,12 @@
#include <asm/mach/map.h>
#include <mach/hardware.h>
-#include <mach/ulpi.h>
#include "common.h"
#include "devices-imx27.h"
#include "eukrea-baseboards.h"
#include "iomux-mx27.h"
+#include "ulpi.h"
static const int eukrea_cpuimx27_pins[] __initconst = {
/* UART1 */
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index 5f78bb2..a54df77 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -37,12 +37,12 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <mach/hardware.h>
-#include <mach/ulpi.h>
#include "3ds_debugboard.h"
#include "common.h"
#include "devices-imx27.h"
#include "iomux-mx27.h"
+#include "ulpi.h"
#define SD1_EN_GPIO IMX_GPIO_NR(2, 25)
#define OTG_PHY_RESET_GPIO IMX_GPIO_NR(2, 23)
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c
index ee6a3f3..5377c88 100644
--- a/arch/arm/mach-imx/mach-mx31_3ds.c
+++ b/arch/arm/mach-imx/mach-mx31_3ds.c
@@ -37,12 +37,12 @@
#include <asm/memory.h>
#include <asm/mach/map.h>
#include <asm/memblock.h>
-#include <mach/ulpi.h>
#include "3ds_debugboard.h"
#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
+#include "ulpi.h"
static int mx31_3ds_pins[] = {
/* UART1 */
diff --git a/arch/arm/mach-imx/mach-mx31lilly.c b/arch/arm/mach-imx/mach-mx31lilly.c
index 15d26a0..74b5fa9 100644
--- a/arch/arm/mach-imx/mach-mx31lilly.c
+++ b/arch/arm/mach-imx/mach-mx31lilly.c
@@ -43,12 +43,12 @@
#include <asm/mach/map.h>
#include <mach/hardware.h>
-#include <mach/ulpi.h>
#include "board-mx31lilly.h"
#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
+#include "ulpi.h"
/*
* This file contains module-specific initialization routines for LILLY-1131.
diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c
index c5f8665..904aa63 100644
--- a/arch/arm/mach-imx/mach-mx31lite.c
+++ b/arch/arm/mach-imx/mach-mx31lite.c
@@ -40,12 +40,12 @@
#include <asm/setup.h>
#include <mach/hardware.h>
-#include <mach/ulpi.h>
#include "board-mx31lite.h"
#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
+#include "ulpi.h"
/*
* This file contains the module-specific initialization routines.
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c
index 955275b..e719c76 100644
--- a/arch/arm/mach-imx/mach-mx31moboard.c
+++ b/arch/arm/mach-imx/mach-mx31moboard.c
@@ -43,13 +43,13 @@
#include <asm/mach/map.h>
#include <asm/memblock.h>
#include <mach/hardware.h>
-#include <mach/ulpi.h>
#include <linux/platform_data/asoc-imx-ssi.h>
#include "board-mx31moboard.h"
#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
+#include "ulpi.h"
static unsigned int moboard_pins[] = {
/* UART0 */
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c
index 826d326bd..743d7e9 100644
--- a/arch/arm/mach-imx/mach-pca100.c
+++ b/arch/arm/mach-imx/mach-pca100.c
@@ -34,11 +34,11 @@
#include <asm/mach-types.h>
#include <mach/hardware.h>
#include <asm/mach/time.h>
-#include <mach/ulpi.h>
#include "common.h"
#include "devices-imx27.h"
#include "iomux-mx27.h"
+#include "ulpi.h"
#define OTG_PHY_CS_GPIO (GPIO_PORTB + 23)
#define USBH2_PHY_CS_GPIO (GPIO_PORTB + 24)
diff --git a/arch/arm/mach-imx/mach-pcm037.c b/arch/arm/mach-imx/mach-pcm037.c
index 59d2274..525f057 100644
--- a/arch/arm/mach-imx/mach-pcm037.c
+++ b/arch/arm/mach-imx/mach-pcm037.c
@@ -43,12 +43,12 @@
#include <asm/mach/map.h>
#include <asm/memblock.h>
#include <mach/hardware.h>
-#include <mach/ulpi.h>
#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
#include "pcm037.h"
+#include "ulpi.h"
static enum pcm037_board_variant pcm037_instance = PCM037_PCM970;
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c
index 9ebc248..4a52340 100644
--- a/arch/arm/mach-imx/mach-pcm038.c
+++ b/arch/arm/mach-imx/mach-pcm038.c
@@ -34,12 +34,12 @@
#include <asm/mach/time.h>
#include <mach/hardware.h>
-#include <mach/ulpi.h>
#include "board-pcm038.h"
#include "common.h"
#include "devices-imx27.h"
#include "iomux-mx27.h"
+#include "ulpi.h"
static const int pcm038_pins[] __initconst = {
/* UART1 */
diff --git a/arch/arm/mach-imx/mach-pcm043.c b/arch/arm/mach-imx/mach-pcm043.c
index 285ac8b..54ac947 100644
--- a/arch/arm/mach-imx/mach-pcm043.c
+++ b/arch/arm/mach-imx/mach-pcm043.c
@@ -34,11 +34,11 @@
#include <asm/mach/map.h>
#include <mach/hardware.h>
-#include <mach/ulpi.h>
#include "common.h"
#include "devices-imx35.h"
#include "iomux-mx35.h"
+#include "ulpi.h"
static const struct fb_videomode fb_modedb[] = {
{
diff --git a/arch/arm/mach-imx/mx31moboard-devboard.c b/arch/arm/mach-imx/mx31moboard-devboard.c
index 527f173..6489afc 100644
--- a/arch/arm/mach-imx/mx31moboard-devboard.c
+++ b/arch/arm/mach-imx/mx31moboard-devboard.c
@@ -23,11 +23,11 @@
#include <linux/usb/otg.h>
#include <mach/hardware.h>
-#include <mach/ulpi.h>
#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
+#include "ulpi.h"
static unsigned int devboard_pins[] = {
/* UART1 */
diff --git a/arch/arm/mach-imx/mx31moboard-marxbot.c b/arch/arm/mach-imx/mx31moboard-marxbot.c
index 4679309..ea973c4 100644
--- a/arch/arm/mach-imx/mx31moboard-marxbot.c
+++ b/arch/arm/mach-imx/mx31moboard-marxbot.c
@@ -25,13 +25,13 @@
#include <linux/usb/otg.h>
#include <mach/hardware.h>
-#include <mach/ulpi.h>
#include <media/soc_camera.h>
#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
+#include "ulpi.h"
static unsigned int marxbot_pins[] = {
/* SDHC2 */
diff --git a/arch/arm/mach-imx/mx31moboard-smartbot.c b/arch/arm/mach-imx/mx31moboard-smartbot.c
index afb4d05..807e882 100644
--- a/arch/arm/mach-imx/mx31moboard-smartbot.c
+++ b/arch/arm/mach-imx/mx31moboard-smartbot.c
@@ -24,7 +24,6 @@
#include <linux/usb/ulpi.h>
#include <mach/hardware.h>
-#include <mach/ulpi.h>
#include <media/soc_camera.h>
@@ -32,6 +31,7 @@
#include "common.h"
#include "devices-imx31.h"
#include "iomux-mx3.h"
+#include "ulpi.h"
static unsigned int smartbot_pins[] = {
/* UART1 */
diff --git a/arch/arm/mach-imx/ulpi.c b/arch/arm/mach-imx/ulpi.c
index d296342..0f05195 100644
--- a/arch/arm/mach-imx/ulpi.c
+++ b/arch/arm/mach-imx/ulpi.c
@@ -24,7 +24,7 @@
#include <linux/usb/otg.h>
#include <linux/usb/ulpi.h>
-#include <mach/ulpi.h>
+#include "ulpi.h"
/* ULPIVIEW register bits */
#define ULPIVW_WU (1 << 31) /* Wakeup */
diff --git a/arch/arm/mach-imx/include/mach/ulpi.h b/arch/arm/mach-imx/ulpi.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/ulpi.h
rename to arch/arm/mach-imx/ulpi.h
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 12/34] media: mx1_camera: remove the driver
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (10 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 11/34] ARM: imx: include ulpi.h rather than mach/ulpi.h Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 8:33 ` Guennadi Liakhovetski
2012-09-17 5:34 ` [PATCH 13/34] ARM: imx: remove mach/dma-mx1-mx2.h Shawn Guo
` (23 subsequent siblings)
35 siblings, 1 reply; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
The mx1_camera driver has been broken for a few release cycles since
commit 6bd0812 (dmaengine: imx-dma: merge old dma-v1.c with imx-dma.c).
It seems there is no one even compile tested it since then, as doing
so will end up with the following error.
CC drivers/media/video/mx1_camera.o
In file included from drivers/media/video/mx1_camera.c:44:0:
arch/arm/mach-imx/include/mach/dma-mx1-mx2.h:8:25: fatal error: mach/dma-v1.h: No such file or directory
It looks that all the related folks have known the breakage [1], but
no one shows the interest to bring it back to work. Thus it becomes
a piece of unmaintained code, so let's remove it.
[1] https://lkml.org/lkml/2012/2/9/171
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-media at vger.kernel.org
---
arch/arm/mach-imx/Makefile | 3 -
arch/arm/mach-imx/clk-imx1.c | 1 -
arch/arm/mach-imx/devices/Kconfig | 3 -
arch/arm/mach-imx/devices/Makefile | 1 -
arch/arm/mach-imx/devices/devices-common.h | 10 -
arch/arm/mach-imx/devices/platform-mx1-camera.c | 42 --
arch/arm/mach-imx/mx1-camera-fiq-ksym.c | 18 -
arch/arm/mach-imx/mx1-camera-fiq.S | 35 -
drivers/media/video/Kconfig | 12 -
drivers/media/video/Makefile | 1 -
drivers/media/video/mx1_camera.c | 889 -----------------------
include/linux/platform_data/camera-mx1.h | 35 -
12 files changed, 1050 deletions(-)
delete mode 100644 arch/arm/mach-imx/devices/platform-mx1-camera.c
delete mode 100644 arch/arm/mach-imx/mx1-camera-fiq-ksym.c
delete mode 100644 arch/arm/mach-imx/mx1-camera-fiq.S
delete mode 100644 drivers/media/video/mx1_camera.c
delete mode 100644 include/linux/platform_data/camera-mx1.h
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index fe47b71..538d0ee 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -35,9 +35,6 @@ obj-y += ssi-fiq.o
obj-y += ssi-fiq-ksym.o
endif
-# Support for CMOS sensor interface
-obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o
-
# i.MX1 based machines
obj-$(CONFIG_ARCH_MX1ADS) += mach-mx1ads.o
obj-$(CONFIG_MACH_SCB9328) += mach-scb9328.o
diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
index b5f90cc..ebfffd2 100644
--- a/arch/arm/mach-imx/clk-imx1.c
+++ b/arch/arm/mach-imx/clk-imx1.c
@@ -84,7 +84,6 @@ int __init mx1_clocks_init(unsigned long fref)
i, PTR_ERR(clk[i]));
clk_register_clkdev(clk[dma_gate], "ahb", "imx-dma");
- clk_register_clkdev(clk[csi_gate], NULL, "mx1-camera.0");
clk_register_clkdev(clk[mma_gate], "mma", NULL);
clk_register_clkdev(clk[usbd_gate], NULL, "imx_udc.0");
clk_register_clkdev(clk[per1], "per", "imx-gpt.0");
diff --git a/arch/arm/mach-imx/devices/Kconfig b/arch/arm/mach-imx/devices/Kconfig
index cb3e3ee..09d796e 100644
--- a/arch/arm/mach-imx/devices/Kconfig
+++ b/arch/arm/mach-imx/devices/Kconfig
@@ -46,9 +46,6 @@ config IMX_HAVE_PLATFORM_IMX_UDC
config IMX_HAVE_PLATFORM_IPU_CORE
bool
-config IMX_HAVE_PLATFORM_MX1_CAMERA
- bool
-
config IMX_HAVE_PLATFORM_MX2_CAMERA
bool
diff --git a/arch/arm/mach-imx/devices/Makefile b/arch/arm/mach-imx/devices/Makefile
index ff22ed1..3cfdc37 100644
--- a/arch/arm/mach-imx/devices/Makefile
+++ b/arch/arm/mach-imx/devices/Makefile
@@ -17,7 +17,6 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IPU_CORE) += platform-ipu-core.o
-obj-$(CONFIG_IMX_HAVE_PLATFORM_MX1_CAMERA) += platform-mx1-camera.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA) += platform-mx2-camera.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI) += platform-mxc-ehci.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
index 9e3e3d8..34419b2 100644
--- a/arch/arm/mach-imx/devices/devices-common.h
+++ b/arch/arm/mach-imx/devices/devices-common.h
@@ -199,16 +199,6 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
const struct imx_ipu_core_data *data,
struct mx3fb_platform_data *pdata);
-#include <linux/platform_data/camera-mx1.h>
-struct imx_mx1_camera_data {
- resource_size_t iobase;
- resource_size_t iosize;
- resource_size_t irq;
-};
-struct platform_device *__init imx_add_mx1_camera(
- const struct imx_mx1_camera_data *data,
- const struct mx1_camera_pdata *pdata);
-
#include <linux/platform_data/camera-mx2.h>
struct imx_mx2_camera_data {
resource_size_t iobasecsi;
diff --git a/arch/arm/mach-imx/devices/platform-mx1-camera.c b/arch/arm/mach-imx/devices/platform-mx1-camera.c
deleted file mode 100644
index 756b0e6..0000000
--- a/arch/arm/mach-imx/devices/platform-mx1-camera.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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 <mach/hardware.h>
-#include "devices-common.h"
-
-#define imx_mx1_camera_data_entry_single(soc, _size) \
- { \
- .iobase = soc ## _CSI ## _BASE_ADDR, \
- .iosize = _size, \
- .irq = soc ## _INT_CSI, \
- }
-
-#ifdef CONFIG_SOC_IMX1
-const struct imx_mx1_camera_data imx1_mx1_camera_data __initconst =
- imx_mx1_camera_data_entry_single(MX1, 10);
-#endif /* ifdef CONFIG_SOC_IMX1 */
-
-struct platform_device *__init imx_add_mx1_camera(
- const struct imx_mx1_camera_data *data,
- const struct mx1_camera_pdata *pdata)
-{
- struct resource res[] = {
- {
- .start = data->iobase,
- .end = data->iobase + data->iosize - 1,
- .flags = IORESOURCE_MEM,
- }, {
- .start = data->irq,
- .end = data->irq,
- .flags = IORESOURCE_IRQ,
- },
- };
- return imx_add_platform_device_dmamask("mx1-camera", 0,
- res, ARRAY_SIZE(res),
- pdata, sizeof(*pdata), DMA_BIT_MASK(32));
-}
diff --git a/arch/arm/mach-imx/mx1-camera-fiq-ksym.c b/arch/arm/mach-imx/mx1-camera-fiq-ksym.c
deleted file mode 100644
index fb38436..0000000
--- a/arch/arm/mach-imx/mx1-camera-fiq-ksym.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Exported ksyms of ARCH_MX1
- *
- * Copyright (C) 2008, Darius Augulis <augulis.darius@gmail.com>
- *
- * 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 <linux/platform_device.h>
-#include <linux/module.h>
-
-#include <linux/platform_data/camera-mx1.h>
-
-/* IMX camera FIQ handler */
-EXPORT_SYMBOL(mx1_camera_sof_fiq_start);
-EXPORT_SYMBOL(mx1_camera_sof_fiq_end);
diff --git a/arch/arm/mach-imx/mx1-camera-fiq.S b/arch/arm/mach-imx/mx1-camera-fiq.S
deleted file mode 100644
index 9c69aa6..0000000
--- a/arch/arm/mach-imx/mx1-camera-fiq.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2008 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
- *
- * Based on linux/arch/arm/lib/floppydma.S
- * Copyright (C) 1995, 1996 Russell King
- *
- * 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 <linux/linkage.h>
-#include <asm/assembler.h>
-
- .text
- .global mx1_camera_sof_fiq_end
- .global mx1_camera_sof_fiq_start
-mx1_camera_sof_fiq_start:
- @ enable dma
- ldr r12, [r9]
- orr r12, r12, #0x00000001
- str r12, [r9]
- @ unmask DMA interrupt
- ldr r12, [r8]
- bic r12, r12, r13
- str r12, [r8]
- @ disable SOF interrupt
- ldr r12, [r10]
- bic r12, r12, #0x00010000
- str r12, [r10]
- @ clear SOF flag
- mov r12, #0x00010000
- str r12, [r11]
- @ return from FIQ
- subs pc, lr, #4
-mx1_camera_sof_fiq_end:
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index c128fac..e8b89a9 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -1118,18 +1118,6 @@ config SOC_CAMERA_OV9740
help
This is a ov9740 camera driver
-config MX1_VIDEO
- bool
-
-config VIDEO_MX1
- tristate "i.MX1/i.MXL CMOS Sensor Interface driver"
- depends on VIDEO_DEV && ARCH_MX1 && SOC_CAMERA
- select FIQ
- select VIDEOBUF_DMA_CONTIG
- select MX1_VIDEO
- ---help---
- This is a v4l2 driver for the i.MX1/i.MXL CMOS Sensor Interface
-
config MX3_VIDEO
bool
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index b7da9fa..8624228 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -178,7 +178,6 @@ obj-$(CONFIG_VIDEO_OMAP2) += omap2cam.o
obj-$(CONFIG_SOC_CAMERA) += soc_camera.o soc_mediabus.o
obj-$(CONFIG_SOC_CAMERA_PLATFORM) += soc_camera_platform.o
# soc-camera host drivers have to be linked after camera drivers
-obj-$(CONFIG_VIDEO_MX1) += mx1_camera.o
obj-$(CONFIG_VIDEO_MX2) += mx2_camera.o
obj-$(CONFIG_VIDEO_MX3) += mx3_camera.o
obj-$(CONFIG_VIDEO_PXA27x) += pxa_camera.o
diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c
deleted file mode 100644
index bbe7099..0000000
--- a/drivers/media/video/mx1_camera.c
+++ /dev/null
@@ -1,889 +0,0 @@
-/*
- * V4L2 Driver for i.MXL/i.MXL camera (CSI) host
- *
- * Copyright (C) 2008, Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
- * Copyright (C) 2009, Darius Augulis <augulis.darius@gmail.com>
- *
- * Based on PXA SoC camera driver
- * Copyright (C) 2006, Sascha Hauer, Pengutronix
- * Copyright (C) 2008, Guennadi Liakhovetski <kernel@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 <linux/clk.h>
-#include <linux/delay.h>
-#include <linux/device.h>
-#include <linux/dma-mapping.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/mutex.h>
-#include <linux/platform_device.h>
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/time.h>
-#include <linux/videodev2.h>
-
-#include <media/soc_camera.h>
-#include <media/v4l2-common.h>
-#include <media/v4l2-dev.h>
-#include <media/videobuf-dma-contig.h>
-#include <media/soc_mediabus.h>
-
-#include <asm/dma.h>
-#include <asm/fiq.h>
-#include <mach/dma-mx1-mx2.h>
-#include <mach/hardware.h>
-#include <mach/irqs.h>
-#include <linux/platform_data/camera-mx1.h>
-
-/*
- * CSI registers
- */
-#define CSICR1 0x00 /* CSI Control Register 1 */
-#define CSISR 0x08 /* CSI Status Register */
-#define CSIRXR 0x10 /* CSI RxFIFO Register */
-
-#define CSICR1_RXFF_LEVEL(x) (((x) & 0x3) << 19)
-#define CSICR1_SOF_POL (1 << 17)
-#define CSICR1_SOF_INTEN (1 << 16)
-#define CSICR1_MCLKDIV(x) (((x) & 0xf) << 12)
-#define CSICR1_MCLKEN (1 << 9)
-#define CSICR1_FCC (1 << 8)
-#define CSICR1_BIG_ENDIAN (1 << 7)
-#define CSICR1_CLR_RXFIFO (1 << 5)
-#define CSICR1_GCLK_MODE (1 << 4)
-#define CSICR1_DATA_POL (1 << 2)
-#define CSICR1_REDGE (1 << 1)
-#define CSICR1_EN (1 << 0)
-
-#define CSISR_SFF_OR_INT (1 << 25)
-#define CSISR_RFF_OR_INT (1 << 24)
-#define CSISR_STATFF_INT (1 << 21)
-#define CSISR_RXFF_INT (1 << 18)
-#define CSISR_SOF_INT (1 << 16)
-#define CSISR_DRDY (1 << 0)
-
-#define DRIVER_VERSION "0.0.2"
-#define DRIVER_NAME "mx1-camera"
-
-#define CSI_IRQ_MASK (CSISR_SFF_OR_INT | CSISR_RFF_OR_INT | \
- CSISR_STATFF_INT | CSISR_RXFF_INT | CSISR_SOF_INT)
-
-#define CSI_BUS_FLAGS (V4L2_MBUS_MASTER | V4L2_MBUS_HSYNC_ACTIVE_HIGH | \
- V4L2_MBUS_VSYNC_ACTIVE_HIGH | V4L2_MBUS_VSYNC_ACTIVE_LOW | \
- V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_PCLK_SAMPLE_FALLING | \
- V4L2_MBUS_DATA_ACTIVE_HIGH | V4L2_MBUS_DATA_ACTIVE_LOW)
-
-#define MAX_VIDEO_MEM 16 /* Video memory limit in megabytes */
-
-/*
- * Structures
- */
-
-/* buffer for one video frame */
-struct mx1_buffer {
- /* common v4l buffer stuff -- must be first */
- struct videobuf_buffer vb;
- enum v4l2_mbus_pixelcode code;
- int inwork;
-};
-
-/*
- * i.MX1/i.MXL is only supposed to handle one camera on its Camera Sensor
- * Interface. If anyone ever builds hardware to enable more than
- * one camera, they will have to modify this driver too
- */
-struct mx1_camera_dev {
- struct soc_camera_host soc_host;
- struct soc_camera_device *icd;
- struct mx1_camera_pdata *pdata;
- struct mx1_buffer *active;
- struct resource *res;
- struct clk *clk;
- struct list_head capture;
-
- void __iomem *base;
- int dma_chan;
- unsigned int irq;
- unsigned long mclk;
-
- spinlock_t lock;
-};
-
-/*
- * Videobuf operations
- */
-static int mx1_videobuf_setup(struct videobuf_queue *vq, unsigned int *count,
- unsigned int *size)
-{
- struct soc_camera_device *icd = vq->priv_data;
-
- *size = icd->sizeimage;
-
- if (!*count)
- *count = 32;
-
- if (*size * *count > MAX_VIDEO_MEM * 1024 * 1024)
- *count = (MAX_VIDEO_MEM * 1024 * 1024) / *size;
-
- dev_dbg(icd->parent, "count=%d, size=%d\n", *count, *size);
-
- return 0;
-}
-
-static void free_buffer(struct videobuf_queue *vq, struct mx1_buffer *buf)
-{
- struct soc_camera_device *icd = vq->priv_data;
- struct videobuf_buffer *vb = &buf->vb;
-
- BUG_ON(in_interrupt());
-
- dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
- vb, vb->baddr, vb->bsize);
-
- /*
- * This waits until this buffer is out of danger, i.e., until it is no
- * longer in STATE_QUEUED or STATE_ACTIVE
- */
- videobuf_waiton(vq, vb, 0, 0);
- videobuf_dma_contig_free(vq, vb);
-
- vb->state = VIDEOBUF_NEEDS_INIT;
-}
-
-static int mx1_videobuf_prepare(struct videobuf_queue *vq,
- struct videobuf_buffer *vb, enum v4l2_field field)
-{
- struct soc_camera_device *icd = vq->priv_data;
- struct mx1_buffer *buf = container_of(vb, struct mx1_buffer, vb);
- int ret;
-
- dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
- vb, vb->baddr, vb->bsize);
-
- /* Added list head initialization on alloc */
- WARN_ON(!list_empty(&vb->queue));
-
- BUG_ON(NULL == icd->current_fmt);
-
- /*
- * I think, in buf_prepare you only have to protect global data,
- * the actual buffer is yours
- */
- buf->inwork = 1;
-
- if (buf->code != icd->current_fmt->code ||
- vb->width != icd->user_width ||
- vb->height != icd->user_height ||
- vb->field != field) {
- buf->code = icd->current_fmt->code;
- vb->width = icd->user_width;
- vb->height = icd->user_height;
- vb->field = field;
- vb->state = VIDEOBUF_NEEDS_INIT;
- }
-
- vb->size = icd->sizeimage;
- if (0 != vb->baddr && vb->bsize < vb->size) {
- ret = -EINVAL;
- goto out;
- }
-
- if (vb->state == VIDEOBUF_NEEDS_INIT) {
- ret = videobuf_iolock(vq, vb, NULL);
- if (ret)
- goto fail;
-
- vb->state = VIDEOBUF_PREPARED;
- }
-
- buf->inwork = 0;
-
- return 0;
-
-fail:
- free_buffer(vq, buf);
-out:
- buf->inwork = 0;
- return ret;
-}
-
-static int mx1_camera_setup_dma(struct mx1_camera_dev *pcdev)
-{
- struct videobuf_buffer *vbuf = &pcdev->active->vb;
- struct device *dev = pcdev->icd->parent;
- int ret;
-
- if (unlikely(!pcdev->active)) {
- dev_err(dev, "DMA End IRQ with no active buffer\n");
- return -EFAULT;
- }
-
- /* setup sg list for future DMA */
- ret = imx_dma_setup_single(pcdev->dma_chan,
- videobuf_to_dma_contig(vbuf),
- vbuf->size, pcdev->res->start +
- CSIRXR, DMA_MODE_READ);
- if (unlikely(ret))
- dev_err(dev, "Failed to setup DMA sg list\n");
-
- return ret;
-}
-
-/* Called under spinlock_irqsave(&pcdev->lock, ...) */
-static void mx1_videobuf_queue(struct videobuf_queue *vq,
- struct videobuf_buffer *vb)
-{
- struct soc_camera_device *icd = vq->priv_data;
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
- struct mx1_camera_dev *pcdev = ici->priv;
- struct mx1_buffer *buf = container_of(vb, struct mx1_buffer, vb);
-
- dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
- vb, vb->baddr, vb->bsize);
-
- list_add_tail(&vb->queue, &pcdev->capture);
-
- vb->state = VIDEOBUF_ACTIVE;
-
- if (!pcdev->active) {
- pcdev->active = buf;
-
- /* setup sg list for future DMA */
- if (!mx1_camera_setup_dma(pcdev)) {
- unsigned int temp;
- /* enable SOF irq */
- temp = __raw_readl(pcdev->base + CSICR1) |
- CSICR1_SOF_INTEN;
- __raw_writel(temp, pcdev->base + CSICR1);
- }
- }
-}
-
-static void mx1_videobuf_release(struct videobuf_queue *vq,
- struct videobuf_buffer *vb)
-{
- struct mx1_buffer *buf = container_of(vb, struct mx1_buffer, vb);
-#ifdef DEBUG
- struct soc_camera_device *icd = vq->priv_data;
- struct device *dev = icd->parent;
-
- dev_dbg(dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
- vb, vb->baddr, vb->bsize);
-
- switch (vb->state) {
- case VIDEOBUF_ACTIVE:
- dev_dbg(dev, "%s (active)\n", __func__);
- break;
- case VIDEOBUF_QUEUED:
- dev_dbg(dev, "%s (queued)\n", __func__);
- break;
- case VIDEOBUF_PREPARED:
- dev_dbg(dev, "%s (prepared)\n", __func__);
- break;
- default:
- dev_dbg(dev, "%s (unknown)\n", __func__);
- break;
- }
-#endif
-
- free_buffer(vq, buf);
-}
-
-static void mx1_camera_wakeup(struct mx1_camera_dev *pcdev,
- struct videobuf_buffer *vb,
- struct mx1_buffer *buf)
-{
- /* _init is used to debug races, see comment in mx1_camera_reqbufs() */
- list_del_init(&vb->queue);
- vb->state = VIDEOBUF_DONE;
- do_gettimeofday(&vb->ts);
- vb->field_count++;
- wake_up(&vb->done);
-
- if (list_empty(&pcdev->capture)) {
- pcdev->active = NULL;
- return;
- }
-
- pcdev->active = list_entry(pcdev->capture.next,
- struct mx1_buffer, vb.queue);
-
- /* setup sg list for future DMA */
- if (likely(!mx1_camera_setup_dma(pcdev))) {
- unsigned int temp;
-
- /* enable SOF irq */
- temp = __raw_readl(pcdev->base + CSICR1) | CSICR1_SOF_INTEN;
- __raw_writel(temp, pcdev->base + CSICR1);
- }
-}
-
-static void mx1_camera_dma_irq(int channel, void *data)
-{
- struct mx1_camera_dev *pcdev = data;
- struct device *dev = pcdev->icd->parent;
- struct mx1_buffer *buf;
- struct videobuf_buffer *vb;
- unsigned long flags;
-
- spin_lock_irqsave(&pcdev->lock, flags);
-
- imx_dma_disable(channel);
-
- if (unlikely(!pcdev->active)) {
- dev_err(dev, "DMA End IRQ with no active buffer\n");
- goto out;
- }
-
- vb = &pcdev->active->vb;
- buf = container_of(vb, struct mx1_buffer, vb);
- WARN_ON(buf->inwork || list_empty(&vb->queue));
- dev_dbg(dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
- vb, vb->baddr, vb->bsize);
-
- mx1_camera_wakeup(pcdev, vb, buf);
-out:
- spin_unlock_irqrestore(&pcdev->lock, flags);
-}
-
-static struct videobuf_queue_ops mx1_videobuf_ops = {
- .buf_setup = mx1_videobuf_setup,
- .buf_prepare = mx1_videobuf_prepare,
- .buf_queue = mx1_videobuf_queue,
- .buf_release = mx1_videobuf_release,
-};
-
-static void mx1_camera_init_videobuf(struct videobuf_queue *q,
- struct soc_camera_device *icd)
-{
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
- struct mx1_camera_dev *pcdev = ici->priv;
-
- videobuf_queue_dma_contig_init(q, &mx1_videobuf_ops, icd->parent,
- &pcdev->lock, V4L2_BUF_TYPE_VIDEO_CAPTURE,
- V4L2_FIELD_NONE,
- sizeof(struct mx1_buffer), icd, &icd->video_lock);
-}
-
-static int mclk_get_divisor(struct mx1_camera_dev *pcdev)
-{
- unsigned int mclk = pcdev->mclk;
- unsigned long div;
- unsigned long lcdclk;
-
- lcdclk = clk_get_rate(pcdev->clk);
-
- /*
- * We verify platform_mclk_10khz != 0, so if anyone breaks it, here
- * they get a nice Oops
- */
- div = (lcdclk + 2 * mclk - 1) / (2 * mclk) - 1;
-
- dev_dbg(pcdev->icd->parent,
- "System clock %lukHz, target freq %dkHz, divisor %lu\n",
- lcdclk / 1000, mclk / 1000, div);
-
- return div;
-}
-
-static void mx1_camera_activate(struct mx1_camera_dev *pcdev)
-{
- unsigned int csicr1 = CSICR1_EN;
-
- dev_dbg(pcdev->icd->parent, "Activate device\n");
-
- clk_prepare_enable(pcdev->clk);
-
- /* enable CSI before doing anything else */
- __raw_writel(csicr1, pcdev->base + CSICR1);
-
- csicr1 |= CSICR1_MCLKEN | CSICR1_FCC | CSICR1_GCLK_MODE;
- csicr1 |= CSICR1_MCLKDIV(mclk_get_divisor(pcdev));
- csicr1 |= CSICR1_RXFF_LEVEL(2); /* 16 words */
-
- __raw_writel(csicr1, pcdev->base + CSICR1);
-}
-
-static void mx1_camera_deactivate(struct mx1_camera_dev *pcdev)
-{
- dev_dbg(pcdev->icd->parent, "Deactivate device\n");
-
- /* Disable all CSI interface */
- __raw_writel(0x00, pcdev->base + CSICR1);
-
- clk_disable_unprepare(pcdev->clk);
-}
-
-/*
- * The following two functions absolutely depend on the fact, that
- * there can be only one camera on i.MX1/i.MXL camera sensor interface
- */
-static int mx1_camera_add_device(struct soc_camera_device *icd)
-{
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
- struct mx1_camera_dev *pcdev = ici->priv;
-
- if (pcdev->icd)
- return -EBUSY;
-
- dev_info(icd->parent, "MX1 Camera driver attached to camera %d\n",
- icd->devnum);
-
- mx1_camera_activate(pcdev);
-
- pcdev->icd = icd;
-
- return 0;
-}
-
-static void mx1_camera_remove_device(struct soc_camera_device *icd)
-{
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
- struct mx1_camera_dev *pcdev = ici->priv;
- unsigned int csicr1;
-
- BUG_ON(icd != pcdev->icd);
-
- /* disable interrupts */
- csicr1 = __raw_readl(pcdev->base + CSICR1) & ~CSI_IRQ_MASK;
- __raw_writel(csicr1, pcdev->base + CSICR1);
-
- /* Stop DMA engine */
- imx_dma_disable(pcdev->dma_chan);
-
- dev_info(icd->parent, "MX1 Camera driver detached from camera %d\n",
- icd->devnum);
-
- mx1_camera_deactivate(pcdev);
-
- pcdev->icd = NULL;
-}
-
-static int mx1_camera_set_crop(struct soc_camera_device *icd,
- struct v4l2_crop *a)
-{
- struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
-
- return v4l2_subdev_call(sd, video, s_crop, a);
-}
-
-static int mx1_camera_set_bus_param(struct soc_camera_device *icd)
-{
- struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
- struct mx1_camera_dev *pcdev = ici->priv;
- struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,};
- unsigned long common_flags;
- unsigned int csicr1;
- int ret;
-
- /* MX1 supports only 8bit buswidth */
- ret = v4l2_subdev_call(sd, video, g_mbus_config, &cfg);
- if (!ret) {
- common_flags = soc_mbus_config_compatible(&cfg, CSI_BUS_FLAGS);
- if (!common_flags) {
- dev_warn(icd->parent,
- "Flags incompatible: camera 0x%x, host 0x%x\n",
- cfg.flags, CSI_BUS_FLAGS);
- return -EINVAL;
- }
- } else if (ret != -ENOIOCTLCMD) {
- return ret;
- } else {
- common_flags = CSI_BUS_FLAGS;
- }
-
- /* Make choises, based on platform choice */
- if ((common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) &&
- (common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)) {
- if (!pcdev->pdata ||
- pcdev->pdata->flags & MX1_CAMERA_VSYNC_HIGH)
- common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_LOW;
- else
- common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_HIGH;
- }
-
- if ((common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING) &&
- (common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING)) {
- if (!pcdev->pdata ||
- pcdev->pdata->flags & MX1_CAMERA_PCLK_RISING)
- common_flags &= ~V4L2_MBUS_PCLK_SAMPLE_FALLING;
- else
- common_flags &= ~V4L2_MBUS_PCLK_SAMPLE_RISING;
- }
-
- if ((common_flags & V4L2_MBUS_DATA_ACTIVE_HIGH) &&
- (common_flags & V4L2_MBUS_DATA_ACTIVE_LOW)) {
- if (!pcdev->pdata ||
- pcdev->pdata->flags & MX1_CAMERA_DATA_HIGH)
- common_flags &= ~V4L2_MBUS_DATA_ACTIVE_LOW;
- else
- common_flags &= ~V4L2_MBUS_DATA_ACTIVE_HIGH;
- }
-
- cfg.flags = common_flags;
- ret = v4l2_subdev_call(sd, video, s_mbus_config, &cfg);
- if (ret < 0 && ret != -ENOIOCTLCMD) {
- dev_dbg(icd->parent, "camera s_mbus_config(0x%lx) returned %d\n",
- common_flags, ret);
- return ret;
- }
-
- csicr1 = __raw_readl(pcdev->base + CSICR1);
-
- if (common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING)
- csicr1 |= CSICR1_REDGE;
- if (common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH)
- csicr1 |= CSICR1_SOF_POL;
- if (common_flags & V4L2_MBUS_DATA_ACTIVE_LOW)
- csicr1 |= CSICR1_DATA_POL;
-
- __raw_writel(csicr1, pcdev->base + CSICR1);
-
- return 0;
-}
-
-static int mx1_camera_set_fmt(struct soc_camera_device *icd,
- struct v4l2_format *f)
-{
- struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
- const struct soc_camera_format_xlate *xlate;
- struct v4l2_pix_format *pix = &f->fmt.pix;
- struct v4l2_mbus_framefmt mf;
- int ret, buswidth;
-
- xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat);
- if (!xlate) {
- dev_warn(icd->parent, "Format %x not found\n",
- pix->pixelformat);
- return -EINVAL;
- }
-
- buswidth = xlate->host_fmt->bits_per_sample;
- if (buswidth > 8) {
- dev_warn(icd->parent,
- "bits-per-sample %d for format %x unsupported\n",
- buswidth, pix->pixelformat);
- return -EINVAL;
- }
-
- mf.width = pix->width;
- mf.height = pix->height;
- mf.field = pix->field;
- mf.colorspace = pix->colorspace;
- mf.code = xlate->code;
-
- ret = v4l2_subdev_call(sd, video, s_mbus_fmt, &mf);
- if (ret < 0)
- return ret;
-
- if (mf.code != xlate->code)
- return -EINVAL;
-
- pix->width = mf.width;
- pix->height = mf.height;
- pix->field = mf.field;
- pix->colorspace = mf.colorspace;
- icd->current_fmt = xlate;
-
- return ret;
-}
-
-static int mx1_camera_try_fmt(struct soc_camera_device *icd,
- struct v4l2_format *f)
-{
- struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
- const struct soc_camera_format_xlate *xlate;
- struct v4l2_pix_format *pix = &f->fmt.pix;
- struct v4l2_mbus_framefmt mf;
- int ret;
- /* TODO: limit to mx1 hardware capabilities */
-
- xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat);
- if (!xlate) {
- dev_warn(icd->parent, "Format %x not found\n",
- pix->pixelformat);
- return -EINVAL;
- }
-
- mf.width = pix->width;
- mf.height = pix->height;
- mf.field = pix->field;
- mf.colorspace = pix->colorspace;
- mf.code = xlate->code;
-
- /* limit to sensor capabilities */
- ret = v4l2_subdev_call(sd, video, try_mbus_fmt, &mf);
- if (ret < 0)
- return ret;
-
- pix->width = mf.width;
- pix->height = mf.height;
- pix->field = mf.field;
- pix->colorspace = mf.colorspace;
-
- return 0;
-}
-
-static int mx1_camera_reqbufs(struct soc_camera_device *icd,
- struct v4l2_requestbuffers *p)
-{
- int i;
-
- /*
- * This is for locking debugging only. I removed spinlocks and now I
- * check whether .prepare is ever called on a linked buffer, or whether
- * a dma IRQ can occur for an in-work or unlinked buffer. Until now
- * it hadn't triggered
- */
- for (i = 0; i < p->count; i++) {
- struct mx1_buffer *buf = container_of(icd->vb_vidq.bufs[i],
- struct mx1_buffer, vb);
- buf->inwork = 0;
- INIT_LIST_HEAD(&buf->vb.queue);
- }
-
- return 0;
-}
-
-static unsigned int mx1_camera_poll(struct file *file, poll_table *pt)
-{
- struct soc_camera_device *icd = file->private_data;
- struct mx1_buffer *buf;
-
- buf = list_entry(icd->vb_vidq.stream.next, struct mx1_buffer,
- vb.stream);
-
- poll_wait(file, &buf->vb.done, pt);
-
- if (buf->vb.state == VIDEOBUF_DONE ||
- buf->vb.state == VIDEOBUF_ERROR)
- return POLLIN | POLLRDNORM;
-
- return 0;
-}
-
-static int mx1_camera_querycap(struct soc_camera_host *ici,
- struct v4l2_capability *cap)
-{
- /* cap->name is set by the friendly caller:-> */
- strlcpy(cap->card, "i.MX1/i.MXL Camera", sizeof(cap->card));
- cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
-
- return 0;
-}
-
-static struct soc_camera_host_ops mx1_soc_camera_host_ops = {
- .owner = THIS_MODULE,
- .add = mx1_camera_add_device,
- .remove = mx1_camera_remove_device,
- .set_bus_param = mx1_camera_set_bus_param,
- .set_crop = mx1_camera_set_crop,
- .set_fmt = mx1_camera_set_fmt,
- .try_fmt = mx1_camera_try_fmt,
- .init_videobuf = mx1_camera_init_videobuf,
- .reqbufs = mx1_camera_reqbufs,
- .poll = mx1_camera_poll,
- .querycap = mx1_camera_querycap,
-};
-
-static struct fiq_handler fh = {
- .name = "csi_sof"
-};
-
-static int __init mx1_camera_probe(struct platform_device *pdev)
-{
- struct mx1_camera_dev *pcdev;
- struct resource *res;
- struct pt_regs regs;
- struct clk *clk;
- void __iomem *base;
- unsigned int irq;
- int err = 0;
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- irq = platform_get_irq(pdev, 0);
- if (!res || (int)irq <= 0) {
- err = -ENODEV;
- goto exit;
- }
-
- clk = clk_get(&pdev->dev, "csi_clk");
- if (IS_ERR(clk)) {
- err = PTR_ERR(clk);
- goto exit;
- }
-
- pcdev = kzalloc(sizeof(*pcdev), GFP_KERNEL);
- if (!pcdev) {
- dev_err(&pdev->dev, "Could not allocate pcdev\n");
- err = -ENOMEM;
- goto exit_put_clk;
- }
-
- pcdev->res = res;
- pcdev->clk = clk;
-
- pcdev->pdata = pdev->dev.platform_data;
-
- if (pcdev->pdata)
- pcdev->mclk = pcdev->pdata->mclk_10khz * 10000;
-
- if (!pcdev->mclk) {
- dev_warn(&pdev->dev,
- "mclk_10khz == 0! Please, fix your platform data. "
- "Using default 20MHz\n");
- pcdev->mclk = 20000000;
- }
-
- INIT_LIST_HEAD(&pcdev->capture);
- spin_lock_init(&pcdev->lock);
-
- /*
- * Request the regions.
- */
- if (!request_mem_region(res->start, resource_size(res), DRIVER_NAME)) {
- err = -EBUSY;
- goto exit_kfree;
- }
-
- base = ioremap(res->start, resource_size(res));
- if (!base) {
- err = -ENOMEM;
- goto exit_release;
- }
- pcdev->irq = irq;
- pcdev->base = base;
-
- /* request dma */
- pcdev->dma_chan = imx_dma_request_by_prio(DRIVER_NAME, DMA_PRIO_HIGH);
- if (pcdev->dma_chan < 0) {
- dev_err(&pdev->dev, "Can't request DMA for MX1 CSI\n");
- err = -EBUSY;
- goto exit_iounmap;
- }
- dev_dbg(&pdev->dev, "got DMA channel %d\n", pcdev->dma_chan);
-
- imx_dma_setup_handlers(pcdev->dma_chan, mx1_camera_dma_irq, NULL,
- pcdev);
-
- imx_dma_config_channel(pcdev->dma_chan, IMX_DMA_TYPE_FIFO,
- IMX_DMA_MEMSIZE_32, MX1_DMA_REQ_CSI_R, 0);
- /* burst length : 16 words = 64 bytes */
- imx_dma_config_burstlen(pcdev->dma_chan, 0);
-
- /* request irq */
- err = claim_fiq(&fh);
- if (err) {
- dev_err(&pdev->dev, "Camera interrupt register failed \n");
- goto exit_free_dma;
- }
-
- set_fiq_handler(&mx1_camera_sof_fiq_start, &mx1_camera_sof_fiq_end -
- &mx1_camera_sof_fiq_start);
-
- regs.ARM_r8 = (long)MX1_DMA_DIMR;
- regs.ARM_r9 = (long)MX1_DMA_CCR(pcdev->dma_chan);
- regs.ARM_r10 = (long)pcdev->base + CSICR1;
- regs.ARM_fp = (long)pcdev->base + CSISR;
- regs.ARM_sp = 1 << pcdev->dma_chan;
- set_fiq_regs(®s);
-
- mxc_set_irq_fiq(irq, 1);
- enable_fiq(irq);
-
- pcdev->soc_host.drv_name = DRIVER_NAME;
- pcdev->soc_host.ops = &mx1_soc_camera_host_ops;
- pcdev->soc_host.priv = pcdev;
- pcdev->soc_host.v4l2_dev.dev = &pdev->dev;
- pcdev->soc_host.nr = pdev->id;
- err = soc_camera_host_register(&pcdev->soc_host);
- if (err)
- goto exit_free_irq;
-
- dev_info(&pdev->dev, "MX1 Camera driver loaded\n");
-
- return 0;
-
-exit_free_irq:
- disable_fiq(irq);
- mxc_set_irq_fiq(irq, 0);
- release_fiq(&fh);
-exit_free_dma:
- imx_dma_free(pcdev->dma_chan);
-exit_iounmap:
- iounmap(base);
-exit_release:
- release_mem_region(res->start, resource_size(res));
-exit_kfree:
- kfree(pcdev);
-exit_put_clk:
- clk_put(clk);
-exit:
- return err;
-}
-
-static int __exit mx1_camera_remove(struct platform_device *pdev)
-{
- struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev);
- struct mx1_camera_dev *pcdev = container_of(soc_host,
- struct mx1_camera_dev, soc_host);
- struct resource *res;
-
- imx_dma_free(pcdev->dma_chan);
- disable_fiq(pcdev->irq);
- mxc_set_irq_fiq(pcdev->irq, 0);
- release_fiq(&fh);
-
- clk_put(pcdev->clk);
-
- soc_camera_host_unregister(soc_host);
-
- iounmap(pcdev->base);
-
- res = pcdev->res;
- release_mem_region(res->start, resource_size(res));
-
- kfree(pcdev);
-
- dev_info(&pdev->dev, "MX1 Camera driver unloaded\n");
-
- return 0;
-}
-
-static struct platform_driver mx1_camera_driver = {
- .driver = {
- .name = DRIVER_NAME,
- },
- .remove = __exit_p(mx1_camera_remove),
-};
-
-static int __init mx1_camera_init(void)
-{
- return platform_driver_probe(&mx1_camera_driver, mx1_camera_probe);
-}
-
-static void __exit mx1_camera_exit(void)
-{
- return platform_driver_unregister(&mx1_camera_driver);
-}
-
-module_init(mx1_camera_init);
-module_exit(mx1_camera_exit);
-
-MODULE_DESCRIPTION("i.MX1/i.MXL SoC Camera Host driver");
-MODULE_AUTHOR("Paulius Zaleckas <paulius.zaleckas@teltonika.lt>");
-MODULE_LICENSE("GPL v2");
-MODULE_VERSION(DRIVER_VERSION);
-MODULE_ALIAS("platform:" DRIVER_NAME);
diff --git a/include/linux/platform_data/camera-mx1.h b/include/linux/platform_data/camera-mx1.h
deleted file mode 100644
index 4fd6c70..0000000
--- a/include/linux/platform_data/camera-mx1.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * mx1_camera.h - i.MX1/i.MXL camera driver header file
- *
- * Copyright (c) 2008, Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
- * Copyright (C) 2009, Darius Augulis <augulis.darius@gmail.com>
- *
- * Based on PXA camera.h file:
- * Copyright (C) 2003, Intel Corporation
- * Copyright (C) 2008, Guennadi Liakhovetski <kernel@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.
- */
-
-#ifndef __ASM_ARCH_CAMERA_H_
-#define __ASM_ARCH_CAMERA_H_
-
-#define MX1_CAMERA_DATA_HIGH 1
-#define MX1_CAMERA_PCLK_RISING 2
-#define MX1_CAMERA_VSYNC_HIGH 4
-
-extern unsigned char mx1_camera_sof_fiq_start, mx1_camera_sof_fiq_end;
-
-/**
- * struct mx1_camera_pdata - i.MX1/i.MXL camera platform data
- * @mclk_10khz: master clock frequency in 10kHz units
- * @flags: MX1 camera platform flags
- */
-struct mx1_camera_pdata {
- unsigned long mclk_10khz;
- unsigned long flags;
-};
-
-#endif /* __ASM_ARCH_CAMERA_H_ */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 13/34] ARM: imx: remove mach/dma-mx1-mx2.h
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (11 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 12/34] media: mx1_camera: remove the driver Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 14/34] dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h Shawn Guo
` (22 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
The header mach/dma-mx1-mx2.h is used nowhere. Remove it.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
arch/arm/mach-imx/include/mach/dma-mx1-mx2.h | 10 ----------
1 file changed, 10 deletions(-)
delete mode 100644 arch/arm/mach-imx/include/mach/dma-mx1-mx2.h
diff --git a/arch/arm/mach-imx/include/mach/dma-mx1-mx2.h b/arch/arm/mach-imx/include/mach/dma-mx1-mx2.h
deleted file mode 100644
index df5f522..0000000
--- a/arch/arm/mach-imx/include/mach/dma-mx1-mx2.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __MACH_DMA_MX1_MX2_H__
-#define __MACH_DMA_MX1_MX2_H__
-/*
- * Don't use this header in new code, it will go away when all users are
- * converted to mach/dma-v1.h
- */
-
-#include <mach/dma-v1.h>
-
-#endif /* ifndef __MACH_DMA_MX1_MX2_H__ */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 14/34] dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (12 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 13/34] ARM: imx: remove mach/dma-mx1-mx2.h Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 9:26 ` Guennadi Liakhovetski
2012-09-17 5:34 ` [PATCH 15/34] dma: imx-sdma: remove unneeded mach/hardware.h inclusion Shawn Guo
` (21 subsequent siblings)
35 siblings, 1 reply; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
The header ipu.h really belongs to dma subsystem rather than imx
platform. Rename it to ipu-dma.h and put it into include/linux/dma/.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: linux-media at vger.kernel.org
Cc: linux-fbdev at vger.kernel.org
---
drivers/dma/ipu/ipu_idmac.c | 3 +--
drivers/dma/ipu/ipu_irq.c | 3 +--
drivers/media/video/mx3_camera.c | 2 +-
drivers/video/mx3fb.c | 2 +-
.../mach/ipu.h => include/linux/dma/ipu-dma.h | 6 +++---
5 files changed, 7 insertions(+), 9 deletions(-)
rename arch/arm/mach-imx/include/mach/ipu.h => include/linux/dma/ipu-dma.h (97%)
diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c
index c7573e5..6585537 100644
--- a/drivers/dma/ipu/ipu_idmac.c
+++ b/drivers/dma/ipu/ipu_idmac.c
@@ -22,8 +22,7 @@
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
-
-#include <mach/ipu.h>
+#include <linux/dma/ipu-dma.h>
#include "../dmaengine.h"
#include "ipu_intern.h"
diff --git a/drivers/dma/ipu/ipu_irq.c b/drivers/dma/ipu/ipu_irq.c
index fa95bcc..a5ee37d 100644
--- a/drivers/dma/ipu/ipu_irq.c
+++ b/drivers/dma/ipu/ipu_irq.c
@@ -15,8 +15,7 @@
#include <linux/irq.h>
#include <linux/io.h>
#include <linux/module.h>
-
-#include <mach/ipu.h>
+#include <linux/dma/ipu-dma.h>
#include "ipu_intern.h"
diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
index 1481b0d..892cba5 100644
--- a/drivers/media/video/mx3_camera.c
+++ b/drivers/media/video/mx3_camera.c
@@ -17,6 +17,7 @@
#include <linux/vmalloc.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
+#include <linux/dma/ipu-dma.h>
#include <media/v4l2-common.h>
#include <media/v4l2-dev.h>
@@ -24,7 +25,6 @@
#include <media/soc_camera.h>
#include <media/soc_mediabus.h>
-#include <mach/ipu.h>
#include <linux/platform_data/camera-mx3.h>
#include <linux/platform_data/dma-imx.h>
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index d738108..3b63ad8 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -26,10 +26,10 @@
#include <linux/console.h>
#include <linux/clk.h>
#include <linux/mutex.h>
+#include <linux/dma/ipu-dma.h>
#include <linux/platform_data/dma-imx.h>
#include <mach/hardware.h>
-#include <mach/ipu.h>
#include <linux/platform_data/video-mx3fb.h>
#include <asm/io.h>
diff --git a/arch/arm/mach-imx/include/mach/ipu.h b/include/linux/dma/ipu-dma.h
similarity index 97%
rename from arch/arm/mach-imx/include/mach/ipu.h
rename to include/linux/dma/ipu-dma.h
index 539e559..1803111 100644
--- a/arch/arm/mach-imx/include/mach/ipu.h
+++ b/include/linux/dma/ipu-dma.h
@@ -9,8 +9,8 @@
* published by the Free Software Foundation.
*/
-#ifndef _IPU_H_
-#define _IPU_H_
+#ifndef __LINUX_DMA_IPU_DMA_H
+#define __LINUX_DMA_IPU_DMA_H
#include <linux/types.h>
#include <linux/dmaengine.h>
@@ -174,4 +174,4 @@ struct idmac_channel {
#define to_tx_desc(tx) container_of(tx, struct idmac_tx_desc, txd)
#define to_idmac_chan(c) container_of(c, struct idmac_channel, dma_chan)
-#endif
+#endif /* __LINUX_DMA_IPU_DMA_H */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 15/34] dma: imx-sdma: remove unneeded mach/hardware.h inclusion
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (13 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 14/34] dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 16/34] ASoC: imx-ssi: " Shawn Guo
` (20 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
The inclusion of mach/hardware.h is not used in imx-sdma driver at all.
Remove it.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Vinod Koul <vinod.koul@intel.com>
---
drivers/dma/imx-sdma.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 1b781d6..38edf46 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -40,7 +40,6 @@
#include <asm/irq.h>
#include <linux/platform_data/dma-imx-sdma.h>
#include <linux/platform_data/dma-imx.h>
-#include <mach/hardware.h>
#include "dmaengine.h"
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 16/34] ASoC: imx-ssi: remove unneeded mach/hardware.h inclusion
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (14 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 15/34] dma: imx-sdma: remove unneeded mach/hardware.h inclusion Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 11:45 ` Mark Brown
2012-09-17 5:34 ` [PATCH 17/34] usb: ehci-mxc: " Shawn Guo
` (19 subsequent siblings)
35 siblings, 1 reply; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
The inclusion of mach/hardware.h is not used by the driver at all.
Remove it.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel at alsa-project.org
---
sound/soc/fsl/imx-ssi.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
index e6a17ba..1a28f15 100644
--- a/sound/soc/fsl/imx-ssi.c
+++ b/sound/soc/fsl/imx-ssi.c
@@ -48,7 +48,6 @@
#include <sound/soc.h>
#include <linux/platform_data/asoc-imx-ssi.h>
-#include <mach/hardware.h>
#include "imx-ssi.h"
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 17/34] usb: ehci-mxc: remove unneeded mach/hardware.h inclusion
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (15 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 16/34] ASoC: imx-ssi: " Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 11:18 ` Greg Kroah-Hartman
2012-09-17 5:34 ` [PATCH 18/34] video: mx3fb: " Shawn Guo
` (18 subsequent siblings)
35 siblings, 1 reply; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
The inclusion of mach/hardware.h is not used by the driver at all.
Remove it.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb at vger.kernel.org
---
drivers/usb/host/ehci-mxc.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c
index a6e2ea4..e5e9856 100644
--- a/drivers/usb/host/ehci-mxc.c
+++ b/drivers/usb/host/ehci-mxc.c
@@ -24,7 +24,6 @@
#include <linux/usb/ulpi.h>
#include <linux/slab.h>
-#include <mach/hardware.h>
#include <linux/platform_data/usb-ehci-mxc.h>
#include <asm/mach-types.h>
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 18/34] video: mx3fb: remove unneeded mach/hardware.h inclusion
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (16 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 17/34] usb: ehci-mxc: " Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 19/34] watchdog: imx2_wdt: " Shawn Guo
` (17 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
The inclusion of mach/hardware.h is not used by the driver at all.
Remove it.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: linux-fbdev at vger.kernel.org
---
drivers/video/mx3fb.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index 3b63ad8..fc50320 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -29,7 +29,6 @@
#include <linux/dma/ipu-dma.h>
#include <linux/platform_data/dma-imx.h>
-#include <mach/hardware.h>
#include <linux/platform_data/video-mx3fb.h>
#include <asm/io.h>
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 19/34] watchdog: imx2_wdt: remove unneeded mach/hardware.h inclusion
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (17 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 18/34] video: mx3fb: " Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 20/34] i2c: imx: remove " Shawn Guo
` (16 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
The inclusion of mach/hardware.h is not used by the driver at all.
Remove it.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: linux-watchdog at vger.kernel.org
---
drivers/watchdog/imx2_wdt.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c
index bcfab2b..9a45d029 100644
--- a/drivers/watchdog/imx2_wdt.c
+++ b/drivers/watchdog/imx2_wdt.c
@@ -33,7 +33,6 @@
#include <linux/uaccess.h>
#include <linux/timer.h>
#include <linux/jiffies.h>
-#include <mach/hardware.h>
#define DRIVER_NAME "imx2-wdt"
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 20/34] i2c: imx: remove mach/hardware.h inclusion
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (18 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 19/34] watchdog: imx2_wdt: " Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 21/34] mtd: mxc_nand: " Shawn Guo
` (15 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
This is some amount of work left/forgot from device tree conversion.
Instead of checking cpu_is_xxx to determine the controller type, the
driver should use platform_device_id, which should match the device
tree compatible string.
The patch changes the driver to use platform_device_id and of_device_id
rather than cpu_is_xxx to determine the controller type/version for
non-DT and DT probing. It also updates the platform code and device
tree source accordingly.
As the result, mach/hardware.h inclusion gets removed from the driver.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Wolfram Sang <w.sang@pengutronix.de>
Cc: linux-i2c at vger.kernel.org
---
.../devicetree/bindings/i2c/fsl-imx-i2c.txt | 4 +-
arch/arm/boot/dts/imx27.dtsi | 4 +-
arch/arm/boot/dts/imx51.dtsi | 4 +-
arch/arm/boot/dts/imx53.dtsi | 6 +--
arch/arm/boot/dts/imx6q.dtsi | 6 +--
arch/arm/mach-imx/clk-imx1.c | 2 +-
arch/arm/mach-imx/clk-imx21.c | 2 +-
arch/arm/mach-imx/clk-imx25.c | 6 +--
arch/arm/mach-imx/clk-imx27.c | 4 +-
arch/arm/mach-imx/clk-imx31.c | 6 +--
arch/arm/mach-imx/clk-imx35.c | 6 +--
arch/arm/mach-imx/clk-imx51-imx53.c | 8 ++--
arch/arm/mach-imx/devices/devices-common.h | 1 +
arch/arm/mach-imx/devices/platform-imx-i2c.c | 27 ++++++-------
arch/arm/mach-imx/imx27-dt.c | 4 +-
arch/arm/mach-imx/imx51-dt.c | 4 +-
arch/arm/mach-imx/mach-imx53.c | 6 +--
drivers/i2c/busses/i2c-imx.c | 40 +++++++++++++++++---
18 files changed, 86 insertions(+), 54 deletions(-)
diff --git a/Documentation/devicetree/bindings/i2c/fsl-imx-i2c.txt b/Documentation/devicetree/bindings/i2c/fsl-imx-i2c.txt
index f3cf43b..3614242 100644
--- a/Documentation/devicetree/bindings/i2c/fsl-imx-i2c.txt
+++ b/Documentation/devicetree/bindings/i2c/fsl-imx-i2c.txt
@@ -12,13 +12,13 @@ Optional properties:
Examples:
i2c at 83fc4000 { /* I2C2 on i.MX51 */
- compatible = "fsl,imx51-i2c", "fsl,imx1-i2c";
+ compatible = "fsl,imx51-i2c", "fsl,imx21-i2c";
reg = <0x83fc4000 0x4000>;
interrupts = <63>;
};
i2c at 70038000 { /* HS-I2C on i.MX51 */
- compatible = "fsl,imx51-i2c", "fsl,imx1-i2c";
+ compatible = "fsl,imx51-i2c", "fsl,imx21-i2c";
reg = <0x70038000 0x4000>;
interrupts = <64>;
clock-frequency = <400000>;
diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi
index 3e54f14..67d6727 100644
--- a/arch/arm/boot/dts/imx27.dtsi
+++ b/arch/arm/boot/dts/imx27.dtsi
@@ -113,7 +113,7 @@
i2c1: i2c at 10012000 {
#address-cells = <1>;
#size-cells = <0>;
- compatible = "fsl,imx27-i2c", "fsl,imx1-i2c";
+ compatible = "fsl,imx27-i2c", "fsl,imx21-i2c";
reg = <0x10012000 0x1000>;
interrupts = <12>;
status = "disabled";
@@ -205,7 +205,7 @@
i2c2: i2c at 1001d000 {
#address-cells = <1>;
#size-cells = <0>;
- compatible = "fsl,imx27-i2c", "fsl,imx1-i2c";
+ compatible = "fsl,imx27-i2c", "fsl,imx21-i2c";
reg = <0x1001d000 0x1000>;
interrupts = <1>;
status = "disabled";
diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
index 2f71a91..702abcf 100644
--- a/arch/arm/boot/dts/imx51.dtsi
+++ b/arch/arm/boot/dts/imx51.dtsi
@@ -377,7 +377,7 @@
i2c at 83fc4000 { /* I2C2 */
#address-cells = <1>;
#size-cells = <0>;
- compatible = "fsl,imx51-i2c", "fsl,imx1-i2c";
+ compatible = "fsl,imx51-i2c", "fsl,imx21-i2c";
reg = <0x83fc4000 0x4000>;
interrupts = <63>;
status = "disabled";
@@ -386,7 +386,7 @@
i2c at 83fc8000 { /* I2C1 */
#address-cells = <1>;
#size-cells = <0>;
- compatible = "fsl,imx51-i2c", "fsl,imx1-i2c";
+ compatible = "fsl,imx51-i2c", "fsl,imx21-i2c";
reg = <0x83fc8000 0x4000>;
interrupts = <62>;
status = "disabled";
diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
index 221cf33..ec3b8cca 100644
--- a/arch/arm/boot/dts/imx53.dtsi
+++ b/arch/arm/boot/dts/imx53.dtsi
@@ -432,7 +432,7 @@
i2c at 53fec000 { /* I2C3 */
#address-cells = <1>;
#size-cells = <0>;
- compatible = "fsl,imx53-i2c", "fsl,imx1-i2c";
+ compatible = "fsl,imx53-i2c", "fsl,imx21-i2c";
reg = <0x53fec000 0x4000>;
interrupts = <64>;
status = "disabled";
@@ -488,7 +488,7 @@
i2c at 63fc4000 { /* I2C2 */
#address-cells = <1>;
#size-cells = <0>;
- compatible = "fsl,imx53-i2c", "fsl,imx1-i2c";
+ compatible = "fsl,imx53-i2c", "fsl,imx21-i2c";
reg = <0x63fc4000 0x4000>;
interrupts = <63>;
status = "disabled";
@@ -497,7 +497,7 @@
i2c at 63fc8000 { /* I2C1 */
#address-cells = <1>;
#size-cells = <0>;
- compatible = "fsl,imx53-i2c", "fsl,imx1-i2c";
+ compatible = "fsl,imx53-i2c", "fsl,imx21-i2c";
reg = <0x63fc8000 0x4000>;
interrupts = <62>;
status = "disabled";
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
index e45476d..8d62ac1 100644
--- a/arch/arm/boot/dts/imx6q.dtsi
+++ b/arch/arm/boot/dts/imx6q.dtsi
@@ -858,7 +858,7 @@
i2c at 021a0000 { /* I2C1 */
#address-cells = <1>;
#size-cells = <0>;
- compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c";
+ compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
reg = <0x021a0000 0x4000>;
interrupts = <0 36 0x04>;
clocks = <&clks 125>;
@@ -868,7 +868,7 @@
i2c at 021a4000 { /* I2C2 */
#address-cells = <1>;
#size-cells = <0>;
- compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c";
+ compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
reg = <0x021a4000 0x4000>;
interrupts = <0 37 0x04>;
clocks = <&clks 126>;
@@ -878,7 +878,7 @@
i2c at 021a8000 { /* I2C3 */
#address-cells = <1>;
#size-cells = <0>;
- compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c";
+ compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
reg = <0x021a8000 0x4000>;
interrupts = <0 38 0x04>;
clocks = <&clks 127>;
diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
index ebfffd2..1cd1c5b 100644
--- a/arch/arm/mach-imx/clk-imx1.c
+++ b/arch/arm/mach-imx/clk-imx1.c
@@ -94,7 +94,7 @@ int __init mx1_clocks_init(unsigned long fref)
clk_register_clkdev(clk[hclk], "ipg", "imx1-uart.1");
clk_register_clkdev(clk[per1], "per", "imx1-uart.2");
clk_register_clkdev(clk[hclk], "ipg", "imx1-uart.2");
- clk_register_clkdev(clk[hclk], NULL, "imx-i2c.0");
+ clk_register_clkdev(clk[hclk], NULL, "imx1-i2c.0");
clk_register_clkdev(clk[per2], "per", "imx1-cspi.0");
clk_register_clkdev(clk[dummy], "ipg", "imx1-cspi.0");
clk_register_clkdev(clk[per2], "per", "imx1-cspi.1");
diff --git a/arch/arm/mach-imx/clk-imx21.c b/arch/arm/mach-imx/clk-imx21.c
index fbee6a4..09fc31c 100644
--- a/arch/arm/mach-imx/clk-imx21.c
+++ b/arch/arm/mach-imx/clk-imx21.c
@@ -166,7 +166,7 @@ int __init mx21_clocks_init(unsigned long lref, unsigned long href)
clk_register_clkdev(clk[dma_hclk_gate], "ahb", "imx-dma");
clk_register_clkdev(clk[dma_gate], "ipg", "imx-dma");
clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
- clk_register_clkdev(clk[i2c_gate], NULL, "imx-i2c.0");
+ clk_register_clkdev(clk[i2c_gate], NULL, "imx21-i2c.0");
clk_register_clkdev(clk[kpp_gate], NULL, "mxc-keypad");
clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1.0");
clk_register_clkdev(clk[brom_gate], "brom", NULL);
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
index 9841ff9..54edac0 100644
--- a/arch/arm/mach-imx/clk-imx25.c
+++ b/arch/arm/mach-imx/clk-imx25.c
@@ -213,9 +213,9 @@ int __init mx25_clocks_init(void)
clk_register_clkdev(clk[per10], "per", "mxc_pwm.3");
clk_register_clkdev(clk[kpp_ipg], NULL, "imx-keypad");
clk_register_clkdev(clk[tsc_ipg], NULL, "mx25-adc");
- clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx-i2c.0");
- clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx-i2c.1");
- clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx-i2c.2");
+ clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx21-i2c.0");
+ clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx21-i2c.1");
+ clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx21-i2c.2");
clk_register_clkdev(clk[fec_ipg], "ipg", "imx25-fec.0");
clk_register_clkdev(clk[fec_ahb], "ahb", "imx25-fec.0");
clk_register_clkdev(clk[dryice_ipg], NULL, "imxdi_rtc.0");
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index 7b6fd13..d9aac0f 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -247,8 +247,8 @@ int __init mx27_clocks_init(unsigned long fref)
clk_register_clkdev(clk[fec_ipg_gate], "ipg", "imx27-fec.0");
clk_register_clkdev(clk[fec_ahb_gate], "ahb", "imx27-fec.0");
clk_register_clkdev(clk[wdog_ipg_gate], NULL, "imx2-wdt.0");
- clk_register_clkdev(clk[i2c1_ipg_gate], NULL, "imx-i2c.0");
- clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx-i2c.1");
+ clk_register_clkdev(clk[i2c1_ipg_gate], NULL, "imx21-i2c.0");
+ clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx21-i2c.1");
clk_register_clkdev(clk[owire_ipg_gate], NULL, "mxc_w1.0");
clk_register_clkdev(clk[kpp_ipg_gate], NULL, "imx-keypad");
clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "mx2-camera.0");
diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c
index a4c298a..76e6462 100644
--- a/arch/arm/mach-imx/clk-imx31.c
+++ b/arch/arm/mach-imx/clk-imx31.c
@@ -155,9 +155,9 @@ int __init mx31_clocks_init(unsigned long fref)
clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.3");
clk_register_clkdev(clk[uart5_gate], "per", "imx21-uart.4");
clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.4");
- clk_register_clkdev(clk[i2c1_gate], NULL, "imx-i2c.0");
- clk_register_clkdev(clk[i2c2_gate], NULL, "imx-i2c.1");
- clk_register_clkdev(clk[i2c3_gate], NULL, "imx-i2c.2");
+ clk_register_clkdev(clk[i2c1_gate], NULL, "imx21-i2c.0");
+ clk_register_clkdev(clk[i2c2_gate], NULL, "imx21-i2c.1");
+ clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2");
clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1.0");
clk_register_clkdev(clk[sdhc1_gate], NULL, "mxc-mmc.0");
clk_register_clkdev(clk[sdhc2_gate], NULL, "mxc-mmc.1");
diff --git a/arch/arm/mach-imx/clk-imx35.c b/arch/arm/mach-imx/clk-imx35.c
index ba26bf3..ee25812 100644
--- a/arch/arm/mach-imx/clk-imx35.c
+++ b/arch/arm/mach-imx/clk-imx35.c
@@ -226,9 +226,9 @@ int __init mx35_clocks_init()
clk_register_clkdev(clk[fec_gate], NULL, "imx27-fec.0");
clk_register_clkdev(clk[gpt_gate], "per", "imx-gpt.0");
clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0");
- clk_register_clkdev(clk[i2c1_gate], NULL, "imx-i2c.0");
- clk_register_clkdev(clk[i2c2_gate], NULL, "imx-i2c.1");
- clk_register_clkdev(clk[i2c3_gate], NULL, "imx-i2c.2");
+ clk_register_clkdev(clk[i2c1_gate], NULL, "imx21-i2c.0");
+ clk_register_clkdev(clk[i2c2_gate], NULL, "imx21-i2c.1");
+ clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2");
clk_register_clkdev(clk[ipu_gate], NULL, "ipu-core");
clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb");
clk_register_clkdev(clk[kpp_gate], NULL, "imx-keypad");
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
index 0ad4f8f..c8ee7d2 100644
--- a/arch/arm/mach-imx/clk-imx51-imx53.c
+++ b/arch/arm/mach-imx/clk-imx51-imx53.c
@@ -258,8 +258,8 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil,
clk_register_clkdev(clk[cspi_ipg_gate], NULL, "imx35-cspi.2");
clk_register_clkdev(clk[pwm1_ipg_gate], "pwm", "mxc_pwm.0");
clk_register_clkdev(clk[pwm2_ipg_gate], "pwm", "mxc_pwm.1");
- clk_register_clkdev(clk[i2c1_gate], NULL, "imx-i2c.0");
- clk_register_clkdev(clk[i2c2_gate], NULL, "imx-i2c.1");
+ clk_register_clkdev(clk[i2c1_gate], NULL, "imx21-i2c.0");
+ clk_register_clkdev(clk[i2c2_gate], NULL, "imx21-i2c.1");
clk_register_clkdev(clk[usboh3_per_gate], "per", "mxc-ehci.0");
clk_register_clkdev(clk[usboh3_gate], "ipg", "mxc-ehci.0");
clk_register_clkdev(clk[usboh3_gate], "ahb", "mxc-ehci.0");
@@ -345,7 +345,7 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
mx5_clocks_common_init(rate_ckil, rate_osc, rate_ckih1, rate_ckih2);
- clk_register_clkdev(clk[hsi2c_gate], NULL, "imx-i2c.2");
+ clk_register_clkdev(clk[hsi2c_gate], NULL, "imx21-i2c.2");
clk_register_clkdev(clk[mx51_mipi], "mipi_hsp", NULL);
clk_register_clkdev(clk[vpu_gate], NULL, "imx51-vpu.0");
clk_register_clkdev(clk[fec_gate], NULL, "imx27-fec.0");
@@ -439,7 +439,7 @@ int __init mx53_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
mx5_clocks_common_init(rate_ckil, rate_osc, rate_ckih1, rate_ckih2);
clk_register_clkdev(clk[vpu_gate], NULL, "imx53-vpu.0");
- clk_register_clkdev(clk[i2c3_gate], NULL, "imx-i2c.2");
+ clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2");
clk_register_clkdev(clk[fec_gate], NULL, "imx25-fec.0");
clk_register_clkdev(clk[ipu_gate], "bus", "imx53-ipu");
clk_register_clkdev(clk[ipu_di0_gate], "di0", "imx53-ipu");
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
index 34419b2..b0f4747 100644
--- a/arch/arm/mach-imx/devices/devices-common.h
+++ b/arch/arm/mach-imx/devices/devices-common.h
@@ -110,6 +110,7 @@ struct platform_device *__init imx_add_imx_fb(
#include <linux/platform_data/i2c-imx.h>
struct imx_imx_i2c_data {
+ const char *devid;
int id;
resource_size_t iobase;
resource_size_t iosize;
diff --git a/arch/arm/mach-imx/devices/platform-imx-i2c.c b/arch/arm/mach-imx/devices/platform-imx-i2c.c
index e0c7d62..4a701fc 100644
--- a/arch/arm/mach-imx/devices/platform-imx-i2c.c
+++ b/arch/arm/mach-imx/devices/platform-imx-i2c.c
@@ -9,31 +9,32 @@
#include <mach/hardware.h>
#include "devices-common.h"
-#define imx_imx_i2c_data_entry_single(soc, _id, _hwid, _size) \
+#define imx_imx_i2c_data_entry_single(soc, _devid, _id, _hwid, _size) \
{ \
+ .devid = _devid, \
.id = _id, \
.iobase = soc ## _I2C ## _hwid ## _BASE_ADDR, \
.iosize = _size, \
.irq = soc ## _INT_I2C ## _hwid, \
}
-#define imx_imx_i2c_data_entry(soc, _id, _hwid, _size) \
- [_id] = imx_imx_i2c_data_entry_single(soc, _id, _hwid, _size)
+#define imx_imx_i2c_data_entry(soc, _devid, _id, _hwid, _size) \
+ [_id] = imx_imx_i2c_data_entry_single(soc, _devid, _id, _hwid, _size)
#ifdef CONFIG_SOC_IMX1
const struct imx_imx_i2c_data imx1_imx_i2c_data __initconst =
- imx_imx_i2c_data_entry_single(MX1, 0, , SZ_4K);
+ imx_imx_i2c_data_entry_single(MX1, "imx1-i2c", 0, , SZ_4K);
#endif /* ifdef CONFIG_SOC_IMX1 */
#ifdef CONFIG_SOC_IMX21
const struct imx_imx_i2c_data imx21_imx_i2c_data __initconst =
- imx_imx_i2c_data_entry_single(MX21, 0, , SZ_4K);
+ imx_imx_i2c_data_entry_single(MX21, "imx21-i2c", 0, , SZ_4K);
#endif /* ifdef CONFIG_SOC_IMX21 */
#ifdef CONFIG_SOC_IMX25
const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst = {
#define imx25_imx_i2c_data_entry(_id, _hwid) \
- imx_imx_i2c_data_entry(MX25, _id, _hwid, SZ_16K)
+ imx_imx_i2c_data_entry(MX25, "imx21-i2c", _id, _hwid, SZ_16K)
imx25_imx_i2c_data_entry(0, 1),
imx25_imx_i2c_data_entry(1, 2),
imx25_imx_i2c_data_entry(2, 3),
@@ -43,7 +44,7 @@ const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst = {
#ifdef CONFIG_SOC_IMX27
const struct imx_imx_i2c_data imx27_imx_i2c_data[] __initconst = {
#define imx27_imx_i2c_data_entry(_id, _hwid) \
- imx_imx_i2c_data_entry(MX27, _id, _hwid, SZ_4K)
+ imx_imx_i2c_data_entry(MX27, "imx21-i2c", _id, _hwid, SZ_4K)
imx27_imx_i2c_data_entry(0, 1),
imx27_imx_i2c_data_entry(1, 2),
};
@@ -52,7 +53,7 @@ const struct imx_imx_i2c_data imx27_imx_i2c_data[] __initconst = {
#ifdef CONFIG_SOC_IMX31
const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst = {
#define imx31_imx_i2c_data_entry(_id, _hwid) \
- imx_imx_i2c_data_entry(MX31, _id, _hwid, SZ_4K)
+ imx_imx_i2c_data_entry(MX31, "imx21-i2c", _id, _hwid, SZ_4K)
imx31_imx_i2c_data_entry(0, 1),
imx31_imx_i2c_data_entry(1, 2),
imx31_imx_i2c_data_entry(2, 3),
@@ -62,7 +63,7 @@ const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst = {
#ifdef CONFIG_SOC_IMX35
const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst = {
#define imx35_imx_i2c_data_entry(_id, _hwid) \
- imx_imx_i2c_data_entry(MX35, _id, _hwid, SZ_4K)
+ imx_imx_i2c_data_entry(MX35, "imx21-i2c", _id, _hwid, SZ_4K)
imx35_imx_i2c_data_entry(0, 1),
imx35_imx_i2c_data_entry(1, 2),
imx35_imx_i2c_data_entry(2, 3),
@@ -72,7 +73,7 @@ const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst = {
#ifdef CONFIG_SOC_IMX50
const struct imx_imx_i2c_data imx50_imx_i2c_data[] __initconst = {
#define imx50_imx_i2c_data_entry(_id, _hwid) \
- imx_imx_i2c_data_entry(MX50, _id, _hwid, SZ_4K)
+ imx_imx_i2c_data_entry(MX50, "imx21-i2c", _id, _hwid, SZ_4K)
imx50_imx_i2c_data_entry(0, 1),
imx50_imx_i2c_data_entry(1, 2),
imx50_imx_i2c_data_entry(2, 3),
@@ -82,7 +83,7 @@ const struct imx_imx_i2c_data imx50_imx_i2c_data[] __initconst = {
#ifdef CONFIG_SOC_IMX51
const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst = {
#define imx51_imx_i2c_data_entry(_id, _hwid) \
- imx_imx_i2c_data_entry(MX51, _id, _hwid, SZ_4K)
+ imx_imx_i2c_data_entry(MX51, "imx21-i2c", _id, _hwid, SZ_4K)
imx51_imx_i2c_data_entry(0, 1),
imx51_imx_i2c_data_entry(1, 2),
{
@@ -97,7 +98,7 @@ const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst = {
#ifdef CONFIG_SOC_IMX53
const struct imx_imx_i2c_data imx53_imx_i2c_data[] __initconst = {
#define imx53_imx_i2c_data_entry(_id, _hwid) \
- imx_imx_i2c_data_entry(MX53, _id, _hwid, SZ_4K)
+ imx_imx_i2c_data_entry(MX53, "imx21-i2c", _id, _hwid, SZ_4K)
imx53_imx_i2c_data_entry(0, 1),
imx53_imx_i2c_data_entry(1, 2),
imx53_imx_i2c_data_entry(2, 3),
@@ -120,7 +121,7 @@ struct platform_device *__init imx_add_imx_i2c(
},
};
- return imx_add_platform_device("imx-i2c", data->id,
+ return imx_add_platform_device(data->devid, data->id,
res, ARRAY_SIZE(res),
pdata, sizeof(*pdata));
}
diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c
index 83c56fb..43fbf86 100644
--- a/arch/arm/mach-imx/imx27-dt.c
+++ b/arch/arm/mach-imx/imx27-dt.c
@@ -23,8 +23,8 @@ static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = {
OF_DEV_AUXDATA("fsl,imx27-uart", MX27_UART2_BASE_ADDR, "imx21-uart.1", NULL),
OF_DEV_AUXDATA("fsl,imx27-uart", MX27_UART3_BASE_ADDR, "imx21-uart.2", NULL),
OF_DEV_AUXDATA("fsl,imx27-fec", MX27_FEC_BASE_ADDR, "imx27-fec.0", NULL),
- OF_DEV_AUXDATA("fsl,imx27-i2c", MX27_I2C1_BASE_ADDR, "imx-i2c.0", NULL),
- OF_DEV_AUXDATA("fsl,imx27-i2c", MX27_I2C2_BASE_ADDR, "imx-i2c.1", NULL),
+ OF_DEV_AUXDATA("fsl,imx27-i2c", MX27_I2C1_BASE_ADDR, "imx21-i2c.0", NULL),
+ OF_DEV_AUXDATA("fsl,imx27-i2c", MX27_I2C2_BASE_ADDR, "imx21-i2c.1", NULL),
OF_DEV_AUXDATA("fsl,imx27-cspi", MX27_CSPI1_BASE_ADDR, "imx27-cspi.0", NULL),
OF_DEV_AUXDATA("fsl,imx27-cspi", MX27_CSPI2_BASE_ADDR, "imx27-cspi.1", NULL),
OF_DEV_AUXDATA("fsl,imx27-cspi", MX27_CSPI3_BASE_ADDR, "imx27-cspi.2", NULL),
diff --git a/arch/arm/mach-imx/imx51-dt.c b/arch/arm/mach-imx/imx51-dt.c
index e105f12..a0391a1 100644
--- a/arch/arm/mach-imx/imx51-dt.c
+++ b/arch/arm/mach-imx/imx51-dt.c
@@ -37,8 +37,8 @@ static const struct of_dev_auxdata imx51_auxdata_lookup[] __initconst = {
OF_DEV_AUXDATA("fsl,imx51-ecspi", MX51_ECSPI1_BASE_ADDR, "imx51-ecspi.0", NULL),
OF_DEV_AUXDATA("fsl,imx51-ecspi", MX51_ECSPI2_BASE_ADDR, "imx51-ecspi.1", NULL),
OF_DEV_AUXDATA("fsl,imx51-cspi", MX51_CSPI_BASE_ADDR, "imx35-cspi.0", NULL),
- OF_DEV_AUXDATA("fsl,imx51-i2c", MX51_I2C1_BASE_ADDR, "imx-i2c.0", NULL),
- OF_DEV_AUXDATA("fsl,imx51-i2c", MX51_I2C2_BASE_ADDR, "imx-i2c.1", NULL),
+ OF_DEV_AUXDATA("fsl,imx51-i2c", MX51_I2C1_BASE_ADDR, "imx21-i2c.0", NULL),
+ OF_DEV_AUXDATA("fsl,imx51-i2c", MX51_I2C2_BASE_ADDR, "imx21-i2c.1", NULL),
OF_DEV_AUXDATA("fsl,imx51-sdma", MX51_SDMA_BASE_ADDR, "imx35-sdma", NULL),
OF_DEV_AUXDATA("fsl,imx51-wdt", MX51_WDOG1_BASE_ADDR, "imx2-wdt.0", NULL),
{ /* sentinel */ }
diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c
index aaa90a7..0e0aadfb 100644
--- a/arch/arm/mach-imx/mach-imx53.c
+++ b/arch/arm/mach-imx/mach-imx53.c
@@ -43,9 +43,9 @@ static const struct of_dev_auxdata imx53_auxdata_lookup[] __initconst = {
OF_DEV_AUXDATA("fsl,imx53-ecspi", MX53_ECSPI1_BASE_ADDR, "imx51-ecspi.0", NULL),
OF_DEV_AUXDATA("fsl,imx53-ecspi", MX53_ECSPI2_BASE_ADDR, "imx51-ecspi.1", NULL),
OF_DEV_AUXDATA("fsl,imx53-cspi", MX53_CSPI_BASE_ADDR, "imx35-cspi.0", NULL),
- OF_DEV_AUXDATA("fsl,imx53-i2c", MX53_I2C1_BASE_ADDR, "imx-i2c.0", NULL),
- OF_DEV_AUXDATA("fsl,imx53-i2c", MX53_I2C2_BASE_ADDR, "imx-i2c.1", NULL),
- OF_DEV_AUXDATA("fsl,imx53-i2c", MX53_I2C3_BASE_ADDR, "imx-i2c.2", NULL),
+ OF_DEV_AUXDATA("fsl,imx53-i2c", MX53_I2C1_BASE_ADDR, "imx21-i2c.0", NULL),
+ OF_DEV_AUXDATA("fsl,imx53-i2c", MX53_I2C2_BASE_ADDR, "imx21-i2c.1", NULL),
+ OF_DEV_AUXDATA("fsl,imx53-i2c", MX53_I2C3_BASE_ADDR, "imx21-i2c.2", NULL),
OF_DEV_AUXDATA("fsl,imx53-sdma", MX53_SDMA_BASE_ADDR, "imx35-sdma", NULL),
OF_DEV_AUXDATA("fsl,imx53-wdt", MX53_WDOG1_BASE_ADDR, "imx2-wdt.0", NULL),
{ /* sentinel */ }
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index b7907ba7..9f75e52 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -52,8 +52,6 @@
#include <linux/of_device.h>
#include <linux/of_i2c.h>
#include <linux/pinctrl/consumer.h>
-
-#include <mach/hardware.h>
#include <linux/platform_data/i2c-imx.h>
/** Defines ********************************************************************
@@ -115,6 +113,11 @@ static u16 __initdata i2c_clk_div[50][2] = {
{ 3072, 0x1E }, { 3840, 0x1F }
};
+enum imx_i2c_type {
+ IMX1_I2C,
+ IMX21_I2C,
+};
+
struct imx_i2c_struct {
struct i2c_adapter adapter;
struct clk *clk;
@@ -124,13 +127,33 @@ struct imx_i2c_struct {
unsigned int disable_delay;
int stopped;
unsigned int ifdr; /* IMX_I2C_IFDR */
+ enum imx_i2c_type devtype;
+};
+
+static struct platform_device_id imx_i2c_devtype[] = {
+ {
+ .name = "imx1-i2c",
+ .driver_data = IMX1_I2C,
+ }, {
+ .name = "imx21-i2c",
+ .driver_data = IMX21_I2C,
+ }, {
+ /* sentinel */
+ }
};
+MODULE_DEVICE_TABLE(platform, imx_i2c_devtype);
static const struct of_device_id i2c_imx_dt_ids[] = {
- { .compatible = "fsl,imx1-i2c", },
+ { .compatible = "fsl,imx1-i2c", .data = &imx_i2c_devtype[IMX1_I2C], },
+ { .compatible = "fsl,imx21-i2c", .data = &imx_i2c_devtype[IMX21_I2C], },
{ /* sentinel */ }
};
+static inline int is_imx1_i2c(struct imx_i2c_struct *i2c_imx)
+{
+ return i2c_imx->devtype == IMX1_I2C;
+}
+
/** Functions for IMX I2C adapter driver ***************************************
*******************************************************************************/
@@ -223,7 +246,7 @@ static void i2c_imx_stop(struct imx_i2c_struct *i2c_imx)
temp &= ~(I2CR_MSTA | I2CR_MTX);
writeb(temp, i2c_imx->base + IMX_I2C_I2CR);
}
- if (cpu_is_mx1()) {
+ if (is_imx1_i2c(i2c_imx)) {
/*
* This delay caused by an i.MXL hardware bug.
* If no (or too short) delay, no "STOP" bit will be generated.
@@ -465,6 +488,8 @@ static struct i2c_algorithm i2c_imx_algo = {
static int __init i2c_imx_probe(struct platform_device *pdev)
{
+ const struct of_device_id *of_id = of_match_device(i2c_imx_dt_ids,
+ &pdev->dev);
struct imx_i2c_struct *i2c_imx;
struct resource *res;
struct imxi2c_platform_data *pdata = pdev->dev.platform_data;
@@ -497,6 +522,10 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
return -ENOMEM;
}
+ if (of_id)
+ pdev->id_entry = of_id->data;
+ i2c_imx->devtype = pdev->id_entry->driver_data;
+
/* Setup i2c_imx driver structure */
strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name));
i2c_imx->adapter.owner = THIS_MODULE;
@@ -593,7 +622,8 @@ static struct platform_driver i2c_imx_driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = i2c_imx_dt_ids,
- }
+ },
+ .id_table = imx_i2c_devtype,
};
static int __init i2c_adap_imx_init(void)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 21/34] mtd: mxc_nand: remove mach/hardware.h inclusion
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (19 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 20/34] i2c: imx: remove " Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 22/34] rtc: mxc_rtc: " Shawn Guo
` (14 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
It changes the driver to use platform_device_id rather than cpu_is_xxx
to determine the controller type, and updates the platform code
accordingly.
As the result, mach/hardware.h inclusion gets removed from the driver.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: linux-mtd at lists.infradead.org
---
arch/arm/mach-imx/clk-imx21.c | 2 +-
arch/arm/mach-imx/clk-imx25.c | 2 +-
arch/arm/mach-imx/clk-imx27.c | 2 +-
arch/arm/mach-imx/clk-imx31.c | 2 +-
arch/arm/mach-imx/clk-imx35.c | 2 +-
arch/arm/mach-imx/clk-imx51-imx53.c | 2 +-
arch/arm/mach-imx/devices/devices-common.h | 1 +
arch/arm/mach-imx/devices/platform-mxc_nand.c | 20 +++---
arch/arm/mach-imx/imx27-dt.c | 2 +-
drivers/mtd/nand/mxc_nand.c | 86 +++++++++++++++----------
10 files changed, 71 insertions(+), 50 deletions(-)
diff --git a/arch/arm/mach-imx/clk-imx21.c b/arch/arm/mach-imx/clk-imx21.c
index 09fc31c..96a4788 100644
--- a/arch/arm/mach-imx/clk-imx21.c
+++ b/arch/arm/mach-imx/clk-imx21.c
@@ -162,7 +162,7 @@ int __init mx21_clocks_init(unsigned long lref, unsigned long href)
clk_register_clkdev(clk[lcdc_hclk_gate], "ahb", "imx-fb.0");
clk_register_clkdev(clk[usb_gate], "per", "imx21-hcd.0");
clk_register_clkdev(clk[usb_hclk_gate], "ahb", "imx21-hcd.0");
- clk_register_clkdev(clk[nfc_gate], NULL, "mxc_nand.0");
+ clk_register_clkdev(clk[nfc_gate], NULL, "imx21-nand.0");
clk_register_clkdev(clk[dma_hclk_gate], "ahb", "imx-dma");
clk_register_clkdev(clk[dma_gate], "ipg", "imx-dma");
clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
index 54edac0..1aea073 100644
--- a/arch/arm/mach-imx/clk-imx25.c
+++ b/arch/arm/mach-imx/clk-imx25.c
@@ -198,7 +198,7 @@ int __init mx25_clocks_init(void)
clk_register_clkdev(clk[ipg], "ipg", "fsl-usb2-udc");
clk_register_clkdev(clk[usbotg_ahb], "ahb", "fsl-usb2-udc");
clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
- clk_register_clkdev(clk[nfc_ipg_per], NULL, "mxc_nand.0");
+ clk_register_clkdev(clk[nfc_ipg_per], NULL, "imx25-nand.0");
/* i.mx25 has the i.mx35 type cspi */
clk_register_clkdev(clk[cspi1_ipg], NULL, "imx35-cspi.0");
clk_register_clkdev(clk[cspi2_ipg], NULL, "imx35-cspi.1");
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index d9aac0f..6ae2868 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -239,7 +239,7 @@ int __init mx27_clocks_init(unsigned long fref)
clk_register_clkdev(clk[usb_ahb_gate], "ahb", "mxc-ehci.2");
clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "imx-ssi.0");
clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "imx-ssi.1");
- clk_register_clkdev(clk[nfc_baud_gate], NULL, "mxc_nand.0");
+ clk_register_clkdev(clk[nfc_baud_gate], NULL, "imx27-nand.0");
clk_register_clkdev(clk[vpu_baud_gate], "per", "imx-vpu");
clk_register_clkdev(clk[vpu_ahb_gate], "ahb", "imx-vpu");
clk_register_clkdev(clk[dma_ahb_gate], "ahb", "imx-dma");
diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c
index 76e6462..729d1a9 100644
--- a/arch/arm/mach-imx/clk-imx31.c
+++ b/arch/arm/mach-imx/clk-imx31.c
@@ -127,7 +127,7 @@ int __init mx31_clocks_init(unsigned long fref)
clk_register_clkdev(clk[rtc_gate], NULL, "mxc_rtc");
clk_register_clkdev(clk[epit1_gate], "epit", NULL);
clk_register_clkdev(clk[epit2_gate], "epit", NULL);
- clk_register_clkdev(clk[nfc], NULL, "mxc_nand.0");
+ clk_register_clkdev(clk[nfc], NULL, "imx27-nand.0");
clk_register_clkdev(clk[ipu_gate], NULL, "ipu-core");
clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb");
clk_register_clkdev(clk[kpp_gate], NULL, "imx-keypad");
diff --git a/arch/arm/mach-imx/clk-imx35.c b/arch/arm/mach-imx/clk-imx35.c
index ee25812..fec48e6 100644
--- a/arch/arm/mach-imx/clk-imx35.c
+++ b/arch/arm/mach-imx/clk-imx35.c
@@ -256,7 +256,7 @@ int __init mx35_clocks_init()
clk_register_clkdev(clk[ipg], "ipg", "fsl-usb2-udc");
clk_register_clkdev(clk[usbotg_gate], "ahb", "fsl-usb2-udc");
clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
- clk_register_clkdev(clk[nfc_div], NULL, "mxc_nand.0");
+ clk_register_clkdev(clk[nfc_div], NULL, "imx25-nand.0");
clk_register_clkdev(clk[csi_gate], NULL, "mx3-camera.0");
clk_prepare_enable(clk[spba_gate]);
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
index c8ee7d2..22afd5f 100644
--- a/arch/arm/mach-imx/clk-imx51-imx53.c
+++ b/arch/arm/mach-imx/clk-imx51-imx53.c
@@ -272,7 +272,7 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil,
clk_register_clkdev(clk[usboh3_per_gate], "per", "fsl-usb2-udc");
clk_register_clkdev(clk[usboh3_gate], "ipg", "fsl-usb2-udc");
clk_register_clkdev(clk[usboh3_gate], "ahb", "fsl-usb2-udc");
- clk_register_clkdev(clk[nfc_gate], NULL, "mxc_nand");
+ clk_register_clkdev(clk[nfc_gate], NULL, "imx51-nand");
clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "imx-ssi.0");
clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "imx-ssi.1");
clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "imx-ssi.2");
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
index b0f4747..d9717b3 100644
--- a/arch/arm/mach-imx/devices/devices-common.h
+++ b/arch/arm/mach-imx/devices/devices-common.h
@@ -239,6 +239,7 @@ struct platform_device *__init imx_add_mxc_mmc(
#include <linux/platform_data/mtd-mxc_nand.h>
struct imx_mxc_nand_data {
+ const char *devid;
/*
* id is traditionally 0, but -1 is more appropriate. We use -1 for new
* machines but don't change existing devices as the nand device usually
diff --git a/arch/arm/mach-imx/devices/platform-mxc_nand.c b/arch/arm/mach-imx/devices/platform-mxc_nand.c
index eb73b82..cec6961 100644
--- a/arch/arm/mach-imx/devices/platform-mxc_nand.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_nand.c
@@ -10,15 +10,17 @@
#include <mach/hardware.h>
#include "devices-common.h"
-#define imx_mxc_nand_data_entry_single(soc, _size) \
+#define imx_mxc_nand_data_entry_single(soc, _devid, _size) \
{ \
+ .devid = _devid, \
.iobase = soc ## _NFC_BASE_ADDR, \
.iosize = _size, \
.irq = soc ## _INT_NFC \
}
-#define imx_mxc_nandv3_data_entry_single(soc, _size) \
+#define imx_mxc_nandv3_data_entry_single(soc, _devid, _size) \
{ \
+ .devid = _devid, \
.id = -1, \
.iobase = soc ## _NFC_BASE_ADDR, \
.iosize = _size, \
@@ -28,32 +30,32 @@
#ifdef CONFIG_SOC_IMX21
const struct imx_mxc_nand_data imx21_mxc_nand_data __initconst =
- imx_mxc_nand_data_entry_single(MX21, SZ_4K);
+ imx_mxc_nand_data_entry_single(MX21, "imx21-nand", SZ_4K);
#endif /* ifdef CONFIG_SOC_IMX21 */
#ifdef CONFIG_SOC_IMX25
const struct imx_mxc_nand_data imx25_mxc_nand_data __initconst =
- imx_mxc_nand_data_entry_single(MX25, SZ_8K);
+ imx_mxc_nand_data_entry_single(MX25, "imx25-nand", SZ_8K);
#endif /* ifdef CONFIG_SOC_IMX25 */
#ifdef CONFIG_SOC_IMX27
const struct imx_mxc_nand_data imx27_mxc_nand_data __initconst =
- imx_mxc_nand_data_entry_single(MX27, SZ_4K);
+ imx_mxc_nand_data_entry_single(MX27, "imx27-nand", SZ_4K);
#endif /* ifdef CONFIG_SOC_IMX27 */
#ifdef CONFIG_SOC_IMX31
const struct imx_mxc_nand_data imx31_mxc_nand_data __initconst =
- imx_mxc_nand_data_entry_single(MX31, SZ_4K);
+ imx_mxc_nand_data_entry_single(MX31, "imx27-nand", SZ_4K);
#endif
#ifdef CONFIG_SOC_IMX35
const struct imx_mxc_nand_data imx35_mxc_nand_data __initconst =
- imx_mxc_nand_data_entry_single(MX35, SZ_8K);
+ imx_mxc_nand_data_entry_single(MX35, "imx25-nand", SZ_8K);
#endif
#ifdef CONFIG_SOC_IMX51
const struct imx_mxc_nand_data imx51_mxc_nand_data __initconst =
- imx_mxc_nandv3_data_entry_single(MX51, SZ_16K);
+ imx_mxc_nandv3_data_entry_single(MX51, "imx51-nand", SZ_16K);
#endif
struct platform_device *__init imx_add_mxc_nand(
@@ -76,7 +78,7 @@ struct platform_device *__init imx_add_mxc_nand(
.flags = IORESOURCE_IRQ,
},
};
- return imx_add_platform_device("mxc_nand", data->id,
+ return imx_add_platform_device(data->devid, data->id,
res + !data->axibase,
ARRAY_SIZE(res) - !data->axibase,
pdata, sizeof(*pdata));
diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c
index 43fbf86..a6c288e 100644
--- a/arch/arm/mach-imx/imx27-dt.c
+++ b/arch/arm/mach-imx/imx27-dt.c
@@ -29,7 +29,7 @@ static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = {
OF_DEV_AUXDATA("fsl,imx27-cspi", MX27_CSPI2_BASE_ADDR, "imx27-cspi.1", NULL),
OF_DEV_AUXDATA("fsl,imx27-cspi", MX27_CSPI3_BASE_ADDR, "imx27-cspi.2", NULL),
OF_DEV_AUXDATA("fsl,imx27-wdt", MX27_WDOG_BASE_ADDR, "imx2-wdt.0", NULL),
- OF_DEV_AUXDATA("fsl,imx27-nand", MX27_NFC_BASE_ADDR, "mxc_nand.0", NULL),
+ OF_DEV_AUXDATA("fsl,imx27-nand", MX27_NFC_BASE_ADDR, "imx27-nand.0", NULL),
{ /* sentinel */ }
};
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 5683604..d5f8f01 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -37,15 +37,9 @@
#include <asm/mach/flash.h>
#include <linux/platform_data/mtd-mxc_nand.h>
-#include <mach/hardware.h>
#define DRIVER_NAME "mxc_nand"
-#define nfc_is_v21() (cpu_is_mx25() || cpu_is_mx35())
-#define nfc_is_v1() (cpu_is_mx31() || cpu_is_mx27() || cpu_is_mx21())
-#define nfc_is_v3_2() (cpu_is_mx51() || cpu_is_mx53())
-#define nfc_is_v3() nfc_is_v3_2()
-
/* Addresses for NFC registers */
#define NFC_V1_V2_BUF_SIZE (host->regs + 0x00)
#define NFC_V1_V2_BUF_ADDR (host->regs + 0x04)
@@ -1260,6 +1254,45 @@ static const struct mxc_nand_devtype_data imx51_nand_devtype_data = {
.eccsize = 0,
};
+static inline int is_imx21_nfc(struct mxc_nand_host *host)
+{
+ return host->devtype_data == &imx21_nand_devtype_data;
+}
+
+static inline int is_imx27_nfc(struct mxc_nand_host *host)
+{
+ return host->devtype_data == &imx27_nand_devtype_data;
+}
+
+static inline int is_imx25_nfc(struct mxc_nand_host *host)
+{
+ return host->devtype_data == &imx25_nand_devtype_data;
+}
+
+static inline int is_imx51_nfc(struct mxc_nand_host *host)
+{
+ return host->devtype_data == &imx51_nand_devtype_data;
+}
+
+static struct platform_device_id mxcnd_devtype[] = {
+ {
+ .name = "imx21-nand",
+ .driver_data = (kernel_ulong_t) &imx21_nand_devtype_data,
+ }, {
+ .name = "imx27-nand",
+ .driver_data = (kernel_ulong_t) &imx27_nand_devtype_data,
+ }, {
+ .name = "imx25-nand",
+ .driver_data = (kernel_ulong_t) &imx25_nand_devtype_data,
+ }, {
+ .name = "imx51-nand",
+ .driver_data = (kernel_ulong_t) &imx51_nand_devtype_data,
+ }, {
+ /* sentinel */
+ }
+};
+MODULE_DEVICE_TABLE(platform, mxcnd_devtype);
+
#ifdef CONFIG_OF_MTD
static const struct of_device_id mxcnd_dt_ids[] = {
{
@@ -1311,30 +1344,6 @@ static int __init mxcnd_probe_dt(struct mxc_nand_host *host)
}
#endif
-static int __init mxcnd_probe_pdata(struct mxc_nand_host *host)
-{
- struct mxc_nand_platform_data *pdata = host->dev->platform_data;
-
- if (!pdata)
- return -ENODEV;
-
- host->pdata = *pdata;
-
- if (nfc_is_v1()) {
- if (cpu_is_mx21())
- host->devtype_data = &imx21_nand_devtype_data;
- else
- host->devtype_data = &imx27_nand_devtype_data;
- } else if (nfc_is_v21()) {
- host->devtype_data = &imx25_nand_devtype_data;
- } else if (nfc_is_v3_2()) {
- host->devtype_data = &imx51_nand_devtype_data;
- } else
- BUG();
-
- return 0;
-}
-
static int __init mxcnd_probe(struct platform_device *pdev)
{
struct nand_chip *this;
@@ -1396,8 +1405,16 @@ static int __init mxcnd_probe(struct platform_device *pdev)
host->main_area0 = host->base;
err = mxcnd_probe_dt(host);
- if (err > 0)
- err = mxcnd_probe_pdata(host);
+ if (err > 0) {
+ struct mxc_nand_platform_data *pdata = pdev->dev.platform_data;
+ if (pdata) {
+ host->pdata = *pdata;
+ host->devtype_data = (struct mxc_nand_devtype_data *)
+ pdev->id_entry->driver_data;
+ } else {
+ err = -ENODEV;
+ }
+ }
if (err < 0)
goto eirq;
@@ -1473,7 +1490,7 @@ static int __init mxcnd_probe(struct platform_device *pdev)
}
/* first scan to find the device and get the page size */
- if (nand_scan_ident(mtd, nfc_is_v21() ? 4 : 1, NULL)) {
+ if (nand_scan_ident(mtd, is_imx25_nfc(host) ? 4 : 1, NULL)) {
err = -ENXIO;
goto escan;
}
@@ -1487,7 +1504,7 @@ static int __init mxcnd_probe(struct platform_device *pdev)
this->ecc.layout = host->devtype_data->ecclayout_4k;
if (this->ecc.mode == NAND_ECC_HW) {
- if (nfc_is_v1())
+ if (is_imx21_nfc(host) || is_imx27_nfc(host))
this->ecc.strength = 1;
else
this->ecc.strength = (host->eccsize == 4) ? 4 : 8;
@@ -1549,6 +1566,7 @@ static struct platform_driver mxcnd_driver = {
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(mxcnd_dt_ids),
},
+ .id_table = mxcnd_devtype,
.remove = __devexit_p(mxcnd_remove),
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 22/34] rtc: mxc_rtc: remove mach/hardware.h inclusion
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (20 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 21/34] mtd: mxc_nand: " Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 23/34] dma: imx-dma: use devm_kzalloc and devm_request_irq Shawn Guo
` (13 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
It changes the driver to use platform_device_id rather than cpu_is_xxx
to determine the controller type, and updates the platform code
accordingly.
As the result, mach/hardware.h inclusion gets removed from the driver.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: rtc-linux at googlegroups.com
---
arch/arm/mach-imx/clk-imx1.c | 2 +-
arch/arm/mach-imx/clk-imx27.c | 2 +-
arch/arm/mach-imx/clk-imx31.c | 2 +-
arch/arm/mach-imx/devices/devices-common.h | 1 +
arch/arm/mach-imx/devices/platform-mxc_rtc.c | 9 ++++---
drivers/rtc/rtc-mxc.c | 34 +++++++++++++++++++++++---
6 files changed, 40 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
index 1cd1c5b..6b9407b 100644
--- a/arch/arm/mach-imx/clk-imx1.c
+++ b/arch/arm/mach-imx/clk-imx1.c
@@ -105,7 +105,7 @@ int __init mx1_clocks_init(unsigned long fref)
clk_register_clkdev(clk[dummy], "ahb", "imx-fb.0");
clk_register_clkdev(clk[hclk], "mshc", NULL);
clk_register_clkdev(clk[per3], "ssi", NULL);
- clk_register_clkdev(clk[clk32], NULL, "mxc_rtc.0");
+ clk_register_clkdev(clk[clk32], NULL, "imx1-rtc.0");
clk_register_clkdev(clk[clko], "clko", NULL);
mxc_timer_init(MX1_IO_ADDRESS(MX1_TIM1_BASE_ADDR), MX1_TIM1_INT);
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index 6ae2868..5ff5cf0 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -259,7 +259,7 @@ int __init mx27_clocks_init(unsigned long fref)
clk_register_clkdev(clk[gpio_ipg_gate], "gpio", NULL);
clk_register_clkdev(clk[brom_ahb_gate], "brom", NULL);
clk_register_clkdev(clk[ata_ahb_gate], "ata", NULL);
- clk_register_clkdev(clk[rtc_ipg_gate], NULL, "mxc_rtc");
+ clk_register_clkdev(clk[rtc_ipg_gate], NULL, "imx21-rtc");
clk_register_clkdev(clk[scc_ipg_gate], "scc", NULL);
clk_register_clkdev(clk[cpu_div], "cpu", NULL);
clk_register_clkdev(clk[emi_ahb_gate], "emi_ahb" , NULL);
diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c
index 729d1a9..d9ff16e 100644
--- a/arch/arm/mach-imx/clk-imx31.c
+++ b/arch/arm/mach-imx/clk-imx31.c
@@ -124,7 +124,7 @@ int __init mx31_clocks_init(unsigned long fref)
clk_register_clkdev(clk[cspi3_gate], NULL, "imx31-cspi.2");
clk_register_clkdev(clk[pwm_gate], "pwm", NULL);
clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
- clk_register_clkdev(clk[rtc_gate], NULL, "mxc_rtc");
+ clk_register_clkdev(clk[rtc_gate], NULL, "imx21-rtc");
clk_register_clkdev(clk[epit1_gate], "epit", NULL);
clk_register_clkdev(clk[epit2_gate], "epit", NULL);
clk_register_clkdev(clk[nfc], NULL, "imx27-nand.0");
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
index d9717b3..73ae524 100644
--- a/arch/arm/mach-imx/devices/devices-common.h
+++ b/arch/arm/mach-imx/devices/devices-common.h
@@ -274,6 +274,7 @@ struct platform_device *__init imx_add_mxc_pwm(
/* mxc_rtc */
struct imx_mxc_rtc_data {
+ const char *devid;
resource_size_t iobase;
resource_size_t irq;
};
diff --git a/arch/arm/mach-imx/devices/platform-mxc_rtc.c b/arch/arm/mach-imx/devices/platform-mxc_rtc.c
index daaf979..f35f848 100644
--- a/arch/arm/mach-imx/devices/platform-mxc_rtc.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_rtc.c
@@ -9,20 +9,21 @@
#include <mach/hardware.h>
#include "devices-common.h"
-#define imx_mxc_rtc_data_entry_single(soc) \
+#define imx_mxc_rtc_data_entry_single(soc, _devid) \
{ \
+ .devid = _devid, \
.iobase = soc ## _RTC_BASE_ADDR, \
.irq = soc ## _INT_RTC, \
}
#ifdef CONFIG_SOC_IMX31
const struct imx_mxc_rtc_data imx31_mxc_rtc_data __initconst =
- imx_mxc_rtc_data_entry_single(MX31);
+ imx_mxc_rtc_data_entry_single(MX31, "imx21-rtc");
#endif /* ifdef CONFIG_SOC_IMX31 */
#ifdef CONFIG_SOC_IMX35
const struct imx_mxc_rtc_data imx35_mxc_rtc_data __initconst =
- imx_mxc_rtc_data_entry_single(MX35);
+ imx_mxc_rtc_data_entry_single(MX35, "imx21-rtc");
#endif /* ifdef CONFIG_SOC_IMX35 */
struct platform_device *__init imx_add_mxc_rtc(
@@ -40,6 +41,6 @@ struct platform_device *__init imx_add_mxc_rtc(
},
};
- return imx_add_platform_device("mxc_rtc", -1,
+ return imx_add_platform_device(data->devid, -1,
res, ARRAY_SIZE(res), NULL, 0);
}
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index e3e50d6..aa81c32 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -17,8 +17,6 @@
#include <linux/platform_device.h>
#include <linux/clk.h>
-#include <mach/hardware.h>
-
#define RTC_INPUT_CLK_32768HZ (0x00 << 5)
#define RTC_INPUT_CLK_32000HZ (0x01 << 5)
#define RTC_INPUT_CLK_38400HZ (0x02 << 5)
@@ -72,14 +70,38 @@ static const u32 PIE_BIT_DEF[MAX_PIE_NUM][2] = {
#define RTC_TEST2 0x2C /* 32bit rtc test reg 2 */
#define RTC_TEST3 0x30 /* 32bit rtc test reg 3 */
+enum imx_rtc_type {
+ IMX1_RTC,
+ IMX21_RTC,
+};
+
struct rtc_plat_data {
struct rtc_device *rtc;
void __iomem *ioaddr;
int irq;
struct clk *clk;
struct rtc_time g_rtc_alarm;
+ enum imx_rtc_type devtype;
};
+static struct platform_device_id imx_rtc_devtype[] = {
+ {
+ .name = "imx1-rtc",
+ .driver_data = IMX1_RTC,
+ }, {
+ .name = "imx21-rtc",
+ .driver_data = IMX21_RTC,
+ }, {
+ /* sentinel */
+ }
+};
+MODULE_DEVICE_TABLE(platform, imx_rtc_devtype);
+
+static inline int is_imx1_rtc(struct rtc_plat_data *data)
+{
+ return data->devtype == IMX1_RTC;
+}
+
/*
* This function is used to obtain the RTC time or the alarm value in
* second.
@@ -278,10 +300,13 @@ static int mxc_rtc_read_time(struct device *dev, struct rtc_time *tm)
*/
static int mxc_rtc_set_mmss(struct device *dev, unsigned long time)
{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
+
/*
* TTC_DAYR register is 9-bit in MX1 SoC, save time and day of year only
*/
- if (cpu_is_mx1()) {
+ if (is_imx1_rtc(pdata)) {
struct rtc_time tm;
rtc_time_to_tm(time, &tm);
@@ -360,6 +385,8 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
if (!pdata)
return -ENOMEM;
+ pdata->devtype = pdev->id_entry->driver_data;
+
if (!devm_request_mem_region(&pdev->dev, res->start,
resource_size(res), pdev->name))
return -EBUSY;
@@ -482,6 +509,7 @@ static struct platform_driver mxc_rtc_driver = {
#endif
.owner = THIS_MODULE,
},
+ .id_table = imx_rtc_devtype,
.remove = __exit_p(mxc_rtc_remove),
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 23/34] dma: imx-dma: use devm_kzalloc and devm_request_irq
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (21 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 22/34] rtc: mxc_rtc: " Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 24/34] dma: imx-dma: retrieve MEM and IRQ from resources Shawn Guo
` (12 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
Use managed functions devm_kzalloc and devm_request_irq instead to
make the error patch simpler.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Vinod Koul <vinod.koul@linux.intel.com>
---
drivers/dma/imx-dma.c | 54 ++++++++++++++-----------------------------------
1 file changed, 15 insertions(+), 39 deletions(-)
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index b90aaec..64ba65b 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -962,7 +962,7 @@ static int __init imxdma_probe(struct platform_device *pdev)
int ret, i;
- imxdma = kzalloc(sizeof(*imxdma), GFP_KERNEL);
+ imxdma = devm_kzalloc(&pdev->dev, sizeof(*imxdma), GFP_KERNEL);
if (!imxdma)
return -ENOMEM;
@@ -978,16 +978,12 @@ static int __init imxdma_probe(struct platform_device *pdev)
}
imxdma->dma_ipg = devm_clk_get(&pdev->dev, "ipg");
- if (IS_ERR(imxdma->dma_ipg)) {
- ret = PTR_ERR(imxdma->dma_ipg);
- goto err_clk;
- }
+ if (IS_ERR(imxdma->dma_ipg))
+ return PTR_ERR(imxdma->dma_ipg);
imxdma->dma_ahb = devm_clk_get(&pdev->dev, "ahb");
- if (IS_ERR(imxdma->dma_ahb)) {
- ret = PTR_ERR(imxdma->dma_ahb);
- goto err_clk;
- }
+ if (IS_ERR(imxdma->dma_ahb))
+ return PTR_ERR(imxdma->dma_ahb);
clk_prepare_enable(imxdma->dma_ipg);
clk_prepare_enable(imxdma->dma_ahb);
@@ -996,17 +992,18 @@ static int __init imxdma_probe(struct platform_device *pdev)
imx_dmav1_writel(imxdma, DCR_DRST, DMA_DCR);
if (cpu_is_mx1()) {
- ret = request_irq(MX1_DMA_INT, dma_irq_handler, 0, "DMA", imxdma);
+ ret = devm_request_irq(&pdev->dev, MX1_DMA_INT,
+ dma_irq_handler, 0, "DMA", imxdma);
if (ret) {
dev_warn(imxdma->dev, "Can't register IRQ for DMA\n");
- goto err_enable;
+ goto err;
}
- ret = request_irq(MX1_DMA_ERR, imxdma_err_handler, 0, "DMA", imxdma);
+ ret = devm_request_irq(&pdev->dev, MX1_DMA_ERR,
+ imxdma_err_handler, 0, "DMA", imxdma);
if (ret) {
dev_warn(imxdma->dev, "Can't register ERRIRQ for DMA\n");
- free_irq(MX1_DMA_INT, NULL);
- goto err_enable;
+ goto err;
}
}
@@ -1037,13 +1034,13 @@ static int __init imxdma_probe(struct platform_device *pdev)
struct imxdma_channel *imxdmac = &imxdma->channel[i];
if (cpu_is_mx21() || cpu_is_mx27()) {
- ret = request_irq(MX2x_INT_DMACH0 + i,
+ ret = devm_request_irq(&pdev->dev, MX2x_INT_DMACH0 + i,
dma_irq_handler, 0, "DMA", imxdma);
if (ret) {
dev_warn(imxdma->dev, "Can't register IRQ %d "
"for DMA channel %d\n",
MX2x_INT_DMACH0 + i, i);
- goto err_init;
+ goto err;
}
init_timer(&imxdmac->watchdog);
imxdmac->watchdog.function = &imxdma_watchdog;
@@ -1089,46 +1086,25 @@ static int __init imxdma_probe(struct platform_device *pdev)
ret = dma_async_device_register(&imxdma->dma_device);
if (ret) {
dev_err(&pdev->dev, "unable to register\n");
- goto err_init;
+ goto err;
}
return 0;
-err_init:
-
- if (cpu_is_mx21() || cpu_is_mx27()) {
- while (--i >= 0)
- free_irq(MX2x_INT_DMACH0 + i, NULL);
- } else if cpu_is_mx1() {
- free_irq(MX1_DMA_INT, NULL);
- free_irq(MX1_DMA_ERR, NULL);
- }
-err_enable:
+err:
clk_disable_unprepare(imxdma->dma_ipg);
clk_disable_unprepare(imxdma->dma_ahb);
-err_clk:
- kfree(imxdma);
return ret;
}
static int __exit imxdma_remove(struct platform_device *pdev)
{
struct imxdma_engine *imxdma = platform_get_drvdata(pdev);
- int i;
dma_async_device_unregister(&imxdma->dma_device);
- if (cpu_is_mx21() || cpu_is_mx27()) {
- for (i = 0; i < IMX_DMA_CHANNELS; i++)
- free_irq(MX2x_INT_DMACH0 + i, NULL);
- } else if cpu_is_mx1() {
- free_irq(MX1_DMA_INT, NULL);
- free_irq(MX1_DMA_ERR, NULL);
- }
-
clk_disable_unprepare(imxdma->dma_ipg);
clk_disable_unprepare(imxdma->dma_ahb);
- kfree(imxdma);
return 0;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 24/34] dma: imx-dma: retrieve MEM and IRQ from resources
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (22 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 23/34] dma: imx-dma: use devm_kzalloc and devm_request_irq Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 25/34] dma: imx-dma: remove mach/hardware.h inclusion Shawn Guo
` (11 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
Retrieve MEM and IRQ from resources rather than directly using the
value by including machine header.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Vinod Koul <vinod.koul@linux.intel.com>
---
arch/arm/mach-imx/devices/devices-common.h | 3 ++-
arch/arm/mach-imx/devices/platform-imx-dma.c | 21 ++++++++++++++--
arch/arm/mach-imx/mm-imx1.c | 2 ++
arch/arm/mach-imx/mm-imx21.c | 2 +-
arch/arm/mach-imx/mm-imx27.c | 2 +-
drivers/dma/imx-dma.c | 35 +++++++++++++++-----------
6 files changed, 45 insertions(+), 20 deletions(-)
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
index 73ae524..a330159 100644
--- a/arch/arm/mach-imx/devices/devices-common.h
+++ b/arch/arm/mach-imx/devices/devices-common.h
@@ -311,7 +311,8 @@ struct platform_device *__init imx_add_spi_imx(
const struct imx_spi_imx_data *data,
const struct spi_imx_master *pdata);
-struct platform_device *imx_add_imx_dma(void);
+struct platform_device *imx_add_imx_dma(resource_size_t iobase,
+ int irq, int irq_err);
struct platform_device *imx_add_imx_sdma(char *name,
resource_size_t iobase, int irq, struct sdma_platform_data *pdata);
diff --git a/arch/arm/mach-imx/devices/platform-imx-dma.c b/arch/arm/mach-imx/devices/platform-imx-dma.c
index c35c99d..f9003e4 100644
--- a/arch/arm/mach-imx/devices/platform-imx-dma.c
+++ b/arch/arm/mach-imx/devices/platform-imx-dma.c
@@ -8,10 +8,27 @@
*/
#include "devices-common.h"
-struct platform_device __init __maybe_unused *imx_add_imx_dma(void)
+struct platform_device __init __maybe_unused *imx_add_imx_dma(
+ resource_size_t iobase, int irq, int irq_err)
{
+ struct resource res[] = {
+ {
+ .start = iobase,
+ .end = iobase + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ }, {
+ .start = irq,
+ .end = irq,
+ .flags = IORESOURCE_IRQ,
+ }, {
+ .start = irq_err,
+ .end = irq_err,
+ .flags = IORESOURCE_IRQ,
+ },
+ };
+
return platform_device_register_resndata(&mxc_ahb_bus,
- "imx-dma", -1, NULL, 0, NULL, 0);
+ "imx-dma", -1, res, ARRAY_SIZE(res), NULL, 0);
}
struct platform_device __init __maybe_unused *imx_add_imx_sdma(char *name,
diff --git a/arch/arm/mach-imx/mm-imx1.c b/arch/arm/mach-imx/mm-imx1.c
index 118aa92..9de81bf 100644
--- a/arch/arm/mach-imx/mm-imx1.c
+++ b/arch/arm/mach-imx/mm-imx1.c
@@ -25,6 +25,7 @@
#include <mach/hardware.h>
#include "common.h"
+#include "devices/devices-common.h"
#include "iomux-v1.h"
static struct map_desc imx_io_desc[] __initdata = {
@@ -59,5 +60,6 @@ void __init imx1_soc_init(void)
MX1_GPIO_INT_PORTC, 0);
mxc_register_gpio("imx1-gpio", 3, MX1_GPIO4_BASE_ADDR, SZ_256,
MX1_GPIO_INT_PORTD, 0);
+ imx_add_imx_dma(MX1_DMA_BASE_ADDR, MX1_DMA_INT, MX1_DMA_ERR);
pinctrl_provide_dummies();
}
diff --git a/arch/arm/mach-imx/mm-imx21.c b/arch/arm/mach-imx/mm-imx21.c
index 0c24556..1c29515 100644
--- a/arch/arm/mach-imx/mm-imx21.c
+++ b/arch/arm/mach-imx/mm-imx21.c
@@ -90,7 +90,7 @@ void __init imx21_soc_init(void)
mxc_register_gpio("imx21-gpio", 5, MX21_GPIO6_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
pinctrl_provide_dummies();
- imx_add_imx_dma();
+ imx_add_imx_dma(MX21_DMA_BASE_ADDR, MX21_INT_DMACH0, 0); /* No ERR irq */
platform_device_register_simple("imx21-audmux", 0, imx21_audmux_res,
ARRAY_SIZE(imx21_audmux_res));
}
diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c
index 3241314..d389f4a 100644
--- a/arch/arm/mach-imx/mm-imx27.c
+++ b/arch/arm/mach-imx/mm-imx27.c
@@ -91,7 +91,7 @@ void __init imx27_soc_init(void)
mxc_register_gpio("imx21-gpio", 5, MX27_GPIO6_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0);
pinctrl_provide_dummies();
- imx_add_imx_dma();
+ imx_add_imx_dma(MX27_DMA_BASE_ADDR, MX27_INT_DMACH0, 0); /* No ERR irq */
/* imx27 has the imx21 type audmux */
platform_device_register_simple("imx21-audmux", 0, imx27_audmux_res,
ARRAY_SIZE(imx27_audmux_res));
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index 64ba65b..a947ce2 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -959,23 +959,22 @@ static void imxdma_issue_pending(struct dma_chan *chan)
static int __init imxdma_probe(struct platform_device *pdev)
{
struct imxdma_engine *imxdma;
+ struct resource *res;
int ret, i;
-
+ int irq, irq_err;
imxdma = devm_kzalloc(&pdev->dev, sizeof(*imxdma), GFP_KERNEL);
if (!imxdma)
return -ENOMEM;
- if (cpu_is_mx1()) {
- imxdma->base = MX1_IO_ADDRESS(MX1_DMA_BASE_ADDR);
- } else if (cpu_is_mx21()) {
- imxdma->base = MX21_IO_ADDRESS(MX21_DMA_BASE_ADDR);
- } else if (cpu_is_mx27()) {
- imxdma->base = MX27_IO_ADDRESS(MX27_DMA_BASE_ADDR);
- } else {
- kfree(imxdma);
- return 0;
- }
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ imxdma->base = devm_request_and_ioremap(&pdev->dev, res);
+ if (!imxdma->base)
+ return -EADDRNOTAVAIL;
+
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ return irq;
imxdma->dma_ipg = devm_clk_get(&pdev->dev, "ipg");
if (IS_ERR(imxdma->dma_ipg))
@@ -992,14 +991,20 @@ static int __init imxdma_probe(struct platform_device *pdev)
imx_dmav1_writel(imxdma, DCR_DRST, DMA_DCR);
if (cpu_is_mx1()) {
- ret = devm_request_irq(&pdev->dev, MX1_DMA_INT,
+ ret = devm_request_irq(&pdev->dev, irq,
dma_irq_handler, 0, "DMA", imxdma);
if (ret) {
dev_warn(imxdma->dev, "Can't register IRQ for DMA\n");
goto err;
}
- ret = devm_request_irq(&pdev->dev, MX1_DMA_ERR,
+ irq_err = platform_get_irq(pdev, 1);
+ if (irq_err < 0) {
+ ret = irq_err;
+ goto err;
+ }
+
+ ret = devm_request_irq(&pdev->dev, irq_err,
imxdma_err_handler, 0, "DMA", imxdma);
if (ret) {
dev_warn(imxdma->dev, "Can't register ERRIRQ for DMA\n");
@@ -1034,12 +1039,12 @@ static int __init imxdma_probe(struct platform_device *pdev)
struct imxdma_channel *imxdmac = &imxdma->channel[i];
if (cpu_is_mx21() || cpu_is_mx27()) {
- ret = devm_request_irq(&pdev->dev, MX2x_INT_DMACH0 + i,
+ ret = devm_request_irq(&pdev->dev, irq + i,
dma_irq_handler, 0, "DMA", imxdma);
if (ret) {
dev_warn(imxdma->dev, "Can't register IRQ %d "
"for DMA channel %d\n",
- MX2x_INT_DMACH0 + i, i);
+ irq + i, i);
goto err;
}
init_timer(&imxdmac->watchdog);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 25/34] dma: imx-dma: remove mach/hardware.h inclusion
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (23 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 24/34] dma: imx-dma: retrieve MEM and IRQ from resources Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 7:58 ` Sascha Hauer
2012-09-17 5:34 ` [PATCH 26/34] media: mx2_camera: remove dead code in mx2_camera_add_device Shawn Guo
` (10 subsequent siblings)
35 siblings, 1 reply; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
It changes the driver to use platform_device_id rather than cpu_is_xxx
to determine the controller type, and updates the platform code
accordingly.
As the result, mach/hardware.h inclusion gets removed from the driver.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Vinod Koul <vinod.koul@linux.intel.com>
---
arch/arm/mach-imx/devices/devices-common.h | 2 +-
arch/arm/mach-imx/devices/platform-imx-dma.c | 4 +-
arch/arm/mach-imx/mm-imx1.c | 3 +-
arch/arm/mach-imx/mm-imx21.c | 3 +-
arch/arm/mach-imx/mm-imx27.c | 3 +-
drivers/dma/imx-dma.c | 54 +++++++++++++++++++++++---
6 files changed, 57 insertions(+), 12 deletions(-)
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
index a330159..7f2698c 100644
--- a/arch/arm/mach-imx/devices/devices-common.h
+++ b/arch/arm/mach-imx/devices/devices-common.h
@@ -311,7 +311,7 @@ struct platform_device *__init imx_add_spi_imx(
const struct imx_spi_imx_data *data,
const struct spi_imx_master *pdata);
-struct platform_device *imx_add_imx_dma(resource_size_t iobase,
+struct platform_device *imx_add_imx_dma(char *name, resource_size_t iobase,
int irq, int irq_err);
struct platform_device *imx_add_imx_sdma(char *name,
resource_size_t iobase, int irq, struct sdma_platform_data *pdata);
diff --git a/arch/arm/mach-imx/devices/platform-imx-dma.c b/arch/arm/mach-imx/devices/platform-imx-dma.c
index f9003e4..ccdb5dc 100644
--- a/arch/arm/mach-imx/devices/platform-imx-dma.c
+++ b/arch/arm/mach-imx/devices/platform-imx-dma.c
@@ -8,7 +8,7 @@
*/
#include "devices-common.h"
-struct platform_device __init __maybe_unused *imx_add_imx_dma(
+struct platform_device __init __maybe_unused *imx_add_imx_dma(char *name,
resource_size_t iobase, int irq, int irq_err)
{
struct resource res[] = {
@@ -28,7 +28,7 @@ struct platform_device __init __maybe_unused *imx_add_imx_dma(
};
return platform_device_register_resndata(&mxc_ahb_bus,
- "imx-dma", -1, res, ARRAY_SIZE(res), NULL, 0);
+ name, -1, res, ARRAY_SIZE(res), NULL, 0);
}
struct platform_device __init __maybe_unused *imx_add_imx_sdma(char *name,
diff --git a/arch/arm/mach-imx/mm-imx1.c b/arch/arm/mach-imx/mm-imx1.c
index 9de81bf..79f6c0b 100644
--- a/arch/arm/mach-imx/mm-imx1.c
+++ b/arch/arm/mach-imx/mm-imx1.c
@@ -60,6 +60,7 @@ void __init imx1_soc_init(void)
MX1_GPIO_INT_PORTC, 0);
mxc_register_gpio("imx1-gpio", 3, MX1_GPIO4_BASE_ADDR, SZ_256,
MX1_GPIO_INT_PORTD, 0);
- imx_add_imx_dma(MX1_DMA_BASE_ADDR, MX1_DMA_INT, MX1_DMA_ERR);
+ imx_add_imx_dma("imx1-dma", MX1_DMA_BASE_ADDR,
+ MX1_DMA_INT, MX1_DMA_ERR);
pinctrl_provide_dummies();
}
diff --git a/arch/arm/mach-imx/mm-imx21.c b/arch/arm/mach-imx/mm-imx21.c
index 1c29515..3b97ea6 100644
--- a/arch/arm/mach-imx/mm-imx21.c
+++ b/arch/arm/mach-imx/mm-imx21.c
@@ -90,7 +90,8 @@ void __init imx21_soc_init(void)
mxc_register_gpio("imx21-gpio", 5, MX21_GPIO6_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
pinctrl_provide_dummies();
- imx_add_imx_dma(MX21_DMA_BASE_ADDR, MX21_INT_DMACH0, 0); /* No ERR irq */
+ imx_add_imx_dma("imx21-dma", MX21_DMA_BASE_ADDR,
+ MX21_INT_DMACH0, 0); /* No ERR irq */
platform_device_register_simple("imx21-audmux", 0, imx21_audmux_res,
ARRAY_SIZE(imx21_audmux_res));
}
diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c
index d389f4a..91e8da8 100644
--- a/arch/arm/mach-imx/mm-imx27.c
+++ b/arch/arm/mach-imx/mm-imx27.c
@@ -91,7 +91,8 @@ void __init imx27_soc_init(void)
mxc_register_gpio("imx21-gpio", 5, MX27_GPIO6_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0);
pinctrl_provide_dummies();
- imx_add_imx_dma(MX27_DMA_BASE_ADDR, MX27_INT_DMACH0, 0); /* No ERR irq */
+ imx_add_imx_dma("imx27-dma", MX27_DMA_BASE_ADDR,
+ MX27_INT_DMACH0, 0); /* No ERR irq */
/* imx27 has the imx21 type audmux */
platform_device_register_simple("imx21-audmux", 0, imx27_audmux_res,
ARRAY_SIZE(imx27_audmux_res));
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index a947ce2..960c88b 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -29,7 +29,6 @@
#include <asm/irq.h>
#include <linux/platform_data/dma-imx.h>
-#include <mach/hardware.h>
#include "dmaengine.h"
#define IMXDMA_MAX_CHAN_DESCRIPTORS 16
@@ -167,6 +166,12 @@ struct imxdma_channel {
int slot_2d;
};
+enum imx_dma_type {
+ IMX1_DMA,
+ IMX21_DMA,
+ IMX27_DMA,
+};
+
struct imxdma_engine {
struct device *dev;
struct device_dma_parameters dma_parms;
@@ -177,8 +182,40 @@ struct imxdma_engine {
spinlock_t lock;
struct imx_dma_2d_config slots_2d[IMX_DMA_2D_SLOTS];
struct imxdma_channel channel[IMX_DMA_CHANNELS];
+ enum imx_dma_type devtype;
};
+static struct platform_device_id imx_dma_devtype[] = {
+ {
+ .name = "imx1-dma",
+ .driver_data = IMX1_DMA,
+ }, {
+ .name = "imx21-dma",
+ .driver_data = IMX21_DMA,
+ }, {
+ .name = "imx27-dma",
+ .driver_data = IMX27_DMA,
+ }, {
+ /* sentinel */
+ }
+};
+MODULE_DEVICE_TABLE(platform, imx_dma_devtype);
+
+static inline int is_imx1_dma(struct imxdma_engine *imxdma)
+{
+ return imxdma->devtype == IMX1_DMA;
+}
+
+static inline int is_imx21_dma(struct imxdma_engine *imxdma)
+{
+ return imxdma->devtype == IMX21_DMA;
+}
+
+static inline int is_imx27_dma(struct imxdma_engine *imxdma)
+{
+ return imxdma->devtype == IMX27_DMA;
+}
+
static struct imxdma_channel *to_imxdma_chan(struct dma_chan *chan)
{
return container_of(chan, struct imxdma_channel, chan);
@@ -212,7 +249,9 @@ static unsigned imx_dmav1_readl(struct imxdma_engine *imxdma, unsigned offset)
static int imxdma_hw_chain(struct imxdma_channel *imxdmac)
{
- if (cpu_is_mx27())
+ struct imxdma_engine *imxdma = imxdmac->imxdma;
+
+ if (is_imx27_dma(imxdma))
return imxdmac->hw_chaining;
else
return 0;
@@ -267,7 +306,7 @@ static void imxdma_enable_hw(struct imxdma_desc *d)
imx_dmav1_writel(imxdma, imx_dmav1_readl(imxdma, DMA_CCR(channel)) |
CCR_CEN | CCR_ACRPT, DMA_CCR(channel));
- if ((cpu_is_mx21() || cpu_is_mx27()) &&
+ if (!is_imx1_dma(imxdma) &&
d->sg && imxdma_hw_chain(imxdmac)) {
d->sg = sg_next(d->sg);
if (d->sg) {
@@ -436,7 +475,7 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id)
struct imxdma_engine *imxdma = dev_id;
int i, disr;
- if (cpu_is_mx21() || cpu_is_mx27())
+ if (!is_imx1_dma(imxdma))
imxdma_err_handler(irq, dev_id);
disr = imx_dmav1_readl(imxdma, DMA_DISR);
@@ -967,6 +1006,8 @@ static int __init imxdma_probe(struct platform_device *pdev)
if (!imxdma)
return -ENOMEM;
+ imxdma->devtype = pdev->id_entry->driver_data;
+
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
imxdma->base = devm_request_and_ioremap(&pdev->dev, res);
if (!imxdma->base)
@@ -990,7 +1031,7 @@ static int __init imxdma_probe(struct platform_device *pdev)
/* reset DMA module */
imx_dmav1_writel(imxdma, DCR_DRST, DMA_DCR);
- if (cpu_is_mx1()) {
+ if (is_imx1_dma(imxdma)) {
ret = devm_request_irq(&pdev->dev, irq,
dma_irq_handler, 0, "DMA", imxdma);
if (ret) {
@@ -1038,7 +1079,7 @@ static int __init imxdma_probe(struct platform_device *pdev)
for (i = 0; i < IMX_DMA_CHANNELS; i++) {
struct imxdma_channel *imxdmac = &imxdma->channel[i];
- if (cpu_is_mx21() || cpu_is_mx27()) {
+ if (!is_imx1_dma(imxdma)) {
ret = devm_request_irq(&pdev->dev, irq + i,
dma_irq_handler, 0, "DMA", imxdma);
if (ret) {
@@ -1118,6 +1159,7 @@ static struct platform_driver imxdma_driver = {
.driver = {
.name = "imx-dma",
},
+ .id_table = imx_dma_devtype,
.remove = __exit_p(imxdma_remove),
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 26/34] media: mx2_camera: remove dead code in mx2_camera_add_device
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (24 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 25/34] dma: imx-dma: remove mach/hardware.h inclusion Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 8:18 ` Guennadi Liakhovetski
2012-09-17 5:34 ` [PATCH 27/34] media: mx2_camera: use managed functions to clean up code Shawn Guo
` (9 subsequent siblings)
35 siblings, 1 reply; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
This is a piece of code becoming dead since commit 2c9ba37 ([media]
V4L: mx2_camera: remove unsupported i.MX27 DMA mode, make EMMA
mandatory). It should have been removed together with the commit.
Remove it now.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-media at vger.kernel.org
---
drivers/media/video/mx2_camera.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
index 965427f..89c7e28 100644
--- a/drivers/media/video/mx2_camera.c
+++ b/drivers/media/video/mx2_camera.c
@@ -441,11 +441,9 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
csicr1 = CSICR1_MCLKEN;
- if (cpu_is_mx27()) {
+ if (cpu_is_mx27())
csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
CSICR1_RXFF_LEVEL(0);
- } else if (cpu_is_mx27())
- csicr1 |= CSICR1_SOF_INTEN | CSICR1_RXFF_LEVEL(2);
pcdev->csicr1 = csicr1;
writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 27/34] media: mx2_camera: use managed functions to clean up code
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (25 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 26/34] media: mx2_camera: remove dead code in mx2_camera_add_device Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 9:11 ` Guennadi Liakhovetski
2012-09-17 5:34 ` [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion Shawn Guo
` (8 subsequent siblings)
35 siblings, 1 reply; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
Use managed functions to clean up the error handling code and function
mx2_camera_remove(). Along with the change, a few variables get removed
from struct mx2_camera_dev.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-media at vger.kernel.org
---
drivers/media/video/mx2_camera.c | 143 +++++++++++---------------------------
1 file changed, 39 insertions(+), 104 deletions(-)
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
index 89c7e28..fe4c76c 100644
--- a/drivers/media/video/mx2_camera.c
+++ b/drivers/media/video/mx2_camera.c
@@ -274,12 +274,9 @@ struct mx2_camera_dev {
struct soc_camera_device *icd;
struct clk *clk_csi, *clk_emma_ahb, *clk_emma_ipg;
- unsigned int irq_csi, irq_emma;
void __iomem *base_csi, *base_emma;
- unsigned long base_dma;
struct mx2_camera_platform_data *pdata;
- struct resource *res_csi, *res_emma;
unsigned long platform_flags;
struct list_head capture;
@@ -1607,64 +1604,59 @@ static irqreturn_t mx27_camera_emma_irq(int irq_emma, void *data)
return IRQ_HANDLED;
}
-static int __devinit mx27_camera_emma_init(struct mx2_camera_dev *pcdev)
+static int __devinit mx27_camera_emma_init(struct platform_device *pdev)
{
- struct resource *res_emma = pcdev->res_emma;
+ struct mx2_camera_dev *pcdev = platform_get_drvdata(pdev);
+ struct resource *res_emma;
+ int irq_emma;
int err = 0;
- if (!request_mem_region(res_emma->start, resource_size(res_emma),
- MX2_CAM_DRV_NAME)) {
- err = -EBUSY;
+ res_emma = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+ irq_emma = platform_get_irq(pdev, 1);
+ if (!res_emma || !irq_emma) {
+ dev_err(pcdev->dev, "no EMMA resources\n");
goto out;
}
- pcdev->base_emma = ioremap(res_emma->start, resource_size(res_emma));
+ pcdev->base_emma = devm_request_and_ioremap(pcdev->dev, res_emma);
if (!pcdev->base_emma) {
- err = -ENOMEM;
- goto exit_release;
+ err = -EADDRNOTAVAIL;
+ goto out;
}
- err = request_irq(pcdev->irq_emma, mx27_camera_emma_irq, 0,
- MX2_CAM_DRV_NAME, pcdev);
+ err = devm_request_irq(pcdev->dev, irq_emma, mx27_camera_emma_irq, 0,
+ MX2_CAM_DRV_NAME, pcdev);
if (err) {
dev_err(pcdev->dev, "Camera EMMA interrupt register failed \n");
- goto exit_iounmap;
+ goto out;
}
- pcdev->clk_emma_ipg = clk_get(pcdev->dev, "emma-ipg");
+ pcdev->clk_emma_ipg = devm_clk_get(pcdev->dev, "emma-ipg");
if (IS_ERR(pcdev->clk_emma_ipg)) {
err = PTR_ERR(pcdev->clk_emma_ipg);
- goto exit_free_irq;
+ goto out;
}
clk_prepare_enable(pcdev->clk_emma_ipg);
- pcdev->clk_emma_ahb = clk_get(pcdev->dev, "emma-ahb");
+ pcdev->clk_emma_ahb = devm_clk_get(pcdev->dev, "emma-ahb");
if (IS_ERR(pcdev->clk_emma_ahb)) {
err = PTR_ERR(pcdev->clk_emma_ahb);
- goto exit_clk_emma_ipg_put;
+ goto exit_clk_emma_ipg;
}
clk_prepare_enable(pcdev->clk_emma_ahb);
err = mx27_camera_emma_prp_reset(pcdev);
if (err)
- goto exit_clk_emma_ahb_put;
+ goto exit_clk_emma_ahb;
return err;
-exit_clk_emma_ahb_put:
+exit_clk_emma_ahb:
clk_disable_unprepare(pcdev->clk_emma_ahb);
- clk_put(pcdev->clk_emma_ahb);
-exit_clk_emma_ipg_put:
+exit_clk_emma_ipg:
clk_disable_unprepare(pcdev->clk_emma_ipg);
- clk_put(pcdev->clk_emma_ipg);
-exit_free_irq:
- free_irq(pcdev->irq_emma, pcdev);
-exit_iounmap:
- iounmap(pcdev->base_emma);
-exit_release:
- release_mem_region(res_emma->start, resource_size(res_emma));
out:
return err;
}
@@ -1672,9 +1664,8 @@ out:
static int __devinit mx2_camera_probe(struct platform_device *pdev)
{
struct mx2_camera_dev *pcdev;
- struct resource *res_csi, *res_emma;
- void __iomem *base_csi;
- int irq_csi, irq_emma;
+ struct resource *res_csi;
+ int irq_csi;
int err = 0;
dev_dbg(&pdev->dev, "initialising\n");
@@ -1687,21 +1678,20 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
goto exit;
}
- pcdev = kzalloc(sizeof(*pcdev), GFP_KERNEL);
+ pcdev = devm_kzalloc(&pdev->dev, sizeof(*pcdev), GFP_KERNEL);
if (!pcdev) {
dev_err(&pdev->dev, "Could not allocate pcdev\n");
err = -ENOMEM;
goto exit;
}
- pcdev->clk_csi = clk_get(&pdev->dev, "ahb");
+ pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
if (IS_ERR(pcdev->clk_csi)) {
dev_err(&pdev->dev, "Could not get csi clock\n");
err = PTR_ERR(pcdev->clk_csi);
- goto exit_kfree;
+ goto exit;
}
- pcdev->res_csi = res_csi;
pcdev->pdata = pdev->dev.platform_data;
if (pcdev->pdata) {
long rate;
@@ -1711,11 +1701,11 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
rate = clk_round_rate(pcdev->clk_csi, pcdev->pdata->clk * 2);
if (rate <= 0) {
err = -ENODEV;
- goto exit_dma_free;
+ goto exit;
}
err = clk_set_rate(pcdev->clk_csi, rate);
if (err < 0)
- goto exit_dma_free;
+ goto exit;
}
INIT_LIST_HEAD(&pcdev->capture);
@@ -1723,48 +1713,28 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&pcdev->discard);
spin_lock_init(&pcdev->lock);
- /*
- * Request the regions.
- */
- if (!request_mem_region(res_csi->start, resource_size(res_csi),
- MX2_CAM_DRV_NAME)) {
- err = -EBUSY;
- goto exit_dma_free;
+ pcdev->base_csi = devm_request_and_ioremap(&pdev->dev, res_csi);
+ if (!pcdev->base_csi) {
+ err = -EADDRNOTAVAIL;
+ goto exit;
}
- base_csi = ioremap(res_csi->start, resource_size(res_csi));
- if (!base_csi) {
- err = -ENOMEM;
- goto exit_release;
- }
- pcdev->irq_csi = irq_csi;
- pcdev->base_csi = base_csi;
- pcdev->base_dma = res_csi->start;
pcdev->dev = &pdev->dev;
+ platform_set_drvdata(pdev, pcdev);
if (cpu_is_mx25()) {
- err = request_irq(pcdev->irq_csi, mx25_camera_irq, 0,
- MX2_CAM_DRV_NAME, pcdev);
+ err = devm_request_irq(&pdev->dev, irq_csi, mx25_camera_irq, 0,
+ MX2_CAM_DRV_NAME, pcdev);
if (err) {
dev_err(pcdev->dev, "Camera interrupt register failed \n");
- goto exit_iounmap;
+ goto exit;
}
}
if (cpu_is_mx27()) {
- /* EMMA support */
- res_emma = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- irq_emma = platform_get_irq(pdev, 1);
-
- if (!res_emma || !irq_emma) {
- dev_err(&pdev->dev, "no EMMA resources\n");
- goto exit_free_irq;
- }
-
- pcdev->res_emma = res_emma;
- pcdev->irq_emma = irq_emma;
- if (mx27_camera_emma_init(pcdev))
- goto exit_free_irq;
+ err = mx27_camera_emma_init(pdev);
+ if (err)
+ goto exit;
}
pcdev->soc_host.drv_name = MX2_CAM_DRV_NAME,
@@ -1793,25 +1763,9 @@ exit_free_emma:
vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
eallocctx:
if (cpu_is_mx27()) {
- free_irq(pcdev->irq_emma, pcdev);
clk_disable_unprepare(pcdev->clk_emma_ipg);
- clk_put(pcdev->clk_emma_ipg);
clk_disable_unprepare(pcdev->clk_emma_ahb);
- clk_put(pcdev->clk_emma_ahb);
- iounmap(pcdev->base_emma);
- release_mem_region(pcdev->res_emma->start, resource_size(pcdev->res_emma));
}
-exit_free_irq:
- if (cpu_is_mx25())
- free_irq(pcdev->irq_csi, pcdev);
-exit_iounmap:
- iounmap(base_csi);
-exit_release:
- release_mem_region(res_csi->start, resource_size(res_csi));
-exit_dma_free:
- clk_put(pcdev->clk_csi);
-exit_kfree:
- kfree(pcdev);
exit:
return err;
}
@@ -1821,35 +1775,16 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev);
struct mx2_camera_dev *pcdev = container_of(soc_host,
struct mx2_camera_dev, soc_host);
- struct resource *res;
-
- clk_put(pcdev->clk_csi);
- if (cpu_is_mx25())
- free_irq(pcdev->irq_csi, pcdev);
- if (cpu_is_mx27())
- free_irq(pcdev->irq_emma, pcdev);
soc_camera_host_unregister(&pcdev->soc_host);
vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
- iounmap(pcdev->base_csi);
-
if (cpu_is_mx27()) {
clk_disable_unprepare(pcdev->clk_emma_ipg);
- clk_put(pcdev->clk_emma_ipg);
clk_disable_unprepare(pcdev->clk_emma_ahb);
- clk_put(pcdev->clk_emma_ahb);
- iounmap(pcdev->base_emma);
- res = pcdev->res_emma;
- release_mem_region(res->start, resource_size(res));
}
- res = pcdev->res_csi;
- release_mem_region(res->start, resource_size(res));
-
- kfree(pcdev);
-
dev_info(&pdev->dev, "MX2 Camera driver unloaded\n");
return 0;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (26 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 27/34] media: mx2_camera: use managed functions to clean up code Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 9:21 ` Guennadi Liakhovetski
2012-09-17 5:34 ` [PATCH 29/34] mmc: mxcmmc: " Shawn Guo
` (7 subsequent siblings)
35 siblings, 1 reply; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
It changes the driver to use platform_device_id rather than cpu_is_xxx
to determine the controller type, and updates the platform code
accordingly.
As the result, mach/hardware.h inclusion gets removed from the driver.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-media at vger.kernel.org
---
arch/arm/mach-imx/clk-imx25.c | 6 +-
arch/arm/mach-imx/clk-imx27.c | 6 +-
arch/arm/mach-imx/devices/devices-common.h | 1 +
arch/arm/mach-imx/devices/platform-mx2-camera.c | 12 +--
drivers/media/video/mx2_camera.c | 95 +++++++++++++++++------
5 files changed, 85 insertions(+), 35 deletions(-)
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
index 1aea073..71fe521 100644
--- a/arch/arm/mach-imx/clk-imx25.c
+++ b/arch/arm/mach-imx/clk-imx25.c
@@ -231,9 +231,9 @@ int __init mx25_clocks_init(void)
clk_register_clkdev(clk[esdhc2_ipg_per], "per", "sdhci-esdhc-imx25.1");
clk_register_clkdev(clk[esdhc2_ipg], "ipg", "sdhci-esdhc-imx25.1");
clk_register_clkdev(clk[esdhc2_ahb], "ahb", "sdhci-esdhc-imx25.1");
- clk_register_clkdev(clk[csi_ipg_per], "per", "mx2-camera.0");
- clk_register_clkdev(clk[csi_ipg], "ipg", "mx2-camera.0");
- clk_register_clkdev(clk[csi_ahb], "ahb", "mx2-camera.0");
+ clk_register_clkdev(clk[csi_ipg_per], "per", "imx25-camera.0");
+ clk_register_clkdev(clk[csi_ipg], "ipg", "imx25-camera.0");
+ clk_register_clkdev(clk[csi_ahb], "ahb", "imx25-camera.0");
clk_register_clkdev(clk[dummy], "audmux", NULL);
clk_register_clkdev(clk[can1_ipg], NULL, "flexcan.0");
clk_register_clkdev(clk[can2_ipg], NULL, "flexcan.1");
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index 5ff5cf0..e26de52 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -224,7 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
clk_register_clkdev(clk[per3_gate], "per", "imx-fb.0");
clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
- clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
+ clk_register_clkdev(clk[csi_ahb_gate], "ahb", "imx27-camera.0");
clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
@@ -251,8 +251,8 @@ int __init mx27_clocks_init(unsigned long fref)
clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx21-i2c.1");
clk_register_clkdev(clk[owire_ipg_gate], NULL, "mxc_w1.0");
clk_register_clkdev(clk[kpp_ipg_gate], NULL, "imx-keypad");
- clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "mx2-camera.0");
- clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "mx2-camera.0");
+ clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "imx27-camera.0");
+ clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "imx27-camera.0");
clk_register_clkdev(clk[emma_ahb_gate], "ahb", "m2m-emmaprp.0");
clk_register_clkdev(clk[emma_ipg_gate], "ipg", "m2m-emmaprp.0");
clk_register_clkdev(clk[iim_ipg_gate], "iim", NULL);
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
index 7f2698c..8112a1a 100644
--- a/arch/arm/mach-imx/devices/devices-common.h
+++ b/arch/arm/mach-imx/devices/devices-common.h
@@ -202,6 +202,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
#include <linux/platform_data/camera-mx2.h>
struct imx_mx2_camera_data {
+ const char *devid;
resource_size_t iobasecsi;
resource_size_t iosizecsi;
resource_size_t irqcsi;
diff --git a/arch/arm/mach-imx/devices/platform-mx2-camera.c b/arch/arm/mach-imx/devices/platform-mx2-camera.c
index 9ad5b2d..b88877d 100644
--- a/arch/arm/mach-imx/devices/platform-mx2-camera.c
+++ b/arch/arm/mach-imx/devices/platform-mx2-camera.c
@@ -9,14 +9,16 @@
#include <mach/hardware.h>
#include "devices-common.h"
-#define imx_mx2_camera_data_entry_single(soc) \
+#define imx_mx2_camera_data_entry_single(soc, _devid) \
{ \
+ .devid = _devid, \
.iobasecsi = soc ## _CSI_BASE_ADDR, \
.iosizecsi = SZ_4K, \
.irqcsi = soc ## _INT_CSI, \
}
-#define imx_mx2_camera_data_entry_single_emma(soc) \
+#define imx_mx2_camera_data_entry_single_emma(soc, _devid) \
{ \
+ .devid = _devid, \
.iobasecsi = soc ## _CSI_BASE_ADDR, \
.iosizecsi = SZ_32, \
.irqcsi = soc ## _INT_CSI, \
@@ -27,12 +29,12 @@
#ifdef CONFIG_SOC_IMX25
const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst =
- imx_mx2_camera_data_entry_single(MX25);
+ imx_mx2_camera_data_entry_single(MX25, "imx25-camera");
#endif /* ifdef CONFIG_SOC_IMX25 */
#ifdef CONFIG_SOC_IMX27
const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst =
- imx_mx2_camera_data_entry_single_emma(MX27);
+ imx_mx2_camera_data_entry_single_emma(MX27, "imx27-camera");
#endif /* ifdef CONFIG_SOC_IMX27 */
struct platform_device *__init imx_add_mx2_camera(
@@ -58,7 +60,7 @@ struct platform_device *__init imx_add_mx2_camera(
.flags = IORESOURCE_IRQ,
},
};
- return imx_add_platform_device_dmamask("mx2-camera", 0,
+ return imx_add_platform_device_dmamask(data->devid, 0,
res, data->iobaseemmaprp ? 4 : 2,
pdata, sizeof(*pdata), DMA_BIT_MASK(32));
}
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
index fe4c76c..cde3374 100644
--- a/drivers/media/video/mx2_camera.c
+++ b/drivers/media/video/mx2_camera.c
@@ -41,7 +41,6 @@
#include <linux/videodev2.h>
#include <linux/platform_data/camera-mx2.h>
-#include <mach/hardware.h>
#include <asm/dma.h>
@@ -121,11 +120,13 @@
#define CSICR1 0x00
#define CSICR2 0x04
-#define CSISR (cpu_is_mx27() ? 0x08 : 0x18)
+#define CSISR_IMX25 0x18
+#define CSISR_IMX27 0x08
#define CSISTATFIFO 0x0c
#define CSIRFIFO 0x10
#define CSIRXCNT 0x14
-#define CSICR3 (cpu_is_mx27() ? 0x1C : 0x08)
+#define CSICR3_IMX25 0x08
+#define CSICR3_IMX27 0x1c
#define CSIDMASA_STATFIFO 0x20
#define CSIDMATA_STATFIFO 0x24
#define CSIDMASA_FB1 0x28
@@ -268,6 +269,11 @@ struct mx2_buffer {
struct mx2_buf_internal internal;
};
+enum mx2_camera_type {
+ IMX25_CAMERA,
+ IMX27_CAMERA,
+};
+
struct mx2_camera_dev {
struct device *dev;
struct soc_camera_host soc_host;
@@ -291,6 +297,9 @@ struct mx2_camera_dev {
struct mx2_buffer *fb2_active;
u32 csicr1;
+ u32 reg_csisr;
+ u32 reg_csicr3;
+ enum mx2_camera_type devtype;
struct mx2_buf_internal buf_discard[2];
void *discard_buffer;
@@ -303,6 +312,29 @@ struct mx2_camera_dev {
struct vb2_alloc_ctx *alloc_ctx;
};
+static struct platform_device_id mx2_camera_devtype[] = {
+ {
+ .name = "imx25-camera",
+ .driver_data = IMX25_CAMERA,
+ }, {
+ .name = "imx27-camera",
+ .driver_data = IMX27_CAMERA,
+ }, {
+ /* sentinel */
+ }
+};
+MODULE_DEVICE_TABLE(platform, mx2_camera_devtype);
+
+static inline int is_imx25_camera(struct mx2_camera_dev *pcdev)
+{
+ return pcdev->devtype == IMX25_CAMERA;
+}
+
+static inline int is_imx27_camera(struct mx2_camera_dev *pcdev)
+{
+ return pcdev->devtype == IMX27_CAMERA;
+}
+
static struct mx2_buffer *mx2_ibuf_to_buf(struct mx2_buf_internal *int_buf)
{
return container_of(int_buf, struct mx2_buffer, internal);
@@ -406,9 +438,9 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
clk_disable_unprepare(pcdev->clk_csi);
writel(0, pcdev->base_csi + CSICR1);
- if (cpu_is_mx27()) {
+ if (is_imx27_camera(pcdev)) {
writel(0, pcdev->base_emma + PRP_CNTL);
- } else if (cpu_is_mx25()) {
+ } else if (is_imx25_camera(pcdev)) {
spin_lock_irqsave(&pcdev->lock, flags);
pcdev->fb1_active = NULL;
pcdev->fb2_active = NULL;
@@ -438,7 +470,7 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
csicr1 = CSICR1_MCLKEN;
- if (cpu_is_mx27())
+ if (is_imx27_camera(pcdev))
csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
CSICR1_RXFF_LEVEL(0);
@@ -514,7 +546,7 @@ out:
static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
{
struct mx2_camera_dev *pcdev = data;
- u32 status = readl(pcdev->base_csi + CSISR);
+ u32 status = readl(pcdev->base_csi + pcdev->reg_csisr);
if (status & CSISR_DMA_TSF_FB1_INT)
mx25_camera_frame_done(pcdev, 1, MX2_STATE_DONE);
@@ -523,7 +555,7 @@ static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
/* FIXME: handle CSISR_RFF_OR_INT */
- writel(status, pcdev->base_csi + CSISR);
+ writel(status, pcdev->base_csi + pcdev->reg_csisr);
return IRQ_HANDLED;
}
@@ -608,7 +640,7 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
buf->state = MX2_STATE_QUEUED;
list_add_tail(&buf->internal.queue, &pcdev->capture);
- if (cpu_is_mx25()) {
+ if (is_imx25_camera(pcdev)) {
u32 csicr3, dma_inten = 0;
if (pcdev->fb1_active == NULL) {
@@ -627,20 +659,20 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
list_del(&buf->internal.queue);
buf->state = MX2_STATE_ACTIVE;
- csicr3 = readl(pcdev->base_csi + CSICR3);
+ csicr3 = readl(pcdev->base_csi + pcdev->reg_csicr3);
/* Reflash DMA */
writel(csicr3 | CSICR3_DMA_REFLASH_RFF,
- pcdev->base_csi + CSICR3);
+ pcdev->base_csi + pcdev->reg_csicr3);
/* clear & enable interrupts */
- writel(dma_inten, pcdev->base_csi + CSISR);
+ writel(dma_inten, pcdev->base_csi + pcdev->reg_csisr);
pcdev->csicr1 |= dma_inten;
writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
/* enable DMA */
csicr3 |= CSICR3_DMA_REQ_EN_RFF | CSICR3_RXFF_LEVEL(1);
- writel(csicr3, pcdev->base_csi + CSICR3);
+ writel(csicr3, pcdev->base_csi + pcdev->reg_csicr3);
}
}
@@ -684,7 +716,7 @@ static void mx2_videobuf_release(struct vb2_buffer *vb)
*/
spin_lock_irqsave(&pcdev->lock, flags);
- if (cpu_is_mx25() && buf->state == MX2_STATE_ACTIVE) {
+ if (is_imx25_camera(pcdev) && buf->state == MX2_STATE_ACTIVE) {
if (pcdev->fb1_active == buf) {
pcdev->csicr1 &= ~CSICR1_FB1_DMA_INTEN;
writel(0, pcdev->base_csi + CSIDMASA_FB1);
@@ -807,7 +839,7 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count)
unsigned long phys;
int bytesperline;
- if (cpu_is_mx27()) {
+ if (is_imx27_camera(pcdev)) {
unsigned long flags;
if (count < 2)
return -EINVAL;
@@ -902,7 +934,7 @@ static int mx2_stop_streaming(struct vb2_queue *q)
void *b;
u32 cntl;
- if (cpu_is_mx27()) {
+ if (is_imx27_camera(pcdev)) {
spin_lock_irqsave(&pcdev->lock, flags);
cntl = readl(pcdev->base_emma + PRP_CNTL);
@@ -1054,11 +1086,11 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd)
if (bytesperline < 0)
return bytesperline;
- if (cpu_is_mx27()) {
+ if (is_imx27_camera(pcdev)) {
ret = mx27_camera_emma_prp_reset(pcdev);
if (ret)
return ret;
- } else if (cpu_is_mx25()) {
+ } else if (is_imx25_camera(pcdev)) {
writel((bytesperline * icd->user_height) >> 2,
pcdev->base_csi + CSIRXCNT);
writel((bytesperline << 16) | icd->user_height,
@@ -1351,7 +1383,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
/* FIXME: implement MX27 limits */
/* limit to MX25 hardware capabilities */
- if (cpu_is_mx25()) {
+ if (is_imx25_camera(pcdev)) {
if (xlate->host_fmt->bits_per_sample <= 8)
width_limit = 0xffff * 4;
else
@@ -1685,6 +1717,20 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
goto exit;
}
+ pcdev->devtype = pdev->id_entry->driver_data;
+ switch (pcdev->devtype) {
+ case IMX25_CAMERA:
+ pcdev->reg_csisr = CSISR_IMX25;
+ pcdev->reg_csicr3 = CSICR3_IMX25;
+ break;
+ case IMX27_CAMERA:
+ pcdev->reg_csisr = CSISR_IMX27;
+ pcdev->reg_csicr3 = CSICR3_IMX27;
+ break;
+ default:
+ break;
+ }
+
pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
if (IS_ERR(pcdev->clk_csi)) {
dev_err(&pdev->dev, "Could not get csi clock\n");
@@ -1722,7 +1768,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
pcdev->dev = &pdev->dev;
platform_set_drvdata(pdev, pcdev);
- if (cpu_is_mx25()) {
+ if (is_imx25_camera(pcdev)) {
err = devm_request_irq(&pdev->dev, irq_csi, mx25_camera_irq, 0,
MX2_CAM_DRV_NAME, pcdev);
if (err) {
@@ -1731,7 +1777,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
}
}
- if (cpu_is_mx27()) {
+ if (is_imx27_camera(pcdev)) {
err = mx27_camera_emma_init(pdev);
if (err)
goto exit;
@@ -1742,7 +1788,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
pcdev->soc_host.priv = pcdev;
pcdev->soc_host.v4l2_dev.dev = &pdev->dev;
pcdev->soc_host.nr = pdev->id;
- if (cpu_is_mx25())
+ if (is_imx25_camera(pcdev))
pcdev->soc_host.capabilities = SOCAM_HOST_CAP_STRIDE;
pcdev->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev);
@@ -1762,7 +1808,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
exit_free_emma:
vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
eallocctx:
- if (cpu_is_mx27()) {
+ if (is_imx27_camera(pcdev)) {
clk_disable_unprepare(pcdev->clk_emma_ipg);
clk_disable_unprepare(pcdev->clk_emma_ahb);
}
@@ -1780,7 +1826,7 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
- if (cpu_is_mx27()) {
+ if (is_imx27_camera(pcdev)) {
clk_disable_unprepare(pcdev->clk_emma_ipg);
clk_disable_unprepare(pcdev->clk_emma_ahb);
}
@@ -1794,6 +1840,7 @@ static struct platform_driver mx2_camera_driver = {
.driver = {
.name = MX2_CAM_DRV_NAME,
},
+ .id_table = mx2_camera_devtype,
.remove = __devexit_p(mx2_camera_remove),
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 29/34] mmc: mxcmmc: remove mach/hardware.h inclusion
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (27 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:41 ` Chris Ball
2012-09-17 5:34 ` [PATCH 30/34] video: imxfb: " Shawn Guo
` (6 subsequent siblings)
35 siblings, 1 reply; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
It changes the driver to use platform_device_id rather than cpu_is_xxx
to determine the controller type, and updates the platform code
accordingly.
As the result, mach/hardware.h inclusion gets removed from the driver.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Chris Ball <cjb@laptop.org>
Cc: linux-mmc at vger.kernel.org
---
arch/arm/mach-imx/clk-imx27.c | 12 +++++-----
arch/arm/mach-imx/clk-imx31.c | 4 ++--
arch/arm/mach-imx/devices/devices-common.h | 1 +
arch/arm/mach-imx/devices/platform-mxc-mmc.c | 15 +++++++------
arch/arm/mach-imx/mach-mx31_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx31moboard.c | 4 ++--
arch/arm/mach-imx/mach-pcm038.c | 2 +-
drivers/mmc/host/mxcmmc.c | 31 ++++++++++++++++++++++++--
8 files changed, 50 insertions(+), 21 deletions(-)
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index e26de52..114be46 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -212,12 +212,12 @@ int __init mx27_clocks_init(unsigned long fref)
clk_register_clkdev(clk[gpt6_ipg_gate], "ipg", "imx-gpt.5");
clk_register_clkdev(clk[per1_gate], "per", "imx-gpt.5");
clk_register_clkdev(clk[pwm_ipg_gate], NULL, "mxc_pwm.0");
- clk_register_clkdev(clk[per2_gate], "per", "mxc-mmc.0");
- clk_register_clkdev(clk[sdhc1_ipg_gate], "ipg", "mxc-mmc.0");
- clk_register_clkdev(clk[per2_gate], "per", "mxc-mmc.1");
- clk_register_clkdev(clk[sdhc2_ipg_gate], "ipg", "mxc-mmc.1");
- clk_register_clkdev(clk[per2_gate], "per", "mxc-mmc.2");
- clk_register_clkdev(clk[sdhc2_ipg_gate], "ipg", "mxc-mmc.2");
+ clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.0");
+ clk_register_clkdev(clk[sdhc1_ipg_gate], "ipg", "imx21-mmc.0");
+ clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.1");
+ clk_register_clkdev(clk[sdhc2_ipg_gate], "ipg", "imx21-mmc.1");
+ clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.2");
+ clk_register_clkdev(clk[sdhc2_ipg_gate], "ipg", "imx21-mmc.2");
clk_register_clkdev(clk[cspi1_ipg_gate], NULL, "imx27-cspi.0");
clk_register_clkdev(clk[cspi2_ipg_gate], NULL, "imx27-cspi.1");
clk_register_clkdev(clk[cspi3_ipg_gate], NULL, "imx27-cspi.2");
diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c
index d9ff16e..1277f73 100644
--- a/arch/arm/mach-imx/clk-imx31.c
+++ b/arch/arm/mach-imx/clk-imx31.c
@@ -159,8 +159,8 @@ int __init mx31_clocks_init(unsigned long fref)
clk_register_clkdev(clk[i2c2_gate], NULL, "imx21-i2c.1");
clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2");
clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1.0");
- clk_register_clkdev(clk[sdhc1_gate], NULL, "mxc-mmc.0");
- clk_register_clkdev(clk[sdhc2_gate], NULL, "mxc-mmc.1");
+ clk_register_clkdev(clk[sdhc1_gate], NULL, "imx31-mmc.0");
+ clk_register_clkdev(clk[sdhc2_gate], NULL, "imx31-mmc.1");
clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0");
clk_register_clkdev(clk[ssi2_gate], NULL, "imx-ssi.1");
clk_register_clkdev(clk[firi_gate], "firi", NULL);
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
index 8112a1a..7fa3ef7 100644
--- a/arch/arm/mach-imx/devices/devices-common.h
+++ b/arch/arm/mach-imx/devices/devices-common.h
@@ -228,6 +228,7 @@ struct platform_device *__init imx_add_mxc_ehci(
#include <linux/platform_data/mmc-mxcmmc.h>
struct imx_mxc_mmc_data {
+ const char *devid;
int id;
resource_size_t iobase;
resource_size_t iosize;
diff --git a/arch/arm/mach-imx/devices/platform-mxc-mmc.c b/arch/arm/mach-imx/devices/platform-mxc-mmc.c
index ce90ab0..487f61c 100644
--- a/arch/arm/mach-imx/devices/platform-mxc-mmc.c
+++ b/arch/arm/mach-imx/devices/platform-mxc-mmc.c
@@ -10,21 +10,22 @@
#include <mach/hardware.h>
#include "devices-common.h"
-#define imx_mxc_mmc_data_entry_single(soc, _id, _hwid, _size) \
+#define imx_mxc_mmc_data_entry_single(soc, _devid, _id, _hwid, _size) \
{ \
+ .devid = _devid, \
.id = _id, \
.iobase = soc ## _SDHC ## _hwid ## _BASE_ADDR, \
.iosize = _size, \
.irq = soc ## _INT_SDHC ## _hwid, \
.dmareq = soc ## _DMA_REQ_SDHC ## _hwid, \
}
-#define imx_mxc_mmc_data_entry(soc, _id, _hwid, _size) \
- [_id] = imx_mxc_mmc_data_entry_single(soc, _id, _hwid, _size)
+#define imx_mxc_mmc_data_entry(soc, _devid, _id, _hwid, _size) \
+ [_id] = imx_mxc_mmc_data_entry_single(soc, _devid, _id, _hwid, _size)
#ifdef CONFIG_SOC_IMX21
const struct imx_mxc_mmc_data imx21_mxc_mmc_data[] __initconst = {
#define imx21_mxc_mmc_data_entry(_id, _hwid) \
- imx_mxc_mmc_data_entry(MX21, _id, _hwid, SZ_4K)
+ imx_mxc_mmc_data_entry(MX21, "imx21-mmc", _id, _hwid, SZ_4K)
imx21_mxc_mmc_data_entry(0, 1),
imx21_mxc_mmc_data_entry(1, 2),
};
@@ -33,7 +34,7 @@ const struct imx_mxc_mmc_data imx21_mxc_mmc_data[] __initconst = {
#ifdef CONFIG_SOC_IMX27
const struct imx_mxc_mmc_data imx27_mxc_mmc_data[] __initconst = {
#define imx27_mxc_mmc_data_entry(_id, _hwid) \
- imx_mxc_mmc_data_entry(MX27, _id, _hwid, SZ_4K)
+ imx_mxc_mmc_data_entry(MX27, "imx21-mmc", _id, _hwid, SZ_4K)
imx27_mxc_mmc_data_entry(0, 1),
imx27_mxc_mmc_data_entry(1, 2),
};
@@ -42,7 +43,7 @@ const struct imx_mxc_mmc_data imx27_mxc_mmc_data[] __initconst = {
#ifdef CONFIG_SOC_IMX31
const struct imx_mxc_mmc_data imx31_mxc_mmc_data[] __initconst = {
#define imx31_mxc_mmc_data_entry(_id, _hwid) \
- imx_mxc_mmc_data_entry(MX31, _id, _hwid, SZ_16K)
+ imx_mxc_mmc_data_entry(MX31, "imx31-mmc", _id, _hwid, SZ_16K)
imx31_mxc_mmc_data_entry(0, 1),
imx31_mxc_mmc_data_entry(1, 2),
};
@@ -67,7 +68,7 @@ struct platform_device *__init imx_add_mxc_mmc(
.flags = IORESOURCE_DMA,
},
};
- return imx_add_platform_device_dmamask("mxc-mmc", data->id,
+ return imx_add_platform_device_dmamask(data->devid, data->id,
res, ARRAY_SIZE(res),
pdata, sizeof(*pdata), DMA_BIT_MASK(32));
}
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c
index 5377c88..0333567 100644
--- a/arch/arm/mach-imx/mach-mx31_3ds.c
+++ b/arch/arm/mach-imx/mach-mx31_3ds.c
@@ -393,7 +393,7 @@ static struct regulator_init_data gpo_init = {
};
static struct regulator_consumer_supply vmmc2_consumers[] = {
- REGULATOR_SUPPLY("vmmc", "mxc-mmc.0"),
+ REGULATOR_SUPPLY("vmmc", "imx31-mmc.0"),
};
static struct regulator_init_data vmmc2_init = {
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c
index e719c76..31c7d05 100644
--- a/arch/arm/mach-imx/mach-mx31moboard.c
+++ b/arch/arm/mach-imx/mach-mx31moboard.c
@@ -175,11 +175,11 @@ static const struct spi_imx_master moboard_spi1_pdata __initconst = {
static struct regulator_consumer_supply sdhc_consumers[] = {
{
- .dev_name = "mxc-mmc.0",
+ .dev_name = "imx31-mmc.0",
.supply = "sdhc0_vcc",
},
{
- .dev_name = "mxc-mmc.1",
+ .dev_name = "imx31-mmc.1",
.supply = "sdhc1_vcc",
},
};
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c
index 4a52340..8bf95f5 100644
--- a/arch/arm/mach-imx/mach-pcm038.c
+++ b/arch/arm/mach-imx/mach-pcm038.c
@@ -212,7 +212,7 @@ static const struct spi_imx_master pcm038_spi0_data __initconst = {
static struct regulator_consumer_supply sdhc1_consumers[] = {
{
- .dev_name = "mxc-mmc.1",
+ .dev_name = "imx21-mmc.1",
.supply = "sdhc_vcc",
},
};
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index 7b1161d..15010b3 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -41,7 +41,6 @@
#include <linux/platform_data/mmc-mxcmmc.h>
#include <linux/platform_data/dma-imx.h>
-#include <mach/hardware.h>
#define DRIVER_NAME "mxc-mmc"
@@ -112,6 +111,11 @@
#define INT_WRITE_OP_DONE_EN (1 << 1)
#define INT_READ_OP_EN (1 << 0)
+enum mxcmci_type {
+ IMX21_MMC,
+ IMX31_MMC,
+};
+
struct mxcmci_host {
struct mmc_host *mmc;
struct resource *res;
@@ -150,7 +154,26 @@ struct mxcmci_host {
int dmareq;
struct dma_slave_config dma_slave_config;
struct imx_dma_data dma_data;
+ enum mxcmci_type devtype;
+};
+
+static struct platform_device_id mxcmci_devtype[] = {
+ {
+ .name = "imx21-mmc",
+ .driver_data = IMX21_MMC,
+ }, {
+ .name = "imx31-mmc",
+ .driver_data = IMX31_MMC,
+ }, {
+ /* sentinel */
+ }
};
+MODULE_DEVICE_TABLE(platform, mxcmci_devtype);
+
+static inline int is_imx31_mmc(struct mxcmci_host *host)
+{
+ return host->devtype == IMX31_MMC;
+}
static void mxcmci_set_clk_rate(struct mxcmci_host *host, unsigned int clk_ios);
@@ -811,6 +834,8 @@ static void mxcmci_enable_sdio_irq(struct mmc_host *mmc, int enable)
static void mxcmci_init_card(struct mmc_host *host, struct mmc_card *card)
{
+ struct mxcmci_host *mxcmci = mmc_priv(host);
+
/*
* MX3 SoCs have a silicon bug which corrupts CRC calculation of
* multi-block transfers when connected SDIO peripheral doesn't
@@ -818,7 +843,7 @@ static void mxcmci_init_card(struct mmc_host *host, struct mmc_card *card)
* One way to prevent this is to only allow 1-bit transfers.
*/
- if (cpu_is_mx3() && card->type == MMC_TYPE_SDIO)
+ if (is_imx31_mmc(mxcmci) && card->type == MMC_TYPE_SDIO)
host->caps &= ~MMC_CAP_4_BIT_DATA;
else
host->caps |= MMC_CAP_4_BIT_DATA;
@@ -888,6 +913,7 @@ static int mxcmci_probe(struct platform_device *pdev)
host->mmc = mmc;
host->pdata = pdev->dev.platform_data;
+ host->devtype = pdev->id_entry->driver_data;
spin_lock_init(&host->lock);
mxcmci_init_ocr(host);
@@ -1056,6 +1082,7 @@ static const struct dev_pm_ops mxcmci_pm_ops = {
static struct platform_driver mxcmci_driver = {
.probe = mxcmci_probe,
.remove = mxcmci_remove,
+ .id_table = mxcmci_devtype,
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 30/34] video: imxfb: remove mach/hardware.h inclusion
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (28 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 29/34] mmc: mxcmmc: " Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 5:35 ` [PATCH 31/34] ARM: imx: move debug macros to include/debug Shawn Guo
` (5 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
It changes the driver to use platform_device_id rather than cpu_is_xxx
to determine the controller type, and updates the platform code
accordingly.
As the result, mach/hardware.h inclusion gets removed from the driver.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: linux-fbdev at vger.kernel.org
---
arch/arm/mach-imx/clk-imx1.c | 6 ++---
arch/arm/mach-imx/clk-imx21.c | 6 ++---
arch/arm/mach-imx/clk-imx25.c | 6 ++---
arch/arm/mach-imx/clk-imx27.c | 6 ++---
arch/arm/mach-imx/devices/devices-common.h | 1 +
arch/arm/mach-imx/devices/platform-imx-fb.c | 11 ++++----
drivers/video/imxfb.c | 38 ++++++++++++++++++++++-----
7 files changed, 51 insertions(+), 23 deletions(-)
diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
index 6b9407b..4bff66a 100644
--- a/arch/arm/mach-imx/clk-imx1.c
+++ b/arch/arm/mach-imx/clk-imx1.c
@@ -100,9 +100,9 @@ int __init mx1_clocks_init(unsigned long fref)
clk_register_clkdev(clk[per2], "per", "imx1-cspi.1");
clk_register_clkdev(clk[dummy], "ipg", "imx1-cspi.1");
clk_register_clkdev(clk[per2], NULL, "imx-mmc.0");
- clk_register_clkdev(clk[per2], "per", "imx-fb.0");
- clk_register_clkdev(clk[dummy], "ipg", "imx-fb.0");
- clk_register_clkdev(clk[dummy], "ahb", "imx-fb.0");
+ clk_register_clkdev(clk[per2], "per", "imx1-fb.0");
+ clk_register_clkdev(clk[dummy], "ipg", "imx1-fb.0");
+ clk_register_clkdev(clk[dummy], "ahb", "imx1-fb.0");
clk_register_clkdev(clk[hclk], "mshc", NULL);
clk_register_clkdev(clk[per3], "ssi", NULL);
clk_register_clkdev(clk[clk32], NULL, "imx1-rtc.0");
diff --git a/arch/arm/mach-imx/clk-imx21.c b/arch/arm/mach-imx/clk-imx21.c
index 96a4788..e981b48 100644
--- a/arch/arm/mach-imx/clk-imx21.c
+++ b/arch/arm/mach-imx/clk-imx21.c
@@ -157,9 +157,9 @@ int __init mx21_clocks_init(unsigned long lref, unsigned long href)
clk_register_clkdev(clk[cspi2_ipg_gate], "ipg", "imx21-cspi.1");
clk_register_clkdev(clk[per2], "per", "imx21-cspi.2");
clk_register_clkdev(clk[cspi3_ipg_gate], "ipg", "imx21-cspi.2");
- clk_register_clkdev(clk[per3], "per", "imx-fb.0");
- clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
- clk_register_clkdev(clk[lcdc_hclk_gate], "ahb", "imx-fb.0");
+ clk_register_clkdev(clk[per3], "per", "imx21-fb.0");
+ clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx21-fb.0");
+ clk_register_clkdev(clk[lcdc_hclk_gate], "ahb", "imx21-fb.0");
clk_register_clkdev(clk[usb_gate], "per", "imx21-hcd.0");
clk_register_clkdev(clk[usb_hclk_gate], "ahb", "imx21-hcd.0");
clk_register_clkdev(clk[nfc_gate], NULL, "imx21-nand.0");
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
index 71fe521..da7155d 100644
--- a/arch/arm/mach-imx/clk-imx25.c
+++ b/arch/arm/mach-imx/clk-imx25.c
@@ -219,9 +219,9 @@ int __init mx25_clocks_init(void)
clk_register_clkdev(clk[fec_ipg], "ipg", "imx25-fec.0");
clk_register_clkdev(clk[fec_ahb], "ahb", "imx25-fec.0");
clk_register_clkdev(clk[dryice_ipg], NULL, "imxdi_rtc.0");
- clk_register_clkdev(clk[lcdc_ipg_per], "per", "imx-fb.0");
- clk_register_clkdev(clk[lcdc_ipg], "ipg", "imx-fb.0");
- clk_register_clkdev(clk[lcdc_ahb], "ahb", "imx-fb.0");
+ clk_register_clkdev(clk[lcdc_ipg_per], "per", "imx21-fb.0");
+ clk_register_clkdev(clk[lcdc_ipg], "ipg", "imx21-fb.0");
+ clk_register_clkdev(clk[lcdc_ahb], "ahb", "imx21-fb.0");
clk_register_clkdev(clk[wdt_ipg], NULL, "imx2-wdt.0");
clk_register_clkdev(clk[ssi1_ipg], NULL, "imx-ssi.0");
clk_register_clkdev(clk[ssi2_ipg], NULL, "imx-ssi.1");
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index 114be46..f3a66a9 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -221,9 +221,9 @@ int __init mx27_clocks_init(unsigned long fref)
clk_register_clkdev(clk[cspi1_ipg_gate], NULL, "imx27-cspi.0");
clk_register_clkdev(clk[cspi2_ipg_gate], NULL, "imx27-cspi.1");
clk_register_clkdev(clk[cspi3_ipg_gate], NULL, "imx27-cspi.2");
- clk_register_clkdev(clk[per3_gate], "per", "imx-fb.0");
- clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
- clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
+ clk_register_clkdev(clk[per3_gate], "per", "imx21-fb.0");
+ clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx21-fb.0");
+ clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx21-fb.0");
clk_register_clkdev(clk[csi_ahb_gate], "ahb", "imx27-camera.0");
clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
index 7fa3ef7..c32279b 100644
--- a/arch/arm/mach-imx/devices/devices-common.h
+++ b/arch/arm/mach-imx/devices/devices-common.h
@@ -100,6 +100,7 @@ struct platform_device *__init imx_add_imxdi_rtc(
#include <linux/platform_data/video-imxfb.h>
struct imx_imx_fb_data {
+ const char *devid;
resource_size_t iobase;
resource_size_t iosize;
resource_size_t irq;
diff --git a/arch/arm/mach-imx/devices/platform-imx-fb.c b/arch/arm/mach-imx/devices/platform-imx-fb.c
index 4e6f857..abea28b 100644
--- a/arch/arm/mach-imx/devices/platform-imx-fb.c
+++ b/arch/arm/mach-imx/devices/platform-imx-fb.c
@@ -10,8 +10,9 @@
#include <mach/hardware.h>
#include "devices-common.h"
-#define imx_imx_fb_data_entry_single(soc, _size) \
+#define imx_imx_fb_data_entry_single(soc, _devid, _size) \
{ \
+ .devid = _devid, \
.iobase = soc ## _LCDC_BASE_ADDR, \
.iosize = _size, \
.irq = soc ## _INT_LCDC, \
@@ -19,22 +20,22 @@
#ifdef CONFIG_SOC_IMX1
const struct imx_imx_fb_data imx1_imx_fb_data __initconst =
- imx_imx_fb_data_entry_single(MX1, SZ_4K);
+ imx_imx_fb_data_entry_single(MX1, "imx1-fb", SZ_4K);
#endif /* ifdef CONFIG_SOC_IMX1 */
#ifdef CONFIG_SOC_IMX21
const struct imx_imx_fb_data imx21_imx_fb_data __initconst =
- imx_imx_fb_data_entry_single(MX21, SZ_4K);
+ imx_imx_fb_data_entry_single(MX21, "imx21-fb", SZ_4K);
#endif /* ifdef CONFIG_SOC_IMX21 */
#ifdef CONFIG_SOC_IMX25
const struct imx_imx_fb_data imx25_imx_fb_data __initconst =
- imx_imx_fb_data_entry_single(MX25, SZ_16K);
+ imx_imx_fb_data_entry_single(MX25, "imx21-fb", SZ_16K);
#endif /* ifdef CONFIG_SOC_IMX25 */
#ifdef CONFIG_SOC_IMX27
const struct imx_imx_fb_data imx27_imx_fb_data __initconst =
- imx_imx_fb_data_entry_single(MX27, SZ_4K);
+ imx_imx_fb_data_entry_single(MX27, "imx21-fb", SZ_4K);
#endif /* ifdef CONFIG_SOC_IMX27 */
struct platform_device *__init imx_add_imx_fb(
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index 53ffdfc..64a39e7 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -33,7 +33,6 @@
#include <linux/math64.h>
#include <linux/platform_data/video-imxfb.h>
-#include <mach/hardware.h>
/*
* Complain if VAR is out of range.
@@ -53,8 +52,8 @@
#define LCDC_SIZE 0x04
#define SIZE_XMAX(x) ((((x) >> 4) & 0x3f) << 20)
-#define YMAX_MASK (cpu_is_mx1() ? 0x1ff : 0x3ff)
-#define SIZE_YMAX(y) ((y) & YMAX_MASK)
+#define YMAX_MASK_IMX1 0x1ff
+#define YMAX_MASK_IMX21 0x3ff
#define LCDC_VPW 0x08
#define VPW_VPW(x) ((x) & 0x3ff)
@@ -128,12 +127,18 @@ struct imxfb_rgb {
struct fb_bitfield transp;
};
+enum imxfb_type {
+ IMX1_FB,
+ IMX21_FB,
+};
+
struct imxfb_info {
struct platform_device *pdev;
void __iomem *regs;
struct clk *clk_ipg;
struct clk *clk_ahb;
struct clk *clk_per;
+ enum imxfb_type devtype;
/*
* These are the addresses we mapped
@@ -168,6 +173,24 @@ struct imxfb_info {
void (*backlight_power)(int);
};
+static struct platform_device_id imxfb_devtype[] = {
+ {
+ .name = "imx1-fb",
+ .driver_data = IMX1_FB,
+ }, {
+ .name = "imx21-fb",
+ .driver_data = IMX21_FB,
+ }, {
+ /* sentinel */
+ }
+};
+MODULE_DEVICE_TABLE(platform, imxfb_devtype);
+
+static inline int is_imx1_fb(struct imxfb_info *fbi)
+{
+ return fbi->devtype == IMX1_FB;
+}
+
#define IMX_NAME "IMX"
/*
@@ -366,7 +389,7 @@ static int imxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
break;
case 16:
default:
- if (cpu_is_mx1())
+ if (is_imx1_fb(fbi))
pcr |= PCR_BPIX_12;
else
pcr |= PCR_BPIX_16;
@@ -596,6 +619,7 @@ static struct fb_ops imxfb_ops = {
static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *info)
{
struct imxfb_info *fbi = info->par;
+ u32 ymax_mask = is_imx1_fb(fbi) ? YMAX_MASK_IMX1 : YMAX_MASK_IMX21;
pr_debug("var: xres=%d hslen=%d lm=%d rm=%d\n",
var->xres, var->hsync_len,
@@ -617,7 +641,7 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
if (var->right_margin > 255)
printk(KERN_ERR "%s: invalid right_margin %d\n",
info->fix.id, var->right_margin);
- if (var->yres < 1 || var->yres > YMAX_MASK)
+ if (var->yres < 1 || var->yres > ymax_mask)
printk(KERN_ERR "%s: invalid yres %d\n",
info->fix.id, var->yres);
if (var->vsync_len > 100)
@@ -645,7 +669,7 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
VCR_V_WAIT_2(var->upper_margin),
fbi->regs + LCDC_VCR);
- writel(SIZE_XMAX(var->xres) | SIZE_YMAX(var->yres),
+ writel(SIZE_XMAX(var->xres) | (var->yres & ymax_mask),
fbi->regs + LCDC_SIZE);
writel(fbi->pcr, fbi->regs + LCDC_PCR);
@@ -765,6 +789,7 @@ static int __init imxfb_probe(struct platform_device *pdev)
return -ENOMEM;
fbi = info->par;
+ fbi->devtype = pdev->id_entry->driver_data;
if (!fb_mode)
fb_mode = pdata->mode[0].mode.name;
@@ -938,6 +963,7 @@ static struct platform_driver imxfb_driver = {
.driver = {
.name = DRIVER_NAME,
},
+ .id_table = imxfb_devtype,
};
static int imxfb_setup(void)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 31/34] ARM: imx: move debug macros to include/debug
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (29 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 30/34] video: imxfb: " Shawn Guo
@ 2012-09-17 5:35 ` Shawn Guo
2012-09-17 5:35 ` [PATCH 32/34] ARM: imx: include hardware.h rather than mach/hardware.h Shawn Guo
` (4 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:35 UTC (permalink / raw)
To: linux-arm-kernel
Move imx debug-macro.S over to common debug macro directory. It
removes the inclusion to hardware.h by hard-coding the physical
address of uart port and copying IMX_IO_P2V from hardware.h.
Since we will need a common solution, which might use a fixed virtual
address for uart port across platforms, we make a copy of IMX_IO_P2V
here as a temporary solution to enable low-level debug for imx
multi-platform build.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
arch/arm/Kconfig.debug | 8 +++++
.../mach/debug-macro.S => include/debug/imx.S} | 33 +++++++++++++-------
2 files changed, 30 insertions(+), 11 deletions(-)
rename arch/arm/{mach-imx/include/mach/debug-macro.S => include/debug/imx.S} (59%)
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 55f3c8a..ffd9b0c 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -412,6 +412,14 @@ endchoice
config DEBUG_LL_INCLUDE
string
default "debug/icedcc.S" if DEBUG_ICEDCC
+ default "debug/imx.S" if DEBUG_IMX1_UART || \
+ DEBUG_IMX25_UART || \
+ DEBUG_IMX21_IMX27_UART || \
+ DEBUG_IMX31_IMX35_UART || \
+ DEBUG_IMX51_UART || \
+ DEBUG_IMX50_IMX53_UART ||\
+ DEBUG_IMX6Q_UART2 || \
+ DEBUG_IMX6Q_UART4
default "debug/highbank.S" if DEBUG_HIGHBANK_UART
default "debug/mvebu.S" if DEBUG_MVEBU_UART
default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART
diff --git a/arch/arm/mach-imx/include/mach/debug-macro.S b/arch/arm/include/debug/imx.S
similarity index 59%
rename from arch/arm/mach-imx/include/mach/debug-macro.S
rename to arch/arm/include/debug/imx.S
index 761e45f..0b65d79 100644
--- a/arch/arm/mach-imx/include/mach/debug-macro.S
+++ b/arch/arm/include/debug/imx.S
@@ -10,27 +10,38 @@
* published by the Free Software Foundation.
*
*/
-#include <mach/hardware.h>
-
#ifdef CONFIG_DEBUG_IMX1_UART
-#define UART_PADDR MX1_UART1_BASE_ADDR
+#define UART_PADDR 0x00206000
#elif defined (CONFIG_DEBUG_IMX25_UART)
-#define UART_PADDR MX25_UART1_BASE_ADDR
+#define UART_PADDR 0x43f90000
#elif defined (CONFIG_DEBUG_IMX21_IMX27_UART)
-#define UART_PADDR MX2x_UART1_BASE_ADDR
+#define UART_PADDR 0x1000a000
#elif defined (CONFIG_DEBUG_IMX31_IMX35_UART)
-#define UART_PADDR MX3x_UART1_BASE_ADDR
+#define UART_PADDR 0x43f90000
#elif defined (CONFIG_DEBUG_IMX51_UART)
-#define UART_PADDR MX51_UART1_BASE_ADDR
+#define UART_PADDR 0x73fbc000
#elif defined (CONFIG_DEBUG_IMX50_IMX53_UART)
-#define UART_PADDR MX53_UART1_BASE_ADDR
+#define UART_PADDR 0x53fbc000
#elif defined (CONFIG_DEBUG_IMX6Q_UART2)
-#define UART_PADDR MX6Q_UART2_BASE_ADDR
+#define UART_PADDR 0x021e8000
#elif defined (CONFIG_DEBUG_IMX6Q_UART4)
-#define UART_PADDR MX6Q_UART4_BASE_ADDR
+#define UART_PADDR 0x021f0000
#endif
-#define UART_VADDR IMX_IO_ADDRESS(UART_PADDR)
+/*
+ * FIXME: This is a copy of IMX_IO_P2V in hardware.h, and needs to
+ * stay sync with that. It's hard to maintain, and should be fixed
+ * globally for multi-platform build to use a fixed virtual address
+ * for low-level debug uart port across platforms.
+ */
+#define IMX_IO_P2V(x) ( \
+ (((x) & 0x80000000) >> 7) | \
+ (0xf4000000 + \
+ (((x) & 0x50000000) >> 6) + \
+ (((x) & 0x0b000000) >> 4) + \
+ (((x) & 0x000fffff))))
+
+#define UART_VADDR IMX_IO_P2V(UART_PADDR)
.macro addruart, rp, rv, tmp
ldr \rp, =UART_PADDR @ physical
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 32/34] ARM: imx: include hardware.h rather than mach/hardware.h
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (30 preceding siblings ...)
2012-09-17 5:35 ` [PATCH 31/34] ARM: imx: move debug macros to include/debug Shawn Guo
@ 2012-09-17 5:35 ` Shawn Guo
2012-09-17 5:35 ` [PATCH 33/34] ARM: imx: remove header file mach/irqs.h Shawn Guo
` (3 subsequent siblings)
35 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:35 UTC (permalink / raw)
To: linux-arm-kernel
It moves a bunch of header files included in hardware.h and itself
from mach-imx/include/mach to mach-imx, and updates users to include
hardware.h rather than mach/hardware.h. The files in mach-imx/devices
will need to include "../hardware.h".
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
arch/arm/mach-imx/3ds_debugboard.c | 2 +-
arch/arm/mach-imx/avic.c | 2 +-
arch/arm/mach-imx/clk-imx1.c | 3 +--
arch/arm/mach-imx/clk-imx21.c | 3 +--
arch/arm/mach-imx/clk-imx25.c | 5 ++--
arch/arm/mach-imx/clk-imx27.c | 3 +--
arch/arm/mach-imx/clk-imx31.c | 5 ++--
arch/arm/mach-imx/clk-imx35.c | 3 +--
arch/arm/mach-imx/clk-imx51-imx53.c | 3 +--
arch/arm/mach-imx/clk-pllv1.c | 2 +-
arch/arm/mach-imx/cpu-imx25.c | 2 +-
arch/arm/mach-imx/cpu-imx27.c | 2 +-
arch/arm/mach-imx/cpu-imx31.c | 2 +-
arch/arm/mach-imx/cpu-imx35.c | 2 +-
arch/arm/mach-imx/cpu-imx5.c | 3 ++-
arch/arm/mach-imx/cpu.c | 3 ++-
arch/arm/mach-imx/cpu_op-mx51.c | 3 ++-
arch/arm/mach-imx/cpufreq.c | 3 ++-
arch/arm/mach-imx/devices/platform-ahci-imx.c | 3 ++-
arch/arm/mach-imx/devices/platform-fec.c | 3 ++-
arch/arm/mach-imx/devices/platform-flexcan.c | 2 +-
arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c | 3 ++-
arch/arm/mach-imx/devices/platform-gpio_keys.c | 3 ++-
arch/arm/mach-imx/devices/platform-imx-fb.c | 3 ++-
arch/arm/mach-imx/devices/platform-imx-i2c.c | 2 +-
arch/arm/mach-imx/devices/platform-imx-keypad.c | 2 +-
arch/arm/mach-imx/devices/platform-imx-ssi.c | 2 +-
arch/arm/mach-imx/devices/platform-imx-uart.c | 2 +-
arch/arm/mach-imx/devices/platform-imx2-wdt.c | 3 ++-
arch/arm/mach-imx/devices/platform-imx21-hcd.c | 2 +-
arch/arm/mach-imx/devices/platform-imx_udc.c | 2 +-
arch/arm/mach-imx/devices/platform-imxdi_rtc.c | 3 ++-
arch/arm/mach-imx/devices/platform-ipu-core.c | 3 ++-
arch/arm/mach-imx/devices/platform-mx2-camera.c | 2 +-
arch/arm/mach-imx/devices/platform-mxc-ehci.c | 3 ++-
arch/arm/mach-imx/devices/platform-mxc-mmc.c | 3 ++-
arch/arm/mach-imx/devices/platform-mxc_nand.c | 3 ++-
arch/arm/mach-imx/devices/platform-mxc_pwm.c | 2 +-
arch/arm/mach-imx/devices/platform-mxc_rnga.c | 2 +-
arch/arm/mach-imx/devices/platform-mxc_rtc.c | 2 +-
arch/arm/mach-imx/devices/platform-mxc_w1.c | 2 +-
arch/arm/mach-imx/devices/platform-pata_imx.c | 2 +-
.../mach-imx/devices/platform-sdhci-esdhc-imx.c | 3 ++-
arch/arm/mach-imx/devices/platform-spi_imx.c | 2 +-
arch/arm/mach-imx/ehci-imx25.c | 4 +--
arch/arm/mach-imx/ehci-imx27.c | 4 +--
arch/arm/mach-imx/ehci-imx31.c | 4 +--
arch/arm/mach-imx/ehci-imx35.c | 4 +--
arch/arm/mach-imx/ehci-imx5.c | 4 +--
arch/arm/mach-imx/epit.c | 3 +--
arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | 3 +--
arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c | 4 +--
arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c | 3 +--
arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c | 3 +--
arch/arm/mach-imx/{include/mach => }/hardware.h | 26 ++++++++++----------
arch/arm/mach-imx/imx27-dt.c | 2 +-
arch/arm/mach-imx/imx31-dt.c | 2 +-
arch/arm/mach-imx/imx51-dt.c | 2 +-
arch/arm/mach-imx/iomux-imx31.c | 2 +-
arch/arm/mach-imx/iomux-v1.c | 2 +-
arch/arm/mach-imx/iomux-v3.c | 2 +-
arch/arm/mach-imx/lluart.c | 3 ++-
arch/arm/mach-imx/mach-apf9328.c | 3 +--
arch/arm/mach-imx/mach-armadillo5x0.c | 2 +-
arch/arm/mach-imx/mach-bug.c | 3 +--
arch/arm/mach-imx/mach-cpuimx27.c | 3 +--
arch/arm/mach-imx/mach-cpuimx35.c | 3 +--
arch/arm/mach-imx/mach-cpuimx51sd.c | 3 +--
arch/arm/mach-imx/mach-eukrea_cpuimx25.c | 4 +--
arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 2 +-
arch/arm/mach-imx/mach-imx27ipcam.c | 2 +-
arch/arm/mach-imx/mach-imx27lite.c | 2 +-
arch/arm/mach-imx/mach-imx53.c | 2 +-
arch/arm/mach-imx/mach-imx6q.c | 2 +-
arch/arm/mach-imx/mach-kzm_arm11_01.c | 3 +--
arch/arm/mach-imx/mach-mx1ads.c | 3 +--
arch/arm/mach-imx/mach-mx21ads.c | 2 +-
arch/arm/mach-imx/mach-mx25_3ds.c | 4 +--
arch/arm/mach-imx/mach-mx27_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx27ads.c | 2 +-
arch/arm/mach-imx/mach-mx31_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx31ads.c | 2 +-
arch/arm/mach-imx/mach-mx31lilly.c | 3 +--
arch/arm/mach-imx/mach-mx31lite.c | 3 +--
arch/arm/mach-imx/mach-mx31moboard.c | 2 +-
arch/arm/mach-imx/mach-mx35_3ds.c | 2 +-
arch/arm/mach-imx/mach-mx50_rdp.c | 3 +--
arch/arm/mach-imx/mach-mx51_3ds.c | 3 +--
arch/arm/mach-imx/mach-mx51_babbage.c | 3 +--
arch/arm/mach-imx/mach-mxt_td60.c | 2 +-
arch/arm/mach-imx/mach-pca100.c | 2 +-
arch/arm/mach-imx/mach-pcm037.c | 2 +-
arch/arm/mach-imx/mach-pcm038.c | 3 +--
arch/arm/mach-imx/mach-pcm043.c | 3 +--
arch/arm/mach-imx/mach-qong.c | 2 +-
arch/arm/mach-imx/mach-scb9328.c | 3 +--
arch/arm/mach-imx/mach-vpr200.c | 3 +--
arch/arm/mach-imx/mm-imx1.c | 3 +--
arch/arm/mach-imx/mm-imx21.c | 2 +-
arch/arm/mach-imx/mm-imx25.c | 5 ++--
arch/arm/mach-imx/mm-imx27.c | 2 +-
arch/arm/mach-imx/mm-imx3.c | 3 +--
arch/arm/mach-imx/mm-imx5.c | 3 +--
arch/arm/mach-imx/{include/mach => }/mx1.h | 0
arch/arm/mach-imx/{include/mach => }/mx21.h | 0
arch/arm/mach-imx/{include/mach => }/mx25.h | 0
arch/arm/mach-imx/{include/mach => }/mx27.h | 0
arch/arm/mach-imx/{include/mach => }/mx2x.h | 0
arch/arm/mach-imx/{include/mach => }/mx31.h | 0
arch/arm/mach-imx/mx31lilly-db.c | 3 +--
arch/arm/mach-imx/mx31lite-db.c | 3 +--
arch/arm/mach-imx/mx31moboard-devboard.c | 3 +--
arch/arm/mach-imx/mx31moboard-marxbot.c | 3 +--
arch/arm/mach-imx/mx31moboard-smartbot.c | 3 +--
arch/arm/mach-imx/{include/mach => }/mx35.h | 0
arch/arm/mach-imx/{include/mach => }/mx3x.h | 0
arch/arm/mach-imx/{include/mach => }/mx50.h | 0
arch/arm/mach-imx/{include/mach => }/mx51.h | 0
arch/arm/mach-imx/{include/mach => }/mx53.h | 0
arch/arm/mach-imx/{include/mach => }/mx6q.h | 0
arch/arm/mach-imx/{include/mach => }/mxc.h | 0
arch/arm/mach-imx/pcm970-baseboard.c | 3 +--
arch/arm/mach-imx/platsmp.c | 2 +-
arch/arm/mach-imx/pm-imx27.c | 3 ++-
arch/arm/mach-imx/pm-imx3.c | 2 +-
arch/arm/mach-imx/pm-imx5.c | 2 +-
arch/arm/mach-imx/pm-imx6q.c | 2 +-
arch/arm/mach-imx/system.c | 2 +-
arch/arm/mach-imx/time.c | 2 +-
arch/arm/mach-imx/tzic.c | 2 +-
130 files changed, 158 insertions(+), 177 deletions(-)
rename arch/arm/mach-imx/{include/mach => }/hardware.h (94%)
rename arch/arm/mach-imx/{include/mach => }/mx1.h (100%)
rename arch/arm/mach-imx/{include/mach => }/mx21.h (100%)
rename arch/arm/mach-imx/{include/mach => }/mx25.h (100%)
rename arch/arm/mach-imx/{include/mach => }/mx27.h (100%)
rename arch/arm/mach-imx/{include/mach => }/mx2x.h (100%)
rename arch/arm/mach-imx/{include/mach => }/mx31.h (100%)
rename arch/arm/mach-imx/{include/mach => }/mx35.h (100%)
rename arch/arm/mach-imx/{include/mach => }/mx3x.h (100%)
rename arch/arm/mach-imx/{include/mach => }/mx50.h (100%)
rename arch/arm/mach-imx/{include/mach => }/mx51.h (100%)
rename arch/arm/mach-imx/{include/mach => }/mx53.h (100%)
rename arch/arm/mach-imx/{include/mach => }/mx6q.h (100%)
rename arch/arm/mach-imx/{include/mach => }/mxc.h (100%)
diff --git a/arch/arm/mach-imx/3ds_debugboard.c b/arch/arm/mach-imx/3ds_debugboard.c
index 5c10ad0..1343773 100644
--- a/arch/arm/mach-imx/3ds_debugboard.c
+++ b/arch/arm/mach-imx/3ds_debugboard.c
@@ -21,7 +21,7 @@
#include <linux/regulator/machine.h>
#include <linux/regulator/fixed.h>
-#include <mach/hardware.h>
+#include "hardware.h"
/* LAN9217 ethernet base address */
#define LAN9217_BASE_ADDR(n) (n + 0x0)
diff --git a/arch/arm/mach-imx/avic.c b/arch/arm/mach-imx/avic.c
index 204fd94..adc64bc 100644
--- a/arch/arm/mach-imx/avic.c
+++ b/arch/arm/mach-imx/avic.c
@@ -24,10 +24,10 @@
#include <linux/of.h>
#include <asm/mach/irq.h>
#include <asm/exception.h>
-#include <mach/hardware.h>
#include <mach/irqs.h>
#include "common.h"
+#include "hardware.h"
#include "irq-common.h"
#define AVIC_INTCNTL 0x00 /* int control reg */
diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
index 4bff66a..7b76bc3 100644
--- a/arch/arm/mach-imx/clk-imx1.c
+++ b/arch/arm/mach-imx/clk-imx1.c
@@ -22,10 +22,9 @@
#include <linux/clkdev.h>
#include <linux/err.h>
-#include <mach/hardware.h>
-
#include "clk.h"
#include "common.h"
+#include "hardware.h"
/* CCM register addresses */
#define IO_ADDR_CCM(off) (MX1_IO_ADDRESS(MX1_CCM_BASE_ADDR + (off)))
diff --git a/arch/arm/mach-imx/clk-imx21.c b/arch/arm/mach-imx/clk-imx21.c
index e981b48..52b0563 100644
--- a/arch/arm/mach-imx/clk-imx21.c
+++ b/arch/arm/mach-imx/clk-imx21.c
@@ -25,10 +25,9 @@
#include <linux/module.h>
#include <linux/err.h>
-#include <mach/hardware.h>
-
#include "clk.h"
#include "common.h"
+#include "hardware.h"
#define IO_ADDR_CCM(off) (MX21_IO_ADDRESS(MX21_CCM_BASE_ADDR + (off)))
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
index da7155d..d150207 100644
--- a/arch/arm/mach-imx/clk-imx25.c
+++ b/arch/arm/mach-imx/clk-imx25.c
@@ -24,11 +24,10 @@
#include <linux/clkdev.h>
#include <linux/err.h>
-#include <mach/hardware.h>
-#include <mach/mx25.h>
-
#include "clk.h"
#include "common.h"
+#include "hardware.h"
+#include "mx25.h"
#define CRM_BASE MX25_IO_ADDRESS(MX25_CRM_BASE_ADDR)
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index f3a66a9..e813745 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -6,10 +6,9 @@
#include <linux/clk-provider.h>
#include <linux/of.h>
-#include <mach/hardware.h>
-
#include "clk.h"
#include "common.h"
+#include "hardware.h"
#define IO_ADDR_CCM(off) (MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR + (off)))
diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c
index 1277f73..8be64e0 100644
--- a/arch/arm/mach-imx/clk-imx31.c
+++ b/arch/arm/mach-imx/clk-imx31.c
@@ -22,12 +22,11 @@
#include <linux/err.h>
#include <linux/of.h>
-#include <mach/hardware.h>
-#include <mach/mx31.h>
-
#include "clk.h"
#include "common.h"
#include "crmregs-imx3.h"
+#include "hardware.h"
+#include "mx31.h"
static const char *mcu_main_sel[] = { "spll", "mpll", };
static const char *per_sel[] = { "per_div", "ipg", };
diff --git a/arch/arm/mach-imx/clk-imx35.c b/arch/arm/mach-imx/clk-imx35.c
index fec48e6..66f3d65 100644
--- a/arch/arm/mach-imx/clk-imx35.c
+++ b/arch/arm/mach-imx/clk-imx35.c
@@ -14,11 +14,10 @@
#include <linux/of.h>
#include <linux/err.h>
-#include <mach/hardware.h>
-
#include "crmregs-imx3.h"
#include "clk.h"
#include "common.h"
+#include "hardware.h"
struct arm_ahb_div {
unsigned char arm, ahb, sel;
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
index 22afd5f..e9fd813 100644
--- a/arch/arm/mach-imx/clk-imx51-imx53.c
+++ b/arch/arm/mach-imx/clk-imx51-imx53.c
@@ -14,11 +14,10 @@
#include <linux/of.h>
#include <linux/err.h>
-#include <mach/hardware.h>
-
#include "crm-regs-imx5.h"
#include "clk.h"
#include "common.h"
+#include "hardware.h"
/* Low-power Audio Playback Mode clock */
static const char *lp_apm_sel[] = { "osc", };
diff --git a/arch/arm/mach-imx/clk-pllv1.c b/arch/arm/mach-imx/clk-pllv1.c
index 02f9013..abff350 100644
--- a/arch/arm/mach-imx/clk-pllv1.c
+++ b/arch/arm/mach-imx/clk-pllv1.c
@@ -4,10 +4,10 @@
#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/err.h>
-#include <mach/hardware.h>
#include "clk.h"
#include "common.h"
+#include "hardware.h"
/**
* pll v1
diff --git a/arch/arm/mach-imx/cpu-imx25.c b/arch/arm/mach-imx/cpu-imx25.c
index 79d4d1c..96ec64b 100644
--- a/arch/arm/mach-imx/cpu-imx25.c
+++ b/arch/arm/mach-imx/cpu-imx25.c
@@ -11,9 +11,9 @@
*/
#include <linux/module.h>
#include <linux/io.h>
-#include <mach/hardware.h>
#include "iim.h"
+#include "hardware.h"
static int mx25_cpu_rev = -1;
diff --git a/arch/arm/mach-imx/cpu-imx27.c b/arch/arm/mach-imx/cpu-imx27.c
index ff38e15..fe8d36f 100644
--- a/arch/arm/mach-imx/cpu-imx27.c
+++ b/arch/arm/mach-imx/cpu-imx27.c
@@ -24,7 +24,7 @@
#include <linux/io.h>
#include <linux/module.h>
-#include <mach/hardware.h>
+#include "hardware.h"
static int mx27_cpu_rev = -1;
static int mx27_cpu_partnumber;
diff --git a/arch/arm/mach-imx/cpu-imx31.c b/arch/arm/mach-imx/cpu-imx31.c
index 51c938f..fde1860 100644
--- a/arch/arm/mach-imx/cpu-imx31.c
+++ b/arch/arm/mach-imx/cpu-imx31.c
@@ -11,9 +11,9 @@
#include <linux/module.h>
#include <linux/io.h>
-#include <mach/hardware.h>
#include "common.h"
+#include "hardware.h"
#include "iim.h"
static int mx31_cpu_rev = -1;
diff --git a/arch/arm/mach-imx/cpu-imx35.c b/arch/arm/mach-imx/cpu-imx35.c
index 8b36d3a..ec3aaa0 100644
--- a/arch/arm/mach-imx/cpu-imx35.c
+++ b/arch/arm/mach-imx/cpu-imx35.c
@@ -10,8 +10,8 @@
*/
#include <linux/module.h>
#include <linux/io.h>
-#include <mach/hardware.h>
+#include "hardware.h"
#include "iim.h"
static int mx35_cpu_rev = -1;
diff --git a/arch/arm/mach-imx/cpu-imx5.c b/arch/arm/mach-imx/cpu-imx5.c
index 8eb15a2..d887600 100644
--- a/arch/arm/mach-imx/cpu-imx5.c
+++ b/arch/arm/mach-imx/cpu-imx5.c
@@ -15,9 +15,10 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
-#include <mach/hardware.h>
#include <linux/io.h>
+#include "hardware.h"
+
static int mx5_cpu_rev = -1;
#define IIM_SREV 0x24
diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c
index 220dd6f..03fcbd0 100644
--- a/arch/arm/mach-imx/cpu.c
+++ b/arch/arm/mach-imx/cpu.c
@@ -1,7 +1,8 @@
#include <linux/module.h>
#include <linux/io.h>
-#include <mach/hardware.h>
+
+#include "hardware.h"
unsigned int __mxc_cpu_type;
EXPORT_SYMBOL(__mxc_cpu_type);
diff --git a/arch/arm/mach-imx/cpu_op-mx51.c b/arch/arm/mach-imx/cpu_op-mx51.c
index 7b92cd6..b9ef692 100644
--- a/arch/arm/mach-imx/cpu_op-mx51.c
+++ b/arch/arm/mach-imx/cpu_op-mx51.c
@@ -13,9 +13,10 @@
#include <linux/bug.h>
#include <linux/types.h>
-#include <mach/hardware.h>
#include <linux/kernel.h>
+#include "hardware.h"
+
static struct cpu_op mx51_cpu_op[] = {
{
.cpu_rate = 160000000,},
diff --git a/arch/arm/mach-imx/cpufreq.c b/arch/arm/mach-imx/cpufreq.c
index b5b6f80..36e8b39 100644
--- a/arch/arm/mach-imx/cpufreq.c
+++ b/arch/arm/mach-imx/cpufreq.c
@@ -22,7 +22,8 @@
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/slab.h>
-#include <mach/hardware.h>
+
+#include "hardware.h"
#define CLK32_FREQ 32768
#define NANOSECOND (1000 * 1000 * 1000)
diff --git a/arch/arm/mach-imx/devices/platform-ahci-imx.c b/arch/arm/mach-imx/devices/platform-ahci-imx.c
index bf7f46d..3d87dd9 100644
--- a/arch/arm/mach-imx/devices/platform-ahci-imx.c
+++ b/arch/arm/mach-imx/devices/platform-ahci-imx.c
@@ -24,7 +24,8 @@
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <asm/sizes.h>
-#include <mach/hardware.h>
+
+#include "../hardware.h"
#include "devices-common.h"
#define imx_ahci_imx_data_entry_single(soc, _devid) \
diff --git a/arch/arm/mach-imx/devices/platform-fec.c b/arch/arm/mach-imx/devices/platform-fec.c
index e62114f..2cb188a 100644
--- a/arch/arm/mach-imx/devices/platform-fec.c
+++ b/arch/arm/mach-imx/devices/platform-fec.c
@@ -8,7 +8,8 @@
*/
#include <linux/dma-mapping.h>
#include <asm/sizes.h>
-#include <mach/hardware.h>
+
+#include "../hardware.h"
#include "devices-common.h"
#define imx_fec_data_entry_single(soc, _devid) \
diff --git a/arch/arm/mach-imx/devices/platform-flexcan.c b/arch/arm/mach-imx/devices/platform-flexcan.c
index e776d8e..1078bf0 100644
--- a/arch/arm/mach-imx/devices/platform-flexcan.c
+++ b/arch/arm/mach-imx/devices/platform-flexcan.c
@@ -5,7 +5,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/hardware.h>
+#include "../hardware.h"
#include "devices-common.h"
#define imx_flexcan_data_entry_single(soc, _id, _hwid, _size) \
diff --git a/arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c b/arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c
index 6ecccf9..37e4439 100644
--- a/arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c
+++ b/arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c
@@ -7,7 +7,8 @@
* Free Software Foundation.
*/
#include <linux/dma-mapping.h>
-#include <mach/hardware.h>
+
+#include "../hardware.h"
#include "devices-common.h"
#define imx_fsl_usb2_udc_data_entry_single(soc) \
diff --git a/arch/arm/mach-imx/devices/platform-gpio_keys.c b/arch/arm/mach-imx/devices/platform-gpio_keys.c
index 3f87279..4862825 100644
--- a/arch/arm/mach-imx/devices/platform-gpio_keys.c
+++ b/arch/arm/mach-imx/devices/platform-gpio_keys.c
@@ -16,7 +16,8 @@
* Boston, MA 02110-1301, USA.
*/
#include <asm/sizes.h>
-#include <mach/hardware.h>
+
+#include "../hardware.h"
#include "devices-common.h"
struct platform_device *__init imx_add_gpio_keys(
diff --git a/arch/arm/mach-imx/devices/platform-imx-fb.c b/arch/arm/mach-imx/devices/platform-imx-fb.c
index abea28b..10b0ed3 100644
--- a/arch/arm/mach-imx/devices/platform-imx-fb.c
+++ b/arch/arm/mach-imx/devices/platform-imx-fb.c
@@ -7,7 +7,8 @@
* Free Software Foundation.
*/
#include <linux/dma-mapping.h>
-#include <mach/hardware.h>
+
+#include "../hardware.h"
#include "devices-common.h"
#define imx_imx_fb_data_entry_single(soc, _devid, _size) \
diff --git a/arch/arm/mach-imx/devices/platform-imx-i2c.c b/arch/arm/mach-imx/devices/platform-imx-i2c.c
index 4a701fc..d1cb34a 100644
--- a/arch/arm/mach-imx/devices/platform-imx-i2c.c
+++ b/arch/arm/mach-imx/devices/platform-imx-i2c.c
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/hardware.h>
+#include "../hardware.h"
#include "devices-common.h"
#define imx_imx_i2c_data_entry_single(soc, _devid, _id, _hwid, _size) \
diff --git a/arch/arm/mach-imx/devices/platform-imx-keypad.c b/arch/arm/mach-imx/devices/platform-imx-keypad.c
index 371b1e6..8f22a4c 100644
--- a/arch/arm/mach-imx/devices/platform-imx-keypad.c
+++ b/arch/arm/mach-imx/devices/platform-imx-keypad.c
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/hardware.h>
+#include "../hardware.h"
#include "devices-common.h"
#define imx_imx_keypad_data_entry_single(soc, _size) \
diff --git a/arch/arm/mach-imx/devices/platform-imx-ssi.c b/arch/arm/mach-imx/devices/platform-imx-ssi.c
index bf0c5e4..bfcb8f3 100644
--- a/arch/arm/mach-imx/devices/platform-imx-ssi.c
+++ b/arch/arm/mach-imx/devices/platform-imx-ssi.c
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/hardware.h>
+#include "../hardware.h"
#include "devices-common.h"
#define imx_imx_ssi_data_entry(soc, _id, _hwid, _size) \
diff --git a/arch/arm/mach-imx/devices/platform-imx-uart.c b/arch/arm/mach-imx/devices/platform-imx-uart.c
index e6132f2..67bf866 100644
--- a/arch/arm/mach-imx/devices/platform-imx-uart.c
+++ b/arch/arm/mach-imx/devices/platform-imx-uart.c
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/hardware.h>
+#include "../hardware.h"
#include "devices-common.h"
#define imx_imx_uart_3irq_data_entry(soc, _id, _hwid, _size) \
diff --git a/arch/arm/mach-imx/devices/platform-imx2-wdt.c b/arch/arm/mach-imx/devices/platform-imx2-wdt.c
index 729c191..ec75d64 100644
--- a/arch/arm/mach-imx/devices/platform-imx2-wdt.c
+++ b/arch/arm/mach-imx/devices/platform-imx2-wdt.c
@@ -7,7 +7,8 @@
* Free Software Foundation.
*/
#include <asm/sizes.h>
-#include <mach/hardware.h>
+
+#include "../hardware.h"
#include "devices-common.h"
#define imx_imx2_wdt_data_entry_single(soc, _id, _hwid, _size) \
diff --git a/arch/arm/mach-imx/devices/platform-imx21-hcd.c b/arch/arm/mach-imx/devices/platform-imx21-hcd.c
index 18b9963..30c8161 100644
--- a/arch/arm/mach-imx/devices/platform-imx21-hcd.c
+++ b/arch/arm/mach-imx/devices/platform-imx21-hcd.c
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/hardware.h>
+#include "../hardware.h"
#include "devices-common.h"
#define imx_imx21_hcd_data_entry_single(soc) \
diff --git a/arch/arm/mach-imx/devices/platform-imx_udc.c b/arch/arm/mach-imx/devices/platform-imx_udc.c
index 75aee0b..5ced7e4 100644
--- a/arch/arm/mach-imx/devices/platform-imx_udc.c
+++ b/arch/arm/mach-imx/devices/platform-imx_udc.c
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/hardware.h>
+#include "../hardware.h"
#include "devices-common.h"
#define imx_imx_udc_data_entry_single(soc, _size) \
diff --git a/arch/arm/mach-imx/devices/platform-imxdi_rtc.c b/arch/arm/mach-imx/devices/platform-imxdi_rtc.c
index e4b22eb..5bb490d 100644
--- a/arch/arm/mach-imx/devices/platform-imxdi_rtc.c
+++ b/arch/arm/mach-imx/devices/platform-imxdi_rtc.c
@@ -7,7 +7,8 @@
* Free Software Foundation.
*/
#include <asm/sizes.h>
-#include <mach/hardware.h>
+
+#include "../hardware.h"
#include "devices-common.h"
#define imx_imxdi_rtc_data_entry_single(soc) \
diff --git a/arch/arm/mach-imx/devices/platform-ipu-core.c b/arch/arm/mach-imx/devices/platform-ipu-core.c
index dc0e837..fc4dd7c 100644
--- a/arch/arm/mach-imx/devices/platform-ipu-core.c
+++ b/arch/arm/mach-imx/devices/platform-ipu-core.c
@@ -7,7 +7,8 @@
* Free Software Foundation.
*/
#include <linux/dma-mapping.h>
-#include <mach/hardware.h>
+
+#include "../hardware.h"
#include "devices-common.h"
#define imx_ipu_core_entry_single(soc) \
diff --git a/arch/arm/mach-imx/devices/platform-mx2-camera.c b/arch/arm/mach-imx/devices/platform-mx2-camera.c
index b88877d..f491016 100644
--- a/arch/arm/mach-imx/devices/platform-mx2-camera.c
+++ b/arch/arm/mach-imx/devices/platform-mx2-camera.c
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/hardware.h>
+#include "../hardware.h"
#include "devices-common.h"
#define imx_mx2_camera_data_entry_single(soc, _devid) \
diff --git a/arch/arm/mach-imx/devices/platform-mxc-ehci.c b/arch/arm/mach-imx/devices/platform-mxc-ehci.c
index 27c8171..5d4bbbf 100644
--- a/arch/arm/mach-imx/devices/platform-mxc-ehci.c
+++ b/arch/arm/mach-imx/devices/platform-mxc-ehci.c
@@ -7,7 +7,8 @@
* Free Software Foundation.
*/
#include <linux/dma-mapping.h>
-#include <mach/hardware.h>
+
+#include "../hardware.h"
#include "devices-common.h"
#define imx_mxc_ehci_data_entry_single(soc, _id, hs) \
diff --git a/arch/arm/mach-imx/devices/platform-mxc-mmc.c b/arch/arm/mach-imx/devices/platform-mxc-mmc.c
index 487f61c..7da19af 100644
--- a/arch/arm/mach-imx/devices/platform-mxc-mmc.c
+++ b/arch/arm/mach-imx/devices/platform-mxc-mmc.c
@@ -7,7 +7,8 @@
* Free Software Foundation.
*/
#include <linux/dma-mapping.h>
-#include <mach/hardware.h>
+
+#include "../hardware.h"
#include "devices-common.h"
#define imx_mxc_mmc_data_entry_single(soc, _devid, _id, _hwid, _size) \
diff --git a/arch/arm/mach-imx/devices/platform-mxc_nand.c b/arch/arm/mach-imx/devices/platform-mxc_nand.c
index cec6961..6743b11 100644
--- a/arch/arm/mach-imx/devices/platform-mxc_nand.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_nand.c
@@ -7,7 +7,8 @@
* Free Software Foundation.
*/
#include <asm/sizes.h>
-#include <mach/hardware.h>
+
+#include "../hardware.h"
#include "devices-common.h"
#define imx_mxc_nand_data_entry_single(soc, _devid, _size) \
diff --git a/arch/arm/mach-imx/devices/platform-mxc_pwm.c b/arch/arm/mach-imx/devices/platform-mxc_pwm.c
index a0551bf..dcd2897 100644
--- a/arch/arm/mach-imx/devices/platform-mxc_pwm.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_pwm.c
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/hardware.h>
+#include "../hardware.h"
#include "devices-common.h"
#define imx_mxc_pwm_data_entry_single(soc, _id, _hwid, _size) \
diff --git a/arch/arm/mach-imx/devices/platform-mxc_rnga.c b/arch/arm/mach-imx/devices/platform-mxc_rnga.c
index 37bb23c..c58404b 100644
--- a/arch/arm/mach-imx/devices/platform-mxc_rnga.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_rnga.c
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/hardware.h>
+#include "../hardware.h"
#include "devices-common.h"
struct imx_mxc_rnga_data {
diff --git a/arch/arm/mach-imx/devices/platform-mxc_rtc.c b/arch/arm/mach-imx/devices/platform-mxc_rtc.c
index f35f848..c7fffaa 100644
--- a/arch/arm/mach-imx/devices/platform-mxc_rtc.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_rtc.c
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/hardware.h>
+#include "../hardware.h"
#include "devices-common.h"
#define imx_mxc_rtc_data_entry_single(soc, _devid) \
diff --git a/arch/arm/mach-imx/devices/platform-mxc_w1.c b/arch/arm/mach-imx/devices/platform-mxc_w1.c
index 5f972c6..88c18b7 100644
--- a/arch/arm/mach-imx/devices/platform-mxc_w1.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_w1.c
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/hardware.h>
+#include "../hardware.h"
#include "devices-common.h"
#define imx_mxc_w1_data_entry_single(soc) \
diff --git a/arch/arm/mach-imx/devices/platform-pata_imx.c b/arch/arm/mach-imx/devices/platform-pata_imx.c
index 3627ec8d..e4ec11c 100644
--- a/arch/arm/mach-imx/devices/platform-pata_imx.c
+++ b/arch/arm/mach-imx/devices/platform-pata_imx.c
@@ -3,7 +3,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/hardware.h>
+#include "../hardware.h"
#include "devices-common.h"
#define imx_pata_imx_data_entry_single(soc, _size) \
diff --git a/arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c b/arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c
index 772ba2d..e66a4e3 100644
--- a/arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c
+++ b/arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c
@@ -6,8 +6,9 @@
* Free Software Foundation.
*/
-#include <mach/hardware.h>
#include <linux/platform_data/mmc-esdhc-imx.h>
+
+#include "../hardware.h"
#include "devices-common.h"
#define imx_sdhci_esdhc_imx_data_entry_single(soc, _devid, _id, hwid) \
diff --git a/arch/arm/mach-imx/devices/platform-spi_imx.c b/arch/arm/mach-imx/devices/platform-spi_imx.c
index 63a116b..8880bcb 100644
--- a/arch/arm/mach-imx/devices/platform-spi_imx.c
+++ b/arch/arm/mach-imx/devices/platform-spi_imx.c
@@ -6,7 +6,7 @@
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
-#include <mach/hardware.h>
+#include "../hardware.h"
#include "devices-common.h"
#define imx_spi_imx_data_entry_single(soc, type, _devid, _id, hwid, _size) \
diff --git a/arch/arm/mach-imx/ehci-imx25.c b/arch/arm/mach-imx/ehci-imx25.c
index 412c583..27e40d1 100644
--- a/arch/arm/mach-imx/ehci-imx25.c
+++ b/arch/arm/mach-imx/ehci-imx25.c
@@ -15,10 +15,10 @@
#include <linux/platform_device.h>
#include <linux/io.h>
-
-#include <mach/hardware.h>
#include <linux/platform_data/usb-ehci-mxc.h>
+#include "hardware.h"
+
#define USBCTRL_OTGBASE_OFFSET 0x600
#define MX25_OTG_SIC_SHIFT 29
diff --git a/arch/arm/mach-imx/ehci-imx27.c b/arch/arm/mach-imx/ehci-imx27.c
index cd6e1f8..448d911 100644
--- a/arch/arm/mach-imx/ehci-imx27.c
+++ b/arch/arm/mach-imx/ehci-imx27.c
@@ -15,10 +15,10 @@
#include <linux/platform_device.h>
#include <linux/io.h>
-
-#include <mach/hardware.h>
#include <linux/platform_data/usb-ehci-mxc.h>
+#include "hardware.h"
+
#define USBCTRL_OTGBASE_OFFSET 0x600
#define MX27_OTG_SIC_SHIFT 29
diff --git a/arch/arm/mach-imx/ehci-imx31.c b/arch/arm/mach-imx/ehci-imx31.c
index 9a880c7..05de4e1 100644
--- a/arch/arm/mach-imx/ehci-imx31.c
+++ b/arch/arm/mach-imx/ehci-imx31.c
@@ -15,10 +15,10 @@
#include <linux/platform_device.h>
#include <linux/io.h>
-
-#include <mach/hardware.h>
#include <linux/platform_data/usb-ehci-mxc.h>
+#include "hardware.h"
+
#define USBCTRL_OTGBASE_OFFSET 0x600
#define MX31_OTG_SIC_SHIFT 29
diff --git a/arch/arm/mach-imx/ehci-imx35.c b/arch/arm/mach-imx/ehci-imx35.c
index 779e16e..a596f70 100644
--- a/arch/arm/mach-imx/ehci-imx35.c
+++ b/arch/arm/mach-imx/ehci-imx35.c
@@ -15,10 +15,10 @@
#include <linux/platform_device.h>
#include <linux/io.h>
-
-#include <mach/hardware.h>
#include <linux/platform_data/usb-ehci-mxc.h>
+#include "hardware.h"
+
#define USBCTRL_OTGBASE_OFFSET 0x600
#define MX35_OTG_SIC_SHIFT 29
diff --git a/arch/arm/mach-imx/ehci-imx5.c b/arch/arm/mach-imx/ehci-imx5.c
index cf8d00e..e49710b 100644
--- a/arch/arm/mach-imx/ehci-imx5.c
+++ b/arch/arm/mach-imx/ehci-imx5.c
@@ -15,10 +15,10 @@
#include <linux/platform_device.h>
#include <linux/io.h>
-
-#include <mach/hardware.h>
#include <linux/platform_data/usb-ehci-mxc.h>
+#include "hardware.h"
+
#define MXC_OTG_OFFSET 0
#define MXC_H1_OFFSET 0x200
#define MXC_H2_OFFSET 0x400
diff --git a/arch/arm/mach-imx/epit.c b/arch/arm/mach-imx/epit.c
index 76720f5..04a5961 100644
--- a/arch/arm/mach-imx/epit.c
+++ b/arch/arm/mach-imx/epit.c
@@ -51,11 +51,10 @@
#include <linux/clockchips.h>
#include <linux/clk.h>
#include <linux/err.h>
-
-#include <mach/hardware.h>
#include <asm/mach/time.h>
#include "common.h"
+#include "hardware.h"
static struct clock_event_device clockevent_epit;
static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED;
diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
index c29e2c5..b94cf41 100644
--- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
@@ -29,10 +29,9 @@
#include <asm/mach/arch.h>
-#include <mach/hardware.h>
-
#include "common.h"
#include "devices-imx27.h"
+#include "hardware.h"
#include "iomux-mx27.h"
static const int eukrea_mbimx27_pins[] __initconst = {
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
index fd7112e..0c549b7 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
@@ -26,14 +26,14 @@
#include <linux/spi/spi.h>
#include <video/platform_lcd.h>
-#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
-#include <mach/mx25.h>
#include "common.h"
#include "devices-imx25.h"
+#include "hardware.h"
#include "iomux-mx25.h"
+#include "mx25.h"
static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
/* LCD */
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
index 01b5996..1322d51 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
@@ -36,10 +36,9 @@
#include <asm/mach/time.h>
#include <asm/mach/map.h>
-#include <mach/hardware.h>
-
#include "common.h"
#include "devices-imx35.h"
+#include "hardware.h"
#include "iomux-mx35.h"
static const struct fb_videomode fb_modedb[] = {
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
index 17245a4..87807cc 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
@@ -36,10 +36,9 @@
#include <asm/mach/time.h>
#include <asm/mach/map.h>
-#include <mach/hardware.h>
-
#include "common.h"
#include "devices-imx51.h"
+#include "hardware.h"
#include "iomux-mx51.h"
static iomux_v3_cfg_t eukrea_mbimxsd51_pads[] = {
diff --git a/arch/arm/mach-imx/include/mach/hardware.h b/arch/arm/mach-imx/hardware.h
similarity index 94%
rename from arch/arm/mach-imx/include/mach/hardware.h
rename to arch/arm/mach-imx/hardware.h
index ebf1065..3ce7fa3 100644
--- a/arch/arm/mach-imx/include/mach/hardware.h
+++ b/arch/arm/mach-imx/hardware.h
@@ -105,20 +105,20 @@
#define IMX_IO_ADDRESS(x) IOMEM(IMX_IO_P2V(x))
-#include <mach/mxc.h>
+#include "mxc.h"
-#include <mach/mx6q.h>
-#include <mach/mx50.h>
-#include <mach/mx51.h>
-#include <mach/mx53.h>
-#include <mach/mx3x.h>
-#include <mach/mx31.h>
-#include <mach/mx35.h>
-#include <mach/mx2x.h>
-#include <mach/mx21.h>
-#include <mach/mx27.h>
-#include <mach/mx1.h>
-#include <mach/mx25.h>
+#include "mx6q.h"
+#include "mx50.h"
+#include "mx51.h"
+#include "mx53.h"
+#include "mx3x.h"
+#include "mx31.h"
+#include "mx35.h"
+#include "mx2x.h"
+#include "mx21.h"
+#include "mx27.h"
+#include "mx1.h"
+#include "mx25.h"
#define imx_map_entry(soc, name, _type) { \
.virtual = soc ## _IO_P2V(soc ## _ ## name ## _BASE_ADDR), \
diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c
index a6c288e..ebfae96 100644
--- a/arch/arm/mach-imx/imx27-dt.c
+++ b/arch/arm/mach-imx/imx27-dt.c
@@ -14,9 +14,9 @@
#include <linux/of_platform.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/mx27.h>
#include "common.h"
+#include "mx27.h"
static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = {
OF_DEV_AUXDATA("fsl,imx27-uart", MX27_UART1_BASE_ADDR, "imx21-uart.0", NULL),
diff --git a/arch/arm/mach-imx/imx31-dt.c b/arch/arm/mach-imx/imx31-dt.c
index 408afcc..af476de 100644
--- a/arch/arm/mach-imx/imx31-dt.c
+++ b/arch/arm/mach-imx/imx31-dt.c
@@ -14,9 +14,9 @@
#include <linux/of_platform.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/mx31.h>
#include "common.h"
+#include "mx31.h"
static const struct of_dev_auxdata imx31_auxdata_lookup[] __initconst = {
OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART1_BASE_ADDR,
diff --git a/arch/arm/mach-imx/imx51-dt.c b/arch/arm/mach-imx/imx51-dt.c
index a0391a1..5074299 100644
--- a/arch/arm/mach-imx/imx51-dt.c
+++ b/arch/arm/mach-imx/imx51-dt.c
@@ -15,9 +15,9 @@
#include <linux/of_platform.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/mx51.h>
#include "common.h"
+#include "mx51.h"
/*
* Lookup table for attaching a specific name and platform_data pointer to
diff --git a/arch/arm/mach-imx/iomux-imx31.c b/arch/arm/mach-imx/iomux-imx31.c
index 7c3ba2b..cabefbc 100644
--- a/arch/arm/mach-imx/iomux-imx31.c
+++ b/arch/arm/mach-imx/iomux-imx31.c
@@ -22,8 +22,8 @@
#include <linux/spinlock.h>
#include <linux/io.h>
#include <linux/kernel.h>
-#include <mach/hardware.h>
+#include "hardware.h"
#include "iomux-mx3.h"
/*
diff --git a/arch/arm/mach-imx/iomux-v1.c b/arch/arm/mach-imx/iomux-v1.c
index 2ac5580..2b156d1 100644
--- a/arch/arm/mach-imx/iomux-v1.c
+++ b/arch/arm/mach-imx/iomux-v1.c
@@ -28,9 +28,9 @@
#include <linux/string.h>
#include <linux/gpio.h>
-#include <mach/hardware.h>
#include <asm/mach/map.h>
+#include "hardware.h"
#include "iomux-v1.h"
static void __iomem *imx_iomuxv1_baseaddr;
diff --git a/arch/arm/mach-imx/iomux-v3.c b/arch/arm/mach-imx/iomux-v3.c
index de1459c..9dae74b 100644
--- a/arch/arm/mach-imx/iomux-v3.c
+++ b/arch/arm/mach-imx/iomux-v3.c
@@ -25,9 +25,9 @@
#include <linux/string.h>
#include <linux/gpio.h>
-#include <mach/hardware.h>
#include <asm/mach/map.h>
+#include "hardware.h"
#include "iomux-v3.h"
static void __iomem *base;
diff --git a/arch/arm/mach-imx/lluart.c b/arch/arm/mach-imx/lluart.c
index c40a34c..5f15103 100644
--- a/arch/arm/mach-imx/lluart.c
+++ b/arch/arm/mach-imx/lluart.c
@@ -14,7 +14,8 @@
#include <asm/page.h>
#include <asm/sizes.h>
#include <asm/mach/map.h>
-#include <mach/hardware.h>
+
+#include "hardware.h"
static struct map_desc imx_lluart_desc = {
#ifdef CONFIG_DEBUG_IMX6Q_UART2
diff --git a/arch/arm/mach-imx/mach-apf9328.c b/arch/arm/mach-imx/mach-apf9328.c
index a0b4c3f..5c9bd2c 100644
--- a/arch/arm/mach-imx/mach-apf9328.c
+++ b/arch/arm/mach-imx/mach-apf9328.c
@@ -25,10 +25,9 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/hardware.h>
-
#include "common.h"
#include "devices-imx1.h"
+#include "hardware.h"
#include "iomux-mx1.h"
static const int apf9328_pins[] __initconst = {
diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c
index ea8731f..ae6484a 100644
--- a/arch/arm/mach-imx/mach-armadillo5x0.c
+++ b/arch/arm/mach-imx/mach-armadillo5x0.c
@@ -41,7 +41,6 @@
#include <linux/regulator/machine.h>
#include <linux/regulator/fixed.h>
-#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
@@ -51,6 +50,7 @@
#include "common.h"
#include "devices-imx31.h"
#include "crmregs-imx3.h"
+#include "hardware.h"
#include "iomux-mx3.h"
#include "ulpi.h"
diff --git a/arch/arm/mach-imx/mach-bug.c b/arch/arm/mach-imx/mach-bug.c
index b98e982..3a39d5a 100644
--- a/arch/arm/mach-imx/mach-bug.c
+++ b/arch/arm/mach-imx/mach-bug.c
@@ -19,14 +19,13 @@
#include <linux/init.h>
#include <linux/platform_device.h>
-#include <mach/hardware.h>
-
#include <asm/mach/time.h>
#include <asm/mach/arch.h>
#include <asm/mach-types.h>
#include "common.h"
#include "devices-imx31.h"
+#include "hardware.h"
#include "iomux-mx3.h"
static const struct imxuart_platform_data uart_pdata __initconst = {
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c
index 37571f3..12a3706 100644
--- a/arch/arm/mach-imx/mach-cpuimx27.c
+++ b/arch/arm/mach-imx/mach-cpuimx27.c
@@ -34,11 +34,10 @@
#include <asm/mach/time.h>
#include <asm/mach/map.h>
-#include <mach/hardware.h>
-
#include "common.h"
#include "devices-imx27.h"
#include "eukrea-baseboards.h"
+#include "hardware.h"
#include "iomux-mx27.h"
#include "ulpi.h"
diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c
index 86d4ac9..5a31bf8 100644
--- a/arch/arm/mach-imx/mach-cpuimx35.c
+++ b/arch/arm/mach-imx/mach-cpuimx35.c
@@ -37,11 +37,10 @@
#include <asm/mach/time.h>
#include <asm/mach/map.h>
-#include <mach/hardware.h>
-
#include "common.h"
#include "devices-imx35.h"
#include "eukrea-baseboards.h"
+#include "hardware.h"
#include "iomux-mx35.h"
static const struct imxuart_platform_data uart_pdata __initconst = {
diff --git a/arch/arm/mach-imx/mach-cpuimx51sd.c b/arch/arm/mach-imx/mach-cpuimx51sd.c
index 58ad093..b727de0 100644
--- a/arch/arm/mach-imx/mach-cpuimx51sd.c
+++ b/arch/arm/mach-imx/mach-cpuimx51sd.c
@@ -26,8 +26,6 @@
#include <linux/spi/spi.h>
#include <linux/can/platform/mcp251x.h>
-#include <mach/hardware.h>
-
#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -37,6 +35,7 @@
#include "devices-imx51.h"
#include "cpu_op-mx51.h"
#include "eukrea-baseboards.h"
+#include "hardware.h"
#include "iomux-mx51.h"
#define USBH1_RST IMX_GPIO_NR(2, 28)
diff --git a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
index e754b0c..75027a5 100644
--- a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
+++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
@@ -27,18 +27,18 @@
#include <linux/usb/otg.h>
#include <linux/usb/ulpi.h>
-#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/memory.h>
#include <asm/mach/map.h>
-#include <mach/mx25.h>
#include "common.h"
#include "devices-imx25.h"
#include "eukrea-baseboards.h"
+#include "hardware.h"
#include "iomux-mx25.h"
+#include "mx25.h"
static const struct imxuart_platform_data uart_pdata __initconst = {
.flags = IMXUART_HAVE_RTSCTS,
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index 31e30a2..a4dad7c 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -40,10 +40,10 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/system_info.h>
-#include <mach/hardware.h>
#include "common.h"
#include "devices-imx27.h"
+#include "hardware.h"
#include "iomux-mx27.h"
#define TVP5150_RSTN (GPIO_PORTC + 18)
diff --git a/arch/arm/mach-imx/mach-imx27ipcam.c b/arch/arm/mach-imx/mach-imx27ipcam.c
index 725a87f..53a8601 100644
--- a/arch/arm/mach-imx/mach-imx27ipcam.c
+++ b/arch/arm/mach-imx/mach-imx27ipcam.c
@@ -17,8 +17,8 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/hardware.h>
+#include "hardware.h"
#include "common.h"
#include "devices-imx27.h"
#include "iomux-mx27.h"
diff --git a/arch/arm/mach-imx/mach-imx27lite.c b/arch/arm/mach-imx/mach-imx27lite.c
index ec46030..fc8dce9 100644
--- a/arch/arm/mach-imx/mach-imx27lite.c
+++ b/arch/arm/mach-imx/mach-imx27lite.c
@@ -20,10 +20,10 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/mach/map.h>
-#include <mach/hardware.h>
#include "common.h"
#include "devices-imx27.h"
+#include "hardware.h"
#include "iomux-mx27.h"
static const int mx27lite_pins[] __initconst = {
diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c
index 0e0aadfb..e71e6261 100644
--- a/arch/arm/mach-imx/mach-imx53.c
+++ b/arch/arm/mach-imx/mach-imx53.c
@@ -19,9 +19,9 @@
#include <linux/of_platform.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/mx53.h>
#include "common.h"
+#include "mx53.h"
/*
* Lookup table for attaching a specific name and platform_data pointer to
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index b74f02f..a6f114e 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -32,10 +32,10 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/system_misc.h>
-#include <mach/hardware.h>
#include "common.h"
#include "cpuidle.h"
+#include "hardware.h"
void imx6q_restart(char mode, const char *cmd)
{
diff --git a/arch/arm/mach-imx/mach-kzm_arm11_01.c b/arch/arm/mach-imx/mach-kzm_arm11_01.c
index 73334b8..11b198a 100644
--- a/arch/arm/mach-imx/mach-kzm_arm11_01.c
+++ b/arch/arm/mach-imx/mach-kzm_arm11_01.c
@@ -36,10 +36,9 @@
#include <asm/mach/map.h>
#include <asm/mach/time.h>
-#include <mach/hardware.h>
-
#include "common.h"
#include "devices-imx31.h"
+#include "hardware.h"
#include "iomux-mx3.h"
#define KZM_ARM11_IO_ADDRESS(x) (IOMEM( \
diff --git a/arch/arm/mach-imx/mach-mx1ads.c b/arch/arm/mach-imx/mach-mx1ads.c
index 8be62f3..06b4837 100644
--- a/arch/arm/mach-imx/mach-mx1ads.c
+++ b/arch/arm/mach-imx/mach-mx1ads.c
@@ -23,10 +23,9 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/hardware.h>
-
#include "common.h"
#include "devices-imx1.h"
+#include "hardware.h"
#include "iomux-mx1.h"
static const int mx1ads_pins[] __initconst = {
diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c
index 99adc9f..6adb313 100644
--- a/arch/arm/mach-imx/mach-mx21ads.c
+++ b/arch/arm/mach-imx/mach-mx21ads.c
@@ -18,7 +18,6 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/physmap.h>
#include <linux/gpio.h>
-#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
@@ -26,6 +25,7 @@
#include "common.h"
#include "devices-imx21.h"
+#include "hardware.h"
#include "iomux-mx21.h"
/*
diff --git a/arch/arm/mach-imx/mach-mx25_3ds.c b/arch/arm/mach-imx/mach-mx25_3ds.c
index 5a17dd6..b1b03aa 100644
--- a/arch/arm/mach-imx/mach-mx25_3ds.c
+++ b/arch/arm/mach-imx/mach-mx25_3ds.c
@@ -31,17 +31,17 @@
#include <linux/platform_device.h>
#include <linux/usb/otg.h>
-#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/memory.h>
#include <asm/mach/map.h>
-#include <mach/mx25.h>
#include "common.h"
#include "devices-imx25.h"
+#include "hardware.h"
#include "iomux-mx25.h"
+#include "mx25.h"
#define MX25PDK_CAN_PWDN IMX_GPIO_NR(4, 6)
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index a54df77..d0e547f 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -36,11 +36,11 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/hardware.h>
#include "3ds_debugboard.h"
#include "common.h"
#include "devices-imx27.h"
+#include "hardware.h"
#include "iomux-mx27.h"
#include "ulpi.h"
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index beb281c..3d036f5 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -21,7 +21,6 @@
#include <linux/mtd/physmap.h>
#include <linux/i2c.h>
#include <linux/irq.h>
-#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
@@ -29,6 +28,7 @@
#include "common.h"
#include "devices-imx27.h"
+#include "hardware.h"
#include "iomux-mx27.h"
/*
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c
index 0333567..bc301be 100644
--- a/arch/arm/mach-imx/mach-mx31_3ds.c
+++ b/arch/arm/mach-imx/mach-mx31_3ds.c
@@ -30,7 +30,6 @@
#include <media/soc_camera.h>
-#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
@@ -41,6 +40,7 @@
#include "3ds_debugboard.h"
#include "common.h"
#include "devices-imx31.h"
+#include "hardware.h"
#include "iomux-mx3.h"
#include "ulpi.h"
diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c
index 1fab27a..c5d4be9 100644
--- a/arch/arm/mach-imx/mach-mx31ads.c
+++ b/arch/arm/mach-imx/mach-mx31ads.c
@@ -28,7 +28,6 @@
#include <asm/mach/time.h>
#include <asm/memory.h>
#include <asm/mach/map.h>
-#include <mach/hardware.h>
#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1
#include <linux/mfd/wm8350/audio.h>
@@ -38,6 +37,7 @@
#include "common.h"
#include "devices-imx31.h"
+#include "hardware.h"
#include "iomux-mx3.h"
/* Base address of PBC controller */
diff --git a/arch/arm/mach-imx/mach-mx31lilly.c b/arch/arm/mach-imx/mach-mx31lilly.c
index 74b5fa9..08b9965 100644
--- a/arch/arm/mach-imx/mach-mx31lilly.c
+++ b/arch/arm/mach-imx/mach-mx31lilly.c
@@ -42,11 +42,10 @@
#include <asm/mach/time.h>
#include <asm/mach/map.h>
-#include <mach/hardware.h>
-
#include "board-mx31lilly.h"
#include "common.h"
#include "devices-imx31.h"
+#include "hardware.h"
#include "iomux-mx3.h"
#include "ulpi.h"
diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c
index 904aa63..8139097 100644
--- a/arch/arm/mach-imx/mach-mx31lite.c
+++ b/arch/arm/mach-imx/mach-mx31lite.c
@@ -39,11 +39,10 @@
#include <asm/page.h>
#include <asm/setup.h>
-#include <mach/hardware.h>
-
#include "board-mx31lite.h"
#include "common.h"
#include "devices-imx31.h"
+#include "hardware.h"
#include "iomux-mx3.h"
#include "ulpi.h"
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c
index 31c7d05..2517cfa 100644
--- a/arch/arm/mach-imx/mach-mx31moboard.c
+++ b/arch/arm/mach-imx/mach-mx31moboard.c
@@ -42,12 +42,12 @@
#include <asm/mach/time.h>
#include <asm/mach/map.h>
#include <asm/memblock.h>
-#include <mach/hardware.h>
#include <linux/platform_data/asoc-imx-ssi.h>
#include "board-mx31moboard.h"
#include "common.h"
#include "devices-imx31.h"
+#include "hardware.h"
#include "iomux-mx3.h"
#include "ulpi.h"
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c
index ee7d037..5277da4 100644
--- a/arch/arm/mach-imx/mach-mx35_3ds.c
+++ b/arch/arm/mach-imx/mach-mx35_3ds.c
@@ -43,7 +43,6 @@
#include <asm/mach/map.h>
#include <asm/memblock.h>
-#include <mach/hardware.h>
#include <video/platform_lcd.h>
#include <media/soc_camera.h>
@@ -51,6 +50,7 @@
#include "3ds_debugboard.h"
#include "common.h"
#include "devices-imx35.h"
+#include "hardware.h"
#include "iomux-mx35.h"
#define GPIO_MC9S08DZ60_GPS_ENABLE 0
diff --git a/arch/arm/mach-imx/mach-mx50_rdp.c b/arch/arm/mach-imx/mach-mx50_rdp.c
index 4a3e98e..0c1f88a 100644
--- a/arch/arm/mach-imx/mach-mx50_rdp.c
+++ b/arch/arm/mach-imx/mach-mx50_rdp.c
@@ -24,8 +24,6 @@
#include <linux/delay.h>
#include <linux/io.h>
-#include <mach/hardware.h>
-
#include <asm/irq.h>
#include <asm/setup.h>
#include <asm/mach-types.h>
@@ -34,6 +32,7 @@
#include "common.h"
#include "devices-imx50.h"
+#include "hardware.h"
#include "iomux-mx50.h"
#define FEC_EN IMX_GPIO_NR(6, 23)
diff --git a/arch/arm/mach-imx/mach-mx51_3ds.c b/arch/arm/mach-imx/mach-mx51_3ds.c
index 476c759..abc25bd 100644
--- a/arch/arm/mach-imx/mach-mx51_3ds.c
+++ b/arch/arm/mach-imx/mach-mx51_3ds.c
@@ -19,11 +19,10 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/hardware.h>
-
#include "3ds_debugboard.h"
#include "common.h"
#include "devices-imx51.h"
+#include "hardware.h"
#include "iomux-mx51.h"
#define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28)
diff --git a/arch/arm/mach-imx/mach-mx51_babbage.c b/arch/arm/mach-imx/mach-mx51_babbage.c
index 383948a..d9a84ca 100644
--- a/arch/arm/mach-imx/mach-mx51_babbage.c
+++ b/arch/arm/mach-imx/mach-mx51_babbage.c
@@ -20,8 +20,6 @@
#include <linux/spi/flash.h>
#include <linux/spi/spi.h>
-#include <mach/hardware.h>
-
#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -30,6 +28,7 @@
#include "common.h"
#include "devices-imx51.h"
#include "cpu_op-mx51.h"
+#include "hardware.h"
#include "iomux-mx51.h"
#define BABBAGE_USB_HUB_RESET IMX_GPIO_NR(1, 7)
diff --git a/arch/arm/mach-imx/mach-mxt_td60.c b/arch/arm/mach-imx/mach-mxt_td60.c
index f1cbe03..f4a8c7e 100644
--- a/arch/arm/mach-imx/mach-mxt_td60.c
+++ b/arch/arm/mach-imx/mach-mxt_td60.c
@@ -21,7 +21,6 @@
#include <linux/mtd/physmap.h>
#include <linux/i2c.h>
#include <linux/irq.h>
-#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
@@ -31,6 +30,7 @@
#include "common.h"
#include "devices-imx27.h"
+#include "hardware.h"
#include "iomux-mx27.h"
static const int mxt_td60_pins[] __initconst = {
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c
index 743d7e9..eee369f 100644
--- a/arch/arm/mach-imx/mach-pca100.c
+++ b/arch/arm/mach-imx/mach-pca100.c
@@ -32,11 +32,11 @@
#include <asm/mach/arch.h>
#include <asm/mach-types.h>
-#include <mach/hardware.h>
#include <asm/mach/time.h>
#include "common.h"
#include "devices-imx27.h"
+#include "hardware.h"
#include "iomux-mx27.h"
#include "ulpi.h"
diff --git a/arch/arm/mach-imx/mach-pcm037.c b/arch/arm/mach-imx/mach-pcm037.c
index 525f057..547fef1 100644
--- a/arch/arm/mach-imx/mach-pcm037.c
+++ b/arch/arm/mach-imx/mach-pcm037.c
@@ -42,10 +42,10 @@
#include <asm/mach/time.h>
#include <asm/mach/map.h>
#include <asm/memblock.h>
-#include <mach/hardware.h>
#include "common.h"
#include "devices-imx31.h"
+#include "hardware.h"
#include "iomux-mx3.h"
#include "pcm037.h"
#include "ulpi.h"
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c
index 8bf95f5..4aa0d07 100644
--- a/arch/arm/mach-imx/mach-pcm038.c
+++ b/arch/arm/mach-imx/mach-pcm038.c
@@ -33,11 +33,10 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/hardware.h>
-
#include "board-pcm038.h"
#include "common.h"
#include "devices-imx27.h"
+#include "hardware.h"
#include "iomux-mx27.h"
#include "ulpi.h"
diff --git a/arch/arm/mach-imx/mach-pcm043.c b/arch/arm/mach-imx/mach-pcm043.c
index 54ac947..9244544 100644
--- a/arch/arm/mach-imx/mach-pcm043.c
+++ b/arch/arm/mach-imx/mach-pcm043.c
@@ -33,10 +33,9 @@
#include <asm/mach/time.h>
#include <asm/mach/map.h>
-#include <mach/hardware.h>
-
#include "common.h"
#include "devices-imx35.h"
+#include "hardware.h"
#include "iomux-mx35.h"
#include "ulpi.h"
diff --git a/arch/arm/mach-imx/mach-qong.c b/arch/arm/mach-imx/mach-qong.c
index 962988a..96d9a91 100644
--- a/arch/arm/mach-imx/mach-qong.c
+++ b/arch/arm/mach-imx/mach-qong.c
@@ -21,7 +21,6 @@
#include <linux/mtd/nand.h>
#include <linux/gpio.h>
-#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
@@ -31,6 +30,7 @@
#include "common.h"
#include "devices-imx31.h"
+#include "hardware.h"
#include "iomux-mx3.h"
/* FPGA defines */
diff --git a/arch/arm/mach-imx/mach-scb9328.c b/arch/arm/mach-imx/mach-scb9328.c
index c491756..fc97040 100644
--- a/arch/arm/mach-imx/mach-scb9328.c
+++ b/arch/arm/mach-imx/mach-scb9328.c
@@ -20,10 +20,9 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/hardware.h>
-
#include "common.h"
#include "devices-imx1.h"
+#include "hardware.h"
#include "iomux-mx1.h"
/*
diff --git a/arch/arm/mach-imx/mach-vpr200.c b/arch/arm/mach-imx/mach-vpr200.c
index 288a920..3aecf91 100644
--- a/arch/arm/mach-imx/mach-vpr200.c
+++ b/arch/arm/mach-imx/mach-vpr200.c
@@ -28,14 +28,13 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <mach/hardware.h>
-
#include <linux/i2c.h>
#include <linux/i2c/at24.h>
#include <linux/mfd/mc13xxx.h>
#include "common.h"
#include "devices-imx35.h"
+#include "hardware.h"
#include "iomux-mx35.h"
#define GPIO_LCDPWR IMX_GPIO_NR(1, 2)
diff --git a/arch/arm/mach-imx/mm-imx1.c b/arch/arm/mach-imx/mm-imx1.c
index 79f6c0b..7a14667 100644
--- a/arch/arm/mach-imx/mm-imx1.c
+++ b/arch/arm/mach-imx/mm-imx1.c
@@ -22,10 +22,9 @@
#include <asm/mach/map.h>
-#include <mach/hardware.h>
-
#include "common.h"
#include "devices/devices-common.h"
+#include "hardware.h"
#include "iomux-v1.h"
static struct map_desc imx_io_desc[] __initdata = {
diff --git a/arch/arm/mach-imx/mm-imx21.c b/arch/arm/mach-imx/mm-imx21.c
index 3b97ea6..8868398 100644
--- a/arch/arm/mach-imx/mm-imx21.c
+++ b/arch/arm/mach-imx/mm-imx21.c
@@ -21,12 +21,12 @@
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/pinctrl/machine.h>
-#include <mach/hardware.h>
#include <asm/pgtable.h>
#include <asm/mach/map.h>
#include "common.h"
#include "devices/devices-common.h"
+#include "hardware.h"
#include "iomux-v1.h"
/* MX21 memory map definition */
diff --git a/arch/arm/mach-imx/mm-imx25.c b/arch/arm/mach-imx/mm-imx25.c
index a08a960..9be33cd 100644
--- a/arch/arm/mach-imx/mm-imx25.c
+++ b/arch/arm/mach-imx/mm-imx25.c
@@ -24,12 +24,11 @@
#include <asm/pgtable.h>
#include <asm/mach/map.h>
-#include <mach/hardware.h>
-#include <mach/mx25.h>
-
#include "common.h"
#include "devices/devices-common.h"
+#include "hardware.h"
#include "iomux-v3.h"
+#include "mx25.h"
/*
* This table defines static virtual address mappings for I/O regions.
diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c
index 91e8da8..ecaa5b9 100644
--- a/arch/arm/mach-imx/mm-imx27.c
+++ b/arch/arm/mach-imx/mm-imx27.c
@@ -21,12 +21,12 @@
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/pinctrl/machine.h>
-#include <mach/hardware.h>
#include <asm/pgtable.h>
#include <asm/mach/map.h>
#include "common.h"
#include "devices/devices-common.h"
+#include "hardware.h"
#include "iomux-v1.h"
/* MX27 memory map definition */
diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c
index 3e2ed2a..072b3bf 100644
--- a/arch/arm/mach-imx/mm-imx3.c
+++ b/arch/arm/mach-imx/mm-imx3.c
@@ -26,11 +26,10 @@
#include <asm/hardware/cache-l2x0.h>
#include <asm/mach/map.h>
-#include <mach/hardware.h>
-
#include "common.h"
#include "crmregs-imx3.h"
#include "devices/devices-common.h"
+#include "hardware.h"
#include "iomux-v3.h"
void __iomem *mx3_ccm_base;
diff --git a/arch/arm/mach-imx/mm-imx5.c b/arch/arm/mach-imx/mm-imx5.c
index d9ef24b..e739553 100644
--- a/arch/arm/mach-imx/mm-imx5.c
+++ b/arch/arm/mach-imx/mm-imx5.c
@@ -18,10 +18,9 @@
#include <asm/mach/map.h>
-#include <mach/hardware.h>
-
#include "common.h"
#include "devices/devices-common.h"
+#include "hardware.h"
#include "iomux-v3.h"
/*
diff --git a/arch/arm/mach-imx/include/mach/mx1.h b/arch/arm/mach-imx/mx1.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/mx1.h
rename to arch/arm/mach-imx/mx1.h
diff --git a/arch/arm/mach-imx/include/mach/mx21.h b/arch/arm/mach-imx/mx21.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/mx21.h
rename to arch/arm/mach-imx/mx21.h
diff --git a/arch/arm/mach-imx/include/mach/mx25.h b/arch/arm/mach-imx/mx25.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/mx25.h
rename to arch/arm/mach-imx/mx25.h
diff --git a/arch/arm/mach-imx/include/mach/mx27.h b/arch/arm/mach-imx/mx27.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/mx27.h
rename to arch/arm/mach-imx/mx27.h
diff --git a/arch/arm/mach-imx/include/mach/mx2x.h b/arch/arm/mach-imx/mx2x.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/mx2x.h
rename to arch/arm/mach-imx/mx2x.h
diff --git a/arch/arm/mach-imx/include/mach/mx31.h b/arch/arm/mach-imx/mx31.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/mx31.h
rename to arch/arm/mach-imx/mx31.h
diff --git a/arch/arm/mach-imx/mx31lilly-db.c b/arch/arm/mach-imx/mx31lilly-db.c
index 8cdcf0f..d4361b8 100644
--- a/arch/arm/mach-imx/mx31lilly-db.c
+++ b/arch/arm/mach-imx/mx31lilly-db.c
@@ -30,11 +30,10 @@
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
-#include <mach/hardware.h>
-
#include "board-mx31lilly.h"
#include "common.h"
#include "devices-imx31.h"
+#include "hardware.h"
#include "iomux-mx3.h"
/*
diff --git a/arch/arm/mach-imx/mx31lite-db.c b/arch/arm/mach-imx/mx31lite-db.c
index c9eb91c..5a160b7 100644
--- a/arch/arm/mach-imx/mx31lite-db.c
+++ b/arch/arm/mach-imx/mx31lite-db.c
@@ -31,11 +31,10 @@
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
-#include <mach/hardware.h>
-
#include "board-mx31lite.h"
#include "common.h"
#include "devices-imx31.h"
+#include "hardware.h"
#include "iomux-mx3.h"
/*
diff --git a/arch/arm/mach-imx/mx31moboard-devboard.c b/arch/arm/mach-imx/mx31moboard-devboard.c
index 6489afc..52d5b15 100644
--- a/arch/arm/mach-imx/mx31moboard-devboard.c
+++ b/arch/arm/mach-imx/mx31moboard-devboard.c
@@ -22,10 +22,9 @@
#include <linux/usb/otg.h>
-#include <mach/hardware.h>
-
#include "common.h"
#include "devices-imx31.h"
+#include "hardware.h"
#include "iomux-mx3.h"
#include "ulpi.h"
diff --git a/arch/arm/mach-imx/mx31moboard-marxbot.c b/arch/arm/mach-imx/mx31moboard-marxbot.c
index ea973c4..a4f43e9 100644
--- a/arch/arm/mach-imx/mx31moboard-marxbot.c
+++ b/arch/arm/mach-imx/mx31moboard-marxbot.c
@@ -24,12 +24,11 @@
#include <linux/usb/otg.h>
-#include <mach/hardware.h>
-
#include <media/soc_camera.h>
#include "common.h"
#include "devices-imx31.h"
+#include "hardware.h"
#include "iomux-mx3.h"
#include "ulpi.h"
diff --git a/arch/arm/mach-imx/mx31moboard-smartbot.c b/arch/arm/mach-imx/mx31moboard-smartbot.c
index 807e882..04ae45d 100644
--- a/arch/arm/mach-imx/mx31moboard-smartbot.c
+++ b/arch/arm/mach-imx/mx31moboard-smartbot.c
@@ -23,13 +23,12 @@
#include <linux/usb/otg.h>
#include <linux/usb/ulpi.h>
-#include <mach/hardware.h>
-
#include <media/soc_camera.h>
#include "board-mx31moboard.h"
#include "common.h"
#include "devices-imx31.h"
+#include "hardware.h"
#include "iomux-mx3.h"
#include "ulpi.h"
diff --git a/arch/arm/mach-imx/include/mach/mx35.h b/arch/arm/mach-imx/mx35.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/mx35.h
rename to arch/arm/mach-imx/mx35.h
diff --git a/arch/arm/mach-imx/include/mach/mx3x.h b/arch/arm/mach-imx/mx3x.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/mx3x.h
rename to arch/arm/mach-imx/mx3x.h
diff --git a/arch/arm/mach-imx/include/mach/mx50.h b/arch/arm/mach-imx/mx50.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/mx50.h
rename to arch/arm/mach-imx/mx50.h
diff --git a/arch/arm/mach-imx/include/mach/mx51.h b/arch/arm/mach-imx/mx51.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/mx51.h
rename to arch/arm/mach-imx/mx51.h
diff --git a/arch/arm/mach-imx/include/mach/mx53.h b/arch/arm/mach-imx/mx53.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/mx53.h
rename to arch/arm/mach-imx/mx53.h
diff --git a/arch/arm/mach-imx/include/mach/mx6q.h b/arch/arm/mach-imx/mx6q.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/mx6q.h
rename to arch/arm/mach-imx/mx6q.h
diff --git a/arch/arm/mach-imx/include/mach/mxc.h b/arch/arm/mach-imx/mxc.h
similarity index 100%
rename from arch/arm/mach-imx/include/mach/mxc.h
rename to arch/arm/mach-imx/mxc.h
diff --git a/arch/arm/mach-imx/pcm970-baseboard.c b/arch/arm/mach-imx/pcm970-baseboard.c
index c491f59..51c6082 100644
--- a/arch/arm/mach-imx/pcm970-baseboard.c
+++ b/arch/arm/mach-imx/pcm970-baseboard.c
@@ -23,10 +23,9 @@
#include <asm/mach/arch.h>
-#include <mach/hardware.h>
-
#include "common.h"
#include "devices-imx27.h"
+#include "hardware.h"
#include "iomux-mx27.h"
static const int pcm970_pins[] __initconst = {
diff --git a/arch/arm/mach-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c
index 6147be2..3777b80 100644
--- a/arch/arm/mach-imx/platsmp.c
+++ b/arch/arm/mach-imx/platsmp.c
@@ -16,9 +16,9 @@
#include <asm/smp_scu.h>
#include <asm/hardware/gic.h>
#include <asm/mach/map.h>
-#include <mach/hardware.h>
#include "common.h"
+#include "hardware.h"
static void __iomem *scu_base;
diff --git a/arch/arm/mach-imx/pm-imx27.c b/arch/arm/mach-imx/pm-imx27.c
index 6fcffa7..56d02d0 100644
--- a/arch/arm/mach-imx/pm-imx27.c
+++ b/arch/arm/mach-imx/pm-imx27.c
@@ -10,7 +10,8 @@
#include <linux/kernel.h>
#include <linux/suspend.h>
#include <linux/io.h>
-#include <mach/hardware.h>
+
+#include "hardware.h"
static int mx27_suspend_enter(suspend_state_t state)
{
diff --git a/arch/arm/mach-imx/pm-imx3.c b/arch/arm/mach-imx/pm-imx3.c
index e509be0..6a07006 100644
--- a/arch/arm/mach-imx/pm-imx3.c
+++ b/arch/arm/mach-imx/pm-imx3.c
@@ -9,11 +9,11 @@
* http://www.gnu.org/copyleft/gpl.html
*/
#include <linux/io.h>
-#include <mach/hardware.h>
#include "common.h"
#include "crmregs-imx3.h"
#include "devices/devices-common.h"
+#include "hardware.h"
/*
* Set cpu low power mode before WFI instruction. This function is called
diff --git a/arch/arm/mach-imx/pm-imx5.c b/arch/arm/mach-imx/pm-imx5.c
index a614702..2e063c2 100644
--- a/arch/arm/mach-imx/pm-imx5.c
+++ b/arch/arm/mach-imx/pm-imx5.c
@@ -16,11 +16,11 @@
#include <asm/cacheflush.h>
#include <asm/system_misc.h>
#include <asm/tlbflush.h>
-#include <mach/hardware.h>
#include "common.h"
#include "cpuidle.h"
#include "crm-regs-imx5.h"
+#include "hardware.h"
/*
* The WAIT_UNCLOCKED_POWER_OFF state only requires <= 500ns to exit.
diff --git a/arch/arm/mach-imx/pm-imx6q.c b/arch/arm/mach-imx/pm-imx6q.c
index 05618af..a17543d 100644
--- a/arch/arm/mach-imx/pm-imx6q.c
+++ b/arch/arm/mach-imx/pm-imx6q.c
@@ -18,9 +18,9 @@
#include <asm/proc-fns.h>
#include <asm/suspend.h>
#include <asm/hardware/cache-l2x0.h>
-#include <mach/hardware.h>
#include "common.h"
+#include "hardware.h"
extern unsigned long phys_l2x0_saved_regs;
diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c
index bbd80f2..695e0d7 100644
--- a/arch/arm/mach-imx/system.c
+++ b/arch/arm/mach-imx/system.c
@@ -22,12 +22,12 @@
#include <linux/err.h>
#include <linux/delay.h>
-#include <mach/hardware.h>
#include <asm/system_misc.h>
#include <asm/proc-fns.h>
#include <asm/mach-types.h>
#include "common.h"
+#include "hardware.h"
static void __iomem *wdog_base;
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
index 8ee6f36..f017302 100644
--- a/arch/arm/mach-imx/time.c
+++ b/arch/arm/mach-imx/time.c
@@ -27,11 +27,11 @@
#include <linux/clk.h>
#include <linux/err.h>
-#include <mach/hardware.h>
#include <asm/sched_clock.h>
#include <asm/mach/time.h>
#include "common.h"
+#include "hardware.h"
/*
* There are 2 versions of the timer hardware on Freescale MXC hardware.
diff --git a/arch/arm/mach-imx/tzic.c b/arch/arm/mach-imx/tzic.c
index 6134e96..c7625b4 100644
--- a/arch/arm/mach-imx/tzic.c
+++ b/arch/arm/mach-imx/tzic.c
@@ -21,10 +21,10 @@
#include <asm/mach/irq.h>
#include <asm/exception.h>
-#include <mach/hardware.h>
#include <mach/irqs.h>
#include "common.h"
+#include "hardware.h"
#include "irq-common.h"
/*
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 33/34] ARM: imx: remove header file mach/irqs.h
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (31 preceding siblings ...)
2012-09-17 5:35 ` [PATCH 32/34] ARM: imx: include hardware.h rather than mach/hardware.h Shawn Guo
@ 2012-09-17 5:35 ` Shawn Guo
2012-09-17 11:32 ` Arnd Bergmann
2012-09-17 11:46 ` Mark Brown
2012-09-17 5:35 ` [PATCH 34/34] ARM: imx: enable multi-platform build Shawn Guo
` (2 subsequent siblings)
35 siblings, 2 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:35 UTC (permalink / raw)
To: linux-arm-kernel
The only mach/irqs.h user outside arch/arm/mach-imx is
sound/soc/fsl/imx-pcm-fiq.c, which refers to mxc_set_irq_fiq().
Though moving the declaration into imx-pcm-fiq.c will result in
the checkpatch below, let's do it to gain the multi-platform support
for mach-imx.
WARNING: externs should be avoided in .c files
Inside arch/arm/mach-imx, the only users to mach/irqs.h are avic.c
and tzic.c for referring to macro FIQ_START. Let's move the macro
into irq-common.h and get rid of mach/irqs.h completely.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel at alsa-project.org
---
arch/arm/mach-imx/avic.c | 1 -
arch/arm/mach-imx/include/mach/irqs.h | 21 ---------------------
arch/arm/mach-imx/irq-common.h | 3 +++
arch/arm/mach-imx/tzic.c | 2 --
sound/soc/fsl/imx-pcm-fiq.c | 3 ++-
5 files changed, 5 insertions(+), 25 deletions(-)
delete mode 100644 arch/arm/mach-imx/include/mach/irqs.h
diff --git a/arch/arm/mach-imx/avic.c b/arch/arm/mach-imx/avic.c
index adc64bc..0eff23e 100644
--- a/arch/arm/mach-imx/avic.c
+++ b/arch/arm/mach-imx/avic.c
@@ -24,7 +24,6 @@
#include <linux/of.h>
#include <asm/mach/irq.h>
#include <asm/exception.h>
-#include <mach/irqs.h>
#include "common.h"
#include "hardware.h"
diff --git a/arch/arm/mach-imx/include/mach/irqs.h b/arch/arm/mach-imx/include/mach/irqs.h
deleted file mode 100644
index d73f5e8..0000000
--- a/arch/arm/mach-imx/include/mach/irqs.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
- */
-
-/*
- * 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.
- */
-
-#ifndef __ASM_ARCH_MXC_IRQS_H__
-#define __ASM_ARCH_MXC_IRQS_H__
-
-extern int imx_irq_set_priority(unsigned char irq, unsigned char prio);
-
-/* all normal IRQs can be FIQs */
-#define FIQ_START 0
-/* switch between IRQ and FIQ */
-extern int mxc_set_irq_fiq(unsigned int irq, unsigned int type);
-
-#endif /* __ASM_ARCH_MXC_IRQS_H__ */
diff --git a/arch/arm/mach-imx/irq-common.h b/arch/arm/mach-imx/irq-common.h
index 6ccb3a1..5b2dabb 100644
--- a/arch/arm/mach-imx/irq-common.h
+++ b/arch/arm/mach-imx/irq-common.h
@@ -19,6 +19,9 @@
#ifndef __PLAT_MXC_IRQ_COMMON_H__
#define __PLAT_MXC_IRQ_COMMON_H__
+/* all normal IRQs can be FIQs */
+#define FIQ_START 0
+
struct mxc_extra_irq
{
int (*set_priority)(unsigned char irq, unsigned char prio);
diff --git a/arch/arm/mach-imx/tzic.c b/arch/arm/mach-imx/tzic.c
index c7625b4..9721161 100644
--- a/arch/arm/mach-imx/tzic.c
+++ b/arch/arm/mach-imx/tzic.c
@@ -21,8 +21,6 @@
#include <asm/mach/irq.h>
#include <asm/exception.h>
-#include <mach/irqs.h>
-
#include "common.h"
#include "hardware.h"
#include "irq-common.h"
diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c
index 22c6130..84c9aed 100644
--- a/sound/soc/fsl/imx-pcm-fiq.c
+++ b/sound/soc/fsl/imx-pcm-fiq.c
@@ -29,7 +29,6 @@
#include <asm/fiq.h>
-#include <mach/irqs.h>
#include <linux/platform_data/asoc-imx-ssi.h>
#include "imx-ssi.h"
@@ -269,6 +268,8 @@ static int imx_pcm_fiq_new(struct snd_soc_pcm_runtime *rtd)
return 0;
}
+extern int mxc_set_irq_fiq(unsigned int irq, unsigned int type);
+
static void imx_pcm_fiq_free(struct snd_pcm *pcm)
{
mxc_set_irq_fiq(ssi_irq, 0);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 34/34] ARM: imx: enable multi-platform build
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (32 preceding siblings ...)
2012-09-17 5:35 ` [PATCH 33/34] ARM: imx: remove header file mach/irqs.h Shawn Guo
@ 2012-09-17 5:35 ` Shawn Guo
2012-09-17 11:44 ` Arnd Bergmann
2012-09-17 7:51 ` [PATCH 00/34] i.MX multi-platform support Sascha Hauer
2012-09-18 7:52 ` Sascha Hauer
35 siblings, 1 reply; 80+ messages in thread
From: Shawn Guo @ 2012-09-17 5:35 UTC (permalink / raw)
To: linux-arm-kernel
It enables multi-platform build for imx. ARCH_MXC, ARCH_IMX_V4_V5 and
ARCH_IMX_V6_V7 become invisible options to users, and are controlled
by multi-platform options. AUTO_ZRELADDR and ARM_PATCH_PHYS_VIRT
are selected by ARCH_MXC now to save the duplication.
Headers timex.h and uncompress.h are not needed for multi-platform
build. Remove them.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
arch/arm/Kconfig | 13 ---
arch/arm/mach-imx/Kconfig | 46 +++++-----
arch/arm/mach-imx/include/mach/timex.h | 22 -----
arch/arm/mach-imx/include/mach/uncompress.h | 132 ---------------------------
4 files changed, 22 insertions(+), 191 deletions(-)
delete mode 100644 arch/arm/mach-imx/include/mach/timex.h
delete mode 100644 arch/arm/mach-imx/include/mach/uncompress.h
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1d73bbc..afcd466 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -420,19 +420,6 @@ config ARCH_FOOTBRIDGE
Support for systems based on the DC21285 companion chip
("FootBridge"), such as the Simtec CATS and the Rebel NetWinder.
-config ARCH_MXC
- bool "Freescale MXC/iMX-based"
- select GENERIC_CLOCKEVENTS
- select ARCH_REQUIRE_GPIOLIB
- select CLKDEV_LOOKUP
- select CLKSRC_MMIO
- select GENERIC_IRQ_CHIP
- select MULTI_IRQ_HANDLER
- select SPARSE_IRQ
- select USE_OF
- help
- Support for Freescale MXC/iMX-based family of processors
-
config ARCH_MXS
bool "Freescale MXS-based"
select GENERIC_CLOCKEVENTS
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index b8f0f7d..e6a5764 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -1,4 +1,20 @@
-if ARCH_MXC
+config ARCH_MXC
+ def_bool y if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7
+ select AUTO_ZRELADDR if !ZBOOT_ROM
+ select ARM_PATCH_PHYS_VIRT
+ select GENERIC_CLOCKEVENTS
+ select ARCH_REQUIRE_GPIOLIB
+ select CLKDEV_LOOKUP
+ select CLKSRC_MMIO
+ select GENERIC_IRQ_CHIP
+ select MULTI_IRQ_HANDLER
+ select SPARSE_IRQ
+ select USE_OF
+ help
+ Support for Freescale MXC/iMX-based family of processors
+
+menu "Freescale i.MX support"
+ depends on ARCH_MXC
config MXC_IRQ_PRIOR
bool "Use IRQ priority"
@@ -161,19 +177,9 @@ config SOC_IMX51
select PINCTRL
select PINCTRL_IMX51
-menu "Freescale MXC Implementations"
-
-choice
- prompt "Freescale CPU family:"
- default ARCH_IMX_V6_V7
-
config ARCH_IMX_V4_V5
- bool "i.MX1, i.MX21, i.MX25, i.MX27"
- select AUTO_ZRELADDR if !ZBOOT_ROM
- select ARM_PATCH_PHYS_VIRT
- help
- This enables support for systems based on the Freescale i.MX ARMv4
- and ARMv5 SoCs
+ def_bool y
+ depends on ARCH_MULTI_V4_V5
if ARCH_IMX_V4_V5
@@ -456,13 +462,9 @@ config MACH_IMX27_DT
endif
config ARCH_IMX_V6_V7
- bool "i.MX3, i.MX5, i.MX6"
- select AUTO_ZRELADDR if !ZBOOT_ROM
- select ARM_PATCH_PHYS_VIRT
+ def_bool y
+ depends on ARCH_MULTI_V6_V7
select MIGHT_HAVE_CACHE_L2X0
- help
- This enables support for systems based on the Freescale i.MX3, i.MX5
- and i.MX6 family.
if ARCH_IMX_V6_V7
@@ -847,10 +849,6 @@ config SOC_IMX6Q
endif
-endchoice
-
-endmenu
-
source "arch/arm/mach-imx/devices/Kconfig"
-endif
+endmenu
diff --git a/arch/arm/mach-imx/include/mach/timex.h b/arch/arm/mach-imx/include/mach/timex.h
deleted file mode 100644
index 10343d1..0000000
--- a/arch/arm/mach-imx/include/mach/timex.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 1999 ARM Limited
- * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#ifndef __ASM_ARCH_MXC_TIMEX_H__
-#define __ASM_ARCH_MXC_TIMEX_H__
-
-/* Bogus value */
-#define CLOCK_TICK_RATE 12345678
-
-#endif /* __ASM_ARCH_MXC_TIMEX_H__ */
diff --git a/arch/arm/mach-imx/include/mach/uncompress.h b/arch/arm/mach-imx/include/mach/uncompress.h
deleted file mode 100644
index 477971b..0000000
--- a/arch/arm/mach-imx/include/mach/uncompress.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * arch/arm/plat-mxc/include/mach/uncompress.h
- *
- * Copyright (C) 1999 ARM Limited
- * Copyright (C) Shane Nay (shane at minirl.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-#ifndef __ASM_ARCH_MXC_UNCOMPRESS_H__
-#define __ASM_ARCH_MXC_UNCOMPRESS_H__
-
-#define __MXC_BOOT_UNCOMPRESS
-
-#include <asm/mach-types.h>
-
-unsigned long uart_base;
-
-#define UART(x) (*(volatile unsigned long *)(uart_base + (x)))
-
-#define USR2 0x98
-#define USR2_TXFE (1<<14)
-#define TXR 0x40
-#define UCR1 0x80
-#define UCR1_UARTEN 1
-
-/*
- * The following code assumes the serial port has already been
- * initialized by the bootloader. We search for the first enabled
- * port in the most probable order. If you didn't setup a port in
- * your bootloader then nothing will appear (which might be desired).
- *
- * This does not append a newline
- */
-
-static void putc(int ch)
-{
- if (!uart_base)
- return;
- if (!(UART(UCR1) & UCR1_UARTEN))
- return;
-
- while (!(UART(USR2) & USR2_TXFE))
- barrier();
-
- UART(TXR) = ch;
-}
-
-static inline void flush(void)
-{
-}
-
-#define MX1_UART1_BASE_ADDR 0x00206000
-#define MX25_UART1_BASE_ADDR 0x43f90000
-#define MX2X_UART1_BASE_ADDR 0x1000a000
-#define MX3X_UART1_BASE_ADDR 0x43F90000
-#define MX3X_UART2_BASE_ADDR 0x43F94000
-#define MX3X_UART5_BASE_ADDR 0x43FB4000
-#define MX51_UART1_BASE_ADDR 0x73fbc000
-#define MX50_UART1_BASE_ADDR 0x53fbc000
-#define MX53_UART1_BASE_ADDR 0x53fbc000
-
-static __inline__ void __arch_decomp_setup(unsigned long arch_id)
-{
- switch (arch_id) {
- case MACH_TYPE_MX1ADS:
- case MACH_TYPE_SCB9328:
- uart_base = MX1_UART1_BASE_ADDR;
- break;
- case MACH_TYPE_MX25_3DS:
- uart_base = MX25_UART1_BASE_ADDR;
- break;
- case MACH_TYPE_IMX27LITE:
- case MACH_TYPE_MX27_3DS:
- case MACH_TYPE_MX27ADS:
- case MACH_TYPE_PCM038:
- case MACH_TYPE_MX21ADS:
- case MACH_TYPE_PCA100:
- case MACH_TYPE_MXT_TD60:
- case MACH_TYPE_IMX27IPCAM:
- uart_base = MX2X_UART1_BASE_ADDR;
- break;
- case MACH_TYPE_MX31LITE:
- case MACH_TYPE_ARMADILLO5X0:
- case MACH_TYPE_MX31MOBOARD:
- case MACH_TYPE_QONG:
- case MACH_TYPE_MX31_3DS:
- case MACH_TYPE_PCM037:
- case MACH_TYPE_MX31ADS:
- case MACH_TYPE_MX35_3DS:
- case MACH_TYPE_PCM043:
- case MACH_TYPE_LILLY1131:
- case MACH_TYPE_VPR200:
- case MACH_TYPE_EUKREA_CPUIMX35SD:
- uart_base = MX3X_UART1_BASE_ADDR;
- break;
- case MACH_TYPE_MAGX_ZN5:
- uart_base = MX3X_UART2_BASE_ADDR;
- break;
- case MACH_TYPE_BUG:
- uart_base = MX3X_UART5_BASE_ADDR;
- break;
- case MACH_TYPE_MX51_BABBAGE:
- case MACH_TYPE_EUKREA_CPUIMX51SD:
- case MACH_TYPE_MX51_3DS:
- uart_base = MX51_UART1_BASE_ADDR;
- break;
- case MACH_TYPE_MX50_RDP:
- uart_base = MX50_UART1_BASE_ADDR;
- break;
- case MACH_TYPE_MX53_EVK:
- case MACH_TYPE_MX53_LOCO:
- case MACH_TYPE_MX53_SMD:
- case MACH_TYPE_MX53_ARD:
- uart_base = MX53_UART1_BASE_ADDR;
- break;
- default:
- break;
- }
-}
-
-#define arch_decomp_setup() __arch_decomp_setup(arch_id)
-#define arch_decomp_wdog()
-
-#endif /* __ASM_ARCH_MXC_UNCOMPRESS_H__ */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 29/34] mmc: mxcmmc: remove mach/hardware.h inclusion
2012-09-17 5:34 ` [PATCH 29/34] mmc: mxcmmc: " Shawn Guo
@ 2012-09-17 5:41 ` Chris Ball
2012-09-18 9:18 ` javier Martin
0 siblings, 1 reply; 80+ messages in thread
From: Chris Ball @ 2012-09-17 5:41 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Mon, Sep 17 2012, Shawn Guo wrote:
> It changes the driver to use platform_device_id rather than cpu_is_xxx
> to determine the controller type, and updates the platform code
> accordingly.
>
> As the result, mach/hardware.h inclusion gets removed from the driver.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Chris Ball <cjb@laptop.org>
> Cc: linux-mmc at vger.kernel.org
Acked-by: Chris Ball <cjb@laptop.org>
Thanks,
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 00/34] i.MX multi-platform support
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (33 preceding siblings ...)
2012-09-17 5:35 ` [PATCH 34/34] ARM: imx: enable multi-platform build Shawn Guo
@ 2012-09-17 7:51 ` Sascha Hauer
2012-09-17 11:38 ` Arnd Bergmann
2012-09-18 8:20 ` Shawn Guo
2012-09-18 7:52 ` Sascha Hauer
35 siblings, 2 replies; 80+ messages in thread
From: Sascha Hauer @ 2012-09-17 7:51 UTC (permalink / raw)
To: linux-arm-kernel
Hi Shawn,
On Mon, Sep 17, 2012 at 01:34:29PM +0800, Shawn Guo wrote:
> The series enables multi-platform support for imx. Since the required
> frameworks (clk, pwm) and spare_irq have already been adopted on imx,
> the series is all about cleaning up mach/* headers. Along with the
> changes, arch/arm/plat-mxc gets merged into arch/arm/mach-imx.
>
> It's based on a bunch of branches (works from others), Rob's initial
> multi-platform series, Arnd's platform-data and smp_ops (Marc's) and
> imx 3.7 material (Sascha and myself).
>
> It's available on branch below.
>
> git://git.linaro.org/people/shawnguo/linux-2.6.git imx/multi-platform
>
> It's been tested on imx5 and imx6, and only compile-tested on imx2 and
> imx3, so testing on imx2/3 are appreciated.
Great work! This really pushes the i.MX architecture one step closer to
a clean code base.
I gave it a test on i.MX1, i.MX27, i.MX31 and i.MX35. All run fine, but
the last patch breaks the imx_v4_v5_defconfig: Somehow it now defaults
to ARMv7 based machines. I haven't looked into it, just reenabled
ARMv4/ARMv5 and the boards again -> works. The config should be updated
with the last patch.
I'm fine with the changes to mx2-camera, but Javier should give his ok
to it, he has worked on it quite a lot recently.
One other issue related to imx-dma, see comment to that patch.
Otherwise:
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Thanks
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 25/34] dma: imx-dma: remove mach/hardware.h inclusion
2012-09-17 5:34 ` [PATCH 25/34] dma: imx-dma: remove mach/hardware.h inclusion Shawn Guo
@ 2012-09-17 7:58 ` Sascha Hauer
2012-09-18 1:40 ` Shawn Guo
2012-09-21 2:49 ` Shawn Guo
0 siblings, 2 replies; 80+ messages in thread
From: Sascha Hauer @ 2012-09-17 7:58 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Sep 17, 2012 at 01:34:54PM +0800, Shawn Guo wrote:
> It changes the driver to use platform_device_id rather than cpu_is_xxx
> to determine the controller type, and updates the platform code
> accordingly.
>
> As the result, mach/hardware.h inclusion gets removed from the driver.
I know the important thing for you is to get rid of the mach/hardware.h
inclusion, but I think the subject for this patch should rather be that
you switch to platform_device_id for this driver.
This patch misses to adjust the clock lookups according to the new
platform_device_ids. Please fixup the patch with the following.
Sascha
8<---------------------------------------------------------
>From 3094908fcbb4532056034539ea57042cd60abf47 Mon Sep 17 00:00:00 2001
From: Sascha Hauer <s.hauer@pengutronix.de>
Date: Mon, 17 Sep 2012 09:39:30 +0200
Subject: [PATCH] ARM i.MX DMA: Fixup clock lookups after platform_device_id conversion
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-imx/clk-imx1.c | 3 ++-
arch/arm/mach-imx/clk-imx21.c | 4 ++--
arch/arm/mach-imx/clk-imx27.c | 4 ++--
include/linux/platform_data/dma-imx.h | 4 +++-
4 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
index 7b76bc3..e8d9242 100644
--- a/arch/arm/mach-imx/clk-imx1.c
+++ b/arch/arm/mach-imx/clk-imx1.c
@@ -82,7 +82,8 @@ int __init mx1_clocks_init(unsigned long fref)
pr_err("imx1 clk %d: register failed with %ld\n",
i, PTR_ERR(clk[i]));
- clk_register_clkdev(clk[dma_gate], "ahb", "imx-dma");
+ clk_register_clkdev(clk[dma_gate], "ahb", "imx1-dma");
+ clk_register_clkdev(clk[hclk], "ipg", "imx1-dma");
clk_register_clkdev(clk[mma_gate], "mma", NULL);
clk_register_clkdev(clk[usbd_gate], NULL, "imx_udc.0");
clk_register_clkdev(clk[per1], "per", "imx-gpt.0");
diff --git a/arch/arm/mach-imx/clk-imx21.c b/arch/arm/mach-imx/clk-imx21.c
index 52b0563..d7ed660 100644
--- a/arch/arm/mach-imx/clk-imx21.c
+++ b/arch/arm/mach-imx/clk-imx21.c
@@ -162,8 +162,8 @@ int __init mx21_clocks_init(unsigned long lref, unsigned long href)
clk_register_clkdev(clk[usb_gate], "per", "imx21-hcd.0");
clk_register_clkdev(clk[usb_hclk_gate], "ahb", "imx21-hcd.0");
clk_register_clkdev(clk[nfc_gate], NULL, "imx21-nand.0");
- clk_register_clkdev(clk[dma_hclk_gate], "ahb", "imx-dma");
- clk_register_clkdev(clk[dma_gate], "ipg", "imx-dma");
+ clk_register_clkdev(clk[dma_hclk_gate], "ahb", "imx21-dma");
+ clk_register_clkdev(clk[dma_gate], "ipg", "imx21-dma");
clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
clk_register_clkdev(clk[i2c_gate], NULL, "imx21-i2c.0");
clk_register_clkdev(clk[kpp_gate], NULL, "mxc-keypad");
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index e813745..d286bac 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -241,8 +241,8 @@ int __init mx27_clocks_init(unsigned long fref)
clk_register_clkdev(clk[nfc_baud_gate], NULL, "imx27-nand.0");
clk_register_clkdev(clk[vpu_baud_gate], "per", "imx-vpu");
clk_register_clkdev(clk[vpu_ahb_gate], "ahb", "imx-vpu");
- clk_register_clkdev(clk[dma_ahb_gate], "ahb", "imx-dma");
- clk_register_clkdev(clk[dma_ipg_gate], "ipg", "imx-dma");
+ clk_register_clkdev(clk[dma_ahb_gate], "ahb", "imx27-dma");
+ clk_register_clkdev(clk[dma_ipg_gate], "ipg", "imx27-dma");
clk_register_clkdev(clk[fec_ipg_gate], "ipg", "imx27-fec.0");
clk_register_clkdev(clk[fec_ahb_gate], "ahb", "imx27-fec.0");
clk_register_clkdev(clk[wdog_ipg_gate], NULL, "imx2-wdt.0");
diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h
index 1b90803..f6d30cc 100644
--- a/include/linux/platform_data/dma-imx.h
+++ b/include/linux/platform_data/dma-imx.h
@@ -61,7 +61,9 @@ static inline int imx_dma_is_ipu(struct dma_chan *chan)
static inline int imx_dma_is_general_purpose(struct dma_chan *chan)
{
return strstr(dev_name(chan->device->dev), "sdma") ||
- !strcmp(dev_name(chan->device->dev), "imx-dma");
+ !strcmp(dev_name(chan->device->dev), "imx1-dma") ||
+ !strcmp(dev_name(chan->device->dev), "imx21-dma") ||
+ !strcmp(dev_name(chan->device->dev), "imx27-dma");
}
#endif
--
1.7.10.4
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply related [flat|nested] 80+ messages in thread
* [PATCH 26/34] media: mx2_camera: remove dead code in mx2_camera_add_device
2012-09-17 5:34 ` [PATCH 26/34] media: mx2_camera: remove dead code in mx2_camera_add_device Shawn Guo
@ 2012-09-17 8:18 ` Guennadi Liakhovetski
2012-09-17 13:36 ` javier Martin
2012-09-18 1:49 ` Shawn Guo
0 siblings, 2 replies; 80+ messages in thread
From: Guennadi Liakhovetski @ 2012-09-17 8:18 UTC (permalink / raw)
To: linux-arm-kernel
Hi Shawn
Thanks for the clean up. Would you like these patches to go via a single
tree, presumably, arm-soc? In this case
On Mon, 17 Sep 2012, Shawn Guo wrote:
> This is a piece of code becoming dead since commit 2c9ba37 ([media]
> V4L: mx2_camera: remove unsupported i.MX27 DMA mode, make EMMA
> mandatory). It should have been removed together with the commit.
> Remove it now.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: linux-media at vger.kernel.org
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Thanks
Guennadi
> ---
> drivers/media/video/mx2_camera.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
> index 965427f..89c7e28 100644
> --- a/drivers/media/video/mx2_camera.c
> +++ b/drivers/media/video/mx2_camera.c
> @@ -441,11 +441,9 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
>
> csicr1 = CSICR1_MCLKEN;
>
> - if (cpu_is_mx27()) {
> + if (cpu_is_mx27())
> csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
> CSICR1_RXFF_LEVEL(0);
> - } else if (cpu_is_mx27())
> - csicr1 |= CSICR1_SOF_INTEN | CSICR1_RXFF_LEVEL(2);
>
> pcdev->csicr1 = csicr1;
> writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
> --
> 1.7.9.5
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 12/34] media: mx1_camera: remove the driver
2012-09-17 5:34 ` [PATCH 12/34] media: mx1_camera: remove the driver Shawn Guo
@ 2012-09-17 8:33 ` Guennadi Liakhovetski
2012-09-18 1:28 ` Shawn Guo
0 siblings, 1 reply; 80+ messages in thread
From: Guennadi Liakhovetski @ 2012-09-17 8:33 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 17 Sep 2012, Shawn Guo wrote:
> The mx1_camera driver has been broken for a few release cycles since
> commit 6bd0812 (dmaengine: imx-dma: merge old dma-v1.c with imx-dma.c).
> It seems there is no one even compile tested it since then, as doing
> so will end up with the following error.
>
> CC drivers/media/video/mx1_camera.o
> In file included from drivers/media/video/mx1_camera.c:44:0:
> arch/arm/mach-imx/include/mach/dma-mx1-mx2.h:8:25: fatal error: mach/dma-v1.h: No such file or directory
>
> It looks that all the related folks have known the breakage [1], but
> no one shows the interest to bring it back to work. Thus it becomes
> a piece of unmaintained code, so let's remove it.
>
> [1] https://lkml.org/lkml/2012/2/9/171
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: linux-media at vger.kernel.org
Ok, it used to compile not-so-long-ago, but it doesn't seem to be cared
for a lot lately. Let's give Paulius a bit more time to react to this
mail, otherwise I'll have no objections. Just as an idea, to make it a bit
milder we could first mark it BROKEN and add to remove schedule... But I
don't mind either way.
Thanks
Guennadi
> ---
> arch/arm/mach-imx/Makefile | 3 -
> arch/arm/mach-imx/clk-imx1.c | 1 -
> arch/arm/mach-imx/devices/Kconfig | 3 -
> arch/arm/mach-imx/devices/Makefile | 1 -
> arch/arm/mach-imx/devices/devices-common.h | 10 -
> arch/arm/mach-imx/devices/platform-mx1-camera.c | 42 --
> arch/arm/mach-imx/mx1-camera-fiq-ksym.c | 18 -
> arch/arm/mach-imx/mx1-camera-fiq.S | 35 -
> drivers/media/video/Kconfig | 12 -
> drivers/media/video/Makefile | 1 -
> drivers/media/video/mx1_camera.c | 889 -----------------------
> include/linux/platform_data/camera-mx1.h | 35 -
> 12 files changed, 1050 deletions(-)
> delete mode 100644 arch/arm/mach-imx/devices/platform-mx1-camera.c
> delete mode 100644 arch/arm/mach-imx/mx1-camera-fiq-ksym.c
> delete mode 100644 arch/arm/mach-imx/mx1-camera-fiq.S
> delete mode 100644 drivers/media/video/mx1_camera.c
> delete mode 100644 include/linux/platform_data/camera-mx1.h
>
> diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> index fe47b71..538d0ee 100644
> --- a/arch/arm/mach-imx/Makefile
> +++ b/arch/arm/mach-imx/Makefile
> @@ -35,9 +35,6 @@ obj-y += ssi-fiq.o
> obj-y += ssi-fiq-ksym.o
> endif
>
> -# Support for CMOS sensor interface
> -obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o
> -
> # i.MX1 based machines
> obj-$(CONFIG_ARCH_MX1ADS) += mach-mx1ads.o
> obj-$(CONFIG_MACH_SCB9328) += mach-scb9328.o
> diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
> index b5f90cc..ebfffd2 100644
> --- a/arch/arm/mach-imx/clk-imx1.c
> +++ b/arch/arm/mach-imx/clk-imx1.c
> @@ -84,7 +84,6 @@ int __init mx1_clocks_init(unsigned long fref)
> i, PTR_ERR(clk[i]));
>
> clk_register_clkdev(clk[dma_gate], "ahb", "imx-dma");
> - clk_register_clkdev(clk[csi_gate], NULL, "mx1-camera.0");
> clk_register_clkdev(clk[mma_gate], "mma", NULL);
> clk_register_clkdev(clk[usbd_gate], NULL, "imx_udc.0");
> clk_register_clkdev(clk[per1], "per", "imx-gpt.0");
> diff --git a/arch/arm/mach-imx/devices/Kconfig b/arch/arm/mach-imx/devices/Kconfig
> index cb3e3ee..09d796e 100644
> --- a/arch/arm/mach-imx/devices/Kconfig
> +++ b/arch/arm/mach-imx/devices/Kconfig
> @@ -46,9 +46,6 @@ config IMX_HAVE_PLATFORM_IMX_UDC
> config IMX_HAVE_PLATFORM_IPU_CORE
> bool
>
> -config IMX_HAVE_PLATFORM_MX1_CAMERA
> - bool
> -
> config IMX_HAVE_PLATFORM_MX2_CAMERA
> bool
>
> diff --git a/arch/arm/mach-imx/devices/Makefile b/arch/arm/mach-imx/devices/Makefile
> index ff22ed1..3cfdc37 100644
> --- a/arch/arm/mach-imx/devices/Makefile
> +++ b/arch/arm/mach-imx/devices/Makefile
> @@ -17,7 +17,6 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o
> obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o
> obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o
> obj-$(CONFIG_IMX_HAVE_PLATFORM_IPU_CORE) += platform-ipu-core.o
> -obj-$(CONFIG_IMX_HAVE_PLATFORM_MX1_CAMERA) += platform-mx1-camera.o
> obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA) += platform-mx2-camera.o
> obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI) += platform-mxc-ehci.o
> obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o
> diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
> index 9e3e3d8..34419b2 100644
> --- a/arch/arm/mach-imx/devices/devices-common.h
> +++ b/arch/arm/mach-imx/devices/devices-common.h
> @@ -199,16 +199,6 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
> const struct imx_ipu_core_data *data,
> struct mx3fb_platform_data *pdata);
>
> -#include <linux/platform_data/camera-mx1.h>
> -struct imx_mx1_camera_data {
> - resource_size_t iobase;
> - resource_size_t iosize;
> - resource_size_t irq;
> -};
> -struct platform_device *__init imx_add_mx1_camera(
> - const struct imx_mx1_camera_data *data,
> - const struct mx1_camera_pdata *pdata);
> -
> #include <linux/platform_data/camera-mx2.h>
> struct imx_mx2_camera_data {
> resource_size_t iobasecsi;
> diff --git a/arch/arm/mach-imx/devices/platform-mx1-camera.c b/arch/arm/mach-imx/devices/platform-mx1-camera.c
> deleted file mode 100644
> index 756b0e6..0000000
> --- a/arch/arm/mach-imx/devices/platform-mx1-camera.c
> +++ /dev/null
> @@ -1,42 +0,0 @@
> -/*
> - * 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 <mach/hardware.h>
> -#include "devices-common.h"
> -
> -#define imx_mx1_camera_data_entry_single(soc, _size) \
> - { \
> - .iobase = soc ## _CSI ## _BASE_ADDR, \
> - .iosize = _size, \
> - .irq = soc ## _INT_CSI, \
> - }
> -
> -#ifdef CONFIG_SOC_IMX1
> -const struct imx_mx1_camera_data imx1_mx1_camera_data __initconst =
> - imx_mx1_camera_data_entry_single(MX1, 10);
> -#endif /* ifdef CONFIG_SOC_IMX1 */
> -
> -struct platform_device *__init imx_add_mx1_camera(
> - const struct imx_mx1_camera_data *data,
> - const struct mx1_camera_pdata *pdata)
> -{
> - struct resource res[] = {
> - {
> - .start = data->iobase,
> - .end = data->iobase + data->iosize - 1,
> - .flags = IORESOURCE_MEM,
> - }, {
> - .start = data->irq,
> - .end = data->irq,
> - .flags = IORESOURCE_IRQ,
> - },
> - };
> - return imx_add_platform_device_dmamask("mx1-camera", 0,
> - res, ARRAY_SIZE(res),
> - pdata, sizeof(*pdata), DMA_BIT_MASK(32));
> -}
> diff --git a/arch/arm/mach-imx/mx1-camera-fiq-ksym.c b/arch/arm/mach-imx/mx1-camera-fiq-ksym.c
> deleted file mode 100644
> index fb38436..0000000
> --- a/arch/arm/mach-imx/mx1-camera-fiq-ksym.c
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -/*
> - * Exported ksyms of ARCH_MX1
> - *
> - * Copyright (C) 2008, Darius Augulis <augulis.darius@gmail.com>
> - *
> - * 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 <linux/platform_device.h>
> -#include <linux/module.h>
> -
> -#include <linux/platform_data/camera-mx1.h>
> -
> -/* IMX camera FIQ handler */
> -EXPORT_SYMBOL(mx1_camera_sof_fiq_start);
> -EXPORT_SYMBOL(mx1_camera_sof_fiq_end);
> diff --git a/arch/arm/mach-imx/mx1-camera-fiq.S b/arch/arm/mach-imx/mx1-camera-fiq.S
> deleted file mode 100644
> index 9c69aa6..0000000
> --- a/arch/arm/mach-imx/mx1-camera-fiq.S
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -/*
> - * Copyright (C) 2008 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
> - *
> - * Based on linux/arch/arm/lib/floppydma.S
> - * Copyright (C) 1995, 1996 Russell King
> - *
> - * 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 <linux/linkage.h>
> -#include <asm/assembler.h>
> -
> - .text
> - .global mx1_camera_sof_fiq_end
> - .global mx1_camera_sof_fiq_start
> -mx1_camera_sof_fiq_start:
> - @ enable dma
> - ldr r12, [r9]
> - orr r12, r12, #0x00000001
> - str r12, [r9]
> - @ unmask DMA interrupt
> - ldr r12, [r8]
> - bic r12, r12, r13
> - str r12, [r8]
> - @ disable SOF interrupt
> - ldr r12, [r10]
> - bic r12, r12, #0x00010000
> - str r12, [r10]
> - @ clear SOF flag
> - mov r12, #0x00010000
> - str r12, [r11]
> - @ return from FIQ
> - subs pc, lr, #4
> -mx1_camera_sof_fiq_end:
> diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
> index c128fac..e8b89a9 100644
> --- a/drivers/media/video/Kconfig
> +++ b/drivers/media/video/Kconfig
> @@ -1118,18 +1118,6 @@ config SOC_CAMERA_OV9740
> help
> This is a ov9740 camera driver
>
> -config MX1_VIDEO
> - bool
> -
> -config VIDEO_MX1
> - tristate "i.MX1/i.MXL CMOS Sensor Interface driver"
> - depends on VIDEO_DEV && ARCH_MX1 && SOC_CAMERA
> - select FIQ
> - select VIDEOBUF_DMA_CONTIG
> - select MX1_VIDEO
> - ---help---
> - This is a v4l2 driver for the i.MX1/i.MXL CMOS Sensor Interface
> -
> config MX3_VIDEO
> bool
>
> diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
> index b7da9fa..8624228 100644
> --- a/drivers/media/video/Makefile
> +++ b/drivers/media/video/Makefile
> @@ -178,7 +178,6 @@ obj-$(CONFIG_VIDEO_OMAP2) += omap2cam.o
> obj-$(CONFIG_SOC_CAMERA) += soc_camera.o soc_mediabus.o
> obj-$(CONFIG_SOC_CAMERA_PLATFORM) += soc_camera_platform.o
> # soc-camera host drivers have to be linked after camera drivers
> -obj-$(CONFIG_VIDEO_MX1) += mx1_camera.o
> obj-$(CONFIG_VIDEO_MX2) += mx2_camera.o
> obj-$(CONFIG_VIDEO_MX3) += mx3_camera.o
> obj-$(CONFIG_VIDEO_PXA27x) += pxa_camera.o
> diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c
> deleted file mode 100644
> index bbe7099..0000000
> --- a/drivers/media/video/mx1_camera.c
> +++ /dev/null
> @@ -1,889 +0,0 @@
> -/*
> - * V4L2 Driver for i.MXL/i.MXL camera (CSI) host
> - *
> - * Copyright (C) 2008, Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
> - * Copyright (C) 2009, Darius Augulis <augulis.darius@gmail.com>
> - *
> - * Based on PXA SoC camera driver
> - * Copyright (C) 2006, Sascha Hauer, Pengutronix
> - * Copyright (C) 2008, Guennadi Liakhovetski <kernel@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 <linux/clk.h>
> -#include <linux/delay.h>
> -#include <linux/device.h>
> -#include <linux/dma-mapping.h>
> -#include <linux/errno.h>
> -#include <linux/fs.h>
> -#include <linux/init.h>
> -#include <linux/interrupt.h>
> -#include <linux/io.h>
> -#include <linux/kernel.h>
> -#include <linux/mm.h>
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
> -#include <linux/mutex.h>
> -#include <linux/platform_device.h>
> -#include <linux/sched.h>
> -#include <linux/slab.h>
> -#include <linux/time.h>
> -#include <linux/videodev2.h>
> -
> -#include <media/soc_camera.h>
> -#include <media/v4l2-common.h>
> -#include <media/v4l2-dev.h>
> -#include <media/videobuf-dma-contig.h>
> -#include <media/soc_mediabus.h>
> -
> -#include <asm/dma.h>
> -#include <asm/fiq.h>
> -#include <mach/dma-mx1-mx2.h>
> -#include <mach/hardware.h>
> -#include <mach/irqs.h>
> -#include <linux/platform_data/camera-mx1.h>
> -
> -/*
> - * CSI registers
> - */
> -#define CSICR1 0x00 /* CSI Control Register 1 */
> -#define CSISR 0x08 /* CSI Status Register */
> -#define CSIRXR 0x10 /* CSI RxFIFO Register */
> -
> -#define CSICR1_RXFF_LEVEL(x) (((x) & 0x3) << 19)
> -#define CSICR1_SOF_POL (1 << 17)
> -#define CSICR1_SOF_INTEN (1 << 16)
> -#define CSICR1_MCLKDIV(x) (((x) & 0xf) << 12)
> -#define CSICR1_MCLKEN (1 << 9)
> -#define CSICR1_FCC (1 << 8)
> -#define CSICR1_BIG_ENDIAN (1 << 7)
> -#define CSICR1_CLR_RXFIFO (1 << 5)
> -#define CSICR1_GCLK_MODE (1 << 4)
> -#define CSICR1_DATA_POL (1 << 2)
> -#define CSICR1_REDGE (1 << 1)
> -#define CSICR1_EN (1 << 0)
> -
> -#define CSISR_SFF_OR_INT (1 << 25)
> -#define CSISR_RFF_OR_INT (1 << 24)
> -#define CSISR_STATFF_INT (1 << 21)
> -#define CSISR_RXFF_INT (1 << 18)
> -#define CSISR_SOF_INT (1 << 16)
> -#define CSISR_DRDY (1 << 0)
> -
> -#define DRIVER_VERSION "0.0.2"
> -#define DRIVER_NAME "mx1-camera"
> -
> -#define CSI_IRQ_MASK (CSISR_SFF_OR_INT | CSISR_RFF_OR_INT | \
> - CSISR_STATFF_INT | CSISR_RXFF_INT | CSISR_SOF_INT)
> -
> -#define CSI_BUS_FLAGS (V4L2_MBUS_MASTER | V4L2_MBUS_HSYNC_ACTIVE_HIGH | \
> - V4L2_MBUS_VSYNC_ACTIVE_HIGH | V4L2_MBUS_VSYNC_ACTIVE_LOW | \
> - V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_PCLK_SAMPLE_FALLING | \
> - V4L2_MBUS_DATA_ACTIVE_HIGH | V4L2_MBUS_DATA_ACTIVE_LOW)
> -
> -#define MAX_VIDEO_MEM 16 /* Video memory limit in megabytes */
> -
> -/*
> - * Structures
> - */
> -
> -/* buffer for one video frame */
> -struct mx1_buffer {
> - /* common v4l buffer stuff -- must be first */
> - struct videobuf_buffer vb;
> - enum v4l2_mbus_pixelcode code;
> - int inwork;
> -};
> -
> -/*
> - * i.MX1/i.MXL is only supposed to handle one camera on its Camera Sensor
> - * Interface. If anyone ever builds hardware to enable more than
> - * one camera, they will have to modify this driver too
> - */
> -struct mx1_camera_dev {
> - struct soc_camera_host soc_host;
> - struct soc_camera_device *icd;
> - struct mx1_camera_pdata *pdata;
> - struct mx1_buffer *active;
> - struct resource *res;
> - struct clk *clk;
> - struct list_head capture;
> -
> - void __iomem *base;
> - int dma_chan;
> - unsigned int irq;
> - unsigned long mclk;
> -
> - spinlock_t lock;
> -};
> -
> -/*
> - * Videobuf operations
> - */
> -static int mx1_videobuf_setup(struct videobuf_queue *vq, unsigned int *count,
> - unsigned int *size)
> -{
> - struct soc_camera_device *icd = vq->priv_data;
> -
> - *size = icd->sizeimage;
> -
> - if (!*count)
> - *count = 32;
> -
> - if (*size * *count > MAX_VIDEO_MEM * 1024 * 1024)
> - *count = (MAX_VIDEO_MEM * 1024 * 1024) / *size;
> -
> - dev_dbg(icd->parent, "count=%d, size=%d\n", *count, *size);
> -
> - return 0;
> -}
> -
> -static void free_buffer(struct videobuf_queue *vq, struct mx1_buffer *buf)
> -{
> - struct soc_camera_device *icd = vq->priv_data;
> - struct videobuf_buffer *vb = &buf->vb;
> -
> - BUG_ON(in_interrupt());
> -
> - dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
> - vb, vb->baddr, vb->bsize);
> -
> - /*
> - * This waits until this buffer is out of danger, i.e., until it is no
> - * longer in STATE_QUEUED or STATE_ACTIVE
> - */
> - videobuf_waiton(vq, vb, 0, 0);
> - videobuf_dma_contig_free(vq, vb);
> -
> - vb->state = VIDEOBUF_NEEDS_INIT;
> -}
> -
> -static int mx1_videobuf_prepare(struct videobuf_queue *vq,
> - struct videobuf_buffer *vb, enum v4l2_field field)
> -{
> - struct soc_camera_device *icd = vq->priv_data;
> - struct mx1_buffer *buf = container_of(vb, struct mx1_buffer, vb);
> - int ret;
> -
> - dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
> - vb, vb->baddr, vb->bsize);
> -
> - /* Added list head initialization on alloc */
> - WARN_ON(!list_empty(&vb->queue));
> -
> - BUG_ON(NULL == icd->current_fmt);
> -
> - /*
> - * I think, in buf_prepare you only have to protect global data,
> - * the actual buffer is yours
> - */
> - buf->inwork = 1;
> -
> - if (buf->code != icd->current_fmt->code ||
> - vb->width != icd->user_width ||
> - vb->height != icd->user_height ||
> - vb->field != field) {
> - buf->code = icd->current_fmt->code;
> - vb->width = icd->user_width;
> - vb->height = icd->user_height;
> - vb->field = field;
> - vb->state = VIDEOBUF_NEEDS_INIT;
> - }
> -
> - vb->size = icd->sizeimage;
> - if (0 != vb->baddr && vb->bsize < vb->size) {
> - ret = -EINVAL;
> - goto out;
> - }
> -
> - if (vb->state == VIDEOBUF_NEEDS_INIT) {
> - ret = videobuf_iolock(vq, vb, NULL);
> - if (ret)
> - goto fail;
> -
> - vb->state = VIDEOBUF_PREPARED;
> - }
> -
> - buf->inwork = 0;
> -
> - return 0;
> -
> -fail:
> - free_buffer(vq, buf);
> -out:
> - buf->inwork = 0;
> - return ret;
> -}
> -
> -static int mx1_camera_setup_dma(struct mx1_camera_dev *pcdev)
> -{
> - struct videobuf_buffer *vbuf = &pcdev->active->vb;
> - struct device *dev = pcdev->icd->parent;
> - int ret;
> -
> - if (unlikely(!pcdev->active)) {
> - dev_err(dev, "DMA End IRQ with no active buffer\n");
> - return -EFAULT;
> - }
> -
> - /* setup sg list for future DMA */
> - ret = imx_dma_setup_single(pcdev->dma_chan,
> - videobuf_to_dma_contig(vbuf),
> - vbuf->size, pcdev->res->start +
> - CSIRXR, DMA_MODE_READ);
> - if (unlikely(ret))
> - dev_err(dev, "Failed to setup DMA sg list\n");
> -
> - return ret;
> -}
> -
> -/* Called under spinlock_irqsave(&pcdev->lock, ...) */
> -static void mx1_videobuf_queue(struct videobuf_queue *vq,
> - struct videobuf_buffer *vb)
> -{
> - struct soc_camera_device *icd = vq->priv_data;
> - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
> - struct mx1_camera_dev *pcdev = ici->priv;
> - struct mx1_buffer *buf = container_of(vb, struct mx1_buffer, vb);
> -
> - dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
> - vb, vb->baddr, vb->bsize);
> -
> - list_add_tail(&vb->queue, &pcdev->capture);
> -
> - vb->state = VIDEOBUF_ACTIVE;
> -
> - if (!pcdev->active) {
> - pcdev->active = buf;
> -
> - /* setup sg list for future DMA */
> - if (!mx1_camera_setup_dma(pcdev)) {
> - unsigned int temp;
> - /* enable SOF irq */
> - temp = __raw_readl(pcdev->base + CSICR1) |
> - CSICR1_SOF_INTEN;
> - __raw_writel(temp, pcdev->base + CSICR1);
> - }
> - }
> -}
> -
> -static void mx1_videobuf_release(struct videobuf_queue *vq,
> - struct videobuf_buffer *vb)
> -{
> - struct mx1_buffer *buf = container_of(vb, struct mx1_buffer, vb);
> -#ifdef DEBUG
> - struct soc_camera_device *icd = vq->priv_data;
> - struct device *dev = icd->parent;
> -
> - dev_dbg(dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
> - vb, vb->baddr, vb->bsize);
> -
> - switch (vb->state) {
> - case VIDEOBUF_ACTIVE:
> - dev_dbg(dev, "%s (active)\n", __func__);
> - break;
> - case VIDEOBUF_QUEUED:
> - dev_dbg(dev, "%s (queued)\n", __func__);
> - break;
> - case VIDEOBUF_PREPARED:
> - dev_dbg(dev, "%s (prepared)\n", __func__);
> - break;
> - default:
> - dev_dbg(dev, "%s (unknown)\n", __func__);
> - break;
> - }
> -#endif
> -
> - free_buffer(vq, buf);
> -}
> -
> -static void mx1_camera_wakeup(struct mx1_camera_dev *pcdev,
> - struct videobuf_buffer *vb,
> - struct mx1_buffer *buf)
> -{
> - /* _init is used to debug races, see comment in mx1_camera_reqbufs() */
> - list_del_init(&vb->queue);
> - vb->state = VIDEOBUF_DONE;
> - do_gettimeofday(&vb->ts);
> - vb->field_count++;
> - wake_up(&vb->done);
> -
> - if (list_empty(&pcdev->capture)) {
> - pcdev->active = NULL;
> - return;
> - }
> -
> - pcdev->active = list_entry(pcdev->capture.next,
> - struct mx1_buffer, vb.queue);
> -
> - /* setup sg list for future DMA */
> - if (likely(!mx1_camera_setup_dma(pcdev))) {
> - unsigned int temp;
> -
> - /* enable SOF irq */
> - temp = __raw_readl(pcdev->base + CSICR1) | CSICR1_SOF_INTEN;
> - __raw_writel(temp, pcdev->base + CSICR1);
> - }
> -}
> -
> -static void mx1_camera_dma_irq(int channel, void *data)
> -{
> - struct mx1_camera_dev *pcdev = data;
> - struct device *dev = pcdev->icd->parent;
> - struct mx1_buffer *buf;
> - struct videobuf_buffer *vb;
> - unsigned long flags;
> -
> - spin_lock_irqsave(&pcdev->lock, flags);
> -
> - imx_dma_disable(channel);
> -
> - if (unlikely(!pcdev->active)) {
> - dev_err(dev, "DMA End IRQ with no active buffer\n");
> - goto out;
> - }
> -
> - vb = &pcdev->active->vb;
> - buf = container_of(vb, struct mx1_buffer, vb);
> - WARN_ON(buf->inwork || list_empty(&vb->queue));
> - dev_dbg(dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
> - vb, vb->baddr, vb->bsize);
> -
> - mx1_camera_wakeup(pcdev, vb, buf);
> -out:
> - spin_unlock_irqrestore(&pcdev->lock, flags);
> -}
> -
> -static struct videobuf_queue_ops mx1_videobuf_ops = {
> - .buf_setup = mx1_videobuf_setup,
> - .buf_prepare = mx1_videobuf_prepare,
> - .buf_queue = mx1_videobuf_queue,
> - .buf_release = mx1_videobuf_release,
> -};
> -
> -static void mx1_camera_init_videobuf(struct videobuf_queue *q,
> - struct soc_camera_device *icd)
> -{
> - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
> - struct mx1_camera_dev *pcdev = ici->priv;
> -
> - videobuf_queue_dma_contig_init(q, &mx1_videobuf_ops, icd->parent,
> - &pcdev->lock, V4L2_BUF_TYPE_VIDEO_CAPTURE,
> - V4L2_FIELD_NONE,
> - sizeof(struct mx1_buffer), icd, &icd->video_lock);
> -}
> -
> -static int mclk_get_divisor(struct mx1_camera_dev *pcdev)
> -{
> - unsigned int mclk = pcdev->mclk;
> - unsigned long div;
> - unsigned long lcdclk;
> -
> - lcdclk = clk_get_rate(pcdev->clk);
> -
> - /*
> - * We verify platform_mclk_10khz != 0, so if anyone breaks it, here
> - * they get a nice Oops
> - */
> - div = (lcdclk + 2 * mclk - 1) / (2 * mclk) - 1;
> -
> - dev_dbg(pcdev->icd->parent,
> - "System clock %lukHz, target freq %dkHz, divisor %lu\n",
> - lcdclk / 1000, mclk / 1000, div);
> -
> - return div;
> -}
> -
> -static void mx1_camera_activate(struct mx1_camera_dev *pcdev)
> -{
> - unsigned int csicr1 = CSICR1_EN;
> -
> - dev_dbg(pcdev->icd->parent, "Activate device\n");
> -
> - clk_prepare_enable(pcdev->clk);
> -
> - /* enable CSI before doing anything else */
> - __raw_writel(csicr1, pcdev->base + CSICR1);
> -
> - csicr1 |= CSICR1_MCLKEN | CSICR1_FCC | CSICR1_GCLK_MODE;
> - csicr1 |= CSICR1_MCLKDIV(mclk_get_divisor(pcdev));
> - csicr1 |= CSICR1_RXFF_LEVEL(2); /* 16 words */
> -
> - __raw_writel(csicr1, pcdev->base + CSICR1);
> -}
> -
> -static void mx1_camera_deactivate(struct mx1_camera_dev *pcdev)
> -{
> - dev_dbg(pcdev->icd->parent, "Deactivate device\n");
> -
> - /* Disable all CSI interface */
> - __raw_writel(0x00, pcdev->base + CSICR1);
> -
> - clk_disable_unprepare(pcdev->clk);
> -}
> -
> -/*
> - * The following two functions absolutely depend on the fact, that
> - * there can be only one camera on i.MX1/i.MXL camera sensor interface
> - */
> -static int mx1_camera_add_device(struct soc_camera_device *icd)
> -{
> - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
> - struct mx1_camera_dev *pcdev = ici->priv;
> -
> - if (pcdev->icd)
> - return -EBUSY;
> -
> - dev_info(icd->parent, "MX1 Camera driver attached to camera %d\n",
> - icd->devnum);
> -
> - mx1_camera_activate(pcdev);
> -
> - pcdev->icd = icd;
> -
> - return 0;
> -}
> -
> -static void mx1_camera_remove_device(struct soc_camera_device *icd)
> -{
> - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
> - struct mx1_camera_dev *pcdev = ici->priv;
> - unsigned int csicr1;
> -
> - BUG_ON(icd != pcdev->icd);
> -
> - /* disable interrupts */
> - csicr1 = __raw_readl(pcdev->base + CSICR1) & ~CSI_IRQ_MASK;
> - __raw_writel(csicr1, pcdev->base + CSICR1);
> -
> - /* Stop DMA engine */
> - imx_dma_disable(pcdev->dma_chan);
> -
> - dev_info(icd->parent, "MX1 Camera driver detached from camera %d\n",
> - icd->devnum);
> -
> - mx1_camera_deactivate(pcdev);
> -
> - pcdev->icd = NULL;
> -}
> -
> -static int mx1_camera_set_crop(struct soc_camera_device *icd,
> - struct v4l2_crop *a)
> -{
> - struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
> -
> - return v4l2_subdev_call(sd, video, s_crop, a);
> -}
> -
> -static int mx1_camera_set_bus_param(struct soc_camera_device *icd)
> -{
> - struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
> - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
> - struct mx1_camera_dev *pcdev = ici->priv;
> - struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,};
> - unsigned long common_flags;
> - unsigned int csicr1;
> - int ret;
> -
> - /* MX1 supports only 8bit buswidth */
> - ret = v4l2_subdev_call(sd, video, g_mbus_config, &cfg);
> - if (!ret) {
> - common_flags = soc_mbus_config_compatible(&cfg, CSI_BUS_FLAGS);
> - if (!common_flags) {
> - dev_warn(icd->parent,
> - "Flags incompatible: camera 0x%x, host 0x%x\n",
> - cfg.flags, CSI_BUS_FLAGS);
> - return -EINVAL;
> - }
> - } else if (ret != -ENOIOCTLCMD) {
> - return ret;
> - } else {
> - common_flags = CSI_BUS_FLAGS;
> - }
> -
> - /* Make choises, based on platform choice */
> - if ((common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) &&
> - (common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)) {
> - if (!pcdev->pdata ||
> - pcdev->pdata->flags & MX1_CAMERA_VSYNC_HIGH)
> - common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_LOW;
> - else
> - common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_HIGH;
> - }
> -
> - if ((common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING) &&
> - (common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING)) {
> - if (!pcdev->pdata ||
> - pcdev->pdata->flags & MX1_CAMERA_PCLK_RISING)
> - common_flags &= ~V4L2_MBUS_PCLK_SAMPLE_FALLING;
> - else
> - common_flags &= ~V4L2_MBUS_PCLK_SAMPLE_RISING;
> - }
> -
> - if ((common_flags & V4L2_MBUS_DATA_ACTIVE_HIGH) &&
> - (common_flags & V4L2_MBUS_DATA_ACTIVE_LOW)) {
> - if (!pcdev->pdata ||
> - pcdev->pdata->flags & MX1_CAMERA_DATA_HIGH)
> - common_flags &= ~V4L2_MBUS_DATA_ACTIVE_LOW;
> - else
> - common_flags &= ~V4L2_MBUS_DATA_ACTIVE_HIGH;
> - }
> -
> - cfg.flags = common_flags;
> - ret = v4l2_subdev_call(sd, video, s_mbus_config, &cfg);
> - if (ret < 0 && ret != -ENOIOCTLCMD) {
> - dev_dbg(icd->parent, "camera s_mbus_config(0x%lx) returned %d\n",
> - common_flags, ret);
> - return ret;
> - }
> -
> - csicr1 = __raw_readl(pcdev->base + CSICR1);
> -
> - if (common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING)
> - csicr1 |= CSICR1_REDGE;
> - if (common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH)
> - csicr1 |= CSICR1_SOF_POL;
> - if (common_flags & V4L2_MBUS_DATA_ACTIVE_LOW)
> - csicr1 |= CSICR1_DATA_POL;
> -
> - __raw_writel(csicr1, pcdev->base + CSICR1);
> -
> - return 0;
> -}
> -
> -static int mx1_camera_set_fmt(struct soc_camera_device *icd,
> - struct v4l2_format *f)
> -{
> - struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
> - const struct soc_camera_format_xlate *xlate;
> - struct v4l2_pix_format *pix = &f->fmt.pix;
> - struct v4l2_mbus_framefmt mf;
> - int ret, buswidth;
> -
> - xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat);
> - if (!xlate) {
> - dev_warn(icd->parent, "Format %x not found\n",
> - pix->pixelformat);
> - return -EINVAL;
> - }
> -
> - buswidth = xlate->host_fmt->bits_per_sample;
> - if (buswidth > 8) {
> - dev_warn(icd->parent,
> - "bits-per-sample %d for format %x unsupported\n",
> - buswidth, pix->pixelformat);
> - return -EINVAL;
> - }
> -
> - mf.width = pix->width;
> - mf.height = pix->height;
> - mf.field = pix->field;
> - mf.colorspace = pix->colorspace;
> - mf.code = xlate->code;
> -
> - ret = v4l2_subdev_call(sd, video, s_mbus_fmt, &mf);
> - if (ret < 0)
> - return ret;
> -
> - if (mf.code != xlate->code)
> - return -EINVAL;
> -
> - pix->width = mf.width;
> - pix->height = mf.height;
> - pix->field = mf.field;
> - pix->colorspace = mf.colorspace;
> - icd->current_fmt = xlate;
> -
> - return ret;
> -}
> -
> -static int mx1_camera_try_fmt(struct soc_camera_device *icd,
> - struct v4l2_format *f)
> -{
> - struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
> - const struct soc_camera_format_xlate *xlate;
> - struct v4l2_pix_format *pix = &f->fmt.pix;
> - struct v4l2_mbus_framefmt mf;
> - int ret;
> - /* TODO: limit to mx1 hardware capabilities */
> -
> - xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat);
> - if (!xlate) {
> - dev_warn(icd->parent, "Format %x not found\n",
> - pix->pixelformat);
> - return -EINVAL;
> - }
> -
> - mf.width = pix->width;
> - mf.height = pix->height;
> - mf.field = pix->field;
> - mf.colorspace = pix->colorspace;
> - mf.code = xlate->code;
> -
> - /* limit to sensor capabilities */
> - ret = v4l2_subdev_call(sd, video, try_mbus_fmt, &mf);
> - if (ret < 0)
> - return ret;
> -
> - pix->width = mf.width;
> - pix->height = mf.height;
> - pix->field = mf.field;
> - pix->colorspace = mf.colorspace;
> -
> - return 0;
> -}
> -
> -static int mx1_camera_reqbufs(struct soc_camera_device *icd,
> - struct v4l2_requestbuffers *p)
> -{
> - int i;
> -
> - /*
> - * This is for locking debugging only. I removed spinlocks and now I
> - * check whether .prepare is ever called on a linked buffer, or whether
> - * a dma IRQ can occur for an in-work or unlinked buffer. Until now
> - * it hadn't triggered
> - */
> - for (i = 0; i < p->count; i++) {
> - struct mx1_buffer *buf = container_of(icd->vb_vidq.bufs[i],
> - struct mx1_buffer, vb);
> - buf->inwork = 0;
> - INIT_LIST_HEAD(&buf->vb.queue);
> - }
> -
> - return 0;
> -}
> -
> -static unsigned int mx1_camera_poll(struct file *file, poll_table *pt)
> -{
> - struct soc_camera_device *icd = file->private_data;
> - struct mx1_buffer *buf;
> -
> - buf = list_entry(icd->vb_vidq.stream.next, struct mx1_buffer,
> - vb.stream);
> -
> - poll_wait(file, &buf->vb.done, pt);
> -
> - if (buf->vb.state == VIDEOBUF_DONE ||
> - buf->vb.state == VIDEOBUF_ERROR)
> - return POLLIN | POLLRDNORM;
> -
> - return 0;
> -}
> -
> -static int mx1_camera_querycap(struct soc_camera_host *ici,
> - struct v4l2_capability *cap)
> -{
> - /* cap->name is set by the friendly caller:-> */
> - strlcpy(cap->card, "i.MX1/i.MXL Camera", sizeof(cap->card));
> - cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
> -
> - return 0;
> -}
> -
> -static struct soc_camera_host_ops mx1_soc_camera_host_ops = {
> - .owner = THIS_MODULE,
> - .add = mx1_camera_add_device,
> - .remove = mx1_camera_remove_device,
> - .set_bus_param = mx1_camera_set_bus_param,
> - .set_crop = mx1_camera_set_crop,
> - .set_fmt = mx1_camera_set_fmt,
> - .try_fmt = mx1_camera_try_fmt,
> - .init_videobuf = mx1_camera_init_videobuf,
> - .reqbufs = mx1_camera_reqbufs,
> - .poll = mx1_camera_poll,
> - .querycap = mx1_camera_querycap,
> -};
> -
> -static struct fiq_handler fh = {
> - .name = "csi_sof"
> -};
> -
> -static int __init mx1_camera_probe(struct platform_device *pdev)
> -{
> - struct mx1_camera_dev *pcdev;
> - struct resource *res;
> - struct pt_regs regs;
> - struct clk *clk;
> - void __iomem *base;
> - unsigned int irq;
> - int err = 0;
> -
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - irq = platform_get_irq(pdev, 0);
> - if (!res || (int)irq <= 0) {
> - err = -ENODEV;
> - goto exit;
> - }
> -
> - clk = clk_get(&pdev->dev, "csi_clk");
> - if (IS_ERR(clk)) {
> - err = PTR_ERR(clk);
> - goto exit;
> - }
> -
> - pcdev = kzalloc(sizeof(*pcdev), GFP_KERNEL);
> - if (!pcdev) {
> - dev_err(&pdev->dev, "Could not allocate pcdev\n");
> - err = -ENOMEM;
> - goto exit_put_clk;
> - }
> -
> - pcdev->res = res;
> - pcdev->clk = clk;
> -
> - pcdev->pdata = pdev->dev.platform_data;
> -
> - if (pcdev->pdata)
> - pcdev->mclk = pcdev->pdata->mclk_10khz * 10000;
> -
> - if (!pcdev->mclk) {
> - dev_warn(&pdev->dev,
> - "mclk_10khz == 0! Please, fix your platform data. "
> - "Using default 20MHz\n");
> - pcdev->mclk = 20000000;
> - }
> -
> - INIT_LIST_HEAD(&pcdev->capture);
> - spin_lock_init(&pcdev->lock);
> -
> - /*
> - * Request the regions.
> - */
> - if (!request_mem_region(res->start, resource_size(res), DRIVER_NAME)) {
> - err = -EBUSY;
> - goto exit_kfree;
> - }
> -
> - base = ioremap(res->start, resource_size(res));
> - if (!base) {
> - err = -ENOMEM;
> - goto exit_release;
> - }
> - pcdev->irq = irq;
> - pcdev->base = base;
> -
> - /* request dma */
> - pcdev->dma_chan = imx_dma_request_by_prio(DRIVER_NAME, DMA_PRIO_HIGH);
> - if (pcdev->dma_chan < 0) {
> - dev_err(&pdev->dev, "Can't request DMA for MX1 CSI\n");
> - err = -EBUSY;
> - goto exit_iounmap;
> - }
> - dev_dbg(&pdev->dev, "got DMA channel %d\n", pcdev->dma_chan);
> -
> - imx_dma_setup_handlers(pcdev->dma_chan, mx1_camera_dma_irq, NULL,
> - pcdev);
> -
> - imx_dma_config_channel(pcdev->dma_chan, IMX_DMA_TYPE_FIFO,
> - IMX_DMA_MEMSIZE_32, MX1_DMA_REQ_CSI_R, 0);
> - /* burst length : 16 words = 64 bytes */
> - imx_dma_config_burstlen(pcdev->dma_chan, 0);
> -
> - /* request irq */
> - err = claim_fiq(&fh);
> - if (err) {
> - dev_err(&pdev->dev, "Camera interrupt register failed \n");
> - goto exit_free_dma;
> - }
> -
> - set_fiq_handler(&mx1_camera_sof_fiq_start, &mx1_camera_sof_fiq_end -
> - &mx1_camera_sof_fiq_start);
> -
> - regs.ARM_r8 = (long)MX1_DMA_DIMR;
> - regs.ARM_r9 = (long)MX1_DMA_CCR(pcdev->dma_chan);
> - regs.ARM_r10 = (long)pcdev->base + CSICR1;
> - regs.ARM_fp = (long)pcdev->base + CSISR;
> - regs.ARM_sp = 1 << pcdev->dma_chan;
> - set_fiq_regs(®s);
> -
> - mxc_set_irq_fiq(irq, 1);
> - enable_fiq(irq);
> -
> - pcdev->soc_host.drv_name = DRIVER_NAME;
> - pcdev->soc_host.ops = &mx1_soc_camera_host_ops;
> - pcdev->soc_host.priv = pcdev;
> - pcdev->soc_host.v4l2_dev.dev = &pdev->dev;
> - pcdev->soc_host.nr = pdev->id;
> - err = soc_camera_host_register(&pcdev->soc_host);
> - if (err)
> - goto exit_free_irq;
> -
> - dev_info(&pdev->dev, "MX1 Camera driver loaded\n");
> -
> - return 0;
> -
> -exit_free_irq:
> - disable_fiq(irq);
> - mxc_set_irq_fiq(irq, 0);
> - release_fiq(&fh);
> -exit_free_dma:
> - imx_dma_free(pcdev->dma_chan);
> -exit_iounmap:
> - iounmap(base);
> -exit_release:
> - release_mem_region(res->start, resource_size(res));
> -exit_kfree:
> - kfree(pcdev);
> -exit_put_clk:
> - clk_put(clk);
> -exit:
> - return err;
> -}
> -
> -static int __exit mx1_camera_remove(struct platform_device *pdev)
> -{
> - struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev);
> - struct mx1_camera_dev *pcdev = container_of(soc_host,
> - struct mx1_camera_dev, soc_host);
> - struct resource *res;
> -
> - imx_dma_free(pcdev->dma_chan);
> - disable_fiq(pcdev->irq);
> - mxc_set_irq_fiq(pcdev->irq, 0);
> - release_fiq(&fh);
> -
> - clk_put(pcdev->clk);
> -
> - soc_camera_host_unregister(soc_host);
> -
> - iounmap(pcdev->base);
> -
> - res = pcdev->res;
> - release_mem_region(res->start, resource_size(res));
> -
> - kfree(pcdev);
> -
> - dev_info(&pdev->dev, "MX1 Camera driver unloaded\n");
> -
> - return 0;
> -}
> -
> -static struct platform_driver mx1_camera_driver = {
> - .driver = {
> - .name = DRIVER_NAME,
> - },
> - .remove = __exit_p(mx1_camera_remove),
> -};
> -
> -static int __init mx1_camera_init(void)
> -{
> - return platform_driver_probe(&mx1_camera_driver, mx1_camera_probe);
> -}
> -
> -static void __exit mx1_camera_exit(void)
> -{
> - return platform_driver_unregister(&mx1_camera_driver);
> -}
> -
> -module_init(mx1_camera_init);
> -module_exit(mx1_camera_exit);
> -
> -MODULE_DESCRIPTION("i.MX1/i.MXL SoC Camera Host driver");
> -MODULE_AUTHOR("Paulius Zaleckas <paulius.zaleckas@teltonika.lt>");
> -MODULE_LICENSE("GPL v2");
> -MODULE_VERSION(DRIVER_VERSION);
> -MODULE_ALIAS("platform:" DRIVER_NAME);
> diff --git a/include/linux/platform_data/camera-mx1.h b/include/linux/platform_data/camera-mx1.h
> deleted file mode 100644
> index 4fd6c70..0000000
> --- a/include/linux/platform_data/camera-mx1.h
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -/*
> - * mx1_camera.h - i.MX1/i.MXL camera driver header file
> - *
> - * Copyright (c) 2008, Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
> - * Copyright (C) 2009, Darius Augulis <augulis.darius@gmail.com>
> - *
> - * Based on PXA camera.h file:
> - * Copyright (C) 2003, Intel Corporation
> - * Copyright (C) 2008, Guennadi Liakhovetski <kernel@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.
> - */
> -
> -#ifndef __ASM_ARCH_CAMERA_H_
> -#define __ASM_ARCH_CAMERA_H_
> -
> -#define MX1_CAMERA_DATA_HIGH 1
> -#define MX1_CAMERA_PCLK_RISING 2
> -#define MX1_CAMERA_VSYNC_HIGH 4
> -
> -extern unsigned char mx1_camera_sof_fiq_start, mx1_camera_sof_fiq_end;
> -
> -/**
> - * struct mx1_camera_pdata - i.MX1/i.MXL camera platform data
> - * @mclk_10khz: master clock frequency in 10kHz units
> - * @flags: MX1 camera platform flags
> - */
> -struct mx1_camera_pdata {
> - unsigned long mclk_10khz;
> - unsigned long flags;
> -};
> -
> -#endif /* __ASM_ARCH_CAMERA_H_ */
> --
> 1.7.9.5
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 27/34] media: mx2_camera: use managed functions to clean up code
2012-09-17 5:34 ` [PATCH 27/34] media: mx2_camera: use managed functions to clean up code Shawn Guo
@ 2012-09-17 9:11 ` Guennadi Liakhovetski
2012-09-17 13:36 ` javier Martin
0 siblings, 1 reply; 80+ messages in thread
From: Guennadi Liakhovetski @ 2012-09-17 9:11 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 17 Sep 2012, Shawn Guo wrote:
> Use managed functions to clean up the error handling code and function
> mx2_camera_remove(). Along with the change, a few variables get removed
> from struct mx2_camera_dev.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: linux-media at vger.kernel.org
(in case you want to push it via arm-soc)
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Thanks
Guennadi
> ---
> drivers/media/video/mx2_camera.c | 143 +++++++++++---------------------------
> 1 file changed, 39 insertions(+), 104 deletions(-)
>
> diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
> index 89c7e28..fe4c76c 100644
> --- a/drivers/media/video/mx2_camera.c
> +++ b/drivers/media/video/mx2_camera.c
> @@ -274,12 +274,9 @@ struct mx2_camera_dev {
> struct soc_camera_device *icd;
> struct clk *clk_csi, *clk_emma_ahb, *clk_emma_ipg;
>
> - unsigned int irq_csi, irq_emma;
> void __iomem *base_csi, *base_emma;
> - unsigned long base_dma;
>
> struct mx2_camera_platform_data *pdata;
> - struct resource *res_csi, *res_emma;
> unsigned long platform_flags;
>
> struct list_head capture;
> @@ -1607,64 +1604,59 @@ static irqreturn_t mx27_camera_emma_irq(int irq_emma, void *data)
> return IRQ_HANDLED;
> }
>
> -static int __devinit mx27_camera_emma_init(struct mx2_camera_dev *pcdev)
> +static int __devinit mx27_camera_emma_init(struct platform_device *pdev)
> {
> - struct resource *res_emma = pcdev->res_emma;
> + struct mx2_camera_dev *pcdev = platform_get_drvdata(pdev);
> + struct resource *res_emma;
> + int irq_emma;
> int err = 0;
>
> - if (!request_mem_region(res_emma->start, resource_size(res_emma),
> - MX2_CAM_DRV_NAME)) {
> - err = -EBUSY;
> + res_emma = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> + irq_emma = platform_get_irq(pdev, 1);
> + if (!res_emma || !irq_emma) {
> + dev_err(pcdev->dev, "no EMMA resources\n");
> goto out;
> }
>
> - pcdev->base_emma = ioremap(res_emma->start, resource_size(res_emma));
> + pcdev->base_emma = devm_request_and_ioremap(pcdev->dev, res_emma);
> if (!pcdev->base_emma) {
> - err = -ENOMEM;
> - goto exit_release;
> + err = -EADDRNOTAVAIL;
> + goto out;
> }
>
> - err = request_irq(pcdev->irq_emma, mx27_camera_emma_irq, 0,
> - MX2_CAM_DRV_NAME, pcdev);
> + err = devm_request_irq(pcdev->dev, irq_emma, mx27_camera_emma_irq, 0,
> + MX2_CAM_DRV_NAME, pcdev);
> if (err) {
> dev_err(pcdev->dev, "Camera EMMA interrupt register failed \n");
> - goto exit_iounmap;
> + goto out;
> }
>
> - pcdev->clk_emma_ipg = clk_get(pcdev->dev, "emma-ipg");
> + pcdev->clk_emma_ipg = devm_clk_get(pcdev->dev, "emma-ipg");
> if (IS_ERR(pcdev->clk_emma_ipg)) {
> err = PTR_ERR(pcdev->clk_emma_ipg);
> - goto exit_free_irq;
> + goto out;
> }
>
> clk_prepare_enable(pcdev->clk_emma_ipg);
>
> - pcdev->clk_emma_ahb = clk_get(pcdev->dev, "emma-ahb");
> + pcdev->clk_emma_ahb = devm_clk_get(pcdev->dev, "emma-ahb");
> if (IS_ERR(pcdev->clk_emma_ahb)) {
> err = PTR_ERR(pcdev->clk_emma_ahb);
> - goto exit_clk_emma_ipg_put;
> + goto exit_clk_emma_ipg;
> }
>
> clk_prepare_enable(pcdev->clk_emma_ahb);
>
> err = mx27_camera_emma_prp_reset(pcdev);
> if (err)
> - goto exit_clk_emma_ahb_put;
> + goto exit_clk_emma_ahb;
>
> return err;
>
> -exit_clk_emma_ahb_put:
> +exit_clk_emma_ahb:
> clk_disable_unprepare(pcdev->clk_emma_ahb);
> - clk_put(pcdev->clk_emma_ahb);
> -exit_clk_emma_ipg_put:
> +exit_clk_emma_ipg:
> clk_disable_unprepare(pcdev->clk_emma_ipg);
> - clk_put(pcdev->clk_emma_ipg);
> -exit_free_irq:
> - free_irq(pcdev->irq_emma, pcdev);
> -exit_iounmap:
> - iounmap(pcdev->base_emma);
> -exit_release:
> - release_mem_region(res_emma->start, resource_size(res_emma));
> out:
> return err;
> }
> @@ -1672,9 +1664,8 @@ out:
> static int __devinit mx2_camera_probe(struct platform_device *pdev)
> {
> struct mx2_camera_dev *pcdev;
> - struct resource *res_csi, *res_emma;
> - void __iomem *base_csi;
> - int irq_csi, irq_emma;
> + struct resource *res_csi;
> + int irq_csi;
> int err = 0;
>
> dev_dbg(&pdev->dev, "initialising\n");
> @@ -1687,21 +1678,20 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> goto exit;
> }
>
> - pcdev = kzalloc(sizeof(*pcdev), GFP_KERNEL);
> + pcdev = devm_kzalloc(&pdev->dev, sizeof(*pcdev), GFP_KERNEL);
> if (!pcdev) {
> dev_err(&pdev->dev, "Could not allocate pcdev\n");
> err = -ENOMEM;
> goto exit;
> }
>
> - pcdev->clk_csi = clk_get(&pdev->dev, "ahb");
> + pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
> if (IS_ERR(pcdev->clk_csi)) {
> dev_err(&pdev->dev, "Could not get csi clock\n");
> err = PTR_ERR(pcdev->clk_csi);
> - goto exit_kfree;
> + goto exit;
> }
>
> - pcdev->res_csi = res_csi;
> pcdev->pdata = pdev->dev.platform_data;
> if (pcdev->pdata) {
> long rate;
> @@ -1711,11 +1701,11 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> rate = clk_round_rate(pcdev->clk_csi, pcdev->pdata->clk * 2);
> if (rate <= 0) {
> err = -ENODEV;
> - goto exit_dma_free;
> + goto exit;
> }
> err = clk_set_rate(pcdev->clk_csi, rate);
> if (err < 0)
> - goto exit_dma_free;
> + goto exit;
> }
>
> INIT_LIST_HEAD(&pcdev->capture);
> @@ -1723,48 +1713,28 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> INIT_LIST_HEAD(&pcdev->discard);
> spin_lock_init(&pcdev->lock);
>
> - /*
> - * Request the regions.
> - */
> - if (!request_mem_region(res_csi->start, resource_size(res_csi),
> - MX2_CAM_DRV_NAME)) {
> - err = -EBUSY;
> - goto exit_dma_free;
> + pcdev->base_csi = devm_request_and_ioremap(&pdev->dev, res_csi);
> + if (!pcdev->base_csi) {
> + err = -EADDRNOTAVAIL;
> + goto exit;
> }
>
> - base_csi = ioremap(res_csi->start, resource_size(res_csi));
> - if (!base_csi) {
> - err = -ENOMEM;
> - goto exit_release;
> - }
> - pcdev->irq_csi = irq_csi;
> - pcdev->base_csi = base_csi;
> - pcdev->base_dma = res_csi->start;
> pcdev->dev = &pdev->dev;
> + platform_set_drvdata(pdev, pcdev);
>
> if (cpu_is_mx25()) {
> - err = request_irq(pcdev->irq_csi, mx25_camera_irq, 0,
> - MX2_CAM_DRV_NAME, pcdev);
> + err = devm_request_irq(&pdev->dev, irq_csi, mx25_camera_irq, 0,
> + MX2_CAM_DRV_NAME, pcdev);
> if (err) {
> dev_err(pcdev->dev, "Camera interrupt register failed \n");
> - goto exit_iounmap;
> + goto exit;
> }
> }
>
> if (cpu_is_mx27()) {
> - /* EMMA support */
> - res_emma = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> - irq_emma = platform_get_irq(pdev, 1);
> -
> - if (!res_emma || !irq_emma) {
> - dev_err(&pdev->dev, "no EMMA resources\n");
> - goto exit_free_irq;
> - }
> -
> - pcdev->res_emma = res_emma;
> - pcdev->irq_emma = irq_emma;
> - if (mx27_camera_emma_init(pcdev))
> - goto exit_free_irq;
> + err = mx27_camera_emma_init(pdev);
> + if (err)
> + goto exit;
> }
>
> pcdev->soc_host.drv_name = MX2_CAM_DRV_NAME,
> @@ -1793,25 +1763,9 @@ exit_free_emma:
> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
> eallocctx:
> if (cpu_is_mx27()) {
> - free_irq(pcdev->irq_emma, pcdev);
> clk_disable_unprepare(pcdev->clk_emma_ipg);
> - clk_put(pcdev->clk_emma_ipg);
> clk_disable_unprepare(pcdev->clk_emma_ahb);
> - clk_put(pcdev->clk_emma_ahb);
> - iounmap(pcdev->base_emma);
> - release_mem_region(pcdev->res_emma->start, resource_size(pcdev->res_emma));
> }
> -exit_free_irq:
> - if (cpu_is_mx25())
> - free_irq(pcdev->irq_csi, pcdev);
> -exit_iounmap:
> - iounmap(base_csi);
> -exit_release:
> - release_mem_region(res_csi->start, resource_size(res_csi));
> -exit_dma_free:
> - clk_put(pcdev->clk_csi);
> -exit_kfree:
> - kfree(pcdev);
> exit:
> return err;
> }
> @@ -1821,35 +1775,16 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
> struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev);
> struct mx2_camera_dev *pcdev = container_of(soc_host,
> struct mx2_camera_dev, soc_host);
> - struct resource *res;
> -
> - clk_put(pcdev->clk_csi);
> - if (cpu_is_mx25())
> - free_irq(pcdev->irq_csi, pcdev);
> - if (cpu_is_mx27())
> - free_irq(pcdev->irq_emma, pcdev);
>
> soc_camera_host_unregister(&pcdev->soc_host);
>
> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
>
> - iounmap(pcdev->base_csi);
> -
> if (cpu_is_mx27()) {
> clk_disable_unprepare(pcdev->clk_emma_ipg);
> - clk_put(pcdev->clk_emma_ipg);
> clk_disable_unprepare(pcdev->clk_emma_ahb);
> - clk_put(pcdev->clk_emma_ahb);
> - iounmap(pcdev->base_emma);
> - res = pcdev->res_emma;
> - release_mem_region(res->start, resource_size(res));
> }
>
> - res = pcdev->res_csi;
> - release_mem_region(res->start, resource_size(res));
> -
> - kfree(pcdev);
> -
> dev_info(&pdev->dev, "MX2 Camera driver unloaded\n");
>
> return 0;
> --
> 1.7.9.5
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 02/34] ASoC: mx27vis: retrieve gpio numbers from platform_data
2012-09-17 5:34 ` [PATCH 02/34] ASoC: mx27vis: retrieve gpio numbers from platform_data Shawn Guo
@ 2012-09-17 9:19 ` javier Martin
2012-09-17 11:07 ` Mark Brown
1 sibling, 0 replies; 80+ messages in thread
From: javier Martin @ 2012-09-17 9:19 UTC (permalink / raw)
To: linux-arm-kernel
Hi Shawn,
thank you for your patch.
On 17 September 2012 07:34, Shawn Guo <shawn.guo@linaro.org> wrote:
> Rather than including mach/iomux-mx27.h to define gpio numbers and set
> up the pins, the patch moves all these into machine code and has the
> gpio numbers passed to driver via platform_data. As the result, we
> can remove the mach/iomux-mx27.h inclusion from driver.
In fact, this even solves a BUG related to the external amp GPIOs not
being registered.
Acked-By: Javier Martin <javier.martin@vista-silicon.com>
Regards.
--
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion
2012-09-17 5:34 ` [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion Shawn Guo
@ 2012-09-17 9:21 ` Guennadi Liakhovetski
2012-09-17 13:43 ` javier Martin
0 siblings, 1 reply; 80+ messages in thread
From: Guennadi Liakhovetski @ 2012-09-17 9:21 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 17 Sep 2012, Shawn Guo wrote:
> It changes the driver to use platform_device_id rather than cpu_is_xxx
> to determine the controller type, and updates the platform code
> accordingly.
>
> As the result, mach/hardware.h inclusion gets removed from the driver.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: linux-media at vger.kernel.org
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Thanks
Guennadi
> ---
> arch/arm/mach-imx/clk-imx25.c | 6 +-
> arch/arm/mach-imx/clk-imx27.c | 6 +-
> arch/arm/mach-imx/devices/devices-common.h | 1 +
> arch/arm/mach-imx/devices/platform-mx2-camera.c | 12 +--
> drivers/media/video/mx2_camera.c | 95 +++++++++++++++++------
> 5 files changed, 85 insertions(+), 35 deletions(-)
>
> diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
> index 1aea073..71fe521 100644
> --- a/arch/arm/mach-imx/clk-imx25.c
> +++ b/arch/arm/mach-imx/clk-imx25.c
> @@ -231,9 +231,9 @@ int __init mx25_clocks_init(void)
> clk_register_clkdev(clk[esdhc2_ipg_per], "per", "sdhci-esdhc-imx25.1");
> clk_register_clkdev(clk[esdhc2_ipg], "ipg", "sdhci-esdhc-imx25.1");
> clk_register_clkdev(clk[esdhc2_ahb], "ahb", "sdhci-esdhc-imx25.1");
> - clk_register_clkdev(clk[csi_ipg_per], "per", "mx2-camera.0");
> - clk_register_clkdev(clk[csi_ipg], "ipg", "mx2-camera.0");
> - clk_register_clkdev(clk[csi_ahb], "ahb", "mx2-camera.0");
> + clk_register_clkdev(clk[csi_ipg_per], "per", "imx25-camera.0");
> + clk_register_clkdev(clk[csi_ipg], "ipg", "imx25-camera.0");
> + clk_register_clkdev(clk[csi_ahb], "ahb", "imx25-camera.0");
> clk_register_clkdev(clk[dummy], "audmux", NULL);
> clk_register_clkdev(clk[can1_ipg], NULL, "flexcan.0");
> clk_register_clkdev(clk[can2_ipg], NULL, "flexcan.1");
> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
> index 5ff5cf0..e26de52 100644
> --- a/arch/arm/mach-imx/clk-imx27.c
> +++ b/arch/arm/mach-imx/clk-imx27.c
> @@ -224,7 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
> clk_register_clkdev(clk[per3_gate], "per", "imx-fb.0");
> clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
> clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
> - clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
> + clk_register_clkdev(clk[csi_ahb_gate], "ahb", "imx27-camera.0");
> clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
> clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
> clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
> @@ -251,8 +251,8 @@ int __init mx27_clocks_init(unsigned long fref)
> clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx21-i2c.1");
> clk_register_clkdev(clk[owire_ipg_gate], NULL, "mxc_w1.0");
> clk_register_clkdev(clk[kpp_ipg_gate], NULL, "imx-keypad");
> - clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "mx2-camera.0");
> - clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "mx2-camera.0");
> + clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "imx27-camera.0");
> + clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "imx27-camera.0");
> clk_register_clkdev(clk[emma_ahb_gate], "ahb", "m2m-emmaprp.0");
> clk_register_clkdev(clk[emma_ipg_gate], "ipg", "m2m-emmaprp.0");
> clk_register_clkdev(clk[iim_ipg_gate], "iim", NULL);
> diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
> index 7f2698c..8112a1a 100644
> --- a/arch/arm/mach-imx/devices/devices-common.h
> +++ b/arch/arm/mach-imx/devices/devices-common.h
> @@ -202,6 +202,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
>
> #include <linux/platform_data/camera-mx2.h>
> struct imx_mx2_camera_data {
> + const char *devid;
> resource_size_t iobasecsi;
> resource_size_t iosizecsi;
> resource_size_t irqcsi;
> diff --git a/arch/arm/mach-imx/devices/platform-mx2-camera.c b/arch/arm/mach-imx/devices/platform-mx2-camera.c
> index 9ad5b2d..b88877d 100644
> --- a/arch/arm/mach-imx/devices/platform-mx2-camera.c
> +++ b/arch/arm/mach-imx/devices/platform-mx2-camera.c
> @@ -9,14 +9,16 @@
> #include <mach/hardware.h>
> #include "devices-common.h"
>
> -#define imx_mx2_camera_data_entry_single(soc) \
> +#define imx_mx2_camera_data_entry_single(soc, _devid) \
> { \
> + .devid = _devid, \
> .iobasecsi = soc ## _CSI_BASE_ADDR, \
> .iosizecsi = SZ_4K, \
> .irqcsi = soc ## _INT_CSI, \
> }
> -#define imx_mx2_camera_data_entry_single_emma(soc) \
> +#define imx_mx2_camera_data_entry_single_emma(soc, _devid) \
> { \
> + .devid = _devid, \
> .iobasecsi = soc ## _CSI_BASE_ADDR, \
> .iosizecsi = SZ_32, \
> .irqcsi = soc ## _INT_CSI, \
> @@ -27,12 +29,12 @@
>
> #ifdef CONFIG_SOC_IMX25
> const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst =
> - imx_mx2_camera_data_entry_single(MX25);
> + imx_mx2_camera_data_entry_single(MX25, "imx25-camera");
> #endif /* ifdef CONFIG_SOC_IMX25 */
>
> #ifdef CONFIG_SOC_IMX27
> const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst =
> - imx_mx2_camera_data_entry_single_emma(MX27);
> + imx_mx2_camera_data_entry_single_emma(MX27, "imx27-camera");
> #endif /* ifdef CONFIG_SOC_IMX27 */
>
> struct platform_device *__init imx_add_mx2_camera(
> @@ -58,7 +60,7 @@ struct platform_device *__init imx_add_mx2_camera(
> .flags = IORESOURCE_IRQ,
> },
> };
> - return imx_add_platform_device_dmamask("mx2-camera", 0,
> + return imx_add_platform_device_dmamask(data->devid, 0,
> res, data->iobaseemmaprp ? 4 : 2,
> pdata, sizeof(*pdata), DMA_BIT_MASK(32));
> }
> diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
> index fe4c76c..cde3374 100644
> --- a/drivers/media/video/mx2_camera.c
> +++ b/drivers/media/video/mx2_camera.c
> @@ -41,7 +41,6 @@
> #include <linux/videodev2.h>
>
> #include <linux/platform_data/camera-mx2.h>
> -#include <mach/hardware.h>
>
> #include <asm/dma.h>
>
> @@ -121,11 +120,13 @@
>
> #define CSICR1 0x00
> #define CSICR2 0x04
> -#define CSISR (cpu_is_mx27() ? 0x08 : 0x18)
> +#define CSISR_IMX25 0x18
> +#define CSISR_IMX27 0x08
> #define CSISTATFIFO 0x0c
> #define CSIRFIFO 0x10
> #define CSIRXCNT 0x14
> -#define CSICR3 (cpu_is_mx27() ? 0x1C : 0x08)
> +#define CSICR3_IMX25 0x08
> +#define CSICR3_IMX27 0x1c
> #define CSIDMASA_STATFIFO 0x20
> #define CSIDMATA_STATFIFO 0x24
> #define CSIDMASA_FB1 0x28
> @@ -268,6 +269,11 @@ struct mx2_buffer {
> struct mx2_buf_internal internal;
> };
>
> +enum mx2_camera_type {
> + IMX25_CAMERA,
> + IMX27_CAMERA,
> +};
> +
> struct mx2_camera_dev {
> struct device *dev;
> struct soc_camera_host soc_host;
> @@ -291,6 +297,9 @@ struct mx2_camera_dev {
> struct mx2_buffer *fb2_active;
>
> u32 csicr1;
> + u32 reg_csisr;
> + u32 reg_csicr3;
> + enum mx2_camera_type devtype;
>
> struct mx2_buf_internal buf_discard[2];
> void *discard_buffer;
> @@ -303,6 +312,29 @@ struct mx2_camera_dev {
> struct vb2_alloc_ctx *alloc_ctx;
> };
>
> +static struct platform_device_id mx2_camera_devtype[] = {
> + {
> + .name = "imx25-camera",
> + .driver_data = IMX25_CAMERA,
> + }, {
> + .name = "imx27-camera",
> + .driver_data = IMX27_CAMERA,
> + }, {
> + /* sentinel */
> + }
> +};
> +MODULE_DEVICE_TABLE(platform, mx2_camera_devtype);
> +
> +static inline int is_imx25_camera(struct mx2_camera_dev *pcdev)
> +{
> + return pcdev->devtype == IMX25_CAMERA;
> +}
> +
> +static inline int is_imx27_camera(struct mx2_camera_dev *pcdev)
> +{
> + return pcdev->devtype == IMX27_CAMERA;
> +}
> +
> static struct mx2_buffer *mx2_ibuf_to_buf(struct mx2_buf_internal *int_buf)
> {
> return container_of(int_buf, struct mx2_buffer, internal);
> @@ -406,9 +438,9 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
>
> clk_disable_unprepare(pcdev->clk_csi);
> writel(0, pcdev->base_csi + CSICR1);
> - if (cpu_is_mx27()) {
> + if (is_imx27_camera(pcdev)) {
> writel(0, pcdev->base_emma + PRP_CNTL);
> - } else if (cpu_is_mx25()) {
> + } else if (is_imx25_camera(pcdev)) {
> spin_lock_irqsave(&pcdev->lock, flags);
> pcdev->fb1_active = NULL;
> pcdev->fb2_active = NULL;
> @@ -438,7 +470,7 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
>
> csicr1 = CSICR1_MCLKEN;
>
> - if (cpu_is_mx27())
> + if (is_imx27_camera(pcdev))
> csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
> CSICR1_RXFF_LEVEL(0);
>
> @@ -514,7 +546,7 @@ out:
> static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
> {
> struct mx2_camera_dev *pcdev = data;
> - u32 status = readl(pcdev->base_csi + CSISR);
> + u32 status = readl(pcdev->base_csi + pcdev->reg_csisr);
>
> if (status & CSISR_DMA_TSF_FB1_INT)
> mx25_camera_frame_done(pcdev, 1, MX2_STATE_DONE);
> @@ -523,7 +555,7 @@ static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
>
> /* FIXME: handle CSISR_RFF_OR_INT */
>
> - writel(status, pcdev->base_csi + CSISR);
> + writel(status, pcdev->base_csi + pcdev->reg_csisr);
>
> return IRQ_HANDLED;
> }
> @@ -608,7 +640,7 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
> buf->state = MX2_STATE_QUEUED;
> list_add_tail(&buf->internal.queue, &pcdev->capture);
>
> - if (cpu_is_mx25()) {
> + if (is_imx25_camera(pcdev)) {
> u32 csicr3, dma_inten = 0;
>
> if (pcdev->fb1_active == NULL) {
> @@ -627,20 +659,20 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
> list_del(&buf->internal.queue);
> buf->state = MX2_STATE_ACTIVE;
>
> - csicr3 = readl(pcdev->base_csi + CSICR3);
> + csicr3 = readl(pcdev->base_csi + pcdev->reg_csicr3);
>
> /* Reflash DMA */
> writel(csicr3 | CSICR3_DMA_REFLASH_RFF,
> - pcdev->base_csi + CSICR3);
> + pcdev->base_csi + pcdev->reg_csicr3);
>
> /* clear & enable interrupts */
> - writel(dma_inten, pcdev->base_csi + CSISR);
> + writel(dma_inten, pcdev->base_csi + pcdev->reg_csisr);
> pcdev->csicr1 |= dma_inten;
> writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
>
> /* enable DMA */
> csicr3 |= CSICR3_DMA_REQ_EN_RFF | CSICR3_RXFF_LEVEL(1);
> - writel(csicr3, pcdev->base_csi + CSICR3);
> + writel(csicr3, pcdev->base_csi + pcdev->reg_csicr3);
> }
> }
>
> @@ -684,7 +716,7 @@ static void mx2_videobuf_release(struct vb2_buffer *vb)
> */
>
> spin_lock_irqsave(&pcdev->lock, flags);
> - if (cpu_is_mx25() && buf->state == MX2_STATE_ACTIVE) {
> + if (is_imx25_camera(pcdev) && buf->state == MX2_STATE_ACTIVE) {
> if (pcdev->fb1_active == buf) {
> pcdev->csicr1 &= ~CSICR1_FB1_DMA_INTEN;
> writel(0, pcdev->base_csi + CSIDMASA_FB1);
> @@ -807,7 +839,7 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count)
> unsigned long phys;
> int bytesperline;
>
> - if (cpu_is_mx27()) {
> + if (is_imx27_camera(pcdev)) {
> unsigned long flags;
> if (count < 2)
> return -EINVAL;
> @@ -902,7 +934,7 @@ static int mx2_stop_streaming(struct vb2_queue *q)
> void *b;
> u32 cntl;
>
> - if (cpu_is_mx27()) {
> + if (is_imx27_camera(pcdev)) {
> spin_lock_irqsave(&pcdev->lock, flags);
>
> cntl = readl(pcdev->base_emma + PRP_CNTL);
> @@ -1054,11 +1086,11 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd)
> if (bytesperline < 0)
> return bytesperline;
>
> - if (cpu_is_mx27()) {
> + if (is_imx27_camera(pcdev)) {
> ret = mx27_camera_emma_prp_reset(pcdev);
> if (ret)
> return ret;
> - } else if (cpu_is_mx25()) {
> + } else if (is_imx25_camera(pcdev)) {
> writel((bytesperline * icd->user_height) >> 2,
> pcdev->base_csi + CSIRXCNT);
> writel((bytesperline << 16) | icd->user_height,
> @@ -1351,7 +1383,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
> /* FIXME: implement MX27 limits */
>
> /* limit to MX25 hardware capabilities */
> - if (cpu_is_mx25()) {
> + if (is_imx25_camera(pcdev)) {
> if (xlate->host_fmt->bits_per_sample <= 8)
> width_limit = 0xffff * 4;
> else
> @@ -1685,6 +1717,20 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> goto exit;
> }
>
> + pcdev->devtype = pdev->id_entry->driver_data;
> + switch (pcdev->devtype) {
> + case IMX25_CAMERA:
> + pcdev->reg_csisr = CSISR_IMX25;
> + pcdev->reg_csicr3 = CSICR3_IMX25;
> + break;
> + case IMX27_CAMERA:
> + pcdev->reg_csisr = CSISR_IMX27;
> + pcdev->reg_csicr3 = CSICR3_IMX27;
> + break;
> + default:
> + break;
> + }
> +
> pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
> if (IS_ERR(pcdev->clk_csi)) {
> dev_err(&pdev->dev, "Could not get csi clock\n");
> @@ -1722,7 +1768,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> pcdev->dev = &pdev->dev;
> platform_set_drvdata(pdev, pcdev);
>
> - if (cpu_is_mx25()) {
> + if (is_imx25_camera(pcdev)) {
> err = devm_request_irq(&pdev->dev, irq_csi, mx25_camera_irq, 0,
> MX2_CAM_DRV_NAME, pcdev);
> if (err) {
> @@ -1731,7 +1777,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> }
> }
>
> - if (cpu_is_mx27()) {
> + if (is_imx27_camera(pcdev)) {
> err = mx27_camera_emma_init(pdev);
> if (err)
> goto exit;
> @@ -1742,7 +1788,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> pcdev->soc_host.priv = pcdev;
> pcdev->soc_host.v4l2_dev.dev = &pdev->dev;
> pcdev->soc_host.nr = pdev->id;
> - if (cpu_is_mx25())
> + if (is_imx25_camera(pcdev))
> pcdev->soc_host.capabilities = SOCAM_HOST_CAP_STRIDE;
>
> pcdev->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev);
> @@ -1762,7 +1808,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> exit_free_emma:
> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
> eallocctx:
> - if (cpu_is_mx27()) {
> + if (is_imx27_camera(pcdev)) {
> clk_disable_unprepare(pcdev->clk_emma_ipg);
> clk_disable_unprepare(pcdev->clk_emma_ahb);
> }
> @@ -1780,7 +1826,7 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
>
> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
>
> - if (cpu_is_mx27()) {
> + if (is_imx27_camera(pcdev)) {
> clk_disable_unprepare(pcdev->clk_emma_ipg);
> clk_disable_unprepare(pcdev->clk_emma_ahb);
> }
> @@ -1794,6 +1840,7 @@ static struct platform_driver mx2_camera_driver = {
> .driver = {
> .name = MX2_CAM_DRV_NAME,
> },
> + .id_table = mx2_camera_devtype,
> .remove = __devexit_p(mx2_camera_remove),
> };
>
> --
> 1.7.9.5
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 14/34] dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h
2012-09-17 5:34 ` [PATCH 14/34] dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h Shawn Guo
@ 2012-09-17 9:26 ` Guennadi Liakhovetski
2012-09-27 7:38 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 80+ messages in thread
From: Guennadi Liakhovetski @ 2012-09-17 9:26 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 17 Sep 2012, Shawn Guo wrote:
> The header ipu.h really belongs to dma subsystem rather than imx
> platform. Rename it to ipu-dma.h and put it into include/linux/dma/.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Vinod Koul <vinod.koul@intel.com>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
> Cc: linux-media at vger.kernel.org
> Cc: linux-fbdev at vger.kernel.org
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Thanks
Guennadi
> ---
> drivers/dma/ipu/ipu_idmac.c | 3 +--
> drivers/dma/ipu/ipu_irq.c | 3 +--
> drivers/media/video/mx3_camera.c | 2 +-
> drivers/video/mx3fb.c | 2 +-
> .../mach/ipu.h => include/linux/dma/ipu-dma.h | 6 +++---
> 5 files changed, 7 insertions(+), 9 deletions(-)
> rename arch/arm/mach-imx/include/mach/ipu.h => include/linux/dma/ipu-dma.h (97%)
>
> diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c
> index c7573e5..6585537 100644
> --- a/drivers/dma/ipu/ipu_idmac.c
> +++ b/drivers/dma/ipu/ipu_idmac.c
> @@ -22,8 +22,7 @@
> #include <linux/interrupt.h>
> #include <linux/io.h>
> #include <linux/module.h>
> -
> -#include <mach/ipu.h>
> +#include <linux/dma/ipu-dma.h>
>
> #include "../dmaengine.h"
> #include "ipu_intern.h"
> diff --git a/drivers/dma/ipu/ipu_irq.c b/drivers/dma/ipu/ipu_irq.c
> index fa95bcc..a5ee37d 100644
> --- a/drivers/dma/ipu/ipu_irq.c
> +++ b/drivers/dma/ipu/ipu_irq.c
> @@ -15,8 +15,7 @@
> #include <linux/irq.h>
> #include <linux/io.h>
> #include <linux/module.h>
> -
> -#include <mach/ipu.h>
> +#include <linux/dma/ipu-dma.h>
>
> #include "ipu_intern.h"
>
> diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
> index 1481b0d..892cba5 100644
> --- a/drivers/media/video/mx3_camera.c
> +++ b/drivers/media/video/mx3_camera.c
> @@ -17,6 +17,7 @@
> #include <linux/vmalloc.h>
> #include <linux/interrupt.h>
> #include <linux/sched.h>
> +#include <linux/dma/ipu-dma.h>
>
> #include <media/v4l2-common.h>
> #include <media/v4l2-dev.h>
> @@ -24,7 +25,6 @@
> #include <media/soc_camera.h>
> #include <media/soc_mediabus.h>
>
> -#include <mach/ipu.h>
> #include <linux/platform_data/camera-mx3.h>
> #include <linux/platform_data/dma-imx.h>
>
> diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
> index d738108..3b63ad8 100644
> --- a/drivers/video/mx3fb.c
> +++ b/drivers/video/mx3fb.c
> @@ -26,10 +26,10 @@
> #include <linux/console.h>
> #include <linux/clk.h>
> #include <linux/mutex.h>
> +#include <linux/dma/ipu-dma.h>
>
> #include <linux/platform_data/dma-imx.h>
> #include <mach/hardware.h>
> -#include <mach/ipu.h>
> #include <linux/platform_data/video-mx3fb.h>
>
> #include <asm/io.h>
> diff --git a/arch/arm/mach-imx/include/mach/ipu.h b/include/linux/dma/ipu-dma.h
> similarity index 97%
> rename from arch/arm/mach-imx/include/mach/ipu.h
> rename to include/linux/dma/ipu-dma.h
> index 539e559..1803111 100644
> --- a/arch/arm/mach-imx/include/mach/ipu.h
> +++ b/include/linux/dma/ipu-dma.h
> @@ -9,8 +9,8 @@
> * published by the Free Software Foundation.
> */
>
> -#ifndef _IPU_H_
> -#define _IPU_H_
> +#ifndef __LINUX_DMA_IPU_DMA_H
> +#define __LINUX_DMA_IPU_DMA_H
>
> #include <linux/types.h>
> #include <linux/dmaengine.h>
> @@ -174,4 +174,4 @@ struct idmac_channel {
> #define to_tx_desc(tx) container_of(tx, struct idmac_tx_desc, txd)
> #define to_idmac_chan(c) container_of(c, struct idmac_channel, dma_chan)
>
> -#endif
> +#endif /* __LINUX_DMA_IPU_DMA_H */
> --
> 1.7.9.5
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 02/34] ASoC: mx27vis: retrieve gpio numbers from platform_data
2012-09-17 5:34 ` [PATCH 02/34] ASoC: mx27vis: retrieve gpio numbers from platform_data Shawn Guo
2012-09-17 9:19 ` javier Martin
@ 2012-09-17 11:07 ` Mark Brown
2012-09-20 1:14 ` Shawn Guo
1 sibling, 1 reply; 80+ messages in thread
From: Mark Brown @ 2012-09-17 11:07 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Sep 17, 2012 at 01:34:31PM +0800, Shawn Guo wrote:
I've applied this since Javier says it fixes a bug but I'm not terribly
enthused about it.
> arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 42 ++++++++++++++++++++++++++-
> include/linux/platform_data/asoc-mx27vis.h | 11 +++++++
> sound/soc/fsl/mx27vis-aic32x4.c | 42 +++++++++++++--------------
Audio drivers put their platform data in include/sound.
> 3 files changed, 72 insertions(+), 23 deletions(-)
This also seems like we're just going to be going for bloat, given that
this is a general change we should be (finally) getting round to having
a generic GPIO based CODEC driver.
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 17/34] usb: ehci-mxc: remove unneeded mach/hardware.h inclusion
2012-09-17 5:34 ` [PATCH 17/34] usb: ehci-mxc: " Shawn Guo
@ 2012-09-17 11:18 ` Greg Kroah-Hartman
0 siblings, 0 replies; 80+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-17 11:18 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Sep 17, 2012 at 01:34:46PM +0800, Shawn Guo wrote:
> The inclusion of mach/hardware.h is not used by the driver at all.
> Remove it.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-usb at vger.kernel.org
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 33/34] ARM: imx: remove header file mach/irqs.h
2012-09-17 5:35 ` [PATCH 33/34] ARM: imx: remove header file mach/irqs.h Shawn Guo
@ 2012-09-17 11:32 ` Arnd Bergmann
2012-09-18 8:13 ` Shawn Guo
2012-09-17 11:46 ` Mark Brown
1 sibling, 1 reply; 80+ messages in thread
From: Arnd Bergmann @ 2012-09-17 11:32 UTC (permalink / raw)
To: linux-arm-kernel
On Monday 17 September 2012, Shawn Guo wrote:
> @@ -269,6 +268,8 @@ static int imx_pcm_fiq_new(struct snd_soc_pcm_runtime *rtd)
> return 0;
> }
>
> +extern int mxc_set_irq_fiq(unsigned int irq, unsigned int type);
> +
> static void imx_pcm_fiq_free(struct snd_pcm *pcm)
> {
> mxc_set_irq_fiq(ssi_irq, 0);
Hmm, this is quite hacky, I can see why you left it all the way
to the end of the otherwise excellent series ;-)
We already have some fiq specific stuff in the
include/linux/platform_data/asoc-imx-ssi.h header file,
so I think it's best to put this declaration there, too.
If we want to eventually clean up the fiq usage in this driver,
I think we should extend the DT binding for the interrupt controller
to describe the fiq correctly so it can all be done transparently.
Arnd
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 00/34] i.MX multi-platform support
2012-09-17 7:51 ` [PATCH 00/34] i.MX multi-platform support Sascha Hauer
@ 2012-09-17 11:38 ` Arnd Bergmann
2012-09-18 8:20 ` Shawn Guo
1 sibling, 0 replies; 80+ messages in thread
From: Arnd Bergmann @ 2012-09-17 11:38 UTC (permalink / raw)
To: linux-arm-kernel
On Monday 17 September 2012, Sascha Hauer wrote:
> On Mon, Sep 17, 2012 at 01:34:29PM +0800, Shawn Guo wrote:
> > The series enables multi-platform support for imx. Since the required
> > frameworks (clk, pwm) and spare_irq have already been adopted on imx,
> > the series is all about cleaning up mach/* headers. Along with the
> > changes, arch/arm/plat-mxc gets merged into arch/arm/mach-imx.
> >
> > It's based on a bunch of branches (works from others), Rob's initial
> > multi-platform series, Arnd's platform-data and smp_ops (Marc's) and
> > imx 3.7 material (Sascha and myself).
> >
> > It's available on branch below.
> >
> > git://git.linaro.org/people/shawnguo/linux-2.6.git imx/multi-platform
> >
> > It's been tested on imx5 and imx6, and only compile-tested on imx2 and
> > imx3, so testing on imx2/3 are appreciated.
>
> Great work! This really pushes the i.MX architecture one step closer to
> a clean code base.
I agree, this series is wonderful, I thought it would take much longer
to get this far.
Two small comments on the last two patches from me, but overall I really
love it.
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 34/34] ARM: imx: enable multi-platform build
2012-09-17 5:35 ` [PATCH 34/34] ARM: imx: enable multi-platform build Shawn Guo
@ 2012-09-17 11:44 ` Arnd Bergmann
0 siblings, 0 replies; 80+ messages in thread
From: Arnd Bergmann @ 2012-09-17 11:44 UTC (permalink / raw)
To: linux-arm-kernel
On Monday 17 September 2012, Shawn Guo wrote:
> -menu "Freescale MXC Implementations"
> -
> -choice
> - prompt "Freescale CPU family:"
> - default ARCH_IMX_V6_V7
> -
> config ARCH_IMX_V4_V5
> - bool "i.MX1, i.MX21, i.MX25, i.MX27"
> - select AUTO_ZRELADDR if !ZBOOT_ROM
> - select ARM_PATCH_PHYS_VIRT
> - help
> - This enables support for systems based on the Freescale i.MX ARMv4
> - and ARMv5 SoCs
> + def_bool y
> + depends on ARCH_MULTI_V4_V5
>
This is good, but I'd also suggest using specific dependencies on the
architecture level (V4, V4T, V5, V6, V6K, V7). For the other platforms
in the Rob's multiplatform series, this is not an issue because each
of them only works on exactly one architecture level.
For i.MX and other platforms that us a bunch of different CPU cores,
I think it's helpful if you can limit the configuration to a specific
architecture level, because that can result in a slightly more
efficient kernel binary. E.g. when you want to build a THUMB2 based
kernel, you can start by enabling only ARMv7 CPUs, and then select all
the board configurations without having to know which ones are actually
V6 or V7.
Doing this will require another update to the defconfig file, in addition
to the one mentioned by Sascha.
Arnd
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 16/34] ASoC: imx-ssi: remove unneeded mach/hardware.h inclusion
2012-09-17 5:34 ` [PATCH 16/34] ASoC: imx-ssi: " Shawn Guo
@ 2012-09-17 11:45 ` Mark Brown
2012-09-17 14:30 ` Arnd Bergmann
0 siblings, 1 reply; 80+ messages in thread
From: Mark Brown @ 2012-09-17 11:45 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Sep 17, 2012 at 01:34:45PM +0800, Shawn Guo wrote:
> #include <linux/platform_data/asoc-imx-ssi.h>
> -#include <mach/hardware.h>
This doesn't apply - there's no platform data header for imx-ssi at the
minute (and I don't see a patch in this series related to that in the
series). I checked -next and there doesn't seem to be anything via a
non-ASoC tree either.
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 33/34] ARM: imx: remove header file mach/irqs.h
2012-09-17 5:35 ` [PATCH 33/34] ARM: imx: remove header file mach/irqs.h Shawn Guo
2012-09-17 11:32 ` Arnd Bergmann
@ 2012-09-17 11:46 ` Mark Brown
1 sibling, 0 replies; 80+ messages in thread
From: Mark Brown @ 2012-09-17 11:46 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Sep 17, 2012 at 01:35:02PM +0800, Shawn Guo wrote:
> The only mach/irqs.h user outside arch/arm/mach-imx is
> sound/soc/fsl/imx-pcm-fiq.c, which refers to mxc_set_irq_fiq().
> Though moving the declaration into imx-pcm-fiq.c will result in
> the checkpatch below, let's do it to gain the multi-platform support
> for mach-imx.
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 27/34] media: mx2_camera: use managed functions to clean up code
2012-09-17 9:11 ` Guennadi Liakhovetski
@ 2012-09-17 13:36 ` javier Martin
2012-09-18 7:43 ` Shawn Guo
0 siblings, 1 reply; 80+ messages in thread
From: javier Martin @ 2012-09-17 13:36 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On 17 September 2012 11:11, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> On Mon, 17 Sep 2012, Shawn Guo wrote:
>
>> Use managed functions to clean up the error handling code and function
>> mx2_camera_remove(). Along with the change, a few variables get removed
>> from struct mx2_camera_dev.
>>
>> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>> Cc: linux-media at vger.kernel.org
>
> (in case you want to push it via arm-soc)
>
> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
This patch breaks the driver:
soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
Unable to handle kernel paging request at virtual address 656d6162
pgd = c0004000
[656d6162] *pgd=00000000
Internal error: Oops: 80000005 [#1] PREEMPT ARM
Modules linked in:
CPU: 0 Not tainted (3.6.0-rc5-01222-g3413fb1 #12)
PC is at 0x656d6162
LR is at soc_camera_host_register+0x230/0x81c
pc : [<656d6162>] lr : [<c01ff6a0>] psr: 40000033
sp : c3025e48 ip : 00000000 fp : 00000000
r10: c03f236c r9 : 00000000 r8 : 00000001
r7 : 00000000 r6 : c317d414 r5 : c30431a0 r4 : c317d600
r3 : 656d6163 r2 : c3025e18 r1 : 000c0000 r0 : c317d600
Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA Thumb Segment kernel
Control: 0005317f Table: a0004000 DAC: 00000017
Process swapper (pid: 1, stack limit = 0xc3024270)
Stack: (0xc3025e48 to 0xc3026000)
5e40: c3006460 00000000 c3192960 00000043 c317d638 c005d624
5e60: 00000043 c317d410 c317d478 c317d414 c02012f0 c317d410 00000000 00000043
5e80: c31a9800 c31a9820 00000000 c022ca74 c300ab20 00000000 c306e4a8 c306e4a0
5ea0: c30000c0 40000013 000080d0 c317d410 c317d410 c306e4a8 c306e4a0 00000001
5ec0: 00000000 c03f236c 00000000 c02c8d50 00000000 c03535ee c317d410 c02c8a44
5ee0: c306e4a8 c306e4a8 c03fc478 c03fc478 00000050 c03e0774 c03dc684 c0189d30
5f00: c306e4a8 c0188c3c c306e4a8 c306e4dc c03fc478 00000000 00000050 c0188db8
5f20: c03fc478 c3025f30 c0188d58 c0187610 c300760c c3079ad0 c03fc478 c03fc478
5f40: c318e680 c03f6458 00000000 c0187d24 c03535ee c03535ee c3025f58 c03fc478
5f60: 00000001 c04049c0 00000000 c01892c8 c03fc464 00000001 c04049c0 00000000
5f80: 00000050 c018a05c c03dc67c c03d4e84 c04049c0 c00087c8 00000006 00000006
5fa0: c03eeca0 c03dc67c 00000007 c03dc67c 00000007 c04049c0 c03c41a4 00000050
5fc0: c03e0774 c03c42f4 00000006 00000006 c03c41a4 00000000 00000000 c03c4214
5fe0: c0014900 00000013 00000000 00000000 00000000 c0014900 ffffffff ffffffff
[<c01ff6a0>] (soc_camera_host_register+0x230/0x81c) from [<c02c8d50>]
(mx2_camera_probe+0x30c/0x3ac)
[<c02c8d50>] (mx2_camera_probe+0x30c/0x3ac) from [<c0189d30>]
(platform_drv_probe+0x14/0x18)
[<c0189d30>] (platform_drv_probe+0x14/0x18) from [<c0188c3c>]
(driver_probe_device+0xb0/0x1cc)
[<c0188c3c>] (driver_probe_device+0xb0/0x1cc) from [<c0188db8>]
(__driver_attach+0x60/0x84)
[<c0188db8>] (__driver_attach+0x60/0x84) from [<c0187610>]
(bus_for_each_dev+0x48/0x84)
[<c0187610>] (bus_for_each_dev+0x48/0x84) from [<c0187d24>]
(bus_add_driver+0x9c/0x20c)
[<c0187d24>] (bus_add_driver+0x9c/0x20c) from [<c01892c8>]
(driver_register+0xa0/0x138)
[<c01892c8>] (driver_register+0xa0/0x138) from [<c018a05c>]
(platform_driver_probe+0x18/0x98)
[<c018a05c>] (platform_driver_probe+0x18/0x98) from [<c00087c8>]
(do_one_initcall+0x94/0x16c)
[<c00087c8>] (do_one_initcall+0x94/0x16c) from [<c03c42f4>]
(kernel_init+0xe0/0x1ac)
[<c03c42f4>] (kernel_init+0xe0/0x1ac) from [<c0014900>]
(kernel_thread_exit+0x0/0x8)
Code: bad PC value
---[ end trace 7f259a1ce2e10b1a ]---
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
--
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 26/34] media: mx2_camera: remove dead code in mx2_camera_add_device
2012-09-17 8:18 ` Guennadi Liakhovetski
@ 2012-09-17 13:36 ` javier Martin
2012-09-18 1:49 ` Shawn Guo
1 sibling, 0 replies; 80+ messages in thread
From: javier Martin @ 2012-09-17 13:36 UTC (permalink / raw)
To: linux-arm-kernel
On 17 September 2012 10:18, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> Hi Shawn
>
> Thanks for the clean up. Would you like these patches to go via a single
> tree, presumably, arm-soc? In this case
>
> On Mon, 17 Sep 2012, Shawn Guo wrote:
>
>> This is a piece of code becoming dead since commit 2c9ba37 ([media]
>> V4L: mx2_camera: remove unsupported i.MX27 DMA mode, make EMMA
>> mandatory). It should have been removed together with the commit.
>> Remove it now.
>>
>> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>> Cc: linux-media at vger.kernel.org
>
Acked-by: Javier Martin <javier.martin@vista-silicon.com>
> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>
> Thanks
> Guennadi
>
>> ---
>> drivers/media/video/mx2_camera.c | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
>> index 965427f..89c7e28 100644
>> --- a/drivers/media/video/mx2_camera.c
>> +++ b/drivers/media/video/mx2_camera.c
>> @@ -441,11 +441,9 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
>>
>> csicr1 = CSICR1_MCLKEN;
>>
>> - if (cpu_is_mx27()) {
>> + if (cpu_is_mx27())
>> csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
>> CSICR1_RXFF_LEVEL(0);
>> - } else if (cpu_is_mx27())
>> - csicr1 |= CSICR1_SOF_INTEN | CSICR1_RXFF_LEVEL(2);
>>
>> pcdev->csicr1 = csicr1;
>> writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
>> --
>> 1.7.9.5
>>
>
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion
2012-09-17 9:21 ` Guennadi Liakhovetski
@ 2012-09-17 13:43 ` javier Martin
2012-09-17 13:59 ` Guennadi Liakhovetski
0 siblings, 1 reply; 80+ messages in thread
From: javier Martin @ 2012-09-17 13:43 UTC (permalink / raw)
To: linux-arm-kernel
Hi Shawn,
On 17 September 2012 11:21, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> On Mon, 17 Sep 2012, Shawn Guo wrote:
>
>> It changes the driver to use platform_device_id rather than cpu_is_xxx
>> to determine the controller type, and updates the platform code
>> accordingly.
>>
>> As the result, mach/hardware.h inclusion gets removed from the driver.
>>
>> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>> Cc: linux-media at vger.kernel.org
>
> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
i.MX25 support is broken and is scheduled for removal.
I think we should not keep on trying to maintain it. Couldn't we just
drop it? It only makes maintenance tasks more difficult.
> Thanks
> Guennadi
>
>> ---
>> arch/arm/mach-imx/clk-imx25.c | 6 +-
>> arch/arm/mach-imx/clk-imx27.c | 6 +-
>> arch/arm/mach-imx/devices/devices-common.h | 1 +
>> arch/arm/mach-imx/devices/platform-mx2-camera.c | 12 +--
>> drivers/media/video/mx2_camera.c | 95 +++++++++++++++++------
>> 5 files changed, 85 insertions(+), 35 deletions(-)
>>
>> diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
>> index 1aea073..71fe521 100644
>> --- a/arch/arm/mach-imx/clk-imx25.c
>> +++ b/arch/arm/mach-imx/clk-imx25.c
>> @@ -231,9 +231,9 @@ int __init mx25_clocks_init(void)
>> clk_register_clkdev(clk[esdhc2_ipg_per], "per", "sdhci-esdhc-imx25.1");
>> clk_register_clkdev(clk[esdhc2_ipg], "ipg", "sdhci-esdhc-imx25.1");
>> clk_register_clkdev(clk[esdhc2_ahb], "ahb", "sdhci-esdhc-imx25.1");
>> - clk_register_clkdev(clk[csi_ipg_per], "per", "mx2-camera.0");
>> - clk_register_clkdev(clk[csi_ipg], "ipg", "mx2-camera.0");
>> - clk_register_clkdev(clk[csi_ahb], "ahb", "mx2-camera.0");
>> + clk_register_clkdev(clk[csi_ipg_per], "per", "imx25-camera.0");
>> + clk_register_clkdev(clk[csi_ipg], "ipg", "imx25-camera.0");
>> + clk_register_clkdev(clk[csi_ahb], "ahb", "imx25-camera.0");
>> clk_register_clkdev(clk[dummy], "audmux", NULL);
>> clk_register_clkdev(clk[can1_ipg], NULL, "flexcan.0");
>> clk_register_clkdev(clk[can2_ipg], NULL, "flexcan.1");
>> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
>> index 5ff5cf0..e26de52 100644
>> --- a/arch/arm/mach-imx/clk-imx27.c
>> +++ b/arch/arm/mach-imx/clk-imx27.c
>> @@ -224,7 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
>> clk_register_clkdev(clk[per3_gate], "per", "imx-fb.0");
>> clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
>> clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
>> - clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
>> + clk_register_clkdev(clk[csi_ahb_gate], "ahb", "imx27-camera.0");
>> clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
>> clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
>> clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
>> @@ -251,8 +251,8 @@ int __init mx27_clocks_init(unsigned long fref)
>> clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx21-i2c.1");
>> clk_register_clkdev(clk[owire_ipg_gate], NULL, "mxc_w1.0");
>> clk_register_clkdev(clk[kpp_ipg_gate], NULL, "imx-keypad");
>> - clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "mx2-camera.0");
>> - clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "mx2-camera.0");
>> + clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "imx27-camera.0");
>> + clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "imx27-camera.0");
>> clk_register_clkdev(clk[emma_ahb_gate], "ahb", "m2m-emmaprp.0");
>> clk_register_clkdev(clk[emma_ipg_gate], "ipg", "m2m-emmaprp.0");
>> clk_register_clkdev(clk[iim_ipg_gate], "iim", NULL);
>> diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
>> index 7f2698c..8112a1a 100644
>> --- a/arch/arm/mach-imx/devices/devices-common.h
>> +++ b/arch/arm/mach-imx/devices/devices-common.h
>> @@ -202,6 +202,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
>>
>> #include <linux/platform_data/camera-mx2.h>
>> struct imx_mx2_camera_data {
>> + const char *devid;
>> resource_size_t iobasecsi;
>> resource_size_t iosizecsi;
>> resource_size_t irqcsi;
>> diff --git a/arch/arm/mach-imx/devices/platform-mx2-camera.c b/arch/arm/mach-imx/devices/platform-mx2-camera.c
>> index 9ad5b2d..b88877d 100644
>> --- a/arch/arm/mach-imx/devices/platform-mx2-camera.c
>> +++ b/arch/arm/mach-imx/devices/platform-mx2-camera.c
>> @@ -9,14 +9,16 @@
>> #include <mach/hardware.h>
>> #include "devices-common.h"
>>
>> -#define imx_mx2_camera_data_entry_single(soc) \
>> +#define imx_mx2_camera_data_entry_single(soc, _devid) \
>> { \
>> + .devid = _devid, \
>> .iobasecsi = soc ## _CSI_BASE_ADDR, \
>> .iosizecsi = SZ_4K, \
>> .irqcsi = soc ## _INT_CSI, \
>> }
>> -#define imx_mx2_camera_data_entry_single_emma(soc) \
>> +#define imx_mx2_camera_data_entry_single_emma(soc, _devid) \
>> { \
>> + .devid = _devid, \
>> .iobasecsi = soc ## _CSI_BASE_ADDR, \
>> .iosizecsi = SZ_32, \
>> .irqcsi = soc ## _INT_CSI, \
>> @@ -27,12 +29,12 @@
>>
>> #ifdef CONFIG_SOC_IMX25
>> const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst =
>> - imx_mx2_camera_data_entry_single(MX25);
>> + imx_mx2_camera_data_entry_single(MX25, "imx25-camera");
>> #endif /* ifdef CONFIG_SOC_IMX25 */
>>
>> #ifdef CONFIG_SOC_IMX27
>> const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst =
>> - imx_mx2_camera_data_entry_single_emma(MX27);
>> + imx_mx2_camera_data_entry_single_emma(MX27, "imx27-camera");
>> #endif /* ifdef CONFIG_SOC_IMX27 */
>>
>> struct platform_device *__init imx_add_mx2_camera(
>> @@ -58,7 +60,7 @@ struct platform_device *__init imx_add_mx2_camera(
>> .flags = IORESOURCE_IRQ,
>> },
>> };
>> - return imx_add_platform_device_dmamask("mx2-camera", 0,
>> + return imx_add_platform_device_dmamask(data->devid, 0,
>> res, data->iobaseemmaprp ? 4 : 2,
>> pdata, sizeof(*pdata), DMA_BIT_MASK(32));
>> }
>> diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
>> index fe4c76c..cde3374 100644
>> --- a/drivers/media/video/mx2_camera.c
>> +++ b/drivers/media/video/mx2_camera.c
>> @@ -41,7 +41,6 @@
>> #include <linux/videodev2.h>
>>
>> #include <linux/platform_data/camera-mx2.h>
>> -#include <mach/hardware.h>
>>
>> #include <asm/dma.h>
>>
>> @@ -121,11 +120,13 @@
>>
>> #define CSICR1 0x00
>> #define CSICR2 0x04
>> -#define CSISR (cpu_is_mx27() ? 0x08 : 0x18)
>> +#define CSISR_IMX25 0x18
>> +#define CSISR_IMX27 0x08
>> #define CSISTATFIFO 0x0c
>> #define CSIRFIFO 0x10
>> #define CSIRXCNT 0x14
>> -#define CSICR3 (cpu_is_mx27() ? 0x1C : 0x08)
>> +#define CSICR3_IMX25 0x08
>> +#define CSICR3_IMX27 0x1c
>> #define CSIDMASA_STATFIFO 0x20
>> #define CSIDMATA_STATFIFO 0x24
>> #define CSIDMASA_FB1 0x28
>> @@ -268,6 +269,11 @@ struct mx2_buffer {
>> struct mx2_buf_internal internal;
>> };
>>
>> +enum mx2_camera_type {
>> + IMX25_CAMERA,
>> + IMX27_CAMERA,
>> +};
>> +
>> struct mx2_camera_dev {
>> struct device *dev;
>> struct soc_camera_host soc_host;
>> @@ -291,6 +297,9 @@ struct mx2_camera_dev {
>> struct mx2_buffer *fb2_active;
>>
>> u32 csicr1;
>> + u32 reg_csisr;
>> + u32 reg_csicr3;
>> + enum mx2_camera_type devtype;
>>
>> struct mx2_buf_internal buf_discard[2];
>> void *discard_buffer;
>> @@ -303,6 +312,29 @@ struct mx2_camera_dev {
>> struct vb2_alloc_ctx *alloc_ctx;
>> };
>>
>> +static struct platform_device_id mx2_camera_devtype[] = {
>> + {
>> + .name = "imx25-camera",
>> + .driver_data = IMX25_CAMERA,
>> + }, {
>> + .name = "imx27-camera",
>> + .driver_data = IMX27_CAMERA,
>> + }, {
>> + /* sentinel */
>> + }
>> +};
>> +MODULE_DEVICE_TABLE(platform, mx2_camera_devtype);
>> +
>> +static inline int is_imx25_camera(struct mx2_camera_dev *pcdev)
>> +{
>> + return pcdev->devtype == IMX25_CAMERA;
>> +}
>> +
>> +static inline int is_imx27_camera(struct mx2_camera_dev *pcdev)
>> +{
>> + return pcdev->devtype == IMX27_CAMERA;
>> +}
>> +
>> static struct mx2_buffer *mx2_ibuf_to_buf(struct mx2_buf_internal *int_buf)
>> {
>> return container_of(int_buf, struct mx2_buffer, internal);
>> @@ -406,9 +438,9 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
>>
>> clk_disable_unprepare(pcdev->clk_csi);
>> writel(0, pcdev->base_csi + CSICR1);
>> - if (cpu_is_mx27()) {
>> + if (is_imx27_camera(pcdev)) {
>> writel(0, pcdev->base_emma + PRP_CNTL);
>> - } else if (cpu_is_mx25()) {
>> + } else if (is_imx25_camera(pcdev)) {
>> spin_lock_irqsave(&pcdev->lock, flags);
>> pcdev->fb1_active = NULL;
>> pcdev->fb2_active = NULL;
>> @@ -438,7 +470,7 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
>>
>> csicr1 = CSICR1_MCLKEN;
>>
>> - if (cpu_is_mx27())
>> + if (is_imx27_camera(pcdev))
>> csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
>> CSICR1_RXFF_LEVEL(0);
>>
>> @@ -514,7 +546,7 @@ out:
>> static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
>> {
>> struct mx2_camera_dev *pcdev = data;
>> - u32 status = readl(pcdev->base_csi + CSISR);
>> + u32 status = readl(pcdev->base_csi + pcdev->reg_csisr);
>>
>> if (status & CSISR_DMA_TSF_FB1_INT)
>> mx25_camera_frame_done(pcdev, 1, MX2_STATE_DONE);
>> @@ -523,7 +555,7 @@ static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
>>
>> /* FIXME: handle CSISR_RFF_OR_INT */
>>
>> - writel(status, pcdev->base_csi + CSISR);
>> + writel(status, pcdev->base_csi + pcdev->reg_csisr);
>>
>> return IRQ_HANDLED;
>> }
>> @@ -608,7 +640,7 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
>> buf->state = MX2_STATE_QUEUED;
>> list_add_tail(&buf->internal.queue, &pcdev->capture);
>>
>> - if (cpu_is_mx25()) {
>> + if (is_imx25_camera(pcdev)) {
>> u32 csicr3, dma_inten = 0;
>>
>> if (pcdev->fb1_active == NULL) {
>> @@ -627,20 +659,20 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
>> list_del(&buf->internal.queue);
>> buf->state = MX2_STATE_ACTIVE;
>>
>> - csicr3 = readl(pcdev->base_csi + CSICR3);
>> + csicr3 = readl(pcdev->base_csi + pcdev->reg_csicr3);
>>
>> /* Reflash DMA */
>> writel(csicr3 | CSICR3_DMA_REFLASH_RFF,
>> - pcdev->base_csi + CSICR3);
>> + pcdev->base_csi + pcdev->reg_csicr3);
>>
>> /* clear & enable interrupts */
>> - writel(dma_inten, pcdev->base_csi + CSISR);
>> + writel(dma_inten, pcdev->base_csi + pcdev->reg_csisr);
>> pcdev->csicr1 |= dma_inten;
>> writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
>>
>> /* enable DMA */
>> csicr3 |= CSICR3_DMA_REQ_EN_RFF | CSICR3_RXFF_LEVEL(1);
>> - writel(csicr3, pcdev->base_csi + CSICR3);
>> + writel(csicr3, pcdev->base_csi + pcdev->reg_csicr3);
>> }
>> }
>>
>> @@ -684,7 +716,7 @@ static void mx2_videobuf_release(struct vb2_buffer *vb)
>> */
>>
>> spin_lock_irqsave(&pcdev->lock, flags);
>> - if (cpu_is_mx25() && buf->state == MX2_STATE_ACTIVE) {
>> + if (is_imx25_camera(pcdev) && buf->state == MX2_STATE_ACTIVE) {
>> if (pcdev->fb1_active == buf) {
>> pcdev->csicr1 &= ~CSICR1_FB1_DMA_INTEN;
>> writel(0, pcdev->base_csi + CSIDMASA_FB1);
>> @@ -807,7 +839,7 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count)
>> unsigned long phys;
>> int bytesperline;
>>
>> - if (cpu_is_mx27()) {
>> + if (is_imx27_camera(pcdev)) {
>> unsigned long flags;
>> if (count < 2)
>> return -EINVAL;
>> @@ -902,7 +934,7 @@ static int mx2_stop_streaming(struct vb2_queue *q)
>> void *b;
>> u32 cntl;
>>
>> - if (cpu_is_mx27()) {
>> + if (is_imx27_camera(pcdev)) {
>> spin_lock_irqsave(&pcdev->lock, flags);
>>
>> cntl = readl(pcdev->base_emma + PRP_CNTL);
>> @@ -1054,11 +1086,11 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd)
>> if (bytesperline < 0)
>> return bytesperline;
>>
>> - if (cpu_is_mx27()) {
>> + if (is_imx27_camera(pcdev)) {
>> ret = mx27_camera_emma_prp_reset(pcdev);
>> if (ret)
>> return ret;
>> - } else if (cpu_is_mx25()) {
>> + } else if (is_imx25_camera(pcdev)) {
>> writel((bytesperline * icd->user_height) >> 2,
>> pcdev->base_csi + CSIRXCNT);
>> writel((bytesperline << 16) | icd->user_height,
>> @@ -1351,7 +1383,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
>> /* FIXME: implement MX27 limits */
>>
>> /* limit to MX25 hardware capabilities */
>> - if (cpu_is_mx25()) {
>> + if (is_imx25_camera(pcdev)) {
>> if (xlate->host_fmt->bits_per_sample <= 8)
>> width_limit = 0xffff * 4;
>> else
>> @@ -1685,6 +1717,20 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> goto exit;
>> }
>>
>> + pcdev->devtype = pdev->id_entry->driver_data;
>> + switch (pcdev->devtype) {
>> + case IMX25_CAMERA:
>> + pcdev->reg_csisr = CSISR_IMX25;
>> + pcdev->reg_csicr3 = CSICR3_IMX25;
>> + break;
>> + case IMX27_CAMERA:
>> + pcdev->reg_csisr = CSISR_IMX27;
>> + pcdev->reg_csicr3 = CSICR3_IMX27;
>> + break;
>> + default:
>> + break;
>> + }
>> +
>> pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
>> if (IS_ERR(pcdev->clk_csi)) {
>> dev_err(&pdev->dev, "Could not get csi clock\n");
>> @@ -1722,7 +1768,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> pcdev->dev = &pdev->dev;
>> platform_set_drvdata(pdev, pcdev);
>>
>> - if (cpu_is_mx25()) {
>> + if (is_imx25_camera(pcdev)) {
>> err = devm_request_irq(&pdev->dev, irq_csi, mx25_camera_irq, 0,
>> MX2_CAM_DRV_NAME, pcdev);
>> if (err) {
>> @@ -1731,7 +1777,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> }
>> }
>>
>> - if (cpu_is_mx27()) {
>> + if (is_imx27_camera(pcdev)) {
>> err = mx27_camera_emma_init(pdev);
>> if (err)
>> goto exit;
>> @@ -1742,7 +1788,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> pcdev->soc_host.priv = pcdev;
>> pcdev->soc_host.v4l2_dev.dev = &pdev->dev;
>> pcdev->soc_host.nr = pdev->id;
>> - if (cpu_is_mx25())
>> + if (is_imx25_camera(pcdev))
>> pcdev->soc_host.capabilities = SOCAM_HOST_CAP_STRIDE;
>>
>> pcdev->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev);
>> @@ -1762,7 +1808,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> exit_free_emma:
>> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
>> eallocctx:
>> - if (cpu_is_mx27()) {
>> + if (is_imx27_camera(pcdev)) {
>> clk_disable_unprepare(pcdev->clk_emma_ipg);
>> clk_disable_unprepare(pcdev->clk_emma_ahb);
>> }
>> @@ -1780,7 +1826,7 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
>>
>> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
>>
>> - if (cpu_is_mx27()) {
>> + if (is_imx27_camera(pcdev)) {
>> clk_disable_unprepare(pcdev->clk_emma_ipg);
>> clk_disable_unprepare(pcdev->clk_emma_ahb);
>> }
>> @@ -1794,6 +1840,7 @@ static struct platform_driver mx2_camera_driver = {
>> .driver = {
>> .name = MX2_CAM_DRV_NAME,
>> },
>> + .id_table = mx2_camera_devtype,
>> .remove = __devexit_p(mx2_camera_remove),
>> };
>>
>> --
>> 1.7.9.5
I can't test this patch because it depends heavily on the previous
one, which breaks the driver.
Regards.
--
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion
2012-09-17 13:43 ` javier Martin
@ 2012-09-17 13:59 ` Guennadi Liakhovetski
2012-09-18 8:35 ` javier Martin
0 siblings, 1 reply; 80+ messages in thread
From: Guennadi Liakhovetski @ 2012-09-17 13:59 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 17 Sep 2012, javier Martin wrote:
> Hi Shawn,
>
> On 17 September 2012 11:21, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> > On Mon, 17 Sep 2012, Shawn Guo wrote:
> >
> >> It changes the driver to use platform_device_id rather than cpu_is_xxx
> >> to determine the controller type, and updates the platform code
> >> accordingly.
> >>
> >> As the result, mach/hardware.h inclusion gets removed from the driver.
> >>
> >> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> >> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> >> Cc: linux-media at vger.kernel.org
> >
> > Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>
> i.MX25 support is broken and is scheduled for removal.
It is not yet, I haven't pushed those your patches yet.
Thanks
Guennadi
> I think we should not keep on trying to maintain it. Couldn't we just
> drop it? It only makes maintenance tasks more difficult.
>
> > Thanks
> > Guennadi
> >
> >> ---
> >> arch/arm/mach-imx/clk-imx25.c | 6 +-
> >> arch/arm/mach-imx/clk-imx27.c | 6 +-
> >> arch/arm/mach-imx/devices/devices-common.h | 1 +
> >> arch/arm/mach-imx/devices/platform-mx2-camera.c | 12 +--
> >> drivers/media/video/mx2_camera.c | 95 +++++++++++++++++------
> >> 5 files changed, 85 insertions(+), 35 deletions(-)
> >>
> >> diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
> >> index 1aea073..71fe521 100644
> >> --- a/arch/arm/mach-imx/clk-imx25.c
> >> +++ b/arch/arm/mach-imx/clk-imx25.c
> >> @@ -231,9 +231,9 @@ int __init mx25_clocks_init(void)
> >> clk_register_clkdev(clk[esdhc2_ipg_per], "per", "sdhci-esdhc-imx25.1");
> >> clk_register_clkdev(clk[esdhc2_ipg], "ipg", "sdhci-esdhc-imx25.1");
> >> clk_register_clkdev(clk[esdhc2_ahb], "ahb", "sdhci-esdhc-imx25.1");
> >> - clk_register_clkdev(clk[csi_ipg_per], "per", "mx2-camera.0");
> >> - clk_register_clkdev(clk[csi_ipg], "ipg", "mx2-camera.0");
> >> - clk_register_clkdev(clk[csi_ahb], "ahb", "mx2-camera.0");
> >> + clk_register_clkdev(clk[csi_ipg_per], "per", "imx25-camera.0");
> >> + clk_register_clkdev(clk[csi_ipg], "ipg", "imx25-camera.0");
> >> + clk_register_clkdev(clk[csi_ahb], "ahb", "imx25-camera.0");
> >> clk_register_clkdev(clk[dummy], "audmux", NULL);
> >> clk_register_clkdev(clk[can1_ipg], NULL, "flexcan.0");
> >> clk_register_clkdev(clk[can2_ipg], NULL, "flexcan.1");
> >> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
> >> index 5ff5cf0..e26de52 100644
> >> --- a/arch/arm/mach-imx/clk-imx27.c
> >> +++ b/arch/arm/mach-imx/clk-imx27.c
> >> @@ -224,7 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
> >> clk_register_clkdev(clk[per3_gate], "per", "imx-fb.0");
> >> clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
> >> clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
> >> - clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
> >> + clk_register_clkdev(clk[csi_ahb_gate], "ahb", "imx27-camera.0");
> >> clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
> >> clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
> >> clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
> >> @@ -251,8 +251,8 @@ int __init mx27_clocks_init(unsigned long fref)
> >> clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx21-i2c.1");
> >> clk_register_clkdev(clk[owire_ipg_gate], NULL, "mxc_w1.0");
> >> clk_register_clkdev(clk[kpp_ipg_gate], NULL, "imx-keypad");
> >> - clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "mx2-camera.0");
> >> - clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "mx2-camera.0");
> >> + clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "imx27-camera.0");
> >> + clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "imx27-camera.0");
> >> clk_register_clkdev(clk[emma_ahb_gate], "ahb", "m2m-emmaprp.0");
> >> clk_register_clkdev(clk[emma_ipg_gate], "ipg", "m2m-emmaprp.0");
> >> clk_register_clkdev(clk[iim_ipg_gate], "iim", NULL);
> >> diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
> >> index 7f2698c..8112a1a 100644
> >> --- a/arch/arm/mach-imx/devices/devices-common.h
> >> +++ b/arch/arm/mach-imx/devices/devices-common.h
> >> @@ -202,6 +202,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
> >>
> >> #include <linux/platform_data/camera-mx2.h>
> >> struct imx_mx2_camera_data {
> >> + const char *devid;
> >> resource_size_t iobasecsi;
> >> resource_size_t iosizecsi;
> >> resource_size_t irqcsi;
> >> diff --git a/arch/arm/mach-imx/devices/platform-mx2-camera.c b/arch/arm/mach-imx/devices/platform-mx2-camera.c
> >> index 9ad5b2d..b88877d 100644
> >> --- a/arch/arm/mach-imx/devices/platform-mx2-camera.c
> >> +++ b/arch/arm/mach-imx/devices/platform-mx2-camera.c
> >> @@ -9,14 +9,16 @@
> >> #include <mach/hardware.h>
> >> #include "devices-common.h"
> >>
> >> -#define imx_mx2_camera_data_entry_single(soc) \
> >> +#define imx_mx2_camera_data_entry_single(soc, _devid) \
> >> { \
> >> + .devid = _devid, \
> >> .iobasecsi = soc ## _CSI_BASE_ADDR, \
> >> .iosizecsi = SZ_4K, \
> >> .irqcsi = soc ## _INT_CSI, \
> >> }
> >> -#define imx_mx2_camera_data_entry_single_emma(soc) \
> >> +#define imx_mx2_camera_data_entry_single_emma(soc, _devid) \
> >> { \
> >> + .devid = _devid, \
> >> .iobasecsi = soc ## _CSI_BASE_ADDR, \
> >> .iosizecsi = SZ_32, \
> >> .irqcsi = soc ## _INT_CSI, \
> >> @@ -27,12 +29,12 @@
> >>
> >> #ifdef CONFIG_SOC_IMX25
> >> const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst =
> >> - imx_mx2_camera_data_entry_single(MX25);
> >> + imx_mx2_camera_data_entry_single(MX25, "imx25-camera");
> >> #endif /* ifdef CONFIG_SOC_IMX25 */
> >>
> >> #ifdef CONFIG_SOC_IMX27
> >> const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst =
> >> - imx_mx2_camera_data_entry_single_emma(MX27);
> >> + imx_mx2_camera_data_entry_single_emma(MX27, "imx27-camera");
> >> #endif /* ifdef CONFIG_SOC_IMX27 */
> >>
> >> struct platform_device *__init imx_add_mx2_camera(
> >> @@ -58,7 +60,7 @@ struct platform_device *__init imx_add_mx2_camera(
> >> .flags = IORESOURCE_IRQ,
> >> },
> >> };
> >> - return imx_add_platform_device_dmamask("mx2-camera", 0,
> >> + return imx_add_platform_device_dmamask(data->devid, 0,
> >> res, data->iobaseemmaprp ? 4 : 2,
> >> pdata, sizeof(*pdata), DMA_BIT_MASK(32));
> >> }
> >> diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
> >> index fe4c76c..cde3374 100644
> >> --- a/drivers/media/video/mx2_camera.c
> >> +++ b/drivers/media/video/mx2_camera.c
> >> @@ -41,7 +41,6 @@
> >> #include <linux/videodev2.h>
> >>
> >> #include <linux/platform_data/camera-mx2.h>
> >> -#include <mach/hardware.h>
> >>
> >> #include <asm/dma.h>
> >>
> >> @@ -121,11 +120,13 @@
> >>
> >> #define CSICR1 0x00
> >> #define CSICR2 0x04
> >> -#define CSISR (cpu_is_mx27() ? 0x08 : 0x18)
> >> +#define CSISR_IMX25 0x18
> >> +#define CSISR_IMX27 0x08
> >> #define CSISTATFIFO 0x0c
> >> #define CSIRFIFO 0x10
> >> #define CSIRXCNT 0x14
> >> -#define CSICR3 (cpu_is_mx27() ? 0x1C : 0x08)
> >> +#define CSICR3_IMX25 0x08
> >> +#define CSICR3_IMX27 0x1c
> >> #define CSIDMASA_STATFIFO 0x20
> >> #define CSIDMATA_STATFIFO 0x24
> >> #define CSIDMASA_FB1 0x28
> >> @@ -268,6 +269,11 @@ struct mx2_buffer {
> >> struct mx2_buf_internal internal;
> >> };
> >>
> >> +enum mx2_camera_type {
> >> + IMX25_CAMERA,
> >> + IMX27_CAMERA,
> >> +};
> >> +
> >> struct mx2_camera_dev {
> >> struct device *dev;
> >> struct soc_camera_host soc_host;
> >> @@ -291,6 +297,9 @@ struct mx2_camera_dev {
> >> struct mx2_buffer *fb2_active;
> >>
> >> u32 csicr1;
> >> + u32 reg_csisr;
> >> + u32 reg_csicr3;
> >> + enum mx2_camera_type devtype;
> >>
> >> struct mx2_buf_internal buf_discard[2];
> >> void *discard_buffer;
> >> @@ -303,6 +312,29 @@ struct mx2_camera_dev {
> >> struct vb2_alloc_ctx *alloc_ctx;
> >> };
> >>
> >> +static struct platform_device_id mx2_camera_devtype[] = {
> >> + {
> >> + .name = "imx25-camera",
> >> + .driver_data = IMX25_CAMERA,
> >> + }, {
> >> + .name = "imx27-camera",
> >> + .driver_data = IMX27_CAMERA,
> >> + }, {
> >> + /* sentinel */
> >> + }
> >> +};
> >> +MODULE_DEVICE_TABLE(platform, mx2_camera_devtype);
> >> +
> >> +static inline int is_imx25_camera(struct mx2_camera_dev *pcdev)
> >> +{
> >> + return pcdev->devtype == IMX25_CAMERA;
> >> +}
> >> +
> >> +static inline int is_imx27_camera(struct mx2_camera_dev *pcdev)
> >> +{
> >> + return pcdev->devtype == IMX27_CAMERA;
> >> +}
> >> +
> >> static struct mx2_buffer *mx2_ibuf_to_buf(struct mx2_buf_internal *int_buf)
> >> {
> >> return container_of(int_buf, struct mx2_buffer, internal);
> >> @@ -406,9 +438,9 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
> >>
> >> clk_disable_unprepare(pcdev->clk_csi);
> >> writel(0, pcdev->base_csi + CSICR1);
> >> - if (cpu_is_mx27()) {
> >> + if (is_imx27_camera(pcdev)) {
> >> writel(0, pcdev->base_emma + PRP_CNTL);
> >> - } else if (cpu_is_mx25()) {
> >> + } else if (is_imx25_camera(pcdev)) {
> >> spin_lock_irqsave(&pcdev->lock, flags);
> >> pcdev->fb1_active = NULL;
> >> pcdev->fb2_active = NULL;
> >> @@ -438,7 +470,7 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
> >>
> >> csicr1 = CSICR1_MCLKEN;
> >>
> >> - if (cpu_is_mx27())
> >> + if (is_imx27_camera(pcdev))
> >> csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
> >> CSICR1_RXFF_LEVEL(0);
> >>
> >> @@ -514,7 +546,7 @@ out:
> >> static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
> >> {
> >> struct mx2_camera_dev *pcdev = data;
> >> - u32 status = readl(pcdev->base_csi + CSISR);
> >> + u32 status = readl(pcdev->base_csi + pcdev->reg_csisr);
> >>
> >> if (status & CSISR_DMA_TSF_FB1_INT)
> >> mx25_camera_frame_done(pcdev, 1, MX2_STATE_DONE);
> >> @@ -523,7 +555,7 @@ static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
> >>
> >> /* FIXME: handle CSISR_RFF_OR_INT */
> >>
> >> - writel(status, pcdev->base_csi + CSISR);
> >> + writel(status, pcdev->base_csi + pcdev->reg_csisr);
> >>
> >> return IRQ_HANDLED;
> >> }
> >> @@ -608,7 +640,7 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
> >> buf->state = MX2_STATE_QUEUED;
> >> list_add_tail(&buf->internal.queue, &pcdev->capture);
> >>
> >> - if (cpu_is_mx25()) {
> >> + if (is_imx25_camera(pcdev)) {
> >> u32 csicr3, dma_inten = 0;
> >>
> >> if (pcdev->fb1_active == NULL) {
> >> @@ -627,20 +659,20 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
> >> list_del(&buf->internal.queue);
> >> buf->state = MX2_STATE_ACTIVE;
> >>
> >> - csicr3 = readl(pcdev->base_csi + CSICR3);
> >> + csicr3 = readl(pcdev->base_csi + pcdev->reg_csicr3);
> >>
> >> /* Reflash DMA */
> >> writel(csicr3 | CSICR3_DMA_REFLASH_RFF,
> >> - pcdev->base_csi + CSICR3);
> >> + pcdev->base_csi + pcdev->reg_csicr3);
> >>
> >> /* clear & enable interrupts */
> >> - writel(dma_inten, pcdev->base_csi + CSISR);
> >> + writel(dma_inten, pcdev->base_csi + pcdev->reg_csisr);
> >> pcdev->csicr1 |= dma_inten;
> >> writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
> >>
> >> /* enable DMA */
> >> csicr3 |= CSICR3_DMA_REQ_EN_RFF | CSICR3_RXFF_LEVEL(1);
> >> - writel(csicr3, pcdev->base_csi + CSICR3);
> >> + writel(csicr3, pcdev->base_csi + pcdev->reg_csicr3);
> >> }
> >> }
> >>
> >> @@ -684,7 +716,7 @@ static void mx2_videobuf_release(struct vb2_buffer *vb)
> >> */
> >>
> >> spin_lock_irqsave(&pcdev->lock, flags);
> >> - if (cpu_is_mx25() && buf->state == MX2_STATE_ACTIVE) {
> >> + if (is_imx25_camera(pcdev) && buf->state == MX2_STATE_ACTIVE) {
> >> if (pcdev->fb1_active == buf) {
> >> pcdev->csicr1 &= ~CSICR1_FB1_DMA_INTEN;
> >> writel(0, pcdev->base_csi + CSIDMASA_FB1);
> >> @@ -807,7 +839,7 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count)
> >> unsigned long phys;
> >> int bytesperline;
> >>
> >> - if (cpu_is_mx27()) {
> >> + if (is_imx27_camera(pcdev)) {
> >> unsigned long flags;
> >> if (count < 2)
> >> return -EINVAL;
> >> @@ -902,7 +934,7 @@ static int mx2_stop_streaming(struct vb2_queue *q)
> >> void *b;
> >> u32 cntl;
> >>
> >> - if (cpu_is_mx27()) {
> >> + if (is_imx27_camera(pcdev)) {
> >> spin_lock_irqsave(&pcdev->lock, flags);
> >>
> >> cntl = readl(pcdev->base_emma + PRP_CNTL);
> >> @@ -1054,11 +1086,11 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd)
> >> if (bytesperline < 0)
> >> return bytesperline;
> >>
> >> - if (cpu_is_mx27()) {
> >> + if (is_imx27_camera(pcdev)) {
> >> ret = mx27_camera_emma_prp_reset(pcdev);
> >> if (ret)
> >> return ret;
> >> - } else if (cpu_is_mx25()) {
> >> + } else if (is_imx25_camera(pcdev)) {
> >> writel((bytesperline * icd->user_height) >> 2,
> >> pcdev->base_csi + CSIRXCNT);
> >> writel((bytesperline << 16) | icd->user_height,
> >> @@ -1351,7 +1383,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
> >> /* FIXME: implement MX27 limits */
> >>
> >> /* limit to MX25 hardware capabilities */
> >> - if (cpu_is_mx25()) {
> >> + if (is_imx25_camera(pcdev)) {
> >> if (xlate->host_fmt->bits_per_sample <= 8)
> >> width_limit = 0xffff * 4;
> >> else
> >> @@ -1685,6 +1717,20 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> >> goto exit;
> >> }
> >>
> >> + pcdev->devtype = pdev->id_entry->driver_data;
> >> + switch (pcdev->devtype) {
> >> + case IMX25_CAMERA:
> >> + pcdev->reg_csisr = CSISR_IMX25;
> >> + pcdev->reg_csicr3 = CSICR3_IMX25;
> >> + break;
> >> + case IMX27_CAMERA:
> >> + pcdev->reg_csisr = CSISR_IMX27;
> >> + pcdev->reg_csicr3 = CSICR3_IMX27;
> >> + break;
> >> + default:
> >> + break;
> >> + }
> >> +
> >> pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
> >> if (IS_ERR(pcdev->clk_csi)) {
> >> dev_err(&pdev->dev, "Could not get csi clock\n");
> >> @@ -1722,7 +1768,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> >> pcdev->dev = &pdev->dev;
> >> platform_set_drvdata(pdev, pcdev);
> >>
> >> - if (cpu_is_mx25()) {
> >> + if (is_imx25_camera(pcdev)) {
> >> err = devm_request_irq(&pdev->dev, irq_csi, mx25_camera_irq, 0,
> >> MX2_CAM_DRV_NAME, pcdev);
> >> if (err) {
> >> @@ -1731,7 +1777,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> >> }
> >> }
> >>
> >> - if (cpu_is_mx27()) {
> >> + if (is_imx27_camera(pcdev)) {
> >> err = mx27_camera_emma_init(pdev);
> >> if (err)
> >> goto exit;
> >> @@ -1742,7 +1788,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> >> pcdev->soc_host.priv = pcdev;
> >> pcdev->soc_host.v4l2_dev.dev = &pdev->dev;
> >> pcdev->soc_host.nr = pdev->id;
> >> - if (cpu_is_mx25())
> >> + if (is_imx25_camera(pcdev))
> >> pcdev->soc_host.capabilities = SOCAM_HOST_CAP_STRIDE;
> >>
> >> pcdev->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev);
> >> @@ -1762,7 +1808,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> >> exit_free_emma:
> >> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
> >> eallocctx:
> >> - if (cpu_is_mx27()) {
> >> + if (is_imx27_camera(pcdev)) {
> >> clk_disable_unprepare(pcdev->clk_emma_ipg);
> >> clk_disable_unprepare(pcdev->clk_emma_ahb);
> >> }
> >> @@ -1780,7 +1826,7 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
> >>
> >> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
> >>
> >> - if (cpu_is_mx27()) {
> >> + if (is_imx27_camera(pcdev)) {
> >> clk_disable_unprepare(pcdev->clk_emma_ipg);
> >> clk_disable_unprepare(pcdev->clk_emma_ahb);
> >> }
> >> @@ -1794,6 +1840,7 @@ static struct platform_driver mx2_camera_driver = {
> >> .driver = {
> >> .name = MX2_CAM_DRV_NAME,
> >> },
> >> + .id_table = mx2_camera_devtype,
> >> .remove = __devexit_p(mx2_camera_remove),
> >> };
> >>
> >> --
> >> 1.7.9.5
>
> I can't test this patch because it depends heavily on the previous
> one, which breaks the driver.
>
> Regards.
>
> --
> Javier Martin
> Vista Silicon S.L.
> CDTUC - FASE C - Oficina S-345
> Avda de los Castros s/n
> 39005- Santander. Cantabria. Spain
> +34 942 25 32 60
> www.vista-silicon.com
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 16/34] ASoC: imx-ssi: remove unneeded mach/hardware.h inclusion
2012-09-17 11:45 ` Mark Brown
@ 2012-09-17 14:30 ` Arnd Bergmann
2012-09-19 3:23 ` Mark Brown
0 siblings, 1 reply; 80+ messages in thread
From: Arnd Bergmann @ 2012-09-17 14:30 UTC (permalink / raw)
To: linux-arm-kernel
On Monday 17 September 2012, Mark Brown wrote:
> On Mon, Sep 17, 2012 at 01:34:45PM +0800, Shawn Guo wrote:
>
> > #include <linux/platform_data/asoc-imx-ssi.h>
> > -#include <mach/hardware.h>
>
> This doesn't apply - there's no platform data header for imx-ssi at the
> minute (and I don't see a patch in this series related to that in the
> series). I checked -next and there doesn't seem to be anything via a
> non-ASoC tree either.
>
It's in my testing/platform-data series, and will be in linux-next in
a few days.
Arnd
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 12/34] media: mx1_camera: remove the driver
2012-09-17 8:33 ` Guennadi Liakhovetski
@ 2012-09-18 1:28 ` Shawn Guo
2012-09-18 9:13 ` Arnd Bergmann
0 siblings, 1 reply; 80+ messages in thread
From: Shawn Guo @ 2012-09-18 1:28 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Sep 17, 2012 at 10:33:25AM +0200, Guennadi Liakhovetski wrote:
> Ok, it used to compile not-so-long-ago, but it doesn't seem to be cared
> for a lot lately. Let's give Paulius a bit more time to react to this
> mail, otherwise I'll have no objections. Just as an idea, to make it a bit
> milder we could first mark it BROKEN and add to remove schedule... But I
> don't mind either way.
>
I chose to remove the driver completely rather than marking it BROKEN
because the removal of the driver cleans up platform code a lot :)
Ok, if we hear anything back from Paulius in the next couple of weeks,
I keep the driver there with BROKEN marked.
Regards,
Shawn
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 25/34] dma: imx-dma: remove mach/hardware.h inclusion
2012-09-17 7:58 ` Sascha Hauer
@ 2012-09-18 1:40 ` Shawn Guo
2012-09-21 2:49 ` Shawn Guo
1 sibling, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-18 1:40 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Sep 17, 2012 at 09:58:14AM +0200, Sascha Hauer wrote:
> I know the important thing for you is to get rid of the mach/hardware.h
> inclusion, but I think the subject for this patch should rather be that
> you switch to platform_device_id for this driver.
>
Ok, I will update the subject for the patch and the similar ones.
> This patch misses to adjust the clock lookups according to the new
> platform_device_ids. Please fixup the patch with the following.
>
Ok, will do. Thanks, Sascha.
Regards,
Shawn
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 26/34] media: mx2_camera: remove dead code in mx2_camera_add_device
2012-09-17 8:18 ` Guennadi Liakhovetski
2012-09-17 13:36 ` javier Martin
@ 2012-09-18 1:49 ` Shawn Guo
1 sibling, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-18 1:49 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Sep 17, 2012 at 10:18:42AM +0200, Guennadi Liakhovetski wrote:
> Hi Shawn
>
> Thanks for the clean up. Would you like these patches to go via a single
> tree, presumably, arm-soc? In this case
>
Yes, to save the cross-tree dependency, I would like to have the series
go via arm-soc tree as a whole.
> On Mon, 17 Sep 2012, Shawn Guo wrote:
>
> > This is a piece of code becoming dead since commit 2c9ba37 ([media]
> > V4L: mx2_camera: remove unsupported i.MX27 DMA mode, make EMMA
> > mandatory). It should have been removed together with the commit.
> > Remove it now.
> >
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> > Cc: linux-media at vger.kernel.org
>
> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>
Thanks, Guennadi.
--
Regards,
Shawn
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 27/34] media: mx2_camera: use managed functions to clean up code
2012-09-17 13:36 ` javier Martin
@ 2012-09-18 7:43 ` Shawn Guo
2012-09-18 8:34 ` javier Martin
0 siblings, 1 reply; 80+ messages in thread
From: Shawn Guo @ 2012-09-18 7:43 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Sep 17, 2012 at 03:36:07PM +0200, javier Martin wrote:
> This patch breaks the driver:
>
Javier,
Can you please apply the following change to see if it fixes the
problem?
Shawn
@@ -1783,6 +1783,8 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
goto exit;
}
+ platform_set_drvdata(pdev, NULL);
+
pcdev->soc_host.drv_name = MX2_CAM_DRV_NAME,
pcdev->soc_host.ops = &mx2_soc_camera_host_ops,
pcdev->soc_host.priv = pcdev;
> soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
> Unable to handle kernel paging request at virtual address 656d6162
> pgd = c0004000
> [656d6162] *pgd=00000000
> Internal error: Oops: 80000005 [#1] PREEMPT ARM
> Modules linked in:
> CPU: 0 Not tainted (3.6.0-rc5-01222-g3413fb1 #12)
> PC is at 0x656d6162
> LR is at soc_camera_host_register+0x230/0x81c
> pc : [<656d6162>] lr : [<c01ff6a0>] psr: 40000033
> sp : c3025e48 ip : 00000000 fp : 00000000
> r10: c03f236c r9 : 00000000 r8 : 00000001
> r7 : 00000000 r6 : c317d414 r5 : c30431a0 r4 : c317d600
> r3 : 656d6163 r2 : c3025e18 r1 : 000c0000 r0 : c317d600
> Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA Thumb Segment kernel
> Control: 0005317f Table: a0004000 DAC: 00000017
> Process swapper (pid: 1, stack limit = 0xc3024270)
> Stack: (0xc3025e48 to 0xc3026000)
> 5e40: c3006460 00000000 c3192960 00000043 c317d638 c005d624
> 5e60: 00000043 c317d410 c317d478 c317d414 c02012f0 c317d410 00000000 00000043
> 5e80: c31a9800 c31a9820 00000000 c022ca74 c300ab20 00000000 c306e4a8 c306e4a0
> 5ea0: c30000c0 40000013 000080d0 c317d410 c317d410 c306e4a8 c306e4a0 00000001
> 5ec0: 00000000 c03f236c 00000000 c02c8d50 00000000 c03535ee c317d410 c02c8a44
> 5ee0: c306e4a8 c306e4a8 c03fc478 c03fc478 00000050 c03e0774 c03dc684 c0189d30
> 5f00: c306e4a8 c0188c3c c306e4a8 c306e4dc c03fc478 00000000 00000050 c0188db8
> 5f20: c03fc478 c3025f30 c0188d58 c0187610 c300760c c3079ad0 c03fc478 c03fc478
> 5f40: c318e680 c03f6458 00000000 c0187d24 c03535ee c03535ee c3025f58 c03fc478
> 5f60: 00000001 c04049c0 00000000 c01892c8 c03fc464 00000001 c04049c0 00000000
> 5f80: 00000050 c018a05c c03dc67c c03d4e84 c04049c0 c00087c8 00000006 00000006
> 5fa0: c03eeca0 c03dc67c 00000007 c03dc67c 00000007 c04049c0 c03c41a4 00000050
> 5fc0: c03e0774 c03c42f4 00000006 00000006 c03c41a4 00000000 00000000 c03c4214
> 5fe0: c0014900 00000013 00000000 00000000 00000000 c0014900 ffffffff ffffffff
> [<c01ff6a0>] (soc_camera_host_register+0x230/0x81c) from [<c02c8d50>]
> (mx2_camera_probe+0x30c/0x3ac)
> [<c02c8d50>] (mx2_camera_probe+0x30c/0x3ac) from [<c0189d30>]
> (platform_drv_probe+0x14/0x18)
> [<c0189d30>] (platform_drv_probe+0x14/0x18) from [<c0188c3c>]
> (driver_probe_device+0xb0/0x1cc)
> [<c0188c3c>] (driver_probe_device+0xb0/0x1cc) from [<c0188db8>]
> (__driver_attach+0x60/0x84)
> [<c0188db8>] (__driver_attach+0x60/0x84) from [<c0187610>]
> (bus_for_each_dev+0x48/0x84)
> [<c0187610>] (bus_for_each_dev+0x48/0x84) from [<c0187d24>]
> (bus_add_driver+0x9c/0x20c)
> [<c0187d24>] (bus_add_driver+0x9c/0x20c) from [<c01892c8>]
> (driver_register+0xa0/0x138)
> [<c01892c8>] (driver_register+0xa0/0x138) from [<c018a05c>]
> (platform_driver_probe+0x18/0x98)
> [<c018a05c>] (platform_driver_probe+0x18/0x98) from [<c00087c8>]
> (do_one_initcall+0x94/0x16c)
> [<c00087c8>] (do_one_initcall+0x94/0x16c) from [<c03c42f4>]
> (kernel_init+0xe0/0x1ac)
> [<c03c42f4>] (kernel_init+0xe0/0x1ac) from [<c0014900>]
> (kernel_thread_exit+0x0/0x8)
> Code: bad PC value
> ---[ end trace 7f259a1ce2e10b1a ]---
> Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
>
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 00/34] i.MX multi-platform support
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (34 preceding siblings ...)
2012-09-17 7:51 ` [PATCH 00/34] i.MX multi-platform support Sascha Hauer
@ 2012-09-18 7:52 ` Sascha Hauer
2012-09-18 8:05 ` [alsa-devel] " Shawn Guo
35 siblings, 1 reply; 80+ messages in thread
From: Sascha Hauer @ 2012-09-18 7:52 UTC (permalink / raw)
To: linux-arm-kernel
Hi Shawn,
On Mon, Sep 17, 2012 at 01:34:29PM +0800, Shawn Guo wrote:
> The series enables multi-platform support for imx. Since the required
> frameworks (clk, pwm) and spare_irq have already been adopted on imx,
> the series is all about cleaning up mach/* headers. Along with the
> changes, arch/arm/plat-mxc gets merged into arch/arm/mach-imx.
>
> It's based on a bunch of branches (works from others), Rob's initial
> multi-platform series, Arnd's platform-data and smp_ops (Marc's) and
> imx 3.7 material (Sascha and myself).
>
> It's available on branch below.
>
> git://git.linaro.org/people/shawnguo/linux-2.6.git imx/multi-platform
>
> It's been tested on imx5 and imx6, and only compile-tested on imx2 and
> imx3, so testing on imx2/3 are appreciated.
>
> Subsystem maintainers,
>
> I plan to send the whole series via arm-soc tree at the end of 3.7
> merge window when all dependant bits hit mainline. Please have a
> look at the patches you get copied and provide ACKs if the changes
> are good. Thanks.
I just had a look at the remaining initcalls in arch-imx. Most of them
are protected with a cpu_is_*, but this one should be fixed before i.MX
is enabled for multi platform:
arch/arm/mach-imx/devices/devices.c:48:core_initcall(mxc_device_init);
I think this won't harm others directly, but it will register i.MX
related devices on foreign platforms.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 80+ messages in thread
* [alsa-devel] [PATCH 00/34] i.MX multi-platform support
2012-09-18 7:52 ` Sascha Hauer
@ 2012-09-18 8:05 ` Shawn Guo
0 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-18 8:05 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Sep 18, 2012 at 09:52:13AM +0200, Sascha Hauer wrote:
> I just had a look at the remaining initcalls in arch-imx. Most of them
> are protected with a cpu_is_*, but this one should be fixed before i.MX
> is enabled for multi platform:
>
> arch/arm/mach-imx/devices/devices.c:48:core_initcall(mxc_device_init);
>
Ah, I missed that. Thanks for reminding, Sascha.
Shawn
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 06/34] ARM: imx: merge plat-mxc into mach-imx
2012-09-17 5:34 ` [PATCH 06/34] ARM: imx: merge plat-mxc " Shawn Guo
@ 2012-09-18 8:08 ` Shawn Guo
0 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-18 8:08 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Sep 17, 2012 at 01:34:35PM +0800, Shawn Guo wrote:
> It's really unnecessary to have plat-mxc, and let's merge it into
> mach-imx. It's pretty much just a bunch of file renaming and
> Kconfig/Makefile merge.
>
> To make the change less invasive, we keep using Kconfig symbol
> CONFIG_ARCH_MXC for mach-imx sub-architecture.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Will amend the following change into the patch.
Shawn
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -775,7 +775,6 @@ L: linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
S: Maintained
T: git git://git.pengutronix.de/git/imx/linux-2.6.git
F: arch/arm/mach-imx/
-F: arch/arm/plat-mxc/
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 33/34] ARM: imx: remove header file mach/irqs.h
2012-09-17 11:32 ` Arnd Bergmann
@ 2012-09-18 8:13 ` Shawn Guo
0 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-18 8:13 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Sep 17, 2012 at 11:32:52AM +0000, Arnd Bergmann wrote:
> We already have some fiq specific stuff in the
> include/linux/platform_data/asoc-imx-ssi.h header file,
> so I think it's best to put this declaration there, too.
>
That's indeed a better place. Thanks for the idea, Arnd.
Shawn
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 00/34] i.MX multi-platform support
2012-09-17 7:51 ` [PATCH 00/34] i.MX multi-platform support Sascha Hauer
2012-09-17 11:38 ` Arnd Bergmann
@ 2012-09-18 8:20 ` Shawn Guo
1 sibling, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-18 8:20 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Sep 17, 2012 at 09:51:38AM +0200, Sascha Hauer wrote:
> I gave it a test on i.MX1, i.MX27, i.MX31 and i.MX35. All run fine, but
> the last patch breaks the imx_v4_v5_defconfig: Somehow it now defaults
> to ARMv7 based machines. I haven't looked into it, just reenabled
> ARMv4/ARMv5 and the boards again -> works. The config should be updated
> with the last patch.
>
Yes, I will rework the patch with all these and Arnd's comment on the
last patch taken into account.
> I'm fine with the changes to mx2-camera, but Javier should give his ok
> to it, he has worked on it quite a lot recently.
>
> One other issue related to imx-dma, see comment to that patch.
>
> Otherwise:
>
> Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
> Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
>
Thanks a lot.
Shawn
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 27/34] media: mx2_camera: use managed functions to clean up code
2012-09-18 7:43 ` Shawn Guo
@ 2012-09-18 8:34 ` javier Martin
0 siblings, 0 replies; 80+ messages in thread
From: javier Martin @ 2012-09-18 8:34 UTC (permalink / raw)
To: linux-arm-kernel
Hi Shawn,
On 18 September 2012 09:43, Shawn Guo <shawn.guo@linaro.org> wrote:
> On Mon, Sep 17, 2012 at 03:36:07PM +0200, javier Martin wrote:
>> This patch breaks the driver:
>>
> Javier,
>
> Can you please apply the following change to see if it fixes the
> problem?
>
> Shawn
>
> @@ -1783,6 +1783,8 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> goto exit;
> }
>
> + platform_set_drvdata(pdev, NULL);
> +
> pcdev->soc_host.drv_name = MX2_CAM_DRV_NAME,
> pcdev->soc_host.ops = &mx2_soc_camera_host_ops,
> pcdev->soc_host.priv = pcdev;
Yes. That fixes the problem.
With this fix:
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Regards.
--
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion
2012-09-17 13:59 ` Guennadi Liakhovetski
@ 2012-09-18 8:35 ` javier Martin
2012-09-27 7:36 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 80+ messages in thread
From: javier Martin @ 2012-09-18 8:35 UTC (permalink / raw)
To: linux-arm-kernel
On 17 September 2012 15:59, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> On Mon, 17 Sep 2012, javier Martin wrote:
>
>> Hi Shawn,
>>
>> On 17 September 2012 11:21, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
>> > On Mon, 17 Sep 2012, Shawn Guo wrote:
>> >
>> >> It changes the driver to use platform_device_id rather than cpu_is_xxx
>> >> to determine the controller type, and updates the platform code
>> >> accordingly.
>> >>
>> >> As the result, mach/hardware.h inclusion gets removed from the driver.
>> >>
>> >> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>> >> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>> >> Cc: linux-media at vger.kernel.org
>> >
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
>> > Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>
>> i.MX25 support is broken and is scheduled for removal.
>
> It is not yet, I haven't pushed those your patches yet.
>
> Thanks
> Guennadi
>
>> I think we should not keep on trying to maintain it. Couldn't we just
>> drop it? It only makes maintenance tasks more difficult.
>>
>> > Thanks
>> > Guennadi
>> >
>> >> ---
>> >> arch/arm/mach-imx/clk-imx25.c | 6 +-
>> >> arch/arm/mach-imx/clk-imx27.c | 6 +-
>> >> arch/arm/mach-imx/devices/devices-common.h | 1 +
>> >> arch/arm/mach-imx/devices/platform-mx2-camera.c | 12 +--
>> >> drivers/media/video/mx2_camera.c | 95 +++++++++++++++++------
>> >> 5 files changed, 85 insertions(+), 35 deletions(-)
>> >>
>> >> diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
>> >> index 1aea073..71fe521 100644
>> >> --- a/arch/arm/mach-imx/clk-imx25.c
>> >> +++ b/arch/arm/mach-imx/clk-imx25.c
>> >> @@ -231,9 +231,9 @@ int __init mx25_clocks_init(void)
>> >> clk_register_clkdev(clk[esdhc2_ipg_per], "per", "sdhci-esdhc-imx25.1");
>> >> clk_register_clkdev(clk[esdhc2_ipg], "ipg", "sdhci-esdhc-imx25.1");
>> >> clk_register_clkdev(clk[esdhc2_ahb], "ahb", "sdhci-esdhc-imx25.1");
>> >> - clk_register_clkdev(clk[csi_ipg_per], "per", "mx2-camera.0");
>> >> - clk_register_clkdev(clk[csi_ipg], "ipg", "mx2-camera.0");
>> >> - clk_register_clkdev(clk[csi_ahb], "ahb", "mx2-camera.0");
>> >> + clk_register_clkdev(clk[csi_ipg_per], "per", "imx25-camera.0");
>> >> + clk_register_clkdev(clk[csi_ipg], "ipg", "imx25-camera.0");
>> >> + clk_register_clkdev(clk[csi_ahb], "ahb", "imx25-camera.0");
>> >> clk_register_clkdev(clk[dummy], "audmux", NULL);
>> >> clk_register_clkdev(clk[can1_ipg], NULL, "flexcan.0");
>> >> clk_register_clkdev(clk[can2_ipg], NULL, "flexcan.1");
>> >> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
>> >> index 5ff5cf0..e26de52 100644
>> >> --- a/arch/arm/mach-imx/clk-imx27.c
>> >> +++ b/arch/arm/mach-imx/clk-imx27.c
>> >> @@ -224,7 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
>> >> clk_register_clkdev(clk[per3_gate], "per", "imx-fb.0");
>> >> clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
>> >> clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
>> >> - clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
>> >> + clk_register_clkdev(clk[csi_ahb_gate], "ahb", "imx27-camera.0");
>> >> clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
>> >> clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
>> >> clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
>> >> @@ -251,8 +251,8 @@ int __init mx27_clocks_init(unsigned long fref)
>> >> clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx21-i2c.1");
>> >> clk_register_clkdev(clk[owire_ipg_gate], NULL, "mxc_w1.0");
>> >> clk_register_clkdev(clk[kpp_ipg_gate], NULL, "imx-keypad");
>> >> - clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "mx2-camera.0");
>> >> - clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "mx2-camera.0");
>> >> + clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "imx27-camera.0");
>> >> + clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "imx27-camera.0");
>> >> clk_register_clkdev(clk[emma_ahb_gate], "ahb", "m2m-emmaprp.0");
>> >> clk_register_clkdev(clk[emma_ipg_gate], "ipg", "m2m-emmaprp.0");
>> >> clk_register_clkdev(clk[iim_ipg_gate], "iim", NULL);
>> >> diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
>> >> index 7f2698c..8112a1a 100644
>> >> --- a/arch/arm/mach-imx/devices/devices-common.h
>> >> +++ b/arch/arm/mach-imx/devices/devices-common.h
>> >> @@ -202,6 +202,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
>> >>
>> >> #include <linux/platform_data/camera-mx2.h>
>> >> struct imx_mx2_camera_data {
>> >> + const char *devid;
>> >> resource_size_t iobasecsi;
>> >> resource_size_t iosizecsi;
>> >> resource_size_t irqcsi;
>> >> diff --git a/arch/arm/mach-imx/devices/platform-mx2-camera.c b/arch/arm/mach-imx/devices/platform-mx2-camera.c
>> >> index 9ad5b2d..b88877d 100644
>> >> --- a/arch/arm/mach-imx/devices/platform-mx2-camera.c
>> >> +++ b/arch/arm/mach-imx/devices/platform-mx2-camera.c
>> >> @@ -9,14 +9,16 @@
>> >> #include <mach/hardware.h>
>> >> #include "devices-common.h"
>> >>
>> >> -#define imx_mx2_camera_data_entry_single(soc) \
>> >> +#define imx_mx2_camera_data_entry_single(soc, _devid) \
>> >> { \
>> >> + .devid = _devid, \
>> >> .iobasecsi = soc ## _CSI_BASE_ADDR, \
>> >> .iosizecsi = SZ_4K, \
>> >> .irqcsi = soc ## _INT_CSI, \
>> >> }
>> >> -#define imx_mx2_camera_data_entry_single_emma(soc) \
>> >> +#define imx_mx2_camera_data_entry_single_emma(soc, _devid) \
>> >> { \
>> >> + .devid = _devid, \
>> >> .iobasecsi = soc ## _CSI_BASE_ADDR, \
>> >> .iosizecsi = SZ_32, \
>> >> .irqcsi = soc ## _INT_CSI, \
>> >> @@ -27,12 +29,12 @@
>> >>
>> >> #ifdef CONFIG_SOC_IMX25
>> >> const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst =
>> >> - imx_mx2_camera_data_entry_single(MX25);
>> >> + imx_mx2_camera_data_entry_single(MX25, "imx25-camera");
>> >> #endif /* ifdef CONFIG_SOC_IMX25 */
>> >>
>> >> #ifdef CONFIG_SOC_IMX27
>> >> const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst =
>> >> - imx_mx2_camera_data_entry_single_emma(MX27);
>> >> + imx_mx2_camera_data_entry_single_emma(MX27, "imx27-camera");
>> >> #endif /* ifdef CONFIG_SOC_IMX27 */
>> >>
>> >> struct platform_device *__init imx_add_mx2_camera(
>> >> @@ -58,7 +60,7 @@ struct platform_device *__init imx_add_mx2_camera(
>> >> .flags = IORESOURCE_IRQ,
>> >> },
>> >> };
>> >> - return imx_add_platform_device_dmamask("mx2-camera", 0,
>> >> + return imx_add_platform_device_dmamask(data->devid, 0,
>> >> res, data->iobaseemmaprp ? 4 : 2,
>> >> pdata, sizeof(*pdata), DMA_BIT_MASK(32));
>> >> }
>> >> diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
>> >> index fe4c76c..cde3374 100644
>> >> --- a/drivers/media/video/mx2_camera.c
>> >> +++ b/drivers/media/video/mx2_camera.c
>> >> @@ -41,7 +41,6 @@
>> >> #include <linux/videodev2.h>
>> >>
>> >> #include <linux/platform_data/camera-mx2.h>
>> >> -#include <mach/hardware.h>
>> >>
>> >> #include <asm/dma.h>
>> >>
>> >> @@ -121,11 +120,13 @@
>> >>
>> >> #define CSICR1 0x00
>> >> #define CSICR2 0x04
>> >> -#define CSISR (cpu_is_mx27() ? 0x08 : 0x18)
>> >> +#define CSISR_IMX25 0x18
>> >> +#define CSISR_IMX27 0x08
>> >> #define CSISTATFIFO 0x0c
>> >> #define CSIRFIFO 0x10
>> >> #define CSIRXCNT 0x14
>> >> -#define CSICR3 (cpu_is_mx27() ? 0x1C : 0x08)
>> >> +#define CSICR3_IMX25 0x08
>> >> +#define CSICR3_IMX27 0x1c
>> >> #define CSIDMASA_STATFIFO 0x20
>> >> #define CSIDMATA_STATFIFO 0x24
>> >> #define CSIDMASA_FB1 0x28
>> >> @@ -268,6 +269,11 @@ struct mx2_buffer {
>> >> struct mx2_buf_internal internal;
>> >> };
>> >>
>> >> +enum mx2_camera_type {
>> >> + IMX25_CAMERA,
>> >> + IMX27_CAMERA,
>> >> +};
>> >> +
>> >> struct mx2_camera_dev {
>> >> struct device *dev;
>> >> struct soc_camera_host soc_host;
>> >> @@ -291,6 +297,9 @@ struct mx2_camera_dev {
>> >> struct mx2_buffer *fb2_active;
>> >>
>> >> u32 csicr1;
>> >> + u32 reg_csisr;
>> >> + u32 reg_csicr3;
>> >> + enum mx2_camera_type devtype;
>> >>
>> >> struct mx2_buf_internal buf_discard[2];
>> >> void *discard_buffer;
>> >> @@ -303,6 +312,29 @@ struct mx2_camera_dev {
>> >> struct vb2_alloc_ctx *alloc_ctx;
>> >> };
>> >>
>> >> +static struct platform_device_id mx2_camera_devtype[] = {
>> >> + {
>> >> + .name = "imx25-camera",
>> >> + .driver_data = IMX25_CAMERA,
>> >> + }, {
>> >> + .name = "imx27-camera",
>> >> + .driver_data = IMX27_CAMERA,
>> >> + }, {
>> >> + /* sentinel */
>> >> + }
>> >> +};
>> >> +MODULE_DEVICE_TABLE(platform, mx2_camera_devtype);
>> >> +
>> >> +static inline int is_imx25_camera(struct mx2_camera_dev *pcdev)
>> >> +{
>> >> + return pcdev->devtype == IMX25_CAMERA;
>> >> +}
>> >> +
>> >> +static inline int is_imx27_camera(struct mx2_camera_dev *pcdev)
>> >> +{
>> >> + return pcdev->devtype == IMX27_CAMERA;
>> >> +}
>> >> +
>> >> static struct mx2_buffer *mx2_ibuf_to_buf(struct mx2_buf_internal *int_buf)
>> >> {
>> >> return container_of(int_buf, struct mx2_buffer, internal);
>> >> @@ -406,9 +438,9 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
>> >>
>> >> clk_disable_unprepare(pcdev->clk_csi);
>> >> writel(0, pcdev->base_csi + CSICR1);
>> >> - if (cpu_is_mx27()) {
>> >> + if (is_imx27_camera(pcdev)) {
>> >> writel(0, pcdev->base_emma + PRP_CNTL);
>> >> - } else if (cpu_is_mx25()) {
>> >> + } else if (is_imx25_camera(pcdev)) {
>> >> spin_lock_irqsave(&pcdev->lock, flags);
>> >> pcdev->fb1_active = NULL;
>> >> pcdev->fb2_active = NULL;
>> >> @@ -438,7 +470,7 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
>> >>
>> >> csicr1 = CSICR1_MCLKEN;
>> >>
>> >> - if (cpu_is_mx27())
>> >> + if (is_imx27_camera(pcdev))
>> >> csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
>> >> CSICR1_RXFF_LEVEL(0);
>> >>
>> >> @@ -514,7 +546,7 @@ out:
>> >> static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
>> >> {
>> >> struct mx2_camera_dev *pcdev = data;
>> >> - u32 status = readl(pcdev->base_csi + CSISR);
>> >> + u32 status = readl(pcdev->base_csi + pcdev->reg_csisr);
>> >>
>> >> if (status & CSISR_DMA_TSF_FB1_INT)
>> >> mx25_camera_frame_done(pcdev, 1, MX2_STATE_DONE);
>> >> @@ -523,7 +555,7 @@ static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
>> >>
>> >> /* FIXME: handle CSISR_RFF_OR_INT */
>> >>
>> >> - writel(status, pcdev->base_csi + CSISR);
>> >> + writel(status, pcdev->base_csi + pcdev->reg_csisr);
>> >>
>> >> return IRQ_HANDLED;
>> >> }
>> >> @@ -608,7 +640,7 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
>> >> buf->state = MX2_STATE_QUEUED;
>> >> list_add_tail(&buf->internal.queue, &pcdev->capture);
>> >>
>> >> - if (cpu_is_mx25()) {
>> >> + if (is_imx25_camera(pcdev)) {
>> >> u32 csicr3, dma_inten = 0;
>> >>
>> >> if (pcdev->fb1_active == NULL) {
>> >> @@ -627,20 +659,20 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
>> >> list_del(&buf->internal.queue);
>> >> buf->state = MX2_STATE_ACTIVE;
>> >>
>> >> - csicr3 = readl(pcdev->base_csi + CSICR3);
>> >> + csicr3 = readl(pcdev->base_csi + pcdev->reg_csicr3);
>> >>
>> >> /* Reflash DMA */
>> >> writel(csicr3 | CSICR3_DMA_REFLASH_RFF,
>> >> - pcdev->base_csi + CSICR3);
>> >> + pcdev->base_csi + pcdev->reg_csicr3);
>> >>
>> >> /* clear & enable interrupts */
>> >> - writel(dma_inten, pcdev->base_csi + CSISR);
>> >> + writel(dma_inten, pcdev->base_csi + pcdev->reg_csisr);
>> >> pcdev->csicr1 |= dma_inten;
>> >> writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
>> >>
>> >> /* enable DMA */
>> >> csicr3 |= CSICR3_DMA_REQ_EN_RFF | CSICR3_RXFF_LEVEL(1);
>> >> - writel(csicr3, pcdev->base_csi + CSICR3);
>> >> + writel(csicr3, pcdev->base_csi + pcdev->reg_csicr3);
>> >> }
>> >> }
>> >>
>> >> @@ -684,7 +716,7 @@ static void mx2_videobuf_release(struct vb2_buffer *vb)
>> >> */
>> >>
>> >> spin_lock_irqsave(&pcdev->lock, flags);
>> >> - if (cpu_is_mx25() && buf->state == MX2_STATE_ACTIVE) {
>> >> + if (is_imx25_camera(pcdev) && buf->state == MX2_STATE_ACTIVE) {
>> >> if (pcdev->fb1_active == buf) {
>> >> pcdev->csicr1 &= ~CSICR1_FB1_DMA_INTEN;
>> >> writel(0, pcdev->base_csi + CSIDMASA_FB1);
>> >> @@ -807,7 +839,7 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count)
>> >> unsigned long phys;
>> >> int bytesperline;
>> >>
>> >> - if (cpu_is_mx27()) {
>> >> + if (is_imx27_camera(pcdev)) {
>> >> unsigned long flags;
>> >> if (count < 2)
>> >> return -EINVAL;
>> >> @@ -902,7 +934,7 @@ static int mx2_stop_streaming(struct vb2_queue *q)
>> >> void *b;
>> >> u32 cntl;
>> >>
>> >> - if (cpu_is_mx27()) {
>> >> + if (is_imx27_camera(pcdev)) {
>> >> spin_lock_irqsave(&pcdev->lock, flags);
>> >>
>> >> cntl = readl(pcdev->base_emma + PRP_CNTL);
>> >> @@ -1054,11 +1086,11 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd)
>> >> if (bytesperline < 0)
>> >> return bytesperline;
>> >>
>> >> - if (cpu_is_mx27()) {
>> >> + if (is_imx27_camera(pcdev)) {
>> >> ret = mx27_camera_emma_prp_reset(pcdev);
>> >> if (ret)
>> >> return ret;
>> >> - } else if (cpu_is_mx25()) {
>> >> + } else if (is_imx25_camera(pcdev)) {
>> >> writel((bytesperline * icd->user_height) >> 2,
>> >> pcdev->base_csi + CSIRXCNT);
>> >> writel((bytesperline << 16) | icd->user_height,
>> >> @@ -1351,7 +1383,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
>> >> /* FIXME: implement MX27 limits */
>> >>
>> >> /* limit to MX25 hardware capabilities */
>> >> - if (cpu_is_mx25()) {
>> >> + if (is_imx25_camera(pcdev)) {
>> >> if (xlate->host_fmt->bits_per_sample <= 8)
>> >> width_limit = 0xffff * 4;
>> >> else
>> >> @@ -1685,6 +1717,20 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> >> goto exit;
>> >> }
>> >>
>> >> + pcdev->devtype = pdev->id_entry->driver_data;
>> >> + switch (pcdev->devtype) {
>> >> + case IMX25_CAMERA:
>> >> + pcdev->reg_csisr = CSISR_IMX25;
>> >> + pcdev->reg_csicr3 = CSICR3_IMX25;
>> >> + break;
>> >> + case IMX27_CAMERA:
>> >> + pcdev->reg_csisr = CSISR_IMX27;
>> >> + pcdev->reg_csicr3 = CSICR3_IMX27;
>> >> + break;
>> >> + default:
>> >> + break;
>> >> + }
>> >> +
>> >> pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
>> >> if (IS_ERR(pcdev->clk_csi)) {
>> >> dev_err(&pdev->dev, "Could not get csi clock\n");
>> >> @@ -1722,7 +1768,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> >> pcdev->dev = &pdev->dev;
>> >> platform_set_drvdata(pdev, pcdev);
>> >>
>> >> - if (cpu_is_mx25()) {
>> >> + if (is_imx25_camera(pcdev)) {
>> >> err = devm_request_irq(&pdev->dev, irq_csi, mx25_camera_irq, 0,
>> >> MX2_CAM_DRV_NAME, pcdev);
>> >> if (err) {
>> >> @@ -1731,7 +1777,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> >> }
>> >> }
>> >>
>> >> - if (cpu_is_mx27()) {
>> >> + if (is_imx27_camera(pcdev)) {
>> >> err = mx27_camera_emma_init(pdev);
>> >> if (err)
>> >> goto exit;
>> >> @@ -1742,7 +1788,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> >> pcdev->soc_host.priv = pcdev;
>> >> pcdev->soc_host.v4l2_dev.dev = &pdev->dev;
>> >> pcdev->soc_host.nr = pdev->id;
>> >> - if (cpu_is_mx25())
>> >> + if (is_imx25_camera(pcdev))
>> >> pcdev->soc_host.capabilities = SOCAM_HOST_CAP_STRIDE;
>> >>
>> >> pcdev->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev);
>> >> @@ -1762,7 +1808,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> >> exit_free_emma:
>> >> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
>> >> eallocctx:
>> >> - if (cpu_is_mx27()) {
>> >> + if (is_imx27_camera(pcdev)) {
>> >> clk_disable_unprepare(pcdev->clk_emma_ipg);
>> >> clk_disable_unprepare(pcdev->clk_emma_ahb);
>> >> }
>> >> @@ -1780,7 +1826,7 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
>> >>
>> >> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
>> >>
>> >> - if (cpu_is_mx27()) {
>> >> + if (is_imx27_camera(pcdev)) {
>> >> clk_disable_unprepare(pcdev->clk_emma_ipg);
>> >> clk_disable_unprepare(pcdev->clk_emma_ahb);
>> >> }
>> >> @@ -1794,6 +1840,7 @@ static struct platform_driver mx2_camera_driver = {
>> >> .driver = {
>> >> .name = MX2_CAM_DRV_NAME,
>> >> },
>> >> + .id_table = mx2_camera_devtype,
>> >> .remove = __devexit_p(mx2_camera_remove),
>> >> };
>> >>
>> >> --
>> >> 1.7.9.5
>>
>> I can't test this patch because it depends heavily on the previous
>> one, which breaks the driver.
>>
>> Regards.
>>
>> --
>> Javier Martin
>> Vista Silicon S.L.
>> CDTUC - FASE C - Oficina S-345
>> Avda de los Castros s/n
>> 39005- Santander. Cantabria. Spain
>> +34 942 25 32 60
>> www.vista-silicon.com
>>
>
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 12/34] media: mx1_camera: remove the driver
2012-09-18 1:28 ` Shawn Guo
@ 2012-09-18 9:13 ` Arnd Bergmann
2012-09-20 1:35 ` Shawn Guo
0 siblings, 1 reply; 80+ messages in thread
From: Arnd Bergmann @ 2012-09-18 9:13 UTC (permalink / raw)
To: linux-arm-kernel
On Tuesday 18 September 2012, Shawn Guo wrote:
>
> On Mon, Sep 17, 2012 at 10:33:25AM +0200, Guennadi Liakhovetski wrote:
> > Ok, it used to compile not-so-long-ago, but it doesn't seem to be cared
> > for a lot lately. Let's give Paulius a bit more time to react to this
> > mail, otherwise I'll have no objections. Just as an idea, to make it a bit
> > milder we could first mark it BROKEN and add to remove schedule... But I
> > don't mind either way.
> >
> I chose to remove the driver completely rather than marking it BROKEN
> because the removal of the driver cleans up platform code a lot :)
>
> Ok, if we hear anything back from Paulius in the next couple of weeks,
> I keep the driver there with BROKEN marked.
Sounds fine to me. Of course, if someone wants the driver back and is
willing to fix it, we'll just revert this patch even after the driver
is gone.
I would like an Ack from Mauro however. You did not Cc him directly
in the patch, and he probably has an opionion on it as well, or may
want to take this patch through his git tree.
Arnd
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 29/34] mmc: mxcmmc: remove mach/hardware.h inclusion
2012-09-17 5:41 ` Chris Ball
@ 2012-09-18 9:18 ` javier Martin
0 siblings, 0 replies; 80+ messages in thread
From: javier Martin @ 2012-09-18 9:18 UTC (permalink / raw)
To: linux-arm-kernel
Hi Shawn,
On 17 September 2012 07:41, Chris Ball <cjb@laptop.org> wrote:
> Hi,
>
> On Mon, Sep 17 2012, Shawn Guo wrote:
>> It changes the driver to use platform_device_id rather than cpu_is_xxx
>> to determine the controller type, and updates the platform code
>> accordingly.
>>
>> As the result, mach/hardware.h inclusion gets removed from the driver.
>>
>> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>> Cc: Chris Ball <cjb@laptop.org>
>> Cc: linux-mmc at vger.kernel.org
>
the dma fix provided by Sascha is needed for this patch to work too:
http://www.spinics.net/lists/arm-kernel/msg195690.html
Otherwise:
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Regards.
--
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 16/34] ASoC: imx-ssi: remove unneeded mach/hardware.h inclusion
2012-09-17 14:30 ` Arnd Bergmann
@ 2012-09-19 3:23 ` Mark Brown
2012-09-19 8:01 ` Arnd Bergmann
0 siblings, 1 reply; 80+ messages in thread
From: Mark Brown @ 2012-09-19 3:23 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Sep 17, 2012 at 02:30:35PM +0000, Arnd Bergmann wrote:
> On Monday 17 September 2012, Mark Brown wrote:
> > On Mon, Sep 17, 2012 at 01:34:45PM +0800, Shawn Guo wrote:
> > > #include <linux/platform_data/asoc-imx-ssi.h>
> > > -#include <mach/hardware.h>
> > This doesn't apply - there's no platform data header for imx-ssi at the
> > minute (and I don't see a patch in this series related to that in the
> > series). I checked -next and there doesn't seem to be anything via a
> > non-ASoC tree either.
> It's in my testing/platform-data series, and will be in linux-next in
> a few days.
Hrm, that seems odd - why are we adding platform data to the driver?
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 16/34] ASoC: imx-ssi: remove unneeded mach/hardware.h inclusion
2012-09-19 3:23 ` Mark Brown
@ 2012-09-19 8:01 ` Arnd Bergmann
2012-09-19 11:44 ` Mark Brown
0 siblings, 1 reply; 80+ messages in thread
From: Arnd Bergmann @ 2012-09-19 8:01 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 19 September 2012, Mark Brown wrote:
> On Mon, Sep 17, 2012 at 02:30:35PM +0000, Arnd Bergmann wrote:
> > On Monday 17 September 2012, Mark Brown wrote:
> > > On Mon, Sep 17, 2012 at 01:34:45PM +0800, Shawn Guo wrote:
>
> > > > #include <linux/platform_data/asoc-imx-ssi.h>
> > > > -#include <mach/hardware.h>
>
> > > This doesn't apply - there's no platform data header for imx-ssi at the
> > > minute (and I don't see a patch in this series related to that in the
> > > series). I checked -next and there doesn't seem to be anything via a
> > > non-ASoC tree either.
>
> > It's in my testing/platform-data series, and will be in linux-next in
> > a few days.
>
> Hrm, that seems odd - why are we adding platform data to the driver?
We're not adding it, we just rename the header file from mach/imx.h
to linux/platform-data/asoc-imx-ssi.h, along with 94 other header files
that get moved to the same directory.
Arnd
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 16/34] ASoC: imx-ssi: remove unneeded mach/hardware.h inclusion
2012-09-19 8:01 ` Arnd Bergmann
@ 2012-09-19 11:44 ` Mark Brown
0 siblings, 0 replies; 80+ messages in thread
From: Mark Brown @ 2012-09-19 11:44 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Sep 19, 2012 at 08:01:23AM +0000, Arnd Bergmann wrote:
> On Wednesday 19 September 2012, Mark Brown wrote:
> > Hrm, that seems odd - why are we adding platform data to the driver?
> We're not adding it, we just rename the header file from mach/imx.h
> to linux/platform-data/asoc-imx-ssi.h, along with 94 other header files
> that get moved to the same directory.
Ah, that stuff. I'd not really registered it as actually adding
platform data to be honest, obviously the series was too big to read in
detail.
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 02/34] ASoC: mx27vis: retrieve gpio numbers from platform_data
2012-09-17 11:07 ` Mark Brown
@ 2012-09-20 1:14 ` Shawn Guo
2012-09-20 1:26 ` Mark Brown
0 siblings, 1 reply; 80+ messages in thread
From: Shawn Guo @ 2012-09-20 1:14 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Sep 17, 2012 at 07:07:42AM -0400, Mark Brown wrote:
> On Mon, Sep 17, 2012 at 01:34:31PM +0800, Shawn Guo wrote:
>
> I've applied this since Javier says it fixes a bug but I'm not terribly
> enthused about it.
>
Ok. But now we have a cross-tree dependency. Please ensure your
for-3.7 branch is stable, so that I can ask arm-soc folks to pull
it as dependency of my series. Or you need to create a topic branch
for this patch.
Shawn
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 02/34] ASoC: mx27vis: retrieve gpio numbers from platform_data
2012-09-20 1:14 ` Shawn Guo
@ 2012-09-20 1:26 ` Mark Brown
2012-09-20 2:20 ` Shawn Guo
0 siblings, 1 reply; 80+ messages in thread
From: Mark Brown @ 2012-09-20 1:26 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 20, 2012 at 09:14:59AM +0800, Shawn Guo wrote:
> On Mon, Sep 17, 2012 at 07:07:42AM -0400, Mark Brown wrote:
> > I've applied this since Javier says it fixes a bug but I'm not terribly
> > enthused about it.
> Ok. But now we have a cross-tree dependency. Please ensure your
> for-3.7 branch is stable, so that I can ask arm-soc folks to pull
> it as dependency of my series. Or you need to create a topic branch
> for this patch.
What's the dependency here?
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 12/34] media: mx1_camera: remove the driver
2012-09-18 9:13 ` Arnd Bergmann
@ 2012-09-20 1:35 ` Shawn Guo
0 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-20 1:35 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Sep 18, 2012 at 09:13:54AM +0000, Arnd Bergmann wrote:
> On Tuesday 18 September 2012, Shawn Guo wrote:
> >
> > On Mon, Sep 17, 2012 at 10:33:25AM +0200, Guennadi Liakhovetski wrote:
> > > Ok, it used to compile not-so-long-ago, but it doesn't seem to be cared
> > > for a lot lately. Let's give Paulius a bit more time to react to this
> > > mail, otherwise I'll have no objections. Just as an idea, to make it a bit
> > > milder we could first mark it BROKEN and add to remove schedule... But I
> > > don't mind either way.
> > >
> > I chose to remove the driver completely rather than marking it BROKEN
> > because the removal of the driver cleans up platform code a lot :)
> >
> > Ok, if we hear anything back from Paulius in the next couple of weeks,
> > I keep the driver there with BROKEN marked.
>
> Sounds fine to me. Of course, if someone wants the driver back and is
> willing to fix it, we'll just revert this patch even after the driver
> is gone.
>
> I would like an Ack from Mauro however. You did not Cc him directly
> in the patch, and he probably has an opionion on it as well, or may
> want to take this patch through his git tree.
>
I've seen Guennadi is collecting camera patches and sending them to
Mauro recently. So I think Guennadi is someone that Mauro trusts.
But yes, we should copy him directly to see if he has an opionion on
this driver removal.
Shawn
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 02/34] ASoC: mx27vis: retrieve gpio numbers from platform_data
2012-09-20 1:26 ` Mark Brown
@ 2012-09-20 2:20 ` Shawn Guo
0 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-20 2:20 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Sep 19, 2012 at 09:26:05PM -0400, Mark Brown wrote:
> On Thu, Sep 20, 2012 at 09:14:59AM +0800, Shawn Guo wrote:
> > On Mon, Sep 17, 2012 at 07:07:42AM -0400, Mark Brown wrote:
>
> > > I've applied this since Javier says it fixes a bug but I'm not terribly
> > > enthused about it.
>
> > Ok. But now we have a cross-tree dependency. Please ensure your
> > for-3.7 branch is stable, so that I can ask arm-soc folks to pull
> > it as dependency of my series. Or you need to create a topic branch
> > for this patch.
>
> What's the dependency here?
We need this patch to enable multi-platform support for imx family,
which is what the series is doing as a whole.
Shawn
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 25/34] dma: imx-dma: remove mach/hardware.h inclusion
2012-09-17 7:58 ` Sascha Hauer
2012-09-18 1:40 ` Shawn Guo
@ 2012-09-21 2:49 ` Shawn Guo
1 sibling, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-09-21 2:49 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Sep 17, 2012 at 09:58:14AM +0200, Sascha Hauer wrote:
> From 3094908fcbb4532056034539ea57042cd60abf47 Mon Sep 17 00:00:00 2001
> From: Sascha Hauer <s.hauer@pengutronix.de>
> Date: Mon, 17 Sep 2012 09:39:30 +0200
> Subject: [PATCH] ARM i.MX DMA: Fixup clock lookups after platform_device_id conversion
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> arch/arm/mach-imx/clk-imx1.c | 3 ++-
> arch/arm/mach-imx/clk-imx21.c | 4 ++--
> arch/arm/mach-imx/clk-imx27.c | 4 ++--
> include/linux/platform_data/dma-imx.h | 4 +++-
> 4 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
> index 7b76bc3..e8d9242 100644
> --- a/arch/arm/mach-imx/clk-imx1.c
> +++ b/arch/arm/mach-imx/clk-imx1.c
> @@ -82,7 +82,8 @@ int __init mx1_clocks_init(unsigned long fref)
> pr_err("imx1 clk %d: register failed with %ld\n",
> i, PTR_ERR(clk[i]));
>
> - clk_register_clkdev(clk[dma_gate], "ahb", "imx-dma");
> + clk_register_clkdev(clk[dma_gate], "ahb", "imx1-dma");
> + clk_register_clkdev(clk[hclk], "ipg", "imx1-dma");
I guess the clock names should be inverted?
Shawn
> clk_register_clkdev(clk[mma_gate], "mma", NULL);
> clk_register_clkdev(clk[usbd_gate], NULL, "imx_udc.0");
> clk_register_clkdev(clk[per1], "per", "imx-gpt.0");
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion
2012-09-18 8:35 ` javier Martin
@ 2012-09-27 7:36 ` Mauro Carvalho Chehab
2012-10-06 8:16 ` Shawn Guo
0 siblings, 1 reply; 80+ messages in thread
From: Mauro Carvalho Chehab @ 2012-09-27 7:36 UTC (permalink / raw)
To: linux-arm-kernel
Em 18-09-2012 05:35, javier Martin escreveu:
> On 17 September 2012 15:59, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
>> On Mon, 17 Sep 2012, javier Martin wrote:
>>
>>> Hi Shawn,
>>>
>>> On 17 September 2012 11:21, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
>>>> On Mon, 17 Sep 2012, Shawn Guo wrote:
>>>>
>>>>> It changes the driver to use platform_device_id rather than cpu_is_xxx
>>>>> to determine the controller type, and updates the platform code
>>>>> accordingly.
>>>>>
>>>>> As the result, mach/hardware.h inclusion gets removed from the driver.
>>>>>
>>>>> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>>>>> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>>>> Cc: linux-media at vger.kernel.org
>>>>
>
> Tested-by: Javier Martin <javier.martin@vista-silicon.com>
I'm understanding that this patch will flow through arm tree[1]. So:
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[1] if you understand otherwise, I can apply it via my tree as well
>
>>>> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>>
>>> i.MX25 support is broken and is scheduled for removal.
>>
>> It is not yet, I haven't pushed those your patches yet.
>>
>> Thanks
>> Guennadi
>>
>>> I think we should not keep on trying to maintain it. Couldn't we just
>>> drop it? It only makes maintenance tasks more difficult.
>>>
>>>> Thanks
>>>> Guennadi
>>>>
>>>>> ---
>>>>> arch/arm/mach-imx/clk-imx25.c | 6 +-
>>>>> arch/arm/mach-imx/clk-imx27.c | 6 +-
>>>>> arch/arm/mach-imx/devices/devices-common.h | 1 +
>>>>> arch/arm/mach-imx/devices/platform-mx2-camera.c | 12 +--
>>>>> drivers/media/video/mx2_camera.c | 95 +++++++++++++++++------
>>>>> 5 files changed, 85 insertions(+), 35 deletions(-)
>>>>>
>>>>> diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
>>>>> index 1aea073..71fe521 100644
>>>>> --- a/arch/arm/mach-imx/clk-imx25.c
>>>>> +++ b/arch/arm/mach-imx/clk-imx25.c
>>>>> @@ -231,9 +231,9 @@ int __init mx25_clocks_init(void)
>>>>> clk_register_clkdev(clk[esdhc2_ipg_per], "per", "sdhci-esdhc-imx25.1");
>>>>> clk_register_clkdev(clk[esdhc2_ipg], "ipg", "sdhci-esdhc-imx25.1");
>>>>> clk_register_clkdev(clk[esdhc2_ahb], "ahb", "sdhci-esdhc-imx25.1");
>>>>> - clk_register_clkdev(clk[csi_ipg_per], "per", "mx2-camera.0");
>>>>> - clk_register_clkdev(clk[csi_ipg], "ipg", "mx2-camera.0");
>>>>> - clk_register_clkdev(clk[csi_ahb], "ahb", "mx2-camera.0");
>>>>> + clk_register_clkdev(clk[csi_ipg_per], "per", "imx25-camera.0");
>>>>> + clk_register_clkdev(clk[csi_ipg], "ipg", "imx25-camera.0");
>>>>> + clk_register_clkdev(clk[csi_ahb], "ahb", "imx25-camera.0");
>>>>> clk_register_clkdev(clk[dummy], "audmux", NULL);
>>>>> clk_register_clkdev(clk[can1_ipg], NULL, "flexcan.0");
>>>>> clk_register_clkdev(clk[can2_ipg], NULL, "flexcan.1");
>>>>> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
>>>>> index 5ff5cf0..e26de52 100644
>>>>> --- a/arch/arm/mach-imx/clk-imx27.c
>>>>> +++ b/arch/arm/mach-imx/clk-imx27.c
>>>>> @@ -224,7 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
>>>>> clk_register_clkdev(clk[per3_gate], "per", "imx-fb.0");
>>>>> clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
>>>>> clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
>>>>> - clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
>>>>> + clk_register_clkdev(clk[csi_ahb_gate], "ahb", "imx27-camera.0");
>>>>> clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
>>>>> clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
>>>>> clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
>>>>> @@ -251,8 +251,8 @@ int __init mx27_clocks_init(unsigned long fref)
>>>>> clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx21-i2c.1");
>>>>> clk_register_clkdev(clk[owire_ipg_gate], NULL, "mxc_w1.0");
>>>>> clk_register_clkdev(clk[kpp_ipg_gate], NULL, "imx-keypad");
>>>>> - clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "mx2-camera.0");
>>>>> - clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "mx2-camera.0");
>>>>> + clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "imx27-camera.0");
>>>>> + clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "imx27-camera.0");
>>>>> clk_register_clkdev(clk[emma_ahb_gate], "ahb", "m2m-emmaprp.0");
>>>>> clk_register_clkdev(clk[emma_ipg_gate], "ipg", "m2m-emmaprp.0");
>>>>> clk_register_clkdev(clk[iim_ipg_gate], "iim", NULL);
>>>>> diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
>>>>> index 7f2698c..8112a1a 100644
>>>>> --- a/arch/arm/mach-imx/devices/devices-common.h
>>>>> +++ b/arch/arm/mach-imx/devices/devices-common.h
>>>>> @@ -202,6 +202,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
>>>>>
>>>>> #include <linux/platform_data/camera-mx2.h>
>>>>> struct imx_mx2_camera_data {
>>>>> + const char *devid;
>>>>> resource_size_t iobasecsi;
>>>>> resource_size_t iosizecsi;
>>>>> resource_size_t irqcsi;
>>>>> diff --git a/arch/arm/mach-imx/devices/platform-mx2-camera.c b/arch/arm/mach-imx/devices/platform-mx2-camera.c
>>>>> index 9ad5b2d..b88877d 100644
>>>>> --- a/arch/arm/mach-imx/devices/platform-mx2-camera.c
>>>>> +++ b/arch/arm/mach-imx/devices/platform-mx2-camera.c
>>>>> @@ -9,14 +9,16 @@
>>>>> #include <mach/hardware.h>
>>>>> #include "devices-common.h"
>>>>>
>>>>> -#define imx_mx2_camera_data_entry_single(soc) \
>>>>> +#define imx_mx2_camera_data_entry_single(soc, _devid) \
>>>>> { \
>>>>> + .devid = _devid, \
>>>>> .iobasecsi = soc ## _CSI_BASE_ADDR, \
>>>>> .iosizecsi = SZ_4K, \
>>>>> .irqcsi = soc ## _INT_CSI, \
>>>>> }
>>>>> -#define imx_mx2_camera_data_entry_single_emma(soc) \
>>>>> +#define imx_mx2_camera_data_entry_single_emma(soc, _devid) \
>>>>> { \
>>>>> + .devid = _devid, \
>>>>> .iobasecsi = soc ## _CSI_BASE_ADDR, \
>>>>> .iosizecsi = SZ_32, \
>>>>> .irqcsi = soc ## _INT_CSI, \
>>>>> @@ -27,12 +29,12 @@
>>>>>
>>>>> #ifdef CONFIG_SOC_IMX25
>>>>> const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst =
>>>>> - imx_mx2_camera_data_entry_single(MX25);
>>>>> + imx_mx2_camera_data_entry_single(MX25, "imx25-camera");
>>>>> #endif /* ifdef CONFIG_SOC_IMX25 */
>>>>>
>>>>> #ifdef CONFIG_SOC_IMX27
>>>>> const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst =
>>>>> - imx_mx2_camera_data_entry_single_emma(MX27);
>>>>> + imx_mx2_camera_data_entry_single_emma(MX27, "imx27-camera");
>>>>> #endif /* ifdef CONFIG_SOC_IMX27 */
>>>>>
>>>>> struct platform_device *__init imx_add_mx2_camera(
>>>>> @@ -58,7 +60,7 @@ struct platform_device *__init imx_add_mx2_camera(
>>>>> .flags = IORESOURCE_IRQ,
>>>>> },
>>>>> };
>>>>> - return imx_add_platform_device_dmamask("mx2-camera", 0,
>>>>> + return imx_add_platform_device_dmamask(data->devid, 0,
>>>>> res, data->iobaseemmaprp ? 4 : 2,
>>>>> pdata, sizeof(*pdata), DMA_BIT_MASK(32));
>>>>> }
>>>>> diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
>>>>> index fe4c76c..cde3374 100644
>>>>> --- a/drivers/media/video/mx2_camera.c
>>>>> +++ b/drivers/media/video/mx2_camera.c
>>>>> @@ -41,7 +41,6 @@
>>>>> #include <linux/videodev2.h>
>>>>>
>>>>> #include <linux/platform_data/camera-mx2.h>
>>>>> -#include <mach/hardware.h>
>>>>>
>>>>> #include <asm/dma.h>
>>>>>
>>>>> @@ -121,11 +120,13 @@
>>>>>
>>>>> #define CSICR1 0x00
>>>>> #define CSICR2 0x04
>>>>> -#define CSISR (cpu_is_mx27() ? 0x08 : 0x18)
>>>>> +#define CSISR_IMX25 0x18
>>>>> +#define CSISR_IMX27 0x08
>>>>> #define CSISTATFIFO 0x0c
>>>>> #define CSIRFIFO 0x10
>>>>> #define CSIRXCNT 0x14
>>>>> -#define CSICR3 (cpu_is_mx27() ? 0x1C : 0x08)
>>>>> +#define CSICR3_IMX25 0x08
>>>>> +#define CSICR3_IMX27 0x1c
>>>>> #define CSIDMASA_STATFIFO 0x20
>>>>> #define CSIDMATA_STATFIFO 0x24
>>>>> #define CSIDMASA_FB1 0x28
>>>>> @@ -268,6 +269,11 @@ struct mx2_buffer {
>>>>> struct mx2_buf_internal internal;
>>>>> };
>>>>>
>>>>> +enum mx2_camera_type {
>>>>> + IMX25_CAMERA,
>>>>> + IMX27_CAMERA,
>>>>> +};
>>>>> +
>>>>> struct mx2_camera_dev {
>>>>> struct device *dev;
>>>>> struct soc_camera_host soc_host;
>>>>> @@ -291,6 +297,9 @@ struct mx2_camera_dev {
>>>>> struct mx2_buffer *fb2_active;
>>>>>
>>>>> u32 csicr1;
>>>>> + u32 reg_csisr;
>>>>> + u32 reg_csicr3;
>>>>> + enum mx2_camera_type devtype;
>>>>>
>>>>> struct mx2_buf_internal buf_discard[2];
>>>>> void *discard_buffer;
>>>>> @@ -303,6 +312,29 @@ struct mx2_camera_dev {
>>>>> struct vb2_alloc_ctx *alloc_ctx;
>>>>> };
>>>>>
>>>>> +static struct platform_device_id mx2_camera_devtype[] = {
>>>>> + {
>>>>> + .name = "imx25-camera",
>>>>> + .driver_data = IMX25_CAMERA,
>>>>> + }, {
>>>>> + .name = "imx27-camera",
>>>>> + .driver_data = IMX27_CAMERA,
>>>>> + }, {
>>>>> + /* sentinel */
>>>>> + }
>>>>> +};
>>>>> +MODULE_DEVICE_TABLE(platform, mx2_camera_devtype);
>>>>> +
>>>>> +static inline int is_imx25_camera(struct mx2_camera_dev *pcdev)
>>>>> +{
>>>>> + return pcdev->devtype == IMX25_CAMERA;
>>>>> +}
>>>>> +
>>>>> +static inline int is_imx27_camera(struct mx2_camera_dev *pcdev)
>>>>> +{
>>>>> + return pcdev->devtype == IMX27_CAMERA;
>>>>> +}
>>>>> +
>>>>> static struct mx2_buffer *mx2_ibuf_to_buf(struct mx2_buf_internal *int_buf)
>>>>> {
>>>>> return container_of(int_buf, struct mx2_buffer, internal);
>>>>> @@ -406,9 +438,9 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
>>>>>
>>>>> clk_disable_unprepare(pcdev->clk_csi);
>>>>> writel(0, pcdev->base_csi + CSICR1);
>>>>> - if (cpu_is_mx27()) {
>>>>> + if (is_imx27_camera(pcdev)) {
>>>>> writel(0, pcdev->base_emma + PRP_CNTL);
>>>>> - } else if (cpu_is_mx25()) {
>>>>> + } else if (is_imx25_camera(pcdev)) {
>>>>> spin_lock_irqsave(&pcdev->lock, flags);
>>>>> pcdev->fb1_active = NULL;
>>>>> pcdev->fb2_active = NULL;
>>>>> @@ -438,7 +470,7 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
>>>>>
>>>>> csicr1 = CSICR1_MCLKEN;
>>>>>
>>>>> - if (cpu_is_mx27())
>>>>> + if (is_imx27_camera(pcdev))
>>>>> csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
>>>>> CSICR1_RXFF_LEVEL(0);
>>>>>
>>>>> @@ -514,7 +546,7 @@ out:
>>>>> static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
>>>>> {
>>>>> struct mx2_camera_dev *pcdev = data;
>>>>> - u32 status = readl(pcdev->base_csi + CSISR);
>>>>> + u32 status = readl(pcdev->base_csi + pcdev->reg_csisr);
>>>>>
>>>>> if (status & CSISR_DMA_TSF_FB1_INT)
>>>>> mx25_camera_frame_done(pcdev, 1, MX2_STATE_DONE);
>>>>> @@ -523,7 +555,7 @@ static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
>>>>>
>>>>> /* FIXME: handle CSISR_RFF_OR_INT */
>>>>>
>>>>> - writel(status, pcdev->base_csi + CSISR);
>>>>> + writel(status, pcdev->base_csi + pcdev->reg_csisr);
>>>>>
>>>>> return IRQ_HANDLED;
>>>>> }
>>>>> @@ -608,7 +640,7 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
>>>>> buf->state = MX2_STATE_QUEUED;
>>>>> list_add_tail(&buf->internal.queue, &pcdev->capture);
>>>>>
>>>>> - if (cpu_is_mx25()) {
>>>>> + if (is_imx25_camera(pcdev)) {
>>>>> u32 csicr3, dma_inten = 0;
>>>>>
>>>>> if (pcdev->fb1_active == NULL) {
>>>>> @@ -627,20 +659,20 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
>>>>> list_del(&buf->internal.queue);
>>>>> buf->state = MX2_STATE_ACTIVE;
>>>>>
>>>>> - csicr3 = readl(pcdev->base_csi + CSICR3);
>>>>> + csicr3 = readl(pcdev->base_csi + pcdev->reg_csicr3);
>>>>>
>>>>> /* Reflash DMA */
>>>>> writel(csicr3 | CSICR3_DMA_REFLASH_RFF,
>>>>> - pcdev->base_csi + CSICR3);
>>>>> + pcdev->base_csi + pcdev->reg_csicr3);
>>>>>
>>>>> /* clear & enable interrupts */
>>>>> - writel(dma_inten, pcdev->base_csi + CSISR);
>>>>> + writel(dma_inten, pcdev->base_csi + pcdev->reg_csisr);
>>>>> pcdev->csicr1 |= dma_inten;
>>>>> writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
>>>>>
>>>>> /* enable DMA */
>>>>> csicr3 |= CSICR3_DMA_REQ_EN_RFF | CSICR3_RXFF_LEVEL(1);
>>>>> - writel(csicr3, pcdev->base_csi + CSICR3);
>>>>> + writel(csicr3, pcdev->base_csi + pcdev->reg_csicr3);
>>>>> }
>>>>> }
>>>>>
>>>>> @@ -684,7 +716,7 @@ static void mx2_videobuf_release(struct vb2_buffer *vb)
>>>>> */
>>>>>
>>>>> spin_lock_irqsave(&pcdev->lock, flags);
>>>>> - if (cpu_is_mx25() && buf->state == MX2_STATE_ACTIVE) {
>>>>> + if (is_imx25_camera(pcdev) && buf->state == MX2_STATE_ACTIVE) {
>>>>> if (pcdev->fb1_active == buf) {
>>>>> pcdev->csicr1 &= ~CSICR1_FB1_DMA_INTEN;
>>>>> writel(0, pcdev->base_csi + CSIDMASA_FB1);
>>>>> @@ -807,7 +839,7 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count)
>>>>> unsigned long phys;
>>>>> int bytesperline;
>>>>>
>>>>> - if (cpu_is_mx27()) {
>>>>> + if (is_imx27_camera(pcdev)) {
>>>>> unsigned long flags;
>>>>> if (count < 2)
>>>>> return -EINVAL;
>>>>> @@ -902,7 +934,7 @@ static int mx2_stop_streaming(struct vb2_queue *q)
>>>>> void *b;
>>>>> u32 cntl;
>>>>>
>>>>> - if (cpu_is_mx27()) {
>>>>> + if (is_imx27_camera(pcdev)) {
>>>>> spin_lock_irqsave(&pcdev->lock, flags);
>>>>>
>>>>> cntl = readl(pcdev->base_emma + PRP_CNTL);
>>>>> @@ -1054,11 +1086,11 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd)
>>>>> if (bytesperline < 0)
>>>>> return bytesperline;
>>>>>
>>>>> - if (cpu_is_mx27()) {
>>>>> + if (is_imx27_camera(pcdev)) {
>>>>> ret = mx27_camera_emma_prp_reset(pcdev);
>>>>> if (ret)
>>>>> return ret;
>>>>> - } else if (cpu_is_mx25()) {
>>>>> + } else if (is_imx25_camera(pcdev)) {
>>>>> writel((bytesperline * icd->user_height) >> 2,
>>>>> pcdev->base_csi + CSIRXCNT);
>>>>> writel((bytesperline << 16) | icd->user_height,
>>>>> @@ -1351,7 +1383,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
>>>>> /* FIXME: implement MX27 limits */
>>>>>
>>>>> /* limit to MX25 hardware capabilities */
>>>>> - if (cpu_is_mx25()) {
>>>>> + if (is_imx25_camera(pcdev)) {
>>>>> if (xlate->host_fmt->bits_per_sample <= 8)
>>>>> width_limit = 0xffff * 4;
>>>>> else
>>>>> @@ -1685,6 +1717,20 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>>>>> goto exit;
>>>>> }
>>>>>
>>>>> + pcdev->devtype = pdev->id_entry->driver_data;
>>>>> + switch (pcdev->devtype) {
>>>>> + case IMX25_CAMERA:
>>>>> + pcdev->reg_csisr = CSISR_IMX25;
>>>>> + pcdev->reg_csicr3 = CSICR3_IMX25;
>>>>> + break;
>>>>> + case IMX27_CAMERA:
>>>>> + pcdev->reg_csisr = CSISR_IMX27;
>>>>> + pcdev->reg_csicr3 = CSICR3_IMX27;
>>>>> + break;
>>>>> + default:
>>>>> + break;
>>>>> + }
>>>>> +
>>>>> pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
>>>>> if (IS_ERR(pcdev->clk_csi)) {
>>>>> dev_err(&pdev->dev, "Could not get csi clock\n");
>>>>> @@ -1722,7 +1768,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>>>>> pcdev->dev = &pdev->dev;
>>>>> platform_set_drvdata(pdev, pcdev);
>>>>>
>>>>> - if (cpu_is_mx25()) {
>>>>> + if (is_imx25_camera(pcdev)) {
>>>>> err = devm_request_irq(&pdev->dev, irq_csi, mx25_camera_irq, 0,
>>>>> MX2_CAM_DRV_NAME, pcdev);
>>>>> if (err) {
>>>>> @@ -1731,7 +1777,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>>>>> }
>>>>> }
>>>>>
>>>>> - if (cpu_is_mx27()) {
>>>>> + if (is_imx27_camera(pcdev)) {
>>>>> err = mx27_camera_emma_init(pdev);
>>>>> if (err)
>>>>> goto exit;
>>>>> @@ -1742,7 +1788,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>>>>> pcdev->soc_host.priv = pcdev;
>>>>> pcdev->soc_host.v4l2_dev.dev = &pdev->dev;
>>>>> pcdev->soc_host.nr = pdev->id;
>>>>> - if (cpu_is_mx25())
>>>>> + if (is_imx25_camera(pcdev))
>>>>> pcdev->soc_host.capabilities = SOCAM_HOST_CAP_STRIDE;
>>>>>
>>>>> pcdev->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev);
>>>>> @@ -1762,7 +1808,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>>>>> exit_free_emma:
>>>>> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
>>>>> eallocctx:
>>>>> - if (cpu_is_mx27()) {
>>>>> + if (is_imx27_camera(pcdev)) {
>>>>> clk_disable_unprepare(pcdev->clk_emma_ipg);
>>>>> clk_disable_unprepare(pcdev->clk_emma_ahb);
>>>>> }
>>>>> @@ -1780,7 +1826,7 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
>>>>>
>>>>> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
>>>>>
>>>>> - if (cpu_is_mx27()) {
>>>>> + if (is_imx27_camera(pcdev)) {
>>>>> clk_disable_unprepare(pcdev->clk_emma_ipg);
>>>>> clk_disable_unprepare(pcdev->clk_emma_ahb);
>>>>> }
>>>>> @@ -1794,6 +1840,7 @@ static struct platform_driver mx2_camera_driver = {
>>>>> .driver = {
>>>>> .name = MX2_CAM_DRV_NAME,
>>>>> },
>>>>> + .id_table = mx2_camera_devtype,
>>>>> .remove = __devexit_p(mx2_camera_remove),
>>>>> };
>>>>>
>>>>> --
>>>>> 1.7.9.5
>>>
>>> I can't test this patch because it depends heavily on the previous
>>> one, which breaks the driver.
>>>
>>> Regards.
>>>
>>> --
>>> Javier Martin
>>> Vista Silicon S.L.
>>> CDTUC - FASE C - Oficina S-345
>>> Avda de los Castros s/n
>>> 39005- Santander. Cantabria. Spain
>>> +34 942 25 32 60
>>> www.vista-silicon.com
>>>
>>
>> ---
>> Guennadi Liakhovetski, Ph.D.
>> Freelance Open-Source Software Developer
>> http://www.open-technology.de/
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-media" in
>> the body of a message to majordomo at vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 14/34] dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h
2012-09-17 9:26 ` Guennadi Liakhovetski
@ 2012-09-27 7:38 ` Mauro Carvalho Chehab
0 siblings, 0 replies; 80+ messages in thread
From: Mauro Carvalho Chehab @ 2012-09-27 7:38 UTC (permalink / raw)
To: linux-arm-kernel
Em 17-09-2012 06:26, Guennadi Liakhovetski escreveu:
> On Mon, 17 Sep 2012, Shawn Guo wrote:
>
>> The header ipu.h really belongs to dma subsystem rather than imx
>> platform. Rename it to ipu-dma.h and put it into include/linux/dma/.
>>
>> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>> Cc: Vinod Koul <vinod.koul@intel.com>
>> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
>> Cc: linux-media at vger.kernel.org
>> Cc: linux-fbdev at vger.kernel.org
>
> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>
> Thanks
> Guennadi
>
>> ---
>> drivers/dma/ipu/ipu_idmac.c | 3 +--
>> drivers/dma/ipu/ipu_irq.c | 3 +--
>> drivers/media/video/mx3_camera.c | 2 +-
>> drivers/video/mx3fb.c | 2 +-
>> .../mach/ipu.h => include/linux/dma/ipu-dma.h | 6 +++---
>> 5 files changed, 7 insertions(+), 9 deletions(-)
>> rename arch/arm/mach-imx/include/mach/ipu.h => include/linux/dma/ipu-dma.h (97%)
>>
>> diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c
>> index c7573e5..6585537 100644
>> --- a/drivers/dma/ipu/ipu_idmac.c
>> +++ b/drivers/dma/ipu/ipu_idmac.c
>> @@ -22,8 +22,7 @@
>> #include <linux/interrupt.h>
>> #include <linux/io.h>
>> #include <linux/module.h>
>> -
>> -#include <mach/ipu.h>
>> +#include <linux/dma/ipu-dma.h>
>>
>> #include "../dmaengine.h"
>> #include "ipu_intern.h"
>> diff --git a/drivers/dma/ipu/ipu_irq.c b/drivers/dma/ipu/ipu_irq.c
>> index fa95bcc..a5ee37d 100644
>> --- a/drivers/dma/ipu/ipu_irq.c
>> +++ b/drivers/dma/ipu/ipu_irq.c
>> @@ -15,8 +15,7 @@
>> #include <linux/irq.h>
>> #include <linux/io.h>
>> #include <linux/module.h>
>> -
>> -#include <mach/ipu.h>
>> +#include <linux/dma/ipu-dma.h>
>>
>> #include "ipu_intern.h"
>>
>> diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
>> index 1481b0d..892cba5 100644
>> --- a/drivers/media/video/mx3_camera.c
>> +++ b/drivers/media/video/mx3_camera.c
>> @@ -17,6 +17,7 @@
>> #include <linux/vmalloc.h>
>> #include <linux/interrupt.h>
>> #include <linux/sched.h>
>> +#include <linux/dma/ipu-dma.h>
>>
>> #include <media/v4l2-common.h>
>> #include <media/v4l2-dev.h>
>> @@ -24,7 +25,6 @@
>> #include <media/soc_camera.h>
>> #include <media/soc_mediabus.h>
>>
>> -#include <mach/ipu.h>
>> #include <linux/platform_data/camera-mx3.h>
>> #include <linux/platform_data/dma-imx.h>
>>
>> diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
>> index d738108..3b63ad8 100644
>> --- a/drivers/video/mx3fb.c
>> +++ b/drivers/video/mx3fb.c
>> @@ -26,10 +26,10 @@
>> #include <linux/console.h>
>> #include <linux/clk.h>
>> #include <linux/mutex.h>
>> +#include <linux/dma/ipu-dma.h>
>>
>> #include <linux/platform_data/dma-imx.h>
>> #include <mach/hardware.h>
>> -#include <mach/ipu.h>
>> #include <linux/platform_data/video-mx3fb.h>
>>
>> #include <asm/io.h>
>> diff --git a/arch/arm/mach-imx/include/mach/ipu.h b/include/linux/dma/ipu-dma.h
>> similarity index 97%
>> rename from arch/arm/mach-imx/include/mach/ipu.h
>> rename to include/linux/dma/ipu-dma.h
>> index 539e559..1803111 100644
>> --- a/arch/arm/mach-imx/include/mach/ipu.h
>> +++ b/include/linux/dma/ipu-dma.h
>> @@ -9,8 +9,8 @@
>> * published by the Free Software Foundation.
>> */
>>
>> -#ifndef _IPU_H_
>> -#define _IPU_H_
>> +#ifndef __LINUX_DMA_IPU_DMA_H
>> +#define __LINUX_DMA_IPU_DMA_H
>>
>> #include <linux/types.h>
>> #include <linux/dmaengine.h>
>> @@ -174,4 +174,4 @@ struct idmac_channel {
>> #define to_tx_desc(tx) container_of(tx, struct idmac_tx_desc, txd)
>> #define to_idmac_chan(c) container_of(c, struct idmac_channel, dma_chan)
>>
>> -#endif
>> +#endif /* __LINUX_DMA_IPU_DMA_H */
>> --
>> 1.7.9.5
>>
>
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 80+ messages in thread
* [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion
2012-09-27 7:36 ` Mauro Carvalho Chehab
@ 2012-10-06 8:16 ` Shawn Guo
0 siblings, 0 replies; 80+ messages in thread
From: Shawn Guo @ 2012-10-06 8:16 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 27, 2012 at 04:36:56AM -0300, Mauro Carvalho Chehab wrote:
> I'm understanding that this patch will flow through arm tree[1]. So:
Yes, it will go through arm-soc tree for 3.8.
> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>
Thanks, Mauro.
Shawn
^ permalink raw reply [flat|nested] 80+ messages in thread
end of thread, other threads:[~2012-10-06 8:16 UTC | newest]
Thread overview: 80+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
2012-09-17 5:34 ` [PATCH 01/34] ARM: imx: include board headers in the same folder Shawn Guo
2012-09-17 5:34 ` [PATCH 02/34] ASoC: mx27vis: retrieve gpio numbers from platform_data Shawn Guo
2012-09-17 9:19 ` javier Martin
2012-09-17 11:07 ` Mark Brown
2012-09-20 1:14 ` Shawn Guo
2012-09-20 1:26 ` Mark Brown
2012-09-20 2:20 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 03/34] ARM: imx: move iomux drivers and headers into mach-imx Shawn Guo
2012-09-17 5:34 ` [PATCH 04/34] ARM: imx: remove unnecessary inclusion from device-imx*.h Shawn Guo
2012-09-17 5:34 ` [PATCH 05/34] ARM: imx: move platform device code into mach-imx Shawn Guo
2012-09-17 5:34 ` [PATCH 06/34] ARM: imx: merge plat-mxc " Shawn Guo
2012-09-18 8:08 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 07/34] ARM: imx: include common.h rather than mach/common.h Shawn Guo
2012-09-17 5:34 ` [PATCH 08/34] ARM: imx: ARM: imx: include cpuidle.h rather than mach/cpuidle.h Shawn Guo
2012-09-17 5:34 ` [PATCH 09/34] ARM: imx: include iim.h rather than mach/iim.h Shawn Guo
2012-09-17 5:34 ` [PATCH 10/34] ARM: imx: include iram.h rather than mach/iram.h Shawn Guo
2012-09-17 5:34 ` [PATCH 11/34] ARM: imx: include ulpi.h rather than mach/ulpi.h Shawn Guo
2012-09-17 5:34 ` [PATCH 12/34] media: mx1_camera: remove the driver Shawn Guo
2012-09-17 8:33 ` Guennadi Liakhovetski
2012-09-18 1:28 ` Shawn Guo
2012-09-18 9:13 ` Arnd Bergmann
2012-09-20 1:35 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 13/34] ARM: imx: remove mach/dma-mx1-mx2.h Shawn Guo
2012-09-17 5:34 ` [PATCH 14/34] dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h Shawn Guo
2012-09-17 9:26 ` Guennadi Liakhovetski
2012-09-27 7:38 ` Mauro Carvalho Chehab
2012-09-17 5:34 ` [PATCH 15/34] dma: imx-sdma: remove unneeded mach/hardware.h inclusion Shawn Guo
2012-09-17 5:34 ` [PATCH 16/34] ASoC: imx-ssi: " Shawn Guo
2012-09-17 11:45 ` Mark Brown
2012-09-17 14:30 ` Arnd Bergmann
2012-09-19 3:23 ` Mark Brown
2012-09-19 8:01 ` Arnd Bergmann
2012-09-19 11:44 ` Mark Brown
2012-09-17 5:34 ` [PATCH 17/34] usb: ehci-mxc: " Shawn Guo
2012-09-17 11:18 ` Greg Kroah-Hartman
2012-09-17 5:34 ` [PATCH 18/34] video: mx3fb: " Shawn Guo
2012-09-17 5:34 ` [PATCH 19/34] watchdog: imx2_wdt: " Shawn Guo
2012-09-17 5:34 ` [PATCH 20/34] i2c: imx: remove " Shawn Guo
2012-09-17 5:34 ` [PATCH 21/34] mtd: mxc_nand: " Shawn Guo
2012-09-17 5:34 ` [PATCH 22/34] rtc: mxc_rtc: " Shawn Guo
2012-09-17 5:34 ` [PATCH 23/34] dma: imx-dma: use devm_kzalloc and devm_request_irq Shawn Guo
2012-09-17 5:34 ` [PATCH 24/34] dma: imx-dma: retrieve MEM and IRQ from resources Shawn Guo
2012-09-17 5:34 ` [PATCH 25/34] dma: imx-dma: remove mach/hardware.h inclusion Shawn Guo
2012-09-17 7:58 ` Sascha Hauer
2012-09-18 1:40 ` Shawn Guo
2012-09-21 2:49 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 26/34] media: mx2_camera: remove dead code in mx2_camera_add_device Shawn Guo
2012-09-17 8:18 ` Guennadi Liakhovetski
2012-09-17 13:36 ` javier Martin
2012-09-18 1:49 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 27/34] media: mx2_camera: use managed functions to clean up code Shawn Guo
2012-09-17 9:11 ` Guennadi Liakhovetski
2012-09-17 13:36 ` javier Martin
2012-09-18 7:43 ` Shawn Guo
2012-09-18 8:34 ` javier Martin
2012-09-17 5:34 ` [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion Shawn Guo
2012-09-17 9:21 ` Guennadi Liakhovetski
2012-09-17 13:43 ` javier Martin
2012-09-17 13:59 ` Guennadi Liakhovetski
2012-09-18 8:35 ` javier Martin
2012-09-27 7:36 ` Mauro Carvalho Chehab
2012-10-06 8:16 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 29/34] mmc: mxcmmc: " Shawn Guo
2012-09-17 5:41 ` Chris Ball
2012-09-18 9:18 ` javier Martin
2012-09-17 5:34 ` [PATCH 30/34] video: imxfb: " Shawn Guo
2012-09-17 5:35 ` [PATCH 31/34] ARM: imx: move debug macros to include/debug Shawn Guo
2012-09-17 5:35 ` [PATCH 32/34] ARM: imx: include hardware.h rather than mach/hardware.h Shawn Guo
2012-09-17 5:35 ` [PATCH 33/34] ARM: imx: remove header file mach/irqs.h Shawn Guo
2012-09-17 11:32 ` Arnd Bergmann
2012-09-18 8:13 ` Shawn Guo
2012-09-17 11:46 ` Mark Brown
2012-09-17 5:35 ` [PATCH 34/34] ARM: imx: enable multi-platform build Shawn Guo
2012-09-17 11:44 ` Arnd Bergmann
2012-09-17 7:51 ` [PATCH 00/34] i.MX multi-platform support Sascha Hauer
2012-09-17 11:38 ` Arnd Bergmann
2012-09-18 8:20 ` Shawn Guo
2012-09-18 7:52 ` Sascha Hauer
2012-09-18 8:05 ` [alsa-devel] " Shawn Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).