ARM: davinci: da850-evm: camera capture
cover ARM: davinci: da850-evm: camera capture
This series is the final step to demonstrate VPIF capture via an external camera sensor. It is only FYI and for testing/validation purposes, and not intended for upstream merge.
Tested on a da850-evm with UI board.
With only the first patch (GPIO hogs) patch applied, VPIF capture works for composite input, but still relies on pdata-quirks for the tvp514x input/output routing.
With the rest of the series applied, it works for camera input with VPIF in DT mode (no more pdata-quirks needed.)
Tested with da850-evm + UI board + On-Semi camera board using aptina,mt9v032 sensor:
http://www.mouser.com/search/ProductDetail.aspx?R=0virtualkey0virtualkeyMT9V032C12STCH-GEVB
Dependencies:
- VPIF driver changes
https://marc.info/?l=linux-arm-kernel&m=149643932427173
- davinci platform updates
https://marc.info/?l=linux-arm-kernel&m=149644517728393
Kevin Hilman (3):
ARM: dts: da850-evm: VPIF input selction via GPIO hogs
ARM: dts: da850-evm.dts: add mt9v032 camera sensor
HACK: ARM: davinci: add cdce913 clock controller
arch/arm/boot/dts/da850-evm.dts | 76 ++++++++++++++++ arch/arm/mach-davinci/Makefile | 2 +- arch/arm/mach-davinci/cdce913.c | 164 +++++++++++++++++++++++++++++++++++ arch/arm/mach-davinci/pdata-quirks.c | 8 +- 4 files changed, 247 insertions(+), 3 deletions(-) create mode 100644 arch/arm/mach-davinci/cdce913.c
Signature · 1 line
2.9.3
PATCH 1/3 ARM: dts: da850-evm: VPIF input selction via GPIO hogs
Force VPIF input selection to use composite video input.
--- arch/arm/boot/dts/da850-evm.dts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
arch/arm/boot/dts/da850-evm.dts +24 -0
@@ -302,3 +302,27 @@ pinctrl-0 = <&vpif_capture_pins>, <&vpif_display_pins>; status = "okay"; }; + +/* UI board: VPIF input selection */ +&tca6416 { + status = "okay"; + + sel_a { + gpio-hog; + gpios = <7 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "ADC_ENn"; + }; + sel_b { + gpio-hog; + gpios = <6 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "CAMERA_ENn"; + }; + sel_c { + gpio-hog; + gpios = <5 GPIO_ACTIVE_HIGH>; + output-low; + line-name = "VIDEO_IN_ENn"; + }; +};
Signature · 1 line
2.9.3
PATCH 2/3 ARM: dts: da850-evm.dts: add mt9v032 camera sensor
In reply to Kevin HilmanAdd nodes to support camera input via UI board connector. Includes;
- i2c-mux used to connect VPIF input peripherals
- camera-sensor on the On-Semi camera board[1], which provides and aptina,mt9v032 sensor. Note that this board provides a way to change the i2c addr via a switch, and this series assumes 0x4c
- clock-controler for the master clock provided to camera. Note that this node is FYI only. The upstream driver for ti,cdce913 requires CCF, which davinci does not support, so a subsequent patch/hack will create a basic clock driver so the camera driver can work
- VPIF endpoint nodes to connect VPIF input and camera sensor
- GPIO hog changes to switch VPIF input from composite to camera
[1] http://www.mouser.com/search/ProductDetail.aspx?R=0virtualkey0virtualkeyMT9V032C12STCH-GEVB
--- arch/arm/boot/dts/da850-evm.dts | 56 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-)
arch/arm/boot/dts/da850-evm.dts +54 -2
@@ -297,10 +297,62 @@ }; }; +/* + * Extentions provided on UI board + */ +&i2c0 { + /* clock generator used for camera input */ + cdce913: clock-controller at 65 { + compatible = "ti,cdce913"; + reg = <0x65>; + #clock-cells = <1>; + }; + + pca9543: i2c-mux at 73 { + compatible = "nxp,pca9543"; + reg = <0x73>; + #address-cells = <1>; + #size-cells = <0>; + + pca9543_i2c1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + }; +}; + +&pca9543_i2c1 { + mt9v032: camera at 4c { + compatible = "aptina,mt9v032"; + reg = <0x4c>; + port { + mt9v032_out: endpoint { + remote-endpoint = <&vpif_input_ch0>; + }; + }; + }; +}; + &vpif { pinctrl-names = "default"; pinctrl-0 = <&vpif_capture_pins>, <&vpif_display_pins>; status = "okay"; + + /* VPIF capture port */ + port at 0 { + vpif_input_ch0: endpoint at 0 { + reg = <0>; + bus-width = <8>; + remote-endpoint = <&mt9v032_out>; + }; + + vpif_input_ch1: endpoint at 1 { + reg = <1>; + bus-width = <8>; + data-shift = <8>; + }; + }; }; /* UI board: VPIF input selection */
@@ -316,13 +368,13 @@ sel_b { gpio-hog; gpios = <6 GPIO_ACTIVE_HIGH>; - output-high; + output-low; line-name = "CAMERA_ENn"; }; sel_c { gpio-hog; gpios = <5 GPIO_ACTIVE_HIGH>; - output-low; + output-high; line-name = "VIDEO_IN_ENn"; }; };
Signature · 1 line
2.9.3
PATCH 3/3 HACK: ARM: davinci: add cdce913 clock controller
In reply to Kevin HilmanThe da850-evm UI board has a ti,cdce913 clock controller with a 27MHz crystal to provide the master clock to the camera connector.
While there is an upstream driver for the ti,cdce913, it is CCF only, and since davinci does not currently support CCF, an alternate driver is needed to make camera sensors that depend on the clock API to work correctly.
Note that the current driver is very dumb and doesn't even implement .set_rate, because the default, power-on defaults are sufficient to provide the 27 MHz clock expected by the aptina,mt9v032 which was used for testing.
--- arch/arm/mach-davinci/Makefile | 2 +- arch/arm/mach-davinci/cdce913.c | 164 +++++++++++++++++++++++++++++++++++ arch/arm/mach-davinci/pdata-quirks.c | 8 +- 3 files changed, 171 insertions(+), 3 deletions(-) create mode 100644 arch/arm/mach-davinci/cdce913.c
arch/arm/mach-davinci/Makefile +1 -1
@@ -21,7 +21,7 @@ obj-$(CONFIG_AINTC) += irq.o obj-$(CONFIG_CP_INTC) += cp_intc.o # Board specific -obj-$(CONFIG_MACH_DA8XX_DT) += da8xx-dt.o pdata-quirks.o +obj-$(CONFIG_MACH_DA8XX_DT) += da8xx-dt.o pdata-quirks.o cdce913.o obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o obj-$(CONFIG_MACH_SFFSDR) += board-sffsdr.o obj-$(CONFIG_MACH_NEUROS_OSD2) += board-neuros-osd2.o
arch/arm/mach-davinci/cdce913.c new file +164 -0
164 lines not on this page · raw message
arch/arm/mach-davinci/pdata-quirks.c +6 -2
@@ -191,6 +191,9 @@ static void __init da850_vpif_display_legacy_init_evm(void) __func__, ret); } + +extern void __init da850_evm_camera_capture_init (void ); +static void pdata_quirks_check (struct pdata_init *quirks) {while (quirks->compatible) {
@@ -204,8 +207,9 @@ static void pdata_quirks_check(struct pdata_init *quirks)static struct pdata_init pdata_quirks[]__initdata = { {"ti,da850-lcdk" , da850_vpif_capture_legacy_init_lcdk, }, - {"ti,da850-evm" , da850_vpif_display_legacy_init_evm, }, - {"ti,da850-evm" , da850_vpif_capture_legacy_init_evm, }, + {"ti,da850-evm" , da850_evm_camera_capture_init, }, +/* { "ti,da850-evm", da850_vpif_display_legacy_init_evm, }, */ +/* { "ti,da850-evm", da850_vpif_capture_legacy_init_evm, }, */ {/* sentinel */ }, };
Signature · 1 line
2.9.3