i.MX multi-platform support
Subsystems (19)
cover i.MX multi-platform support
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.hSignature · 1 line
1.7.9.5
PATCH 1/34 ARM: imx: include board headers in the same folder
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.
---
.../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%)arch/arm/mach-imx/3ds_debugboard.h renamed from arch/arm/plat-mxc/include/mach/3ds_debugboard.h +0 -0
arch/arm/mach-imx/board-mx31lilly.h renamed from arch/arm/plat-mxc/include/mach/board-mx31lilly.h +0 -0
arch/arm/mach-imx/board-mx31lite.h renamed from arch/arm/plat-mxc/include/mach/board-mx31lite.h +0 -0
arch/arm/mach-imx/board-mx31moboard.h renamed from arch/arm/plat-mxc/include/mach/board-mx31moboard.h +0 -0
arch/arm/mach-imx/board-pcm038.h renamed from arch/arm/plat-mxc/include/mach/board-pcm038.h +0 -0
arch/arm/mach-imx/eukrea-baseboards.h renamed from arch/arm/plat-mxc/include/mach/eukrea-baseboards.h +0 -0
arch/arm/mach-imx/mach-cpuimx27.c +1 -1
@@ -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 */
arch/arm/mach-imx/mach-cpuimx35.c +1 -1
@@ -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 ,
arch/arm/mach-imx/mach-cpuimx51sd.c +1 -1
@@ -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)
arch/arm/mach-imx/mach-eukrea_cpuimx25.c +1 -1
@@ -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 ,
arch/arm/mach-imx/mach-mx27_3ds.c +1 -1
@@ -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)
arch/arm/mach-imx/mach-mx31_3ds.c +1 -1
@@ -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[] = {
arch/arm/mach-imx/mach-mx31lilly.c +1 -1
@@ -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" /*
arch/arm/mach-imx/mach-mx31lite.c +1 -1
@@ -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" /*
arch/arm/mach-imx/mach-mx31moboard.c +1 -1
@@ -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[] = {
arch/arm/mach-imx/mach-mx35_3ds.c +1 -1
@@ -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
arch/arm/mach-imx/mach-mx51_3ds.c +1 -1
@@ -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)
arch/arm/mach-imx/mach-pcm038.c +1 -1
@@ -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 = {
arch/arm/mach-imx/mx31lilly-db.c +1 -1
@@ -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" /*
arch/arm/mach-imx/mx31lite-db.c +1 -1
@@ -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" /*
arch/arm/mach-imx/mx31moboard-smartbot.c +1 -1
@@ -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[] = {
Signature · 1 line
1.7.9.5
PATCH 2/34 ASoC: mx27vis: retrieve gpio numbers from platform_data
In reply to Shawn GuoRather 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.
--- 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
arch/arm/mach-imx/mach-imx27_visstrim_m10.c +41 -1
@@ -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);
include/linux/platform_data/asoc-mx27vis.h new file +11 -0
@@ -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 */
sound/soc/fsl/mx27vis-aic32x4.c +20 -22
85 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Re: [PATCH 02/34] ASoC: mx27vis: retrieve gpio numbers from platform_data
Hi Shawn,
thank you for your patch.
Quoted 4 lines · Shawn Guo
Rather than including
mach/iomux-mx27.hto define gpio numbers and set up the pins, the patch moves all these into machine code and has the gpio numbers passed to driver viaplatform_data. As the result, we can remove themach/iomux-mx27.hinclusion from driver.
In fact, this even solves a BUG related to the external amp GPIOs not being registered.
Regards.
Signature · 7 lines
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
Re: [PATCH 02/34] ASoC: mx27vis: retrieve gpio numbers from platform_data
In reply to Shawn GuoOn 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.
Quoted 3 lines
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.
Quoted 1 line
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.
Re: [PATCH 02/34] ASoC: mx27vis: retrieve gpio numbers from platform_data
Quoted 5 lines · Mark Brown
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
Re: [PATCH 02/34] ASoC: mx27vis: retrieve gpio numbers from platform_data
Quoted 9 lines · Shawn Guo
Quoted 2 lines · Mark Brown
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?
Re: [PATCH 02/34] ASoC: mx27vis: retrieve gpio numbers from platform_data
Quoted 6 lines · Mark Brown
Quoted 4 lines · Shawn Guo
Quoted 2 lines · Mark Brown
I've applied this since Javier says it fixes a bug but I'm not terribly enthused about it.
Quoted 6 lines
Quoted 4 lines
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
PATCH 3/34 ARM: imx: move iomux drivers and headers into mach-imx
In reply to Shawn GuoThe board files in mach-imx are the only users of iomux drivers and headers. Move them into mach-imx from plat-mxc.
---
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%)arch/arm/mach-imx/Kconfig +6 -0
@@ -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
arch/arm/mach-imx/Makefile +3 -0
@@ -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
arch/arm/mach-imx/eukrea_mbimx27-baseboard.c +1 -1
@@ -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 */
arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c +1 -1
@@ -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 */
arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c +1 -1
@@ -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[] = { {
arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c +1 -1
@@ -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 */
arch/arm/mach-imx/iomux-imx31.c +2 -1
@@ -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
arch/arm/mach-imx/iomux-mx1.h renamed from arch/arm/plat-mxc/include/mach/iomux-mx1.h +1 -1
@@ -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)
arch/arm/mach-imx/iomux-mx21.h renamed from arch/arm/plat-mxc/include/mach/iomux-mx21.h +2 -2
@@ -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 */
arch/arm/mach-imx/iomux-mx25.h renamed from arch/arm/plat-mxc/include/mach/iomux-mx25.h +1 -1
@@ -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
arch/arm/mach-imx/iomux-mx27.h renamed from arch/arm/plat-mxc/include/mach/iomux-mx27.h +2 -2
@@ -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 */
arch/arm/mach-imx/iomux-mx2x.h renamed from arch/arm/plat-mxc/include/mach/iomux-mx2x.h +0 -0
arch/arm/mach-imx/iomux-mx3.h renamed from arch/arm/plat-mxc/include/mach/iomux-mx3.h +0 -0
arch/arm/mach-imx/iomux-mx35.h renamed from arch/arm/plat-mxc/include/mach/iomux-mx35.h +1 -1
@@ -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>
arch/arm/mach-imx/iomux-mx50.h renamed from arch/arm/plat-mxc/include/mach/iomux-mx50.h +1 -1
@@ -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)
arch/arm/mach-imx/iomux-mx51.h renamed from arch/arm/plat-mxc/include/mach/iomux-mx51.h +1 -1
@@ -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
arch/arm/mach-imx/iomux-v1.c renamed from arch/arm/plat-mxc/iomux-v1.c +2 -1
@@ -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;
arch/arm/mach-imx/iomux-v1.h renamed from arch/arm/plat-mxc/include/mach/iomux-v1.h +0 -0
arch/arm/mach-imx/iomux-v3.c renamed from arch/arm/plat-mxc/iomux-v3.c +2 -1
@@ -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;
arch/arm/mach-imx/iomux-v3.h renamed from arch/arm/plat-mxc/include/mach/iomux-v3.h +0 -0
arch/arm/mach-imx/mach-apf9328.c +1 -1
@@ -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 */
arch/arm/mach-imx/mach-armadillo5x0.c +1 -1
@@ -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 */
arch/arm/mach-imx/mach-bug.c +1 -1
@@ -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 ,
arch/arm/mach-imx/mach-cpuimx27.c +1 -1
@@ -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 */
arch/arm/mach-imx/mach-cpuimx35.c +1 -1
@@ -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 ,
arch/arm/mach-imx/mach-cpuimx51sd.c +1 -1
@@ -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)
arch/arm/mach-imx/mach-eukrea_cpuimx25.c +1 -1
@@ -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 ,
arch/arm/mach-imx/mach-imx27_visstrim_m10.c +1 -1
@@ -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)
arch/arm/mach-imx/mach-imx27ipcam.c +1 -1
@@ -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 */
arch/arm/mach-imx/mach-imx27lite.c +1 -1
@@ -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 */
arch/arm/mach-imx/mach-kzm_arm11_01.c +1 -1
@@ -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) ?: \
arch/arm/mach-imx/mach-mx1ads.c +1 -1
@@ -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 */
arch/arm/mach-imx/mach-mx21ads.c +1 -1
@@ -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
arch/arm/mach-imx/mach-mx25_3ds.c +1 -1
@@ -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)
arch/arm/mach-imx/mach-mx27_3ds.c +1 -1
@@ -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)
arch/arm/mach-imx/mach-mx27ads.c +1 -1
@@ -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
arch/arm/mach-imx/mach-mx31_3ds.c +1 -1
@@ -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 */
arch/arm/mach-imx/mach-mx31ads.c +1 -1
@@ -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
arch/arm/mach-imx/mach-mx31lilly.c +1 -1
@@ -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.
arch/arm/mach-imx/mach-mx31lite.c +1 -1
@@ -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.
arch/arm/mach-imx/mach-mx31moboard.c +1 -1
@@ -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 */
arch/arm/mach-imx/mach-mx35_3ds.c +1 -1
@@ -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
arch/arm/mach-imx/mach-mx50_rdp.c +1 -1
@@ -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)
arch/arm/mach-imx/mach-mx51_3ds.c +1 -1
@@ -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)
arch/arm/mach-imx/mach-mx51_babbage.c +1 -1
@@ -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)
arch/arm/mach-imx/mach-mxt_td60.c +1 -1
@@ -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 */
arch/arm/mach-imx/mach-pca100.c +1 -1
@@ -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)
arch/arm/mach-imx/mach-pcm037.c +1 -1
@@ -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 ;
arch/arm/mach-imx/mach-pcm037_eet.c +1 -1
@@ -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 */
arch/arm/mach-imx/mach-pcm038.c +1 -1
@@ -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 */
arch/arm/mach-imx/mach-pcm043.c +1 -1
@@ -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[] = { {
arch/arm/mach-imx/mach-qong.c +1 -1
@@ -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) \
arch/arm/mach-imx/mach-scb9328.c +1 -1
@@ -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
arch/arm/mach-imx/mach-vpr200.c +1 -1
@@ -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)
arch/arm/mach-imx/mm-imx1.c +2 -1
@@ -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 ),
arch/arm/mach-imx/mm-imx21.c +2 -1
@@ -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 = {
arch/arm/mach-imx/mm-imx25.c +2 -1
@@ -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.
arch/arm/mach-imx/mm-imx27.c +2 -1
@@ -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 = {
arch/arm/mach-imx/mm-imx3.c +1 -1
@@ -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;
arch/arm/mach-imx/mm-imx5.c +2 -1
@@ -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.
arch/arm/mach-imx/mx31lilly-db.c +1 -1
@@ -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
arch/arm/mach-imx/mx31lite-db.c +1 -1
@@ -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
arch/arm/mach-imx/mx31moboard-devboard.c +1 -1
@@ -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 */
arch/arm/mach-imx/mx31moboard-marxbot.c +1 -1
@@ -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 */
arch/arm/mach-imx/mx31moboard-smartbot.c +1 -1
@@ -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 */
arch/arm/mach-imx/pcm970-baseboard.c +1 -1
@@ -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 */
arch/arm/plat-mxc/Kconfig +0 -6
@@ -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
arch/arm/plat-mxc/Makefile +0 -2
@@ -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
Signature · 1 line
1.7.9.5
PATCH 4/34 ARM: imx: remove unnecessary inclusion from device-imx*.h
In reply to Shawn GuoThere is no need for device-imx*.h to include <soc>.h. Remove them and fix one indirect inclusion in mach-mx31ads.c.
--- 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(-)
arch/arm/mach-imx/devices-imx1.h +0 -1
@@ -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;
arch/arm/mach-imx/devices-imx21.h +0 -1
@@ -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;
arch/arm/mach-imx/devices-imx25.h +0 -1
@@ -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;
arch/arm/mach-imx/devices-imx27.h +0 -1
@@ -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;
arch/arm/mach-imx/devices-imx31.h +0 -1
@@ -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;
arch/arm/mach-imx/devices-imx35.h +0 -1
@@ -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;
arch/arm/mach-imx/devices-imx50.h +0 -1
@@ -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[];
arch/arm/mach-imx/devices-imx51.h +0 -1
@@ -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;
arch/arm/mach-imx/mach-mx31ads.c +1 -0
@@ -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>
Signature · 1 line
1.7.9.5
PATCH 5/34 ARM: imx: move platform device code into mach-imx
In reply to Shawn GuoIt 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/.
---
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%)arch/arm/mach-imx/Kconfig +2 -0
@@ -772,3 +772,5 @@ config SOC_IMX6Q This enables support for Freescale i.MX6 Quad processor. endif + +source "arch/arm/mach-imx/devices/Kconfig"
arch/arm/mach-imx/Makefile +2 -0
@@ -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/
arch/arm/mach-imx/devices-imx1.h +1 -1
@@ -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) \
arch/arm/mach-imx/devices-imx21.h +1 -1
@@ -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) \
arch/arm/mach-imx/devices-imx25.h +1 -1
@@ -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) \
arch/arm/mach-imx/devices-imx27.h +1 -1
@@ -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) \
arch/arm/mach-imx/devices-imx31.h +1 -1
@@ -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) \
arch/arm/mach-imx/devices-imx35.h +1 -1
@@ -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) \
arch/arm/mach-imx/devices-imx50.h +1 -1
@@ -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) \
arch/arm/mach-imx/devices-imx51.h +1 -1
@@ -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) \
arch/arm/mach-imx/devices/Kconfig renamed from arch/arm/plat-mxc/devices/Kconfig +0 -0
arch/arm/mach-imx/devices/Makefile renamed from arch/arm/plat-mxc/devices/Makefile +2 -0
@@ -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
arch/arm/mach-imx/devices/devices-common.h renamed from arch/arm/plat-mxc/include/mach/devices-common.h +0 -0
arch/arm/mach-imx/devices/devices.c renamed from arch/arm/plat-mxc/devices.c +0 -0
arch/arm/mach-imx/devices/platform-ahci-imx.c renamed from arch/arm/plat-mxc/devices/platform-ahci-imx.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-fec.c renamed from arch/arm/plat-mxc/devices/platform-fec.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-flexcan.c renamed from arch/arm/plat-mxc/devices/platform-flexcan.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c renamed from arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-gpio-mxc.c renamed from arch/arm/plat-mxc/devices/platform-gpio-mxc.c +1 -1
@@ -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)
arch/arm/mach-imx/devices/platform-gpio_keys.c renamed from arch/arm/plat-mxc/devices/platform-gpio_keys.c +1 -1
@@ -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)
arch/arm/mach-imx/devices/platform-imx-dma.c renamed from arch/arm/plat-mxc/devices/platform-imx-dma.c +1 -1
@@ -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 ) {
arch/arm/mach-imx/devices/platform-imx-fb.c renamed from arch/arm/plat-mxc/devices/platform-imx-fb.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-imx-i2c.c renamed from arch/arm/plat-mxc/devices/platform-imx-i2c.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-imx-keypad.c renamed from arch/arm/plat-mxc/devices/platform-imx-keypad.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-imx-ssi.c renamed from arch/arm/plat-mxc/devices/platform-imx-ssi.c +1 -1
@@ -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] = { \
arch/arm/mach-imx/devices/platform-imx-uart.c renamed from arch/arm/plat-mxc/devices/platform-imx-uart.c +1 -1
@@ -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] = { \
arch/arm/mach-imx/devices/platform-imx2-wdt.c renamed from arch/arm/plat-mxc/devices/platform-imx2-wdt.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-imx21-hcd.c renamed from arch/arm/plat-mxc/devices/platform-imx21-hcd.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-imx_udc.c renamed from arch/arm/plat-mxc/devices/platform-imx_udc.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-imxdi_rtc.c renamed from arch/arm/plat-mxc/devices/platform-imxdi_rtc.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-ipu-core.c renamed from arch/arm/plat-mxc/devices/platform-ipu-core.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-mx1-camera.c renamed from arch/arm/plat-mxc/devices/platform-mx1-camera.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-mx2-camera.c renamed from arch/arm/plat-mxc/devices/platform-mx2-camera.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-mxc-ehci.c renamed from arch/arm/plat-mxc/devices/platform-mxc-ehci.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-mxc-mmc.c renamed from arch/arm/plat-mxc/devices/platform-mxc-mmc.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-mxc_nand.c renamed from arch/arm/plat-mxc/devices/platform-mxc_nand.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-mxc_pwm.c renamed from arch/arm/plat-mxc/devices/platform-mxc_pwm.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-mxc_rnga.c renamed from arch/arm/plat-mxc/devices/platform-mxc_rnga.c +1 -1
@@ -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;
arch/arm/mach-imx/devices/platform-mxc_rtc.c renamed from arch/arm/plat-mxc/devices/platform-mxc_rtc.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-mxc_w1.c renamed from arch/arm/plat-mxc/devices/platform-mxc_w1.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-pata_imx.c renamed from arch/arm/plat-mxc/devices/platform-pata_imx.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c renamed from arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/devices/platform-spi_imx.c renamed from arch/arm/plat-mxc/devices/platform-spi_imx.c +1 -1
@@ -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) \ { \
arch/arm/mach-imx/mm-imx21.c +1 -1
@@ -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 */
arch/arm/mach-imx/mm-imx25.c +1 -1
@@ -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" /*
arch/arm/mach-imx/mm-imx27.c +1 -1
@@ -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 */
arch/arm/mach-imx/mm-imx3.c +1 -1
@@ -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;
arch/arm/mach-imx/mm-imx5.c +1 -1
@@ -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" /*
arch/arm/mach-imx/pm-imx3.c +1 -1
@@ -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
arch/arm/plat-mxc/Kconfig +0 -2
@@ -1,7 +1,5 @@ if ARCH_MXC -source "arch/arm/plat-mxc/devices/Kconfig" - menu "Freescale MXC Implementations" choice
arch/arm/plat-mxc/Makefile +1 -3
@@ -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/
Signature · 1 line
1.7.9.5
PATCH 6/34 ARM: imx: merge plat-mxc into mach-imx
In reply to Shawn GuoIt'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.
---
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/Makefilearch/arm/Kconfig +1 -1
@@ -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"
arch/arm/Makefile +0 -1
@@ -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
arch/arm/mach-imx/3ds_debugboard.c renamed from arch/arm/plat-mxc/3ds_debugboard.c +0 -0
arch/arm/mach-imx/Kconfig +80 -0
99 lines not on this page · raw message
arch/arm/mach-imx/Makefile +17 -0
@@ -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
arch/arm/mach-imx/avic.c renamed from arch/arm/plat-mxc/avic.c +0 -0
arch/arm/mach-imx/cpu.c renamed from arch/arm/plat-mxc/cpu.c +0 -0
arch/arm/mach-imx/cpufreq.c renamed from arch/arm/plat-mxc/cpufreq.c +0 -0
arch/arm/mach-imx/cpuidle.c renamed from arch/arm/plat-mxc/cpuidle.c +0 -0
arch/arm/mach-imx/epit.c renamed from arch/arm/plat-mxc/epit.c +0 -0
arch/arm/mach-imx/include/mach/common.h renamed from arch/arm/plat-mxc/include/mach/common.h +0 -0
arch/arm/mach-imx/include/mach/cpuidle.h renamed from arch/arm/plat-mxc/include/mach/cpuidle.h +0 -0
arch/arm/mach-imx/include/mach/debug-macro.S renamed from arch/arm/plat-mxc/include/mach/debug-macro.S +0 -0
arch/arm/mach-imx/include/mach/hardware.h renamed from arch/arm/plat-mxc/include/mach/hardware.h +0 -0
arch/arm/mach-imx/include/mach/iim.h renamed from arch/arm/plat-mxc/include/mach/iim.h +0 -0
arch/arm/mach-imx/include/mach/ipu.h renamed from arch/arm/plat-mxc/include/mach/ipu.h +0 -0
arch/arm/mach-imx/include/mach/iram.h renamed from arch/arm/plat-mxc/include/mach/iram.h +0 -0
arch/arm/mach-imx/include/mach/irqs.h renamed from arch/arm/plat-mxc/include/mach/irqs.h +0 -0
arch/arm/mach-imx/include/mach/mx1.h renamed from arch/arm/plat-mxc/include/mach/mx1.h +0 -0
arch/arm/mach-imx/include/mach/mx21.h renamed from arch/arm/plat-mxc/include/mach/mx21.h +0 -0
arch/arm/mach-imx/include/mach/mx25.h renamed from arch/arm/plat-mxc/include/mach/mx25.h +0 -0
arch/arm/mach-imx/include/mach/mx27.h renamed from arch/arm/plat-mxc/include/mach/mx27.h +0 -0
arch/arm/mach-imx/include/mach/mx2x.h renamed from arch/arm/plat-mxc/include/mach/mx2x.h +0 -0
arch/arm/mach-imx/include/mach/mx31.h renamed from arch/arm/plat-mxc/include/mach/mx31.h +0 -0
arch/arm/mach-imx/include/mach/mx35.h renamed from arch/arm/plat-mxc/include/mach/mx35.h +0 -0
arch/arm/mach-imx/include/mach/mx3x.h renamed from arch/arm/plat-mxc/include/mach/mx3x.h +0 -0
arch/arm/mach-imx/include/mach/mx50.h renamed from arch/arm/plat-mxc/include/mach/mx50.h +0 -0
arch/arm/mach-imx/include/mach/mx51.h renamed from arch/arm/plat-mxc/include/mach/mx51.h +0 -0
arch/arm/mach-imx/include/mach/mx53.h renamed from arch/arm/plat-mxc/include/mach/mx53.h +0 -0
arch/arm/mach-imx/include/mach/mx6q.h renamed from arch/arm/plat-mxc/include/mach/mx6q.h +0 -0
arch/arm/mach-imx/include/mach/mxc.h renamed from arch/arm/plat-mxc/include/mach/mxc.h +0 -0
arch/arm/mach-imx/include/mach/timex.h renamed from arch/arm/plat-mxc/include/mach/timex.h +0 -0
arch/arm/mach-imx/include/mach/ulpi.h renamed from arch/arm/plat-mxc/include/mach/ulpi.h +0 -0
arch/arm/mach-imx/include/mach/uncompress.h renamed from arch/arm/plat-mxc/include/mach/uncompress.h +0 -0
arch/arm/mach-imx/iram_alloc.c renamed from arch/arm/plat-mxc/iram_alloc.c +0 -0
arch/arm/mach-imx/irq-common.c renamed from arch/arm/plat-mxc/irq-common.c +0 -0
arch/arm/mach-imx/irq-common.h renamed from arch/arm/plat-mxc/irq-common.h +0 -0
arch/arm/mach-imx/ssi-fiq-ksym.c renamed from arch/arm/plat-mxc/ssi-fiq-ksym.c +0 -0
arch/arm/mach-imx/ssi-fiq.S renamed from arch/arm/plat-mxc/ssi-fiq.S +0 -0
arch/arm/mach-imx/system.c renamed from arch/arm/plat-mxc/system.c +0 -0
arch/arm/mach-imx/time.c renamed from arch/arm/plat-mxc/time.c +0 -0
arch/arm/mach-imx/tzic.c renamed from arch/arm/plat-mxc/tzic.c +0 -0
arch/arm/mach-imx/ulpi.c renamed from arch/arm/plat-mxc/ulpi.c +0 -0
arch/arm/plat-mxc/Kconfig deleted +0 -81
81 lines not on this page · raw message
arch/arm/plat-mxc/Makefile deleted +0 -20
@@ -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
Signature · 1 line
1.7.9.5
PATCH 6/34 ARM: imx: merge plat-mxc into mach-imx
Quoted 8 lines · Shawn Guo
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
KconfigsymbolCONFIG_ARCH_MXCfor mach-imx sub-architecture.Signed-off-by Shawn Guo <[email protected]>
Will amend the following change into the patch.
Shawn
MAINTAINERS +0 -1
@@ -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/
PATCH 7/34 ARM: imx: include common.h rather than mach/common.h
In reply to Shawn GuoRename 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.
---
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%)arch/arm/mach-imx/avic.c +1 -1
@@ -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 */
arch/arm/mach-imx/clk-imx1.c +2 -1
@@ -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)))
arch/arm/mach-imx/clk-imx21.c +2 -1
@@ -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)))
arch/arm/mach-imx/clk-imx25.c +2 -1
@@ -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)
arch/arm/mach-imx/clk-imx27.c +2 -1
@@ -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)))
arch/arm/mach-imx/clk-imx31.c +1 -1
@@ -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" , };
arch/arm/mach-imx/clk-imx35.c +1 -1
@@ -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;
arch/arm/mach-imx/clk-imx51-imx53.c +1 -1
@@ -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" , };
arch/arm/mach-imx/clk-imx6q.c +2 -1
@@ -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
arch/arm/mach-imx/clk-pllv1.c +1 -1
@@ -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
arch/arm/mach-imx/common.h renamed from arch/arm/mach-imx/include/mach/common.h +0 -0
arch/arm/mach-imx/cpu-imx31.c +2 -1
@@ -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 ;
arch/arm/mach-imx/devices/devices.c +0 -1
@@ -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" ,
arch/arm/mach-imx/epit.c +2 -1
@@ -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 ;
arch/arm/mach-imx/eukrea_mbimx27-baseboard.c +1 -1
@@ -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"
arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c +1 -1
@@ -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"
arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c +1 -1
@@ -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"
arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c +1 -1
@@ -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"
arch/arm/mach-imx/hotplug.c +2 -1
@@ -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 ) {
arch/arm/mach-imx/imx27-dt.c +2 -1
@@ -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 ),
arch/arm/mach-imx/imx31-dt.c +2 -1
@@ -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 ),
arch/arm/mach-imx/imx51-dt.c +2 -1
@@ -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
arch/arm/mach-imx/mach-apf9328.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-armadillo5x0.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-bug.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-cpuimx27.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-cpuimx35.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-cpuimx51sd.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-eukrea_cpuimx25.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-imx27_visstrim_m10.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-imx27ipcam.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-imx27lite.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-imx53.c +2 -1
@@ -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
arch/arm/mach-imx/mach-imx6q.c +1 -1
@@ -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) {
arch/arm/mach-imx/mach-kzm_arm11_01.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-mx1ads.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-mx21ads.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-mx25_3ds.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-mx27_3ds.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-mx27ads.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-mx31_3ds.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-mx31ads.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-mx31lilly.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-mx31lite.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-mx31moboard.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-mx35_3ds.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-mx50_rdp.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-mx51_3ds.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-mx51_babbage.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-mxt_td60.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-pca100.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-pcm037.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-pcm037_eet.c +1 -2
@@ -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"
arch/arm/mach-imx/mach-pcm038.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-pcm043.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-qong.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-scb9328.c +1 -1
@@ -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"
arch/arm/mach-imx/mach-vpr200.c +1 -1
@@ -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"
arch/arm/mach-imx/mm-imx1.c +1 -1
@@ -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 = {
arch/arm/mach-imx/mm-imx21.c +1 -1
@@ -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"
arch/arm/mach-imx/mm-imx25.c +1 -1
@@ -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"
arch/arm/mach-imx/mm-imx27.c +1 -1
@@ -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"
arch/arm/mach-imx/mm-imx3.c +1 -1
@@ -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"
arch/arm/mach-imx/mm-imx5.c +1 -1
@@ -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"
arch/arm/mach-imx/mx31lilly-db.c +1 -1
@@ -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"
arch/arm/mach-imx/mx31lite-db.c +1 -1
@@ -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"
arch/arm/mach-imx/mx31moboard-devboard.c +1 -1
@@ -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"
arch/arm/mach-imx/mx31moboard-marxbot.c +1 -1
@@ -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"
arch/arm/mach-imx/mx31moboard-smartbot.c +1 -1
@@ -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"
arch/arm/mach-imx/pcm970-baseboard.c +1 -1
@@ -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"
arch/arm/mach-imx/platsmp.c +2 -1
@@ -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 = {
arch/arm/mach-imx/pm-imx3.c +2 -1
@@ -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"
arch/arm/mach-imx/pm-imx5.c +2 -1
@@ -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" /*
arch/arm/mach-imx/pm-imx6q.c +2 -1
@@ -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)
arch/arm/mach-imx/system.c +2 -1
@@ -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;/*
arch/arm/mach-imx/time.c +2 -1
@@ -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.
arch/arm/mach-imx/tzic.c +1 -1
@@ -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" /*
Signature · 1 line
1.7.9.5
PATCH 8/34 ARM: imx: ARM: imx: include cpuidle.h rather than mach/cpuidle.h
In reply to Shawn GuoRename mach-imx/include/mach/cpuidle.h to mach-imx/cpuidle.h, and update users to include cpuidle.h rather than mach/cpuidle.h.
---
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%)arch/arm/mach-imx/cpuidle.h renamed from arch/arm/mach-imx/include/mach/cpuidle.h +0 -0
arch/arm/mach-imx/mach-imx6q.c +1 -1
@@ -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) {
arch/arm/mach-imx/pm-imx5.c +1 -1
@@ -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" /*
Signature · 1 line
1.7.9.5
PATCH 9/34 ARM: imx: include iim.h rather than mach/iim.h
In reply to Shawn GuoRename mach-imx/include/mach/iim.h to mach-imx/iim.h, and update users to include iim.h rather than mach/iim.h.
---
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%)arch/arm/mach-imx/cpu-imx25.c +2 -1
@@ -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 ;
arch/arm/mach-imx/cpu-imx31.c +1 -1
@@ -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 ;
arch/arm/mach-imx/cpu-imx35.c +2 -1
@@ -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 ;
arch/arm/mach-imx/iim.h renamed from arch/arm/mach-imx/include/mach/iim.h +0 -0
Signature · 1 line
1.7.9.5
PATCH 10/34 ARM: imx: include iram.h rather than mach/iram.h
In reply to Shawn GuoRename mach-imx/include/mach/iram.h to mach-imx/iram.h, and update users to include iram.h rather than mach/iram.h.
---
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%)arch/arm/mach-imx/iram.h renamed from arch/arm/mach-imx/include/mach/iram.h +0 -0
arch/arm/mach-imx/iram_alloc.c +2 -1
@@ -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;
Signature · 1 line
1.7.9.5
PATCH 11/34 ARM: imx: include ulpi.h rather than mach/ulpi.h
In reply to Shawn GuoRename mach-imx/include/mach/ulpi.h to mach-imx/ulpi.h, and update users to include ulpi.h rather than mach/ulpi.h.
---
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%)arch/arm/mach-imx/mach-armadillo5x0.c +1 -2
@@ -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 */
arch/arm/mach-imx/mach-cpuimx27.c +1 -1
@@ -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 */
arch/arm/mach-imx/mach-mx27_3ds.c +1 -1
@@ -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)
arch/arm/mach-imx/mach-mx31_3ds.c +1 -1
@@ -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 */
arch/arm/mach-imx/mach-mx31lilly.c +1 -1
@@ -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.
arch/arm/mach-imx/mach-mx31lite.c +1 -1
@@ -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.
arch/arm/mach-imx/mach-mx31moboard.c +1 -1
@@ -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 */
arch/arm/mach-imx/mach-pca100.c +1 -1
@@ -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)
arch/arm/mach-imx/mach-pcm037.c +1 -1
@@ -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 ;
arch/arm/mach-imx/mach-pcm038.c +1 -1
@@ -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 */
arch/arm/mach-imx/mach-pcm043.c +1 -1
@@ -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[] = { {
arch/arm/mach-imx/mx31moboard-devboard.c +1 -1
@@ -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 */
arch/arm/mach-imx/mx31moboard-marxbot.c +1 -1
@@ -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 */
arch/arm/mach-imx/mx31moboard-smartbot.c +1 -1
@@ -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 */
arch/arm/mach-imx/ulpi.c +1 -1
@@ -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 */
arch/arm/mach-imx/ulpi.h renamed from arch/arm/mach-imx/include/mach/ulpi.h +0 -0
Signature · 1 line
1.7.9.5
PATCH 12/34 media: mx1_camera: remove the driver
In reply to Shawn GuoThe 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
--- 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
arch/arm/mach-imx/Makefile +0 -3
@@ -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
arch/arm/mach-imx/clk-imx1.c +0 -1
@@ -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" );
arch/arm/mach-imx/devices/Kconfig +0 -3
@@ -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
arch/arm/mach-imx/devices/Makefile +0 -1
@@ -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
arch/arm/mach-imx/devices/devices-common.h +0 -10
@@ -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;
arch/arm/mach-imx/devices/platform-mx1-camera.c deleted +0 -42
42 lines not on this page · raw message
arch/arm/mach-imx/mx1-camera-fiq-ksym.c deleted +0 -18
@@ -1,18 +0,0 @@ -/* -* Exported ksyms of ARCH_MX1 -* -* Copyright (C) 2008, Darius Augulis <[email protected]> -* -* 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);
arch/arm/mach-imx/mx1-camera-fiq.S deleted +0 -35
@@ -1,35 +0,0 @@ -/* - * Copyright (C) 2008 Paulius Zaleckas <[email protected]> - * - * 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:
drivers/media/video/Kconfig +0 -12
@@ -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
drivers/media/video/Makefile +0 -1
@@ -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
drivers/media/video/mx1_camera.c deleted +0 -889
889 lines not on this page · raw message
include/linux/platform_data/camera-mx1.h deleted +0 -35
@@ -1,35 +0,0 @@ -/* -* mx1_camera.h - i.MX1/i.MXL camera driver header file -* -* Copyright (c) 2008, Paulius Zaleckas <[email protected]> -* Copyright (C) 2009, Darius Augulis <[email protected]> -* -* Based on PXA camera.h file: -* Copyright (C) 2003, Intel Corporation -* Copyright (C) 2008, Guennadi Liakhovetski <[email protected]> -* -* 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_ */
Signature · 1 line
1.7.9.5
PATCH 12/34 media: mx1_camera: remove the driver
Quoted 13 lines · Shawn Guo
The
mx1_cameradriver has been broken for a few release cycles since commit 6bd0812 (dmaengine: imx-dma: merge olddma-v1.cwithimx-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 fromdrivers/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 directoryIt 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.
Quoted 6 lines
[1] https://lkml.org/lkml/2012/2/9/171
Signed-off-by Shawn Guo <[email protected]>Cc Paulius Zaleckas <[email protected]>Cc Guennadi Liakhovetski <[email protected]>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
Quoted 1,180 lines
--- 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.harch/arm/mach-imx/Makefile +0
-3@@ -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.oarch/arm/mach-imx/clk-imx1.c +0
-1@@ -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" );arch/arm/mach-imx/devices/Kconfig +0
-3@@ -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 boolarch/arm/mach-imx/devices/Makefile +0
-1@@ -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.oarch/arm/mach-imx/devices/devices-common.h +0
-10@@ -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;arch/arm/mach-imx/devices/platform-mx1-camera.c deleted +0
-42@@ -1,42 +0,0 @@ -/* -* Copyright (C) 2010 Pengutronix -* Uwe Kleine-Koenig <[email protected]> -* -* 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 )); -}arch/arm/mach-imx/mx1-camera-fiq-ksym.c deleted +0
-18@@ -1,18 +0,0 @@ -/* -* Exported ksyms of ARCH_MX1 -* -* Copyright (C) 2008, Darius Augulis <[email protected]> -* -* 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);arch/arm/mach-imx/mx1-camera-fiq.S deleted +0
-35@@ -1,35 +0,0 @@ -/* - * Copyright (C) 2008 Paulius Zaleckas <[email protected]> - * - * 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:drivers/media/video/Kconfig +0
-12@@ -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 booldrivers/media/video/Makefile +0
-1@@ -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.odrivers/media/video/mx1_camera.c deleted +0
-889@@ -1,889 +0,0 @@ -/* -* V4L2 Driver for i.MXL/i.MXL camera (CSI) host -* -* Copyright (C) 2008, Paulius Zaleckas <[email protected]> -* Copyright (C) 2009, Darius Augulis <[email protected]> -* -* Based on PXA SoC camera driver -* Copyright (C) 2006, Sascha Hauer, Pengutronix -* Copyright (C) 2008, Guennadi Liakhovetski <[email protected]> -* -* 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 <[email protected]>" ); -MODULE_LICENSE ("GPL v2" ); -MODULE_VERSION (DRIVER_VERSION ); -MODULE_ALIAS ("platform:" DRIVER_NAME );include/linux/platform_data/camera-mx1.h deleted +0
-35@@ -1,35 +0,0 @@ -/* -* mx1_camera.h - i.MX1/i.MXL camera driver header file -* -* Copyright (c) 2008, Paulius Zaleckas <[email protected]> -* Copyright (C) 2009, Darius Augulis <[email protected]> -* -* Based on PXA camera.h file: -* Copyright (C) 2003, Intel Corporation -* Copyright (C) 2008, Guennadi Liakhovetski <[email protected]> -* -* 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_ */ Signature · 1 line
1.7.9.5
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
PATCH 12/34 media: mx1_camera: remove the driver
Quoted 6 lines · Guennadi Liakhovetski
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
PATCH 12/34 media: mx1_camera: remove the driver
Quoted 8 lines · Shawn Guo
Quoted 6 lines · Guennadi Liakhovetski
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.
Quoted 5 lines
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
PATCH 12/34 media: mx1_camera: remove the driver
Quoted 15 lines · Arnd Bergmann
Quoted 8 lines · Shawn Guo
Quoted 6 lines · Guennadi Liakhovetski
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.
Quoted 5 lines
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.
Quoted 8 lines
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
PATCH 13/34 ARM: imx: remove mach/dma-mx1-mx2.h
In reply to Shawn GuoThe header mach/dma-mx1-mx2.h is used nowhere. Remove it.
--- 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
arch/arm/mach-imx/include/mach/dma-mx1-mx2.h deleted +0 -10
@@ -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__ */
Signature · 1 line
1.7.9.5
PATCH 14/34 dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h
In reply to Shawn GuoThe 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/.
--- 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%)
drivers/dma/ipu/ipu_idmac.c +1 -2
@@ -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"
drivers/dma/ipu/ipu_irq.c +1 -2
@@ -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"
drivers/media/video/mx3_camera.c +1 -1
@@ -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>
drivers/video/mx3fb.c +1 -1
@@ -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>
include/linux/dma/ipu-dma.h renamed from arch/arm/mach-imx/include/mach/ipu.h +3 -3
@@ -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 */
Signature · 1 line
1.7.9.5
PATCH 14/34 dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h
Quoted 9 lines · Shawn Guo
The header
ipu.hreally belongs to dma subsystem rather than imx platform. Rename it toipu-dma.hand put it intoinclude/linux/dma/.Signed-off-by Shawn Guo <[email protected]>Cc Vinod Koul <[email protected]>Cc Guennadi Liakhovetski <[email protected]>Cc Florian Tobias Schandinat <[email protected]>Cc linux-media at vger.kernel.orgCc linux-fbdev at vger.kernel.org
Thanks
Guennadi
Quoted 100 lines
--- 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%)drivers/dma/ipu/ipu_idmac.c +1
-2@@ -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" drivers/dma/ipu/ipu_irq.c +1
-2@@ -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" drivers/media/video/mx3_camera.c +1
-1@@ -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> drivers/video/mx3fb.c +1
-1@@ -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> include/linux/dma/ipu-dma.h renamed from arch/arm/mach-imx/include/mach/ipu.h +3
-3@@ -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 */ Signature · 1 line
1.7.9.5
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
PATCH 14/34 dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h
Em 17-09-2012 06:26, Guennadi Liakhovetski escreveu:
Quoted 5 lines · Shawn Guo
Quoted 4 lines
The header
ipu.hreally belongs to dma subsystem rather than imx platform. Rename it toipu-dma.hand put it intoinclude/linux/dma/.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Shawn Guo <[email protected]>Cc Vinod Koul <[email protected]>Cc Guennadi Liakhovetski <[email protected]>Cc Florian Tobias Schandinat <[email protected]>Cc linux-media at vger.kernel.orgCc linux-fbdev at vger.kernel.org
Quoted 114 lines
Thanks
GuennadiQuoted 100 lines
--- 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%)drivers/dma/ipu/ipu_idmac.c +1
-2@@ -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" drivers/dma/ipu/ipu_irq.c +1
-2@@ -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" drivers/media/video/mx3_camera.c +1
-1@@ -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> drivers/video/mx3fb.c +1
-1@@ -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> include/linux/dma/ipu-dma.h renamed from arch/arm/mach-imx/include/mach/ipu.h +3
-3@@ -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 */ Signature · 1 line
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
PATCH 15/34 dma: imx-sdma: remove unneeded mach/hardware.h inclusion
In reply to Shawn GuoThe inclusion of mach/hardware.h is not used in imx-sdma driver at all. Remove it.
--- drivers/dma/imx-sdma.c | 1 - 1 file changed, 1 deletion(-)
drivers/dma/imx-sdma.c +0 -1
@@ -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"
Signature · 1 line
1.7.9.5
PATCH 16/34 ASoC: imx-ssi: remove unneeded mach/hardware.h inclusion
In reply to Shawn GuoThe inclusion of mach/hardware.h is not used by the driver at all. Remove it.
--- sound/soc/fsl/imx-ssi.c | 1 - 1 file changed, 1 deletion(-)
sound/soc/fsl/imx-ssi.c +0 -1
@@ -48,7 +48,6 @@#include <sound/soc.h> #include <linux/platform_data/asoc-imx-ssi.h> -#include <mach/hardware.h> #include "imx-ssi.h"
Signature · 1 line
1.7.9.5
Re: [PATCH 16/34] ASoC: imx-ssi: remove unneeded mach/hardware.h inclusion
Quoted 2 lines · Shawn Guo
#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.
Re: [PATCH 16/34] ASoC: imx-ssi: remove unneeded mach/hardware.h inclusion
Quoted 10 lines · Mark Brown
Quoted 2 lines · Shawn Guo
#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
Re: [PATCH 16/34] ASoC: imx-ssi: remove unneeded mach/hardware.h inclusion
Quoted 6 lines · Arnd Bergmann
Quoted 4 lines · Mark Brown
Quoted 2 lines · Shawn Guo
#include <
linux/platform_data/asoc-imx-ssi.h>
-#include <mach/hardware.h>
Quoted 7 lines
Quoted 4 lines
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?
Re: [PATCH 16/34] ASoC: imx-ssi: remove unneeded mach/hardware.h inclusion
Quoted 12 lines · Mark Brown
Quoted 10 lines · Arnd Bergmann
Quoted 9 lines · Mark Brown
Quoted 2 lines · Shawn Guo
#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.
Quoted 4 lines
Quoted 2 lines
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
Re: [PATCH 16/34] ASoC: imx-ssi: remove unneeded mach/hardware.h inclusion
Quoted 7 lines · Arnd Bergmann
Quoted 1 line · Mark Brown
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.htolinux/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.
PATCH 17/34 usb: ehci-mxc: remove unneeded mach/hardware.h inclusion
In reply to Shawn GuoThe inclusion of mach/hardware.h is not used by the driver at all. Remove it.
--- drivers/usb/host/ehci-mxc.c | 1 - 1 file changed, 1 deletion(-)
drivers/usb/host/ehci-mxc.c +0 -1
@@ -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>
Signature · 1 line
1.7.9.5
Greg Kroah-Hartman
maintainerPATCH 17/34 usb: ehci-mxc: remove unneeded mach/hardware.h inclusion
Quoted 6 lines · Shawn Guo
The inclusion of
mach/hardware.his not used by the driver at all. Remove it.Signed-off-by Shawn Guo <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc linux-usb at vger.kernel.org
PATCH 18/34 video: mx3fb: remove unneeded mach/hardware.h inclusion
In reply to Shawn GuoThe inclusion of mach/hardware.h is not used by the driver at all. Remove it.
--- drivers/video/mx3fb.c | 1 - 1 file changed, 1 deletion(-)
drivers/video/mx3fb.c +0 -1
@@ -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>
Signature · 1 line
1.7.9.5
PATCH 19/34 watchdog: imx2_wdt: remove unneeded mach/hardware.h inclusion
In reply to Shawn GuoThe inclusion of mach/hardware.h is not used by the driver at all. Remove it.
--- drivers/watchdog/imx2_wdt.c | 1 - 1 file changed, 1 deletion(-)
drivers/watchdog/imx2_wdt.c +0 -1
@@ -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"
Signature · 1 line
1.7.9.5
PATCH 20/34 i2c: imx: remove mach/hardware.h inclusion
In reply to Shawn GuoThis 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.
--- .../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(-)
Documentation/devicetree/bindings/i2c/fsl-imx-i2c.txt +2 -2
@@ -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>;
arch/arm/boot/dts/imx27.dtsi +2 -2
@@ -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";
arch/arm/boot/dts/imx51.dtsi +2 -2
@@ -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";
arch/arm/boot/dts/imx53.dtsi +3 -3
@@ -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";
arch/arm/boot/dts/imx6q.dtsi +3 -3
@@ -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>;
arch/arm/mach-imx/clk-imx1.c +1 -1
@@ -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" );
arch/arm/mach-imx/clk-imx21.c +1 -1
@@ -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 );
arch/arm/mach-imx/clk-imx25.c +3 -3
@@ -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" );
arch/arm/mach-imx/clk-imx27.c +2 -2
@@ -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" );
arch/arm/mach-imx/clk-imx31.c +3 -3
@@ -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" );
arch/arm/mach-imx/clk-imx35.c +3 -3
@@ -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" );
arch/arm/mach-imx/clk-imx51-imx53.c +4 -4
@@ -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" );
arch/arm/mach-imx/devices/devices-common.h +1 -0
@@ -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;
arch/arm/mach-imx/devices/platform-imx-i2c.c +14 -13
@@ -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)); }
arch/arm/mach-imx/imx27-dt.c +2 -2
@@ -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),
arch/arm/mach-imx/imx51-dt.c +2 -2
@@ -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 */ }
arch/arm/mach-imx/mach-imx53.c +3 -3
@@ -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 */ }
drivers/i2c/busses/i2c-imx.c +35 -5
@@ -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 )
Signature · 1 line
1.7.9.5
PATCH 21/34 mtd: mxc_nand: remove mach/hardware.h inclusion
In reply to Shawn GuoIt 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.
--- 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(-)
arch/arm/mach-imx/clk-imx21.c +1 -1
@@ -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" );
arch/arm/mach-imx/clk-imx25.c +1 -1
@@ -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" );
arch/arm/mach-imx/clk-imx27.c +1 -1
@@ -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" );
arch/arm/mach-imx/clk-imx31.c +1 -1
@@ -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" );
arch/arm/mach-imx/clk-imx35.c +1 -1
@@ -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]);
arch/arm/mach-imx/clk-imx51-imx53.c +1 -1
@@ -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" );
arch/arm/mach-imx/devices/devices-common.h +1 -0
@@ -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
arch/arm/mach-imx/devices/platform-mxc_nand.c +11 -9
@@ -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));
arch/arm/mach-imx/imx27-dt.c +1 -1
@@ -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 */ } };
drivers/mtd/nand/mxc_nand.c +52 -34
131 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 22/34 rtc: mxc_rtc: remove mach/hardware.h inclusion
In reply to Shawn GuoIt 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.
--- 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(-)
arch/arm/mach-imx/clk-imx1.c +1 -1
@@ -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 );
arch/arm/mach-imx/clk-imx27.c +1 -1
@@ -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 );
arch/arm/mach-imx/clk-imx31.c +1 -1
@@ -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" );
arch/arm/mach-imx/devices/devices-common.h +1 -0
@@ -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; };
arch/arm/mach-imx/devices/platform-mxc_rtc.c +5 -4
@@ -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 ); }
drivers/rtc/rtc-mxc.c +31 -3
@@ -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), };
Signature · 1 line
1.7.9.5
PATCH 23/34 dma: imx-dma: use devm_kzalloc and devm_request_irq
In reply to Shawn GuoUse managed functions devm_kzalloc and devm_request_irq instead to make the error patch simpler.
--- drivers/dma/imx-dma.c | 54 ++++++++++++++----------------------------------- 1 file changed, 15 insertions(+), 39 deletions(-)
drivers/dma/imx-dma.c +15 -39
@@ -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 ; }
Signature · 1 line
1.7.9.5
PATCH 24/34 dma: imx-dma: retrieve MEM and IRQ from resources
In reply to Shawn GuoRetrieve MEM and IRQ from resources rather than directly using the value by including machine header.
--- 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(-)
arch/arm/mach-imx/devices/devices-common.h +2 -1
@@ -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);
arch/arm/mach-imx/devices/platform-imx-dma.c +19 -2
@@ -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,
arch/arm/mach-imx/mm-imx1.c +2 -0
@@ -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 (); }
arch/arm/mach-imx/mm-imx21.c +1 -1
@@ -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)); }
arch/arm/mach-imx/mm-imx27.c +1 -1
@@ -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));
drivers/dma/imx-dma.c +20 -15
@@ -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);
Signature · 1 line
1.7.9.5
PATCH 25/34 dma: imx-dma: remove mach/hardware.h inclusion
In reply to Shawn GuoIt 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.
--- 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(-)
arch/arm/mach-imx/devices/devices-common.h +1 -1
@@ -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);
arch/arm/mach-imx/devices/platform-imx-dma.c +2 -2
@@ -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,
arch/arm/mach-imx/mm-imx1.c +2 -1
@@ -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 (); }
arch/arm/mach-imx/mm-imx21.c +2 -1
@@ -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)); }
arch/arm/mach-imx/mm-imx27.c +2 -1
@@ -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));
drivers/dma/imx-dma.c +48 -6
116 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Sascha Hauer
maintainerPATCH 25/34 dma: imx-dma: remove mach/hardware.h inclusion
Quoted 5 lines · Shawn Guo
It changes the driver to use
platform_device_idrather thancpu_is_xxxto determine the controller type, and updates the platform code accordingly.As the result,
mach/hardware.hinclusion 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<---------------------------------------------------------
Quoted 1 line
From
3094908fcbb4532056034539ea57042cd60abf47Mon Sep 17 00:00:00 2001
From: Sascha Hauer <[email protected]>
Date: Mon, 17 Sep 2012 09:39:30 +0200
Subject: [PATCH] ARM i.MX DMA: Fixup clock lookups after platform_device_id conversion
--- 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(-)
arch/arm/mach-imx/clk-imx1.c +2 -1
@@ -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" );
arch/arm/mach-imx/clk-imx21.c +2 -2
@@ -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" );
arch/arm/mach-imx/clk-imx27.c +2 -2
@@ -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" );
include/linux/platform_data/dma-imx.h +3 -1
@@ -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
Signature · 7 lines
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 |
PATCH 25/34 dma: imx-dma: remove mach/hardware.h inclusion
Quoted 4 lines · Sascha Hauer
I know the important thing for you is to get rid of the
mach/hardware.hinclusion, but I think the subject for this patch should rather be that you switch toplatform_device_idfor this driver.
Ok, I will update the subject for the patch and the similar ones.
Quoted 3 lines
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
PATCH 25/34 dma: imx-dma: remove mach/hardware.h inclusion
In reply to Sascha HauerQuoted 18 lines · Sascha Hauer
From
3094908fcbb4532056034539ea57042cd60abf47Mon Sep 17 00:00:00 2001
From: Sascha Hauer <[email protected]>
Date: Mon, 17 Sep 2012 09:39:30 +0200
Subject: [PATCH] ARM i.MX DMA: Fixup clock lookups afterplatform_device_idconversionSigned-off-by Sascha Hauer <[email protected]>--- 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(-)arch/arm/mach-imx/clk-imx1.c +0
-0
arch/arm/mach-imx/clk-imx1.c int __init mx1_clocks_init(unsigned long fref) · line 86
Quoted 6 lines
arch/arm/mach-imx/clk-imx1.c +2
-1@@ -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
Quoted 3 lines
arch/arm/mach-imx/clk-imx1.c +0
-0clk_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" );
PATCH 26/34 media: mx2_camera: remove dead code in mx2_camera_add_device
In reply to Shawn GuoThis 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.
--- drivers/media/video/mx2_camera.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/media/video/mx2_camera.c +1 -3
@@ -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 );
Signature · 1 line
1.7.9.5
PATCH 26/34 media: mx2_camera: remove dead code in mx2_camera_add_device
Hi Shawn
Thanks for the clean up. Would you like these patches to go via a single tree, presumably, arm-soc? In this case
Quoted 8 lines · Shawn Guo
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 <[email protected]>Cc Guennadi Liakhovetski <[email protected]>Cc linux-media at vger.kernel.org
Thanks
Guennadi
Quoted 24 lines
--- drivers/media/video/mx2_camera.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/media/video/mx2_camera.c +1
-3@@ -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 );Signature · 1 line
1.7.9.5
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
PATCH 26/34 media: mx2_camera: remove dead code in mx2_camera_add_device
Quoted 16 lines · Guennadi Liakhovetski
Hi Shawn
Thanks for the clean up. Would you like these patches to go via a single tree, presumably, arm-soc? In this case
Quoted 8 lines · Shawn Guo
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 <[email protected]>Cc Guennadi Liakhovetski <[email protected]>Cc linux-media at vger.kernel.org
Quoted 38 lines
Thanks
GuennadiQuoted 22 lines
--- drivers/media/video/mx2_camera.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/media/video/mx2_camera.c +1
-4@@ -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 ); --Quoted 2 lines
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
Signature · 7 lines
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
PATCH 26/34 media: mx2_camera: remove dead code in mx2_camera_add_device
In reply to Guennadi LiakhovetskiQuoted 5 lines · Guennadi Liakhovetski
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.
Quoted 7 lines · Shawn Guo
Quoted 6 lines
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.
Quoted 6 lines
Quoted 3 lines
Signed-off-by Shawn Guo <[email protected]>Cc Guennadi Liakhovetski <[email protected]>
Thanks, Guennadi.
Signature · 2 lines
Regards, Shawn
PATCH 27/34 media: mx2_camera: use managed functions to clean up code
In reply to Shawn GuoUse 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.
--- drivers/media/video/mx2_camera.c | 143 +++++++++++--------------------------- 1 file changed, 39 insertions(+), 104 deletions(-)
drivers/media/video/mx2_camera.c +39 -104
@@ -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 ;
Signature · 1 line
1.7.9.5
PATCH 27/34 media: mx2_camera: use managed functions to clean up code
Quoted 7 lines · Shawn Guo
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 structmx2_camera_dev.Signed-off-by Shawn Guo <[email protected]>Cc Guennadi Liakhovetski <[email protected]>Cc linux-media at vger.kernel.org
(in case you want to push it via arm-soc)
Thanks
Guennadi
Quoted 283 lines
--- drivers/media/video/mx2_camera.c | 143 +++++++++++--------------------------- 1 file changed, 39 insertions(+), 104 deletions(-)drivers/media/video/mx2_camera.c +39
-104@@ -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 ;Signature · 1 line
1.7.9.5
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
PATCH 27/34 media: mx2_camera: use managed functions to clean up code
Hi,
Quoted 6 lines · Guennadi Liakhovetski
Quoted 4 lines · Shawn Guo
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 structmx2_camera_dev.
Quoted 7 lines
Quoted 3 lines
Signed-off-by Shawn Guo <[email protected]>Cc Guennadi Liakhovetski <[email protected]>Cc linux-media at vger.kernel.org(in case you want to push it via arm-soc)
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
Signature · 7 lines
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
PATCH 27/34 media: mx2_camera: use managed functions to clean up code
Quoted 2 lines · javier Martin
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;Quoted 58 lines
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: 40000033sp :
c3025e48ip : 00000000 fp : 00000000
r10:c03f236cr9 : 00000000 r8 : 00000001
r7 : 00000000 r6 :c317d414r5 :c30431a0r4 :c317d600r3 :656d6163r2 :c3025e18r1 :000c0000r0 :c317d600
Flags: nZcv IRQs on FIQs on ModeSVC_32ISA Thumb Segment kernel
Control:0005317fTable:a0004000DAC: 00000017
Process swapper (pid: 1, stack limit =0xc3024270)Stack: (0xc3025e48 to 0xc3026000)5e40:
c300646000000000c319296000000043c317d638c005d624
5e60: 00000043c317d410c317d478c317d414c02012f0c317d41000000000 00000043 5e80:c31a9800c31a982000000000c022ca74c300ab2000000000c306e4a8c306e4a05ea0:c30000c040000013000080d0c317d410c317d410c306e4a8c306e4a000000001 5ec0: 00000000c03f236c00000000c02c8d5000000000c03535eec317d410c02c8a445ee0:c306e4a8c306e4a8c03fc478c03fc47800000050c03e0774c03dc684c0189d305f00:c306e4a8c0188c3cc306e4a8c306e4dcc03fc47800000000 00000050c0188db85f20:c03fc478c3025f30c0188d58c0187610c300760cc3079ad0c03fc478c03fc4785f40:c318e680c03f645800000000c0187d24c03535eec03535eec3025f58c03fc4785f60: 00000001c04049c000000000c01892c8c03fc46400000001c04049c000000000 5f80: 00000050c018a05cc03dc67cc03d4e84c04049c0c00087c800000006 00000006 5fa0:c03eeca0c03dc67c00000007c03dc67c00000007c04049c0c03c41a400000050 5fc0:c03e0774c03c42f400000006 00000006c03c41a400000000 00000000c03c42145fe0:c001490000000013 00000000 00000000 00000000c0014900ffffffff 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
PATCH 27/34 media: mx2_camera: use managed functions to clean up code
Hi Shawn,
Quoted 11 lines · Shawn Guo
Quoted 2 lines · javier Martin
This patch breaks the driver:
Javier,
Can you please apply the following change to see if it fixes the problem?
Shawn
Review static int __devinit mx2_camera_probe(struct platform_device *pdev) · line 1790
Quoted 8 lines
(quoted diff) +2
-0@@ -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:
Regards.
Signature · 7 lines
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
PATCH 28/34 media: mx2_camera: remove mach/hardware.h inclusion
In reply to Shawn GuoIt 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.
--- 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(-)
arch/arm/mach-imx/clk-imx25.c +3 -3
@@ -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" );
arch/arm/mach-imx/clk-imx27.c +3 -3
@@ -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 );
arch/arm/mach-imx/devices/devices-common.h +1 -0
@@ -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;
arch/arm/mach-imx/devices/platform-mx2-camera.c +7 -5
@@ -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 )); }
drivers/media/video/mx2_camera.c +71 -24
250 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 28/34 media: mx2_camera: remove mach/hardware.h inclusion
Quoted 9 lines · Shawn Guo
It changes the driver to use
platform_device_idrather thancpu_is_xxxto determine the controller type, and updates the platform code accordingly.As the result,
mach/hardware.hinclusion gets removed from the driver.Signed-off-by Shawn Guo <[email protected]>Cc Guennadi Liakhovetski <[email protected]>Cc linux-media at vger.kernel.org
Thanks
Guennadi
Quoted 388 lines
--- 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(-)arch/arm/mach-imx/clk-imx25.c +3
-3@@ -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" );arch/arm/mach-imx/clk-imx27.c +3
-3@@ -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 );arch/arm/mach-imx/devices/devices-common.h +1
-0@@ -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;arch/arm/mach-imx/devices/platform-mx2-camera.c +7
-5@@ -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 )); }drivers/media/video/mx2_camera.c +71
-24@@ -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), };Signature · 1 line
1.7.9.5
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
PATCH 28/34 media: mx2_camera: remove mach/hardware.h inclusion
Hi Shawn,
Quoted 6 lines · Guennadi Liakhovetski
Quoted 4 lines · Shawn Guo
It changes the driver to use
platform_device_idrather thancpu_is_xxxto determine the controller type, and updates the platform code accordingly.
Quoted 7 lines
Quoted 5 lines
As the result,
mach/hardware.hinclusion gets removed from the driver.Signed-off-by Shawn Guo <[email protected]>Cc Guennadi Liakhovetski <[email protected]>Cc linux-media at vger.kernel.org
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.
Quoted 388 lines
Thanks
GuennadiQuoted 385 lines
--- 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(-)arch/arm/mach-imx/clk-imx25.c +3
-3@@ -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" );arch/arm/mach-imx/clk-imx27.c +3
-3@@ -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 );arch/arm/mach-imx/devices/devices-common.h +1
-0@@ -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;arch/arm/mach-imx/devices/platform-mx2-camera.c +7
-5@@ -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 )); }drivers/media/video/mx2_camera.c +71
-24@@ -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), };
Quoted 2 lines
Quoted 2 lines
--
1.7.9.5
I can't test this patch because it depends heavily on the previous one, which breaks the driver.
Regards.
Signature · 7 lines
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
PATCH 28/34 media: mx2_camera: remove mach/hardware.h inclusion
Quoted 11 lines · javier Martin
Hi Shawn,
Quoted 8 lines · Guennadi Liakhovetski
Quoted 6 lines · Shawn Guo
It changes the driver to use
platform_device_idrather thancpu_is_xxxto determine the controller type, and updates the platform code accordingly.As the result,
mach/hardware.hinclusion gets removed from the driver.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Signed-off-by Shawn Guo <[email protected]>Cc Guennadi Liakhovetski <[email protected]>Cc linux-media at vger.kernel.orgi.MX25 support is broken and is scheduled for removal.
It is not yet, I haven't pushed those your patches yet.
Thanks
Guennadi
Quoted 391 lines
I think we should not keep on trying to maintain it. Couldn't we just drop it? It only makes maintenance tasks more difficult.
Quoted 388 lines
Thanks
GuennadiQuoted 385 lines
--- 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(-)arch/arm/mach-imx/clk-imx25.c +3
-3@@ -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" );arch/arm/mach-imx/clk-imx27.c +3
-3@@ -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 );arch/arm/mach-imx/devices/devices-common.h +1
-0@@ -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;arch/arm/mach-imx/devices/platform-mx2-camera.c +7
-5@@ -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 )); }drivers/media/video/mx2_camera.c +71
-24@@ -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), };
Quoted 17 lines
Quoted 2 lines
Quoted 2 lines
--
1.7.9.5I can't test this patch because it depends heavily on the previous one, which breaks the driver.
Regards.
Signature · 7 lines
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/
PATCH 28/34 media: mx2_camera: remove mach/hardware.h inclusion
Quoted 11 lines · Guennadi Liakhovetski
Quoted 9 lines · javier Martin
Hi Shawn,
Quoted 6 lines · Guennadi Liakhovetski
Quoted 4 lines · Shawn Guo
It changes the driver to use
platform_device_idrather thancpu_is_xxxto determine the controller type, and updates the platform code accordingly.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
As the result,
mach/hardware.hinclusion gets removed from the driver.Signed-off-by Shawn Guo <[email protected]>Cc Guennadi Liakhovetski <[email protected]>Cc linux-media at vger.kernel.org
Quoted 426 lines
Quoted 3 lines
Quoted 1 line
i.MX25 support is broken and is scheduled for removal.
It is not yet, I haven't pushed those your patches yet.
Thanks
GuennadiQuoted 399 lines
I think we should not keep on trying to maintain it. Couldn't we just drop it? It only makes maintenance tasks more difficult.
Quoted 388 lines
Thanks
GuennadiQuoted 385 lines
--- 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(-)arch/arm/mach-imx/clk-imx25.c +3
-3@@ -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" );arch/arm/mach-imx/clk-imx27.c +3
-3@@ -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 );arch/arm/mach-imx/devices/devices-common.h +1
-0@@ -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;arch/arm/mach-imx/devices/platform-mx2-camera.c +7
-5@@ -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 )); }drivers/media/video/mx2_camera.c +71
-24@@ -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), };Quoted 2 lines
Quoted 2 lines
--
1.7.9.5I can't test this patch because it depends heavily on the previous one, which breaks the driver.
Regards.
Quoted 9 lines
--
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
Signature · 7 lines
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
PATCH 28/34 media: mx2_camera: remove mach/hardware.h inclusion
Em 18-09-2012 05:35, javier Martin escreveu:
Quoted 12 lines · Guennadi Liakhovetski
Quoted 11 lines · javier Martin
Quoted 10 lines
Hi Shawn,
Quoted 6 lines · Guennadi Liakhovetski
Quoted 4 lines · Shawn Guo
It changes the driver to use
platform_device_idrather thancpu_is_xxxto determine the controller type, and updates the platform code accordingly.
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
As the result,
mach/hardware.hinclusion gets removed from the driver.Signed-off-by Shawn Guo <[email protected]>Cc Guennadi Liakhovetski <[email protected]>Cc linux-media at vger.kernel.orgTested-by Javier Martin <[email protected]>
I'm understanding that this patch will flow through arm tree[1]. So:
[1] if you understand otherwise, I can apply it via my tree as well
Quoted 430 lines
Quoted 427 lines
Quoted 4 lines
Quoted 2 lines
i.MX25 support is broken and is scheduled for removal.
It is not yet, I haven't pushed those your patches yet.
Thanks
GuennadiQuoted 399 lines
I think we should not keep on trying to maintain it. Couldn't we just drop it? It only makes maintenance tasks more difficult.
Quoted 388 lines
Thanks
GuennadiQuoted 385 lines
--- 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(-)arch/arm/mach-imx/clk-imx25.c +3
-3@@ -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" );arch/arm/mach-imx/clk-imx27.c +3
-3@@ -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 );arch/arm/mach-imx/devices/devices-common.h +1
-0@@ -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;arch/arm/mach-imx/devices/platform-mx2-camera.c +7
-5@@ -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 )); }drivers/media/video/mx2_camera.c +71
-24@@ -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), };Quoted 2 lines
Quoted 2 lines
--
1.7.9.5I can't test this patch because it depends heavily on the previous one, which breaks the driver.
Regards.
Quoted 9 lines
--
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
PATCH 28/34 media: mx2_camera: remove mach/hardware.h inclusion
Quoted 1 line · Mauro Carvalho Chehab
I'm understanding that this patch will flow through arm tree[1]. So:
Yes, it will go through arm-soc tree for 3.8.
Quoted 2 lines
Thanks, Mauro.
Shawn
PATCH 29/34 mmc: mxcmmc: remove mach/hardware.h inclusion
In reply to Shawn GuoIt 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.
--- 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(-)
arch/arm/mach-imx/clk-imx27.c +6 -6
@@ -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" );
arch/arm/mach-imx/clk-imx31.c +2 -2
@@ -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 );
arch/arm/mach-imx/devices/devices-common.h +1 -0
@@ -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;
arch/arm/mach-imx/devices/platform-mxc-mmc.c +8 -7
@@ -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 )); }
arch/arm/mach-imx/mach-mx31_3ds.c +1 -1
@@ -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 = {
arch/arm/mach-imx/mach-mx31moboard.c +2 -2
@@ -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" , }, };
arch/arm/mach-imx/mach-pcm038.c +1 -1
@@ -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" , }, };
drivers/mmc/host/mxcmmc.c +29 -2
@@ -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 ,
Signature · 1 line
1.7.9.5
PATCH 29/34 mmc: mxcmmc: remove mach/hardware.h inclusion
Hi,
Quoted 9 lines · Shawn Guo
It changes the driver to use
platform_device_idrather thancpu_is_xxxto determine the controller type, and updates the platform code accordingly.As the result,
mach/hardware.hinclusion gets removed from the driver.
Thanks,
- Chris.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child
PATCH 29/34 mmc: mxcmmc: remove mach/hardware.h inclusion
Hi Shawn,
Quoted 13 lines · Chris Ball
Hi,
Quoted 9 lines · Shawn Guo
It changes the driver to use
platform_device_idrather thancpu_is_xxxto determine the controller type, and updates the platform code accordingly.As the result,
mach/hardware.hinclusion gets removed from the driver.Signed-off-by Shawn Guo <[email protected]>Cc Chris Ball <[email protected]>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:
Regards.
Signature · 7 lines
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
PATCH 30/34 video: imxfb: remove mach/hardware.h inclusion
In reply to Shawn GuoIt 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.
--- 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(-)
arch/arm/mach-imx/clk-imx1.c +3 -3
@@ -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" );
arch/arm/mach-imx/clk-imx21.c +3 -3
@@ -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" );
arch/arm/mach-imx/clk-imx25.c +3 -3
@@ -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" );
arch/arm/mach-imx/clk-imx27.c +3 -3
@@ -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" );
arch/arm/mach-imx/devices/devices-common.h +1 -0
@@ -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;
arch/arm/mach-imx/devices/platform-imx-fb.c +6 -5
@@ -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(
drivers/video/imxfb.c +32 -6
@@ -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 *infif (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 *infVCR_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 )
Signature · 1 line
1.7.9.5
PATCH 31/34 ARM: imx: move debug macros to include/debug
In reply to Shawn GuoMove 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.
---
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%)arch/arm/Kconfig.debug +8 -0
@@ -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
arch/arm/include/debug/imx.S renamed from arch/arm/mach-imx/include/mach/debug-macro.S +22 -11
@@ -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
Signature · 1 line
1.7.9.5