overlays: Add overlay for imx378 sensor
authorDavid Plowman <david.plowman@raspberrypi.com>
Tue, 29 Jun 2021 13:41:15 +0000 (14:41 +0100)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Tue, 29 Jun 2021 16:24:40 +0000 (17:24 +0100)
This is based off a common overlay which is now also used by the
imx477 sensor.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
arch/arm/boot/dts/overlays/Makefile
arch/arm/boot/dts/overlays/README
arch/arm/boot/dts/overlays/imx378-overlay.dts [new file with mode: 0644]
arch/arm/boot/dts/overlays/imx477-overlay.dts
arch/arm/boot/dts/overlays/imx477_378-overlay.dtsi [new file with mode: 0644]

index 7027e5f..05657a7 100644 (file)
@@ -94,6 +94,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
        ilitek251x.dtbo \
        imx219.dtbo \
        imx290.dtbo \
+       imx378.dtbo \
        imx477.dtbo \
        iqaudio-codec.dtbo \
        iqaudio-dac.dtbo \
index e9935e9..34befef 100644 (file)
@@ -1674,6 +1674,15 @@ Params: 4lane                   Enable 4 CSI2 lanes. This requires a Compute
         mono                    Denote that the module is a mono sensor.
 
 
+Name:   imx378
+Info:   Sony IMX378 camera module.
+        Uses Unicam 1, which is the standard camera connector on most Pi
+        variants.
+Load:   dtoverlay=imx378,<param>=<val>
+Params: rotation                Mounting rotation of the camera sensor (0 or
+                                180, default 180)
+
+
 Name:   imx477
 Info:   Sony IMX477 camera module.
         Uses Unicam 1, which is the standard camera connector on most Pi
diff --git a/arch/arm/boot/dts/overlays/imx378-overlay.dts b/arch/arm/boot/dts/overlays/imx378-overlay.dts
new file mode 100644 (file)
index 0000000..74c7288
--- /dev/null
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-only
+// Definitions for IMX378 camera module on VC I2C bus
+/dts-v1/;
+/plugin/;
+
+#include "imx477_378-overlay.dtsi"
+
+&imx477 {
+       compatible = "sony,imx378";
+};
index 0f1ebd2..ca315d1 100644 (file)
@@ -3,111 +3,8 @@
 /dts-v1/;
 /plugin/;
 
-#include <dt-bindings/gpio/gpio.h>
+#include "imx477_378-overlay.dtsi"
 
