i.MX Media Driver
Subsystems (8)
Steve Longerbeam
maintainercover i.MX Media Driver
This is a media driver for video capture on i.MX.
Refer to Documentation/media/v4l-drivers/imx.rst for example capture pipelines on SabreSD, SabreAuto, and SabreLite reference platforms.
This patchset includes the OF graph layout as proposed by Philipp Zabel, with only minor changes which are enumerated in the patch header.
Philipp Zabel (2):
ARM: dts: imx6qdl: Add mipi_ipu1/2 multiplexers, mipi_csi, and their
connections
media: imx: Add video switch subdev driver
Steve Longerbeam (18):
ARM: dts: imx6qdl: Add compatible, clocks, irqs to MIPI CSI-2 node
ARM: dts: imx6qdl: add media device
ARM: dts: imx6-sabrelite: add OV5642 and OV5640 camera sensors
ARM: dts: imx6-sabresd: add OV5642 and OV5640 camera sensors
ARM: dts: imx6-sabreauto: create i2cmux for i2c3
ARM: dts: imx6-sabreauto: add reset-gpios property for max7310_b
ARM: dts: imx6-sabreauto: add pinctrl for gpt input capture
ARM: dts: imx6-sabreauto: add the ADV7180 video decoder
gpio: pca953x: Add optional reset gpio control
media: Add i.MX media core driver
media: imx: Add CSI subdev driver
media: imx: Add SMFC subdev driver
media: imx: Add IC subdev drivers
media: imx: Add Camera Interface subdev driver
media: imx: Add MIPI CSI-2 Receiver subdev driver
media: imx: Add MIPI CSI-2 OV5640 sensor subdev driver
media: imx: Add Parallel OV5642 sensor subdev driver
ARM: imx_v6_v7_defconfig: Enable staging video4linux drivers
.../devicetree/bindings/gpio/gpio-pca953x.txt | 4 + Documentation/devicetree/bindings/media/imx.txt | 205 + Documentation/media/v4l-drivers/imx.rst | 429 ++ arch/arm/boot/dts/imx6dl-sabrelite.dts | 5 + arch/arm/boot/dts/imx6dl-sabresd.dts | 5 + arch/arm/boot/dts/imx6dl.dtsi | 183 + arch/arm/boot/dts/imx6q-sabrelite.dts | 6 + arch/arm/boot/dts/imx6q-sabresd.dts | 5 + arch/arm/boot/dts/imx6q.dtsi | 123 + arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 142 +- arch/arm/boot/dts/imx6qdl-sabrelite.dtsi | 122 +- arch/arm/boot/dts/imx6qdl-sabresd.dtsi | 114 +- arch/arm/boot/dts/imx6qdl.dtsi | 25 +- arch/arm/configs/imx_v6_v7_defconfig | 10 +- drivers/gpio/gpio-pca953x.c | 17 + drivers/staging/media/Kconfig | 2 + drivers/staging/media/Makefile | 1 + drivers/staging/media/imx/Kconfig | 36 + drivers/staging/media/imx/Makefile | 16 + drivers/staging/media/imx/TODO | 18 + drivers/staging/media/imx/imx-camif.c | 1011 +++++ drivers/staging/media/imx/imx-csi.c | 638 +++ drivers/staging/media/imx/imx-ic-common.c | 113 + drivers/staging/media/imx/imx-ic-pp.c | 636 +++ drivers/staging/media/imx/imx-ic-prpenc.c | 1037 +++++ drivers/staging/media/imx/imx-ic-prpvf.c | 1181 ++++++ drivers/staging/media/imx/imx-ic.h | 36 + drivers/staging/media/imx/imx-media-common.c | 981 +++++ drivers/staging/media/imx/imx-media-dev.c | 479 +++ drivers/staging/media/imx/imx-media-fim.c | 508 +++ drivers/staging/media/imx/imx-media-internal-sd.c | 456 ++ drivers/staging/media/imx/imx-media-of.c | 291 ++ drivers/staging/media/imx/imx-media-of.h | 25 + drivers/staging/media/imx/imx-media.h | 290 ++ drivers/staging/media/imx/imx-mipi-csi2.c | 509 +++ drivers/staging/media/imx/imx-smfc.c | 739 ++++ drivers/staging/media/imx/imx-video-switch.c | 349 ++ drivers/staging/media/imx/ov5640-mipi.c | 2349 +++++++++++ drivers/staging/media/imx/ov5642.c | 4364 ++++++++++++++++++++ include/media/imx.h | 15 + include/uapi/Kbuild | 1 + include/uapi/linux/v4l2-controls.h | 4 + include/uapi/media/Kbuild | 2 + include/uapi/media/imx.h | 30 + 44 files changed, 17484 insertions(+), 28 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/imx.txt create mode 100644 Documentation/media/v4l-drivers/imx.rst create mode 100644 drivers/staging/media/imx/Kconfig create mode 100644 drivers/staging/media/imx/Makefile create mode 100644 drivers/staging/media/imx/TODO create mode 100644 drivers/staging/media/imx/imx-camif.c create mode 100644 drivers/staging/media/imx/imx-csi.c create mode 100644 drivers/staging/media/imx/imx-ic-common.c create mode 100644 drivers/staging/media/imx/imx-ic-pp.c create mode 100644 drivers/staging/media/imx/imx-ic-prpenc.c create mode 100644 drivers/staging/media/imx/imx-ic-prpvf.c create mode 100644 drivers/staging/media/imx/imx-ic.h create mode 100644 drivers/staging/media/imx/imx-media-common.c create mode 100644 drivers/staging/media/imx/imx-media-dev.c create mode 100644 drivers/staging/media/imx/imx-media-fim.c create mode 100644 drivers/staging/media/imx/imx-media-internal-sd.c create mode 100644 drivers/staging/media/imx/imx-media-of.c create mode 100644 drivers/staging/media/imx/imx-media-of.h create mode 100644 drivers/staging/media/imx/imx-media.h create mode 100644 drivers/staging/media/imx/imx-mipi-csi2.c create mode 100644 drivers/staging/media/imx/imx-smfc.c create mode 100644 drivers/staging/media/imx/imx-video-switch.c create mode 100644 drivers/staging/media/imx/ov5640-mipi.c create mode 100644 drivers/staging/media/imx/ov5642.c create mode 100644 include/media/imx.h create mode 100644 include/uapi/media/Kbuild create mode 100644 include/uapi/media/imx.h
Signature · 1 line
2.7.4
Steve Longerbeam
maintainerPATCH 1/20 ARM: dts: imx6qdl: Add compatible, clocks, irqs to MIPI CSI-2 node
Add to the MIPI CSI2 receiver node: compatible string, interrupt sources, clocks.
--- arch/arm/boot/dts/imx6qdl.dtsi | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm/boot/dts/imx6qdl.dtsi +7 -0
@@ -1125,7 +1125,14 @@ }; mipi_csi: mipi at 021dc000 { + compatible = "fsl,imx-mipi-csi2"; reg = <0x021dc000 0x4000>; + interrupts = <0 100 0x04>, <0 101 0x04>; + clocks = <&clks IMX6QDL_CLK_HSI_TX>, + <&clks IMX6QDL_CLK_VIDEO_27M>, + <&clks IMX6QDL_CLK_EIM_SEL>; + clock-names = "dphy_clk", "cfg_clk", "pix_clk"; + status = "disabled"; }; mipi_dsi: mipi at 021e0000 {
Signature · 1 line
2.7.4
Steve Longerbeam
maintainerPATCH 2/20 ARM: dts: imx6qdl: Add mipi_ipu1/2 multiplexers, mipi_csi, and their connections
In reply to Steve LongerbeamFrom: Philipp Zabel <[email protected]>
This patch adds the device tree graph connecting the input multiplexers to the IPU CSIs and the MIPI-CSI2 gasket on i.MX6. The MIPI_IPU multiplexers are added as children of the iomuxc-gpr syscon device node. On i.MX6Q/D two two-input multiplexers in front of IPU1 CSI0 and IPU2 CSI1 allow to select between CSI0/1 parallel input pads and the MIPI CSI-2 virtual channels 0/3.
On i.MX6DL/S two five-input multiplexers in front of IPU1 CSI0 and IPU1 CSI1 allow to select between CSI0/1 parallel input pads and any of the four MIPI CSI-2 virtual channels.
- Removed some dangling/unused endpoints (ipu2_csi0_from_csi2ipu)
- Renamed the mipi virtual channel endpoint labels, from "mipi_csiX_..." to "mipi_vcX...".
- Added input endpoints to the video muxes for the connections from parallel sensors.
- Added input endpoints to the mipi_csi for the connections from mipi csi-2 sensors.
- The video multiplexer node has compatible string "imx-video-mux" instead of "video-multiplexer".
- The video multiplexer node indicates GPR register via reg propert only, (register offset and bitmask), instead of specifying with "bit-mask" and "bit-shift" properties.
--- arch/arm/boot/dts/imx6dl.dtsi | 183 +++++++++++++++++++++++++++++++++++++++++ arch/arm/boot/dts/imx6q.dtsi | 119 +++++++++++++++++++++++++++ arch/arm/boot/dts/imx6qdl.dtsi | 10 ++- 3 files changed, 311 insertions(+), 1 deletion(-)
arch/arm/boot/dts/imx6dl.dtsi +183 -0
@@ -181,6 +181,189 @@ "di0", "di1"; }; +&gpr { + ipu1_csi0_mux: ipu1_csi0_mux at 34 { + compatible = "imx-video-mux"; + reg = <0x34 0x07>; + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + port at 0 { + reg = <0>; + + ipu1_csi0_mux_from_mipi_vc0: endpoint { + remote-endpoint = <&mipi_vc0_to_ipu1_csi0_mux>; + }; + }; + + port at 1 { + reg = <1>; + + ipu1_csi0_mux_from_mipi_vc1: endpoint { + remote-endpoint = <&mipi_vc1_to_ipu1_csi0_mux>; + }; + }; + + port at 2 { + reg = <2>; + + ipu1_csi0_mux_from_mipi_vc2: endpoint { + remote-endpoint = <&mipi_vc2_to_ipu1_csi0_mux>; + }; + }; + + port at 3 { + reg = <3>; + + ipu1_csi0_mux_from_mipi_vc3: endpoint { + remote-endpoint = <&mipi_vc3_to_ipu1_csi0_mux>; + }; + }; + + port at 4 { + reg = <4>; + + ipu1_csi0_mux_from_parallel_sensor: endpoint { + }; + }; + + port at 5 { + reg = <5>; + + ipu1_csi0_mux_to_ipu1_csi0: endpoint { + remote-endpoint = <&ipu1_csi0_from_ipu1_csi0_mux>; + }; + }; + }; + + ipu1_csi1_mux: ipu1_csi1_mux at 34 { + compatible = "imx-video-mux"; + reg = <0x34 0x38>; + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + port at 0 { + reg = <0>; + + ipu1_csi1_mux_from_mipi_vc0: endpoint { + remote-endpoint = <&mipi_vc0_to_ipu1_csi1_mux>; + }; + }; + + port at 1 { + reg = <1>; + + ipu1_csi1_mux_from_mipi_vc1: endpoint { + remote-endpoint = <&mipi_vc1_to_ipu1_csi1_mux>; + }; + }; + + port at 2 { + reg = <2>; + + ipu1_csi1_mux_from_mipi_vc2: endpoint { + remote-endpoint = <&mipi_vc2_to_ipu1_csi1_mux>; + }; + }; + + port at 3 { + reg = <3>; + + ipu1_csi1_mux_from_mipi_vc3: endpoint { + remote-endpoint = <&mipi_vc3_to_ipu1_csi1_mux>; + }; + }; + + port at 4 { + reg = <4>; + + ipu1_csi1_mux_from_parallel_sensor: endpoint { + }; + }; + + port at 5 { + reg = <5>; + + ipu1_csi1_mux_to_ipu1_csi1: endpoint { + remote-endpoint = <&ipu1_csi1_from_ipu1_csi1_mux>; + }; + }; + }; +}; + +&ipu1_csi1 { + ipu1_csi1_from_ipu1_csi1_mux: endpoint { + remote-endpoint = <&ipu1_csi1_mux_to_ipu1_csi1>; + }; +}; + +&mipi_csi { + port at 0 { + reg = <0>; + + mipi_csi_from_mipi_sensor: endpoint { + }; + }; + + port at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + mipi_vc0_to_ipu1_csi0_mux: endpoint at 0 { + remote-endpoint = <&ipu1_csi0_mux_from_mipi_vc0>; + }; + + mipi_vc0_to_ipu1_csi1_mux: endpoint at 1 { + remote-endpoint = <&ipu1_csi1_mux_from_mipi_vc0>; + }; + }; + + port at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + + mipi_vc1_to_ipu1_csi0_mux: endpoint at 0 { + remote-endpoint = <&ipu1_csi0_mux_from_mipi_vc1>; + }; + + mipi_vc1_to_ipu1_csi1_mux: endpoint at 1 { + remote-endpoint = <&ipu1_csi1_mux_from_mipi_vc1>; + }; + }; + + port at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + + mipi_vc2_to_ipu1_csi0_mux: endpoint at 0 { + remote-endpoint = <&ipu1_csi0_mux_from_mipi_vc2>; + }; + + mipi_vc2_to_ipu1_csi1_mux: endpoint at 1 { + remote-endpoint = <&ipu1_csi1_mux_from_mipi_vc2>; + }; + }; + + port at 4 { + reg = <4>; + #address-cells = <1>; + #size-cells = <0>; + + mipi_vc3_to_ipu1_csi0_mux: endpoint at 0 { + remote-endpoint = <&ipu1_csi0_mux_from_mipi_vc3>; + }; + + mipi_vc3_to_ipu1_csi1_mux: endpoint at 1 { + remote-endpoint = <&ipu1_csi1_mux_from_mipi_vc3>; + }; + }; +}; + &vpu { compatible = "fsl,imx6dl-vpu", "cnm,coda960"; };
arch/arm/boot/dts/imx6q.dtsi +119 -0
141 lines not on this page · raw message
arch/arm/boot/dts/imx6qdl.dtsi +9 -1
@@ -799,8 +799,10 @@ }; gpr: iomuxc-gpr at 020e0000 { - compatible = "fsl,imx6q-iomuxc-gpr", "syscon"; + compatible = "fsl,imx6q-iomuxc-gpr", "syscon", "simple-mfd"; reg = <0x020e0000 0x38>; + #address-cells = <1>; + #size-cells = <0>; }; iomuxc: iomuxc at 020e0000 {
@@ -1127,6 +1129,8 @@ mipi_csi: mipi at 021dc000 { compatible = "fsl,imx-mipi-csi2"; reg = <0x021dc000 0x4000>; + #address-cells = <1>; + #size-cells = <0>; interrupts = <0 100 0x04>, <0 101 0x04>; clocks = <&clks IMX6QDL_CLK_HSI_TX>, <&clks IMX6QDL_CLK_VIDEO_27M>,
@@ -1232,6 +1236,10 @@ ipu1_csi0: port at 0 { reg = <0>; + + ipu1_csi0_from_ipu1_csi0_mux: endpoint { + remote-endpoint = <&ipu1_csi0_mux_to_ipu1_csi0>; + }; }; ipu1_csi1: port at 1 {
Signature · 1 line
2.7.4
Steve Longerbeam
maintainerPATCH 3/20 ARM: dts: imx6qdl: add media device
In reply to Steve Longerbeam--- arch/arm/boot/dts/imx6q.dtsi | 4 ++++ arch/arm/boot/dts/imx6qdl.dtsi | 8 ++++++++ 2 files changed, 12 insertions(+)
arch/arm/boot/dts/imx6q.dtsi +4 -0
@@ -454,3 +454,7 @@ &vpu { compatible = "fsl,imx6q-vpu", "cnm,coda960"; }; + +&media0 { + ports = <&ipu1_csi0>, <&ipu1_csi1>, <&ipu2_csi0>, <&ipu2_csi1>; +};
arch/arm/boot/dts/imx6qdl.dtsi +8 -0
@@ -1296,5 +1296,13 @@ }; }; }; + + media0: media at 0 { + compatible = "fsl,imx-media"; + ports = <&ipu1_csi0>, <&ipu1_csi1>; + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + }; }; };
Signature · 1 line
2.7.4
Steve Longerbeam
maintainerPATCH 4/20 ARM: dts: imx6-sabrelite: add OV5642 and OV5640 camera sensors
In reply to Steve LongerbeamEnables the OV5642 parallel-bus sensor, and the OV5640 MIPI CSI-2 sensor. Both hang off the same i2c2 bus, so they require different (and non- default) i2c slave addresses.
The OV5642 connects to the parallel-bus mux input port on ipu1_csi0_mux.
The OV5640 connects to the input port on the MIPI CSI-2 receiver on mipi_csi. It is set to transmit over MIPI virtual channel 1.
Note there is a pin conflict with GPIO6. This pin functions as a power input pin to the OV5642, but ENET uses it as the h/w workaround for erratum ERR006687, to wake-up the ARM cores on normal RX and TX packet done events (see 6261c4c8). So workaround 6261c4c8 is reverted here to support the OV5642, and the "fsl,err006687-workaround-present" boolean also must be removed. The result is that the CPUidle driver will no longer allow entering the deep idle states on the sabrelite.
--- arch/arm/boot/dts/imx6dl-sabrelite.dts | 5 ++ arch/arm/boot/dts/imx6q-sabrelite.dts | 6 ++ arch/arm/boot/dts/imx6qdl-sabrelite.dtsi | 122 ++++++++++++++++++++++++++++++- 3 files changed, 129 insertions(+), 4 deletions(-)
arch/arm/boot/dts/imx6dl-sabrelite.dts +5 -0
@@ -48,3 +48,8 @@ model = "Freescale i.MX6 DualLite SABRE Lite Board"; compatible = "fsl,imx6dl-sabrelite", "fsl,imx6dl"; }; + +&ipu1_csi1_from_ipu1_csi1_mux { + data-lanes = <0 1>; + clock-lanes = <2>; +};
arch/arm/boot/dts/imx6q-sabrelite.dts +6 -0
@@ -52,3 +52,9 @@ &sata { status = "okay"; }; + +&ipu1_csi1_from_mipi_vc1 { + data-lanes = <0 1>; + clock-lanes = <2>; +}; +
arch/arm/boot/dts/imx6qdl-sabrelite.dtsi +118 -4
167 lines not on this page · raw message
Signature · 1 line
2.7.4
Steve Longerbeam
maintainerPATCH 5/20 ARM: dts: imx6-sabresd: add OV5642 and OV5640 camera sensors
In reply to Steve LongerbeamEnables the OV5642 parallel-bus sensor, and the OV5640 MIPI CSI-2 sensor.
The OV5642 connects to the parallel-bus mux input port on ipu1_csi0_mux.
The OV5640 connects to the input port on the MIPI CSI-2 receiver on mipi_csi. It is set to transmit over MIPI virtual channel 1.
Until the OV5652 sensor module compatible with the SabreSD becomes available for testing, the ov5642 node is currently disabled.
--- arch/arm/boot/dts/imx6dl-sabresd.dts | 5 ++ arch/arm/boot/dts/imx6q-sabresd.dts | 5 ++ arch/arm/boot/dts/imx6qdl-sabresd.dtsi | 114 ++++++++++++++++++++++++++++++++- 3 files changed, 123 insertions(+), 1 deletion(-)
arch/arm/boot/dts/imx6dl-sabresd.dts +5 -0
@@ -15,3 +15,8 @@ model = "Freescale i.MX6 DualLite SABRE Smart Device Board"; compatible = "fsl,imx6dl-sabresd", "fsl,imx6dl"; }; + +&ipu1_csi1_from_ipu1_csi1_mux { + data-lanes = <0 1>; + clock-lanes = <2>; +};
arch/arm/boot/dts/imx6q-sabresd.dts +5 -0
@@ -23,3 +23,8 @@ &sata { status = "okay"; }; + +&ipu1_csi1_from_mipi_vc1 { + data-lanes = <0 1>; + clock-lanes = <2>; +};
arch/arm/boot/dts/imx6qdl-sabresd.dtsi +113 -1
144 lines not on this page · raw message
Signature · 1 line
2.7.4
Steve Longerbeam
maintainerPATCH 6/20 ARM: dts: imx6-sabreauto: create i2cmux for i2c3
In reply to Steve LongerbeamThe sabreauto uses a steering pin to select between the SDA signal on i2c3 bus, and a data-in pin for an SPI NOR chip. Use i2cmux to control this steering pin. Idle state of the i2cmux selects SPI NOR. This is not a classic way to use i2cmux, since one side of the mux selects something other than an i2c bus, but it works and is probably the cleanest solution. Note that if one thread is attempting to access SPI NOR while another thread is accessing i2c3, the SPI NOR access will fail since the i2cmux has selected the SDA pin rather than SPI NOR data-in. This couldn't be avoided in any case, the board is not designed to allow concurrent i2c3 and SPI NOR functions (and the default device-tree does not enable SPI NOR anyway).
Devices hanging off i2c3 should now be defined under i2cmux, so that the steering pin can be properly controlled to access those devices. The port expanders (MAX7310) are thus moved into i2cmux.
--- arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 65 +++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 21 deletions(-)
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +44 -21
@@ -108,6 +108,44 @@ default-brightness-level = <7>; status = "okay"; }; + + i2cmux { + compatible = "i2c-mux-gpio"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c3mux>; + mux-gpios = <&gpio5 4 0>; + i2c-parent = <&i2c3>; + idle-state = <0>; + + i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + max7310_a: gpio at 30 { + compatible = "maxim,max7310"; + reg = <0x30>; + gpio-controller; + #gpio-cells = <2>; + }; + + max7310_b: gpio at 32 { + compatible = "maxim,max7310"; + reg = <0x32>; + gpio-controller; + #gpio-cells = <2>; + }; + + max7310_c: gpio at 34 { + compatible = "maxim,max7310"; + reg = <0x34>; + gpio-controller; + #gpio-cells = <2>; + }; + }; + }; }; &clks {
@@ -291,27 +329,6 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c3>; status = "okay"; - - max7310_a: gpio at 30 { - compatible = "maxim,max7310"; - reg = <0x30>; - gpio-controller; - #gpio-cells = <2>; - }; - - max7310_b: gpio at 32 { - compatible = "maxim,max7310"; - reg = <0x32>; - gpio-controller; - #gpio-cells = <2>; - }; - - max7310_c: gpio at 34 { - compatible = "maxim,max7310"; - reg = <0x34>; - gpio-controller; - #gpio-cells = <2>; - }; }; &iomuxc {
@@ -419,6 +436,12 @@ >; }; + pinctrl_i2c3mux: i2c3muxgrp { + fsl,pins = < + MX6QDL_PAD_EIM_A24__GPIO5_IO04 0x80000000 + >; + }; + pinctrl_pwm3: pwm1grp { fsl,pins = < MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x1b0b1
Signature · 1 line
2.7.4
Steve Longerbeam
maintainerPATCH 7/20 ARM: dts: imx6-sabreauto: add reset-gpios property for max7310_b
In reply to Steve LongerbeamThe reset pin to the port expander chip (MAX7310) is controlled by a gpio, so define a reset-gpios property to control it. There are three MAX7310's on the SabreAuto CPU card (max7310_[abc]), but all use the same pin for their reset. Since all can't acquire the same pin, assign it to max7310_b, that chip is needed by more functions (usb and adv7180).
--- arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +9 -0
@@ -136,6 +136,9 @@ reg = <0x32>; gpio-controller; #gpio-cells = <2>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_max7310>; + reset-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; }; max7310_c: gpio at 34 {
@@ -442,6 +445,12 @@ >; }; + pinctrl_max7310: max7310grp { + fsl,pins = < + MX6QDL_PAD_SD2_DAT0__GPIO1_IO15 0x80000000 + >; + }; + pinctrl_pwm3: pwm1grp { fsl,pins = < MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x1b0b1
Signature · 1 line
2.7.4
Steve Longerbeam
maintainerPATCH 8/20 ARM: dts: imx6-sabreauto: add pinctrl for gpt input capture
In reply to Steve LongerbeamAdd pinctrl groups for both GPT input capture channels.
--- arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +12 -0
@@ -457,6 +457,18 @@ >; }; + pinctrl_gpt_input_capture0: gptinputcapture0grp { + fsl,pins = < + MX6QDL_PAD_SD1_DAT0__GPT_CAPTURE1 0x80000000 + >; + }; + + pinctrl_gpt_input_capture1: gptinputcapture1grp { + fsl,pins = < + MX6QDL_PAD_SD1_DAT1__GPT_CAPTURE2 0x80000000 + >; + }; + pinctrl_spdif: spdifgrp { fsl,pins = < MX6QDL_PAD_KEY_COL3__SPDIF_IN 0x1b0b0
Signature · 1 line
2.7.4
Steve Longerbeam
maintainerPATCH 9/20 ARM: dts: imx6-sabreauto: add the ADV7180 video decoder
In reply to Steve LongerbeamEnables the ADV7180 decoder sensor. The ADV7180 connects to the parallel-bus mux input on ipu1_csi0_mux.
On the sabreauto, two analog video inputs are routed to the ADV7180, composite on Ain1, and composite on Ain3. Those inputs are defined via inputs and input-names under the ADV7180 node. The ADV7180 power pin is via max7310_b port expander.
--- arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 56 ++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+)
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +56 -0
@@ -147,10 +147,42 @@ gpio-controller; #gpio-cells = <2>; }; + + camera: adv7180 at 21 { + compatible = "adi,adv7180"; + reg = <0x21>; + powerdown-gpios = <&max7310_b 2 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio1>; + interrupts = <27 0x8>; + inputs = <0x00 0x02>; + input-names = "ADV7180 Composite on Ain1", + "ADV7180 Composite on Ain3"; + + port { + adv7180_to_ipu1_csi0_mux: endpoint { + remote-endpoint = <&ipu1_csi0_mux_from_parallel_sensor>; + bus-width = <8>; + }; + }; + }; }; }; }; +&ipu1_csi0_from_ipu1_csi0_mux { + bus-width = <8>; +}; + +&ipu1_csi0_mux_from_parallel_sensor { + remote-endpoint = <&adv7180_to_ipu1_csi0_mux>; + bus-width = <8>; +}; + +&ipu1_csi0 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ipu1_csi0>; +}; + &clks { assigned-clocks = <&clks IMX6QDL_PLL4_BYPASS_SRC>, <&clks IMX6QDL_PLL4_BYPASS>,
@@ -451,6 +483,30 @@ >; }; + pinctrl_ipu1_csi0: ipu1grp-csi0 { + fsl,pins = < + MX6QDL_PAD_CSI0_DAT4__IPU1_CSI0_DATA04 0x80000000 + MX6QDL_PAD_CSI0_DAT5__IPU1_CSI0_DATA05 0x80000000 + MX6QDL_PAD_CSI0_DAT6__IPU1_CSI0_DATA06 0x80000000 + MX6QDL_PAD_CSI0_DAT7__IPU1_CSI0_DATA07 0x80000000 + MX6QDL_PAD_CSI0_DAT8__IPU1_CSI0_DATA08 0x80000000 + MX6QDL_PAD_CSI0_DAT9__IPU1_CSI0_DATA09 0x80000000 + MX6QDL_PAD_CSI0_DAT10__IPU1_CSI0_DATA10 0x80000000 + MX6QDL_PAD_CSI0_DAT11__IPU1_CSI0_DATA11 0x80000000 + MX6QDL_PAD_CSI0_DAT12__IPU1_CSI0_DATA12 0x80000000 + MX6QDL_PAD_CSI0_DAT13__IPU1_CSI0_DATA13 0x80000000 + MX6QDL_PAD_CSI0_DAT14__IPU1_CSI0_DATA14 0x80000000 + MX6QDL_PAD_CSI0_DAT15__IPU1_CSI0_DATA15 0x80000000 + MX6QDL_PAD_CSI0_DAT16__IPU1_CSI0_DATA16 0x80000000 + MX6QDL_PAD_CSI0_DAT17__IPU1_CSI0_DATA17 0x80000000 + MX6QDL_PAD_CSI0_DAT18__IPU1_CSI0_DATA18 0x80000000 + MX6QDL_PAD_CSI0_DAT19__IPU1_CSI0_DATA19 0x80000000 + MX6QDL_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK 0x80000000 + MX6QDL_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC 0x80000000 + MX6QDL_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC 0x80000000 + >; + }; + pinctrl_pwm3: pwm1grp { fsl,pins = < MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x1b0b1
Signature · 1 line
2.7.4
Steve Longerbeam
maintainerPATCH 10/20 gpio: pca953x: Add optional reset gpio control
In reply to Steve LongerbeamAdd optional reset-gpios pin control. If present, de-assert the specified reset gpio pin to bring the chip out of reset.
---
v2:
- documented optional reset-gpios property in Documentation/devicetree/bindings/gpio/gpio-pca953x.txt.
--- Documentation/devicetree/bindings/gpio/gpio-pca953x.txt | 4 ++++ drivers/gpio/gpio-pca953x.c | 17 +++++++++++++++++ 2 files changed, 21 insertions(+)
Documentation/devicetree/bindings/gpio/gpio-pca953x.txt +4 -0
@@ -29,6 +29,10 @@ Required properties: onsemi,pca9654 exar,xra1202 +Optional properties: + - reset-gpios: GPIO specification for the RESET input + + Example:
drivers/gpio/gpio-pca953x.c +17 -0
@@ -22,6 +22,7 @@#include <linux/of_platform.h> #include <linux/acpi.h> #include <linux/regulator/consumer.h> +#include <linux/gpio/consumer.h> #define PCA953X_INPUT 0#define PCA953X_OUTPUT 1
@@ -133,6 +134,7 @@ struct pca953x_chip {const char *const *names;unsigned long driver_data;struct regulator *regulator; +struct gpio_desc *reset_gpio;const struct pca953x_reg_config *regs;
@@ -756,6 +758,21 @@ static int pca953x_probe(struct i2c_client *client, }else { chip->gpio_start =-1 ; irq_base =0 ; + +/* see if we need to de-assert a reset pin */ + chip->reset_gpio =devm_gpiod_get_optional (&client->dev, +"reset" , +GPIOD_OUT_LOW ); +if (IS_ERR (chip->reset_gpio)) { +dev_err (&client->dev,"request for reset pin failed\n" ); +return PTR_ERR (chip->reset_gpio); + } + +if (chip->reset_gpio) { +/* bring chip out of reset */ +dev_info (&client->dev,"releasing reset\n" ); +gpiod_set_value (chip->reset_gpio,0 ); + } } chip->client = client;
Signature · 1 line
2.7.4
Re: [PATCH 10/20] gpio: pca953x: Add optional reset gpio control
Hi,
Quoted 64 lines · On Thu, 29 Dec 2016 14:27:25 -0800 Steve Longerbeam wrote:
Add optional reset-gpios pin control. If present, de-assert the specified reset gpio pin to bring the chip out of reset.
Signed-off-by Steve Longerbeam <[email protected]>Cc Linus Walleij <[email protected]>Cc Alexandre Courbot <[email protected]>Cc linux-gpio at vger.kernel.orgCc linux-kernel at vger.kernel.org---
v2:
- documented optional reset-gpios property inDocumentation/devicetree/bindings/gpio/gpio-pca953x.txt.--- Documentation/devicetree/bindings/gpio/gpio-pca953x.txt | 4 ++++ drivers/gpio/gpio-pca953x.c | 17 +++++++++++++++++ 2 files changed, 21 insertions(+)Documentation/devicetree/bindings/gpio/gpio-pca953x.txt +4
-0@@ -29,6 +29,10 @@ Required properties: onsemi,pca9654 exar,xra1202 +Optional properties: + - reset-gpios: GPIO specification for the RESET input + + Example:drivers/gpio/gpio-pca953x.c +7
-0@@ -22,6 +22,7 @@#include <linux/of_platform.h> #include <linux/acpi.h> #include <linux/regulator/consumer.h> +#include <linux/gpio/consumer.h> #define PCA953X_INPUT 0#define PCA953X_OUTPUT 1@@ -133,6 +134,7 @@ struct pca953x_chip {const char *const *names;unsigned long driver_data;struct regulator *regulator; +struct gpio_desc *reset_gpio;const struct pca953x_reg_config *regs;@@ -756,6 +758,21 @@ static int pca953x_probe(struct i2c_client *client, }else { chip->gpio_start =-1 ; irq_base =0 ; + +/* see if we need to de-assert a reset pin */ + chip->reset_gpio =devm_gpiod_get_optional (&client->dev, +"reset" , +GPIOD_OUT_LOW );
drivers/gpio/gpio-pca953x.c static int pca953x_probe(struct i2c_client *client, · line 776
Quoted 10 lines
drivers/gpio/gpio-pca953x.c +9
-0+if (IS_ERR (chip->reset_gpio)) { +dev_err (&client->dev,"request for reset pin failed\n" ); +return PTR_ERR (chip->reset_gpio); + } + +if (chip->reset_gpio) { +/* bring chip out of reset */ +dev_info (&client->dev,"releasing reset\n" ); +gpiod_set_value (chip->reset_gpio,0 );
The pin is already initialized to the inactive state thru the GPIOD_OUT_LOW flag in devm_gpiod_get_optional(), so this call to gpiod_set_value() is useless.
Lothar Wa?mann
Re: [PATCH 10/20] gpio: pca953x: Add optional reset gpio control
In reply to Steve LongerbeamQuoted 8 lines · Steve Longerbeam
Add optional reset-gpios pin control. If present, de-assert the specified reset gpio pin to bring the chip out of reset.
Signed-off-by Steve Longerbeam <[email protected]>Cc Linus Walleij <[email protected]>Cc Alexandre Courbot <[email protected]>Cc linux-gpio at vger.kernel.orgCc linux-kernel at vger.kernel.org
This seems like a separate patch from the other 19 patches so please send it separately so I can handle logistics easier in the future.
drivers/gpio/gpio-pca953x.c struct pca953x_chip { · line 137
Quoted 5 lines
drivers/gpio/gpio-pca953x.c +1
-0@@ -133,6 +134,7 @@ struct pca953x_chip {const char *const *names;unsigned long driver_data;struct regulator *regulator; +struct gpio_desc *reset_gpio;
Why do you even keep this around in the device state container?
As you only use it in the probe() function, use a local variable.
The descriptor will be free():ed by the devm infrastructure anyways.
drivers/gpio/gpio-pca953x.c static int pca953x_probe(struct i2c_client *client, · line 769
Quoted 8 lines
drivers/gpio/gpio-pca953x.c +8
-0+/* see if we need to de-assert a reset pin */ + chip->reset_gpio =devm_gpiod_get_optional (&client->dev, +"reset" , +GPIOD_OUT_LOW ); +if (IS_ERR (chip->reset_gpio)) { +dev_err (&client->dev,"request for reset pin failed\n" ); +return PTR_ERR (chip->reset_gpio); + }
Nice.
drivers/gpio/gpio-pca953x.c static int pca953x_probe(struct i2c_client *client, · line 775
Quoted 5 lines
drivers/gpio/gpio-pca953x.c +5
-0+if (chip->reset_gpio) { +/* bring chip out of reset */ +dev_info (&client->dev,"releasing reset\n" ); +gpiod_set_value (chip->reset_gpio,0 ); + }
Is this really needed given that you set it low in the devm_gpiod_get_optional()?
Yours,
Linus Walleij
Steve Longerbeam
maintainerRe: [PATCH 10/20] gpio: pca953x: Add optional reset gpio control
Hi Linus, Lothar,
Quoted 6 lines · Linus Walleij
Quoted 3 lines · Steve Longerbeam
Add optional reset-gpios pin control. If present, de-assert the specified reset gpio pin to bring the chip out of reset.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Steve Longerbeam <[email protected]>Cc Linus Walleij <[email protected]>Cc Alexandre Courbot <[email protected]>Cc linux-gpio at vger.kernel.orgCc linux-kernel at vger.kernel.orgThis seems like a separate patch from the other 19 patches so please send it separately so I can handle logistics easier in the future.
Ok, I'll send the next version separately.
Quoted 9 lines
drivers/gpio/gpio-pca953x.c struct pca953x_chip { · line 137
Quoted 7 lines
drivers/gpio/gpio-pca953x.c +1
-0@@ -133,6 +134,7 @@ struct pca953x_chip {const char *const *names;unsigned long driver_data;struct regulator *regulator; +struct gpio_desc *reset_gpio;Why do you even keep this around in the device state container?
Quoted 3 lines
As you only use it in the
probe()function, use a local variable.The descriptor will be free():ed by the devm infrastructure anyways.
I think my reasoning for putting the gpio handle into the device struct was for possibly using it for run-time reset control at some point. But that could be done later if needed, so I'll go ahead and make it local.
Quoted 10 lines
drivers/gpio/gpio-pca953x.c static int pca953x_probe(struct i2c_client *client, · line 769
Quoted 8 lines
drivers/gpio/gpio-pca953x.c +8
-0+/* see if we need to de-assert a reset pin */ + chip->reset_gpio =devm_gpiod_get_optional (&client->dev, +"reset" , +GPIOD_OUT_LOW ); +if (IS_ERR (chip->reset_gpio)) { +dev_err (&client->dev,"request for reset pin failed\n" ); +return PTR_ERR (chip->reset_gpio); + }Nice.
Quoted 7 lines
drivers/gpio/gpio-pca953x.c static int pca953x_probe(struct i2c_client *client, · line 775
Quoted 5 lines
drivers/gpio/gpio-pca953x.c +5
-0+if (chip->reset_gpio) { +/* bring chip out of reset */ +dev_info (&client->dev,"releasing reset\n" ); +gpiod_set_value (chip->reset_gpio,0 ); + }Is this really needed given that you set it low in the
devm_gpiod_get_optional()?
Yep, this is left over from a previous iteration, but it isn't needed now. I'll remove it.
Steve
Steve Longerbeam
maintainerPATCH 11/20 media: Add i.MX media core driver
In reply to Steve LongerbeamAdd the core media driver for i.MX SOC.
--- Documentation/devicetree/bindings/media/imx.txt | 205 +++++ Documentation/media/v4l-drivers/imx.rst | 429 ++++++++++ drivers/staging/media/Kconfig | 2 + drivers/staging/media/Makefile | 1 + drivers/staging/media/imx/Kconfig | 8 + drivers/staging/media/imx/Makefile | 6 + drivers/staging/media/imx/TODO | 18 + drivers/staging/media/imx/imx-media-common.c | 981 ++++++++++++++++++++++ drivers/staging/media/imx/imx-media-dev.c | 479 +++++++++++ drivers/staging/media/imx/imx-media-fim.c | 508 +++++++++++ drivers/staging/media/imx/imx-media-internal-sd.c | 456 ++++++++++ drivers/staging/media/imx/imx-media-of.c | 291 +++++++ drivers/staging/media/imx/imx-media-of.h | 25 + drivers/staging/media/imx/imx-media.h | 290 +++++++ include/media/imx.h | 15 + include/uapi/Kbuild | 1 + include/uapi/linux/v4l2-controls.h | 4 + include/uapi/media/Kbuild | 2 + include/uapi/media/imx.h | 30 + 19 files changed, 3751 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/imx.txt create mode 100644 Documentation/media/v4l-drivers/imx.rst create mode 100644 drivers/staging/media/imx/Kconfig create mode 100644 drivers/staging/media/imx/Makefile create mode 100644 drivers/staging/media/imx/TODO create mode 100644 drivers/staging/media/imx/imx-media-common.c create mode 100644 drivers/staging/media/imx/imx-media-dev.c create mode 100644 drivers/staging/media/imx/imx-media-fim.c create mode 100644 drivers/staging/media/imx/imx-media-internal-sd.c create mode 100644 drivers/staging/media/imx/imx-media-of.c create mode 100644 drivers/staging/media/imx/imx-media-of.h create mode 100644 drivers/staging/media/imx/imx-media.h create mode 100644 include/media/imx.h create mode 100644 include/uapi/media/Kbuild create mode 100644 include/uapi/media/imx.h
Documentation/devicetree/bindings/media/imx.txt new file +205 -0
@@ -0,0 +1,205 @@ +Freescale i.MX Media Video Devices + +Video Media Controller node +--------------------------- + +This is the parent media controller node for video capture support. + +Required properties: +- compatible : "fsl,imx-media"; +- ports : Should contain a list of phandles pointing to camera + sensor interface ports of IPU devices + + +fim child node +-------------- + +This is an optional child node of the ipu_csi port nodes. It can be used +to modify the default control values for the video capture Frame +Interval Monitor. Refer to Documentation/media/v4l-drivers/imx.rst for +more info on the Frame Interval Monitor. + +Optional properties: +- enable : enable (1) or disable (0) the FIM; +- num-avg : how many frame intervals the FIM will average; +- num-skip : how many frames the FIM will skip after a video + capture restart before beginning to sample frame + intervals; +- tolerance-range : a range of tolerances for the averaged frame + interval error, specified as <min max>, in usec. + The FIM will signal a frame interval error if + min < error < max. If the max is <= min, then + tolerance range is disabled (interval error if + error > min). +- input-capture-channel: an input capture channel and channel flags, + specified as <chan flags>. The channel number + must be 0 or 1. The flags can be + IRQ_TYPE_EDGE_RISING, IRQ_TYPE_EDGE_FALLING, or + IRQ_TYPE_EDGE_BOTH, and specify which input + capture signal edge will trigger the event. If + an input capture channel is specified, the FIM + will use this method to measure frame intervals + instead of via the EOF interrupt. The input capture + method is much preferred over EOF as it is not + subject to interrupt latency errors. However it + requires routing the VSYNC or FIELD output + signals of the camera sensor to one of the + i.MX input capture pads (SD1_DAT0, SD1_DAT1), + which also gives up support for SD1. + + +mipi_csi2 node +-------------- + +This is the device node for the MIPI CSI-2 Receiver, required for MIPI +CSI-2 sensors. + +Required properties: +- compatible : "fsl,imx-mipi-csi2"; +- reg : physical base address and length of the register set; +- clocks : the MIPI CSI-2 receiver requires three clocks: hsi_tx + (the DPHY clock), video_27m, and eim_sel; +- clock-names : must contain "dphy_clk", "cfg_clk", "pix_clk"; + +Optional properties: +- interrupts : must contain two level-triggered interrupts, + in order: 100 and 101; + + +video mux node +-------------- + +This is the device node for the video multiplexer. It can control +either the i.MX internal video mux that selects between parallel image +sensors and MIPI CSI-2 virtual channels, or an external mux controlled +by a GPIO. It must be a child device of the syscon GPR device. + +Required properties: +- compatible : "imx-video-mux"; +- sink-ports : the number of sink (input) ports that follow +- ports : at least 2 sink ports must be specified that define + the endpoint inputs to the video mux, and there must + be exactly one output port endpoint which must be the + last port endpoint defined; + +Optional properties: +- reg : the GPR iomuxc register offset and bitmask of the + internal mux bits; +- mux-gpios : if reg is not specified, this must exist to define + a GPIO to control an external mux; + + +SabreLite Quad with OV5642 and OV5640 +------------------------------------- + +On the Sabrelite, the OV5642 module is connected to the parallel bus +input on the i.MX internal video mux to IPU1 CSI0. It's i2c bus connects +to i2c bus 2, so the ov5642 sensor node must be a child of i2c2. + +The MIPI CSI-2 OV5640 module is connected to the i.MX internal MIPI CSI-2 +receiver, and the four virtual channel outputs from the receiver are +routed as follows: vc0 to the IPU1 CSI0 mux, vc1 directly to IPU1 CSI1, +vc2 directly to IPU2 CSI0, and vc3 to the IPU2 CSI1 mux. The OV5640 is +also connected to i2c bus 2 on the SabreLite, so it also must be a child +of i2c2. Therefore the OV5642 and OV5640 must not share the same i2c slave +address. + +OV5642 Required properties: +- compatible : "ovti,ov5642"; +- clocks : the OV5642 system clock (cko2, 200 on Sabrelite); +- clock-names : must be "xclk"; +- reg : i2c slave address (must not be default 0x3c on Sabrelite); +- xclk : the system clock frequency (24000000 on Sabrelite); +- reset-gpios : gpio for the reset pin to OV5642 +- pwdn-gpios : gpio for the powewr-down pin to OV5642 + +OV5642 Endpoint Required properties: +- remote-endpoint : must connect to parallel sensor interface input endpoint + on ipu1_csi0 video mux (ipu1_csi0_mux_from_parallel_sensor). +- bus-width : must be 8; +- hsync-active : must be 1; +- vsync-active : must be 1; + +OV5640 Required properties: +- compatible : "ovti,ov5640_mipi"; +- clocks : the OV5640 system clock (pwm3 on Sabrelite); +- clock-names : must be "xclk"; +- reg : i2c slave address (must not be default 0x3c on Sabrelite); +- xclk : the system clock frequency (22000000 on Sabrelite); +- reset-gpios : gpio for the reset pin to OV5640 +- pwdn-gpios : gpio for the power-down pin to OV5640 + +OV5640 MIPI CSI-2 Endpoint Required properties: +- remote-endpoint : must connect to mipi_csi receiver input endpoint + (mipi_csi_from_mipi_sensor). +- reg : the MIPI CSI-2 virtual channel to transmit over; +- data-lanes : must be <0 1>; +- clock-lanes : must be <2>; + +OV5640/OV5642 Optional properties: +- DOVDD-supply : DOVDD regulator supply; +- AVDD-supply : AVDD regulator supply; +- DVDD-supply : DVDD regulator supply; + + +SabreAuto Quad with ADV7180 +--------------------------- + +On the SabreAuto, an on-board ADV7180 SD decoder is connected to the +parallel bus input on the internal video mux to IPU1 CSI0. + +Two analog video inputs are routed to the ADV7180 on the SabreAuto, +composite on Ain1, and composite on Ain3. Those inputs are defined +via inputs and input-names properties in the ADV7180 device node. + +Regulators and port expanders are required for the ADV7180 (power pin +is via port expander gpio on i2c3). The reset pin to the port expander +chip (MAX7310) is controlled by a gpio, so a reset-gpios property must +be defined under the port expander node to control it. + +The sabreauto uses a steering pin to select between the SDA signal on +i2c3 bus, and a data-in pin for an SPI NOR chip. i2cmux can be used to +control this steering pin. Idle state of the i2cmux selects SPI NOR. +This is not classic way to use i2cmux, since one side of the mux selects +something other than an i2c bus, but it works and is probably the cleanest +solution. Note that if one thread is attempting to access SPI NOR while +another thread is accessing i2c3, the SPI NOR access will fail since the +i2cmux has selected the SDA pin rather than SPI NOR data-in. This couldn't +be avoided in any case, the board is not designed to allow concurrent +i2c3 and SPI NOR functions (and the default device-tree does not enable +SPI NOR anyway). + +ADV7180 Required properties: +- compatible : "adi,adv7180"; +- reg : must be 0x21; + +ADV7180 Optional properties: +- DOVDD-supply : DOVDD regulator supply; +- AVDD-supply : AVDD regulator supply; +- DVDD-supply : DVDD regulator supply; +- PVDD-supply : PVDD regulator supply; +- pwdn-gpios : gpio to control ADV7180 power pin, must be + <&port_exp_b 2 GPIO_ACTIVE_LOW> on SabreAuto; +- interrupts : interrupt from ADV7180, must be <27 0x8> on SabreAuto; +- interrupt-parent : must be <&gpio1> on SabreAuto; +- inputs : list of input mux values, must be 0x00 followed by + 0x02 on SabreAuto; +- input-names : names of the inputs; + +ADV7180 Endpoint Required properties: +- remote-endpoint : must connect to parallel sensor interface input endpoint + on ipu1_csi0 video mux (ipu1_csi0_mux_from_parallel_sensor). +- bus-width : must be 8; + + +SabreSD Quad with OV5642 and MIPI CSI-2 OV5640 +---------------------------------------------- + +Similarly to SabreLite, the SabreSD supports a parallel interface +OV5642 module on IPU1 CSI0, and a MIPI CSI-2 OV5640 module. The OV5642 +connects to i2c bus 1 (i2c1) and the OV5640 to i2c bus 2 (i2c2). + +OV5640 and OV5642 properties are as described above on SabreLite. + +The OV5642 support has not been tested yet due to lack of hardware, +so only OV5640 is enabled in the device tree at this time.
Documentation/media/v4l-drivers/imx.rst new file +429 -0
429 lines not on this page · raw message
drivers/staging/media/Kconfig +2 -0
@@ -25,6 +25,8 @@ source "drivers/staging/media/cxd2099/Kconfig" source "drivers/staging/media/davinci_vpfe/Kconfig" +source "drivers/staging/media/imx/Kconfig" + source "drivers/staging/media/omap4iss/Kconfig" source "drivers/staging/media/s5p-cec/Kconfig"
drivers/staging/media/Makefile +1 -0
@@ -1,6 +1,7 @@ obj-$(CONFIG_I2C_BCM2048) += bcm2048/ obj-$(CONFIG_VIDEO_SAMSUNG_S5P_CEC) += s5p-cec/ obj-$(CONFIG_DVB_CXD2099) += cxd2099/ +obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx/ obj-$(CONFIG_LIRC_STAGING) += lirc/ obj-$(CONFIG_VIDEO_DM365_VPFE) += davinci_vpfe/ obj-$(CONFIG_VIDEO_OMAP4) += omap4iss/
drivers/staging/media/imx/Kconfig new file +8 -0
@@ -0,0 +1,8 @@ +config VIDEO_IMX_MEDIA + tristate "i.MX5/6 V4L2 media core driver" + depends on MEDIA_CONTROLLER && VIDEO_V4L2 && ARCH_MXC && IMX_IPUV3_CORE + default y + ---help--- + Say yes here to enable support for video4linux media controller + driver for the i.MX5/6 SOC. +
drivers/staging/media/imx/Makefile new file +6 -0
@@ -0,0 +1,6 @@ +imx-media-objs := imx-media-dev.o imx-media-fim.o imx-media-internal-sd.o \ + imx-media-of.o + +obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media.o +obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-common.o +
drivers/staging/media/imx/TODO new file +18 -0
@@ -0,0 +1,18 @@ + +- v4l2-compliance + +- imx-csi subdev is not being autoloaded as a kernel module, probably + because ipu_add_client_devices() does not register the IPU client + platform devices, but only allocates those devices. + +- Verify driver remove paths. + +- Currently registering with notifications from subdevs are only + available through the subdev device nodes and not through the main + capture device node. Need to come up with a way to find the camif in + the current pipeline that owns the subdev that sent the notify. + +- Need to decide whether a mem2mem device should be incorporated into + the media graph, or whether it should be a separate device that does + not link with any other entities. +
drivers/staging/media/imx/imx-media-common.c new file +981 -0
981 lines not on this page · raw message
drivers/staging/media/imx/imx-media-dev.c new file +479 -0
479 lines not on this page · raw message
drivers/staging/media/imx/imx-media-fim.c new file +508 -0
508 lines not on this page · raw message
drivers/staging/media/imx/imx-media-internal-sd.c new file +456 -0
351 lines not on this page · raw message
drivers/staging/media/imx/imx-media-of.c new file +291 -0
291 lines not on this page · raw message
drivers/staging/media/imx/imx-media-of.h new file +25 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/imx/imx-media.h new file +290 -0
290 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.7.4
Part of the diff is not shown here. View the raw message.
Rob Herring
maintainerRe: [PATCH 11/20] media: Add i.MX media core driver
Quoted 59 lines · Steve Longerbeam
Add the core media driver for i.MX SOC.
Signed-off-by Steve Longerbeam <[email protected]>--- Documentation/devicetree/bindings/media/imx.txt | 205 +++++ Documentation/media/v4l-drivers/imx.rst | 429 ++++++++++ drivers/staging/media/Kconfig | 2 + drivers/staging/media/Makefile | 1 + drivers/staging/media/imx/Kconfig | 8 + drivers/staging/media/imx/Makefile | 6 + drivers/staging/media/imx/TODO | 18 + drivers/staging/media/imx/imx-media-common.c | 981 ++++++++++++++++++++++ drivers/staging/media/imx/imx-media-dev.c | 479 +++++++++++ drivers/staging/media/imx/imx-media-fim.c | 508 +++++++++++ drivers/staging/media/imx/imx-media-internal-sd.c | 456 ++++++++++ drivers/staging/media/imx/imx-media-of.c | 291 +++++++ drivers/staging/media/imx/imx-media-of.h | 25 + drivers/staging/media/imx/imx-media.h | 290 +++++++ include/media/imx.h | 15 + include/uapi/Kbuild | 1 + include/uapi/linux/v4l2-controls.h | 4 + include/uapi/media/Kbuild | 2 + include/uapi/media/imx.h | 30 + 19 files changed, 3751 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/imx.txt create mode 100644 Documentation/media/v4l-drivers/imx.rst create mode 100644 drivers/staging/media/imx/Kconfig create mode 100644 drivers/staging/media/imx/Makefile create mode 100644 drivers/staging/media/imx/TODO create mode 100644 drivers/staging/media/imx/imx-media-common.c create mode 100644 drivers/staging/media/imx/imx-media-dev.c create mode 100644 drivers/staging/media/imx/imx-media-fim.c create mode 100644 drivers/staging/media/imx/imx-media-internal-sd.c create mode 100644 drivers/staging/media/imx/imx-media-of.c create mode 100644 drivers/staging/media/imx/imx-media-of.h create mode 100644 drivers/staging/media/imx/imx-media.h create mode 100644 include/media/imx.h create mode 100644 include/uapi/media/Kbuild create mode 100644 include/uapi/media/imx.hDocumentation/devicetree/bindings/media/imx.txt new file +13
-0@@ -0,0 +1,205 @@ +Freescale i.MX Media Video Devices + +Video Media Controller node +--------------------------- + +This is the parent media controller node for video capture support. + +Required properties: +- compatible : "fsl,imx-media"; +- ports : Should contain a list of phandles pointing to camera + sensor interface ports of IPU devices + +
Documentation/devicetree/bindings/media/imx.txt line 23
Quoted 10 lines
Documentation/devicetree/bindings/media/imx.txt new file +10
-0+fim child node +-------------- + +This is an optional child node of the ipu_csi port nodes. It can be used +to modify the default control values for the video capture Frame +Interval Monitor. Refer to Documentation/media/v4l-drivers/imx.rst for +more info on the Frame Interval Monitor. + +Optional properties: +- enable : enable (1) or disable (0) the FIM;
"status" property doesn't work for you?
Documentation/devicetree/bindings/media/imx.txt line 33
Quoted 10 lines
Documentation/devicetree/bindings/media/imx.txt new file +10
-0+- num-avg : how many frame intervals the FIM will average; +- num-skip : how many frames the FIM will skip after a video + capture restart before beginning to sample frame + intervals; +- tolerance-range : a range of tolerances for the averaged frame + interval error, specified as <min max>, in usec. + The FIM will signal a frame interval error if + min < error < max. If the max is <= min, then + tolerance range is disabled (interval error if + error > min).
Needs a unit suffix (see property-units.txt).
Documentation/devicetree/bindings/media/imx.txt line 34
Quoted 1 line
Documentation/devicetree/bindings/media/imx.txt new file +1
-0+- input-capture-channel: an input capture channel and channel flags,
These all need vendor prefix.
Quoted 14 lines
Documentation/devicetree/bindings/media/imx.txt new file +14
-0+ specified as <chan flags>. The channel number + must be 0 or 1. The flags can be + IRQ_TYPE_EDGE_RISING, IRQ_TYPE_EDGE_FALLING, or + IRQ_TYPE_EDGE_BOTH, and specify which input + capture signal edge will trigger the event. If + an input capture channel is specified, the FIM + will use this method to measure frame intervals + instead of via the EOF interrupt. The input capture + method is much preferred over EOF as it is not + subject to interrupt latency errors. However it + requires routing the VSYNC or FIELD output + signals of the camera sensor to one of the + i.MX input capture pads (SD1_DAT0, SD1_DAT1), + which also gives up support for SD1.
Documentation/devicetree/bindings/media/imx.txt line 58
Quoted 10 lines
Documentation/devicetree/bindings/media/imx.txt new file +10
-0+ + +mipi_csi2 node +-------------- + +This is the device node for the MIPI CSI-2 Receiver, required for MIPI +CSI-2 sensors. + +Required properties: +- compatible : "fsl,imx-mipi-csi2";
This needs to be an SoC specific compatible string.
Documentation/devicetree/bindings/media/imx.txt line 62
Quoted 4 lines
Documentation/devicetree/bindings/media/imx.txt new file +4
-0+- reg : physical base address and length of the register set; +- clocks : the MIPI CSI-2 receiver requires three clocks: hsi_tx + (the DPHY clock), video_27m, and eim_sel; +- clock-names : must contain "dphy_clk", "cfg_clk", "pix_clk";
"_clk" is redundant.
Documentation/devicetree/bindings/media/imx.txt line 75
Quoted 13 lines
Documentation/devicetree/bindings/media/imx.txt new file +13
-0+ +Optional properties: +- interrupts : must contain two level-triggered interrupts, + in order: 100 and 101; + + +video mux node +-------------- + +This is the device node for the video multiplexer. It can control +either the i.MX internal video mux that selects between parallel image +sensors and MIPI CSI-2 virtual channels, or an external mux controlled +by a GPIO. It must be a child device of the syscon GPR device.
These sound like 2 completely separate things and should not both be "imx-video-mux".
Documentation/devicetree/bindings/media/imx.txt line 78
Quoted 3 lines
Documentation/devicetree/bindings/media/imx.txt new file +3
-0+ +Required properties: +- compatible : "imx-video-mux";
Needs to be SoC specific.
Documentation/devicetree/bindings/media/imx.txt line 80
Quoted 2 lines
Documentation/devicetree/bindings/media/imx.txt new file +2
-0+- sink-ports : the number of sink (input) ports that follow +- ports : at least 2 sink ports must be specified that define
OF graph already provides a way to handle a mux. Multiple endpoints for an input port is a mux (or some kind of mixer). It depends on the definition of the port which depends on the parent compatible string.
Documentation/devicetree/bindings/media/imx.txt line 87
Quoted 7 lines
Documentation/devicetree/bindings/media/imx.txt new file +7
-0+ the endpoint inputs to the video mux, and there must + be exactly one output port endpoint which must be the + last port endpoint defined; + +Optional properties: +- reg : the GPR iomuxc register offset and bitmask of the + internal mux bits;
This should not be optional.
Documentation/devicetree/bindings/media/imx.txt line 93
Quoted 6 lines
Documentation/devicetree/bindings/media/imx.txt new file +6
-0+- mux-gpios : if reg is not specified, this must exist to define + a GPIO to control an external mux; + + +SabreLite Quad with OV5642 and OV5640 +-------------------------------------
Don't put board specifics in here. I assume these sensors are already documented?
Quoted 21 lines
Documentation/devicetree/bindings/media/imx.txt new file +21
-0+ +On the Sabrelite, the OV5642 module is connected to the parallel bus +input on the i.MX internal video mux to IPU1 CSI0. It's i2c bus connects +to i2c bus 2, so the ov5642 sensor node must be a child of i2c2. + +The MIPI CSI-2 OV5640 module is connected to the i.MX internal MIPI CSI-2 +receiver, and the four virtual channel outputs from the receiver are +routed as follows: vc0 to the IPU1 CSI0 mux, vc1 directly to IPU1 CSI1, +vc2 directly to IPU2 CSI0, and vc3 to the IPU2 CSI1 mux. The OV5640 is +also connected to i2c bus 2 on the SabreLite, so it also must be a child +of i2c2. Therefore the OV5642 and OV5640 must not share the same i2c slave +address. + +OV5642 Required properties: +- compatible : "ovti,ov5642"; +- clocks : the OV5642 system clock (cko2, 200 on Sabrelite); +- clock-names : must be "xclk"; +- reg : i2c slave address (must not be default 0x3c on Sabrelite); +- xclk : the system clock frequency (24000000 on Sabrelite); +- reset-gpios : gpio for the reset pin to OV5642 +- pwdn-gpios : gpio for the powewr-down pin to OV5642
Documentation/devicetree/bindings/media/imx.txt line 124
Quoted 10 lines
Documentation/devicetree/bindings/media/imx.txt new file +10
-0+ +OV5642 Endpoint Required properties: +- remote-endpoint : must connect to parallel sensor interface input endpoint + on ipu1_csi0 video mux (ipu1_csi0_mux_from_parallel_sensor). +- bus-width : must be 8; +- hsync-active : must be 1; +- vsync-active : must be 1; + +OV5640 Required properties: +- compatible : "ovti,ov5640_mipi";
The "mipi" part is implied by the type of sensor or the graph connection.
Quoted 81 lines
Documentation/devicetree/bindings/media/imx.txt new file +81
-0+- clocks : the OV5640 system clock (pwm3 on Sabrelite); +- clock-names : must be "xclk"; +- reg : i2c slave address (must not be default 0x3c on Sabrelite); +- xclk : the system clock frequency (22000000 on Sabrelite); +- reset-gpios : gpio for the reset pin to OV5640 +- pwdn-gpios : gpio for the power-down pin to OV5640 + +OV5640 MIPI CSI-2 Endpoint Required properties: +- remote-endpoint : must connect to mipi_csi receiver input endpoint + (mipi_csi_from_mipi_sensor). +- reg : the MIPI CSI-2 virtual channel to transmit over; +- data-lanes : must be <0 1>; +- clock-lanes : must be <2>; + +OV5640/OV5642 Optional properties: +- DOVDD-supply : DOVDD regulator supply; +- AVDD-supply : AVDD regulator supply; +- DVDD-supply : DVDD regulator supply; + + +SabreAuto Quad with ADV7180 +--------------------------- + +On the SabreAuto, an on-board ADV7180 SD decoder is connected to the +parallel bus input on the internal video mux to IPU1 CSI0. + +Two analog video inputs are routed to the ADV7180 on the SabreAuto, +composite on Ain1, and composite on Ain3. Those inputs are defined +via inputs and input-names properties in the ADV7180 device node. + +Regulators and port expanders are required for the ADV7180 (power pin +is via port expander gpio on i2c3). The reset pin to the port expander +chip (MAX7310) is controlled by a gpio, so a reset-gpios property must +be defined under the port expander node to control it. + +The sabreauto uses a steering pin to select between the SDA signal on +i2c3 bus, and a data-in pin for an SPI NOR chip. i2cmux can be used to +control this steering pin. Idle state of the i2cmux selects SPI NOR. +This is not classic way to use i2cmux, since one side of the mux selects +something other than an i2c bus, but it works and is probably the cleanest +solution. Note that if one thread is attempting to access SPI NOR while +another thread is accessing i2c3, the SPI NOR access will fail since the +i2cmux has selected the SDA pin rather than SPI NOR data-in. This couldn't +be avoided in any case, the board is not designed to allow concurrent +i2c3 and SPI NOR functions (and the default device-tree does not enable +SPI NOR anyway). + +ADV7180 Required properties: +- compatible : "adi,adv7180"; +- reg : must be 0x21; + +ADV7180 Optional properties: +- DOVDD-supply : DOVDD regulator supply; +- AVDD-supply : AVDD regulator supply; +- DVDD-supply : DVDD regulator supply; +- PVDD-supply : PVDD regulator supply; +- pwdn-gpios : gpio to control ADV7180 power pin, must be + <&port_exp_b 2 GPIO_ACTIVE_LOW> on SabreAuto; +- interrupts : interrupt from ADV7180, must be <27 0x8> on SabreAuto; +- interrupt-parent : must be <&gpio1> on SabreAuto; +- inputs : list of input mux values, must be 0x00 followed by + 0x02 on SabreAuto; +- input-names : names of the inputs; + +ADV7180 Endpoint Required properties: +- remote-endpoint : must connect to parallel sensor interface input endpoint + on ipu1_csi0 video mux (ipu1_csi0_mux_from_parallel_sensor). +- bus-width : must be 8; + + +SabreSD Quad with OV5642 and MIPI CSI-2 OV5640 +---------------------------------------------- + +Similarly to SabreLite, the SabreSD supports a parallel interface +OV5642 module on IPU1 CSI0, and a MIPI CSI-2 OV5640 module. The OV5642 +connects to i2c bus 1 (i2c1) and the OV5640 to i2c bus 2 (i2c2). + +OV5640 and OV5642 properties are as described above on SabreLite. + +The OV5642 support has not been tested yet due to lack of hardware, +so only OV5640 is enabled in the device tree at this time.
Re: [PATCH 11/20] media: Add i.MX media core driver
Hi Rob,
Quoted 63 lines · Rob Herring
Quoted 62 lines · Steve Longerbeam
Add the core media driver for i.MX SOC.
Signed-off-by Steve Longerbeam<[email protected]>--- Documentation/devicetree/bindings/media/imx.txt | 205 +++++ Documentation/media/v4l-drivers/imx.rst | 429 ++++++++++ drivers/staging/media/Kconfig | 2 + drivers/staging/media/Makefile | 1 + drivers/staging/media/imx/Kconfig | 8 + drivers/staging/media/imx/Makefile | 6 + drivers/staging/media/imx/TODO | 18 + drivers/staging/media/imx/imx-media-common.c | 981 ++++++++++++++++++++++ drivers/staging/media/imx/imx-media-dev.c | 479 +++++++++++ drivers/staging/media/imx/imx-media-fim.c | 508 +++++++++++ drivers/staging/media/imx/imx-media-internal-sd.c | 456 ++++++++++ drivers/staging/media/imx/imx-media-of.c | 291 +++++++ drivers/staging/media/imx/imx-media-of.h | 25 + drivers/staging/media/imx/imx-media.h | 290 +++++++ include/media/imx.h | 15 + include/uapi/Kbuild | 1 + include/uapi/linux/v4l2-controls.h | 4 + include/uapi/media/Kbuild | 2 + include/uapi/media/imx.h | 30 + 19 files changed, 3751 insertions(+)create mode 100644
Documentation/devicetree/bindings/media/imx.txtcreate mode 100644Documentation/media/v4l-drivers/imx.rstcreate mode 100644drivers/staging/media/imx/Kconfigcreate mode 100644drivers/staging/media/imx/Makefilecreate mode 100644drivers/staging/media/imx/TODO
create mode 100644drivers/staging/media/imx/imx-media-common.ccreate mode 100644drivers/staging/media/imx/imx-media-dev.ccreate mode 100644drivers/staging/media/imx/imx-media-fim.ccreate mode 100644drivers/staging/media/imx/imx-media-internal-sd.ccreate mode 100644drivers/staging/media/imx/imx-media-of.ccreate mode 100644drivers/staging/media/imx/imx-media-of.hcreate mode 100644drivers/staging/media/imx/imx-media.hcreate mode 100644include/media/imx.h
create mode 100644include/uapi/media/Kbuild
create mode 100644include/uapi/media/imx.hDocumentation/devicetree/bindings/media/imx.txt new file +16
-0@@ -0,0 +1,205 @@ +Freescale i.MX Media Video Devices + +Video Media Controller node +--------------------------- + +This is the parent media controller node for video capture support. + +Required properties: +- compatible : "fsl,imx-media"; +- ports : Should contain a list of phandles pointing to camera + sensor interface ports of IPU devices + + +fim child node +-------------- +
Quoted 8 lines
Documentation/devicetree/bindings/media/imx.txt line 23
Quoted 7 lines
Documentation/devicetree/bindings/media/imx.txt new file +7
-0+This is an optional child node of the ipu_csi port nodes. It can be used +to modify the default control values for the video capture Frame +Interval Monitor. Refer to Documentation/media/v4l-drivers/imx.rst for +more info on the Frame Interval Monitor. + +Optional properties: +- enable : enable (1) or disable (0) the FIM;"status" property doesn't work for you?
The use of the status property could make sense in this case, i.e. status = "disabled" would mean the FIM is disabled permanently (can never be enabled at run-time). But the "enable" property, and all the other FIM properties, are meant to override the v4l2 control default values. So "enable = <0>" means the FIM is disabled by default but can be enabled using the v4l2 control.
Quoted 11 lines
Documentation/devicetree/bindings/media/imx.txt line 33
Quoted 10 lines
Documentation/devicetree/bindings/media/imx.txt new file +10
-0+- num-avg : how many frame intervals the FIM will average; +- num-skip : how many frames the FIM will skip after a video + capture restart before beginning to sample frame + intervals; +- tolerance-range : a range of tolerances for the averaged frame + interval error, specified as <min max>, in usec. + The FIM will signal a frame interval error if + min < error < max. If the max is <= min, then + tolerance range is disabled (interval error if + error > min).Needs a unit suffix (see property-units.txt).
right, thanks.
Quoted 2 lines
Documentation/devicetree/bindings/media/imx.txt line 34
Quoted 1 line
Documentation/devicetree/bindings/media/imx.txt new file +1
-0+- input-capture-channel: an input capture channel and channel flags,These all need vendor prefix.
Ok.
Quoted 17 lines
Quoted 17 lines
Documentation/devicetree/bindings/media/imx.txt new file +17
-0+ specified as <chan flags>. The channel number + must be 0 or 1. The flags can be + IRQ_TYPE_EDGE_RISING, IRQ_TYPE_EDGE_FALLING, or + IRQ_TYPE_EDGE_BOTH, and specify which input + capture signal edge will trigger the event. If + an input capture channel is specified, the FIM + will use this method to measure frame intervals + instead of via the EOF interrupt. The input capture + method is much preferred over EOF as it is not + subject to interrupt latency errors. However it + requires routing the VSYNC or FIELD output + signals of the camera sensor to one of the + i.MX input capture pads (SD1_DAT0, SD1_DAT1), + which also gives up support for SD1. + + +mipi_csi2 node
Quoted 8 lines
Documentation/devicetree/bindings/media/imx.txt line 58
Quoted 7 lines
Documentation/devicetree/bindings/media/imx.txt new file +7
-0+-------------- + +This is the device node for the MIPI CSI-2 Receiver, required for MIPI +CSI-2 sensors. + +Required properties: +- compatible : "fsl,imx-mipi-csi2";This needs to be an SoC specific compatible string.
changed to "fsl,imx6-mipi-csi2".
Quoted 5 lines
Documentation/devicetree/bindings/media/imx.txt line 62
Quoted 4 lines
Documentation/devicetree/bindings/media/imx.txt new file +4
-0+- reg : physical base address and length of the register set; +- clocks : the MIPI CSI-2 receiver requires three clocks: hsi_tx + (the DPHY clock), video_27m, and eim_sel; +- clock-names : must contain "dphy_clk", "cfg_clk", "pix_clk";"
_clk" is redundant.
fixed.
Quoted 7 lines
Quoted 7 lines
Documentation/devicetree/bindings/media/imx.txt new file +7
-0+ +Optional properties: +- interrupts : must contain two level-triggered interrupts, + in order: 100 and 101; + + +video mux node
Quoted 8 lines
Documentation/devicetree/bindings/media/imx.txt line 75
Quoted 6 lines
Documentation/devicetree/bindings/media/imx.txt new file +6
-0+-------------- + +This is the device node for the video multiplexer. It can control +either the i.MX internal video mux that selects between parallel image +sensors and MIPI CSI-2 virtual channels, or an external mux controlled +by a GPIO. It must be a child device of the syscon GPR device.These sound like 2 completely separate things and should not both be "imx-video-mux".
I ended up bringing in Philipp Zabel's patch that adds the OF graph for video capture. In his version, the video mux device is a child of the gpr device, and the gpr device is made a multi-function device ("simple-mfd"). I had my own version of an OF graph for imx video capture that did not do this but referred to the controlling gpr device by phandle. To clear things up I could simply restate that it is "a child device of the syscon GPR multi-function device". Or go back to referring to the gpr by phandle. Or maybe I misunderstood your comment.
Quoted 4 lines
Documentation/devicetree/bindings/media/imx.txt line 78
Quoted 3 lines
Documentation/devicetree/bindings/media/imx.txt new file +3
-0+ +Required properties: +- compatible : "imx-video-mux";Needs to be SoC specific.
Actually, the video mux subdev has no imx specifics. It uses generic syscon regmap or gpio to do its work. The video mux subdev driver from Philipp that I brought in is an old one. He just posted a new one that explicitly makes the video mux driver a generic subdev, which I agree makes sense and will bring in.
Quoted 10 lines
<snip>
Documentation/devicetree/bindings/media/imx.txt line 93
Quoted 6 lines
+- mux-gpios : if reg is not specified, this must exist to define
Documentation/devicetree/bindings/media/imx.txt new file +5
-0+ a GPIO to control an external mux; + + +SabreLite Quad with OV5642 and OV5640 +-------------------------------------Don't put board specifics in here. I assume these sensors are already documented?
The adv7180 is documented already at Documentation/devicetree/bindings/media/i2c/adv7180.txt, so I'll add some missing properties to that.
There is no binding docs yet for the OV564x. Part of work to be done is to combine, clean up, and move the ov5640/ov5642 subdevs in drivers/media/i2c. Once that is done the binding docs for ov564x can be created under Documentation/devicetree/bindings/media/i2c.
Steve
Steve Longerbeam
maintainerPATCH 12/20 media: imx: Add CSI subdev driver
In reply to Steve LongerbeamThis is a media entity subdevice for the i.MX Camera Serial Interface module.
--- drivers/staging/media/imx/Kconfig | 13 + drivers/staging/media/imx/Makefile | 2 + drivers/staging/media/imx/imx-csi.c | 638 ++++++++++++++++++++++++++++++++++++ 3 files changed, 653 insertions(+) create mode 100644 drivers/staging/media/imx/imx-csi.c
drivers/staging/media/imx/Kconfig +13 -0
@@ -6,3 +6,16 @@ config VIDEO_IMX_MEDIA Say yes here to enable support for video4linux media controller driver for the i.MX5/6 SOC. +if VIDEO_IMX_MEDIA +menu "i.MX5/6 Media Sub devices" + +config VIDEO_IMX_CAMERA + tristate "i.MX5/6 Camera driver" + depends on VIDEO_IMX_MEDIA && VIDEO_DEV && I2C + select VIDEOBUF2_DMA_CONTIG + default y + ---help--- + A video4linux camera capture driver for i.MX5/6. + +endmenu +endif
drivers/staging/media/imx/Makefile +2 -0
@@ -4,3 +4,5 @@ imx-media-objs := imx-media-dev.o imx-media-fim.o imx-media-internal-sd.o \ obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-common.o +obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o +
drivers/staging/media/imx/imx-csi.c new file +638 -0
638 lines not on this page · raw message
Signature · 1 line
2.7.4
Steve Longerbeam
maintainerPATCH 13/20 media: imx: Add SMFC subdev driver
In reply to Steve LongerbeamThis is a media entity subdevice driver for the i.MX Sensor Multi-FIFO Controller module. Video frames are received from the CSI and can be routed to various sinks including the i.MX Image Converter for scaling, color-space conversion, motion compensated deinterlacing, and image rotation.
--- drivers/staging/media/imx/Makefile | 1 + drivers/staging/media/imx/imx-smfc.c | 739 +++++++++++++++++++++++++++++++++++ 2 files changed, 740 insertions(+) create mode 100644 drivers/staging/media/imx/imx-smfc.c
drivers/staging/media/imx/Makefile +1 -0
@@ -5,4 +5,5 @@ obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-common.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o +obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o
drivers/staging/media/imx/imx-smfc.c new file +739 -0
739 lines not on this page · raw message
Signature · 1 line
2.7.4
Steve Longerbeam
maintainerPATCH 14/20 media: imx: Add IC subdev drivers
In reply to Steve LongerbeamThis is a set of three media entity subdevice drivers for the i.MX Image Converter. The i.MX IC module contains three independent "tasks":
- Pre-processing Encode task: video frames are routed directly from the CSI and can be scaled, color-space converted, and rotated. Scaled output is limited to 1024x1024 resolution. Output frames can be routed to various sinks including the post-processing subdev task described below.
- Pre-processing Viewfinder task: this task can perform the same conversions as the pre-process encode task, but in addition can be used for hardware motion compensated deinterlacing. Frames can come either directly from the CSIs or from memory via IDMAC channels. Scaled output is limited to 1024x1024 resolution. Output frames can be routed to various sinks including the post-processing subdev task.
- Post-processing task: same conversions as pre-process encode. However this subdevice driver sends frames to the i.MX IPU image converter which supports image tiling, which allows scaled output up to 4096x4096 resolution. Output frames can be routed to the camera interface driver or a mem2mem driver.
--- drivers/staging/media/imx/Makefile | 2 + drivers/staging/media/imx/imx-ic-common.c | 113 +++ drivers/staging/media/imx/imx-ic-pp.c | 636 ++++++++++++++++ drivers/staging/media/imx/imx-ic-prpenc.c | 1037 +++++++++++++++++++++++++ drivers/staging/media/imx/imx-ic-prpvf.c | 1181 +++++++++++++++++++++++++++++ drivers/staging/media/imx/imx-ic.h | 36 + 6 files changed, 3005 insertions(+) create mode 100644 drivers/staging/media/imx/imx-ic-common.c create mode 100644 drivers/staging/media/imx/imx-ic-pp.c create mode 100644 drivers/staging/media/imx/imx-ic-prpenc.c create mode 100644 drivers/staging/media/imx/imx-ic-prpvf.c create mode 100644 drivers/staging/media/imx/imx-ic.h
drivers/staging/media/imx/Makefile +2 -0
@@ -1,8 +1,10 @@ imx-media-objs := imx-media-dev.o imx-media-fim.o imx-media-internal-sd.o \ imx-media-of.o +imx-ic-objs := imx-ic-common.o imx-ic-prpenc.o imx-ic-prpvf.o imx-ic-pp.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-common.o +obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-ic.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o
drivers/staging/media/imx/imx-ic-common.c new file +113 -0
113 lines not on this page · raw message
drivers/staging/media/imx/imx-ic-pp.c new file +636 -0
636 lines not on this page · raw message
drivers/staging/media/imx/imx-ic-prpenc.c new file +1037 -0
1,037 lines not on this page · raw message
drivers/staging/media/imx/imx-ic-prpvf.c new file +1181 -0
1,181 lines not on this page · raw message
drivers/staging/media/imx/imx-ic.h new file +36 -0
@@ -0,0 +1,36 @@ +/* +* V4L2 Image Converter Subdev for Freescale i.MX5/6 SOC +* +* Copyright (c) 2016 Mentor Graphics Inc. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ +#ifndef _IMX_IC_H +#define _IMX_IC_H + +struct imx_ic_priv { + struct device *dev; + struct v4l2_subdev sd; + int ipu_id; + int task_id; + void *task_priv; +}; + +struct imx_ic_ops { + struct v4l2_subdev_ops *subdev_ops;
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.7.4
Part of the diff is not shown here. View the raw message.
Steve Longerbeam
maintainerPATCH 15/20 media: imx: Add Camera Interface subdev driver
In reply to Steve LongerbeamThis is the camera interface driver that provides the v4l2 user interface. Frames can be received from various sources:
- directly from SMFC for capturing unconverted images directly from camera sensors.
- from the IC pre-process encode task.
- from the IC pre-process viewfinder task.
- from the IC post-process task.
--- drivers/staging/media/imx/Makefile | 2 +- drivers/staging/media/imx/imx-camif.c | 1011 +++++++++++++++++++++++++++++++++ 2 files changed, 1012 insertions(+), 1 deletion(-) create mode 100644 drivers/staging/media/imx/imx-camif.c
drivers/staging/media/imx/Makefile +1 -1
@@ -8,4 +8,4 @@ obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-ic.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o - +obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-camif.o
drivers/staging/media/imx/imx-camif.c new file +1011 -0
1,011 lines not on this page · raw message
Signature · 1 line
2.7.4
Steve Longerbeam
maintainerPATCH 16/20 media: imx: Add MIPI CSI-2 Receiver subdev driver
In reply to Steve LongerbeamAdds MIPI CSI-2 Receiver subdev driver. This subdev is required for sensors with a MIPI CSI2 interface.
--- drivers/staging/media/imx/Makefile | 1 + drivers/staging/media/imx/imx-mipi-csi2.c | 509 ++++++++++++++++++++++++++++++ 2 files changed, 510 insertions(+) create mode 100644 drivers/staging/media/imx/imx-mipi-csi2.c
drivers/staging/media/imx/Makefile +1 -0
@@ -9,3 +9,4 @@ obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-ic.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-camif.o +obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-mipi-csi2.o
drivers/staging/media/imx/imx-mipi-csi2.c new file +509 -0
509 lines not on this page · raw message
Signature · 1 line
2.7.4
Steve Longerbeam
maintainerPATCH 17/20 media: imx: Add video switch subdev driver
In reply to Steve LongerbeamFrom: Philipp Zabel <[email protected]>
This driver can handle SoC internal and extern video bus multiplexers, controlled either by register bit fields or by GPIO.
--- drivers/staging/media/imx/Makefile | 1 + drivers/staging/media/imx/imx-video-switch.c | 349 +++++++++++++++++++++++++++ 2 files changed, 350 insertions(+) create mode 100644 drivers/staging/media/imx/imx-video-switch.c
drivers/staging/media/imx/Makefile +1 -0
@@ -10,3 +10,4 @@ obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-camif.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-mipi-csi2.o +obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-video-switch.o
drivers/staging/media/imx/imx-video-switch.c new file +349 -0
349 lines not on this page · raw message
Signature · 1 line
2.7.4
Steve Longerbeam
maintainerPATCH 18/20 media: imx: Add MIPI CSI-2 OV5640 sensor subdev driver
In reply to Steve LongerbeamThis driver is based on ov5640_mipi.c from Freescale imx_3.10.17_1.0.0_beta branch, modified heavily to bring forward to latest interfaces and code cleanup.
--- drivers/staging/media/imx/Kconfig | 8 + drivers/staging/media/imx/Makefile | 2 + drivers/staging/media/imx/ov5640-mipi.c | 2349 +++++++++++++++++++++++++++++++ 3 files changed, 2359 insertions(+) create mode 100644 drivers/staging/media/imx/ov5640-mipi.c
drivers/staging/media/imx/Kconfig +8 -0
@@ -17,5 +17,13 @@ config VIDEO_IMX_CAMERA ---help--- A video4linux camera capture driver for i.MX5/6. +config IMX_OV5640_MIPI + tristate "OmniVision OV5640 MIPI CSI-2 camera support" + depends on GPIOLIB && VIDEO_IMX_CAMERA + select IMX_MIPI_CSI2 + default y + ---help--- + MIPI CSI-2 OV5640 Camera support. + endmenu endif
drivers/staging/media/imx/Makefile +2 -0
@@ -11,3 +11,5 @@ obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-camif.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-mipi-csi2.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-video-switch.o + +obj-$(CONFIG_IMX_OV5640_MIPI) += ov5640-mipi.o
drivers/staging/media/imx/ov5640-mipi.c new file +2349 -0
2,349 lines not on this page · raw message
Signature · 1 line
2.7.4
Steve Longerbeam
maintainerPATCH 19/20 media: imx: Add Parallel OV5642 sensor subdev driver
In reply to Steve LongerbeamThis driver is based on ov5642.c from Freescale imx_3.10.17_1.0.0_beta branch, modified heavily to bring forward to latest interfaces and code cleanup.
--- drivers/staging/media/imx/Kconfig | 7 + drivers/staging/media/imx/Makefile | 1 + drivers/staging/media/imx/ov5642.c | 4364 ++++++++++++++++++++++++++++++++++++ 3 files changed, 4372 insertions(+) create mode 100644 drivers/staging/media/imx/ov5642.c
drivers/staging/media/imx/Kconfig +7 -0
@@ -25,5 +25,12 @@ config IMX_OV5640_MIPI ---help--- MIPI CSI-2 OV5640 Camera support. +config IMX_OV5642 + tristate "OmniVision OV5642 Parallel camera support" + depends on GPIOLIB && VIDEO_IMX_CAMERA + default y + ---help--- + Parallel interface OV5642 camera support. + endmenu endif
drivers/staging/media/imx/Makefile +1 -0
@@ -13,3 +13,4 @@ obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-mipi-csi2.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-video-switch.o obj-$(CONFIG_IMX_OV5640_MIPI) += ov5640-mipi.o +obj-$(CONFIG_IMX_OV5642) += ov5642.o
drivers/staging/media/imx/ov5642.c new file +4364 -0
2,984 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.7.4
Part of the diff is not shown here. View the raw message.
Steve Longerbeam
maintainerPATCH 20/20 ARM: imx_v6_v7_defconfig: Enable staging video4linux drivers
In reply to Steve LongerbeamEnable imx v4l2 staging drivers. For video capture on the SabreAuto, the ADV7180 video decoder also requires the i2c-mux-gpio and the max7310 port expander. The Sabrelite requires PWM clocks for the OV5640.
--- arch/arm/configs/imx_v6_v7_defconfig | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
arch/arm/configs/imx_v6_v7_defconfig +9 -1
@@ -51,6 +51,7 @@ CONFIG_PREEMPT_VOLUNTARY=y CONFIG_AEABI=y CONFIG_HIGHMEM=y CONFIG_CMA=y +CONFIG_FORCE_MAX_ZONEORDER=14 CONFIG_CMDLINE="noinitrd console=ttymxc0,115200" CONFIG_KEXEC=y CONFIG_CPU_FREQ=y
@@ -181,6 +182,7 @@ CONFIG_SERIAL_FSL_LPUART=y CONFIG_SERIAL_FSL_LPUART_CONSOLE=y # CONFIG_I2C_COMPAT is not set CONFIG_I2C_CHARDEV=y +CONFIG_I2C_MUX=y CONFIG_I2C_MUX_GPIO=y # CONFIG_I2C_HELPER_AUTO is not set CONFIG_I2C_ALGOPCF=m
@@ -194,11 +196,11 @@ CONFIG_GPIO_SYSFS=y CONFIG_GPIO_MC9S08DZ60=y CONFIG_GPIO_PCA953X=y CONFIG_GPIO_STMPE=y -CONFIG_POWER_SUPPLY=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_IMX=y CONFIG_POWER_RESET_SYSCON=y CONFIG_POWER_RESET_SYSCON_POWEROFF=y +CONFIG_POWER_SUPPLY=y CONFIG_SENSORS_GPIO_FAN=y CONFIG_SENSORS_IIO_HWMON=y CONFIG_THERMAL=y
@@ -221,6 +223,8 @@ CONFIG_REGULATOR_PFUZE100=y CONFIG_MEDIA_SUPPORT=y CONFIG_MEDIA_CAMERA_SUPPORT=y CONFIG_MEDIA_RC_SUPPORT=y +CONFIG_MEDIA_CONTROLLER=y +CONFIG_VIDEO_V4L2_SUBDEV_API=y CONFIG_RC_DEVICES=y CONFIG_IR_GPIO_CIR=y CONFIG_MEDIA_USB_SUPPORT=y
@@ -229,6 +233,8 @@ CONFIG_V4L_PLATFORM_DRIVERS=y CONFIG_SOC_CAMERA=y CONFIG_V4L_MEM2MEM_DRIVERS=y CONFIG_VIDEO_CODA=y +# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set +CONFIG_VIDEO_ADV7180=m CONFIG_SOC_CAMERA_OV2640=y CONFIG_IMX_IPUV3_CORE=y CONFIG_DRM=y
@@ -338,6 +344,8 @@ CONFIG_FSL_EDMA=y CONFIG_IMX_SDMA=y CONFIG_MXS_DMA=y CONFIG_STAGING=y +CONFIG_STAGING_MEDIA=y +CONFIG_COMMON_CLK_PWM=y CONFIG_IIO=y CONFIG_VF610_ADC=y CONFIG_MPL3115=y
Signature · 1 line
2.7.4
Hi Steve,
Quoted 7 lines · Steve Longerbeam
This is a media driver for video capture on i.MX.
Refer to
Documentation/media/v4l-drivers/imx.rstfor example capture pipelines on SabreSD, SabreAuto, and SabreLite reference platforms.This patchset includes the OF graph layout as proposed by Philipp Zabel, with only minor changes which are enumerated in the patch header.
Patches 13, 14 and 19 miss your Signed-off-by tag.
Tested the whole series on a mx6qsabresd:
Hi Fabio,
Quoted 11 lines · Fabio Estevam
Hi Steve,
Quoted 7 lines · Steve Longerbeam
This is a media driver for video capture on i.MX.
Refer to
Documentation/media/v4l-drivers/imx.rstfor example capture pipelines on SabreSD, SabreAuto, and SabreLite reference platforms.This patchset includes the OF graph layout as proposed by Philipp Zabel, with only minor changes which are enumerated in the patch header.
Patches 13, 14 and 19 miss your Signed-off-by tag.
thanks for catching. I've added them to version 2.
Steve
Quoted 4 lines
Tested the whole series on a mx6qsabresd:
Tested-by Fabio Estevam <[email protected]>