ARM: dts: stm32: enable OV5640 camera on stm32mp157c-ev1 board
authorHugues Fruchet <hugues.fruchet@st.com>
Thu, 28 Feb 2019 14:25:45 +0000 (15:25 +0100)
committerAlexandre Torgue <alexandre.torgue@st.com>
Tue, 21 May 2019 09:57:31 +0000 (11:57 +0200)
Enable OV5640 camera sensor driver of MB1379A extension
board connected on CN7 connector of stm32mp157c-ev1 board:
bus-width is set to 8, data-shift is set to 2 (lines 9:2 are used),
hsync-active is set to 0 for horizontal synchro line active low,
vsync-active is set to 0 for vertical synchro line active low and
pclk-sample is set to 1 for pixel clock polarity sampling data
on rising edge of the pixel clock signal.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
arch/arm/boot/dts/stm32mp157c-ev1.dts

index d3acbb78f7540649f7ed5165bb57ddd9b0324f25..8ef2cb0f5a7df5adb208dc4b6e0ab540b61f93ef 100644 (file)
                ethernet0 = &ethernet0;
        };
 
+       clocks {
+               clk_ext_camera: clk-ext-camera {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <24000000>;
+               };
+       };
+
        joystick {
                compatible = "gpio-keys";
                #size-cells = <0>;
        status = "okay";
 };
 
+&dcmi {
+       status = "okay";
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&dcmi_pins_a>;
+       pinctrl-1 = <&dcmi_sleep_pins_a>;
+
+       port {
+               dcmi_0: endpoint {
+                       remote-endpoint = <&ov5640_0>;
+                       bus-width = <8>;
+                       hsync-active = <0>;
+                       vsync-active = <0>;
+                       pclk-sample = <1>;
+               };
+       };
+};
+
 &dsi {
        #address-cells = <1>;
        #size-cells = <0>;
        i2c-scl-falling-time-ns = <20>;
        status = "okay";
 
+       ov5640: camera@3c {
+               compatible = "ovti,ov5640";
+               pinctrl-names = "default";
+               pinctrl-0 = <&ov5640_pins>;
+               reg = <0x3c>;
+               clocks = <&clk_ext_camera>;
+               clock-names = "xclk";
+               DOVDD-supply = <&v2v8>;
+               powerdown-gpios = <&stmfx_pinctrl 18 GPIO_ACTIVE_HIGH>;
+               reset-gpios = <&stmfx_pinctrl 19 GPIO_ACTIVE_LOW>;
+               rotation = <180>;
+               status = "okay";
+
+               port {
+                       ov5640_0: endpoint {
+                               remote-endpoint = <&dcmi_0>;
+                               bus-width = <8>;
+                               data-shift = <2>; /* lines 9:2 are used */
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               pclk-sample = <1>;
+                       };
+               };
+       };
+
        stmfx: stmfx@42 {
                compatible = "st,stmfx-0300";
                reg = <0x42>;
                                drive-push-pull;
                                bias-pull-down;
                        };
+
+                       ov5640_pins: camera {
+                               pins = "agpio2", "agpio3"; /* stmfx pins 18 & 19 */
+                               drive-push-pull;
+                               output-low;
+                       };
                };
        };
 };