* [PATCH 00/34] i.MX multi-platform support
@ 2012-09-17 5:34 Shawn Guo
2012-09-17 5:34 ` [PATCH 12/34] media: mx1_camera: remove the driver Shawn Guo
` (6 more replies)
0 siblings, 7 replies; 30+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Sascha Hauer, Fabio Estevam, Rob Herring, Arnd Bergmann,
Shawn Guo, Mark Brown, alsa-devel, Florian Tobias Schandinat,
linux-fbdev, Chris Ball, linux-mmc, Guennadi Liakhovetski,
linux-media, Andrew Morton, rtc-linux, Artem Bityutskiy,
linux-mtd, Wolfram Sang, linux-i2c, Wim Van Sebroeck,
linux-watchdog, Greg Kroah-Hartman, linux-usb, Vinod Koul,
Javier Martin, Paulius Zaleckas
The series enables multi-platform support for imx. Since the required
frameworks (clk, pwm) and spare_irq have already been adopted on imx,
the series is all about cleaning up mach/* headers. Along with the
changes, arch/arm/plat-mxc gets merged into arch/arm/mach-imx.
It's based on a bunch of branches (works from others), Rob's initial
multi-platform series, Arnd's platform-data and smp_ops (Marc's) and
imx 3.7 material (Sascha and myself).
It's available on branch below.
git://git.linaro.org/people/shawnguo/linux-2.6.git imx/multi-platform
It's been tested on imx5 and imx6, and only compile-tested on imx2 and
imx3, so testing on imx2/3 are appreciated.
Subsystem maintainers,
I plan to send the whole series via arm-soc tree at the end of 3.7
merge window when all dependant bits hit mainline. Please have a
look at the patches you get copied and provide ACKs if the changes
are good. Thanks.
Shawn Guo (34):
ARM: imx: include board headers in the same folder
ASoC: mx27vis: retrieve gpio numbers from platform_data
ARM: imx: move iomux drivers and headers into mach-imx
ARM: imx: remove unnecessary inclusion from device-imx*.h
ARM: imx: move platform device code into mach-imx
ARM: imx: merge plat-mxc into mach-imx
ARM: imx: include common.h rather than mach/common.h
ARM: imx: ARM: imx: include cpuidle.h rather than mach/cpuidle.h
ARM: imx: include iim.h rather than mach/iim.h
ARM: imx: include iram.h rather than mach/iram.h
ARM: imx: include ulpi.h rather than mach/ulpi.h
media: mx1_camera: remove the driver
ARM: imx: remove mach/dma-mx1-mx2.h
dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h
dma: imx-sdma: remove unneeded mach/hardware.h inclusion
ASoC: imx-ssi: remove unneeded mach/hardware.h inclusion
usb: ehci-mxc: remove unneeded mach/hardware.h inclusion
video: mx3fb: remove unneeded mach/hardware.h inclusion
watchdog: imx2_wdt: remove unneeded mach/hardware.h inclusion
i2c: imx: remove mach/hardware.h inclusion
mtd: mxc_nand: remove mach/hardware.h inclusion
rtc: mxc_rtc: remove mach/hardware.h inclusion
dma: imx-dma: use devm_kzalloc and devm_request_irq
dma: imx-dma: retrieve MEM and IRQ from resources
dma: imx-dma: remove mach/hardware.h inclusion
media: mx2_camera: remove dead code in mx2_camera_add_device
media: mx2_camera: use managed functions to clean up code
media: mx2_camera: remove mach/hardware.h inclusion
mmc: mxcmmc: remove mach/hardware.h inclusion
video: imxfb: remove mach/hardware.h inclusion
ARM: imx: move debug macros to include/debug
ARM: imx: include hardware.h rather than mach/hardware.h
ARM: imx: remove header file mach/irqs.h
ARM: imx: enable multi-platform build
.../devicetree/bindings/i2c/fsl-imx-i2c.txt | 4 +-
arch/arm/Kconfig | 15 +-
arch/arm/Kconfig.debug | 8 +
arch/arm/Makefile | 1 -
arch/arm/boot/dts/imx27.dtsi | 4 +-
arch/arm/boot/dts/imx51.dtsi | 4 +-
arch/arm/boot/dts/imx53.dtsi | 6 +-
arch/arm/boot/dts/imx6q.dtsi | 6 +-
.../mach/debug-macro.S => include/debug/imx.S} | 33 +-
arch/arm/{plat-mxc => mach-imx}/3ds_debugboard.c | 2 +-
.../include/mach => mach-imx}/3ds_debugboard.h | 0
arch/arm/mach-imx/Kconfig | 86 ++
arch/arm/mach-imx/Makefile | 23 +-
arch/arm/{plat-mxc => mach-imx}/avic.c | 5 +-
.../include/mach => mach-imx}/board-mx31lilly.h | 0
.../include/mach => mach-imx}/board-mx31lite.h | 0
.../include/mach => mach-imx}/board-mx31moboard.h | 0
.../include/mach => mach-imx}/board-pcm038.h | 0
arch/arm/mach-imx/clk-imx1.c | 15 +-
arch/arm/mach-imx/clk-imx21.c | 14 +-
arch/arm/mach-imx/clk-imx25.c | 26 +-
arch/arm/mach-imx/clk-imx27.c | 36 +-
arch/arm/mach-imx/clk-imx31.c | 21 +-
arch/arm/mach-imx/clk-imx35.c | 13 +-
arch/arm/mach-imx/clk-imx51-imx53.c | 15 +-
arch/arm/mach-imx/clk-imx6q.c | 3 +-
arch/arm/mach-imx/clk-pllv1.c | 4 +-
.../{plat-mxc/include/mach => mach-imx}/common.h | 0
arch/arm/mach-imx/cpu-imx25.c | 5 +-
arch/arm/mach-imx/cpu-imx27.c | 2 +-
arch/arm/mach-imx/cpu-imx31.c | 7 +-
arch/arm/mach-imx/cpu-imx35.c | 5 +-
arch/arm/mach-imx/cpu-imx5.c | 3 +-
arch/arm/{plat-mxc => mach-imx}/cpu.c | 3 +-
arch/arm/mach-imx/cpu_op-mx51.c | 3 +-
arch/arm/{plat-mxc => mach-imx}/cpufreq.c | 3 +-
arch/arm/{plat-mxc => mach-imx}/cpuidle.c | 0
.../{plat-mxc/include/mach => mach-imx}/cpuidle.h | 0
arch/arm/mach-imx/devices-imx1.h | 3 +-
arch/arm/mach-imx/devices-imx21.h | 3 +-
arch/arm/mach-imx/devices-imx25.h | 3 +-
arch/arm/mach-imx/devices-imx27.h | 3 +-
arch/arm/mach-imx/devices-imx31.h | 3 +-
arch/arm/mach-imx/devices-imx35.h | 3 +-
arch/arm/mach-imx/devices-imx50.h | 3 +-
arch/arm/mach-imx/devices-imx51.h | 3 +-
arch/arm/{plat-mxc => mach-imx}/devices/Kconfig | 3 -
arch/arm/{plat-mxc => mach-imx}/devices/Makefile | 3 +-
.../mach => mach-imx/devices}/devices-common.h | 19 +-
arch/arm/{plat-mxc => mach-imx/devices}/devices.c | 1 -
.../devices/platform-ahci-imx.c | 5 +-
.../{plat-mxc => mach-imx}/devices/platform-fec.c | 5 +-
.../devices/platform-flexcan.c | 4 +-
.../devices/platform-fsl-usb2-udc.c | 5 +-
.../devices/platform-gpio-mxc.c | 2 +-
.../devices/platform-gpio_keys.c | 5 +-
.../devices/platform-imx-dma.c | 23 +-
.../devices/platform-imx-fb.c | 16 +-
.../devices/platform-imx-i2c.c | 31 +-
.../devices/platform-imx-keypad.c | 4 +-
.../devices/platform-imx-ssi.c | 4 +-
.../devices/platform-imx-uart.c | 4 +-
.../devices/platform-imx2-wdt.c | 5 +-
.../devices/platform-imx21-hcd.c | 4 +-
.../devices/platform-imx_udc.c | 4 +-
.../devices/platform-imxdi_rtc.c | 5 +-
.../devices/platform-ipu-core.c | 5 +-
.../devices/platform-mx2-camera.c | 16 +-
.../devices/platform-mxc-ehci.c | 5 +-
.../devices/platform-mxc-mmc.c | 20 +-
.../devices/platform-mxc_nand.c | 25 +-
.../devices/platform-mxc_pwm.c | 4 +-
.../devices/platform-mxc_rnga.c | 4 +-
.../devices/platform-mxc_rtc.c | 13 +-
.../devices/platform-mxc_w1.c | 4 +-
.../devices/platform-pata_imx.c | 4 +-
.../devices/platform-sdhci-esdhc-imx.c | 5 +-
.../devices/platform-spi_imx.c | 4 +-
arch/arm/mach-imx/ehci-imx25.c | 4 +-
arch/arm/mach-imx/ehci-imx27.c | 4 +-
arch/arm/mach-imx/ehci-imx31.c | 4 +-
arch/arm/mach-imx/ehci-imx35.c | 4 +-
arch/arm/mach-imx/ehci-imx5.c | 4 +-
arch/arm/{plat-mxc => mach-imx}/epit.c | 6 +-
.../include/mach => mach-imx}/eukrea-baseboards.h | 0
arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | 7 +-
arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c | 8 +-
arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c | 7 +-
arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c | 7 +-
.../{plat-mxc/include/mach => mach-imx}/hardware.h | 26 +-
arch/arm/mach-imx/hotplug.c | 3 +-
arch/arm/{plat-mxc/include/mach => mach-imx}/iim.h | 0
arch/arm/mach-imx/imx27-dt.c | 11 +-
arch/arm/mach-imx/imx31-dt.c | 5 +-
arch/arm/mach-imx/imx51-dt.c | 9 +-
arch/arm/mach-imx/include/mach/dma-mx1-mx2.h | 10 -
arch/arm/mach-imx/iomux-imx31.c | 5 +-
.../include/mach => mach-imx}/iomux-mx1.h | 2 +-
.../include/mach => mach-imx}/iomux-mx21.h | 4 +-
.../include/mach => mach-imx}/iomux-mx25.h | 2 +-
.../include/mach => mach-imx}/iomux-mx27.h | 4 +-
.../include/mach => mach-imx}/iomux-mx2x.h | 0
.../include/mach => mach-imx}/iomux-mx3.h | 0
.../include/mach => mach-imx}/iomux-mx35.h | 2 +-
.../include/mach => mach-imx}/iomux-mx50.h | 2 +-
.../include/mach => mach-imx}/iomux-mx51.h | 2 +-
arch/arm/{plat-mxc => mach-imx}/iomux-v1.c | 5 +-
.../{plat-mxc/include/mach => mach-imx}/iomux-v1.h | 0
arch/arm/{plat-mxc => mach-imx}/iomux-v3.c | 5 +-
.../{plat-mxc/include/mach => mach-imx}/iomux-v3.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/iram.h | 0
arch/arm/{plat-mxc => mach-imx}/iram_alloc.c | 3 +-
arch/arm/{plat-mxc => mach-imx}/irq-common.c | 0
arch/arm/{plat-mxc => mach-imx}/irq-common.h | 3 +
arch/arm/mach-imx/lluart.c | 3 +-
arch/arm/mach-imx/mach-apf9328.c | 7 +-
arch/arm/mach-imx/mach-armadillo5x0.c | 9 +-
arch/arm/mach-imx/mach-bug.c | 7 +-
arch/arm/mach-imx/mach-cpuimx27.c | 11 +-
arch/arm/mach-imx/mach-cpuimx35.c | 9 +-
arch/arm/mach-imx/mach-cpuimx51sd.c | 9 +-
arch/arm/mach-imx/mach-eukrea_cpuimx25.c | 10 +-
arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 48 +-
arch/arm/mach-imx/mach-imx27ipcam.c | 6 +-
arch/arm/mach-imx/mach-imx27lite.c | 6 +-
arch/arm/mach-imx/mach-imx53.c | 11 +-
arch/arm/mach-imx/mach-imx6q.c | 6 +-
arch/arm/mach-imx/mach-kzm_arm11_01.c | 7 +-
arch/arm/mach-imx/mach-mx1ads.c | 7 +-
arch/arm/mach-imx/mach-mx21ads.c | 6 +-
arch/arm/mach-imx/mach-mx25_3ds.c | 8 +-
arch/arm/mach-imx/mach-mx27_3ds.c | 10 +-
arch/arm/mach-imx/mach-mx27ads.c | 6 +-
arch/arm/mach-imx/mach-mx31_3ds.c | 12 +-
arch/arm/mach-imx/mach-mx31ads.c | 5 +-
arch/arm/mach-imx/mach-mx31lilly.c | 11 +-
arch/arm/mach-imx/mach-mx31lite.c | 11 +-
arch/arm/mach-imx/mach-mx31moboard.c | 14 +-
arch/arm/mach-imx/mach-mx35_3ds.c | 8 +-
arch/arm/mach-imx/mach-mx50_rdp.c | 7 +-
arch/arm/mach-imx/mach-mx51_3ds.c | 9 +-
arch/arm/mach-imx/mach-mx51_babbage.c | 7 +-
arch/arm/mach-imx/mach-mxt_td60.c | 6 +-
arch/arm/mach-imx/mach-pca100.c | 8 +-
arch/arm/mach-imx/mach-pcm037.c | 8 +-
arch/arm/mach-imx/mach-pcm037_eet.c | 5 +-
arch/arm/mach-imx/mach-pcm038.c | 13 +-
arch/arm/mach-imx/mach-pcm043.c | 9 +-
arch/arm/mach-imx/mach-qong.c | 6 +-
arch/arm/mach-imx/mach-scb9328.c | 7 +-
arch/arm/mach-imx/mach-vpr200.c | 7 +-
arch/arm/mach-imx/mm-imx1.c | 9 +-
arch/arm/mach-imx/mm-imx21.c | 12 +-
arch/arm/mach-imx/mm-imx25.c | 10 +-
arch/arm/mach-imx/mm-imx27.c | 12 +-
arch/arm/mach-imx/mm-imx3.c | 9 +-
arch/arm/mach-imx/mm-imx5.c | 8 +-
arch/arm/mach-imx/mx1-camera-fiq-ksym.c | 18 -
arch/arm/mach-imx/mx1-camera-fiq.S | 35 -
arch/arm/{plat-mxc/include/mach => mach-imx}/mx1.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx21.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx25.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx27.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx2x.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx31.h | 0
arch/arm/mach-imx/mx31lilly-db.c | 9 +-
arch/arm/mach-imx/mx31lite-db.c | 9 +-
arch/arm/mach-imx/mx31moboard-devboard.c | 9 +-
arch/arm/mach-imx/mx31moboard-marxbot.c | 9 +-
arch/arm/mach-imx/mx31moboard-smartbot.c | 11 +-
.../arm/{plat-mxc/include/mach => mach-imx}/mx35.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx3x.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx50.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx51.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx53.h | 0
.../arm/{plat-mxc/include/mach => mach-imx}/mx6q.h | 0
arch/arm/{plat-mxc/include/mach => mach-imx}/mxc.h | 0
arch/arm/mach-imx/pcm970-baseboard.c | 7 +-
arch/arm/mach-imx/platsmp.c | 5 +-
arch/arm/mach-imx/pm-imx27.c | 3 +-
arch/arm/mach-imx/pm-imx3.c | 7 +-
arch/arm/mach-imx/pm-imx5.c | 7 +-
arch/arm/mach-imx/pm-imx6q.c | 5 +-
arch/arm/{plat-mxc => mach-imx}/ssi-fiq-ksym.c | 0
arch/arm/{plat-mxc => mach-imx}/ssi-fiq.S | 0
arch/arm/{plat-mxc => mach-imx}/system.c | 5 +-
arch/arm/{plat-mxc => mach-imx}/time.c | 5 +-
arch/arm/{plat-mxc => mach-imx}/tzic.c | 6 +-
arch/arm/{plat-mxc => mach-imx}/ulpi.c | 2 +-
.../arm/{plat-mxc/include/mach => mach-imx}/ulpi.h | 0
arch/arm/plat-mxc/Kconfig | 89 --
arch/arm/plat-mxc/Makefile | 24 -
arch/arm/plat-mxc/devices/platform-mx1-camera.c | 42 -
arch/arm/plat-mxc/include/mach/irqs.h | 21 -
arch/arm/plat-mxc/include/mach/timex.h | 22 -
arch/arm/plat-mxc/include/mach/uncompress.h | 132 ---
drivers/dma/imx-dma.c | 137 +--
drivers/dma/imx-sdma.c | 1 -
drivers/dma/ipu/ipu_idmac.c | 3 +-
drivers/dma/ipu/ipu_irq.c | 3 +-
drivers/i2c/busses/i2c-imx.c | 40 +-
drivers/media/video/Kconfig | 12 -
drivers/media/video/Makefile | 1 -
drivers/media/video/mx1_camera.c | 889 --------------------
drivers/media/video/mx2_camera.c | 240 +++---
drivers/media/video/mx3_camera.c | 2 +-
drivers/mmc/host/mxcmmc.c | 31 +-
drivers/mtd/nand/mxc_nand.c | 86 +-
drivers/rtc/rtc-mxc.c | 34 +-
drivers/usb/host/ehci-mxc.c | 1 -
drivers/video/imxfb.c | 38 +-
drivers/video/mx3fb.c | 3 +-
drivers/watchdog/imx2_wdt.c | 1 -
.../mach/ipu.h => include/linux/dma/ipu-dma.h | 6 +-
include/linux/platform_data/asoc-mx27vis.h | 11 +
include/linux/platform_data/camera-mx1.h | 35 -
sound/soc/fsl/imx-pcm-fiq.c | 3 +-
sound/soc/fsl/imx-ssi.c | 1 -
sound/soc/fsl/mx27vis-aic32x4.c | 42 +-
219 files changed, 1149 insertions(+), 2170 deletions(-)
rename arch/arm/{plat-mxc/include/mach/debug-macro.S => include/debug/imx.S} (59%)
rename arch/arm/{plat-mxc => mach-imx}/3ds_debugboard.c (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/3ds_debugboard.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/avic.c (98%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/board-mx31lilly.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/board-mx31lite.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/board-mx31moboard.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/board-pcm038.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/common.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/cpu.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/cpufreq.c (99%)
rename arch/arm/{plat-mxc => mach-imx}/cpuidle.c (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/cpuidle.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/devices/Kconfig (96%)
rename arch/arm/{plat-mxc => mach-imx}/devices/Makefile (96%)
rename arch/arm/{plat-mxc/include/mach => mach-imx/devices}/devices-common.h (96%)
rename arch/arm/{plat-mxc => mach-imx/devices}/devices.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-ahci-imx.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-fec.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-flexcan.c (96%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-fsl-usb2-udc.c (96%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-gpio-mxc.c (96%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-gpio_keys.c (94%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-dma.c (63%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-fb.c (79%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-i2c.c (77%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-keypad.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-ssi.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx-uart.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx2-wdt.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx21-hcd.c (94%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imx_udc.c (96%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-imxdi_rtc.c (94%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-ipu-core.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mx2-camera.c (83%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc-ehci.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc-mmc.c (76%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc_nand.c (74%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc_pwm.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc_rnga.c (95%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc_rtc.c (77%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-mxc_w1.c (95%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-pata_imx.c (96%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-sdhci-esdhc-imx.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/devices/platform-spi_imx.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/epit.c (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/eukrea-baseboards.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/hardware.h (94%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iim.h (100%)
delete mode 100644 arch/arm/mach-imx/include/mach/dma-mx1-mx2.h
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx1.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx21.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx25.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx27.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx2x.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx3.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx35.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx50.h (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-mx51.h (99%)
rename arch/arm/{plat-mxc => mach-imx}/iomux-v1.c (98%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-v1.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/iomux-v3.c (97%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iomux-v3.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/iram.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/iram_alloc.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/irq-common.c (100%)
rename arch/arm/{plat-mxc => mach-imx}/irq-common.h (94%)
delete mode 100644 arch/arm/mach-imx/mx1-camera-fiq-ksym.c
delete mode 100644 arch/arm/mach-imx/mx1-camera-fiq.S
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx1.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx21.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx25.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx27.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx2x.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx31.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx35.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx3x.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx50.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx51.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx53.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mx6q.h (100%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/mxc.h (100%)
rename arch/arm/{plat-mxc => mach-imx}/ssi-fiq-ksym.c (100%)
rename arch/arm/{plat-mxc => mach-imx}/ssi-fiq.S (100%)
rename arch/arm/{plat-mxc => mach-imx}/system.c (97%)
rename arch/arm/{plat-mxc => mach-imx}/time.c (99%)
rename arch/arm/{plat-mxc => mach-imx}/tzic.c (98%)
rename arch/arm/{plat-mxc => mach-imx}/ulpi.c (99%)
rename arch/arm/{plat-mxc/include/mach => mach-imx}/ulpi.h (100%)
delete mode 100644 arch/arm/plat-mxc/Kconfig
delete mode 100644 arch/arm/plat-mxc/Makefile
delete mode 100644 arch/arm/plat-mxc/devices/platform-mx1-camera.c
delete mode 100644 arch/arm/plat-mxc/include/mach/irqs.h
delete mode 100644 arch/arm/plat-mxc/include/mach/timex.h
delete mode 100644 arch/arm/plat-mxc/include/mach/uncompress.h
delete mode 100644 drivers/media/video/mx1_camera.c
rename arch/arm/plat-mxc/include/mach/ipu.h => include/linux/dma/ipu-dma.h (97%)
create mode 100644 include/linux/platform_data/asoc-mx27vis.h
delete mode 100644 include/linux/platform_data/camera-mx1.h
--
1.7.9.5
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH 12/34] media: mx1_camera: remove the driver
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 8:33 ` Guennadi Liakhovetski
2012-09-17 5:34 ` [PATCH 14/34] dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h Shawn Guo
` (5 subsequent siblings)
6 siblings, 1 reply; 30+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Sascha Hauer, Fabio Estevam, Rob Herring, Arnd Bergmann,
Shawn Guo, Paulius Zaleckas, Guennadi Liakhovetski, linux-media
The mx1_camera driver has been broken for a few release cycles since
commit 6bd0812 (dmaengine: imx-dma: merge old dma-v1.c with imx-dma.c).
It seems there is no one even compile tested it since then, as doing
so will end up with the following error.
CC drivers/media/video/mx1_camera.o
In file included from drivers/media/video/mx1_camera.c:44:0:
arch/arm/mach-imx/include/mach/dma-mx1-mx2.h:8:25: fatal error: mach/dma-v1.h: No such file or directory
It looks that all the related folks have known the breakage [1], but
no one shows the interest to bring it back to work. Thus it becomes
a piece of unmaintained code, so let's remove it.
[1] https://lkml.org/lkml/2012/2/9/171
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-media@vger.kernel.org
---
arch/arm/mach-imx/Makefile | 3 -
arch/arm/mach-imx/clk-imx1.c | 1 -
arch/arm/mach-imx/devices/Kconfig | 3 -
arch/arm/mach-imx/devices/Makefile | 1 -
arch/arm/mach-imx/devices/devices-common.h | 10 -
arch/arm/mach-imx/devices/platform-mx1-camera.c | 42 --
arch/arm/mach-imx/mx1-camera-fiq-ksym.c | 18 -
arch/arm/mach-imx/mx1-camera-fiq.S | 35 -
drivers/media/video/Kconfig | 12 -
drivers/media/video/Makefile | 1 -
drivers/media/video/mx1_camera.c | 889 -----------------------
include/linux/platform_data/camera-mx1.h | 35 -
12 files changed, 1050 deletions(-)
delete mode 100644 arch/arm/mach-imx/devices/platform-mx1-camera.c
delete mode 100644 arch/arm/mach-imx/mx1-camera-fiq-ksym.c
delete mode 100644 arch/arm/mach-imx/mx1-camera-fiq.S
delete mode 100644 drivers/media/video/mx1_camera.c
delete mode 100644 include/linux/platform_data/camera-mx1.h
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index fe47b71..538d0ee 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -35,9 +35,6 @@ obj-y += ssi-fiq.o
obj-y += ssi-fiq-ksym.o
endif
-# Support for CMOS sensor interface
-obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o
-
# i.MX1 based machines
obj-$(CONFIG_ARCH_MX1ADS) += mach-mx1ads.o
obj-$(CONFIG_MACH_SCB9328) += mach-scb9328.o
diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
index b5f90cc..ebfffd2 100644
--- a/arch/arm/mach-imx/clk-imx1.c
+++ b/arch/arm/mach-imx/clk-imx1.c
@@ -84,7 +84,6 @@ int __init mx1_clocks_init(unsigned long fref)
i, PTR_ERR(clk[i]));
clk_register_clkdev(clk[dma_gate], "ahb", "imx-dma");
- clk_register_clkdev(clk[csi_gate], NULL, "mx1-camera.0");
clk_register_clkdev(clk[mma_gate], "mma", NULL);
clk_register_clkdev(clk[usbd_gate], NULL, "imx_udc.0");
clk_register_clkdev(clk[per1], "per", "imx-gpt.0");
diff --git a/arch/arm/mach-imx/devices/Kconfig b/arch/arm/mach-imx/devices/Kconfig
index cb3e3ee..09d796e 100644
--- a/arch/arm/mach-imx/devices/Kconfig
+++ b/arch/arm/mach-imx/devices/Kconfig
@@ -46,9 +46,6 @@ config IMX_HAVE_PLATFORM_IMX_UDC
config IMX_HAVE_PLATFORM_IPU_CORE
bool
-config IMX_HAVE_PLATFORM_MX1_CAMERA
- bool
-
config IMX_HAVE_PLATFORM_MX2_CAMERA
bool
diff --git a/arch/arm/mach-imx/devices/Makefile b/arch/arm/mach-imx/devices/Makefile
index ff22ed1..3cfdc37 100644
--- a/arch/arm/mach-imx/devices/Makefile
+++ b/arch/arm/mach-imx/devices/Makefile
@@ -17,7 +17,6 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IPU_CORE) += platform-ipu-core.o
-obj-$(CONFIG_IMX_HAVE_PLATFORM_MX1_CAMERA) += platform-mx1-camera.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA) += platform-mx2-camera.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI) += platform-mxc-ehci.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
index 9e3e3d8..34419b2 100644
--- a/arch/arm/mach-imx/devices/devices-common.h
+++ b/arch/arm/mach-imx/devices/devices-common.h
@@ -199,16 +199,6 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
const struct imx_ipu_core_data *data,
struct mx3fb_platform_data *pdata);
-#include <linux/platform_data/camera-mx1.h>
-struct imx_mx1_camera_data {
- resource_size_t iobase;
- resource_size_t iosize;
- resource_size_t irq;
-};
-struct platform_device *__init imx_add_mx1_camera(
- const struct imx_mx1_camera_data *data,
- const struct mx1_camera_pdata *pdata);
-
#include <linux/platform_data/camera-mx2.h>
struct imx_mx2_camera_data {
resource_size_t iobasecsi;
diff --git a/arch/arm/mach-imx/devices/platform-mx1-camera.c b/arch/arm/mach-imx/devices/platform-mx1-camera.c
deleted file mode 100644
index 756b0e6..0000000
--- a/arch/arm/mach-imx/devices/platform-mx1-camera.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2010 Pengutronix
- * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
- *
- * This program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License version 2 as published by the
- * Free Software Foundation.
- */
-#include <mach/hardware.h>
-#include "devices-common.h"
-
-#define imx_mx1_camera_data_entry_single(soc, _size) \
- { \
- .iobase = soc ## _CSI ## _BASE_ADDR, \
- .iosize = _size, \
- .irq = soc ## _INT_CSI, \
- }
-
-#ifdef CONFIG_SOC_IMX1
-const struct imx_mx1_camera_data imx1_mx1_camera_data __initconst =
- imx_mx1_camera_data_entry_single(MX1, 10);
-#endif /* ifdef CONFIG_SOC_IMX1 */
-
-struct platform_device *__init imx_add_mx1_camera(
- const struct imx_mx1_camera_data *data,
- const struct mx1_camera_pdata *pdata)
-{
- struct resource res[] = {
- {
- .start = data->iobase,
- .end = data->iobase + data->iosize - 1,
- .flags = IORESOURCE_MEM,
- }, {
- .start = data->irq,
- .end = data->irq,
- .flags = IORESOURCE_IRQ,
- },
- };
- return imx_add_platform_device_dmamask("mx1-camera", 0,
- res, ARRAY_SIZE(res),
- pdata, sizeof(*pdata), DMA_BIT_MASK(32));
-}
diff --git a/arch/arm/mach-imx/mx1-camera-fiq-ksym.c b/arch/arm/mach-imx/mx1-camera-fiq-ksym.c
deleted file mode 100644
index fb38436..0000000
--- a/arch/arm/mach-imx/mx1-camera-fiq-ksym.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Exported ksyms of ARCH_MX1
- *
- * Copyright (C) 2008, Darius Augulis <augulis.darius@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/platform_device.h>
-#include <linux/module.h>
-
-#include <linux/platform_data/camera-mx1.h>
-
-/* IMX camera FIQ handler */
-EXPORT_SYMBOL(mx1_camera_sof_fiq_start);
-EXPORT_SYMBOL(mx1_camera_sof_fiq_end);
diff --git a/arch/arm/mach-imx/mx1-camera-fiq.S b/arch/arm/mach-imx/mx1-camera-fiq.S
deleted file mode 100644
index 9c69aa6..0000000
--- a/arch/arm/mach-imx/mx1-camera-fiq.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2008 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
- *
- * Based on linux/arch/arm/lib/floppydma.S
- * Copyright (C) 1995, 1996 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <linux/linkage.h>
-#include <asm/assembler.h>
-
- .text
- .global mx1_camera_sof_fiq_end
- .global mx1_camera_sof_fiq_start
-mx1_camera_sof_fiq_start:
- @ enable dma
- ldr r12, [r9]
- orr r12, r12, #0x00000001
- str r12, [r9]
- @ unmask DMA interrupt
- ldr r12, [r8]
- bic r12, r12, r13
- str r12, [r8]
- @ disable SOF interrupt
- ldr r12, [r10]
- bic r12, r12, #0x00010000
- str r12, [r10]
- @ clear SOF flag
- mov r12, #0x00010000
- str r12, [r11]
- @ return from FIQ
- subs pc, lr, #4
-mx1_camera_sof_fiq_end:
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index c128fac..e8b89a9 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -1118,18 +1118,6 @@ config SOC_CAMERA_OV9740
help
This is a ov9740 camera driver
-config MX1_VIDEO
- bool
-
-config VIDEO_MX1
- tristate "i.MX1/i.MXL CMOS Sensor Interface driver"
- depends on VIDEO_DEV && ARCH_MX1 && SOC_CAMERA
- select FIQ
- select VIDEOBUF_DMA_CONTIG
- select MX1_VIDEO
- ---help---
- This is a v4l2 driver for the i.MX1/i.MXL CMOS Sensor Interface
-
config MX3_VIDEO
bool
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index b7da9fa..8624228 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -178,7 +178,6 @@ obj-$(CONFIG_VIDEO_OMAP2) += omap2cam.o
obj-$(CONFIG_SOC_CAMERA) += soc_camera.o soc_mediabus.o
obj-$(CONFIG_SOC_CAMERA_PLATFORM) += soc_camera_platform.o
# soc-camera host drivers have to be linked after camera drivers
-obj-$(CONFIG_VIDEO_MX1) += mx1_camera.o
obj-$(CONFIG_VIDEO_MX2) += mx2_camera.o
obj-$(CONFIG_VIDEO_MX3) += mx3_camera.o
obj-$(CONFIG_VIDEO_PXA27x) += pxa_camera.o
diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c
deleted file mode 100644
index bbe7099..0000000
--- a/drivers/media/video/mx1_camera.c
+++ /dev/null
@@ -1,889 +0,0 @@
-/*
- * V4L2 Driver for i.MXL/i.MXL camera (CSI) host
- *
- * Copyright (C) 2008, Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
- * Copyright (C) 2009, Darius Augulis <augulis.darius@gmail.com>
- *
- * Based on PXA SoC camera driver
- * Copyright (C) 2006, Sascha Hauer, Pengutronix
- * Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/clk.h>
-#include <linux/delay.h>
-#include <linux/device.h>
-#include <linux/dma-mapping.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/mutex.h>
-#include <linux/platform_device.h>
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/time.h>
-#include <linux/videodev2.h>
-
-#include <media/soc_camera.h>
-#include <media/v4l2-common.h>
-#include <media/v4l2-dev.h>
-#include <media/videobuf-dma-contig.h>
-#include <media/soc_mediabus.h>
-
-#include <asm/dma.h>
-#include <asm/fiq.h>
-#include <mach/dma-mx1-mx2.h>
-#include <mach/hardware.h>
-#include <mach/irqs.h>
-#include <linux/platform_data/camera-mx1.h>
-
-/*
- * CSI registers
- */
-#define CSICR1 0x00 /* CSI Control Register 1 */
-#define CSISR 0x08 /* CSI Status Register */
-#define CSIRXR 0x10 /* CSI RxFIFO Register */
-
-#define CSICR1_RXFF_LEVEL(x) (((x) & 0x3) << 19)
-#define CSICR1_SOF_POL (1 << 17)
-#define CSICR1_SOF_INTEN (1 << 16)
-#define CSICR1_MCLKDIV(x) (((x) & 0xf) << 12)
-#define CSICR1_MCLKEN (1 << 9)
-#define CSICR1_FCC (1 << 8)
-#define CSICR1_BIG_ENDIAN (1 << 7)
-#define CSICR1_CLR_RXFIFO (1 << 5)
-#define CSICR1_GCLK_MODE (1 << 4)
-#define CSICR1_DATA_POL (1 << 2)
-#define CSICR1_REDGE (1 << 1)
-#define CSICR1_EN (1 << 0)
-
-#define CSISR_SFF_OR_INT (1 << 25)
-#define CSISR_RFF_OR_INT (1 << 24)
-#define CSISR_STATFF_INT (1 << 21)
-#define CSISR_RXFF_INT (1 << 18)
-#define CSISR_SOF_INT (1 << 16)
-#define CSISR_DRDY (1 << 0)
-
-#define DRIVER_VERSION "0.0.2"
-#define DRIVER_NAME "mx1-camera"
-
-#define CSI_IRQ_MASK (CSISR_SFF_OR_INT | CSISR_RFF_OR_INT | \
- CSISR_STATFF_INT | CSISR_RXFF_INT | CSISR_SOF_INT)
-
-#define CSI_BUS_FLAGS (V4L2_MBUS_MASTER | V4L2_MBUS_HSYNC_ACTIVE_HIGH | \
- V4L2_MBUS_VSYNC_ACTIVE_HIGH | V4L2_MBUS_VSYNC_ACTIVE_LOW | \
- V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_PCLK_SAMPLE_FALLING | \
- V4L2_MBUS_DATA_ACTIVE_HIGH | V4L2_MBUS_DATA_ACTIVE_LOW)
-
-#define MAX_VIDEO_MEM 16 /* Video memory limit in megabytes */
-
-/*
- * Structures
- */
-
-/* buffer for one video frame */
-struct mx1_buffer {
- /* common v4l buffer stuff -- must be first */
- struct videobuf_buffer vb;
- enum v4l2_mbus_pixelcode code;
- int inwork;
-};
-
-/*
- * i.MX1/i.MXL is only supposed to handle one camera on its Camera Sensor
- * Interface. If anyone ever builds hardware to enable more than
- * one camera, they will have to modify this driver too
- */
-struct mx1_camera_dev {
- struct soc_camera_host soc_host;
- struct soc_camera_device *icd;
- struct mx1_camera_pdata *pdata;
- struct mx1_buffer *active;
- struct resource *res;
- struct clk *clk;
- struct list_head capture;
-
- void __iomem *base;
- int dma_chan;
- unsigned int irq;
- unsigned long mclk;
-
- spinlock_t lock;
-};
-
-/*
- * Videobuf operations
- */
-static int mx1_videobuf_setup(struct videobuf_queue *vq, unsigned int *count,
- unsigned int *size)
-{
- struct soc_camera_device *icd = vq->priv_data;
-
- *size = icd->sizeimage;
-
- if (!*count)
- *count = 32;
-
- if (*size * *count > MAX_VIDEO_MEM * 1024 * 1024)
- *count = (MAX_VIDEO_MEM * 1024 * 1024) / *size;
-
- dev_dbg(icd->parent, "count=%d, size=%d\n", *count, *size);
-
- return 0;
-}
-
-static void free_buffer(struct videobuf_queue *vq, struct mx1_buffer *buf)
-{
- struct soc_camera_device *icd = vq->priv_data;
- struct videobuf_buffer *vb = &buf->vb;
-
- BUG_ON(in_interrupt());
-
- dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
- vb, vb->baddr, vb->bsize);
-
- /*
- * This waits until this buffer is out of danger, i.e., until it is no
- * longer in STATE_QUEUED or STATE_ACTIVE
- */
- videobuf_waiton(vq, vb, 0, 0);
- videobuf_dma_contig_free(vq, vb);
-
- vb->state = VIDEOBUF_NEEDS_INIT;
-}
-
-static int mx1_videobuf_prepare(struct videobuf_queue *vq,
- struct videobuf_buffer *vb, enum v4l2_field field)
-{
- struct soc_camera_device *icd = vq->priv_data;
- struct mx1_buffer *buf = container_of(vb, struct mx1_buffer, vb);
- int ret;
-
- dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
- vb, vb->baddr, vb->bsize);
-
- /* Added list head initialization on alloc */
- WARN_ON(!list_empty(&vb->queue));
-
- BUG_ON(NULL == icd->current_fmt);
-
- /*
- * I think, in buf_prepare you only have to protect global data,
- * the actual buffer is yours
- */
- buf->inwork = 1;
-
- if (buf->code != icd->current_fmt->code ||
- vb->width != icd->user_width ||
- vb->height != icd->user_height ||
- vb->field != field) {
- buf->code = icd->current_fmt->code;
- vb->width = icd->user_width;
- vb->height = icd->user_height;
- vb->field = field;
- vb->state = VIDEOBUF_NEEDS_INIT;
- }
-
- vb->size = icd->sizeimage;
- if (0 != vb->baddr && vb->bsize < vb->size) {
- ret = -EINVAL;
- goto out;
- }
-
- if (vb->state == VIDEOBUF_NEEDS_INIT) {
- ret = videobuf_iolock(vq, vb, NULL);
- if (ret)
- goto fail;
-
- vb->state = VIDEOBUF_PREPARED;
- }
-
- buf->inwork = 0;
-
- return 0;
-
-fail:
- free_buffer(vq, buf);
-out:
- buf->inwork = 0;
- return ret;
-}
-
-static int mx1_camera_setup_dma(struct mx1_camera_dev *pcdev)
-{
- struct videobuf_buffer *vbuf = &pcdev->active->vb;
- struct device *dev = pcdev->icd->parent;
- int ret;
-
- if (unlikely(!pcdev->active)) {
- dev_err(dev, "DMA End IRQ with no active buffer\n");
- return -EFAULT;
- }
-
- /* setup sg list for future DMA */
- ret = imx_dma_setup_single(pcdev->dma_chan,
- videobuf_to_dma_contig(vbuf),
- vbuf->size, pcdev->res->start +
- CSIRXR, DMA_MODE_READ);
- if (unlikely(ret))
- dev_err(dev, "Failed to setup DMA sg list\n");
-
- return ret;
-}
-
-/* Called under spinlock_irqsave(&pcdev->lock, ...) */
-static void mx1_videobuf_queue(struct videobuf_queue *vq,
- struct videobuf_buffer *vb)
-{
- struct soc_camera_device *icd = vq->priv_data;
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
- struct mx1_camera_dev *pcdev = ici->priv;
- struct mx1_buffer *buf = container_of(vb, struct mx1_buffer, vb);
-
- dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
- vb, vb->baddr, vb->bsize);
-
- list_add_tail(&vb->queue, &pcdev->capture);
-
- vb->state = VIDEOBUF_ACTIVE;
-
- if (!pcdev->active) {
- pcdev->active = buf;
-
- /* setup sg list for future DMA */
- if (!mx1_camera_setup_dma(pcdev)) {
- unsigned int temp;
- /* enable SOF irq */
- temp = __raw_readl(pcdev->base + CSICR1) |
- CSICR1_SOF_INTEN;
- __raw_writel(temp, pcdev->base + CSICR1);
- }
- }
-}
-
-static void mx1_videobuf_release(struct videobuf_queue *vq,
- struct videobuf_buffer *vb)
-{
- struct mx1_buffer *buf = container_of(vb, struct mx1_buffer, vb);
-#ifdef DEBUG
- struct soc_camera_device *icd = vq->priv_data;
- struct device *dev = icd->parent;
-
- dev_dbg(dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
- vb, vb->baddr, vb->bsize);
-
- switch (vb->state) {
- case VIDEOBUF_ACTIVE:
- dev_dbg(dev, "%s (active)\n", __func__);
- break;
- case VIDEOBUF_QUEUED:
- dev_dbg(dev, "%s (queued)\n", __func__);
- break;
- case VIDEOBUF_PREPARED:
- dev_dbg(dev, "%s (prepared)\n", __func__);
- break;
- default:
- dev_dbg(dev, "%s (unknown)\n", __func__);
- break;
- }
-#endif
-
- free_buffer(vq, buf);
-}
-
-static void mx1_camera_wakeup(struct mx1_camera_dev *pcdev,
- struct videobuf_buffer *vb,
- struct mx1_buffer *buf)
-{
- /* _init is used to debug races, see comment in mx1_camera_reqbufs() */
- list_del_init(&vb->queue);
- vb->state = VIDEOBUF_DONE;
- do_gettimeofday(&vb->ts);
- vb->field_count++;
- wake_up(&vb->done);
-
- if (list_empty(&pcdev->capture)) {
- pcdev->active = NULL;
- return;
- }
-
- pcdev->active = list_entry(pcdev->capture.next,
- struct mx1_buffer, vb.queue);
-
- /* setup sg list for future DMA */
- if (likely(!mx1_camera_setup_dma(pcdev))) {
- unsigned int temp;
-
- /* enable SOF irq */
- temp = __raw_readl(pcdev->base + CSICR1) | CSICR1_SOF_INTEN;
- __raw_writel(temp, pcdev->base + CSICR1);
- }
-}
-
-static void mx1_camera_dma_irq(int channel, void *data)
-{
- struct mx1_camera_dev *pcdev = data;
- struct device *dev = pcdev->icd->parent;
- struct mx1_buffer *buf;
- struct videobuf_buffer *vb;
- unsigned long flags;
-
- spin_lock_irqsave(&pcdev->lock, flags);
-
- imx_dma_disable(channel);
-
- if (unlikely(!pcdev->active)) {
- dev_err(dev, "DMA End IRQ with no active buffer\n");
- goto out;
- }
-
- vb = &pcdev->active->vb;
- buf = container_of(vb, struct mx1_buffer, vb);
- WARN_ON(buf->inwork || list_empty(&vb->queue));
- dev_dbg(dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
- vb, vb->baddr, vb->bsize);
-
- mx1_camera_wakeup(pcdev, vb, buf);
-out:
- spin_unlock_irqrestore(&pcdev->lock, flags);
-}
-
-static struct videobuf_queue_ops mx1_videobuf_ops = {
- .buf_setup = mx1_videobuf_setup,
- .buf_prepare = mx1_videobuf_prepare,
- .buf_queue = mx1_videobuf_queue,
- .buf_release = mx1_videobuf_release,
-};
-
-static void mx1_camera_init_videobuf(struct videobuf_queue *q,
- struct soc_camera_device *icd)
-{
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
- struct mx1_camera_dev *pcdev = ici->priv;
-
- videobuf_queue_dma_contig_init(q, &mx1_videobuf_ops, icd->parent,
- &pcdev->lock, V4L2_BUF_TYPE_VIDEO_CAPTURE,
- V4L2_FIELD_NONE,
- sizeof(struct mx1_buffer), icd, &icd->video_lock);
-}
-
-static int mclk_get_divisor(struct mx1_camera_dev *pcdev)
-{
- unsigned int mclk = pcdev->mclk;
- unsigned long div;
- unsigned long lcdclk;
-
- lcdclk = clk_get_rate(pcdev->clk);
-
- /*
- * We verify platform_mclk_10khz != 0, so if anyone breaks it, here
- * they get a nice Oops
- */
- div = (lcdclk + 2 * mclk - 1) / (2 * mclk) - 1;
-
- dev_dbg(pcdev->icd->parent,
- "System clock %lukHz, target freq %dkHz, divisor %lu\n",
- lcdclk / 1000, mclk / 1000, div);
-
- return div;
-}
-
-static void mx1_camera_activate(struct mx1_camera_dev *pcdev)
-{
- unsigned int csicr1 = CSICR1_EN;
-
- dev_dbg(pcdev->icd->parent, "Activate device\n");
-
- clk_prepare_enable(pcdev->clk);
-
- /* enable CSI before doing anything else */
- __raw_writel(csicr1, pcdev->base + CSICR1);
-
- csicr1 |= CSICR1_MCLKEN | CSICR1_FCC | CSICR1_GCLK_MODE;
- csicr1 |= CSICR1_MCLKDIV(mclk_get_divisor(pcdev));
- csicr1 |= CSICR1_RXFF_LEVEL(2); /* 16 words */
-
- __raw_writel(csicr1, pcdev->base + CSICR1);
-}
-
-static void mx1_camera_deactivate(struct mx1_camera_dev *pcdev)
-{
- dev_dbg(pcdev->icd->parent, "Deactivate device\n");
-
- /* Disable all CSI interface */
- __raw_writel(0x00, pcdev->base + CSICR1);
-
- clk_disable_unprepare(pcdev->clk);
-}
-
-/*
- * The following two functions absolutely depend on the fact, that
- * there can be only one camera on i.MX1/i.MXL camera sensor interface
- */
-static int mx1_camera_add_device(struct soc_camera_device *icd)
-{
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
- struct mx1_camera_dev *pcdev = ici->priv;
-
- if (pcdev->icd)
- return -EBUSY;
-
- dev_info(icd->parent, "MX1 Camera driver attached to camera %d\n",
- icd->devnum);
-
- mx1_camera_activate(pcdev);
-
- pcdev->icd = icd;
-
- return 0;
-}
-
-static void mx1_camera_remove_device(struct soc_camera_device *icd)
-{
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
- struct mx1_camera_dev *pcdev = ici->priv;
- unsigned int csicr1;
-
- BUG_ON(icd != pcdev->icd);
-
- /* disable interrupts */
- csicr1 = __raw_readl(pcdev->base + CSICR1) & ~CSI_IRQ_MASK;
- __raw_writel(csicr1, pcdev->base + CSICR1);
-
- /* Stop DMA engine */
- imx_dma_disable(pcdev->dma_chan);
-
- dev_info(icd->parent, "MX1 Camera driver detached from camera %d\n",
- icd->devnum);
-
- mx1_camera_deactivate(pcdev);
-
- pcdev->icd = NULL;
-}
-
-static int mx1_camera_set_crop(struct soc_camera_device *icd,
- struct v4l2_crop *a)
-{
- struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
-
- return v4l2_subdev_call(sd, video, s_crop, a);
-}
-
-static int mx1_camera_set_bus_param(struct soc_camera_device *icd)
-{
- struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
- struct mx1_camera_dev *pcdev = ici->priv;
- struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,};
- unsigned long common_flags;
- unsigned int csicr1;
- int ret;
-
- /* MX1 supports only 8bit buswidth */
- ret = v4l2_subdev_call(sd, video, g_mbus_config, &cfg);
- if (!ret) {
- common_flags = soc_mbus_config_compatible(&cfg, CSI_BUS_FLAGS);
- if (!common_flags) {
- dev_warn(icd->parent,
- "Flags incompatible: camera 0x%x, host 0x%x\n",
- cfg.flags, CSI_BUS_FLAGS);
- return -EINVAL;
- }
- } else if (ret != -ENOIOCTLCMD) {
- return ret;
- } else {
- common_flags = CSI_BUS_FLAGS;
- }
-
- /* Make choises, based on platform choice */
- if ((common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) &&
- (common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)) {
- if (!pcdev->pdata ||
- pcdev->pdata->flags & MX1_CAMERA_VSYNC_HIGH)
- common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_LOW;
- else
- common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_HIGH;
- }
-
- if ((common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING) &&
- (common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING)) {
- if (!pcdev->pdata ||
- pcdev->pdata->flags & MX1_CAMERA_PCLK_RISING)
- common_flags &= ~V4L2_MBUS_PCLK_SAMPLE_FALLING;
- else
- common_flags &= ~V4L2_MBUS_PCLK_SAMPLE_RISING;
- }
-
- if ((common_flags & V4L2_MBUS_DATA_ACTIVE_HIGH) &&
- (common_flags & V4L2_MBUS_DATA_ACTIVE_LOW)) {
- if (!pcdev->pdata ||
- pcdev->pdata->flags & MX1_CAMERA_DATA_HIGH)
- common_flags &= ~V4L2_MBUS_DATA_ACTIVE_LOW;
- else
- common_flags &= ~V4L2_MBUS_DATA_ACTIVE_HIGH;
- }
-
- cfg.flags = common_flags;
- ret = v4l2_subdev_call(sd, video, s_mbus_config, &cfg);
- if (ret < 0 && ret != -ENOIOCTLCMD) {
- dev_dbg(icd->parent, "camera s_mbus_config(0x%lx) returned %d\n",
- common_flags, ret);
- return ret;
- }
-
- csicr1 = __raw_readl(pcdev->base + CSICR1);
-
- if (common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING)
- csicr1 |= CSICR1_REDGE;
- if (common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH)
- csicr1 |= CSICR1_SOF_POL;
- if (common_flags & V4L2_MBUS_DATA_ACTIVE_LOW)
- csicr1 |= CSICR1_DATA_POL;
-
- __raw_writel(csicr1, pcdev->base + CSICR1);
-
- return 0;
-}
-
-static int mx1_camera_set_fmt(struct soc_camera_device *icd,
- struct v4l2_format *f)
-{
- struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
- const struct soc_camera_format_xlate *xlate;
- struct v4l2_pix_format *pix = &f->fmt.pix;
- struct v4l2_mbus_framefmt mf;
- int ret, buswidth;
-
- xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat);
- if (!xlate) {
- dev_warn(icd->parent, "Format %x not found\n",
- pix->pixelformat);
- return -EINVAL;
- }
-
- buswidth = xlate->host_fmt->bits_per_sample;
- if (buswidth > 8) {
- dev_warn(icd->parent,
- "bits-per-sample %d for format %x unsupported\n",
- buswidth, pix->pixelformat);
- return -EINVAL;
- }
-
- mf.width = pix->width;
- mf.height = pix->height;
- mf.field = pix->field;
- mf.colorspace = pix->colorspace;
- mf.code = xlate->code;
-
- ret = v4l2_subdev_call(sd, video, s_mbus_fmt, &mf);
- if (ret < 0)
- return ret;
-
- if (mf.code != xlate->code)
- return -EINVAL;
-
- pix->width = mf.width;
- pix->height = mf.height;
- pix->field = mf.field;
- pix->colorspace = mf.colorspace;
- icd->current_fmt = xlate;
-
- return ret;
-}
-
-static int mx1_camera_try_fmt(struct soc_camera_device *icd,
- struct v4l2_format *f)
-{
- struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
- const struct soc_camera_format_xlate *xlate;
- struct v4l2_pix_format *pix = &f->fmt.pix;
- struct v4l2_mbus_framefmt mf;
- int ret;
- /* TODO: limit to mx1 hardware capabilities */
-
- xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat);
- if (!xlate) {
- dev_warn(icd->parent, "Format %x not found\n",
- pix->pixelformat);
- return -EINVAL;
- }
-
- mf.width = pix->width;
- mf.height = pix->height;
- mf.field = pix->field;
- mf.colorspace = pix->colorspace;
- mf.code = xlate->code;
-
- /* limit to sensor capabilities */
- ret = v4l2_subdev_call(sd, video, try_mbus_fmt, &mf);
- if (ret < 0)
- return ret;
-
- pix->width = mf.width;
- pix->height = mf.height;
- pix->field = mf.field;
- pix->colorspace = mf.colorspace;
-
- return 0;
-}
-
-static int mx1_camera_reqbufs(struct soc_camera_device *icd,
- struct v4l2_requestbuffers *p)
-{
- int i;
-
- /*
- * This is for locking debugging only. I removed spinlocks and now I
- * check whether .prepare is ever called on a linked buffer, or whether
- * a dma IRQ can occur for an in-work or unlinked buffer. Until now
- * it hadn't triggered
- */
- for (i = 0; i < p->count; i++) {
- struct mx1_buffer *buf = container_of(icd->vb_vidq.bufs[i],
- struct mx1_buffer, vb);
- buf->inwork = 0;
- INIT_LIST_HEAD(&buf->vb.queue);
- }
-
- return 0;
-}
-
-static unsigned int mx1_camera_poll(struct file *file, poll_table *pt)
-{
- struct soc_camera_device *icd = file->private_data;
- struct mx1_buffer *buf;
-
- buf = list_entry(icd->vb_vidq.stream.next, struct mx1_buffer,
- vb.stream);
-
- poll_wait(file, &buf->vb.done, pt);
-
- if (buf->vb.state == VIDEOBUF_DONE ||
- buf->vb.state == VIDEOBUF_ERROR)
- return POLLIN | POLLRDNORM;
-
- return 0;
-}
-
-static int mx1_camera_querycap(struct soc_camera_host *ici,
- struct v4l2_capability *cap)
-{
- /* cap->name is set by the friendly caller:-> */
- strlcpy(cap->card, "i.MX1/i.MXL Camera", sizeof(cap->card));
- cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
-
- return 0;
-}
-
-static struct soc_camera_host_ops mx1_soc_camera_host_ops = {
- .owner = THIS_MODULE,
- .add = mx1_camera_add_device,
- .remove = mx1_camera_remove_device,
- .set_bus_param = mx1_camera_set_bus_param,
- .set_crop = mx1_camera_set_crop,
- .set_fmt = mx1_camera_set_fmt,
- .try_fmt = mx1_camera_try_fmt,
- .init_videobuf = mx1_camera_init_videobuf,
- .reqbufs = mx1_camera_reqbufs,
- .poll = mx1_camera_poll,
- .querycap = mx1_camera_querycap,
-};
-
-static struct fiq_handler fh = {
- .name = "csi_sof"
-};
-
-static int __init mx1_camera_probe(struct platform_device *pdev)
-{
- struct mx1_camera_dev *pcdev;
- struct resource *res;
- struct pt_regs regs;
- struct clk *clk;
- void __iomem *base;
- unsigned int irq;
- int err = 0;
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- irq = platform_get_irq(pdev, 0);
- if (!res || (int)irq <= 0) {
- err = -ENODEV;
- goto exit;
- }
-
- clk = clk_get(&pdev->dev, "csi_clk");
- if (IS_ERR(clk)) {
- err = PTR_ERR(clk);
- goto exit;
- }
-
- pcdev = kzalloc(sizeof(*pcdev), GFP_KERNEL);
- if (!pcdev) {
- dev_err(&pdev->dev, "Could not allocate pcdev\n");
- err = -ENOMEM;
- goto exit_put_clk;
- }
-
- pcdev->res = res;
- pcdev->clk = clk;
-
- pcdev->pdata = pdev->dev.platform_data;
-
- if (pcdev->pdata)
- pcdev->mclk = pcdev->pdata->mclk_10khz * 10000;
-
- if (!pcdev->mclk) {
- dev_warn(&pdev->dev,
- "mclk_10khz == 0! Please, fix your platform data. "
- "Using default 20MHz\n");
- pcdev->mclk = 20000000;
- }
-
- INIT_LIST_HEAD(&pcdev->capture);
- spin_lock_init(&pcdev->lock);
-
- /*
- * Request the regions.
- */
- if (!request_mem_region(res->start, resource_size(res), DRIVER_NAME)) {
- err = -EBUSY;
- goto exit_kfree;
- }
-
- base = ioremap(res->start, resource_size(res));
- if (!base) {
- err = -ENOMEM;
- goto exit_release;
- }
- pcdev->irq = irq;
- pcdev->base = base;
-
- /* request dma */
- pcdev->dma_chan = imx_dma_request_by_prio(DRIVER_NAME, DMA_PRIO_HIGH);
- if (pcdev->dma_chan < 0) {
- dev_err(&pdev->dev, "Can't request DMA for MX1 CSI\n");
- err = -EBUSY;
- goto exit_iounmap;
- }
- dev_dbg(&pdev->dev, "got DMA channel %d\n", pcdev->dma_chan);
-
- imx_dma_setup_handlers(pcdev->dma_chan, mx1_camera_dma_irq, NULL,
- pcdev);
-
- imx_dma_config_channel(pcdev->dma_chan, IMX_DMA_TYPE_FIFO,
- IMX_DMA_MEMSIZE_32, MX1_DMA_REQ_CSI_R, 0);
- /* burst length : 16 words = 64 bytes */
- imx_dma_config_burstlen(pcdev->dma_chan, 0);
-
- /* request irq */
- err = claim_fiq(&fh);
- if (err) {
- dev_err(&pdev->dev, "Camera interrupt register failed \n");
- goto exit_free_dma;
- }
-
- set_fiq_handler(&mx1_camera_sof_fiq_start, &mx1_camera_sof_fiq_end -
- &mx1_camera_sof_fiq_start);
-
- regs.ARM_r8 = (long)MX1_DMA_DIMR;
- regs.ARM_r9 = (long)MX1_DMA_CCR(pcdev->dma_chan);
- regs.ARM_r10 = (long)pcdev->base + CSICR1;
- regs.ARM_fp = (long)pcdev->base + CSISR;
- regs.ARM_sp = 1 << pcdev->dma_chan;
- set_fiq_regs(®s);
-
- mxc_set_irq_fiq(irq, 1);
- enable_fiq(irq);
-
- pcdev->soc_host.drv_name = DRIVER_NAME;
- pcdev->soc_host.ops = &mx1_soc_camera_host_ops;
- pcdev->soc_host.priv = pcdev;
- pcdev->soc_host.v4l2_dev.dev = &pdev->dev;
- pcdev->soc_host.nr = pdev->id;
- err = soc_camera_host_register(&pcdev->soc_host);
- if (err)
- goto exit_free_irq;
-
- dev_info(&pdev->dev, "MX1 Camera driver loaded\n");
-
- return 0;
-
-exit_free_irq:
- disable_fiq(irq);
- mxc_set_irq_fiq(irq, 0);
- release_fiq(&fh);
-exit_free_dma:
- imx_dma_free(pcdev->dma_chan);
-exit_iounmap:
- iounmap(base);
-exit_release:
- release_mem_region(res->start, resource_size(res));
-exit_kfree:
- kfree(pcdev);
-exit_put_clk:
- clk_put(clk);
-exit:
- return err;
-}
-
-static int __exit mx1_camera_remove(struct platform_device *pdev)
-{
- struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev);
- struct mx1_camera_dev *pcdev = container_of(soc_host,
- struct mx1_camera_dev, soc_host);
- struct resource *res;
-
- imx_dma_free(pcdev->dma_chan);
- disable_fiq(pcdev->irq);
- mxc_set_irq_fiq(pcdev->irq, 0);
- release_fiq(&fh);
-
- clk_put(pcdev->clk);
-
- soc_camera_host_unregister(soc_host);
-
- iounmap(pcdev->base);
-
- res = pcdev->res;
- release_mem_region(res->start, resource_size(res));
-
- kfree(pcdev);
-
- dev_info(&pdev->dev, "MX1 Camera driver unloaded\n");
-
- return 0;
-}
-
-static struct platform_driver mx1_camera_driver = {
- .driver = {
- .name = DRIVER_NAME,
- },
- .remove = __exit_p(mx1_camera_remove),
-};
-
-static int __init mx1_camera_init(void)
-{
- return platform_driver_probe(&mx1_camera_driver, mx1_camera_probe);
-}
-
-static void __exit mx1_camera_exit(void)
-{
- return platform_driver_unregister(&mx1_camera_driver);
-}
-
-module_init(mx1_camera_init);
-module_exit(mx1_camera_exit);
-
-MODULE_DESCRIPTION("i.MX1/i.MXL SoC Camera Host driver");
-MODULE_AUTHOR("Paulius Zaleckas <paulius.zaleckas@teltonika.lt>");
-MODULE_LICENSE("GPL v2");
-MODULE_VERSION(DRIVER_VERSION);
-MODULE_ALIAS("platform:" DRIVER_NAME);
diff --git a/include/linux/platform_data/camera-mx1.h b/include/linux/platform_data/camera-mx1.h
deleted file mode 100644
index 4fd6c70..0000000
--- a/include/linux/platform_data/camera-mx1.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * mx1_camera.h - i.MX1/i.MXL camera driver header file
- *
- * Copyright (c) 2008, Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
- * Copyright (C) 2009, Darius Augulis <augulis.darius@gmail.com>
- *
- * Based on PXA camera.h file:
- * Copyright (C) 2003, Intel Corporation
- * Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __ASM_ARCH_CAMERA_H_
-#define __ASM_ARCH_CAMERA_H_
-
-#define MX1_CAMERA_DATA_HIGH 1
-#define MX1_CAMERA_PCLK_RISING 2
-#define MX1_CAMERA_VSYNC_HIGH 4
-
-extern unsigned char mx1_camera_sof_fiq_start, mx1_camera_sof_fiq_end;
-
-/**
- * struct mx1_camera_pdata - i.MX1/i.MXL camera platform data
- * @mclk_10khz: master clock frequency in 10kHz units
- * @flags: MX1 camera platform flags
- */
-struct mx1_camera_pdata {
- unsigned long mclk_10khz;
- unsigned long flags;
-};
-
-#endif /* __ASM_ARCH_CAMERA_H_ */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 14/34] dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
2012-09-17 5:34 ` [PATCH 12/34] media: mx1_camera: remove the driver Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 9:26 ` Guennadi Liakhovetski
2012-09-17 5:34 ` [PATCH 26/34] media: mx2_camera: remove dead code in mx2_camera_add_device Shawn Guo
` (4 subsequent siblings)
6 siblings, 1 reply; 30+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Sascha Hauer, Fabio Estevam, Rob Herring, Arnd Bergmann,
Shawn Guo, Vinod Koul, Guennadi Liakhovetski,
Florian Tobias Schandinat, linux-media, linux-fbdev
The header ipu.h really belongs to dma subsystem rather than imx
platform. Rename it to ipu-dma.h and put it into include/linux/dma/.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: linux-media@vger.kernel.org
Cc: linux-fbdev@vger.kernel.org
---
drivers/dma/ipu/ipu_idmac.c | 3 +--
drivers/dma/ipu/ipu_irq.c | 3 +--
drivers/media/video/mx3_camera.c | 2 +-
drivers/video/mx3fb.c | 2 +-
.../mach/ipu.h => include/linux/dma/ipu-dma.h | 6 +++---
5 files changed, 7 insertions(+), 9 deletions(-)
rename arch/arm/mach-imx/include/mach/ipu.h => include/linux/dma/ipu-dma.h (97%)
diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c
index c7573e5..6585537 100644
--- a/drivers/dma/ipu/ipu_idmac.c
+++ b/drivers/dma/ipu/ipu_idmac.c
@@ -22,8 +22,7 @@
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
-
-#include <mach/ipu.h>
+#include <linux/dma/ipu-dma.h>
#include "../dmaengine.h"
#include "ipu_intern.h"
diff --git a/drivers/dma/ipu/ipu_irq.c b/drivers/dma/ipu/ipu_irq.c
index fa95bcc..a5ee37d 100644
--- a/drivers/dma/ipu/ipu_irq.c
+++ b/drivers/dma/ipu/ipu_irq.c
@@ -15,8 +15,7 @@
#include <linux/irq.h>
#include <linux/io.h>
#include <linux/module.h>
-
-#include <mach/ipu.h>
+#include <linux/dma/ipu-dma.h>
#include "ipu_intern.h"
diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
index 1481b0d..892cba5 100644
--- a/drivers/media/video/mx3_camera.c
+++ b/drivers/media/video/mx3_camera.c
@@ -17,6 +17,7 @@
#include <linux/vmalloc.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
+#include <linux/dma/ipu-dma.h>
#include <media/v4l2-common.h>
#include <media/v4l2-dev.h>
@@ -24,7 +25,6 @@
#include <media/soc_camera.h>
#include <media/soc_mediabus.h>
-#include <mach/ipu.h>
#include <linux/platform_data/camera-mx3.h>
#include <linux/platform_data/dma-imx.h>
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index d738108..3b63ad8 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -26,10 +26,10 @@
#include <linux/console.h>
#include <linux/clk.h>
#include <linux/mutex.h>
+#include <linux/dma/ipu-dma.h>
#include <linux/platform_data/dma-imx.h>
#include <mach/hardware.h>
-#include <mach/ipu.h>
#include <linux/platform_data/video-mx3fb.h>
#include <asm/io.h>
diff --git a/arch/arm/mach-imx/include/mach/ipu.h b/include/linux/dma/ipu-dma.h
similarity index 97%
rename from arch/arm/mach-imx/include/mach/ipu.h
rename to include/linux/dma/ipu-dma.h
index 539e559..1803111 100644
--- a/arch/arm/mach-imx/include/mach/ipu.h
+++ b/include/linux/dma/ipu-dma.h
@@ -9,8 +9,8 @@
* published by the Free Software Foundation.
*/
-#ifndef _IPU_H_
-#define _IPU_H_
+#ifndef __LINUX_DMA_IPU_DMA_H
+#define __LINUX_DMA_IPU_DMA_H
#include <linux/types.h>
#include <linux/dmaengine.h>
@@ -174,4 +174,4 @@ struct idmac_channel {
#define to_tx_desc(tx) container_of(tx, struct idmac_tx_desc, txd)
#define to_idmac_chan(c) container_of(c, struct idmac_channel, dma_chan)
-#endif
+#endif /* __LINUX_DMA_IPU_DMA_H */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 26/34] media: mx2_camera: remove dead code in mx2_camera_add_device
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
2012-09-17 5:34 ` [PATCH 12/34] media: mx1_camera: remove the driver Shawn Guo
2012-09-17 5:34 ` [PATCH 14/34] dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 8:18 ` Guennadi Liakhovetski
2012-09-17 5:34 ` [PATCH 27/34] media: mx2_camera: use managed functions to clean up code Shawn Guo
` (3 subsequent siblings)
6 siblings, 1 reply; 30+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Sascha Hauer, Fabio Estevam, Rob Herring, Arnd Bergmann,
Shawn Guo, Guennadi Liakhovetski, linux-media
This is a piece of code becoming dead since commit 2c9ba37 ([media]
V4L: mx2_camera: remove unsupported i.MX27 DMA mode, make EMMA
mandatory). It should have been removed together with the commit.
Remove it now.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-media@vger.kernel.org
---
drivers/media/video/mx2_camera.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
index 965427f..89c7e28 100644
--- a/drivers/media/video/mx2_camera.c
+++ b/drivers/media/video/mx2_camera.c
@@ -441,11 +441,9 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
csicr1 = CSICR1_MCLKEN;
- if (cpu_is_mx27()) {
+ if (cpu_is_mx27())
csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
CSICR1_RXFF_LEVEL(0);
- } else if (cpu_is_mx27())
- csicr1 |= CSICR1_SOF_INTEN | CSICR1_RXFF_LEVEL(2);
pcdev->csicr1 = csicr1;
writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 27/34] media: mx2_camera: use managed functions to clean up code
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (2 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 26/34] media: mx2_camera: remove dead code in mx2_camera_add_device Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 9:11 ` Guennadi Liakhovetski
2012-09-17 5:34 ` [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion Shawn Guo
` (2 subsequent siblings)
6 siblings, 1 reply; 30+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Sascha Hauer, Fabio Estevam, Rob Herring, Arnd Bergmann,
Shawn Guo, Guennadi Liakhovetski, linux-media
Use managed functions to clean up the error handling code and function
mx2_camera_remove(). Along with the change, a few variables get removed
from struct mx2_camera_dev.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-media@vger.kernel.org
---
drivers/media/video/mx2_camera.c | 143 +++++++++++---------------------------
1 file changed, 39 insertions(+), 104 deletions(-)
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
index 89c7e28..fe4c76c 100644
--- a/drivers/media/video/mx2_camera.c
+++ b/drivers/media/video/mx2_camera.c
@@ -274,12 +274,9 @@ struct mx2_camera_dev {
struct soc_camera_device *icd;
struct clk *clk_csi, *clk_emma_ahb, *clk_emma_ipg;
- unsigned int irq_csi, irq_emma;
void __iomem *base_csi, *base_emma;
- unsigned long base_dma;
struct mx2_camera_platform_data *pdata;
- struct resource *res_csi, *res_emma;
unsigned long platform_flags;
struct list_head capture;
@@ -1607,64 +1604,59 @@ static irqreturn_t mx27_camera_emma_irq(int irq_emma, void *data)
return IRQ_HANDLED;
}
-static int __devinit mx27_camera_emma_init(struct mx2_camera_dev *pcdev)
+static int __devinit mx27_camera_emma_init(struct platform_device *pdev)
{
- struct resource *res_emma = pcdev->res_emma;
+ struct mx2_camera_dev *pcdev = platform_get_drvdata(pdev);
+ struct resource *res_emma;
+ int irq_emma;
int err = 0;
- if (!request_mem_region(res_emma->start, resource_size(res_emma),
- MX2_CAM_DRV_NAME)) {
- err = -EBUSY;
+ res_emma = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+ irq_emma = platform_get_irq(pdev, 1);
+ if (!res_emma || !irq_emma) {
+ dev_err(pcdev->dev, "no EMMA resources\n");
goto out;
}
- pcdev->base_emma = ioremap(res_emma->start, resource_size(res_emma));
+ pcdev->base_emma = devm_request_and_ioremap(pcdev->dev, res_emma);
if (!pcdev->base_emma) {
- err = -ENOMEM;
- goto exit_release;
+ err = -EADDRNOTAVAIL;
+ goto out;
}
- err = request_irq(pcdev->irq_emma, mx27_camera_emma_irq, 0,
- MX2_CAM_DRV_NAME, pcdev);
+ err = devm_request_irq(pcdev->dev, irq_emma, mx27_camera_emma_irq, 0,
+ MX2_CAM_DRV_NAME, pcdev);
if (err) {
dev_err(pcdev->dev, "Camera EMMA interrupt register failed \n");
- goto exit_iounmap;
+ goto out;
}
- pcdev->clk_emma_ipg = clk_get(pcdev->dev, "emma-ipg");
+ pcdev->clk_emma_ipg = devm_clk_get(pcdev->dev, "emma-ipg");
if (IS_ERR(pcdev->clk_emma_ipg)) {
err = PTR_ERR(pcdev->clk_emma_ipg);
- goto exit_free_irq;
+ goto out;
}
clk_prepare_enable(pcdev->clk_emma_ipg);
- pcdev->clk_emma_ahb = clk_get(pcdev->dev, "emma-ahb");
+ pcdev->clk_emma_ahb = devm_clk_get(pcdev->dev, "emma-ahb");
if (IS_ERR(pcdev->clk_emma_ahb)) {
err = PTR_ERR(pcdev->clk_emma_ahb);
- goto exit_clk_emma_ipg_put;
+ goto exit_clk_emma_ipg;
}
clk_prepare_enable(pcdev->clk_emma_ahb);
err = mx27_camera_emma_prp_reset(pcdev);
if (err)
- goto exit_clk_emma_ahb_put;
+ goto exit_clk_emma_ahb;
return err;
-exit_clk_emma_ahb_put:
+exit_clk_emma_ahb:
clk_disable_unprepare(pcdev->clk_emma_ahb);
- clk_put(pcdev->clk_emma_ahb);
-exit_clk_emma_ipg_put:
+exit_clk_emma_ipg:
clk_disable_unprepare(pcdev->clk_emma_ipg);
- clk_put(pcdev->clk_emma_ipg);
-exit_free_irq:
- free_irq(pcdev->irq_emma, pcdev);
-exit_iounmap:
- iounmap(pcdev->base_emma);
-exit_release:
- release_mem_region(res_emma->start, resource_size(res_emma));
out:
return err;
}
@@ -1672,9 +1664,8 @@ out:
static int __devinit mx2_camera_probe(struct platform_device *pdev)
{
struct mx2_camera_dev *pcdev;
- struct resource *res_csi, *res_emma;
- void __iomem *base_csi;
- int irq_csi, irq_emma;
+ struct resource *res_csi;
+ int irq_csi;
int err = 0;
dev_dbg(&pdev->dev, "initialising\n");
@@ -1687,21 +1678,20 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
goto exit;
}
- pcdev = kzalloc(sizeof(*pcdev), GFP_KERNEL);
+ pcdev = devm_kzalloc(&pdev->dev, sizeof(*pcdev), GFP_KERNEL);
if (!pcdev) {
dev_err(&pdev->dev, "Could not allocate pcdev\n");
err = -ENOMEM;
goto exit;
}
- pcdev->clk_csi = clk_get(&pdev->dev, "ahb");
+ pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
if (IS_ERR(pcdev->clk_csi)) {
dev_err(&pdev->dev, "Could not get csi clock\n");
err = PTR_ERR(pcdev->clk_csi);
- goto exit_kfree;
+ goto exit;
}
- pcdev->res_csi = res_csi;
pcdev->pdata = pdev->dev.platform_data;
if (pcdev->pdata) {
long rate;
@@ -1711,11 +1701,11 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
rate = clk_round_rate(pcdev->clk_csi, pcdev->pdata->clk * 2);
if (rate <= 0) {
err = -ENODEV;
- goto exit_dma_free;
+ goto exit;
}
err = clk_set_rate(pcdev->clk_csi, rate);
if (err < 0)
- goto exit_dma_free;
+ goto exit;
}
INIT_LIST_HEAD(&pcdev->capture);
@@ -1723,48 +1713,28 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&pcdev->discard);
spin_lock_init(&pcdev->lock);
- /*
- * Request the regions.
- */
- if (!request_mem_region(res_csi->start, resource_size(res_csi),
- MX2_CAM_DRV_NAME)) {
- err = -EBUSY;
- goto exit_dma_free;
+ pcdev->base_csi = devm_request_and_ioremap(&pdev->dev, res_csi);
+ if (!pcdev->base_csi) {
+ err = -EADDRNOTAVAIL;
+ goto exit;
}
- base_csi = ioremap(res_csi->start, resource_size(res_csi));
- if (!base_csi) {
- err = -ENOMEM;
- goto exit_release;
- }
- pcdev->irq_csi = irq_csi;
- pcdev->base_csi = base_csi;
- pcdev->base_dma = res_csi->start;
pcdev->dev = &pdev->dev;
+ platform_set_drvdata(pdev, pcdev);
if (cpu_is_mx25()) {
- err = request_irq(pcdev->irq_csi, mx25_camera_irq, 0,
- MX2_CAM_DRV_NAME, pcdev);
+ err = devm_request_irq(&pdev->dev, irq_csi, mx25_camera_irq, 0,
+ MX2_CAM_DRV_NAME, pcdev);
if (err) {
dev_err(pcdev->dev, "Camera interrupt register failed \n");
- goto exit_iounmap;
+ goto exit;
}
}
if (cpu_is_mx27()) {
- /* EMMA support */
- res_emma = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- irq_emma = platform_get_irq(pdev, 1);
-
- if (!res_emma || !irq_emma) {
- dev_err(&pdev->dev, "no EMMA resources\n");
- goto exit_free_irq;
- }
-
- pcdev->res_emma = res_emma;
- pcdev->irq_emma = irq_emma;
- if (mx27_camera_emma_init(pcdev))
- goto exit_free_irq;
+ err = mx27_camera_emma_init(pdev);
+ if (err)
+ goto exit;
}
pcdev->soc_host.drv_name = MX2_CAM_DRV_NAME,
@@ -1793,25 +1763,9 @@ exit_free_emma:
vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
eallocctx:
if (cpu_is_mx27()) {
- free_irq(pcdev->irq_emma, pcdev);
clk_disable_unprepare(pcdev->clk_emma_ipg);
- clk_put(pcdev->clk_emma_ipg);
clk_disable_unprepare(pcdev->clk_emma_ahb);
- clk_put(pcdev->clk_emma_ahb);
- iounmap(pcdev->base_emma);
- release_mem_region(pcdev->res_emma->start, resource_size(pcdev->res_emma));
}
-exit_free_irq:
- if (cpu_is_mx25())
- free_irq(pcdev->irq_csi, pcdev);
-exit_iounmap:
- iounmap(base_csi);
-exit_release:
- release_mem_region(res_csi->start, resource_size(res_csi));
-exit_dma_free:
- clk_put(pcdev->clk_csi);
-exit_kfree:
- kfree(pcdev);
exit:
return err;
}
@@ -1821,35 +1775,16 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev);
struct mx2_camera_dev *pcdev = container_of(soc_host,
struct mx2_camera_dev, soc_host);
- struct resource *res;
-
- clk_put(pcdev->clk_csi);
- if (cpu_is_mx25())
- free_irq(pcdev->irq_csi, pcdev);
- if (cpu_is_mx27())
- free_irq(pcdev->irq_emma, pcdev);
soc_camera_host_unregister(&pcdev->soc_host);
vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
- iounmap(pcdev->base_csi);
-
if (cpu_is_mx27()) {
clk_disable_unprepare(pcdev->clk_emma_ipg);
- clk_put(pcdev->clk_emma_ipg);
clk_disable_unprepare(pcdev->clk_emma_ahb);
- clk_put(pcdev->clk_emma_ahb);
- iounmap(pcdev->base_emma);
- res = pcdev->res_emma;
- release_mem_region(res->start, resource_size(res));
}
- res = pcdev->res_csi;
- release_mem_region(res->start, resource_size(res));
-
- kfree(pcdev);
-
dev_info(&pdev->dev, "MX2 Camera driver unloaded\n");
return 0;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (3 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 27/34] media: mx2_camera: use managed functions to clean up code Shawn Guo
@ 2012-09-17 5:34 ` Shawn Guo
2012-09-17 9:21 ` Guennadi Liakhovetski
2012-09-17 7:51 ` [PATCH 00/34] i.MX multi-platform support Sascha Hauer
2012-09-18 7:52 ` Sascha Hauer
6 siblings, 1 reply; 30+ messages in thread
From: Shawn Guo @ 2012-09-17 5:34 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Sascha Hauer, Fabio Estevam, Rob Herring, Arnd Bergmann,
Shawn Guo, Guennadi Liakhovetski, linux-media
It changes the driver to use platform_device_id rather than cpu_is_xxx
to determine the controller type, and updates the platform code
accordingly.
As the result, mach/hardware.h inclusion gets removed from the driver.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-media@vger.kernel.org
---
arch/arm/mach-imx/clk-imx25.c | 6 +-
arch/arm/mach-imx/clk-imx27.c | 6 +-
arch/arm/mach-imx/devices/devices-common.h | 1 +
arch/arm/mach-imx/devices/platform-mx2-camera.c | 12 +--
drivers/media/video/mx2_camera.c | 95 +++++++++++++++++------
5 files changed, 85 insertions(+), 35 deletions(-)
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
index 1aea073..71fe521 100644
--- a/arch/arm/mach-imx/clk-imx25.c
+++ b/arch/arm/mach-imx/clk-imx25.c
@@ -231,9 +231,9 @@ int __init mx25_clocks_init(void)
clk_register_clkdev(clk[esdhc2_ipg_per], "per", "sdhci-esdhc-imx25.1");
clk_register_clkdev(clk[esdhc2_ipg], "ipg", "sdhci-esdhc-imx25.1");
clk_register_clkdev(clk[esdhc2_ahb], "ahb", "sdhci-esdhc-imx25.1");
- clk_register_clkdev(clk[csi_ipg_per], "per", "mx2-camera.0");
- clk_register_clkdev(clk[csi_ipg], "ipg", "mx2-camera.0");
- clk_register_clkdev(clk[csi_ahb], "ahb", "mx2-camera.0");
+ clk_register_clkdev(clk[csi_ipg_per], "per", "imx25-camera.0");
+ clk_register_clkdev(clk[csi_ipg], "ipg", "imx25-camera.0");
+ clk_register_clkdev(clk[csi_ahb], "ahb", "imx25-camera.0");
clk_register_clkdev(clk[dummy], "audmux", NULL);
clk_register_clkdev(clk[can1_ipg], NULL, "flexcan.0");
clk_register_clkdev(clk[can2_ipg], NULL, "flexcan.1");
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index 5ff5cf0..e26de52 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -224,7 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
clk_register_clkdev(clk[per3_gate], "per", "imx-fb.0");
clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
- clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
+ clk_register_clkdev(clk[csi_ahb_gate], "ahb", "imx27-camera.0");
clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
@@ -251,8 +251,8 @@ int __init mx27_clocks_init(unsigned long fref)
clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx21-i2c.1");
clk_register_clkdev(clk[owire_ipg_gate], NULL, "mxc_w1.0");
clk_register_clkdev(clk[kpp_ipg_gate], NULL, "imx-keypad");
- clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "mx2-camera.0");
- clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "mx2-camera.0");
+ clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "imx27-camera.0");
+ clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "imx27-camera.0");
clk_register_clkdev(clk[emma_ahb_gate], "ahb", "m2m-emmaprp.0");
clk_register_clkdev(clk[emma_ipg_gate], "ipg", "m2m-emmaprp.0");
clk_register_clkdev(clk[iim_ipg_gate], "iim", NULL);
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
index 7f2698c..8112a1a 100644
--- a/arch/arm/mach-imx/devices/devices-common.h
+++ b/arch/arm/mach-imx/devices/devices-common.h
@@ -202,6 +202,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
#include <linux/platform_data/camera-mx2.h>
struct imx_mx2_camera_data {
+ const char *devid;
resource_size_t iobasecsi;
resource_size_t iosizecsi;
resource_size_t irqcsi;
diff --git a/arch/arm/mach-imx/devices/platform-mx2-camera.c b/arch/arm/mach-imx/devices/platform-mx2-camera.c
index 9ad5b2d..b88877d 100644
--- a/arch/arm/mach-imx/devices/platform-mx2-camera.c
+++ b/arch/arm/mach-imx/devices/platform-mx2-camera.c
@@ -9,14 +9,16 @@
#include <mach/hardware.h>
#include "devices-common.h"
-#define imx_mx2_camera_data_entry_single(soc) \
+#define imx_mx2_camera_data_entry_single(soc, _devid) \
{ \
+ .devid = _devid, \
.iobasecsi = soc ## _CSI_BASE_ADDR, \
.iosizecsi = SZ_4K, \
.irqcsi = soc ## _INT_CSI, \
}
-#define imx_mx2_camera_data_entry_single_emma(soc) \
+#define imx_mx2_camera_data_entry_single_emma(soc, _devid) \
{ \
+ .devid = _devid, \
.iobasecsi = soc ## _CSI_BASE_ADDR, \
.iosizecsi = SZ_32, \
.irqcsi = soc ## _INT_CSI, \
@@ -27,12 +29,12 @@
#ifdef CONFIG_SOC_IMX25
const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst =
- imx_mx2_camera_data_entry_single(MX25);
+ imx_mx2_camera_data_entry_single(MX25, "imx25-camera");
#endif /* ifdef CONFIG_SOC_IMX25 */
#ifdef CONFIG_SOC_IMX27
const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst =
- imx_mx2_camera_data_entry_single_emma(MX27);
+ imx_mx2_camera_data_entry_single_emma(MX27, "imx27-camera");
#endif /* ifdef CONFIG_SOC_IMX27 */
struct platform_device *__init imx_add_mx2_camera(
@@ -58,7 +60,7 @@ struct platform_device *__init imx_add_mx2_camera(
.flags = IORESOURCE_IRQ,
},
};
- return imx_add_platform_device_dmamask("mx2-camera", 0,
+ return imx_add_platform_device_dmamask(data->devid, 0,
res, data->iobaseemmaprp ? 4 : 2,
pdata, sizeof(*pdata), DMA_BIT_MASK(32));
}
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
index fe4c76c..cde3374 100644
--- a/drivers/media/video/mx2_camera.c
+++ b/drivers/media/video/mx2_camera.c
@@ -41,7 +41,6 @@
#include <linux/videodev2.h>
#include <linux/platform_data/camera-mx2.h>
-#include <mach/hardware.h>
#include <asm/dma.h>
@@ -121,11 +120,13 @@
#define CSICR1 0x00
#define CSICR2 0x04
-#define CSISR (cpu_is_mx27() ? 0x08 : 0x18)
+#define CSISR_IMX25 0x18
+#define CSISR_IMX27 0x08
#define CSISTATFIFO 0x0c
#define CSIRFIFO 0x10
#define CSIRXCNT 0x14
-#define CSICR3 (cpu_is_mx27() ? 0x1C : 0x08)
+#define CSICR3_IMX25 0x08
+#define CSICR3_IMX27 0x1c
#define CSIDMASA_STATFIFO 0x20
#define CSIDMATA_STATFIFO 0x24
#define CSIDMASA_FB1 0x28
@@ -268,6 +269,11 @@ struct mx2_buffer {
struct mx2_buf_internal internal;
};
+enum mx2_camera_type {
+ IMX25_CAMERA,
+ IMX27_CAMERA,
+};
+
struct mx2_camera_dev {
struct device *dev;
struct soc_camera_host soc_host;
@@ -291,6 +297,9 @@ struct mx2_camera_dev {
struct mx2_buffer *fb2_active;
u32 csicr1;
+ u32 reg_csisr;
+ u32 reg_csicr3;
+ enum mx2_camera_type devtype;
struct mx2_buf_internal buf_discard[2];
void *discard_buffer;
@@ -303,6 +312,29 @@ struct mx2_camera_dev {
struct vb2_alloc_ctx *alloc_ctx;
};
+static struct platform_device_id mx2_camera_devtype[] = {
+ {
+ .name = "imx25-camera",
+ .driver_data = IMX25_CAMERA,
+ }, {
+ .name = "imx27-camera",
+ .driver_data = IMX27_CAMERA,
+ }, {
+ /* sentinel */
+ }
+};
+MODULE_DEVICE_TABLE(platform, mx2_camera_devtype);
+
+static inline int is_imx25_camera(struct mx2_camera_dev *pcdev)
+{
+ return pcdev->devtype == IMX25_CAMERA;
+}
+
+static inline int is_imx27_camera(struct mx2_camera_dev *pcdev)
+{
+ return pcdev->devtype == IMX27_CAMERA;
+}
+
static struct mx2_buffer *mx2_ibuf_to_buf(struct mx2_buf_internal *int_buf)
{
return container_of(int_buf, struct mx2_buffer, internal);
@@ -406,9 +438,9 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
clk_disable_unprepare(pcdev->clk_csi);
writel(0, pcdev->base_csi + CSICR1);
- if (cpu_is_mx27()) {
+ if (is_imx27_camera(pcdev)) {
writel(0, pcdev->base_emma + PRP_CNTL);
- } else if (cpu_is_mx25()) {
+ } else if (is_imx25_camera(pcdev)) {
spin_lock_irqsave(&pcdev->lock, flags);
pcdev->fb1_active = NULL;
pcdev->fb2_active = NULL;
@@ -438,7 +470,7 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
csicr1 = CSICR1_MCLKEN;
- if (cpu_is_mx27())
+ if (is_imx27_camera(pcdev))
csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
CSICR1_RXFF_LEVEL(0);
@@ -514,7 +546,7 @@ out:
static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
{
struct mx2_camera_dev *pcdev = data;
- u32 status = readl(pcdev->base_csi + CSISR);
+ u32 status = readl(pcdev->base_csi + pcdev->reg_csisr);
if (status & CSISR_DMA_TSF_FB1_INT)
mx25_camera_frame_done(pcdev, 1, MX2_STATE_DONE);
@@ -523,7 +555,7 @@ static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
/* FIXME: handle CSISR_RFF_OR_INT */
- writel(status, pcdev->base_csi + CSISR);
+ writel(status, pcdev->base_csi + pcdev->reg_csisr);
return IRQ_HANDLED;
}
@@ -608,7 +640,7 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
buf->state = MX2_STATE_QUEUED;
list_add_tail(&buf->internal.queue, &pcdev->capture);
- if (cpu_is_mx25()) {
+ if (is_imx25_camera(pcdev)) {
u32 csicr3, dma_inten = 0;
if (pcdev->fb1_active == NULL) {
@@ -627,20 +659,20 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
list_del(&buf->internal.queue);
buf->state = MX2_STATE_ACTIVE;
- csicr3 = readl(pcdev->base_csi + CSICR3);
+ csicr3 = readl(pcdev->base_csi + pcdev->reg_csicr3);
/* Reflash DMA */
writel(csicr3 | CSICR3_DMA_REFLASH_RFF,
- pcdev->base_csi + CSICR3);
+ pcdev->base_csi + pcdev->reg_csicr3);
/* clear & enable interrupts */
- writel(dma_inten, pcdev->base_csi + CSISR);
+ writel(dma_inten, pcdev->base_csi + pcdev->reg_csisr);
pcdev->csicr1 |= dma_inten;
writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
/* enable DMA */
csicr3 |= CSICR3_DMA_REQ_EN_RFF | CSICR3_RXFF_LEVEL(1);
- writel(csicr3, pcdev->base_csi + CSICR3);
+ writel(csicr3, pcdev->base_csi + pcdev->reg_csicr3);
}
}
@@ -684,7 +716,7 @@ static void mx2_videobuf_release(struct vb2_buffer *vb)
*/
spin_lock_irqsave(&pcdev->lock, flags);
- if (cpu_is_mx25() && buf->state == MX2_STATE_ACTIVE) {
+ if (is_imx25_camera(pcdev) && buf->state == MX2_STATE_ACTIVE) {
if (pcdev->fb1_active == buf) {
pcdev->csicr1 &= ~CSICR1_FB1_DMA_INTEN;
writel(0, pcdev->base_csi + CSIDMASA_FB1);
@@ -807,7 +839,7 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count)
unsigned long phys;
int bytesperline;
- if (cpu_is_mx27()) {
+ if (is_imx27_camera(pcdev)) {
unsigned long flags;
if (count < 2)
return -EINVAL;
@@ -902,7 +934,7 @@ static int mx2_stop_streaming(struct vb2_queue *q)
void *b;
u32 cntl;
- if (cpu_is_mx27()) {
+ if (is_imx27_camera(pcdev)) {
spin_lock_irqsave(&pcdev->lock, flags);
cntl = readl(pcdev->base_emma + PRP_CNTL);
@@ -1054,11 +1086,11 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd)
if (bytesperline < 0)
return bytesperline;
- if (cpu_is_mx27()) {
+ if (is_imx27_camera(pcdev)) {
ret = mx27_camera_emma_prp_reset(pcdev);
if (ret)
return ret;
- } else if (cpu_is_mx25()) {
+ } else if (is_imx25_camera(pcdev)) {
writel((bytesperline * icd->user_height) >> 2,
pcdev->base_csi + CSIRXCNT);
writel((bytesperline << 16) | icd->user_height,
@@ -1351,7 +1383,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
/* FIXME: implement MX27 limits */
/* limit to MX25 hardware capabilities */
- if (cpu_is_mx25()) {
+ if (is_imx25_camera(pcdev)) {
if (xlate->host_fmt->bits_per_sample <= 8)
width_limit = 0xffff * 4;
else
@@ -1685,6 +1717,20 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
goto exit;
}
+ pcdev->devtype = pdev->id_entry->driver_data;
+ switch (pcdev->devtype) {
+ case IMX25_CAMERA:
+ pcdev->reg_csisr = CSISR_IMX25;
+ pcdev->reg_csicr3 = CSICR3_IMX25;
+ break;
+ case IMX27_CAMERA:
+ pcdev->reg_csisr = CSISR_IMX27;
+ pcdev->reg_csicr3 = CSICR3_IMX27;
+ break;
+ default:
+ break;
+ }
+
pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
if (IS_ERR(pcdev->clk_csi)) {
dev_err(&pdev->dev, "Could not get csi clock\n");
@@ -1722,7 +1768,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
pcdev->dev = &pdev->dev;
platform_set_drvdata(pdev, pcdev);
- if (cpu_is_mx25()) {
+ if (is_imx25_camera(pcdev)) {
err = devm_request_irq(&pdev->dev, irq_csi, mx25_camera_irq, 0,
MX2_CAM_DRV_NAME, pcdev);
if (err) {
@@ -1731,7 +1777,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
}
}
- if (cpu_is_mx27()) {
+ if (is_imx27_camera(pcdev)) {
err = mx27_camera_emma_init(pdev);
if (err)
goto exit;
@@ -1742,7 +1788,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
pcdev->soc_host.priv = pcdev;
pcdev->soc_host.v4l2_dev.dev = &pdev->dev;
pcdev->soc_host.nr = pdev->id;
- if (cpu_is_mx25())
+ if (is_imx25_camera(pcdev))
pcdev->soc_host.capabilities = SOCAM_HOST_CAP_STRIDE;
pcdev->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev);
@@ -1762,7 +1808,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
exit_free_emma:
vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
eallocctx:
- if (cpu_is_mx27()) {
+ if (is_imx27_camera(pcdev)) {
clk_disable_unprepare(pcdev->clk_emma_ipg);
clk_disable_unprepare(pcdev->clk_emma_ahb);
}
@@ -1780,7 +1826,7 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
- if (cpu_is_mx27()) {
+ if (is_imx27_camera(pcdev)) {
clk_disable_unprepare(pcdev->clk_emma_ipg);
clk_disable_unprepare(pcdev->clk_emma_ahb);
}
@@ -1794,6 +1840,7 @@ static struct platform_driver mx2_camera_driver = {
.driver = {
.name = MX2_CAM_DRV_NAME,
},
+ .id_table = mx2_camera_devtype,
.remove = __devexit_p(mx2_camera_remove),
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH 00/34] i.MX multi-platform support
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (4 preceding siblings ...)
2012-09-17 5:34 ` [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion Shawn Guo
@ 2012-09-17 7:51 ` Sascha Hauer
2012-09-17 11:38 ` Arnd Bergmann
2012-09-18 8:20 ` Shawn Guo
2012-09-18 7:52 ` Sascha Hauer
6 siblings, 2 replies; 30+ messages in thread
From: Sascha Hauer @ 2012-09-17 7:51 UTC (permalink / raw)
To: Shawn Guo
Cc: linux-arm-kernel, Fabio Estevam, Rob Herring, Arnd Bergmann,
Mark Brown, alsa-devel, Florian Tobias Schandinat, linux-fbdev,
Chris Ball, linux-mmc, Guennadi Liakhovetski, linux-media,
Andrew Morton, rtc-linux, Artem Bityutskiy, linux-mtd,
Wolfram Sang, linux-i2c, Wim Van Sebroeck, linux-watchdog,
Greg Kroah-Hartman, linux-usb, Vinod Koul, Javier Martin,
Paulius Zaleckas
Hi Shawn,
On Mon, Sep 17, 2012 at 01:34:29PM +0800, Shawn Guo wrote:
> The series enables multi-platform support for imx. Since the required
> frameworks (clk, pwm) and spare_irq have already been adopted on imx,
> the series is all about cleaning up mach/* headers. Along with the
> changes, arch/arm/plat-mxc gets merged into arch/arm/mach-imx.
>
> It's based on a bunch of branches (works from others), Rob's initial
> multi-platform series, Arnd's platform-data and smp_ops (Marc's) and
> imx 3.7 material (Sascha and myself).
>
> It's available on branch below.
>
> git://git.linaro.org/people/shawnguo/linux-2.6.git imx/multi-platform
>
> It's been tested on imx5 and imx6, and only compile-tested on imx2 and
> imx3, so testing on imx2/3 are appreciated.
Great work! This really pushes the i.MX architecture one step closer to
a clean code base.
I gave it a test on i.MX1, i.MX27, i.MX31 and i.MX35. All run fine, but
the last patch breaks the imx_v4_v5_defconfig: Somehow it now defaults
to ARMv7 based machines. I haven't looked into it, just reenabled
ARMv4/ARMv5 and the boards again -> works. The config should be updated
with the last patch.
I'm fine with the changes to mx2-camera, but Javier should give his ok
to it, he has worked on it quite a lot recently.
One other issue related to imx-dma, see comment to that patch.
Otherwise:
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Thanks
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 26/34] media: mx2_camera: remove dead code in mx2_camera_add_device
2012-09-17 5:34 ` [PATCH 26/34] media: mx2_camera: remove dead code in mx2_camera_add_device Shawn Guo
@ 2012-09-17 8:18 ` Guennadi Liakhovetski
2012-09-17 13:36 ` javier Martin
2012-09-18 1:49 ` Shawn Guo
0 siblings, 2 replies; 30+ messages in thread
From: Guennadi Liakhovetski @ 2012-09-17 8:18 UTC (permalink / raw)
To: Shawn Guo
Cc: linux-arm-kernel, Sascha Hauer, Fabio Estevam, Rob Herring,
Arnd Bergmann, linux-media
Hi Shawn
Thanks for the clean up. Would you like these patches to go via a single
tree, presumably, arm-soc? In this case
On Mon, 17 Sep 2012, Shawn Guo wrote:
> This is a piece of code becoming dead since commit 2c9ba37 ([media]
> V4L: mx2_camera: remove unsupported i.MX27 DMA mode, make EMMA
> mandatory). It should have been removed together with the commit.
> Remove it now.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: linux-media@vger.kernel.org
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Thanks
Guennadi
> ---
> drivers/media/video/mx2_camera.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
> index 965427f..89c7e28 100644
> --- a/drivers/media/video/mx2_camera.c
> +++ b/drivers/media/video/mx2_camera.c
> @@ -441,11 +441,9 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
>
> csicr1 = CSICR1_MCLKEN;
>
> - if (cpu_is_mx27()) {
> + if (cpu_is_mx27())
> csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
> CSICR1_RXFF_LEVEL(0);
> - } else if (cpu_is_mx27())
> - csicr1 |= CSICR1_SOF_INTEN | CSICR1_RXFF_LEVEL(2);
>
> pcdev->csicr1 = csicr1;
> writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
> --
> 1.7.9.5
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 12/34] media: mx1_camera: remove the driver
2012-09-17 5:34 ` [PATCH 12/34] media: mx1_camera: remove the driver Shawn Guo
@ 2012-09-17 8:33 ` Guennadi Liakhovetski
2012-09-18 1:28 ` Shawn Guo
0 siblings, 1 reply; 30+ messages in thread
From: Guennadi Liakhovetski @ 2012-09-17 8:33 UTC (permalink / raw)
To: Shawn Guo
Cc: linux-arm-kernel, Sascha Hauer, Fabio Estevam, Rob Herring,
Arnd Bergmann, Paulius Zaleckas, linux-media
On Mon, 17 Sep 2012, Shawn Guo wrote:
> The mx1_camera driver has been broken for a few release cycles since
> commit 6bd0812 (dmaengine: imx-dma: merge old dma-v1.c with imx-dma.c).
> It seems there is no one even compile tested it since then, as doing
> so will end up with the following error.
>
> CC drivers/media/video/mx1_camera.o
> In file included from drivers/media/video/mx1_camera.c:44:0:
> arch/arm/mach-imx/include/mach/dma-mx1-mx2.h:8:25: fatal error: mach/dma-v1.h: No such file or directory
>
> It looks that all the related folks have known the breakage [1], but
> no one shows the interest to bring it back to work. Thus it becomes
> a piece of unmaintained code, so let's remove it.
>
> [1] https://lkml.org/lkml/2012/2/9/171
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: linux-media@vger.kernel.org
Ok, it used to compile not-so-long-ago, but it doesn't seem to be cared
for a lot lately. Let's give Paulius a bit more time to react to this
mail, otherwise I'll have no objections. Just as an idea, to make it a bit
milder we could first mark it BROKEN and add to remove schedule... But I
don't mind either way.
Thanks
Guennadi
> ---
> arch/arm/mach-imx/Makefile | 3 -
> arch/arm/mach-imx/clk-imx1.c | 1 -
> arch/arm/mach-imx/devices/Kconfig | 3 -
> arch/arm/mach-imx/devices/Makefile | 1 -
> arch/arm/mach-imx/devices/devices-common.h | 10 -
> arch/arm/mach-imx/devices/platform-mx1-camera.c | 42 --
> arch/arm/mach-imx/mx1-camera-fiq-ksym.c | 18 -
> arch/arm/mach-imx/mx1-camera-fiq.S | 35 -
> drivers/media/video/Kconfig | 12 -
> drivers/media/video/Makefile | 1 -
> drivers/media/video/mx1_camera.c | 889 -----------------------
> include/linux/platform_data/camera-mx1.h | 35 -
> 12 files changed, 1050 deletions(-)
> delete mode 100644 arch/arm/mach-imx/devices/platform-mx1-camera.c
> delete mode 100644 arch/arm/mach-imx/mx1-camera-fiq-ksym.c
> delete mode 100644 arch/arm/mach-imx/mx1-camera-fiq.S
> delete mode 100644 drivers/media/video/mx1_camera.c
> delete mode 100644 include/linux/platform_data/camera-mx1.h
>
> diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> index fe47b71..538d0ee 100644
> --- a/arch/arm/mach-imx/Makefile
> +++ b/arch/arm/mach-imx/Makefile
> @@ -35,9 +35,6 @@ obj-y += ssi-fiq.o
> obj-y += ssi-fiq-ksym.o
> endif
>
> -# Support for CMOS sensor interface
> -obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o
> -
> # i.MX1 based machines
> obj-$(CONFIG_ARCH_MX1ADS) += mach-mx1ads.o
> obj-$(CONFIG_MACH_SCB9328) += mach-scb9328.o
> diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
> index b5f90cc..ebfffd2 100644
> --- a/arch/arm/mach-imx/clk-imx1.c
> +++ b/arch/arm/mach-imx/clk-imx1.c
> @@ -84,7 +84,6 @@ int __init mx1_clocks_init(unsigned long fref)
> i, PTR_ERR(clk[i]));
>
> clk_register_clkdev(clk[dma_gate], "ahb", "imx-dma");
> - clk_register_clkdev(clk[csi_gate], NULL, "mx1-camera.0");
> clk_register_clkdev(clk[mma_gate], "mma", NULL);
> clk_register_clkdev(clk[usbd_gate], NULL, "imx_udc.0");
> clk_register_clkdev(clk[per1], "per", "imx-gpt.0");
> diff --git a/arch/arm/mach-imx/devices/Kconfig b/arch/arm/mach-imx/devices/Kconfig
> index cb3e3ee..09d796e 100644
> --- a/arch/arm/mach-imx/devices/Kconfig
> +++ b/arch/arm/mach-imx/devices/Kconfig
> @@ -46,9 +46,6 @@ config IMX_HAVE_PLATFORM_IMX_UDC
> config IMX_HAVE_PLATFORM_IPU_CORE
> bool
>
> -config IMX_HAVE_PLATFORM_MX1_CAMERA
> - bool
> -
> config IMX_HAVE_PLATFORM_MX2_CAMERA
> bool
>
> diff --git a/arch/arm/mach-imx/devices/Makefile b/arch/arm/mach-imx/devices/Makefile
> index ff22ed1..3cfdc37 100644
> --- a/arch/arm/mach-imx/devices/Makefile
> +++ b/arch/arm/mach-imx/devices/Makefile
> @@ -17,7 +17,6 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o
> obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o
> obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o
> obj-$(CONFIG_IMX_HAVE_PLATFORM_IPU_CORE) += platform-ipu-core.o
> -obj-$(CONFIG_IMX_HAVE_PLATFORM_MX1_CAMERA) += platform-mx1-camera.o
> obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA) += platform-mx2-camera.o
> obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI) += platform-mxc-ehci.o
> obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o
> diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
> index 9e3e3d8..34419b2 100644
> --- a/arch/arm/mach-imx/devices/devices-common.h
> +++ b/arch/arm/mach-imx/devices/devices-common.h
> @@ -199,16 +199,6 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
> const struct imx_ipu_core_data *data,
> struct mx3fb_platform_data *pdata);
>
> -#include <linux/platform_data/camera-mx1.h>
> -struct imx_mx1_camera_data {
> - resource_size_t iobase;
> - resource_size_t iosize;
> - resource_size_t irq;
> -};
> -struct platform_device *__init imx_add_mx1_camera(
> - const struct imx_mx1_camera_data *data,
> - const struct mx1_camera_pdata *pdata);
> -
> #include <linux/platform_data/camera-mx2.h>
> struct imx_mx2_camera_data {
> resource_size_t iobasecsi;
> diff --git a/arch/arm/mach-imx/devices/platform-mx1-camera.c b/arch/arm/mach-imx/devices/platform-mx1-camera.c
> deleted file mode 100644
> index 756b0e6..0000000
> --- a/arch/arm/mach-imx/devices/platform-mx1-camera.c
> +++ /dev/null
> @@ -1,42 +0,0 @@
> -/*
> - * Copyright (C) 2010 Pengutronix
> - * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
> - *
> - * This program is free software; you can redistribute it and/or modify it under
> - * the terms of the GNU General Public License version 2 as published by the
> - * Free Software Foundation.
> - */
> -#include <mach/hardware.h>
> -#include "devices-common.h"
> -
> -#define imx_mx1_camera_data_entry_single(soc, _size) \
> - { \
> - .iobase = soc ## _CSI ## _BASE_ADDR, \
> - .iosize = _size, \
> - .irq = soc ## _INT_CSI, \
> - }
> -
> -#ifdef CONFIG_SOC_IMX1
> -const struct imx_mx1_camera_data imx1_mx1_camera_data __initconst =
> - imx_mx1_camera_data_entry_single(MX1, 10);
> -#endif /* ifdef CONFIG_SOC_IMX1 */
> -
> -struct platform_device *__init imx_add_mx1_camera(
> - const struct imx_mx1_camera_data *data,
> - const struct mx1_camera_pdata *pdata)
> -{
> - struct resource res[] = {
> - {
> - .start = data->iobase,
> - .end = data->iobase + data->iosize - 1,
> - .flags = IORESOURCE_MEM,
> - }, {
> - .start = data->irq,
> - .end = data->irq,
> - .flags = IORESOURCE_IRQ,
> - },
> - };
> - return imx_add_platform_device_dmamask("mx1-camera", 0,
> - res, ARRAY_SIZE(res),
> - pdata, sizeof(*pdata), DMA_BIT_MASK(32));
> -}
> diff --git a/arch/arm/mach-imx/mx1-camera-fiq-ksym.c b/arch/arm/mach-imx/mx1-camera-fiq-ksym.c
> deleted file mode 100644
> index fb38436..0000000
> --- a/arch/arm/mach-imx/mx1-camera-fiq-ksym.c
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -/*
> - * Exported ksyms of ARCH_MX1
> - *
> - * Copyright (C) 2008, Darius Augulis <augulis.darius@gmail.com>
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 2 as
> - * published by the Free Software Foundation.
> - */
> -
> -#include <linux/platform_device.h>
> -#include <linux/module.h>
> -
> -#include <linux/platform_data/camera-mx1.h>
> -
> -/* IMX camera FIQ handler */
> -EXPORT_SYMBOL(mx1_camera_sof_fiq_start);
> -EXPORT_SYMBOL(mx1_camera_sof_fiq_end);
> diff --git a/arch/arm/mach-imx/mx1-camera-fiq.S b/arch/arm/mach-imx/mx1-camera-fiq.S
> deleted file mode 100644
> index 9c69aa6..0000000
> --- a/arch/arm/mach-imx/mx1-camera-fiq.S
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -/*
> - * Copyright (C) 2008 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
> - *
> - * Based on linux/arch/arm/lib/floppydma.S
> - * Copyright (C) 1995, 1996 Russell King
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 2 as
> - * published by the Free Software Foundation.
> - */
> -#include <linux/linkage.h>
> -#include <asm/assembler.h>
> -
> - .text
> - .global mx1_camera_sof_fiq_end
> - .global mx1_camera_sof_fiq_start
> -mx1_camera_sof_fiq_start:
> - @ enable dma
> - ldr r12, [r9]
> - orr r12, r12, #0x00000001
> - str r12, [r9]
> - @ unmask DMA interrupt
> - ldr r12, [r8]
> - bic r12, r12, r13
> - str r12, [r8]
> - @ disable SOF interrupt
> - ldr r12, [r10]
> - bic r12, r12, #0x00010000
> - str r12, [r10]
> - @ clear SOF flag
> - mov r12, #0x00010000
> - str r12, [r11]
> - @ return from FIQ
> - subs pc, lr, #4
> -mx1_camera_sof_fiq_end:
> diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
> index c128fac..e8b89a9 100644
> --- a/drivers/media/video/Kconfig
> +++ b/drivers/media/video/Kconfig
> @@ -1118,18 +1118,6 @@ config SOC_CAMERA_OV9740
> help
> This is a ov9740 camera driver
>
> -config MX1_VIDEO
> - bool
> -
> -config VIDEO_MX1
> - tristate "i.MX1/i.MXL CMOS Sensor Interface driver"
> - depends on VIDEO_DEV && ARCH_MX1 && SOC_CAMERA
> - select FIQ
> - select VIDEOBUF_DMA_CONTIG
> - select MX1_VIDEO
> - ---help---
> - This is a v4l2 driver for the i.MX1/i.MXL CMOS Sensor Interface
> -
> config MX3_VIDEO
> bool
>
> diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
> index b7da9fa..8624228 100644
> --- a/drivers/media/video/Makefile
> +++ b/drivers/media/video/Makefile
> @@ -178,7 +178,6 @@ obj-$(CONFIG_VIDEO_OMAP2) += omap2cam.o
> obj-$(CONFIG_SOC_CAMERA) += soc_camera.o soc_mediabus.o
> obj-$(CONFIG_SOC_CAMERA_PLATFORM) += soc_camera_platform.o
> # soc-camera host drivers have to be linked after camera drivers
> -obj-$(CONFIG_VIDEO_MX1) += mx1_camera.o
> obj-$(CONFIG_VIDEO_MX2) += mx2_camera.o
> obj-$(CONFIG_VIDEO_MX3) += mx3_camera.o
> obj-$(CONFIG_VIDEO_PXA27x) += pxa_camera.o
> diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c
> deleted file mode 100644
> index bbe7099..0000000
> --- a/drivers/media/video/mx1_camera.c
> +++ /dev/null
> @@ -1,889 +0,0 @@
> -/*
> - * V4L2 Driver for i.MXL/i.MXL camera (CSI) host
> - *
> - * Copyright (C) 2008, Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
> - * Copyright (C) 2009, Darius Augulis <augulis.darius@gmail.com>
> - *
> - * Based on PXA SoC camera driver
> - * Copyright (C) 2006, Sascha Hauer, Pengutronix
> - * Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de>
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 2 as
> - * published by the Free Software Foundation.
> - */
> -
> -#include <linux/clk.h>
> -#include <linux/delay.h>
> -#include <linux/device.h>
> -#include <linux/dma-mapping.h>
> -#include <linux/errno.h>
> -#include <linux/fs.h>
> -#include <linux/init.h>
> -#include <linux/interrupt.h>
> -#include <linux/io.h>
> -#include <linux/kernel.h>
> -#include <linux/mm.h>
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
> -#include <linux/mutex.h>
> -#include <linux/platform_device.h>
> -#include <linux/sched.h>
> -#include <linux/slab.h>
> -#include <linux/time.h>
> -#include <linux/videodev2.h>
> -
> -#include <media/soc_camera.h>
> -#include <media/v4l2-common.h>
> -#include <media/v4l2-dev.h>
> -#include <media/videobuf-dma-contig.h>
> -#include <media/soc_mediabus.h>
> -
> -#include <asm/dma.h>
> -#include <asm/fiq.h>
> -#include <mach/dma-mx1-mx2.h>
> -#include <mach/hardware.h>
> -#include <mach/irqs.h>
> -#include <linux/platform_data/camera-mx1.h>
> -
> -/*
> - * CSI registers
> - */
> -#define CSICR1 0x00 /* CSI Control Register 1 */
> -#define CSISR 0x08 /* CSI Status Register */
> -#define CSIRXR 0x10 /* CSI RxFIFO Register */
> -
> -#define CSICR1_RXFF_LEVEL(x) (((x) & 0x3) << 19)
> -#define CSICR1_SOF_POL (1 << 17)
> -#define CSICR1_SOF_INTEN (1 << 16)
> -#define CSICR1_MCLKDIV(x) (((x) & 0xf) << 12)
> -#define CSICR1_MCLKEN (1 << 9)
> -#define CSICR1_FCC (1 << 8)
> -#define CSICR1_BIG_ENDIAN (1 << 7)
> -#define CSICR1_CLR_RXFIFO (1 << 5)
> -#define CSICR1_GCLK_MODE (1 << 4)
> -#define CSICR1_DATA_POL (1 << 2)
> -#define CSICR1_REDGE (1 << 1)
> -#define CSICR1_EN (1 << 0)
> -
> -#define CSISR_SFF_OR_INT (1 << 25)
> -#define CSISR_RFF_OR_INT (1 << 24)
> -#define CSISR_STATFF_INT (1 << 21)
> -#define CSISR_RXFF_INT (1 << 18)
> -#define CSISR_SOF_INT (1 << 16)
> -#define CSISR_DRDY (1 << 0)
> -
> -#define DRIVER_VERSION "0.0.2"
> -#define DRIVER_NAME "mx1-camera"
> -
> -#define CSI_IRQ_MASK (CSISR_SFF_OR_INT | CSISR_RFF_OR_INT | \
> - CSISR_STATFF_INT | CSISR_RXFF_INT | CSISR_SOF_INT)
> -
> -#define CSI_BUS_FLAGS (V4L2_MBUS_MASTER | V4L2_MBUS_HSYNC_ACTIVE_HIGH | \
> - V4L2_MBUS_VSYNC_ACTIVE_HIGH | V4L2_MBUS_VSYNC_ACTIVE_LOW | \
> - V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_PCLK_SAMPLE_FALLING | \
> - V4L2_MBUS_DATA_ACTIVE_HIGH | V4L2_MBUS_DATA_ACTIVE_LOW)
> -
> -#define MAX_VIDEO_MEM 16 /* Video memory limit in megabytes */
> -
> -/*
> - * Structures
> - */
> -
> -/* buffer for one video frame */
> -struct mx1_buffer {
> - /* common v4l buffer stuff -- must be first */
> - struct videobuf_buffer vb;
> - enum v4l2_mbus_pixelcode code;
> - int inwork;
> -};
> -
> -/*
> - * i.MX1/i.MXL is only supposed to handle one camera on its Camera Sensor
> - * Interface. If anyone ever builds hardware to enable more than
> - * one camera, they will have to modify this driver too
> - */
> -struct mx1_camera_dev {
> - struct soc_camera_host soc_host;
> - struct soc_camera_device *icd;
> - struct mx1_camera_pdata *pdata;
> - struct mx1_buffer *active;
> - struct resource *res;
> - struct clk *clk;
> - struct list_head capture;
> -
> - void __iomem *base;
> - int dma_chan;
> - unsigned int irq;
> - unsigned long mclk;
> -
> - spinlock_t lock;
> -};
> -
> -/*
> - * Videobuf operations
> - */
> -static int mx1_videobuf_setup(struct videobuf_queue *vq, unsigned int *count,
> - unsigned int *size)
> -{
> - struct soc_camera_device *icd = vq->priv_data;
> -
> - *size = icd->sizeimage;
> -
> - if (!*count)
> - *count = 32;
> -
> - if (*size * *count > MAX_VIDEO_MEM * 1024 * 1024)
> - *count = (MAX_VIDEO_MEM * 1024 * 1024) / *size;
> -
> - dev_dbg(icd->parent, "count=%d, size=%d\n", *count, *size);
> -
> - return 0;
> -}
> -
> -static void free_buffer(struct videobuf_queue *vq, struct mx1_buffer *buf)
> -{
> - struct soc_camera_device *icd = vq->priv_data;
> - struct videobuf_buffer *vb = &buf->vb;
> -
> - BUG_ON(in_interrupt());
> -
> - dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
> - vb, vb->baddr, vb->bsize);
> -
> - /*
> - * This waits until this buffer is out of danger, i.e., until it is no
> - * longer in STATE_QUEUED or STATE_ACTIVE
> - */
> - videobuf_waiton(vq, vb, 0, 0);
> - videobuf_dma_contig_free(vq, vb);
> -
> - vb->state = VIDEOBUF_NEEDS_INIT;
> -}
> -
> -static int mx1_videobuf_prepare(struct videobuf_queue *vq,
> - struct videobuf_buffer *vb, enum v4l2_field field)
> -{
> - struct soc_camera_device *icd = vq->priv_data;
> - struct mx1_buffer *buf = container_of(vb, struct mx1_buffer, vb);
> - int ret;
> -
> - dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
> - vb, vb->baddr, vb->bsize);
> -
> - /* Added list head initialization on alloc */
> - WARN_ON(!list_empty(&vb->queue));
> -
> - BUG_ON(NULL == icd->current_fmt);
> -
> - /*
> - * I think, in buf_prepare you only have to protect global data,
> - * the actual buffer is yours
> - */
> - buf->inwork = 1;
> -
> - if (buf->code != icd->current_fmt->code ||
> - vb->width != icd->user_width ||
> - vb->height != icd->user_height ||
> - vb->field != field) {
> - buf->code = icd->current_fmt->code;
> - vb->width = icd->user_width;
> - vb->height = icd->user_height;
> - vb->field = field;
> - vb->state = VIDEOBUF_NEEDS_INIT;
> - }
> -
> - vb->size = icd->sizeimage;
> - if (0 != vb->baddr && vb->bsize < vb->size) {
> - ret = -EINVAL;
> - goto out;
> - }
> -
> - if (vb->state == VIDEOBUF_NEEDS_INIT) {
> - ret = videobuf_iolock(vq, vb, NULL);
> - if (ret)
> - goto fail;
> -
> - vb->state = VIDEOBUF_PREPARED;
> - }
> -
> - buf->inwork = 0;
> -
> - return 0;
> -
> -fail:
> - free_buffer(vq, buf);
> -out:
> - buf->inwork = 0;
> - return ret;
> -}
> -
> -static int mx1_camera_setup_dma(struct mx1_camera_dev *pcdev)
> -{
> - struct videobuf_buffer *vbuf = &pcdev->active->vb;
> - struct device *dev = pcdev->icd->parent;
> - int ret;
> -
> - if (unlikely(!pcdev->active)) {
> - dev_err(dev, "DMA End IRQ with no active buffer\n");
> - return -EFAULT;
> - }
> -
> - /* setup sg list for future DMA */
> - ret = imx_dma_setup_single(pcdev->dma_chan,
> - videobuf_to_dma_contig(vbuf),
> - vbuf->size, pcdev->res->start +
> - CSIRXR, DMA_MODE_READ);
> - if (unlikely(ret))
> - dev_err(dev, "Failed to setup DMA sg list\n");
> -
> - return ret;
> -}
> -
> -/* Called under spinlock_irqsave(&pcdev->lock, ...) */
> -static void mx1_videobuf_queue(struct videobuf_queue *vq,
> - struct videobuf_buffer *vb)
> -{
> - struct soc_camera_device *icd = vq->priv_data;
> - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
> - struct mx1_camera_dev *pcdev = ici->priv;
> - struct mx1_buffer *buf = container_of(vb, struct mx1_buffer, vb);
> -
> - dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
> - vb, vb->baddr, vb->bsize);
> -
> - list_add_tail(&vb->queue, &pcdev->capture);
> -
> - vb->state = VIDEOBUF_ACTIVE;
> -
> - if (!pcdev->active) {
> - pcdev->active = buf;
> -
> - /* setup sg list for future DMA */
> - if (!mx1_camera_setup_dma(pcdev)) {
> - unsigned int temp;
> - /* enable SOF irq */
> - temp = __raw_readl(pcdev->base + CSICR1) |
> - CSICR1_SOF_INTEN;
> - __raw_writel(temp, pcdev->base + CSICR1);
> - }
> - }
> -}
> -
> -static void mx1_videobuf_release(struct videobuf_queue *vq,
> - struct videobuf_buffer *vb)
> -{
> - struct mx1_buffer *buf = container_of(vb, struct mx1_buffer, vb);
> -#ifdef DEBUG
> - struct soc_camera_device *icd = vq->priv_data;
> - struct device *dev = icd->parent;
> -
> - dev_dbg(dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
> - vb, vb->baddr, vb->bsize);
> -
> - switch (vb->state) {
> - case VIDEOBUF_ACTIVE:
> - dev_dbg(dev, "%s (active)\n", __func__);
> - break;
> - case VIDEOBUF_QUEUED:
> - dev_dbg(dev, "%s (queued)\n", __func__);
> - break;
> - case VIDEOBUF_PREPARED:
> - dev_dbg(dev, "%s (prepared)\n", __func__);
> - break;
> - default:
> - dev_dbg(dev, "%s (unknown)\n", __func__);
> - break;
> - }
> -#endif
> -
> - free_buffer(vq, buf);
> -}
> -
> -static void mx1_camera_wakeup(struct mx1_camera_dev *pcdev,
> - struct videobuf_buffer *vb,
> - struct mx1_buffer *buf)
> -{
> - /* _init is used to debug races, see comment in mx1_camera_reqbufs() */
> - list_del_init(&vb->queue);
> - vb->state = VIDEOBUF_DONE;
> - do_gettimeofday(&vb->ts);
> - vb->field_count++;
> - wake_up(&vb->done);
> -
> - if (list_empty(&pcdev->capture)) {
> - pcdev->active = NULL;
> - return;
> - }
> -
> - pcdev->active = list_entry(pcdev->capture.next,
> - struct mx1_buffer, vb.queue);
> -
> - /* setup sg list for future DMA */
> - if (likely(!mx1_camera_setup_dma(pcdev))) {
> - unsigned int temp;
> -
> - /* enable SOF irq */
> - temp = __raw_readl(pcdev->base + CSICR1) | CSICR1_SOF_INTEN;
> - __raw_writel(temp, pcdev->base + CSICR1);
> - }
> -}
> -
> -static void mx1_camera_dma_irq(int channel, void *data)
> -{
> - struct mx1_camera_dev *pcdev = data;
> - struct device *dev = pcdev->icd->parent;
> - struct mx1_buffer *buf;
> - struct videobuf_buffer *vb;
> - unsigned long flags;
> -
> - spin_lock_irqsave(&pcdev->lock, flags);
> -
> - imx_dma_disable(channel);
> -
> - if (unlikely(!pcdev->active)) {
> - dev_err(dev, "DMA End IRQ with no active buffer\n");
> - goto out;
> - }
> -
> - vb = &pcdev->active->vb;
> - buf = container_of(vb, struct mx1_buffer, vb);
> - WARN_ON(buf->inwork || list_empty(&vb->queue));
> - dev_dbg(dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
> - vb, vb->baddr, vb->bsize);
> -
> - mx1_camera_wakeup(pcdev, vb, buf);
> -out:
> - spin_unlock_irqrestore(&pcdev->lock, flags);
> -}
> -
> -static struct videobuf_queue_ops mx1_videobuf_ops = {
> - .buf_setup = mx1_videobuf_setup,
> - .buf_prepare = mx1_videobuf_prepare,
> - .buf_queue = mx1_videobuf_queue,
> - .buf_release = mx1_videobuf_release,
> -};
> -
> -static void mx1_camera_init_videobuf(struct videobuf_queue *q,
> - struct soc_camera_device *icd)
> -{
> - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
> - struct mx1_camera_dev *pcdev = ici->priv;
> -
> - videobuf_queue_dma_contig_init(q, &mx1_videobuf_ops, icd->parent,
> - &pcdev->lock, V4L2_BUF_TYPE_VIDEO_CAPTURE,
> - V4L2_FIELD_NONE,
> - sizeof(struct mx1_buffer), icd, &icd->video_lock);
> -}
> -
> -static int mclk_get_divisor(struct mx1_camera_dev *pcdev)
> -{
> - unsigned int mclk = pcdev->mclk;
> - unsigned long div;
> - unsigned long lcdclk;
> -
> - lcdclk = clk_get_rate(pcdev->clk);
> -
> - /*
> - * We verify platform_mclk_10khz != 0, so if anyone breaks it, here
> - * they get a nice Oops
> - */
> - div = (lcdclk + 2 * mclk - 1) / (2 * mclk) - 1;
> -
> - dev_dbg(pcdev->icd->parent,
> - "System clock %lukHz, target freq %dkHz, divisor %lu\n",
> - lcdclk / 1000, mclk / 1000, div);
> -
> - return div;
> -}
> -
> -static void mx1_camera_activate(struct mx1_camera_dev *pcdev)
> -{
> - unsigned int csicr1 = CSICR1_EN;
> -
> - dev_dbg(pcdev->icd->parent, "Activate device\n");
> -
> - clk_prepare_enable(pcdev->clk);
> -
> - /* enable CSI before doing anything else */
> - __raw_writel(csicr1, pcdev->base + CSICR1);
> -
> - csicr1 |= CSICR1_MCLKEN | CSICR1_FCC | CSICR1_GCLK_MODE;
> - csicr1 |= CSICR1_MCLKDIV(mclk_get_divisor(pcdev));
> - csicr1 |= CSICR1_RXFF_LEVEL(2); /* 16 words */
> -
> - __raw_writel(csicr1, pcdev->base + CSICR1);
> -}
> -
> -static void mx1_camera_deactivate(struct mx1_camera_dev *pcdev)
> -{
> - dev_dbg(pcdev->icd->parent, "Deactivate device\n");
> -
> - /* Disable all CSI interface */
> - __raw_writel(0x00, pcdev->base + CSICR1);
> -
> - clk_disable_unprepare(pcdev->clk);
> -}
> -
> -/*
> - * The following two functions absolutely depend on the fact, that
> - * there can be only one camera on i.MX1/i.MXL camera sensor interface
> - */
> -static int mx1_camera_add_device(struct soc_camera_device *icd)
> -{
> - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
> - struct mx1_camera_dev *pcdev = ici->priv;
> -
> - if (pcdev->icd)
> - return -EBUSY;
> -
> - dev_info(icd->parent, "MX1 Camera driver attached to camera %d\n",
> - icd->devnum);
> -
> - mx1_camera_activate(pcdev);
> -
> - pcdev->icd = icd;
> -
> - return 0;
> -}
> -
> -static void mx1_camera_remove_device(struct soc_camera_device *icd)
> -{
> - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
> - struct mx1_camera_dev *pcdev = ici->priv;
> - unsigned int csicr1;
> -
> - BUG_ON(icd != pcdev->icd);
> -
> - /* disable interrupts */
> - csicr1 = __raw_readl(pcdev->base + CSICR1) & ~CSI_IRQ_MASK;
> - __raw_writel(csicr1, pcdev->base + CSICR1);
> -
> - /* Stop DMA engine */
> - imx_dma_disable(pcdev->dma_chan);
> -
> - dev_info(icd->parent, "MX1 Camera driver detached from camera %d\n",
> - icd->devnum);
> -
> - mx1_camera_deactivate(pcdev);
> -
> - pcdev->icd = NULL;
> -}
> -
> -static int mx1_camera_set_crop(struct soc_camera_device *icd,
> - struct v4l2_crop *a)
> -{
> - struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
> -
> - return v4l2_subdev_call(sd, video, s_crop, a);
> -}
> -
> -static int mx1_camera_set_bus_param(struct soc_camera_device *icd)
> -{
> - struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
> - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
> - struct mx1_camera_dev *pcdev = ici->priv;
> - struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,};
> - unsigned long common_flags;
> - unsigned int csicr1;
> - int ret;
> -
> - /* MX1 supports only 8bit buswidth */
> - ret = v4l2_subdev_call(sd, video, g_mbus_config, &cfg);
> - if (!ret) {
> - common_flags = soc_mbus_config_compatible(&cfg, CSI_BUS_FLAGS);
> - if (!common_flags) {
> - dev_warn(icd->parent,
> - "Flags incompatible: camera 0x%x, host 0x%x\n",
> - cfg.flags, CSI_BUS_FLAGS);
> - return -EINVAL;
> - }
> - } else if (ret != -ENOIOCTLCMD) {
> - return ret;
> - } else {
> - common_flags = CSI_BUS_FLAGS;
> - }
> -
> - /* Make choises, based on platform choice */
> - if ((common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) &&
> - (common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)) {
> - if (!pcdev->pdata ||
> - pcdev->pdata->flags & MX1_CAMERA_VSYNC_HIGH)
> - common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_LOW;
> - else
> - common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_HIGH;
> - }
> -
> - if ((common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING) &&
> - (common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING)) {
> - if (!pcdev->pdata ||
> - pcdev->pdata->flags & MX1_CAMERA_PCLK_RISING)
> - common_flags &= ~V4L2_MBUS_PCLK_SAMPLE_FALLING;
> - else
> - common_flags &= ~V4L2_MBUS_PCLK_SAMPLE_RISING;
> - }
> -
> - if ((common_flags & V4L2_MBUS_DATA_ACTIVE_HIGH) &&
> - (common_flags & V4L2_MBUS_DATA_ACTIVE_LOW)) {
> - if (!pcdev->pdata ||
> - pcdev->pdata->flags & MX1_CAMERA_DATA_HIGH)
> - common_flags &= ~V4L2_MBUS_DATA_ACTIVE_LOW;
> - else
> - common_flags &= ~V4L2_MBUS_DATA_ACTIVE_HIGH;
> - }
> -
> - cfg.flags = common_flags;
> - ret = v4l2_subdev_call(sd, video, s_mbus_config, &cfg);
> - if (ret < 0 && ret != -ENOIOCTLCMD) {
> - dev_dbg(icd->parent, "camera s_mbus_config(0x%lx) returned %d\n",
> - common_flags, ret);
> - return ret;
> - }
> -
> - csicr1 = __raw_readl(pcdev->base + CSICR1);
> -
> - if (common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING)
> - csicr1 |= CSICR1_REDGE;
> - if (common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH)
> - csicr1 |= CSICR1_SOF_POL;
> - if (common_flags & V4L2_MBUS_DATA_ACTIVE_LOW)
> - csicr1 |= CSICR1_DATA_POL;
> -
> - __raw_writel(csicr1, pcdev->base + CSICR1);
> -
> - return 0;
> -}
> -
> -static int mx1_camera_set_fmt(struct soc_camera_device *icd,
> - struct v4l2_format *f)
> -{
> - struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
> - const struct soc_camera_format_xlate *xlate;
> - struct v4l2_pix_format *pix = &f->fmt.pix;
> - struct v4l2_mbus_framefmt mf;
> - int ret, buswidth;
> -
> - xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat);
> - if (!xlate) {
> - dev_warn(icd->parent, "Format %x not found\n",
> - pix->pixelformat);
> - return -EINVAL;
> - }
> -
> - buswidth = xlate->host_fmt->bits_per_sample;
> - if (buswidth > 8) {
> - dev_warn(icd->parent,
> - "bits-per-sample %d for format %x unsupported\n",
> - buswidth, pix->pixelformat);
> - return -EINVAL;
> - }
> -
> - mf.width = pix->width;
> - mf.height = pix->height;
> - mf.field = pix->field;
> - mf.colorspace = pix->colorspace;
> - mf.code = xlate->code;
> -
> - ret = v4l2_subdev_call(sd, video, s_mbus_fmt, &mf);
> - if (ret < 0)
> - return ret;
> -
> - if (mf.code != xlate->code)
> - return -EINVAL;
> -
> - pix->width = mf.width;
> - pix->height = mf.height;
> - pix->field = mf.field;
> - pix->colorspace = mf.colorspace;
> - icd->current_fmt = xlate;
> -
> - return ret;
> -}
> -
> -static int mx1_camera_try_fmt(struct soc_camera_device *icd,
> - struct v4l2_format *f)
> -{
> - struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
> - const struct soc_camera_format_xlate *xlate;
> - struct v4l2_pix_format *pix = &f->fmt.pix;
> - struct v4l2_mbus_framefmt mf;
> - int ret;
> - /* TODO: limit to mx1 hardware capabilities */
> -
> - xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat);
> - if (!xlate) {
> - dev_warn(icd->parent, "Format %x not found\n",
> - pix->pixelformat);
> - return -EINVAL;
> - }
> -
> - mf.width = pix->width;
> - mf.height = pix->height;
> - mf.field = pix->field;
> - mf.colorspace = pix->colorspace;
> - mf.code = xlate->code;
> -
> - /* limit to sensor capabilities */
> - ret = v4l2_subdev_call(sd, video, try_mbus_fmt, &mf);
> - if (ret < 0)
> - return ret;
> -
> - pix->width = mf.width;
> - pix->height = mf.height;
> - pix->field = mf.field;
> - pix->colorspace = mf.colorspace;
> -
> - return 0;
> -}
> -
> -static int mx1_camera_reqbufs(struct soc_camera_device *icd,
> - struct v4l2_requestbuffers *p)
> -{
> - int i;
> -
> - /*
> - * This is for locking debugging only. I removed spinlocks and now I
> - * check whether .prepare is ever called on a linked buffer, or whether
> - * a dma IRQ can occur for an in-work or unlinked buffer. Until now
> - * it hadn't triggered
> - */
> - for (i = 0; i < p->count; i++) {
> - struct mx1_buffer *buf = container_of(icd->vb_vidq.bufs[i],
> - struct mx1_buffer, vb);
> - buf->inwork = 0;
> - INIT_LIST_HEAD(&buf->vb.queue);
> - }
> -
> - return 0;
> -}
> -
> -static unsigned int mx1_camera_poll(struct file *file, poll_table *pt)
> -{
> - struct soc_camera_device *icd = file->private_data;
> - struct mx1_buffer *buf;
> -
> - buf = list_entry(icd->vb_vidq.stream.next, struct mx1_buffer,
> - vb.stream);
> -
> - poll_wait(file, &buf->vb.done, pt);
> -
> - if (buf->vb.state == VIDEOBUF_DONE ||
> - buf->vb.state == VIDEOBUF_ERROR)
> - return POLLIN | POLLRDNORM;
> -
> - return 0;
> -}
> -
> -static int mx1_camera_querycap(struct soc_camera_host *ici,
> - struct v4l2_capability *cap)
> -{
> - /* cap->name is set by the friendly caller:-> */
> - strlcpy(cap->card, "i.MX1/i.MXL Camera", sizeof(cap->card));
> - cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
> -
> - return 0;
> -}
> -
> -static struct soc_camera_host_ops mx1_soc_camera_host_ops = {
> - .owner = THIS_MODULE,
> - .add = mx1_camera_add_device,
> - .remove = mx1_camera_remove_device,
> - .set_bus_param = mx1_camera_set_bus_param,
> - .set_crop = mx1_camera_set_crop,
> - .set_fmt = mx1_camera_set_fmt,
> - .try_fmt = mx1_camera_try_fmt,
> - .init_videobuf = mx1_camera_init_videobuf,
> - .reqbufs = mx1_camera_reqbufs,
> - .poll = mx1_camera_poll,
> - .querycap = mx1_camera_querycap,
> -};
> -
> -static struct fiq_handler fh = {
> - .name = "csi_sof"
> -};
> -
> -static int __init mx1_camera_probe(struct platform_device *pdev)
> -{
> - struct mx1_camera_dev *pcdev;
> - struct resource *res;
> - struct pt_regs regs;
> - struct clk *clk;
> - void __iomem *base;
> - unsigned int irq;
> - int err = 0;
> -
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - irq = platform_get_irq(pdev, 0);
> - if (!res || (int)irq <= 0) {
> - err = -ENODEV;
> - goto exit;
> - }
> -
> - clk = clk_get(&pdev->dev, "csi_clk");
> - if (IS_ERR(clk)) {
> - err = PTR_ERR(clk);
> - goto exit;
> - }
> -
> - pcdev = kzalloc(sizeof(*pcdev), GFP_KERNEL);
> - if (!pcdev) {
> - dev_err(&pdev->dev, "Could not allocate pcdev\n");
> - err = -ENOMEM;
> - goto exit_put_clk;
> - }
> -
> - pcdev->res = res;
> - pcdev->clk = clk;
> -
> - pcdev->pdata = pdev->dev.platform_data;
> -
> - if (pcdev->pdata)
> - pcdev->mclk = pcdev->pdata->mclk_10khz * 10000;
> -
> - if (!pcdev->mclk) {
> - dev_warn(&pdev->dev,
> - "mclk_10khz == 0! Please, fix your platform data. "
> - "Using default 20MHz\n");
> - pcdev->mclk = 20000000;
> - }
> -
> - INIT_LIST_HEAD(&pcdev->capture);
> - spin_lock_init(&pcdev->lock);
> -
> - /*
> - * Request the regions.
> - */
> - if (!request_mem_region(res->start, resource_size(res), DRIVER_NAME)) {
> - err = -EBUSY;
> - goto exit_kfree;
> - }
> -
> - base = ioremap(res->start, resource_size(res));
> - if (!base) {
> - err = -ENOMEM;
> - goto exit_release;
> - }
> - pcdev->irq = irq;
> - pcdev->base = base;
> -
> - /* request dma */
> - pcdev->dma_chan = imx_dma_request_by_prio(DRIVER_NAME, DMA_PRIO_HIGH);
> - if (pcdev->dma_chan < 0) {
> - dev_err(&pdev->dev, "Can't request DMA for MX1 CSI\n");
> - err = -EBUSY;
> - goto exit_iounmap;
> - }
> - dev_dbg(&pdev->dev, "got DMA channel %d\n", pcdev->dma_chan);
> -
> - imx_dma_setup_handlers(pcdev->dma_chan, mx1_camera_dma_irq, NULL,
> - pcdev);
> -
> - imx_dma_config_channel(pcdev->dma_chan, IMX_DMA_TYPE_FIFO,
> - IMX_DMA_MEMSIZE_32, MX1_DMA_REQ_CSI_R, 0);
> - /* burst length : 16 words = 64 bytes */
> - imx_dma_config_burstlen(pcdev->dma_chan, 0);
> -
> - /* request irq */
> - err = claim_fiq(&fh);
> - if (err) {
> - dev_err(&pdev->dev, "Camera interrupt register failed \n");
> - goto exit_free_dma;
> - }
> -
> - set_fiq_handler(&mx1_camera_sof_fiq_start, &mx1_camera_sof_fiq_end -
> - &mx1_camera_sof_fiq_start);
> -
> - regs.ARM_r8 = (long)MX1_DMA_DIMR;
> - regs.ARM_r9 = (long)MX1_DMA_CCR(pcdev->dma_chan);
> - regs.ARM_r10 = (long)pcdev->base + CSICR1;
> - regs.ARM_fp = (long)pcdev->base + CSISR;
> - regs.ARM_sp = 1 << pcdev->dma_chan;
> - set_fiq_regs(®s);
> -
> - mxc_set_irq_fiq(irq, 1);
> - enable_fiq(irq);
> -
> - pcdev->soc_host.drv_name = DRIVER_NAME;
> - pcdev->soc_host.ops = &mx1_soc_camera_host_ops;
> - pcdev->soc_host.priv = pcdev;
> - pcdev->soc_host.v4l2_dev.dev = &pdev->dev;
> - pcdev->soc_host.nr = pdev->id;
> - err = soc_camera_host_register(&pcdev->soc_host);
> - if (err)
> - goto exit_free_irq;
> -
> - dev_info(&pdev->dev, "MX1 Camera driver loaded\n");
> -
> - return 0;
> -
> -exit_free_irq:
> - disable_fiq(irq);
> - mxc_set_irq_fiq(irq, 0);
> - release_fiq(&fh);
> -exit_free_dma:
> - imx_dma_free(pcdev->dma_chan);
> -exit_iounmap:
> - iounmap(base);
> -exit_release:
> - release_mem_region(res->start, resource_size(res));
> -exit_kfree:
> - kfree(pcdev);
> -exit_put_clk:
> - clk_put(clk);
> -exit:
> - return err;
> -}
> -
> -static int __exit mx1_camera_remove(struct platform_device *pdev)
> -{
> - struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev);
> - struct mx1_camera_dev *pcdev = container_of(soc_host,
> - struct mx1_camera_dev, soc_host);
> - struct resource *res;
> -
> - imx_dma_free(pcdev->dma_chan);
> - disable_fiq(pcdev->irq);
> - mxc_set_irq_fiq(pcdev->irq, 0);
> - release_fiq(&fh);
> -
> - clk_put(pcdev->clk);
> -
> - soc_camera_host_unregister(soc_host);
> -
> - iounmap(pcdev->base);
> -
> - res = pcdev->res;
> - release_mem_region(res->start, resource_size(res));
> -
> - kfree(pcdev);
> -
> - dev_info(&pdev->dev, "MX1 Camera driver unloaded\n");
> -
> - return 0;
> -}
> -
> -static struct platform_driver mx1_camera_driver = {
> - .driver = {
> - .name = DRIVER_NAME,
> - },
> - .remove = __exit_p(mx1_camera_remove),
> -};
> -
> -static int __init mx1_camera_init(void)
> -{
> - return platform_driver_probe(&mx1_camera_driver, mx1_camera_probe);
> -}
> -
> -static void __exit mx1_camera_exit(void)
> -{
> - return platform_driver_unregister(&mx1_camera_driver);
> -}
> -
> -module_init(mx1_camera_init);
> -module_exit(mx1_camera_exit);
> -
> -MODULE_DESCRIPTION("i.MX1/i.MXL SoC Camera Host driver");
> -MODULE_AUTHOR("Paulius Zaleckas <paulius.zaleckas@teltonika.lt>");
> -MODULE_LICENSE("GPL v2");
> -MODULE_VERSION(DRIVER_VERSION);
> -MODULE_ALIAS("platform:" DRIVER_NAME);
> diff --git a/include/linux/platform_data/camera-mx1.h b/include/linux/platform_data/camera-mx1.h
> deleted file mode 100644
> index 4fd6c70..0000000
> --- a/include/linux/platform_data/camera-mx1.h
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -/*
> - * mx1_camera.h - i.MX1/i.MXL camera driver header file
> - *
> - * Copyright (c) 2008, Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
> - * Copyright (C) 2009, Darius Augulis <augulis.darius@gmail.com>
> - *
> - * Based on PXA camera.h file:
> - * Copyright (C) 2003, Intel Corporation
> - * Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de>
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 2 as
> - * published by the Free Software Foundation.
> - */
> -
> -#ifndef __ASM_ARCH_CAMERA_H_
> -#define __ASM_ARCH_CAMERA_H_
> -
> -#define MX1_CAMERA_DATA_HIGH 1
> -#define MX1_CAMERA_PCLK_RISING 2
> -#define MX1_CAMERA_VSYNC_HIGH 4
> -
> -extern unsigned char mx1_camera_sof_fiq_start, mx1_camera_sof_fiq_end;
> -
> -/**
> - * struct mx1_camera_pdata - i.MX1/i.MXL camera platform data
> - * @mclk_10khz: master clock frequency in 10kHz units
> - * @flags: MX1 camera platform flags
> - */
> -struct mx1_camera_pdata {
> - unsigned long mclk_10khz;
> - unsigned long flags;
> -};
> -
> -#endif /* __ASM_ARCH_CAMERA_H_ */
> --
> 1.7.9.5
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 27/34] media: mx2_camera: use managed functions to clean up code
2012-09-17 5:34 ` [PATCH 27/34] media: mx2_camera: use managed functions to clean up code Shawn Guo
@ 2012-09-17 9:11 ` Guennadi Liakhovetski
2012-09-17 13:36 ` javier Martin
0 siblings, 1 reply; 30+ messages in thread
From: Guennadi Liakhovetski @ 2012-09-17 9:11 UTC (permalink / raw)
To: Shawn Guo
Cc: linux-arm-kernel, Sascha Hauer, Fabio Estevam, Rob Herring,
Arnd Bergmann, linux-media
On Mon, 17 Sep 2012, Shawn Guo wrote:
> Use managed functions to clean up the error handling code and function
> mx2_camera_remove(). Along with the change, a few variables get removed
> from struct mx2_camera_dev.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: linux-media@vger.kernel.org
(in case you want to push it via arm-soc)
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Thanks
Guennadi
> ---
> drivers/media/video/mx2_camera.c | 143 +++++++++++---------------------------
> 1 file changed, 39 insertions(+), 104 deletions(-)
>
> diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
> index 89c7e28..fe4c76c 100644
> --- a/drivers/media/video/mx2_camera.c
> +++ b/drivers/media/video/mx2_camera.c
> @@ -274,12 +274,9 @@ struct mx2_camera_dev {
> struct soc_camera_device *icd;
> struct clk *clk_csi, *clk_emma_ahb, *clk_emma_ipg;
>
> - unsigned int irq_csi, irq_emma;
> void __iomem *base_csi, *base_emma;
> - unsigned long base_dma;
>
> struct mx2_camera_platform_data *pdata;
> - struct resource *res_csi, *res_emma;
> unsigned long platform_flags;
>
> struct list_head capture;
> @@ -1607,64 +1604,59 @@ static irqreturn_t mx27_camera_emma_irq(int irq_emma, void *data)
> return IRQ_HANDLED;
> }
>
> -static int __devinit mx27_camera_emma_init(struct mx2_camera_dev *pcdev)
> +static int __devinit mx27_camera_emma_init(struct platform_device *pdev)
> {
> - struct resource *res_emma = pcdev->res_emma;
> + struct mx2_camera_dev *pcdev = platform_get_drvdata(pdev);
> + struct resource *res_emma;
> + int irq_emma;
> int err = 0;
>
> - if (!request_mem_region(res_emma->start, resource_size(res_emma),
> - MX2_CAM_DRV_NAME)) {
> - err = -EBUSY;
> + res_emma = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> + irq_emma = platform_get_irq(pdev, 1);
> + if (!res_emma || !irq_emma) {
> + dev_err(pcdev->dev, "no EMMA resources\n");
> goto out;
> }
>
> - pcdev->base_emma = ioremap(res_emma->start, resource_size(res_emma));
> + pcdev->base_emma = devm_request_and_ioremap(pcdev->dev, res_emma);
> if (!pcdev->base_emma) {
> - err = -ENOMEM;
> - goto exit_release;
> + err = -EADDRNOTAVAIL;
> + goto out;
> }
>
> - err = request_irq(pcdev->irq_emma, mx27_camera_emma_irq, 0,
> - MX2_CAM_DRV_NAME, pcdev);
> + err = devm_request_irq(pcdev->dev, irq_emma, mx27_camera_emma_irq, 0,
> + MX2_CAM_DRV_NAME, pcdev);
> if (err) {
> dev_err(pcdev->dev, "Camera EMMA interrupt register failed \n");
> - goto exit_iounmap;
> + goto out;
> }
>
> - pcdev->clk_emma_ipg = clk_get(pcdev->dev, "emma-ipg");
> + pcdev->clk_emma_ipg = devm_clk_get(pcdev->dev, "emma-ipg");
> if (IS_ERR(pcdev->clk_emma_ipg)) {
> err = PTR_ERR(pcdev->clk_emma_ipg);
> - goto exit_free_irq;
> + goto out;
> }
>
> clk_prepare_enable(pcdev->clk_emma_ipg);
>
> - pcdev->clk_emma_ahb = clk_get(pcdev->dev, "emma-ahb");
> + pcdev->clk_emma_ahb = devm_clk_get(pcdev->dev, "emma-ahb");
> if (IS_ERR(pcdev->clk_emma_ahb)) {
> err = PTR_ERR(pcdev->clk_emma_ahb);
> - goto exit_clk_emma_ipg_put;
> + goto exit_clk_emma_ipg;
> }
>
> clk_prepare_enable(pcdev->clk_emma_ahb);
>
> err = mx27_camera_emma_prp_reset(pcdev);
> if (err)
> - goto exit_clk_emma_ahb_put;
> + goto exit_clk_emma_ahb;
>
> return err;
>
> -exit_clk_emma_ahb_put:
> +exit_clk_emma_ahb:
> clk_disable_unprepare(pcdev->clk_emma_ahb);
> - clk_put(pcdev->clk_emma_ahb);
> -exit_clk_emma_ipg_put:
> +exit_clk_emma_ipg:
> clk_disable_unprepare(pcdev->clk_emma_ipg);
> - clk_put(pcdev->clk_emma_ipg);
> -exit_free_irq:
> - free_irq(pcdev->irq_emma, pcdev);
> -exit_iounmap:
> - iounmap(pcdev->base_emma);
> -exit_release:
> - release_mem_region(res_emma->start, resource_size(res_emma));
> out:
> return err;
> }
> @@ -1672,9 +1664,8 @@ out:
> static int __devinit mx2_camera_probe(struct platform_device *pdev)
> {
> struct mx2_camera_dev *pcdev;
> - struct resource *res_csi, *res_emma;
> - void __iomem *base_csi;
> - int irq_csi, irq_emma;
> + struct resource *res_csi;
> + int irq_csi;
> int err = 0;
>
> dev_dbg(&pdev->dev, "initialising\n");
> @@ -1687,21 +1678,20 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> goto exit;
> }
>
> - pcdev = kzalloc(sizeof(*pcdev), GFP_KERNEL);
> + pcdev = devm_kzalloc(&pdev->dev, sizeof(*pcdev), GFP_KERNEL);
> if (!pcdev) {
> dev_err(&pdev->dev, "Could not allocate pcdev\n");
> err = -ENOMEM;
> goto exit;
> }
>
> - pcdev->clk_csi = clk_get(&pdev->dev, "ahb");
> + pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
> if (IS_ERR(pcdev->clk_csi)) {
> dev_err(&pdev->dev, "Could not get csi clock\n");
> err = PTR_ERR(pcdev->clk_csi);
> - goto exit_kfree;
> + goto exit;
> }
>
> - pcdev->res_csi = res_csi;
> pcdev->pdata = pdev->dev.platform_data;
> if (pcdev->pdata) {
> long rate;
> @@ -1711,11 +1701,11 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> rate = clk_round_rate(pcdev->clk_csi, pcdev->pdata->clk * 2);
> if (rate <= 0) {
> err = -ENODEV;
> - goto exit_dma_free;
> + goto exit;
> }
> err = clk_set_rate(pcdev->clk_csi, rate);
> if (err < 0)
> - goto exit_dma_free;
> + goto exit;
> }
>
> INIT_LIST_HEAD(&pcdev->capture);
> @@ -1723,48 +1713,28 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> INIT_LIST_HEAD(&pcdev->discard);
> spin_lock_init(&pcdev->lock);
>
> - /*
> - * Request the regions.
> - */
> - if (!request_mem_region(res_csi->start, resource_size(res_csi),
> - MX2_CAM_DRV_NAME)) {
> - err = -EBUSY;
> - goto exit_dma_free;
> + pcdev->base_csi = devm_request_and_ioremap(&pdev->dev, res_csi);
> + if (!pcdev->base_csi) {
> + err = -EADDRNOTAVAIL;
> + goto exit;
> }
>
> - base_csi = ioremap(res_csi->start, resource_size(res_csi));
> - if (!base_csi) {
> - err = -ENOMEM;
> - goto exit_release;
> - }
> - pcdev->irq_csi = irq_csi;
> - pcdev->base_csi = base_csi;
> - pcdev->base_dma = res_csi->start;
> pcdev->dev = &pdev->dev;
> + platform_set_drvdata(pdev, pcdev);
>
> if (cpu_is_mx25()) {
> - err = request_irq(pcdev->irq_csi, mx25_camera_irq, 0,
> - MX2_CAM_DRV_NAME, pcdev);
> + err = devm_request_irq(&pdev->dev, irq_csi, mx25_camera_irq, 0,
> + MX2_CAM_DRV_NAME, pcdev);
> if (err) {
> dev_err(pcdev->dev, "Camera interrupt register failed \n");
> - goto exit_iounmap;
> + goto exit;
> }
> }
>
> if (cpu_is_mx27()) {
> - /* EMMA support */
> - res_emma = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> - irq_emma = platform_get_irq(pdev, 1);
> -
> - if (!res_emma || !irq_emma) {
> - dev_err(&pdev->dev, "no EMMA resources\n");
> - goto exit_free_irq;
> - }
> -
> - pcdev->res_emma = res_emma;
> - pcdev->irq_emma = irq_emma;
> - if (mx27_camera_emma_init(pcdev))
> - goto exit_free_irq;
> + err = mx27_camera_emma_init(pdev);
> + if (err)
> + goto exit;
> }
>
> pcdev->soc_host.drv_name = MX2_CAM_DRV_NAME,
> @@ -1793,25 +1763,9 @@ exit_free_emma:
> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
> eallocctx:
> if (cpu_is_mx27()) {
> - free_irq(pcdev->irq_emma, pcdev);
> clk_disable_unprepare(pcdev->clk_emma_ipg);
> - clk_put(pcdev->clk_emma_ipg);
> clk_disable_unprepare(pcdev->clk_emma_ahb);
> - clk_put(pcdev->clk_emma_ahb);
> - iounmap(pcdev->base_emma);
> - release_mem_region(pcdev->res_emma->start, resource_size(pcdev->res_emma));
> }
> -exit_free_irq:
> - if (cpu_is_mx25())
> - free_irq(pcdev->irq_csi, pcdev);
> -exit_iounmap:
> - iounmap(base_csi);
> -exit_release:
> - release_mem_region(res_csi->start, resource_size(res_csi));
> -exit_dma_free:
> - clk_put(pcdev->clk_csi);
> -exit_kfree:
> - kfree(pcdev);
> exit:
> return err;
> }
> @@ -1821,35 +1775,16 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
> struct soc_camera_host *soc_host = to_soc_camera_host(&pdev->dev);
> struct mx2_camera_dev *pcdev = container_of(soc_host,
> struct mx2_camera_dev, soc_host);
> - struct resource *res;
> -
> - clk_put(pcdev->clk_csi);
> - if (cpu_is_mx25())
> - free_irq(pcdev->irq_csi, pcdev);
> - if (cpu_is_mx27())
> - free_irq(pcdev->irq_emma, pcdev);
>
> soc_camera_host_unregister(&pcdev->soc_host);
>
> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
>
> - iounmap(pcdev->base_csi);
> -
> if (cpu_is_mx27()) {
> clk_disable_unprepare(pcdev->clk_emma_ipg);
> - clk_put(pcdev->clk_emma_ipg);
> clk_disable_unprepare(pcdev->clk_emma_ahb);
> - clk_put(pcdev->clk_emma_ahb);
> - iounmap(pcdev->base_emma);
> - res = pcdev->res_emma;
> - release_mem_region(res->start, resource_size(res));
> }
>
> - res = pcdev->res_csi;
> - release_mem_region(res->start, resource_size(res));
> -
> - kfree(pcdev);
> -
> dev_info(&pdev->dev, "MX2 Camera driver unloaded\n");
>
> return 0;
> --
> 1.7.9.5
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion
2012-09-17 5:34 ` [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion Shawn Guo
@ 2012-09-17 9:21 ` Guennadi Liakhovetski
2012-09-17 13:43 ` javier Martin
0 siblings, 1 reply; 30+ messages in thread
From: Guennadi Liakhovetski @ 2012-09-17 9:21 UTC (permalink / raw)
To: Shawn Guo
Cc: linux-arm-kernel, Sascha Hauer, Fabio Estevam, Rob Herring,
Arnd Bergmann, linux-media
On Mon, 17 Sep 2012, Shawn Guo wrote:
> It changes the driver to use platform_device_id rather than cpu_is_xxx
> to determine the controller type, and updates the platform code
> accordingly.
>
> As the result, mach/hardware.h inclusion gets removed from the driver.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: linux-media@vger.kernel.org
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Thanks
Guennadi
> ---
> arch/arm/mach-imx/clk-imx25.c | 6 +-
> arch/arm/mach-imx/clk-imx27.c | 6 +-
> arch/arm/mach-imx/devices/devices-common.h | 1 +
> arch/arm/mach-imx/devices/platform-mx2-camera.c | 12 +--
> drivers/media/video/mx2_camera.c | 95 +++++++++++++++++------
> 5 files changed, 85 insertions(+), 35 deletions(-)
>
> diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
> index 1aea073..71fe521 100644
> --- a/arch/arm/mach-imx/clk-imx25.c
> +++ b/arch/arm/mach-imx/clk-imx25.c
> @@ -231,9 +231,9 @@ int __init mx25_clocks_init(void)
> clk_register_clkdev(clk[esdhc2_ipg_per], "per", "sdhci-esdhc-imx25.1");
> clk_register_clkdev(clk[esdhc2_ipg], "ipg", "sdhci-esdhc-imx25.1");
> clk_register_clkdev(clk[esdhc2_ahb], "ahb", "sdhci-esdhc-imx25.1");
> - clk_register_clkdev(clk[csi_ipg_per], "per", "mx2-camera.0");
> - clk_register_clkdev(clk[csi_ipg], "ipg", "mx2-camera.0");
> - clk_register_clkdev(clk[csi_ahb], "ahb", "mx2-camera.0");
> + clk_register_clkdev(clk[csi_ipg_per], "per", "imx25-camera.0");
> + clk_register_clkdev(clk[csi_ipg], "ipg", "imx25-camera.0");
> + clk_register_clkdev(clk[csi_ahb], "ahb", "imx25-camera.0");
> clk_register_clkdev(clk[dummy], "audmux", NULL);
> clk_register_clkdev(clk[can1_ipg], NULL, "flexcan.0");
> clk_register_clkdev(clk[can2_ipg], NULL, "flexcan.1");
> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
> index 5ff5cf0..e26de52 100644
> --- a/arch/arm/mach-imx/clk-imx27.c
> +++ b/arch/arm/mach-imx/clk-imx27.c
> @@ -224,7 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
> clk_register_clkdev(clk[per3_gate], "per", "imx-fb.0");
> clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
> clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
> - clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
> + clk_register_clkdev(clk[csi_ahb_gate], "ahb", "imx27-camera.0");
> clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
> clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
> clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
> @@ -251,8 +251,8 @@ int __init mx27_clocks_init(unsigned long fref)
> clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx21-i2c.1");
> clk_register_clkdev(clk[owire_ipg_gate], NULL, "mxc_w1.0");
> clk_register_clkdev(clk[kpp_ipg_gate], NULL, "imx-keypad");
> - clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "mx2-camera.0");
> - clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "mx2-camera.0");
> + clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "imx27-camera.0");
> + clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "imx27-camera.0");
> clk_register_clkdev(clk[emma_ahb_gate], "ahb", "m2m-emmaprp.0");
> clk_register_clkdev(clk[emma_ipg_gate], "ipg", "m2m-emmaprp.0");
> clk_register_clkdev(clk[iim_ipg_gate], "iim", NULL);
> diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
> index 7f2698c..8112a1a 100644
> --- a/arch/arm/mach-imx/devices/devices-common.h
> +++ b/arch/arm/mach-imx/devices/devices-common.h
> @@ -202,6 +202,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
>
> #include <linux/platform_data/camera-mx2.h>
> struct imx_mx2_camera_data {
> + const char *devid;
> resource_size_t iobasecsi;
> resource_size_t iosizecsi;
> resource_size_t irqcsi;
> diff --git a/arch/arm/mach-imx/devices/platform-mx2-camera.c b/arch/arm/mach-imx/devices/platform-mx2-camera.c
> index 9ad5b2d..b88877d 100644
> --- a/arch/arm/mach-imx/devices/platform-mx2-camera.c
> +++ b/arch/arm/mach-imx/devices/platform-mx2-camera.c
> @@ -9,14 +9,16 @@
> #include <mach/hardware.h>
> #include "devices-common.h"
>
> -#define imx_mx2_camera_data_entry_single(soc) \
> +#define imx_mx2_camera_data_entry_single(soc, _devid) \
> { \
> + .devid = _devid, \
> .iobasecsi = soc ## _CSI_BASE_ADDR, \
> .iosizecsi = SZ_4K, \
> .irqcsi = soc ## _INT_CSI, \
> }
> -#define imx_mx2_camera_data_entry_single_emma(soc) \
> +#define imx_mx2_camera_data_entry_single_emma(soc, _devid) \
> { \
> + .devid = _devid, \
> .iobasecsi = soc ## _CSI_BASE_ADDR, \
> .iosizecsi = SZ_32, \
> .irqcsi = soc ## _INT_CSI, \
> @@ -27,12 +29,12 @@
>
> #ifdef CONFIG_SOC_IMX25
> const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst =
> - imx_mx2_camera_data_entry_single(MX25);
> + imx_mx2_camera_data_entry_single(MX25, "imx25-camera");
> #endif /* ifdef CONFIG_SOC_IMX25 */
>
> #ifdef CONFIG_SOC_IMX27
> const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst =
> - imx_mx2_camera_data_entry_single_emma(MX27);
> + imx_mx2_camera_data_entry_single_emma(MX27, "imx27-camera");
> #endif /* ifdef CONFIG_SOC_IMX27 */
>
> struct platform_device *__init imx_add_mx2_camera(
> @@ -58,7 +60,7 @@ struct platform_device *__init imx_add_mx2_camera(
> .flags = IORESOURCE_IRQ,
> },
> };
> - return imx_add_platform_device_dmamask("mx2-camera", 0,
> + return imx_add_platform_device_dmamask(data->devid, 0,
> res, data->iobaseemmaprp ? 4 : 2,
> pdata, sizeof(*pdata), DMA_BIT_MASK(32));
> }
> diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
> index fe4c76c..cde3374 100644
> --- a/drivers/media/video/mx2_camera.c
> +++ b/drivers/media/video/mx2_camera.c
> @@ -41,7 +41,6 @@
> #include <linux/videodev2.h>
>
> #include <linux/platform_data/camera-mx2.h>
> -#include <mach/hardware.h>
>
> #include <asm/dma.h>
>
> @@ -121,11 +120,13 @@
>
> #define CSICR1 0x00
> #define CSICR2 0x04
> -#define CSISR (cpu_is_mx27() ? 0x08 : 0x18)
> +#define CSISR_IMX25 0x18
> +#define CSISR_IMX27 0x08
> #define CSISTATFIFO 0x0c
> #define CSIRFIFO 0x10
> #define CSIRXCNT 0x14
> -#define CSICR3 (cpu_is_mx27() ? 0x1C : 0x08)
> +#define CSICR3_IMX25 0x08
> +#define CSICR3_IMX27 0x1c
> #define CSIDMASA_STATFIFO 0x20
> #define CSIDMATA_STATFIFO 0x24
> #define CSIDMASA_FB1 0x28
> @@ -268,6 +269,11 @@ struct mx2_buffer {
> struct mx2_buf_internal internal;
> };
>
> +enum mx2_camera_type {
> + IMX25_CAMERA,
> + IMX27_CAMERA,
> +};
> +
> struct mx2_camera_dev {
> struct device *dev;
> struct soc_camera_host soc_host;
> @@ -291,6 +297,9 @@ struct mx2_camera_dev {
> struct mx2_buffer *fb2_active;
>
> u32 csicr1;
> + u32 reg_csisr;
> + u32 reg_csicr3;
> + enum mx2_camera_type devtype;
>
> struct mx2_buf_internal buf_discard[2];
> void *discard_buffer;
> @@ -303,6 +312,29 @@ struct mx2_camera_dev {
> struct vb2_alloc_ctx *alloc_ctx;
> };
>
> +static struct platform_device_id mx2_camera_devtype[] = {
> + {
> + .name = "imx25-camera",
> + .driver_data = IMX25_CAMERA,
> + }, {
> + .name = "imx27-camera",
> + .driver_data = IMX27_CAMERA,
> + }, {
> + /* sentinel */
> + }
> +};
> +MODULE_DEVICE_TABLE(platform, mx2_camera_devtype);
> +
> +static inline int is_imx25_camera(struct mx2_camera_dev *pcdev)
> +{
> + return pcdev->devtype == IMX25_CAMERA;
> +}
> +
> +static inline int is_imx27_camera(struct mx2_camera_dev *pcdev)
> +{
> + return pcdev->devtype == IMX27_CAMERA;
> +}
> +
> static struct mx2_buffer *mx2_ibuf_to_buf(struct mx2_buf_internal *int_buf)
> {
> return container_of(int_buf, struct mx2_buffer, internal);
> @@ -406,9 +438,9 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
>
> clk_disable_unprepare(pcdev->clk_csi);
> writel(0, pcdev->base_csi + CSICR1);
> - if (cpu_is_mx27()) {
> + if (is_imx27_camera(pcdev)) {
> writel(0, pcdev->base_emma + PRP_CNTL);
> - } else if (cpu_is_mx25()) {
> + } else if (is_imx25_camera(pcdev)) {
> spin_lock_irqsave(&pcdev->lock, flags);
> pcdev->fb1_active = NULL;
> pcdev->fb2_active = NULL;
> @@ -438,7 +470,7 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
>
> csicr1 = CSICR1_MCLKEN;
>
> - if (cpu_is_mx27())
> + if (is_imx27_camera(pcdev))
> csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
> CSICR1_RXFF_LEVEL(0);
>
> @@ -514,7 +546,7 @@ out:
> static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
> {
> struct mx2_camera_dev *pcdev = data;
> - u32 status = readl(pcdev->base_csi + CSISR);
> + u32 status = readl(pcdev->base_csi + pcdev->reg_csisr);
>
> if (status & CSISR_DMA_TSF_FB1_INT)
> mx25_camera_frame_done(pcdev, 1, MX2_STATE_DONE);
> @@ -523,7 +555,7 @@ static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
>
> /* FIXME: handle CSISR_RFF_OR_INT */
>
> - writel(status, pcdev->base_csi + CSISR);
> + writel(status, pcdev->base_csi + pcdev->reg_csisr);
>
> return IRQ_HANDLED;
> }
> @@ -608,7 +640,7 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
> buf->state = MX2_STATE_QUEUED;
> list_add_tail(&buf->internal.queue, &pcdev->capture);
>
> - if (cpu_is_mx25()) {
> + if (is_imx25_camera(pcdev)) {
> u32 csicr3, dma_inten = 0;
>
> if (pcdev->fb1_active == NULL) {
> @@ -627,20 +659,20 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
> list_del(&buf->internal.queue);
> buf->state = MX2_STATE_ACTIVE;
>
> - csicr3 = readl(pcdev->base_csi + CSICR3);
> + csicr3 = readl(pcdev->base_csi + pcdev->reg_csicr3);
>
> /* Reflash DMA */
> writel(csicr3 | CSICR3_DMA_REFLASH_RFF,
> - pcdev->base_csi + CSICR3);
> + pcdev->base_csi + pcdev->reg_csicr3);
>
> /* clear & enable interrupts */
> - writel(dma_inten, pcdev->base_csi + CSISR);
> + writel(dma_inten, pcdev->base_csi + pcdev->reg_csisr);
> pcdev->csicr1 |= dma_inten;
> writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
>
> /* enable DMA */
> csicr3 |= CSICR3_DMA_REQ_EN_RFF | CSICR3_RXFF_LEVEL(1);
> - writel(csicr3, pcdev->base_csi + CSICR3);
> + writel(csicr3, pcdev->base_csi + pcdev->reg_csicr3);
> }
> }
>
> @@ -684,7 +716,7 @@ static void mx2_videobuf_release(struct vb2_buffer *vb)
> */
>
> spin_lock_irqsave(&pcdev->lock, flags);
> - if (cpu_is_mx25() && buf->state == MX2_STATE_ACTIVE) {
> + if (is_imx25_camera(pcdev) && buf->state == MX2_STATE_ACTIVE) {
> if (pcdev->fb1_active == buf) {
> pcdev->csicr1 &= ~CSICR1_FB1_DMA_INTEN;
> writel(0, pcdev->base_csi + CSIDMASA_FB1);
> @@ -807,7 +839,7 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count)
> unsigned long phys;
> int bytesperline;
>
> - if (cpu_is_mx27()) {
> + if (is_imx27_camera(pcdev)) {
> unsigned long flags;
> if (count < 2)
> return -EINVAL;
> @@ -902,7 +934,7 @@ static int mx2_stop_streaming(struct vb2_queue *q)
> void *b;
> u32 cntl;
>
> - if (cpu_is_mx27()) {
> + if (is_imx27_camera(pcdev)) {
> spin_lock_irqsave(&pcdev->lock, flags);
>
> cntl = readl(pcdev->base_emma + PRP_CNTL);
> @@ -1054,11 +1086,11 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd)
> if (bytesperline < 0)
> return bytesperline;
>
> - if (cpu_is_mx27()) {
> + if (is_imx27_camera(pcdev)) {
> ret = mx27_camera_emma_prp_reset(pcdev);
> if (ret)
> return ret;
> - } else if (cpu_is_mx25()) {
> + } else if (is_imx25_camera(pcdev)) {
> writel((bytesperline * icd->user_height) >> 2,
> pcdev->base_csi + CSIRXCNT);
> writel((bytesperline << 16) | icd->user_height,
> @@ -1351,7 +1383,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
> /* FIXME: implement MX27 limits */
>
> /* limit to MX25 hardware capabilities */
> - if (cpu_is_mx25()) {
> + if (is_imx25_camera(pcdev)) {
> if (xlate->host_fmt->bits_per_sample <= 8)
> width_limit = 0xffff * 4;
> else
> @@ -1685,6 +1717,20 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> goto exit;
> }
>
> + pcdev->devtype = pdev->id_entry->driver_data;
> + switch (pcdev->devtype) {
> + case IMX25_CAMERA:
> + pcdev->reg_csisr = CSISR_IMX25;
> + pcdev->reg_csicr3 = CSICR3_IMX25;
> + break;
> + case IMX27_CAMERA:
> + pcdev->reg_csisr = CSISR_IMX27;
> + pcdev->reg_csicr3 = CSICR3_IMX27;
> + break;
> + default:
> + break;
> + }
> +
> pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
> if (IS_ERR(pcdev->clk_csi)) {
> dev_err(&pdev->dev, "Could not get csi clock\n");
> @@ -1722,7 +1768,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> pcdev->dev = &pdev->dev;
> platform_set_drvdata(pdev, pcdev);
>
> - if (cpu_is_mx25()) {
> + if (is_imx25_camera(pcdev)) {
> err = devm_request_irq(&pdev->dev, irq_csi, mx25_camera_irq, 0,
> MX2_CAM_DRV_NAME, pcdev);
> if (err) {
> @@ -1731,7 +1777,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> }
> }
>
> - if (cpu_is_mx27()) {
> + if (is_imx27_camera(pcdev)) {
> err = mx27_camera_emma_init(pdev);
> if (err)
> goto exit;
> @@ -1742,7 +1788,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> pcdev->soc_host.priv = pcdev;
> pcdev->soc_host.v4l2_dev.dev = &pdev->dev;
> pcdev->soc_host.nr = pdev->id;
> - if (cpu_is_mx25())
> + if (is_imx25_camera(pcdev))
> pcdev->soc_host.capabilities = SOCAM_HOST_CAP_STRIDE;
>
> pcdev->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev);
> @@ -1762,7 +1808,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> exit_free_emma:
> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
> eallocctx:
> - if (cpu_is_mx27()) {
> + if (is_imx27_camera(pcdev)) {
> clk_disable_unprepare(pcdev->clk_emma_ipg);
> clk_disable_unprepare(pcdev->clk_emma_ahb);
> }
> @@ -1780,7 +1826,7 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
>
> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
>
> - if (cpu_is_mx27()) {
> + if (is_imx27_camera(pcdev)) {
> clk_disable_unprepare(pcdev->clk_emma_ipg);
> clk_disable_unprepare(pcdev->clk_emma_ahb);
> }
> @@ -1794,6 +1840,7 @@ static struct platform_driver mx2_camera_driver = {
> .driver = {
> .name = MX2_CAM_DRV_NAME,
> },
> + .id_table = mx2_camera_devtype,
> .remove = __devexit_p(mx2_camera_remove),
> };
>
> --
> 1.7.9.5
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 14/34] dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h
2012-09-17 5:34 ` [PATCH 14/34] dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h Shawn Guo
@ 2012-09-17 9:26 ` Guennadi Liakhovetski
2012-09-27 7:38 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 30+ messages in thread
From: Guennadi Liakhovetski @ 2012-09-17 9:26 UTC (permalink / raw)
To: Shawn Guo
Cc: linux-arm-kernel, Sascha Hauer, Fabio Estevam, Rob Herring,
Arnd Bergmann, Vinod Koul, Florian Tobias Schandinat, linux-media,
linux-fbdev
On Mon, 17 Sep 2012, Shawn Guo wrote:
> The header ipu.h really belongs to dma subsystem rather than imx
> platform. Rename it to ipu-dma.h and put it into include/linux/dma/.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Vinod Koul <vinod.koul@intel.com>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
> Cc: linux-media@vger.kernel.org
> Cc: linux-fbdev@vger.kernel.org
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Thanks
Guennadi
> ---
> drivers/dma/ipu/ipu_idmac.c | 3 +--
> drivers/dma/ipu/ipu_irq.c | 3 +--
> drivers/media/video/mx3_camera.c | 2 +-
> drivers/video/mx3fb.c | 2 +-
> .../mach/ipu.h => include/linux/dma/ipu-dma.h | 6 +++---
> 5 files changed, 7 insertions(+), 9 deletions(-)
> rename arch/arm/mach-imx/include/mach/ipu.h => include/linux/dma/ipu-dma.h (97%)
>
> diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c
> index c7573e5..6585537 100644
> --- a/drivers/dma/ipu/ipu_idmac.c
> +++ b/drivers/dma/ipu/ipu_idmac.c
> @@ -22,8 +22,7 @@
> #include <linux/interrupt.h>
> #include <linux/io.h>
> #include <linux/module.h>
> -
> -#include <mach/ipu.h>
> +#include <linux/dma/ipu-dma.h>
>
> #include "../dmaengine.h"
> #include "ipu_intern.h"
> diff --git a/drivers/dma/ipu/ipu_irq.c b/drivers/dma/ipu/ipu_irq.c
> index fa95bcc..a5ee37d 100644
> --- a/drivers/dma/ipu/ipu_irq.c
> +++ b/drivers/dma/ipu/ipu_irq.c
> @@ -15,8 +15,7 @@
> #include <linux/irq.h>
> #include <linux/io.h>
> #include <linux/module.h>
> -
> -#include <mach/ipu.h>
> +#include <linux/dma/ipu-dma.h>
>
> #include "ipu_intern.h"
>
> diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
> index 1481b0d..892cba5 100644
> --- a/drivers/media/video/mx3_camera.c
> +++ b/drivers/media/video/mx3_camera.c
> @@ -17,6 +17,7 @@
> #include <linux/vmalloc.h>
> #include <linux/interrupt.h>
> #include <linux/sched.h>
> +#include <linux/dma/ipu-dma.h>
>
> #include <media/v4l2-common.h>
> #include <media/v4l2-dev.h>
> @@ -24,7 +25,6 @@
> #include <media/soc_camera.h>
> #include <media/soc_mediabus.h>
>
> -#include <mach/ipu.h>
> #include <linux/platform_data/camera-mx3.h>
> #include <linux/platform_data/dma-imx.h>
>
> diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
> index d738108..3b63ad8 100644
> --- a/drivers/video/mx3fb.c
> +++ b/drivers/video/mx3fb.c
> @@ -26,10 +26,10 @@
> #include <linux/console.h>
> #include <linux/clk.h>
> #include <linux/mutex.h>
> +#include <linux/dma/ipu-dma.h>
>
> #include <linux/platform_data/dma-imx.h>
> #include <mach/hardware.h>
> -#include <mach/ipu.h>
> #include <linux/platform_data/video-mx3fb.h>
>
> #include <asm/io.h>
> diff --git a/arch/arm/mach-imx/include/mach/ipu.h b/include/linux/dma/ipu-dma.h
> similarity index 97%
> rename from arch/arm/mach-imx/include/mach/ipu.h
> rename to include/linux/dma/ipu-dma.h
> index 539e559..1803111 100644
> --- a/arch/arm/mach-imx/include/mach/ipu.h
> +++ b/include/linux/dma/ipu-dma.h
> @@ -9,8 +9,8 @@
> * published by the Free Software Foundation.
> */
>
> -#ifndef _IPU_H_
> -#define _IPU_H_
> +#ifndef __LINUX_DMA_IPU_DMA_H
> +#define __LINUX_DMA_IPU_DMA_H
>
> #include <linux/types.h>
> #include <linux/dmaengine.h>
> @@ -174,4 +174,4 @@ struct idmac_channel {
> #define to_tx_desc(tx) container_of(tx, struct idmac_tx_desc, txd)
> #define to_idmac_chan(c) container_of(c, struct idmac_channel, dma_chan)
>
> -#endif
> +#endif /* __LINUX_DMA_IPU_DMA_H */
> --
> 1.7.9.5
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 00/34] i.MX multi-platform support
2012-09-17 7:51 ` [PATCH 00/34] i.MX multi-platform support Sascha Hauer
@ 2012-09-17 11:38 ` Arnd Bergmann
2012-09-18 8:20 ` Shawn Guo
1 sibling, 0 replies; 30+ messages in thread
From: Arnd Bergmann @ 2012-09-17 11:38 UTC (permalink / raw)
To: Sascha Hauer
Cc: Shawn Guo, linux-arm-kernel, Fabio Estevam, Rob Herring,
Mark Brown, alsa-devel, Florian Tobias Schandinat, linux-fbdev,
Chris Ball, linux-mmc, Guennadi Liakhovetski, linux-media,
Andrew Morton, rtc-linux, Artem Bityutskiy, linux-mtd,
Wolfram Sang, linux-i2c, Wim Van Sebroeck, linux-watchdog,
Greg Kroah-Hartman, linux-usb, Vinod Koul, Javier Martin,
Paulius Zaleckas
On Monday 17 September 2012, Sascha Hauer wrote:
> On Mon, Sep 17, 2012 at 01:34:29PM +0800, Shawn Guo wrote:
> > The series enables multi-platform support for imx. Since the required
> > frameworks (clk, pwm) and spare_irq have already been adopted on imx,
> > the series is all about cleaning up mach/* headers. Along with the
> > changes, arch/arm/plat-mxc gets merged into arch/arm/mach-imx.
> >
> > It's based on a bunch of branches (works from others), Rob's initial
> > multi-platform series, Arnd's platform-data and smp_ops (Marc's) and
> > imx 3.7 material (Sascha and myself).
> >
> > It's available on branch below.
> >
> > git://git.linaro.org/people/shawnguo/linux-2.6.git imx/multi-platform
> >
> > It's been tested on imx5 and imx6, and only compile-tested on imx2 and
> > imx3, so testing on imx2/3 are appreciated.
>
> Great work! This really pushes the i.MX architecture one step closer to
> a clean code base.
I agree, this series is wonderful, I thought it would take much longer
to get this far.
Two small comments on the last two patches from me, but overall I really
love it.
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 27/34] media: mx2_camera: use managed functions to clean up code
2012-09-17 9:11 ` Guennadi Liakhovetski
@ 2012-09-17 13:36 ` javier Martin
2012-09-18 7:43 ` Shawn Guo
0 siblings, 1 reply; 30+ messages in thread
From: javier Martin @ 2012-09-17 13:36 UTC (permalink / raw)
To: Guennadi Liakhovetski
Cc: Shawn Guo, linux-arm-kernel, Sascha Hauer, Fabio Estevam,
Rob Herring, Arnd Bergmann, linux-media
Hi,
On 17 September 2012 11:11, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> On Mon, 17 Sep 2012, Shawn Guo wrote:
>
>> Use managed functions to clean up the error handling code and function
>> mx2_camera_remove(). Along with the change, a few variables get removed
>> from struct mx2_camera_dev.
>>
>> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>> Cc: linux-media@vger.kernel.org
>
> (in case you want to push it via arm-soc)
>
> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
This patch breaks the driver:
soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
Unable to handle kernel paging request at virtual address 656d6162
pgd = c0004000
[656d6162] *pgd=00000000
Internal error: Oops: 80000005 [#1] PREEMPT ARM
Modules linked in:
CPU: 0 Not tainted (3.6.0-rc5-01222-g3413fb1 #12)
PC is at 0x656d6162
LR is at soc_camera_host_register+0x230/0x81c
pc : [<656d6162>] lr : [<c01ff6a0>] psr: 40000033
sp : c3025e48 ip : 00000000 fp : 00000000
r10: c03f236c r9 : 00000000 r8 : 00000001
r7 : 00000000 r6 : c317d414 r5 : c30431a0 r4 : c317d600
r3 : 656d6163 r2 : c3025e18 r1 : 000c0000 r0 : c317d600
Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA Thumb Segment kernel
Control: 0005317f Table: a0004000 DAC: 00000017
Process swapper (pid: 1, stack limit = 0xc3024270)
Stack: (0xc3025e48 to 0xc3026000)
5e40: c3006460 00000000 c3192960 00000043 c317d638 c005d624
5e60: 00000043 c317d410 c317d478 c317d414 c02012f0 c317d410 00000000 00000043
5e80: c31a9800 c31a9820 00000000 c022ca74 c300ab20 00000000 c306e4a8 c306e4a0
5ea0: c30000c0 40000013 000080d0 c317d410 c317d410 c306e4a8 c306e4a0 00000001
5ec0: 00000000 c03f236c 00000000 c02c8d50 00000000 c03535ee c317d410 c02c8a44
5ee0: c306e4a8 c306e4a8 c03fc478 c03fc478 00000050 c03e0774 c03dc684 c0189d30
5f00: c306e4a8 c0188c3c c306e4a8 c306e4dc c03fc478 00000000 00000050 c0188db8
5f20: c03fc478 c3025f30 c0188d58 c0187610 c300760c c3079ad0 c03fc478 c03fc478
5f40: c318e680 c03f6458 00000000 c0187d24 c03535ee c03535ee c3025f58 c03fc478
5f60: 00000001 c04049c0 00000000 c01892c8 c03fc464 00000001 c04049c0 00000000
5f80: 00000050 c018a05c c03dc67c c03d4e84 c04049c0 c00087c8 00000006 00000006
5fa0: c03eeca0 c03dc67c 00000007 c03dc67c 00000007 c04049c0 c03c41a4 00000050
5fc0: c03e0774 c03c42f4 00000006 00000006 c03c41a4 00000000 00000000 c03c4214
5fe0: c0014900 00000013 00000000 00000000 00000000 c0014900 ffffffff ffffffff
[<c01ff6a0>] (soc_camera_host_register+0x230/0x81c) from [<c02c8d50>]
(mx2_camera_probe+0x30c/0x3ac)
[<c02c8d50>] (mx2_camera_probe+0x30c/0x3ac) from [<c0189d30>]
(platform_drv_probe+0x14/0x18)
[<c0189d30>] (platform_drv_probe+0x14/0x18) from [<c0188c3c>]
(driver_probe_device+0xb0/0x1cc)
[<c0188c3c>] (driver_probe_device+0xb0/0x1cc) from [<c0188db8>]
(__driver_attach+0x60/0x84)
[<c0188db8>] (__driver_attach+0x60/0x84) from [<c0187610>]
(bus_for_each_dev+0x48/0x84)
[<c0187610>] (bus_for_each_dev+0x48/0x84) from [<c0187d24>]
(bus_add_driver+0x9c/0x20c)
[<c0187d24>] (bus_add_driver+0x9c/0x20c) from [<c01892c8>]
(driver_register+0xa0/0x138)
[<c01892c8>] (driver_register+0xa0/0x138) from [<c018a05c>]
(platform_driver_probe+0x18/0x98)
[<c018a05c>] (platform_driver_probe+0x18/0x98) from [<c00087c8>]
(do_one_initcall+0x94/0x16c)
[<c00087c8>] (do_one_initcall+0x94/0x16c) from [<c03c42f4>]
(kernel_init+0xe0/0x1ac)
[<c03c42f4>] (kernel_init+0xe0/0x1ac) from [<c0014900>]
(kernel_thread_exit+0x0/0x8)
Code: bad PC value
---[ end trace 7f259a1ce2e10b1a ]---
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
--
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 26/34] media: mx2_camera: remove dead code in mx2_camera_add_device
2012-09-17 8:18 ` Guennadi Liakhovetski
@ 2012-09-17 13:36 ` javier Martin
2012-09-18 1:49 ` Shawn Guo
1 sibling, 0 replies; 30+ messages in thread
From: javier Martin @ 2012-09-17 13:36 UTC (permalink / raw)
To: Guennadi Liakhovetski
Cc: Shawn Guo, linux-arm-kernel, Sascha Hauer, Fabio Estevam,
Rob Herring, Arnd Bergmann, linux-media
On 17 September 2012 10:18, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> Hi Shawn
>
> Thanks for the clean up. Would you like these patches to go via a single
> tree, presumably, arm-soc? In this case
>
> On Mon, 17 Sep 2012, Shawn Guo wrote:
>
>> This is a piece of code becoming dead since commit 2c9ba37 ([media]
>> V4L: mx2_camera: remove unsupported i.MX27 DMA mode, make EMMA
>> mandatory). It should have been removed together with the commit.
>> Remove it now.
>>
>> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>> Cc: linux-media@vger.kernel.org
>
Acked-by: Javier Martin <javier.martin@vista-silicon.com>
> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>
> Thanks
> Guennadi
>
>> ---
>> drivers/media/video/mx2_camera.c | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
>> index 965427f..89c7e28 100644
>> --- a/drivers/media/video/mx2_camera.c
>> +++ b/drivers/media/video/mx2_camera.c
>> @@ -441,11 +441,9 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
>>
>> csicr1 = CSICR1_MCLKEN;
>>
>> - if (cpu_is_mx27()) {
>> + if (cpu_is_mx27())
>> csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
>> CSICR1_RXFF_LEVEL(0);
>> - } else if (cpu_is_mx27())
>> - csicr1 |= CSICR1_SOF_INTEN | CSICR1_RXFF_LEVEL(2);
>>
>> pcdev->csicr1 = csicr1;
>> writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
>> --
>> 1.7.9.5
>>
>
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion
2012-09-17 9:21 ` Guennadi Liakhovetski
@ 2012-09-17 13:43 ` javier Martin
2012-09-17 13:59 ` Guennadi Liakhovetski
0 siblings, 1 reply; 30+ messages in thread
From: javier Martin @ 2012-09-17 13:43 UTC (permalink / raw)
To: Guennadi Liakhovetski
Cc: Shawn Guo, linux-arm-kernel, Sascha Hauer, Fabio Estevam,
Rob Herring, Arnd Bergmann, linux-media
Hi Shawn,
On 17 September 2012 11:21, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> On Mon, 17 Sep 2012, Shawn Guo wrote:
>
>> It changes the driver to use platform_device_id rather than cpu_is_xxx
>> to determine the controller type, and updates the platform code
>> accordingly.
>>
>> As the result, mach/hardware.h inclusion gets removed from the driver.
>>
>> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>> Cc: linux-media@vger.kernel.org
>
> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
i.MX25 support is broken and is scheduled for removal.
I think we should not keep on trying to maintain it. Couldn't we just
drop it? It only makes maintenance tasks more difficult.
> Thanks
> Guennadi
>
>> ---
>> arch/arm/mach-imx/clk-imx25.c | 6 +-
>> arch/arm/mach-imx/clk-imx27.c | 6 +-
>> arch/arm/mach-imx/devices/devices-common.h | 1 +
>> arch/arm/mach-imx/devices/platform-mx2-camera.c | 12 +--
>> drivers/media/video/mx2_camera.c | 95 +++++++++++++++++------
>> 5 files changed, 85 insertions(+), 35 deletions(-)
>>
>> diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
>> index 1aea073..71fe521 100644
>> --- a/arch/arm/mach-imx/clk-imx25.c
>> +++ b/arch/arm/mach-imx/clk-imx25.c
>> @@ -231,9 +231,9 @@ int __init mx25_clocks_init(void)
>> clk_register_clkdev(clk[esdhc2_ipg_per], "per", "sdhci-esdhc-imx25.1");
>> clk_register_clkdev(clk[esdhc2_ipg], "ipg", "sdhci-esdhc-imx25.1");
>> clk_register_clkdev(clk[esdhc2_ahb], "ahb", "sdhci-esdhc-imx25.1");
>> - clk_register_clkdev(clk[csi_ipg_per], "per", "mx2-camera.0");
>> - clk_register_clkdev(clk[csi_ipg], "ipg", "mx2-camera.0");
>> - clk_register_clkdev(clk[csi_ahb], "ahb", "mx2-camera.0");
>> + clk_register_clkdev(clk[csi_ipg_per], "per", "imx25-camera.0");
>> + clk_register_clkdev(clk[csi_ipg], "ipg", "imx25-camera.0");
>> + clk_register_clkdev(clk[csi_ahb], "ahb", "imx25-camera.0");
>> clk_register_clkdev(clk[dummy], "audmux", NULL);
>> clk_register_clkdev(clk[can1_ipg], NULL, "flexcan.0");
>> clk_register_clkdev(clk[can2_ipg], NULL, "flexcan.1");
>> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
>> index 5ff5cf0..e26de52 100644
>> --- a/arch/arm/mach-imx/clk-imx27.c
>> +++ b/arch/arm/mach-imx/clk-imx27.c
>> @@ -224,7 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
>> clk_register_clkdev(clk[per3_gate], "per", "imx-fb.0");
>> clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
>> clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
>> - clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
>> + clk_register_clkdev(clk[csi_ahb_gate], "ahb", "imx27-camera.0");
>> clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
>> clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
>> clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
>> @@ -251,8 +251,8 @@ int __init mx27_clocks_init(unsigned long fref)
>> clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx21-i2c.1");
>> clk_register_clkdev(clk[owire_ipg_gate], NULL, "mxc_w1.0");
>> clk_register_clkdev(clk[kpp_ipg_gate], NULL, "imx-keypad");
>> - clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "mx2-camera.0");
>> - clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "mx2-camera.0");
>> + clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "imx27-camera.0");
>> + clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "imx27-camera.0");
>> clk_register_clkdev(clk[emma_ahb_gate], "ahb", "m2m-emmaprp.0");
>> clk_register_clkdev(clk[emma_ipg_gate], "ipg", "m2m-emmaprp.0");
>> clk_register_clkdev(clk[iim_ipg_gate], "iim", NULL);
>> diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
>> index 7f2698c..8112a1a 100644
>> --- a/arch/arm/mach-imx/devices/devices-common.h
>> +++ b/arch/arm/mach-imx/devices/devices-common.h
>> @@ -202,6 +202,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
>>
>> #include <linux/platform_data/camera-mx2.h>
>> struct imx_mx2_camera_data {
>> + const char *devid;
>> resource_size_t iobasecsi;
>> resource_size_t iosizecsi;
>> resource_size_t irqcsi;
>> diff --git a/arch/arm/mach-imx/devices/platform-mx2-camera.c b/arch/arm/mach-imx/devices/platform-mx2-camera.c
>> index 9ad5b2d..b88877d 100644
>> --- a/arch/arm/mach-imx/devices/platform-mx2-camera.c
>> +++ b/arch/arm/mach-imx/devices/platform-mx2-camera.c
>> @@ -9,14 +9,16 @@
>> #include <mach/hardware.h>
>> #include "devices-common.h"
>>
>> -#define imx_mx2_camera_data_entry_single(soc) \
>> +#define imx_mx2_camera_data_entry_single(soc, _devid) \
>> { \
>> + .devid = _devid, \
>> .iobasecsi = soc ## _CSI_BASE_ADDR, \
>> .iosizecsi = SZ_4K, \
>> .irqcsi = soc ## _INT_CSI, \
>> }
>> -#define imx_mx2_camera_data_entry_single_emma(soc) \
>> +#define imx_mx2_camera_data_entry_single_emma(soc, _devid) \
>> { \
>> + .devid = _devid, \
>> .iobasecsi = soc ## _CSI_BASE_ADDR, \
>> .iosizecsi = SZ_32, \
>> .irqcsi = soc ## _INT_CSI, \
>> @@ -27,12 +29,12 @@
>>
>> #ifdef CONFIG_SOC_IMX25
>> const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst =
>> - imx_mx2_camera_data_entry_single(MX25);
>> + imx_mx2_camera_data_entry_single(MX25, "imx25-camera");
>> #endif /* ifdef CONFIG_SOC_IMX25 */
>>
>> #ifdef CONFIG_SOC_IMX27
>> const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst =
>> - imx_mx2_camera_data_entry_single_emma(MX27);
>> + imx_mx2_camera_data_entry_single_emma(MX27, "imx27-camera");
>> #endif /* ifdef CONFIG_SOC_IMX27 */
>>
>> struct platform_device *__init imx_add_mx2_camera(
>> @@ -58,7 +60,7 @@ struct platform_device *__init imx_add_mx2_camera(
>> .flags = IORESOURCE_IRQ,
>> },
>> };
>> - return imx_add_platform_device_dmamask("mx2-camera", 0,
>> + return imx_add_platform_device_dmamask(data->devid, 0,
>> res, data->iobaseemmaprp ? 4 : 2,
>> pdata, sizeof(*pdata), DMA_BIT_MASK(32));
>> }
>> diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
>> index fe4c76c..cde3374 100644
>> --- a/drivers/media/video/mx2_camera.c
>> +++ b/drivers/media/video/mx2_camera.c
>> @@ -41,7 +41,6 @@
>> #include <linux/videodev2.h>
>>
>> #include <linux/platform_data/camera-mx2.h>
>> -#include <mach/hardware.h>
>>
>> #include <asm/dma.h>
>>
>> @@ -121,11 +120,13 @@
>>
>> #define CSICR1 0x00
>> #define CSICR2 0x04
>> -#define CSISR (cpu_is_mx27() ? 0x08 : 0x18)
>> +#define CSISR_IMX25 0x18
>> +#define CSISR_IMX27 0x08
>> #define CSISTATFIFO 0x0c
>> #define CSIRFIFO 0x10
>> #define CSIRXCNT 0x14
>> -#define CSICR3 (cpu_is_mx27() ? 0x1C : 0x08)
>> +#define CSICR3_IMX25 0x08
>> +#define CSICR3_IMX27 0x1c
>> #define CSIDMASA_STATFIFO 0x20
>> #define CSIDMATA_STATFIFO 0x24
>> #define CSIDMASA_FB1 0x28
>> @@ -268,6 +269,11 @@ struct mx2_buffer {
>> struct mx2_buf_internal internal;
>> };
>>
>> +enum mx2_camera_type {
>> + IMX25_CAMERA,
>> + IMX27_CAMERA,
>> +};
>> +
>> struct mx2_camera_dev {
>> struct device *dev;
>> struct soc_camera_host soc_host;
>> @@ -291,6 +297,9 @@ struct mx2_camera_dev {
>> struct mx2_buffer *fb2_active;
>>
>> u32 csicr1;
>> + u32 reg_csisr;
>> + u32 reg_csicr3;
>> + enum mx2_camera_type devtype;
>>
>> struct mx2_buf_internal buf_discard[2];
>> void *discard_buffer;
>> @@ -303,6 +312,29 @@ struct mx2_camera_dev {
>> struct vb2_alloc_ctx *alloc_ctx;
>> };
>>
>> +static struct platform_device_id mx2_camera_devtype[] = {
>> + {
>> + .name = "imx25-camera",
>> + .driver_data = IMX25_CAMERA,
>> + }, {
>> + .name = "imx27-camera",
>> + .driver_data = IMX27_CAMERA,
>> + }, {
>> + /* sentinel */
>> + }
>> +};
>> +MODULE_DEVICE_TABLE(platform, mx2_camera_devtype);
>> +
>> +static inline int is_imx25_camera(struct mx2_camera_dev *pcdev)
>> +{
>> + return pcdev->devtype == IMX25_CAMERA;
>> +}
>> +
>> +static inline int is_imx27_camera(struct mx2_camera_dev *pcdev)
>> +{
>> + return pcdev->devtype == IMX27_CAMERA;
>> +}
>> +
>> static struct mx2_buffer *mx2_ibuf_to_buf(struct mx2_buf_internal *int_buf)
>> {
>> return container_of(int_buf, struct mx2_buffer, internal);
>> @@ -406,9 +438,9 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
>>
>> clk_disable_unprepare(pcdev->clk_csi);
>> writel(0, pcdev->base_csi + CSICR1);
>> - if (cpu_is_mx27()) {
>> + if (is_imx27_camera(pcdev)) {
>> writel(0, pcdev->base_emma + PRP_CNTL);
>> - } else if (cpu_is_mx25()) {
>> + } else if (is_imx25_camera(pcdev)) {
>> spin_lock_irqsave(&pcdev->lock, flags);
>> pcdev->fb1_active = NULL;
>> pcdev->fb2_active = NULL;
>> @@ -438,7 +470,7 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
>>
>> csicr1 = CSICR1_MCLKEN;
>>
>> - if (cpu_is_mx27())
>> + if (is_imx27_camera(pcdev))
>> csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
>> CSICR1_RXFF_LEVEL(0);
>>
>> @@ -514,7 +546,7 @@ out:
>> static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
>> {
>> struct mx2_camera_dev *pcdev = data;
>> - u32 status = readl(pcdev->base_csi + CSISR);
>> + u32 status = readl(pcdev->base_csi + pcdev->reg_csisr);
>>
>> if (status & CSISR_DMA_TSF_FB1_INT)
>> mx25_camera_frame_done(pcdev, 1, MX2_STATE_DONE);
>> @@ -523,7 +555,7 @@ static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
>>
>> /* FIXME: handle CSISR_RFF_OR_INT */
>>
>> - writel(status, pcdev->base_csi + CSISR);
>> + writel(status, pcdev->base_csi + pcdev->reg_csisr);
>>
>> return IRQ_HANDLED;
>> }
>> @@ -608,7 +640,7 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
>> buf->state = MX2_STATE_QUEUED;
>> list_add_tail(&buf->internal.queue, &pcdev->capture);
>>
>> - if (cpu_is_mx25()) {
>> + if (is_imx25_camera(pcdev)) {
>> u32 csicr3, dma_inten = 0;
>>
>> if (pcdev->fb1_active == NULL) {
>> @@ -627,20 +659,20 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
>> list_del(&buf->internal.queue);
>> buf->state = MX2_STATE_ACTIVE;
>>
>> - csicr3 = readl(pcdev->base_csi + CSICR3);
>> + csicr3 = readl(pcdev->base_csi + pcdev->reg_csicr3);
>>
>> /* Reflash DMA */
>> writel(csicr3 | CSICR3_DMA_REFLASH_RFF,
>> - pcdev->base_csi + CSICR3);
>> + pcdev->base_csi + pcdev->reg_csicr3);
>>
>> /* clear & enable interrupts */
>> - writel(dma_inten, pcdev->base_csi + CSISR);
>> + writel(dma_inten, pcdev->base_csi + pcdev->reg_csisr);
>> pcdev->csicr1 |= dma_inten;
>> writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
>>
>> /* enable DMA */
>> csicr3 |= CSICR3_DMA_REQ_EN_RFF | CSICR3_RXFF_LEVEL(1);
>> - writel(csicr3, pcdev->base_csi + CSICR3);
>> + writel(csicr3, pcdev->base_csi + pcdev->reg_csicr3);
>> }
>> }
>>
>> @@ -684,7 +716,7 @@ static void mx2_videobuf_release(struct vb2_buffer *vb)
>> */
>>
>> spin_lock_irqsave(&pcdev->lock, flags);
>> - if (cpu_is_mx25() && buf->state == MX2_STATE_ACTIVE) {
>> + if (is_imx25_camera(pcdev) && buf->state == MX2_STATE_ACTIVE) {
>> if (pcdev->fb1_active == buf) {
>> pcdev->csicr1 &= ~CSICR1_FB1_DMA_INTEN;
>> writel(0, pcdev->base_csi + CSIDMASA_FB1);
>> @@ -807,7 +839,7 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count)
>> unsigned long phys;
>> int bytesperline;
>>
>> - if (cpu_is_mx27()) {
>> + if (is_imx27_camera(pcdev)) {
>> unsigned long flags;
>> if (count < 2)
>> return -EINVAL;
>> @@ -902,7 +934,7 @@ static int mx2_stop_streaming(struct vb2_queue *q)
>> void *b;
>> u32 cntl;
>>
>> - if (cpu_is_mx27()) {
>> + if (is_imx27_camera(pcdev)) {
>> spin_lock_irqsave(&pcdev->lock, flags);
>>
>> cntl = readl(pcdev->base_emma + PRP_CNTL);
>> @@ -1054,11 +1086,11 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd)
>> if (bytesperline < 0)
>> return bytesperline;
>>
>> - if (cpu_is_mx27()) {
>> + if (is_imx27_camera(pcdev)) {
>> ret = mx27_camera_emma_prp_reset(pcdev);
>> if (ret)
>> return ret;
>> - } else if (cpu_is_mx25()) {
>> + } else if (is_imx25_camera(pcdev)) {
>> writel((bytesperline * icd->user_height) >> 2,
>> pcdev->base_csi + CSIRXCNT);
>> writel((bytesperline << 16) | icd->user_height,
>> @@ -1351,7 +1383,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
>> /* FIXME: implement MX27 limits */
>>
>> /* limit to MX25 hardware capabilities */
>> - if (cpu_is_mx25()) {
>> + if (is_imx25_camera(pcdev)) {
>> if (xlate->host_fmt->bits_per_sample <= 8)
>> width_limit = 0xffff * 4;
>> else
>> @@ -1685,6 +1717,20 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> goto exit;
>> }
>>
>> + pcdev->devtype = pdev->id_entry->driver_data;
>> + switch (pcdev->devtype) {
>> + case IMX25_CAMERA:
>> + pcdev->reg_csisr = CSISR_IMX25;
>> + pcdev->reg_csicr3 = CSICR3_IMX25;
>> + break;
>> + case IMX27_CAMERA:
>> + pcdev->reg_csisr = CSISR_IMX27;
>> + pcdev->reg_csicr3 = CSICR3_IMX27;
>> + break;
>> + default:
>> + break;
>> + }
>> +
>> pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
>> if (IS_ERR(pcdev->clk_csi)) {
>> dev_err(&pdev->dev, "Could not get csi clock\n");
>> @@ -1722,7 +1768,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> pcdev->dev = &pdev->dev;
>> platform_set_drvdata(pdev, pcdev);
>>
>> - if (cpu_is_mx25()) {
>> + if (is_imx25_camera(pcdev)) {
>> err = devm_request_irq(&pdev->dev, irq_csi, mx25_camera_irq, 0,
>> MX2_CAM_DRV_NAME, pcdev);
>> if (err) {
>> @@ -1731,7 +1777,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> }
>> }
>>
>> - if (cpu_is_mx27()) {
>> + if (is_imx27_camera(pcdev)) {
>> err = mx27_camera_emma_init(pdev);
>> if (err)
>> goto exit;
>> @@ -1742,7 +1788,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> pcdev->soc_host.priv = pcdev;
>> pcdev->soc_host.v4l2_dev.dev = &pdev->dev;
>> pcdev->soc_host.nr = pdev->id;
>> - if (cpu_is_mx25())
>> + if (is_imx25_camera(pcdev))
>> pcdev->soc_host.capabilities = SOCAM_HOST_CAP_STRIDE;
>>
>> pcdev->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev);
>> @@ -1762,7 +1808,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> exit_free_emma:
>> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
>> eallocctx:
>> - if (cpu_is_mx27()) {
>> + if (is_imx27_camera(pcdev)) {
>> clk_disable_unprepare(pcdev->clk_emma_ipg);
>> clk_disable_unprepare(pcdev->clk_emma_ahb);
>> }
>> @@ -1780,7 +1826,7 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
>>
>> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
>>
>> - if (cpu_is_mx27()) {
>> + if (is_imx27_camera(pcdev)) {
>> clk_disable_unprepare(pcdev->clk_emma_ipg);
>> clk_disable_unprepare(pcdev->clk_emma_ahb);
>> }
>> @@ -1794,6 +1840,7 @@ static struct platform_driver mx2_camera_driver = {
>> .driver = {
>> .name = MX2_CAM_DRV_NAME,
>> },
>> + .id_table = mx2_camera_devtype,
>> .remove = __devexit_p(mx2_camera_remove),
>> };
>>
>> --
>> 1.7.9.5
I can't test this patch because it depends heavily on the previous
one, which breaks the driver.
Regards.
--
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion
2012-09-17 13:43 ` javier Martin
@ 2012-09-17 13:59 ` Guennadi Liakhovetski
2012-09-18 8:35 ` javier Martin
0 siblings, 1 reply; 30+ messages in thread
From: Guennadi Liakhovetski @ 2012-09-17 13:59 UTC (permalink / raw)
To: javier Martin
Cc: Shawn Guo, linux-arm-kernel, Sascha Hauer, Fabio Estevam,
Rob Herring, Arnd Bergmann, linux-media
On Mon, 17 Sep 2012, javier Martin wrote:
> Hi Shawn,
>
> On 17 September 2012 11:21, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> > On Mon, 17 Sep 2012, Shawn Guo wrote:
> >
> >> It changes the driver to use platform_device_id rather than cpu_is_xxx
> >> to determine the controller type, and updates the platform code
> >> accordingly.
> >>
> >> As the result, mach/hardware.h inclusion gets removed from the driver.
> >>
> >> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> >> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> >> Cc: linux-media@vger.kernel.org
> >
> > Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>
> i.MX25 support is broken and is scheduled for removal.
It is not yet, I haven't pushed those your patches yet.
Thanks
Guennadi
> I think we should not keep on trying to maintain it. Couldn't we just
> drop it? It only makes maintenance tasks more difficult.
>
> > Thanks
> > Guennadi
> >
> >> ---
> >> arch/arm/mach-imx/clk-imx25.c | 6 +-
> >> arch/arm/mach-imx/clk-imx27.c | 6 +-
> >> arch/arm/mach-imx/devices/devices-common.h | 1 +
> >> arch/arm/mach-imx/devices/platform-mx2-camera.c | 12 +--
> >> drivers/media/video/mx2_camera.c | 95 +++++++++++++++++------
> >> 5 files changed, 85 insertions(+), 35 deletions(-)
> >>
> >> diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
> >> index 1aea073..71fe521 100644
> >> --- a/arch/arm/mach-imx/clk-imx25.c
> >> +++ b/arch/arm/mach-imx/clk-imx25.c
> >> @@ -231,9 +231,9 @@ int __init mx25_clocks_init(void)
> >> clk_register_clkdev(clk[esdhc2_ipg_per], "per", "sdhci-esdhc-imx25.1");
> >> clk_register_clkdev(clk[esdhc2_ipg], "ipg", "sdhci-esdhc-imx25.1");
> >> clk_register_clkdev(clk[esdhc2_ahb], "ahb", "sdhci-esdhc-imx25.1");
> >> - clk_register_clkdev(clk[csi_ipg_per], "per", "mx2-camera.0");
> >> - clk_register_clkdev(clk[csi_ipg], "ipg", "mx2-camera.0");
> >> - clk_register_clkdev(clk[csi_ahb], "ahb", "mx2-camera.0");
> >> + clk_register_clkdev(clk[csi_ipg_per], "per", "imx25-camera.0");
> >> + clk_register_clkdev(clk[csi_ipg], "ipg", "imx25-camera.0");
> >> + clk_register_clkdev(clk[csi_ahb], "ahb", "imx25-camera.0");
> >> clk_register_clkdev(clk[dummy], "audmux", NULL);
> >> clk_register_clkdev(clk[can1_ipg], NULL, "flexcan.0");
> >> clk_register_clkdev(clk[can2_ipg], NULL, "flexcan.1");
> >> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
> >> index 5ff5cf0..e26de52 100644
> >> --- a/arch/arm/mach-imx/clk-imx27.c
> >> +++ b/arch/arm/mach-imx/clk-imx27.c
> >> @@ -224,7 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
> >> clk_register_clkdev(clk[per3_gate], "per", "imx-fb.0");
> >> clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
> >> clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
> >> - clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
> >> + clk_register_clkdev(clk[csi_ahb_gate], "ahb", "imx27-camera.0");
> >> clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
> >> clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
> >> clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
> >> @@ -251,8 +251,8 @@ int __init mx27_clocks_init(unsigned long fref)
> >> clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx21-i2c.1");
> >> clk_register_clkdev(clk[owire_ipg_gate], NULL, "mxc_w1.0");
> >> clk_register_clkdev(clk[kpp_ipg_gate], NULL, "imx-keypad");
> >> - clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "mx2-camera.0");
> >> - clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "mx2-camera.0");
> >> + clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "imx27-camera.0");
> >> + clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "imx27-camera.0");
> >> clk_register_clkdev(clk[emma_ahb_gate], "ahb", "m2m-emmaprp.0");
> >> clk_register_clkdev(clk[emma_ipg_gate], "ipg", "m2m-emmaprp.0");
> >> clk_register_clkdev(clk[iim_ipg_gate], "iim", NULL);
> >> diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
> >> index 7f2698c..8112a1a 100644
> >> --- a/arch/arm/mach-imx/devices/devices-common.h
> >> +++ b/arch/arm/mach-imx/devices/devices-common.h
> >> @@ -202,6 +202,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
> >>
> >> #include <linux/platform_data/camera-mx2.h>
> >> struct imx_mx2_camera_data {
> >> + const char *devid;
> >> resource_size_t iobasecsi;
> >> resource_size_t iosizecsi;
> >> resource_size_t irqcsi;
> >> diff --git a/arch/arm/mach-imx/devices/platform-mx2-camera.c b/arch/arm/mach-imx/devices/platform-mx2-camera.c
> >> index 9ad5b2d..b88877d 100644
> >> --- a/arch/arm/mach-imx/devices/platform-mx2-camera.c
> >> +++ b/arch/arm/mach-imx/devices/platform-mx2-camera.c
> >> @@ -9,14 +9,16 @@
> >> #include <mach/hardware.h>
> >> #include "devices-common.h"
> >>
> >> -#define imx_mx2_camera_data_entry_single(soc) \
> >> +#define imx_mx2_camera_data_entry_single(soc, _devid) \
> >> { \
> >> + .devid = _devid, \
> >> .iobasecsi = soc ## _CSI_BASE_ADDR, \
> >> .iosizecsi = SZ_4K, \
> >> .irqcsi = soc ## _INT_CSI, \
> >> }
> >> -#define imx_mx2_camera_data_entry_single_emma(soc) \
> >> +#define imx_mx2_camera_data_entry_single_emma(soc, _devid) \
> >> { \
> >> + .devid = _devid, \
> >> .iobasecsi = soc ## _CSI_BASE_ADDR, \
> >> .iosizecsi = SZ_32, \
> >> .irqcsi = soc ## _INT_CSI, \
> >> @@ -27,12 +29,12 @@
> >>
> >> #ifdef CONFIG_SOC_IMX25
> >> const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst =
> >> - imx_mx2_camera_data_entry_single(MX25);
> >> + imx_mx2_camera_data_entry_single(MX25, "imx25-camera");
> >> #endif /* ifdef CONFIG_SOC_IMX25 */
> >>
> >> #ifdef CONFIG_SOC_IMX27
> >> const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst =
> >> - imx_mx2_camera_data_entry_single_emma(MX27);
> >> + imx_mx2_camera_data_entry_single_emma(MX27, "imx27-camera");
> >> #endif /* ifdef CONFIG_SOC_IMX27 */
> >>
> >> struct platform_device *__init imx_add_mx2_camera(
> >> @@ -58,7 +60,7 @@ struct platform_device *__init imx_add_mx2_camera(
> >> .flags = IORESOURCE_IRQ,
> >> },
> >> };
> >> - return imx_add_platform_device_dmamask("mx2-camera", 0,
> >> + return imx_add_platform_device_dmamask(data->devid, 0,
> >> res, data->iobaseemmaprp ? 4 : 2,
> >> pdata, sizeof(*pdata), DMA_BIT_MASK(32));
> >> }
> >> diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
> >> index fe4c76c..cde3374 100644
> >> --- a/drivers/media/video/mx2_camera.c
> >> +++ b/drivers/media/video/mx2_camera.c
> >> @@ -41,7 +41,6 @@
> >> #include <linux/videodev2.h>
> >>
> >> #include <linux/platform_data/camera-mx2.h>
> >> -#include <mach/hardware.h>
> >>
> >> #include <asm/dma.h>
> >>
> >> @@ -121,11 +120,13 @@
> >>
> >> #define CSICR1 0x00
> >> #define CSICR2 0x04
> >> -#define CSISR (cpu_is_mx27() ? 0x08 : 0x18)
> >> +#define CSISR_IMX25 0x18
> >> +#define CSISR_IMX27 0x08
> >> #define CSISTATFIFO 0x0c
> >> #define CSIRFIFO 0x10
> >> #define CSIRXCNT 0x14
> >> -#define CSICR3 (cpu_is_mx27() ? 0x1C : 0x08)
> >> +#define CSICR3_IMX25 0x08
> >> +#define CSICR3_IMX27 0x1c
> >> #define CSIDMASA_STATFIFO 0x20
> >> #define CSIDMATA_STATFIFO 0x24
> >> #define CSIDMASA_FB1 0x28
> >> @@ -268,6 +269,11 @@ struct mx2_buffer {
> >> struct mx2_buf_internal internal;
> >> };
> >>
> >> +enum mx2_camera_type {
> >> + IMX25_CAMERA,
> >> + IMX27_CAMERA,
> >> +};
> >> +
> >> struct mx2_camera_dev {
> >> struct device *dev;
> >> struct soc_camera_host soc_host;
> >> @@ -291,6 +297,9 @@ struct mx2_camera_dev {
> >> struct mx2_buffer *fb2_active;
> >>
> >> u32 csicr1;
> >> + u32 reg_csisr;
> >> + u32 reg_csicr3;
> >> + enum mx2_camera_type devtype;
> >>
> >> struct mx2_buf_internal buf_discard[2];
> >> void *discard_buffer;
> >> @@ -303,6 +312,29 @@ struct mx2_camera_dev {
> >> struct vb2_alloc_ctx *alloc_ctx;
> >> };
> >>
> >> +static struct platform_device_id mx2_camera_devtype[] = {
> >> + {
> >> + .name = "imx25-camera",
> >> + .driver_data = IMX25_CAMERA,
> >> + }, {
> >> + .name = "imx27-camera",
> >> + .driver_data = IMX27_CAMERA,
> >> + }, {
> >> + /* sentinel */
> >> + }
> >> +};
> >> +MODULE_DEVICE_TABLE(platform, mx2_camera_devtype);
> >> +
> >> +static inline int is_imx25_camera(struct mx2_camera_dev *pcdev)
> >> +{
> >> + return pcdev->devtype == IMX25_CAMERA;
> >> +}
> >> +
> >> +static inline int is_imx27_camera(struct mx2_camera_dev *pcdev)
> >> +{
> >> + return pcdev->devtype == IMX27_CAMERA;
> >> +}
> >> +
> >> static struct mx2_buffer *mx2_ibuf_to_buf(struct mx2_buf_internal *int_buf)
> >> {
> >> return container_of(int_buf, struct mx2_buffer, internal);
> >> @@ -406,9 +438,9 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
> >>
> >> clk_disable_unprepare(pcdev->clk_csi);
> >> writel(0, pcdev->base_csi + CSICR1);
> >> - if (cpu_is_mx27()) {
> >> + if (is_imx27_camera(pcdev)) {
> >> writel(0, pcdev->base_emma + PRP_CNTL);
> >> - } else if (cpu_is_mx25()) {
> >> + } else if (is_imx25_camera(pcdev)) {
> >> spin_lock_irqsave(&pcdev->lock, flags);
> >> pcdev->fb1_active = NULL;
> >> pcdev->fb2_active = NULL;
> >> @@ -438,7 +470,7 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
> >>
> >> csicr1 = CSICR1_MCLKEN;
> >>
> >> - if (cpu_is_mx27())
> >> + if (is_imx27_camera(pcdev))
> >> csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
> >> CSICR1_RXFF_LEVEL(0);
> >>
> >> @@ -514,7 +546,7 @@ out:
> >> static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
> >> {
> >> struct mx2_camera_dev *pcdev = data;
> >> - u32 status = readl(pcdev->base_csi + CSISR);
> >> + u32 status = readl(pcdev->base_csi + pcdev->reg_csisr);
> >>
> >> if (status & CSISR_DMA_TSF_FB1_INT)
> >> mx25_camera_frame_done(pcdev, 1, MX2_STATE_DONE);
> >> @@ -523,7 +555,7 @@ static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
> >>
> >> /* FIXME: handle CSISR_RFF_OR_INT */
> >>
> >> - writel(status, pcdev->base_csi + CSISR);
> >> + writel(status, pcdev->base_csi + pcdev->reg_csisr);
> >>
> >> return IRQ_HANDLED;
> >> }
> >> @@ -608,7 +640,7 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
> >> buf->state = MX2_STATE_QUEUED;
> >> list_add_tail(&buf->internal.queue, &pcdev->capture);
> >>
> >> - if (cpu_is_mx25()) {
> >> + if (is_imx25_camera(pcdev)) {
> >> u32 csicr3, dma_inten = 0;
> >>
> >> if (pcdev->fb1_active == NULL) {
> >> @@ -627,20 +659,20 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
> >> list_del(&buf->internal.queue);
> >> buf->state = MX2_STATE_ACTIVE;
> >>
> >> - csicr3 = readl(pcdev->base_csi + CSICR3);
> >> + csicr3 = readl(pcdev->base_csi + pcdev->reg_csicr3);
> >>
> >> /* Reflash DMA */
> >> writel(csicr3 | CSICR3_DMA_REFLASH_RFF,
> >> - pcdev->base_csi + CSICR3);
> >> + pcdev->base_csi + pcdev->reg_csicr3);
> >>
> >> /* clear & enable interrupts */
> >> - writel(dma_inten, pcdev->base_csi + CSISR);
> >> + writel(dma_inten, pcdev->base_csi + pcdev->reg_csisr);
> >> pcdev->csicr1 |= dma_inten;
> >> writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
> >>
> >> /* enable DMA */
> >> csicr3 |= CSICR3_DMA_REQ_EN_RFF | CSICR3_RXFF_LEVEL(1);
> >> - writel(csicr3, pcdev->base_csi + CSICR3);
> >> + writel(csicr3, pcdev->base_csi + pcdev->reg_csicr3);
> >> }
> >> }
> >>
> >> @@ -684,7 +716,7 @@ static void mx2_videobuf_release(struct vb2_buffer *vb)
> >> */
> >>
> >> spin_lock_irqsave(&pcdev->lock, flags);
> >> - if (cpu_is_mx25() && buf->state == MX2_STATE_ACTIVE) {
> >> + if (is_imx25_camera(pcdev) && buf->state == MX2_STATE_ACTIVE) {
> >> if (pcdev->fb1_active == buf) {
> >> pcdev->csicr1 &= ~CSICR1_FB1_DMA_INTEN;
> >> writel(0, pcdev->base_csi + CSIDMASA_FB1);
> >> @@ -807,7 +839,7 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count)
> >> unsigned long phys;
> >> int bytesperline;
> >>
> >> - if (cpu_is_mx27()) {
> >> + if (is_imx27_camera(pcdev)) {
> >> unsigned long flags;
> >> if (count < 2)
> >> return -EINVAL;
> >> @@ -902,7 +934,7 @@ static int mx2_stop_streaming(struct vb2_queue *q)
> >> void *b;
> >> u32 cntl;
> >>
> >> - if (cpu_is_mx27()) {
> >> + if (is_imx27_camera(pcdev)) {
> >> spin_lock_irqsave(&pcdev->lock, flags);
> >>
> >> cntl = readl(pcdev->base_emma + PRP_CNTL);
> >> @@ -1054,11 +1086,11 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd)
> >> if (bytesperline < 0)
> >> return bytesperline;
> >>
> >> - if (cpu_is_mx27()) {
> >> + if (is_imx27_camera(pcdev)) {
> >> ret = mx27_camera_emma_prp_reset(pcdev);
> >> if (ret)
> >> return ret;
> >> - } else if (cpu_is_mx25()) {
> >> + } else if (is_imx25_camera(pcdev)) {
> >> writel((bytesperline * icd->user_height) >> 2,
> >> pcdev->base_csi + CSIRXCNT);
> >> writel((bytesperline << 16) | icd->user_height,
> >> @@ -1351,7 +1383,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
> >> /* FIXME: implement MX27 limits */
> >>
> >> /* limit to MX25 hardware capabilities */
> >> - if (cpu_is_mx25()) {
> >> + if (is_imx25_camera(pcdev)) {
> >> if (xlate->host_fmt->bits_per_sample <= 8)
> >> width_limit = 0xffff * 4;
> >> else
> >> @@ -1685,6 +1717,20 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> >> goto exit;
> >> }
> >>
> >> + pcdev->devtype = pdev->id_entry->driver_data;
> >> + switch (pcdev->devtype) {
> >> + case IMX25_CAMERA:
> >> + pcdev->reg_csisr = CSISR_IMX25;
> >> + pcdev->reg_csicr3 = CSICR3_IMX25;
> >> + break;
> >> + case IMX27_CAMERA:
> >> + pcdev->reg_csisr = CSISR_IMX27;
> >> + pcdev->reg_csicr3 = CSICR3_IMX27;
> >> + break;
> >> + default:
> >> + break;
> >> + }
> >> +
> >> pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
> >> if (IS_ERR(pcdev->clk_csi)) {
> >> dev_err(&pdev->dev, "Could not get csi clock\n");
> >> @@ -1722,7 +1768,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> >> pcdev->dev = &pdev->dev;
> >> platform_set_drvdata(pdev, pcdev);
> >>
> >> - if (cpu_is_mx25()) {
> >> + if (is_imx25_camera(pcdev)) {
> >> err = devm_request_irq(&pdev->dev, irq_csi, mx25_camera_irq, 0,
> >> MX2_CAM_DRV_NAME, pcdev);
> >> if (err) {
> >> @@ -1731,7 +1777,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> >> }
> >> }
> >>
> >> - if (cpu_is_mx27()) {
> >> + if (is_imx27_camera(pcdev)) {
> >> err = mx27_camera_emma_init(pdev);
> >> if (err)
> >> goto exit;
> >> @@ -1742,7 +1788,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> >> pcdev->soc_host.priv = pcdev;
> >> pcdev->soc_host.v4l2_dev.dev = &pdev->dev;
> >> pcdev->soc_host.nr = pdev->id;
> >> - if (cpu_is_mx25())
> >> + if (is_imx25_camera(pcdev))
> >> pcdev->soc_host.capabilities = SOCAM_HOST_CAP_STRIDE;
> >>
> >> pcdev->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev);
> >> @@ -1762,7 +1808,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> >> exit_free_emma:
> >> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
> >> eallocctx:
> >> - if (cpu_is_mx27()) {
> >> + if (is_imx27_camera(pcdev)) {
> >> clk_disable_unprepare(pcdev->clk_emma_ipg);
> >> clk_disable_unprepare(pcdev->clk_emma_ahb);
> >> }
> >> @@ -1780,7 +1826,7 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
> >>
> >> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
> >>
> >> - if (cpu_is_mx27()) {
> >> + if (is_imx27_camera(pcdev)) {
> >> clk_disable_unprepare(pcdev->clk_emma_ipg);
> >> clk_disable_unprepare(pcdev->clk_emma_ahb);
> >> }
> >> @@ -1794,6 +1840,7 @@ static struct platform_driver mx2_camera_driver = {
> >> .driver = {
> >> .name = MX2_CAM_DRV_NAME,
> >> },
> >> + .id_table = mx2_camera_devtype,
> >> .remove = __devexit_p(mx2_camera_remove),
> >> };
> >>
> >> --
> >> 1.7.9.5
>
> I can't test this patch because it depends heavily on the previous
> one, which breaks the driver.
>
> Regards.
>
> --
> Javier Martin
> Vista Silicon S.L.
> CDTUC - FASE C - Oficina S-345
> Avda de los Castros s/n
> 39005- Santander. Cantabria. Spain
> +34 942 25 32 60
> www.vista-silicon.com
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 12/34] media: mx1_camera: remove the driver
2012-09-17 8:33 ` Guennadi Liakhovetski
@ 2012-09-18 1:28 ` Shawn Guo
2012-09-18 9:13 ` Arnd Bergmann
0 siblings, 1 reply; 30+ messages in thread
From: Shawn Guo @ 2012-09-18 1:28 UTC (permalink / raw)
To: Guennadi Liakhovetski
Cc: linux-arm-kernel, Sascha Hauer, Fabio Estevam, Rob Herring,
Arnd Bergmann, Paulius Zaleckas, linux-media
On Mon, Sep 17, 2012 at 10:33:25AM +0200, Guennadi Liakhovetski wrote:
> Ok, it used to compile not-so-long-ago, but it doesn't seem to be cared
> for a lot lately. Let's give Paulius a bit more time to react to this
> mail, otherwise I'll have no objections. Just as an idea, to make it a bit
> milder we could first mark it BROKEN and add to remove schedule... But I
> don't mind either way.
>
I chose to remove the driver completely rather than marking it BROKEN
because the removal of the driver cleans up platform code a lot :)
Ok, if we hear anything back from Paulius in the next couple of weeks,
I keep the driver there with BROKEN marked.
Regards,
Shawn
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 26/34] media: mx2_camera: remove dead code in mx2_camera_add_device
2012-09-17 8:18 ` Guennadi Liakhovetski
2012-09-17 13:36 ` javier Martin
@ 2012-09-18 1:49 ` Shawn Guo
1 sibling, 0 replies; 30+ messages in thread
From: Shawn Guo @ 2012-09-18 1:49 UTC (permalink / raw)
To: Guennadi Liakhovetski
Cc: linux-arm-kernel, Sascha Hauer, Fabio Estevam, Rob Herring,
Arnd Bergmann, linux-media
On Mon, Sep 17, 2012 at 10:18:42AM +0200, Guennadi Liakhovetski wrote:
> Hi Shawn
>
> Thanks for the clean up. Would you like these patches to go via a single
> tree, presumably, arm-soc? In this case
>
Yes, to save the cross-tree dependency, I would like to have the series
go via arm-soc tree as a whole.
> On Mon, 17 Sep 2012, Shawn Guo wrote:
>
> > This is a piece of code becoming dead since commit 2c9ba37 ([media]
> > V4L: mx2_camera: remove unsupported i.MX27 DMA mode, make EMMA
> > mandatory). It should have been removed together with the commit.
> > Remove it now.
> >
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> > Cc: linux-media@vger.kernel.org
>
> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>
Thanks, Guennadi.
--
Regards,
Shawn
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 27/34] media: mx2_camera: use managed functions to clean up code
2012-09-17 13:36 ` javier Martin
@ 2012-09-18 7:43 ` Shawn Guo
2012-09-18 8:34 ` javier Martin
0 siblings, 1 reply; 30+ messages in thread
From: Shawn Guo @ 2012-09-18 7:43 UTC (permalink / raw)
To: javier Martin
Cc: Guennadi Liakhovetski, linux-arm-kernel, Sascha Hauer,
Fabio Estevam, Rob Herring, Arnd Bergmann, linux-media
On Mon, Sep 17, 2012 at 03:36:07PM +0200, javier Martin wrote:
> This patch breaks the driver:
>
Javier,
Can you please apply the following change to see if it fixes the
problem?
Shawn
@@ -1783,6 +1783,8 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
goto exit;
}
+ platform_set_drvdata(pdev, NULL);
+
pcdev->soc_host.drv_name = MX2_CAM_DRV_NAME,
pcdev->soc_host.ops = &mx2_soc_camera_host_ops,
pcdev->soc_host.priv = pcdev;
> soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
> Unable to handle kernel paging request at virtual address 656d6162
> pgd = c0004000
> [656d6162] *pgd=00000000
> Internal error: Oops: 80000005 [#1] PREEMPT ARM
> Modules linked in:
> CPU: 0 Not tainted (3.6.0-rc5-01222-g3413fb1 #12)
> PC is at 0x656d6162
> LR is at soc_camera_host_register+0x230/0x81c
> pc : [<656d6162>] lr : [<c01ff6a0>] psr: 40000033
> sp : c3025e48 ip : 00000000 fp : 00000000
> r10: c03f236c r9 : 00000000 r8 : 00000001
> r7 : 00000000 r6 : c317d414 r5 : c30431a0 r4 : c317d600
> r3 : 656d6163 r2 : c3025e18 r1 : 000c0000 r0 : c317d600
> Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA Thumb Segment kernel
> Control: 0005317f Table: a0004000 DAC: 00000017
> Process swapper (pid: 1, stack limit = 0xc3024270)
> Stack: (0xc3025e48 to 0xc3026000)
> 5e40: c3006460 00000000 c3192960 00000043 c317d638 c005d624
> 5e60: 00000043 c317d410 c317d478 c317d414 c02012f0 c317d410 00000000 00000043
> 5e80: c31a9800 c31a9820 00000000 c022ca74 c300ab20 00000000 c306e4a8 c306e4a0
> 5ea0: c30000c0 40000013 000080d0 c317d410 c317d410 c306e4a8 c306e4a0 00000001
> 5ec0: 00000000 c03f236c 00000000 c02c8d50 00000000 c03535ee c317d410 c02c8a44
> 5ee0: c306e4a8 c306e4a8 c03fc478 c03fc478 00000050 c03e0774 c03dc684 c0189d30
> 5f00: c306e4a8 c0188c3c c306e4a8 c306e4dc c03fc478 00000000 00000050 c0188db8
> 5f20: c03fc478 c3025f30 c0188d58 c0187610 c300760c c3079ad0 c03fc478 c03fc478
> 5f40: c318e680 c03f6458 00000000 c0187d24 c03535ee c03535ee c3025f58 c03fc478
> 5f60: 00000001 c04049c0 00000000 c01892c8 c03fc464 00000001 c04049c0 00000000
> 5f80: 00000050 c018a05c c03dc67c c03d4e84 c04049c0 c00087c8 00000006 00000006
> 5fa0: c03eeca0 c03dc67c 00000007 c03dc67c 00000007 c04049c0 c03c41a4 00000050
> 5fc0: c03e0774 c03c42f4 00000006 00000006 c03c41a4 00000000 00000000 c03c4214
> 5fe0: c0014900 00000013 00000000 00000000 00000000 c0014900 ffffffff ffffffff
> [<c01ff6a0>] (soc_camera_host_register+0x230/0x81c) from [<c02c8d50>]
> (mx2_camera_probe+0x30c/0x3ac)
> [<c02c8d50>] (mx2_camera_probe+0x30c/0x3ac) from [<c0189d30>]
> (platform_drv_probe+0x14/0x18)
> [<c0189d30>] (platform_drv_probe+0x14/0x18) from [<c0188c3c>]
> (driver_probe_device+0xb0/0x1cc)
> [<c0188c3c>] (driver_probe_device+0xb0/0x1cc) from [<c0188db8>]
> (__driver_attach+0x60/0x84)
> [<c0188db8>] (__driver_attach+0x60/0x84) from [<c0187610>]
> (bus_for_each_dev+0x48/0x84)
> [<c0187610>] (bus_for_each_dev+0x48/0x84) from [<c0187d24>]
> (bus_add_driver+0x9c/0x20c)
> [<c0187d24>] (bus_add_driver+0x9c/0x20c) from [<c01892c8>]
> (driver_register+0xa0/0x138)
> [<c01892c8>] (driver_register+0xa0/0x138) from [<c018a05c>]
> (platform_driver_probe+0x18/0x98)
> [<c018a05c>] (platform_driver_probe+0x18/0x98) from [<c00087c8>]
> (do_one_initcall+0x94/0x16c)
> [<c00087c8>] (do_one_initcall+0x94/0x16c) from [<c03c42f4>]
> (kernel_init+0xe0/0x1ac)
> [<c03c42f4>] (kernel_init+0xe0/0x1ac) from [<c0014900>]
> (kernel_thread_exit+0x0/0x8)
> Code: bad PC value
> ---[ end trace 7f259a1ce2e10b1a ]---
> Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 00/34] i.MX multi-platform support
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
` (5 preceding siblings ...)
2012-09-17 7:51 ` [PATCH 00/34] i.MX multi-platform support Sascha Hauer
@ 2012-09-18 7:52 ` Sascha Hauer
2012-09-18 8:05 ` [alsa-devel] " Shawn Guo
6 siblings, 1 reply; 30+ messages in thread
From: Sascha Hauer @ 2012-09-18 7:52 UTC (permalink / raw)
To: Shawn Guo
Cc: linux-arm-kernel, Fabio Estevam, Rob Herring, Arnd Bergmann,
Mark Brown, alsa-devel, Florian Tobias Schandinat, linux-fbdev,
Chris Ball, linux-mmc, Guennadi Liakhovetski, linux-media,
Andrew Morton, rtc-linux, Artem Bityutskiy, linux-mtd,
Wolfram Sang, linux-i2c, Wim Van Sebroeck, linux-watchdog,
Greg Kroah-Hartman, linux-usb, Vinod Koul, Javier Martin,
Paulius Zaleckas
Hi Shawn,
On Mon, Sep 17, 2012 at 01:34:29PM +0800, Shawn Guo wrote:
> The series enables multi-platform support for imx. Since the required
> frameworks (clk, pwm) and spare_irq have already been adopted on imx,
> the series is all about cleaning up mach/* headers. Along with the
> changes, arch/arm/plat-mxc gets merged into arch/arm/mach-imx.
>
> It's based on a bunch of branches (works from others), Rob's initial
> multi-platform series, Arnd's platform-data and smp_ops (Marc's) and
> imx 3.7 material (Sascha and myself).
>
> It's available on branch below.
>
> git://git.linaro.org/people/shawnguo/linux-2.6.git imx/multi-platform
>
> It's been tested on imx5 and imx6, and only compile-tested on imx2 and
> imx3, so testing on imx2/3 are appreciated.
>
> Subsystem maintainers,
>
> I plan to send the whole series via arm-soc tree at the end of 3.7
> merge window when all dependant bits hit mainline. Please have a
> look at the patches you get copied and provide ACKs if the changes
> are good. Thanks.
I just had a look at the remaining initcalls in arch-imx. Most of them
are protected with a cpu_is_*, but this one should be fixed before i.MX
is enabled for multi platform:
arch/arm/mach-imx/devices/devices.c:48:core_initcall(mxc_device_init);
I think this won't harm others directly, but it will register i.MX
related devices on foreign platforms.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [alsa-devel] [PATCH 00/34] i.MX multi-platform support
2012-09-18 7:52 ` Sascha Hauer
@ 2012-09-18 8:05 ` Shawn Guo
0 siblings, 0 replies; 30+ messages in thread
From: Shawn Guo @ 2012-09-18 8:05 UTC (permalink / raw)
To: Sascha Hauer
Cc: alsa-devel, Mark Brown, Artem Bityutskiy, linux-fbdev,
Wim Van Sebroeck, linux-mtd, linux-i2c, Arnd Bergmann,
Florian Tobias Schandinat, Paulius Zaleckas, Chris Ball,
linux-media, linux-watchdog, rtc-linux, Rob Herring,
linux-arm-kernel, Fabio Estevam, Vinod Koul, Greg Kroah-Hartman,
linux-usb, linux-mmc, Wolfram Sang, Javier Martin, Andrew Morton,
Guennadi Liakhovetski
On Tue, Sep 18, 2012 at 09:52:13AM +0200, Sascha Hauer wrote:
> I just had a look at the remaining initcalls in arch-imx. Most of them
> are protected with a cpu_is_*, but this one should be fixed before i.MX
> is enabled for multi platform:
>
> arch/arm/mach-imx/devices/devices.c:48:core_initcall(mxc_device_init);
>
Ah, I missed that. Thanks for reminding, Sascha.
Shawn
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 00/34] i.MX multi-platform support
2012-09-17 7:51 ` [PATCH 00/34] i.MX multi-platform support Sascha Hauer
2012-09-17 11:38 ` Arnd Bergmann
@ 2012-09-18 8:20 ` Shawn Guo
1 sibling, 0 replies; 30+ messages in thread
From: Shawn Guo @ 2012-09-18 8:20 UTC (permalink / raw)
To: Sascha Hauer
Cc: linux-arm-kernel, Fabio Estevam, Rob Herring, Arnd Bergmann,
Mark Brown, alsa-devel, Florian Tobias Schandinat, linux-fbdev,
Chris Ball, linux-mmc, Guennadi Liakhovetski, linux-media,
Andrew Morton, rtc-linux, Artem Bityutskiy, linux-mtd,
Wolfram Sang, linux-i2c, Wim Van Sebroeck, linux-watchdog,
Greg Kroah-Hartman, linux-usb, Vinod Koul, Javier Martin,
Paulius Zaleckas
On Mon, Sep 17, 2012 at 09:51:38AM +0200, Sascha Hauer wrote:
> I gave it a test on i.MX1, i.MX27, i.MX31 and i.MX35. All run fine, but
> the last patch breaks the imx_v4_v5_defconfig: Somehow it now defaults
> to ARMv7 based machines. I haven't looked into it, just reenabled
> ARMv4/ARMv5 and the boards again -> works. The config should be updated
> with the last patch.
>
Yes, I will rework the patch with all these and Arnd's comment on the
last patch taken into account.
> I'm fine with the changes to mx2-camera, but Javier should give his ok
> to it, he has worked on it quite a lot recently.
>
> One other issue related to imx-dma, see comment to that patch.
>
> Otherwise:
>
> Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
> Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
>
Thanks a lot.
Shawn
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 27/34] media: mx2_camera: use managed functions to clean up code
2012-09-18 7:43 ` Shawn Guo
@ 2012-09-18 8:34 ` javier Martin
0 siblings, 0 replies; 30+ messages in thread
From: javier Martin @ 2012-09-18 8:34 UTC (permalink / raw)
To: Shawn Guo
Cc: Guennadi Liakhovetski, linux-arm-kernel, Sascha Hauer,
Fabio Estevam, Rob Herring, Arnd Bergmann, linux-media
Hi Shawn,
On 18 September 2012 09:43, Shawn Guo <shawn.guo@linaro.org> wrote:
> On Mon, Sep 17, 2012 at 03:36:07PM +0200, javier Martin wrote:
>> This patch breaks the driver:
>>
> Javier,
>
> Can you please apply the following change to see if it fixes the
> problem?
>
> Shawn
>
> @@ -1783,6 +1783,8 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
> goto exit;
> }
>
> + platform_set_drvdata(pdev, NULL);
> +
> pcdev->soc_host.drv_name = MX2_CAM_DRV_NAME,
> pcdev->soc_host.ops = &mx2_soc_camera_host_ops,
> pcdev->soc_host.priv = pcdev;
Yes. That fixes the problem.
With this fix:
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Regards.
--
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion
2012-09-17 13:59 ` Guennadi Liakhovetski
@ 2012-09-18 8:35 ` javier Martin
2012-09-27 7:36 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 30+ messages in thread
From: javier Martin @ 2012-09-18 8:35 UTC (permalink / raw)
To: Guennadi Liakhovetski
Cc: Shawn Guo, linux-arm-kernel, Sascha Hauer, Fabio Estevam,
Rob Herring, Arnd Bergmann, linux-media
On 17 September 2012 15:59, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
> On Mon, 17 Sep 2012, javier Martin wrote:
>
>> Hi Shawn,
>>
>> On 17 September 2012 11:21, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
>> > On Mon, 17 Sep 2012, Shawn Guo wrote:
>> >
>> >> It changes the driver to use platform_device_id rather than cpu_is_xxx
>> >> to determine the controller type, and updates the platform code
>> >> accordingly.
>> >>
>> >> As the result, mach/hardware.h inclusion gets removed from the driver.
>> >>
>> >> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>> >> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>> >> Cc: linux-media@vger.kernel.org
>> >
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
>> > Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>
>> i.MX25 support is broken and is scheduled for removal.
>
> It is not yet, I haven't pushed those your patches yet.
>
> Thanks
> Guennadi
>
>> I think we should not keep on trying to maintain it. Couldn't we just
>> drop it? It only makes maintenance tasks more difficult.
>>
>> > Thanks
>> > Guennadi
>> >
>> >> ---
>> >> arch/arm/mach-imx/clk-imx25.c | 6 +-
>> >> arch/arm/mach-imx/clk-imx27.c | 6 +-
>> >> arch/arm/mach-imx/devices/devices-common.h | 1 +
>> >> arch/arm/mach-imx/devices/platform-mx2-camera.c | 12 +--
>> >> drivers/media/video/mx2_camera.c | 95 +++++++++++++++++------
>> >> 5 files changed, 85 insertions(+), 35 deletions(-)
>> >>
>> >> diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
>> >> index 1aea073..71fe521 100644
>> >> --- a/arch/arm/mach-imx/clk-imx25.c
>> >> +++ b/arch/arm/mach-imx/clk-imx25.c
>> >> @@ -231,9 +231,9 @@ int __init mx25_clocks_init(void)
>> >> clk_register_clkdev(clk[esdhc2_ipg_per], "per", "sdhci-esdhc-imx25.1");
>> >> clk_register_clkdev(clk[esdhc2_ipg], "ipg", "sdhci-esdhc-imx25.1");
>> >> clk_register_clkdev(clk[esdhc2_ahb], "ahb", "sdhci-esdhc-imx25.1");
>> >> - clk_register_clkdev(clk[csi_ipg_per], "per", "mx2-camera.0");
>> >> - clk_register_clkdev(clk[csi_ipg], "ipg", "mx2-camera.0");
>> >> - clk_register_clkdev(clk[csi_ahb], "ahb", "mx2-camera.0");
>> >> + clk_register_clkdev(clk[csi_ipg_per], "per", "imx25-camera.0");
>> >> + clk_register_clkdev(clk[csi_ipg], "ipg", "imx25-camera.0");
>> >> + clk_register_clkdev(clk[csi_ahb], "ahb", "imx25-camera.0");
>> >> clk_register_clkdev(clk[dummy], "audmux", NULL);
>> >> clk_register_clkdev(clk[can1_ipg], NULL, "flexcan.0");
>> >> clk_register_clkdev(clk[can2_ipg], NULL, "flexcan.1");
>> >> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
>> >> index 5ff5cf0..e26de52 100644
>> >> --- a/arch/arm/mach-imx/clk-imx27.c
>> >> +++ b/arch/arm/mach-imx/clk-imx27.c
>> >> @@ -224,7 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
>> >> clk_register_clkdev(clk[per3_gate], "per", "imx-fb.0");
>> >> clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
>> >> clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
>> >> - clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
>> >> + clk_register_clkdev(clk[csi_ahb_gate], "ahb", "imx27-camera.0");
>> >> clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
>> >> clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
>> >> clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
>> >> @@ -251,8 +251,8 @@ int __init mx27_clocks_init(unsigned long fref)
>> >> clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx21-i2c.1");
>> >> clk_register_clkdev(clk[owire_ipg_gate], NULL, "mxc_w1.0");
>> >> clk_register_clkdev(clk[kpp_ipg_gate], NULL, "imx-keypad");
>> >> - clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "mx2-camera.0");
>> >> - clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "mx2-camera.0");
>> >> + clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "imx27-camera.0");
>> >> + clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "imx27-camera.0");
>> >> clk_register_clkdev(clk[emma_ahb_gate], "ahb", "m2m-emmaprp.0");
>> >> clk_register_clkdev(clk[emma_ipg_gate], "ipg", "m2m-emmaprp.0");
>> >> clk_register_clkdev(clk[iim_ipg_gate], "iim", NULL);
>> >> diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
>> >> index 7f2698c..8112a1a 100644
>> >> --- a/arch/arm/mach-imx/devices/devices-common.h
>> >> +++ b/arch/arm/mach-imx/devices/devices-common.h
>> >> @@ -202,6 +202,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
>> >>
>> >> #include <linux/platform_data/camera-mx2.h>
>> >> struct imx_mx2_camera_data {
>> >> + const char *devid;
>> >> resource_size_t iobasecsi;
>> >> resource_size_t iosizecsi;
>> >> resource_size_t irqcsi;
>> >> diff --git a/arch/arm/mach-imx/devices/platform-mx2-camera.c b/arch/arm/mach-imx/devices/platform-mx2-camera.c
>> >> index 9ad5b2d..b88877d 100644
>> >> --- a/arch/arm/mach-imx/devices/platform-mx2-camera.c
>> >> +++ b/arch/arm/mach-imx/devices/platform-mx2-camera.c
>> >> @@ -9,14 +9,16 @@
>> >> #include <mach/hardware.h>
>> >> #include "devices-common.h"
>> >>
>> >> -#define imx_mx2_camera_data_entry_single(soc) \
>> >> +#define imx_mx2_camera_data_entry_single(soc, _devid) \
>> >> { \
>> >> + .devid = _devid, \
>> >> .iobasecsi = soc ## _CSI_BASE_ADDR, \
>> >> .iosizecsi = SZ_4K, \
>> >> .irqcsi = soc ## _INT_CSI, \
>> >> }
>> >> -#define imx_mx2_camera_data_entry_single_emma(soc) \
>> >> +#define imx_mx2_camera_data_entry_single_emma(soc, _devid) \
>> >> { \
>> >> + .devid = _devid, \
>> >> .iobasecsi = soc ## _CSI_BASE_ADDR, \
>> >> .iosizecsi = SZ_32, \
>> >> .irqcsi = soc ## _INT_CSI, \
>> >> @@ -27,12 +29,12 @@
>> >>
>> >> #ifdef CONFIG_SOC_IMX25
>> >> const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst =
>> >> - imx_mx2_camera_data_entry_single(MX25);
>> >> + imx_mx2_camera_data_entry_single(MX25, "imx25-camera");
>> >> #endif /* ifdef CONFIG_SOC_IMX25 */
>> >>
>> >> #ifdef CONFIG_SOC_IMX27
>> >> const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst =
>> >> - imx_mx2_camera_data_entry_single_emma(MX27);
>> >> + imx_mx2_camera_data_entry_single_emma(MX27, "imx27-camera");
>> >> #endif /* ifdef CONFIG_SOC_IMX27 */
>> >>
>> >> struct platform_device *__init imx_add_mx2_camera(
>> >> @@ -58,7 +60,7 @@ struct platform_device *__init imx_add_mx2_camera(
>> >> .flags = IORESOURCE_IRQ,
>> >> },
>> >> };
>> >> - return imx_add_platform_device_dmamask("mx2-camera", 0,
>> >> + return imx_add_platform_device_dmamask(data->devid, 0,
>> >> res, data->iobaseemmaprp ? 4 : 2,
>> >> pdata, sizeof(*pdata), DMA_BIT_MASK(32));
>> >> }
>> >> diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
>> >> index fe4c76c..cde3374 100644
>> >> --- a/drivers/media/video/mx2_camera.c
>> >> +++ b/drivers/media/video/mx2_camera.c
>> >> @@ -41,7 +41,6 @@
>> >> #include <linux/videodev2.h>
>> >>
>> >> #include <linux/platform_data/camera-mx2.h>
>> >> -#include <mach/hardware.h>
>> >>
>> >> #include <asm/dma.h>
>> >>
>> >> @@ -121,11 +120,13 @@
>> >>
>> >> #define CSICR1 0x00
>> >> #define CSICR2 0x04
>> >> -#define CSISR (cpu_is_mx27() ? 0x08 : 0x18)
>> >> +#define CSISR_IMX25 0x18
>> >> +#define CSISR_IMX27 0x08
>> >> #define CSISTATFIFO 0x0c
>> >> #define CSIRFIFO 0x10
>> >> #define CSIRXCNT 0x14
>> >> -#define CSICR3 (cpu_is_mx27() ? 0x1C : 0x08)
>> >> +#define CSICR3_IMX25 0x08
>> >> +#define CSICR3_IMX27 0x1c
>> >> #define CSIDMASA_STATFIFO 0x20
>> >> #define CSIDMATA_STATFIFO 0x24
>> >> #define CSIDMASA_FB1 0x28
>> >> @@ -268,6 +269,11 @@ struct mx2_buffer {
>> >> struct mx2_buf_internal internal;
>> >> };
>> >>
>> >> +enum mx2_camera_type {
>> >> + IMX25_CAMERA,
>> >> + IMX27_CAMERA,
>> >> +};
>> >> +
>> >> struct mx2_camera_dev {
>> >> struct device *dev;
>> >> struct soc_camera_host soc_host;
>> >> @@ -291,6 +297,9 @@ struct mx2_camera_dev {
>> >> struct mx2_buffer *fb2_active;
>> >>
>> >> u32 csicr1;
>> >> + u32 reg_csisr;
>> >> + u32 reg_csicr3;
>> >> + enum mx2_camera_type devtype;
>> >>
>> >> struct mx2_buf_internal buf_discard[2];
>> >> void *discard_buffer;
>> >> @@ -303,6 +312,29 @@ struct mx2_camera_dev {
>> >> struct vb2_alloc_ctx *alloc_ctx;
>> >> };
>> >>
>> >> +static struct platform_device_id mx2_camera_devtype[] = {
>> >> + {
>> >> + .name = "imx25-camera",
>> >> + .driver_data = IMX25_CAMERA,
>> >> + }, {
>> >> + .name = "imx27-camera",
>> >> + .driver_data = IMX27_CAMERA,
>> >> + }, {
>> >> + /* sentinel */
>> >> + }
>> >> +};
>> >> +MODULE_DEVICE_TABLE(platform, mx2_camera_devtype);
>> >> +
>> >> +static inline int is_imx25_camera(struct mx2_camera_dev *pcdev)
>> >> +{
>> >> + return pcdev->devtype == IMX25_CAMERA;
>> >> +}
>> >> +
>> >> +static inline int is_imx27_camera(struct mx2_camera_dev *pcdev)
>> >> +{
>> >> + return pcdev->devtype == IMX27_CAMERA;
>> >> +}
>> >> +
>> >> static struct mx2_buffer *mx2_ibuf_to_buf(struct mx2_buf_internal *int_buf)
>> >> {
>> >> return container_of(int_buf, struct mx2_buffer, internal);
>> >> @@ -406,9 +438,9 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
>> >>
>> >> clk_disable_unprepare(pcdev->clk_csi);
>> >> writel(0, pcdev->base_csi + CSICR1);
>> >> - if (cpu_is_mx27()) {
>> >> + if (is_imx27_camera(pcdev)) {
>> >> writel(0, pcdev->base_emma + PRP_CNTL);
>> >> - } else if (cpu_is_mx25()) {
>> >> + } else if (is_imx25_camera(pcdev)) {
>> >> spin_lock_irqsave(&pcdev->lock, flags);
>> >> pcdev->fb1_active = NULL;
>> >> pcdev->fb2_active = NULL;
>> >> @@ -438,7 +470,7 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
>> >>
>> >> csicr1 = CSICR1_MCLKEN;
>> >>
>> >> - if (cpu_is_mx27())
>> >> + if (is_imx27_camera(pcdev))
>> >> csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
>> >> CSICR1_RXFF_LEVEL(0);
>> >>
>> >> @@ -514,7 +546,7 @@ out:
>> >> static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
>> >> {
>> >> struct mx2_camera_dev *pcdev = data;
>> >> - u32 status = readl(pcdev->base_csi + CSISR);
>> >> + u32 status = readl(pcdev->base_csi + pcdev->reg_csisr);
>> >>
>> >> if (status & CSISR_DMA_TSF_FB1_INT)
>> >> mx25_camera_frame_done(pcdev, 1, MX2_STATE_DONE);
>> >> @@ -523,7 +555,7 @@ static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
>> >>
>> >> /* FIXME: handle CSISR_RFF_OR_INT */
>> >>
>> >> - writel(status, pcdev->base_csi + CSISR);
>> >> + writel(status, pcdev->base_csi + pcdev->reg_csisr);
>> >>
>> >> return IRQ_HANDLED;
>> >> }
>> >> @@ -608,7 +640,7 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
>> >> buf->state = MX2_STATE_QUEUED;
>> >> list_add_tail(&buf->internal.queue, &pcdev->capture);
>> >>
>> >> - if (cpu_is_mx25()) {
>> >> + if (is_imx25_camera(pcdev)) {
>> >> u32 csicr3, dma_inten = 0;
>> >>
>> >> if (pcdev->fb1_active == NULL) {
>> >> @@ -627,20 +659,20 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
>> >> list_del(&buf->internal.queue);
>> >> buf->state = MX2_STATE_ACTIVE;
>> >>
>> >> - csicr3 = readl(pcdev->base_csi + CSICR3);
>> >> + csicr3 = readl(pcdev->base_csi + pcdev->reg_csicr3);
>> >>
>> >> /* Reflash DMA */
>> >> writel(csicr3 | CSICR3_DMA_REFLASH_RFF,
>> >> - pcdev->base_csi + CSICR3);
>> >> + pcdev->base_csi + pcdev->reg_csicr3);
>> >>
>> >> /* clear & enable interrupts */
>> >> - writel(dma_inten, pcdev->base_csi + CSISR);
>> >> + writel(dma_inten, pcdev->base_csi + pcdev->reg_csisr);
>> >> pcdev->csicr1 |= dma_inten;
>> >> writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
>> >>
>> >> /* enable DMA */
>> >> csicr3 |= CSICR3_DMA_REQ_EN_RFF | CSICR3_RXFF_LEVEL(1);
>> >> - writel(csicr3, pcdev->base_csi + CSICR3);
>> >> + writel(csicr3, pcdev->base_csi + pcdev->reg_csicr3);
>> >> }
>> >> }
>> >>
>> >> @@ -684,7 +716,7 @@ static void mx2_videobuf_release(struct vb2_buffer *vb)
>> >> */
>> >>
>> >> spin_lock_irqsave(&pcdev->lock, flags);
>> >> - if (cpu_is_mx25() && buf->state == MX2_STATE_ACTIVE) {
>> >> + if (is_imx25_camera(pcdev) && buf->state == MX2_STATE_ACTIVE) {
>> >> if (pcdev->fb1_active == buf) {
>> >> pcdev->csicr1 &= ~CSICR1_FB1_DMA_INTEN;
>> >> writel(0, pcdev->base_csi + CSIDMASA_FB1);
>> >> @@ -807,7 +839,7 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count)
>> >> unsigned long phys;
>> >> int bytesperline;
>> >>
>> >> - if (cpu_is_mx27()) {
>> >> + if (is_imx27_camera(pcdev)) {
>> >> unsigned long flags;
>> >> if (count < 2)
>> >> return -EINVAL;
>> >> @@ -902,7 +934,7 @@ static int mx2_stop_streaming(struct vb2_queue *q)
>> >> void *b;
>> >> u32 cntl;
>> >>
>> >> - if (cpu_is_mx27()) {
>> >> + if (is_imx27_camera(pcdev)) {
>> >> spin_lock_irqsave(&pcdev->lock, flags);
>> >>
>> >> cntl = readl(pcdev->base_emma + PRP_CNTL);
>> >> @@ -1054,11 +1086,11 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd)
>> >> if (bytesperline < 0)
>> >> return bytesperline;
>> >>
>> >> - if (cpu_is_mx27()) {
>> >> + if (is_imx27_camera(pcdev)) {
>> >> ret = mx27_camera_emma_prp_reset(pcdev);
>> >> if (ret)
>> >> return ret;
>> >> - } else if (cpu_is_mx25()) {
>> >> + } else if (is_imx25_camera(pcdev)) {
>> >> writel((bytesperline * icd->user_height) >> 2,
>> >> pcdev->base_csi + CSIRXCNT);
>> >> writel((bytesperline << 16) | icd->user_height,
>> >> @@ -1351,7 +1383,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
>> >> /* FIXME: implement MX27 limits */
>> >>
>> >> /* limit to MX25 hardware capabilities */
>> >> - if (cpu_is_mx25()) {
>> >> + if (is_imx25_camera(pcdev)) {
>> >> if (xlate->host_fmt->bits_per_sample <= 8)
>> >> width_limit = 0xffff * 4;
>> >> else
>> >> @@ -1685,6 +1717,20 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> >> goto exit;
>> >> }
>> >>
>> >> + pcdev->devtype = pdev->id_entry->driver_data;
>> >> + switch (pcdev->devtype) {
>> >> + case IMX25_CAMERA:
>> >> + pcdev->reg_csisr = CSISR_IMX25;
>> >> + pcdev->reg_csicr3 = CSICR3_IMX25;
>> >> + break;
>> >> + case IMX27_CAMERA:
>> >> + pcdev->reg_csisr = CSISR_IMX27;
>> >> + pcdev->reg_csicr3 = CSICR3_IMX27;
>> >> + break;
>> >> + default:
>> >> + break;
>> >> + }
>> >> +
>> >> pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
>> >> if (IS_ERR(pcdev->clk_csi)) {
>> >> dev_err(&pdev->dev, "Could not get csi clock\n");
>> >> @@ -1722,7 +1768,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> >> pcdev->dev = &pdev->dev;
>> >> platform_set_drvdata(pdev, pcdev);
>> >>
>> >> - if (cpu_is_mx25()) {
>> >> + if (is_imx25_camera(pcdev)) {
>> >> err = devm_request_irq(&pdev->dev, irq_csi, mx25_camera_irq, 0,
>> >> MX2_CAM_DRV_NAME, pcdev);
>> >> if (err) {
>> >> @@ -1731,7 +1777,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> >> }
>> >> }
>> >>
>> >> - if (cpu_is_mx27()) {
>> >> + if (is_imx27_camera(pcdev)) {
>> >> err = mx27_camera_emma_init(pdev);
>> >> if (err)
>> >> goto exit;
>> >> @@ -1742,7 +1788,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> >> pcdev->soc_host.priv = pcdev;
>> >> pcdev->soc_host.v4l2_dev.dev = &pdev->dev;
>> >> pcdev->soc_host.nr = pdev->id;
>> >> - if (cpu_is_mx25())
>> >> + if (is_imx25_camera(pcdev))
>> >> pcdev->soc_host.capabilities = SOCAM_HOST_CAP_STRIDE;
>> >>
>> >> pcdev->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev);
>> >> @@ -1762,7 +1808,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>> >> exit_free_emma:
>> >> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
>> >> eallocctx:
>> >> - if (cpu_is_mx27()) {
>> >> + if (is_imx27_camera(pcdev)) {
>> >> clk_disable_unprepare(pcdev->clk_emma_ipg);
>> >> clk_disable_unprepare(pcdev->clk_emma_ahb);
>> >> }
>> >> @@ -1780,7 +1826,7 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
>> >>
>> >> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
>> >>
>> >> - if (cpu_is_mx27()) {
>> >> + if (is_imx27_camera(pcdev)) {
>> >> clk_disable_unprepare(pcdev->clk_emma_ipg);
>> >> clk_disable_unprepare(pcdev->clk_emma_ahb);
>> >> }
>> >> @@ -1794,6 +1840,7 @@ static struct platform_driver mx2_camera_driver = {
>> >> .driver = {
>> >> .name = MX2_CAM_DRV_NAME,
>> >> },
>> >> + .id_table = mx2_camera_devtype,
>> >> .remove = __devexit_p(mx2_camera_remove),
>> >> };
>> >>
>> >> --
>> >> 1.7.9.5
>>
>> I can't test this patch because it depends heavily on the previous
>> one, which breaks the driver.
>>
>> Regards.
>>
>> --
>> Javier Martin
>> Vista Silicon S.L.
>> CDTUC - FASE C - Oficina S-345
>> Avda de los Castros s/n
>> 39005- Santander. Cantabria. Spain
>> +34 942 25 32 60
>> www.vista-silicon.com
>>
>
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 12/34] media: mx1_camera: remove the driver
2012-09-18 1:28 ` Shawn Guo
@ 2012-09-18 9:13 ` Arnd Bergmann
2012-09-20 1:35 ` Shawn Guo
0 siblings, 1 reply; 30+ messages in thread
From: Arnd Bergmann @ 2012-09-18 9:13 UTC (permalink / raw)
To: Shawn Guo
Cc: Guennadi Liakhovetski, linux-arm-kernel, Sascha Hauer,
Fabio Estevam, Rob Herring, Paulius Zaleckas, linux-media,
Mauro Carvalho Chehab
On Tuesday 18 September 2012, Shawn Guo wrote:
>
> On Mon, Sep 17, 2012 at 10:33:25AM +0200, Guennadi Liakhovetski wrote:
> > Ok, it used to compile not-so-long-ago, but it doesn't seem to be cared
> > for a lot lately. Let's give Paulius a bit more time to react to this
> > mail, otherwise I'll have no objections. Just as an idea, to make it a bit
> > milder we could first mark it BROKEN and add to remove schedule... But I
> > don't mind either way.
> >
> I chose to remove the driver completely rather than marking it BROKEN
> because the removal of the driver cleans up platform code a lot :)
>
> Ok, if we hear anything back from Paulius in the next couple of weeks,
> I keep the driver there with BROKEN marked.
Sounds fine to me. Of course, if someone wants the driver back and is
willing to fix it, we'll just revert this patch even after the driver
is gone.
I would like an Ack from Mauro however. You did not Cc him directly
in the patch, and he probably has an opionion on it as well, or may
want to take this patch through his git tree.
Arnd
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 12/34] media: mx1_camera: remove the driver
2012-09-18 9:13 ` Arnd Bergmann
@ 2012-09-20 1:35 ` Shawn Guo
0 siblings, 0 replies; 30+ messages in thread
From: Shawn Guo @ 2012-09-20 1:35 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Guennadi Liakhovetski, linux-arm-kernel, Sascha Hauer,
Fabio Estevam, Rob Herring, Paulius Zaleckas, linux-media,
Mauro Carvalho Chehab
On Tue, Sep 18, 2012 at 09:13:54AM +0000, Arnd Bergmann wrote:
> On Tuesday 18 September 2012, Shawn Guo wrote:
> >
> > On Mon, Sep 17, 2012 at 10:33:25AM +0200, Guennadi Liakhovetski wrote:
> > > Ok, it used to compile not-so-long-ago, but it doesn't seem to be cared
> > > for a lot lately. Let's give Paulius a bit more time to react to this
> > > mail, otherwise I'll have no objections. Just as an idea, to make it a bit
> > > milder we could first mark it BROKEN and add to remove schedule... But I
> > > don't mind either way.
> > >
> > I chose to remove the driver completely rather than marking it BROKEN
> > because the removal of the driver cleans up platform code a lot :)
> >
> > Ok, if we hear anything back from Paulius in the next couple of weeks,
> > I keep the driver there with BROKEN marked.
>
> Sounds fine to me. Of course, if someone wants the driver back and is
> willing to fix it, we'll just revert this patch even after the driver
> is gone.
>
> I would like an Ack from Mauro however. You did not Cc him directly
> in the patch, and he probably has an opionion on it as well, or may
> want to take this patch through his git tree.
>
I've seen Guennadi is collecting camera patches and sending them to
Mauro recently. So I think Guennadi is someone that Mauro trusts.
But yes, we should copy him directly to see if he has an opionion on
this driver removal.
Shawn
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion
2012-09-18 8:35 ` javier Martin
@ 2012-09-27 7:36 ` Mauro Carvalho Chehab
2012-10-06 8:16 ` Shawn Guo
0 siblings, 1 reply; 30+ messages in thread
From: Mauro Carvalho Chehab @ 2012-09-27 7:36 UTC (permalink / raw)
To: javier Martin
Cc: Guennadi Liakhovetski, Shawn Guo, linux-arm-kernel, Sascha Hauer,
Fabio Estevam, Rob Herring, Arnd Bergmann, linux-media
Em 18-09-2012 05:35, javier Martin escreveu:
> On 17 September 2012 15:59, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
>> On Mon, 17 Sep 2012, javier Martin wrote:
>>
>>> Hi Shawn,
>>>
>>> On 17 September 2012 11:21, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:
>>>> On Mon, 17 Sep 2012, Shawn Guo wrote:
>>>>
>>>>> It changes the driver to use platform_device_id rather than cpu_is_xxx
>>>>> to determine the controller type, and updates the platform code
>>>>> accordingly.
>>>>>
>>>>> As the result, mach/hardware.h inclusion gets removed from the driver.
>>>>>
>>>>> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>>>>> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>>>> Cc: linux-media@vger.kernel.org
>>>>
>
> Tested-by: Javier Martin <javier.martin@vista-silicon.com>
I'm understanding that this patch will flow through arm tree[1]. So:
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[1] if you understand otherwise, I can apply it via my tree as well
>
>>>> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>>
>>> i.MX25 support is broken and is scheduled for removal.
>>
>> It is not yet, I haven't pushed those your patches yet.
>>
>> Thanks
>> Guennadi
>>
>>> I think we should not keep on trying to maintain it. Couldn't we just
>>> drop it? It only makes maintenance tasks more difficult.
>>>
>>>> Thanks
>>>> Guennadi
>>>>
>>>>> ---
>>>>> arch/arm/mach-imx/clk-imx25.c | 6 +-
>>>>> arch/arm/mach-imx/clk-imx27.c | 6 +-
>>>>> arch/arm/mach-imx/devices/devices-common.h | 1 +
>>>>> arch/arm/mach-imx/devices/platform-mx2-camera.c | 12 +--
>>>>> drivers/media/video/mx2_camera.c | 95 +++++++++++++++++------
>>>>> 5 files changed, 85 insertions(+), 35 deletions(-)
>>>>>
>>>>> diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
>>>>> index 1aea073..71fe521 100644
>>>>> --- a/arch/arm/mach-imx/clk-imx25.c
>>>>> +++ b/arch/arm/mach-imx/clk-imx25.c
>>>>> @@ -231,9 +231,9 @@ int __init mx25_clocks_init(void)
>>>>> clk_register_clkdev(clk[esdhc2_ipg_per], "per", "sdhci-esdhc-imx25.1");
>>>>> clk_register_clkdev(clk[esdhc2_ipg], "ipg", "sdhci-esdhc-imx25.1");
>>>>> clk_register_clkdev(clk[esdhc2_ahb], "ahb", "sdhci-esdhc-imx25.1");
>>>>> - clk_register_clkdev(clk[csi_ipg_per], "per", "mx2-camera.0");
>>>>> - clk_register_clkdev(clk[csi_ipg], "ipg", "mx2-camera.0");
>>>>> - clk_register_clkdev(clk[csi_ahb], "ahb", "mx2-camera.0");
>>>>> + clk_register_clkdev(clk[csi_ipg_per], "per", "imx25-camera.0");
>>>>> + clk_register_clkdev(clk[csi_ipg], "ipg", "imx25-camera.0");
>>>>> + clk_register_clkdev(clk[csi_ahb], "ahb", "imx25-camera.0");
>>>>> clk_register_clkdev(clk[dummy], "audmux", NULL);
>>>>> clk_register_clkdev(clk[can1_ipg], NULL, "flexcan.0");
>>>>> clk_register_clkdev(clk[can2_ipg], NULL, "flexcan.1");
>>>>> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
>>>>> index 5ff5cf0..e26de52 100644
>>>>> --- a/arch/arm/mach-imx/clk-imx27.c
>>>>> +++ b/arch/arm/mach-imx/clk-imx27.c
>>>>> @@ -224,7 +224,7 @@ int __init mx27_clocks_init(unsigned long fref)
>>>>> clk_register_clkdev(clk[per3_gate], "per", "imx-fb.0");
>>>>> clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
>>>>> clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
>>>>> - clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
>>>>> + clk_register_clkdev(clk[csi_ahb_gate], "ahb", "imx27-camera.0");
>>>>> clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
>>>>> clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
>>>>> clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
>>>>> @@ -251,8 +251,8 @@ int __init mx27_clocks_init(unsigned long fref)
>>>>> clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx21-i2c.1");
>>>>> clk_register_clkdev(clk[owire_ipg_gate], NULL, "mxc_w1.0");
>>>>> clk_register_clkdev(clk[kpp_ipg_gate], NULL, "imx-keypad");
>>>>> - clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "mx2-camera.0");
>>>>> - clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "mx2-camera.0");
>>>>> + clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "imx27-camera.0");
>>>>> + clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "imx27-camera.0");
>>>>> clk_register_clkdev(clk[emma_ahb_gate], "ahb", "m2m-emmaprp.0");
>>>>> clk_register_clkdev(clk[emma_ipg_gate], "ipg", "m2m-emmaprp.0");
>>>>> clk_register_clkdev(clk[iim_ipg_gate], "iim", NULL);
>>>>> diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
>>>>> index 7f2698c..8112a1a 100644
>>>>> --- a/arch/arm/mach-imx/devices/devices-common.h
>>>>> +++ b/arch/arm/mach-imx/devices/devices-common.h
>>>>> @@ -202,6 +202,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
>>>>>
>>>>> #include <linux/platform_data/camera-mx2.h>
>>>>> struct imx_mx2_camera_data {
>>>>> + const char *devid;
>>>>> resource_size_t iobasecsi;
>>>>> resource_size_t iosizecsi;
>>>>> resource_size_t irqcsi;
>>>>> diff --git a/arch/arm/mach-imx/devices/platform-mx2-camera.c b/arch/arm/mach-imx/devices/platform-mx2-camera.c
>>>>> index 9ad5b2d..b88877d 100644
>>>>> --- a/arch/arm/mach-imx/devices/platform-mx2-camera.c
>>>>> +++ b/arch/arm/mach-imx/devices/platform-mx2-camera.c
>>>>> @@ -9,14 +9,16 @@
>>>>> #include <mach/hardware.h>
>>>>> #include "devices-common.h"
>>>>>
>>>>> -#define imx_mx2_camera_data_entry_single(soc) \
>>>>> +#define imx_mx2_camera_data_entry_single(soc, _devid) \
>>>>> { \
>>>>> + .devid = _devid, \
>>>>> .iobasecsi = soc ## _CSI_BASE_ADDR, \
>>>>> .iosizecsi = SZ_4K, \
>>>>> .irqcsi = soc ## _INT_CSI, \
>>>>> }
>>>>> -#define imx_mx2_camera_data_entry_single_emma(soc) \
>>>>> +#define imx_mx2_camera_data_entry_single_emma(soc, _devid) \
>>>>> { \
>>>>> + .devid = _devid, \
>>>>> .iobasecsi = soc ## _CSI_BASE_ADDR, \
>>>>> .iosizecsi = SZ_32, \
>>>>> .irqcsi = soc ## _INT_CSI, \
>>>>> @@ -27,12 +29,12 @@
>>>>>
>>>>> #ifdef CONFIG_SOC_IMX25
>>>>> const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst =
>>>>> - imx_mx2_camera_data_entry_single(MX25);
>>>>> + imx_mx2_camera_data_entry_single(MX25, "imx25-camera");
>>>>> #endif /* ifdef CONFIG_SOC_IMX25 */
>>>>>
>>>>> #ifdef CONFIG_SOC_IMX27
>>>>> const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst =
>>>>> - imx_mx2_camera_data_entry_single_emma(MX27);
>>>>> + imx_mx2_camera_data_entry_single_emma(MX27, "imx27-camera");
>>>>> #endif /* ifdef CONFIG_SOC_IMX27 */
>>>>>
>>>>> struct platform_device *__init imx_add_mx2_camera(
>>>>> @@ -58,7 +60,7 @@ struct platform_device *__init imx_add_mx2_camera(
>>>>> .flags = IORESOURCE_IRQ,
>>>>> },
>>>>> };
>>>>> - return imx_add_platform_device_dmamask("mx2-camera", 0,
>>>>> + return imx_add_platform_device_dmamask(data->devid, 0,
>>>>> res, data->iobaseemmaprp ? 4 : 2,
>>>>> pdata, sizeof(*pdata), DMA_BIT_MASK(32));
>>>>> }
>>>>> diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
>>>>> index fe4c76c..cde3374 100644
>>>>> --- a/drivers/media/video/mx2_camera.c
>>>>> +++ b/drivers/media/video/mx2_camera.c
>>>>> @@ -41,7 +41,6 @@
>>>>> #include <linux/videodev2.h>
>>>>>
>>>>> #include <linux/platform_data/camera-mx2.h>
>>>>> -#include <mach/hardware.h>
>>>>>
>>>>> #include <asm/dma.h>
>>>>>
>>>>> @@ -121,11 +120,13 @@
>>>>>
>>>>> #define CSICR1 0x00
>>>>> #define CSICR2 0x04
>>>>> -#define CSISR (cpu_is_mx27() ? 0x08 : 0x18)
>>>>> +#define CSISR_IMX25 0x18
>>>>> +#define CSISR_IMX27 0x08
>>>>> #define CSISTATFIFO 0x0c
>>>>> #define CSIRFIFO 0x10
>>>>> #define CSIRXCNT 0x14
>>>>> -#define CSICR3 (cpu_is_mx27() ? 0x1C : 0x08)
>>>>> +#define CSICR3_IMX25 0x08
>>>>> +#define CSICR3_IMX27 0x1c
>>>>> #define CSIDMASA_STATFIFO 0x20
>>>>> #define CSIDMATA_STATFIFO 0x24
>>>>> #define CSIDMASA_FB1 0x28
>>>>> @@ -268,6 +269,11 @@ struct mx2_buffer {
>>>>> struct mx2_buf_internal internal;
>>>>> };
>>>>>
>>>>> +enum mx2_camera_type {
>>>>> + IMX25_CAMERA,
>>>>> + IMX27_CAMERA,
>>>>> +};
>>>>> +
>>>>> struct mx2_camera_dev {
>>>>> struct device *dev;
>>>>> struct soc_camera_host soc_host;
>>>>> @@ -291,6 +297,9 @@ struct mx2_camera_dev {
>>>>> struct mx2_buffer *fb2_active;
>>>>>
>>>>> u32 csicr1;
>>>>> + u32 reg_csisr;
>>>>> + u32 reg_csicr3;
>>>>> + enum mx2_camera_type devtype;
>>>>>
>>>>> struct mx2_buf_internal buf_discard[2];
>>>>> void *discard_buffer;
>>>>> @@ -303,6 +312,29 @@ struct mx2_camera_dev {
>>>>> struct vb2_alloc_ctx *alloc_ctx;
>>>>> };
>>>>>
>>>>> +static struct platform_device_id mx2_camera_devtype[] = {
>>>>> + {
>>>>> + .name = "imx25-camera",
>>>>> + .driver_data = IMX25_CAMERA,
>>>>> + }, {
>>>>> + .name = "imx27-camera",
>>>>> + .driver_data = IMX27_CAMERA,
>>>>> + }, {
>>>>> + /* sentinel */
>>>>> + }
>>>>> +};
>>>>> +MODULE_DEVICE_TABLE(platform, mx2_camera_devtype);
>>>>> +
>>>>> +static inline int is_imx25_camera(struct mx2_camera_dev *pcdev)
>>>>> +{
>>>>> + return pcdev->devtype == IMX25_CAMERA;
>>>>> +}
>>>>> +
>>>>> +static inline int is_imx27_camera(struct mx2_camera_dev *pcdev)
>>>>> +{
>>>>> + return pcdev->devtype == IMX27_CAMERA;
>>>>> +}
>>>>> +
>>>>> static struct mx2_buffer *mx2_ibuf_to_buf(struct mx2_buf_internal *int_buf)
>>>>> {
>>>>> return container_of(int_buf, struct mx2_buffer, internal);
>>>>> @@ -406,9 +438,9 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
>>>>>
>>>>> clk_disable_unprepare(pcdev->clk_csi);
>>>>> writel(0, pcdev->base_csi + CSICR1);
>>>>> - if (cpu_is_mx27()) {
>>>>> + if (is_imx27_camera(pcdev)) {
>>>>> writel(0, pcdev->base_emma + PRP_CNTL);
>>>>> - } else if (cpu_is_mx25()) {
>>>>> + } else if (is_imx25_camera(pcdev)) {
>>>>> spin_lock_irqsave(&pcdev->lock, flags);
>>>>> pcdev->fb1_active = NULL;
>>>>> pcdev->fb2_active = NULL;
>>>>> @@ -438,7 +470,7 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
>>>>>
>>>>> csicr1 = CSICR1_MCLKEN;
>>>>>
>>>>> - if (cpu_is_mx27())
>>>>> + if (is_imx27_camera(pcdev))
>>>>> csicr1 |= CSICR1_PRP_IF_EN | CSICR1_FCC |
>>>>> CSICR1_RXFF_LEVEL(0);
>>>>>
>>>>> @@ -514,7 +546,7 @@ out:
>>>>> static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
>>>>> {
>>>>> struct mx2_camera_dev *pcdev = data;
>>>>> - u32 status = readl(pcdev->base_csi + CSISR);
>>>>> + u32 status = readl(pcdev->base_csi + pcdev->reg_csisr);
>>>>>
>>>>> if (status & CSISR_DMA_TSF_FB1_INT)
>>>>> mx25_camera_frame_done(pcdev, 1, MX2_STATE_DONE);
>>>>> @@ -523,7 +555,7 @@ static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
>>>>>
>>>>> /* FIXME: handle CSISR_RFF_OR_INT */
>>>>>
>>>>> - writel(status, pcdev->base_csi + CSISR);
>>>>> + writel(status, pcdev->base_csi + pcdev->reg_csisr);
>>>>>
>>>>> return IRQ_HANDLED;
>>>>> }
>>>>> @@ -608,7 +640,7 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
>>>>> buf->state = MX2_STATE_QUEUED;
>>>>> list_add_tail(&buf->internal.queue, &pcdev->capture);
>>>>>
>>>>> - if (cpu_is_mx25()) {
>>>>> + if (is_imx25_camera(pcdev)) {
>>>>> u32 csicr3, dma_inten = 0;
>>>>>
>>>>> if (pcdev->fb1_active == NULL) {
>>>>> @@ -627,20 +659,20 @@ static void mx2_videobuf_queue(struct vb2_buffer *vb)
>>>>> list_del(&buf->internal.queue);
>>>>> buf->state = MX2_STATE_ACTIVE;
>>>>>
>>>>> - csicr3 = readl(pcdev->base_csi + CSICR3);
>>>>> + csicr3 = readl(pcdev->base_csi + pcdev->reg_csicr3);
>>>>>
>>>>> /* Reflash DMA */
>>>>> writel(csicr3 | CSICR3_DMA_REFLASH_RFF,
>>>>> - pcdev->base_csi + CSICR3);
>>>>> + pcdev->base_csi + pcdev->reg_csicr3);
>>>>>
>>>>> /* clear & enable interrupts */
>>>>> - writel(dma_inten, pcdev->base_csi + CSISR);
>>>>> + writel(dma_inten, pcdev->base_csi + pcdev->reg_csisr);
>>>>> pcdev->csicr1 |= dma_inten;
>>>>> writel(pcdev->csicr1, pcdev->base_csi + CSICR1);
>>>>>
>>>>> /* enable DMA */
>>>>> csicr3 |= CSICR3_DMA_REQ_EN_RFF | CSICR3_RXFF_LEVEL(1);
>>>>> - writel(csicr3, pcdev->base_csi + CSICR3);
>>>>> + writel(csicr3, pcdev->base_csi + pcdev->reg_csicr3);
>>>>> }
>>>>> }
>>>>>
>>>>> @@ -684,7 +716,7 @@ static void mx2_videobuf_release(struct vb2_buffer *vb)
>>>>> */
>>>>>
>>>>> spin_lock_irqsave(&pcdev->lock, flags);
>>>>> - if (cpu_is_mx25() && buf->state == MX2_STATE_ACTIVE) {
>>>>> + if (is_imx25_camera(pcdev) && buf->state == MX2_STATE_ACTIVE) {
>>>>> if (pcdev->fb1_active == buf) {
>>>>> pcdev->csicr1 &= ~CSICR1_FB1_DMA_INTEN;
>>>>> writel(0, pcdev->base_csi + CSIDMASA_FB1);
>>>>> @@ -807,7 +839,7 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count)
>>>>> unsigned long phys;
>>>>> int bytesperline;
>>>>>
>>>>> - if (cpu_is_mx27()) {
>>>>> + if (is_imx27_camera(pcdev)) {
>>>>> unsigned long flags;
>>>>> if (count < 2)
>>>>> return -EINVAL;
>>>>> @@ -902,7 +934,7 @@ static int mx2_stop_streaming(struct vb2_queue *q)
>>>>> void *b;
>>>>> u32 cntl;
>>>>>
>>>>> - if (cpu_is_mx27()) {
>>>>> + if (is_imx27_camera(pcdev)) {
>>>>> spin_lock_irqsave(&pcdev->lock, flags);
>>>>>
>>>>> cntl = readl(pcdev->base_emma + PRP_CNTL);
>>>>> @@ -1054,11 +1086,11 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd)
>>>>> if (bytesperline < 0)
>>>>> return bytesperline;
>>>>>
>>>>> - if (cpu_is_mx27()) {
>>>>> + if (is_imx27_camera(pcdev)) {
>>>>> ret = mx27_camera_emma_prp_reset(pcdev);
>>>>> if (ret)
>>>>> return ret;
>>>>> - } else if (cpu_is_mx25()) {
>>>>> + } else if (is_imx25_camera(pcdev)) {
>>>>> writel((bytesperline * icd->user_height) >> 2,
>>>>> pcdev->base_csi + CSIRXCNT);
>>>>> writel((bytesperline << 16) | icd->user_height,
>>>>> @@ -1351,7 +1383,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
>>>>> /* FIXME: implement MX27 limits */
>>>>>
>>>>> /* limit to MX25 hardware capabilities */
>>>>> - if (cpu_is_mx25()) {
>>>>> + if (is_imx25_camera(pcdev)) {
>>>>> if (xlate->host_fmt->bits_per_sample <= 8)
>>>>> width_limit = 0xffff * 4;
>>>>> else
>>>>> @@ -1685,6 +1717,20 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>>>>> goto exit;
>>>>> }
>>>>>
>>>>> + pcdev->devtype = pdev->id_entry->driver_data;
>>>>> + switch (pcdev->devtype) {
>>>>> + case IMX25_CAMERA:
>>>>> + pcdev->reg_csisr = CSISR_IMX25;
>>>>> + pcdev->reg_csicr3 = CSICR3_IMX25;
>>>>> + break;
>>>>> + case IMX27_CAMERA:
>>>>> + pcdev->reg_csisr = CSISR_IMX27;
>>>>> + pcdev->reg_csicr3 = CSICR3_IMX27;
>>>>> + break;
>>>>> + default:
>>>>> + break;
>>>>> + }
>>>>> +
>>>>> pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
>>>>> if (IS_ERR(pcdev->clk_csi)) {
>>>>> dev_err(&pdev->dev, "Could not get csi clock\n");
>>>>> @@ -1722,7 +1768,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>>>>> pcdev->dev = &pdev->dev;
>>>>> platform_set_drvdata(pdev, pcdev);
>>>>>
>>>>> - if (cpu_is_mx25()) {
>>>>> + if (is_imx25_camera(pcdev)) {
>>>>> err = devm_request_irq(&pdev->dev, irq_csi, mx25_camera_irq, 0,
>>>>> MX2_CAM_DRV_NAME, pcdev);
>>>>> if (err) {
>>>>> @@ -1731,7 +1777,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>>>>> }
>>>>> }
>>>>>
>>>>> - if (cpu_is_mx27()) {
>>>>> + if (is_imx27_camera(pcdev)) {
>>>>> err = mx27_camera_emma_init(pdev);
>>>>> if (err)
>>>>> goto exit;
>>>>> @@ -1742,7 +1788,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>>>>> pcdev->soc_host.priv = pcdev;
>>>>> pcdev->soc_host.v4l2_dev.dev = &pdev->dev;
>>>>> pcdev->soc_host.nr = pdev->id;
>>>>> - if (cpu_is_mx25())
>>>>> + if (is_imx25_camera(pcdev))
>>>>> pcdev->soc_host.capabilities = SOCAM_HOST_CAP_STRIDE;
>>>>>
>>>>> pcdev->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev);
>>>>> @@ -1762,7 +1808,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev)
>>>>> exit_free_emma:
>>>>> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
>>>>> eallocctx:
>>>>> - if (cpu_is_mx27()) {
>>>>> + if (is_imx27_camera(pcdev)) {
>>>>> clk_disable_unprepare(pcdev->clk_emma_ipg);
>>>>> clk_disable_unprepare(pcdev->clk_emma_ahb);
>>>>> }
>>>>> @@ -1780,7 +1826,7 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev)
>>>>>
>>>>> vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
>>>>>
>>>>> - if (cpu_is_mx27()) {
>>>>> + if (is_imx27_camera(pcdev)) {
>>>>> clk_disable_unprepare(pcdev->clk_emma_ipg);
>>>>> clk_disable_unprepare(pcdev->clk_emma_ahb);
>>>>> }
>>>>> @@ -1794,6 +1840,7 @@ static struct platform_driver mx2_camera_driver = {
>>>>> .driver = {
>>>>> .name = MX2_CAM_DRV_NAME,
>>>>> },
>>>>> + .id_table = mx2_camera_devtype,
>>>>> .remove = __devexit_p(mx2_camera_remove),
>>>>> };
>>>>>
>>>>> --
>>>>> 1.7.9.5
>>>
>>> I can't test this patch because it depends heavily on the previous
>>> one, which breaks the driver.
>>>
>>> Regards.
>>>
>>> --
>>> Javier Martin
>>> Vista Silicon S.L.
>>> CDTUC - FASE C - Oficina S-345
>>> Avda de los Castros s/n
>>> 39005- Santander. Cantabria. Spain
>>> +34 942 25 32 60
>>> www.vista-silicon.com
>>>
>>
>> ---
>> Guennadi Liakhovetski, Ph.D.
>> Freelance Open-Source Software Developer
>> http://www.open-technology.de/
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-media" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 14/34] dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h
2012-09-17 9:26 ` Guennadi Liakhovetski
@ 2012-09-27 7:38 ` Mauro Carvalho Chehab
0 siblings, 0 replies; 30+ messages in thread
From: Mauro Carvalho Chehab @ 2012-09-27 7:38 UTC (permalink / raw)
To: Guennadi Liakhovetski
Cc: Shawn Guo, linux-arm-kernel, Sascha Hauer, Fabio Estevam,
Rob Herring, Arnd Bergmann, Vinod Koul, Florian Tobias Schandinat,
linux-media, linux-fbdev
Em 17-09-2012 06:26, Guennadi Liakhovetski escreveu:
> On Mon, 17 Sep 2012, Shawn Guo wrote:
>
>> The header ipu.h really belongs to dma subsystem rather than imx
>> platform. Rename it to ipu-dma.h and put it into include/linux/dma/.
>>
>> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>> Cc: Vinod Koul <vinod.koul@intel.com>
>> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
>> Cc: linux-media@vger.kernel.org
>> Cc: linux-fbdev@vger.kernel.org
>
> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>
> Thanks
> Guennadi
>
>> ---
>> drivers/dma/ipu/ipu_idmac.c | 3 +--
>> drivers/dma/ipu/ipu_irq.c | 3 +--
>> drivers/media/video/mx3_camera.c | 2 +-
>> drivers/video/mx3fb.c | 2 +-
>> .../mach/ipu.h => include/linux/dma/ipu-dma.h | 6 +++---
>> 5 files changed, 7 insertions(+), 9 deletions(-)
>> rename arch/arm/mach-imx/include/mach/ipu.h => include/linux/dma/ipu-dma.h (97%)
>>
>> diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c
>> index c7573e5..6585537 100644
>> --- a/drivers/dma/ipu/ipu_idmac.c
>> +++ b/drivers/dma/ipu/ipu_idmac.c
>> @@ -22,8 +22,7 @@
>> #include <linux/interrupt.h>
>> #include <linux/io.h>
>> #include <linux/module.h>
>> -
>> -#include <mach/ipu.h>
>> +#include <linux/dma/ipu-dma.h>
>>
>> #include "../dmaengine.h"
>> #include "ipu_intern.h"
>> diff --git a/drivers/dma/ipu/ipu_irq.c b/drivers/dma/ipu/ipu_irq.c
>> index fa95bcc..a5ee37d 100644
>> --- a/drivers/dma/ipu/ipu_irq.c
>> +++ b/drivers/dma/ipu/ipu_irq.c
>> @@ -15,8 +15,7 @@
>> #include <linux/irq.h>
>> #include <linux/io.h>
>> #include <linux/module.h>
>> -
>> -#include <mach/ipu.h>
>> +#include <linux/dma/ipu-dma.h>
>>
>> #include "ipu_intern.h"
>>
>> diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
>> index 1481b0d..892cba5 100644
>> --- a/drivers/media/video/mx3_camera.c
>> +++ b/drivers/media/video/mx3_camera.c
>> @@ -17,6 +17,7 @@
>> #include <linux/vmalloc.h>
>> #include <linux/interrupt.h>
>> #include <linux/sched.h>
>> +#include <linux/dma/ipu-dma.h>
>>
>> #include <media/v4l2-common.h>
>> #include <media/v4l2-dev.h>
>> @@ -24,7 +25,6 @@
>> #include <media/soc_camera.h>
>> #include <media/soc_mediabus.h>
>>
>> -#include <mach/ipu.h>
>> #include <linux/platform_data/camera-mx3.h>
>> #include <linux/platform_data/dma-imx.h>
>>
>> diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
>> index d738108..3b63ad8 100644
>> --- a/drivers/video/mx3fb.c
>> +++ b/drivers/video/mx3fb.c
>> @@ -26,10 +26,10 @@
>> #include <linux/console.h>
>> #include <linux/clk.h>
>> #include <linux/mutex.h>
>> +#include <linux/dma/ipu-dma.h>
>>
>> #include <linux/platform_data/dma-imx.h>
>> #include <mach/hardware.h>
>> -#include <mach/ipu.h>
>> #include <linux/platform_data/video-mx3fb.h>
>>
>> #include <asm/io.h>
>> diff --git a/arch/arm/mach-imx/include/mach/ipu.h b/include/linux/dma/ipu-dma.h
>> similarity index 97%
>> rename from arch/arm/mach-imx/include/mach/ipu.h
>> rename to include/linux/dma/ipu-dma.h
>> index 539e559..1803111 100644
>> --- a/arch/arm/mach-imx/include/mach/ipu.h
>> +++ b/include/linux/dma/ipu-dma.h
>> @@ -9,8 +9,8 @@
>> * published by the Free Software Foundation.
>> */
>>
>> -#ifndef _IPU_H_
>> -#define _IPU_H_
>> +#ifndef __LINUX_DMA_IPU_DMA_H
>> +#define __LINUX_DMA_IPU_DMA_H
>>
>> #include <linux/types.h>
>> #include <linux/dmaengine.h>
>> @@ -174,4 +174,4 @@ struct idmac_channel {
>> #define to_tx_desc(tx) container_of(tx, struct idmac_tx_desc, txd)
>> #define to_idmac_chan(c) container_of(c, struct idmac_channel, dma_chan)
>>
>> -#endif
>> +#endif /* __LINUX_DMA_IPU_DMA_H */
>> --
>> 1.7.9.5
>>
>
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion
2012-09-27 7:36 ` Mauro Carvalho Chehab
@ 2012-10-06 8:16 ` Shawn Guo
0 siblings, 0 replies; 30+ messages in thread
From: Shawn Guo @ 2012-10-06 8:16 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: javier Martin, Guennadi Liakhovetski, linux-arm-kernel,
Sascha Hauer, Fabio Estevam, Rob Herring, Arnd Bergmann,
linux-media
On Thu, Sep 27, 2012 at 04:36:56AM -0300, Mauro Carvalho Chehab wrote:
> I'm understanding that this patch will flow through arm tree[1]. So:
Yes, it will go through arm-soc tree for 3.8.
> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>
Thanks, Mauro.
Shawn
^ permalink raw reply [flat|nested] 30+ messages in thread
end of thread, other threads:[~2012-10-06 8:16 UTC | newest]
Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-17 5:34 [PATCH 00/34] i.MX multi-platform support Shawn Guo
2012-09-17 5:34 ` [PATCH 12/34] media: mx1_camera: remove the driver Shawn Guo
2012-09-17 8:33 ` Guennadi Liakhovetski
2012-09-18 1:28 ` Shawn Guo
2012-09-18 9:13 ` Arnd Bergmann
2012-09-20 1:35 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 14/34] dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h Shawn Guo
2012-09-17 9:26 ` Guennadi Liakhovetski
2012-09-27 7:38 ` Mauro Carvalho Chehab
2012-09-17 5:34 ` [PATCH 26/34] media: mx2_camera: remove dead code in mx2_camera_add_device Shawn Guo
2012-09-17 8:18 ` Guennadi Liakhovetski
2012-09-17 13:36 ` javier Martin
2012-09-18 1:49 ` Shawn Guo
2012-09-17 5:34 ` [PATCH 27/34] media: mx2_camera: use managed functions to clean up code Shawn Guo
2012-09-17 9:11 ` Guennadi Liakhovetski
2012-09-17 13:36 ` javier Martin
2012-09-18 7:43 ` Shawn Guo
2012-09-18 8:34 ` javier Martin
2012-09-17 5:34 ` [PATCH 28/34] media: mx2_camera: remove mach/hardware.h inclusion Shawn Guo
2012-09-17 9:21 ` Guennadi Liakhovetski
2012-09-17 13:43 ` javier Martin
2012-09-17 13:59 ` Guennadi Liakhovetski
2012-09-18 8:35 ` javier Martin
2012-09-27 7:36 ` Mauro Carvalho Chehab
2012-10-06 8:16 ` Shawn Guo
2012-09-17 7:51 ` [PATCH 00/34] i.MX multi-platform support Sascha Hauer
2012-09-17 11:38 ` Arnd Bergmann
2012-09-18 8:20 ` Shawn Guo
2012-09-18 7:52 ` Sascha Hauer
2012-09-18 8:05 ` [alsa-devel] " Shawn Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).