-/{
-       compatible = "brcm,bcm2835";
-
-       fragment@0 {
-               target = <&i2c_csi_dsi>;
-               __overlay__ {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       status = "okay";
-
-                       imx477: imx477@1a {
-                               compatible = "sony,imx477";
-                               reg = <0x1a>;
-                               status = "okay";
-
-                               clocks = <&imx477_clk>;
-                               clock-names = "xclk";
-
-                               VANA-supply = <&cam1_reg>;      /* 2.8v */
-                               VDIG-supply = <&imx477_vdig>;   /* 1.05v */
-                               VDDL-supply = <&imx477_vddl>;   /* 1.8v */
-
-                               rotation = <180>;
-
-                               port {
-                                       imx477_0: endpoint {
-                                               remote-endpoint = <&csi1_ep>;
-                                               clock-lanes = <0>;
-                                               data-lanes = <1 2>;
-                                               clock-noncontinuous;
-                                               link-frequencies =
-                                                       /bits/ 64 <450000000>;
-                                       };
-                               };
-                       };
-               };
-       };
-
-       fragment@1 {
-               target = <&csi1>;
-               __overlay__ {
-                       status = "okay";
-
-                       port {
-                               csi1_ep: endpoint {
-                                       remote-endpoint = <&imx477_0>;
-                                       clock-lanes = <0>;
-                                       data-lanes = <1 2>;
-                                       clock-noncontinuous;
-                               };
-                       };
-               };
-       };
-
-       fragment@2 {
-               target = <&i2c0if>;
-               __overlay__ {
-                       status = "okay";
-               };
-       };
-
-       fragment@3 {
-               target-path="/";
-               __overlay__ {
-                       imx477_vdig: fixedregulator@0 {
-                               compatible = "regulator-fixed";
-                               regulator-name = "imx477_vdig";
-                               regulator-min-microvolt = <1050000>;
-                               regulator-max-microvolt = <1050000>;
-                       };
-                       imx477_vddl: fixedregulator@1 {
-                               compatible = "regulator-fixed";
-                               regulator-name = "imx477_vddl";
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <1800000>;
-                       };
-                       imx477_clk: camera-clk {
-                               compatible = "fixed-clock";
-                               #clock-cells = <0>;
-                               clock-frequency = <24000000>;
-                       };
-               };
-       };
-
-       fragment@4 {
-               target = <&i2c0mux>;
-               __overlay__ {
-                       status = "okay";
-               };
-       };
-
-       fragment@5 {
-               target = <&cam1_reg>;
-               __overlay__ {
-                       status = "okay";
-                       regulator-name = "imx477_vana";
-                       startup-delay-us = <300000>;
-                       regulator-min-microvolt = <2800000>;
-                       regulator-max-microvolt = <2800000>;
-               };
-       };
-
-       __overrides__ {
-               rotation = <&imx477>,"rotation:0";
-       };
+&imx477 {
+       compatible = "sony,imx477";
 };
diff --git a/arch/arm/boot/dts/overlays/imx477_378-overlay.dtsi b/arch/arm/boot/dts/overlays/imx477_378-overlay.dtsi
new file mode 100644 (file)
index 0000000..4e44470
--- /dev/null
@@ -0,0 +1,108 @@
+// SPDX-License-Identifier: GPL-2.0-only
+// Definitions for IMX477 camera module on VC I2C bus
+
+/{
+       compatible = "brcm,bcm2835";
+
+       fragment@0 {
+               target = <&i2c_csi_dsi>;
+               __overlay__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
+
+                       imx477: imx477@1a {
+                               reg = <0x1a>;
+                               status = "okay";
+
+                               clocks = <&imx477_clk>;
+                               clock-names = "xclk";
+
+                               VANA-supply = <&cam1_reg>;      /* 2.8v */
+                               VDIG-supply = <&imx477_vdig>;   /* 1.05v */
+                               VDDL-supply = <&imx477_vddl>;   /* 1.8v */
+
+                               rotation = <180>;
+
+                               port {
+                                       imx477_0: endpoint {
+                                               remote-endpoint = <&csi1_ep>;
+                                               clock-lanes = <0>;
+                                               data-lanes = <1 2>;
+                                               clock-noncontinuous;
+                                               link-frequencies =
+                                                       /bits/ 64 <450000000>;
+                                       };
+                               };
+                       };
+               };
+       };
+
+       fragment@1 {
+               target = <&csi1>;
+               __overlay__ {
+                       status = "okay";
+
+                       port {
+                               csi1_ep: endpoint {
+                                       remote-endpoint = <&imx477_0>;
+                                       clock-lanes = <0>;
+                                       data-lanes = <1 2>;
+                                       clock-noncontinuous;
+                               };
+                       };
+               };
+       };
+
+       fragment@2 {
+               target = <&i2c0if>;
+               __overlay__ {
+                       status = "okay";
+               };
+       };
+
+       fragment@3 {
+               target-path="/";
+               __overlay__ {
+                       imx477_vdig: fixedregulator@0 {
+                               compatible = "regulator-fixed";
+                               regulator-name = "imx477_vdig";
+                               regulator-min-microvolt = <1050000>;
+                               regulator-max-microvolt = <1050000>;
+                       };
+                       imx477_vddl: fixedregulator@1 {
+                               compatible = "regulator-fixed";
+                               regulator-name = "imx477_vddl";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+                       imx477_clk: camera-clk {
+                               compatible = "fixed-clock";
+                               #clock-cells = <0>;
+                               clock-frequency = <24000000>;
+                       };
+               };
+       };
+
+       fragment@4 {
+               target = <&i2c0mux>;
+               __overlay__ {
+                       status = "okay";
+               };
+       };
+
+       fragment@5 {
+               target = <&cam1_reg>;
+               __overlay__ {
+                       status = "okay";
+                       regulator-name = "imx477_vana";
+                       startup-delay-us = <300000>;
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <2800000>;
+               };
+       };
+
+       __overrides__ {
+               rotation = <&imx477>,"rotation:0";
+       };
+};