Skip to content

Commit

Permalink
radxa cm3i io: modify camera config for dual cameras
Browse files Browse the repository at this point in the history
Signed-off-by: Alvin Xie <[email protected]>
  • Loading branch information
Radxa-Alvin committed Apr 11, 2024
1 parent 2fcf1d1 commit 64366ca
Show file tree
Hide file tree
Showing 6 changed files with 260 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,22 @@
};

&{/} {
ext_cam_clk_imx219: ext-cam-clk-imx219 {
ext_cam_clk_imx219_1: ext-cam-clk-imx219-1 {
status = "okay";
compatible = "fixed-clock";
clock-frequency = <24000000>;
clock-output-names = "ext_cam_clk_imx219";
clock-output-names = "ext_cam_clk_imx219_1";
#clock-cells = <0>;
};

camera_pwdn_gpio: camera-pwdn-gpio {
imx219_1_pwdn_gpio: imx219-1-pwdn-gpio {
status = "okay";
compatible = "regulator-fixed";
regulator-name = "camera_pwdn_gpio";
regulator-name = "imx219_1_pwdn_gpio";
regulator-always-on;
regulator-boot-on;
enable-active-high;
pwdn-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&cam_pwdn_gpio>;
gpio = <&gpio3 RK_PB0 GPIO_ACTIVE_HIGH>;
};
};

Expand All @@ -44,23 +42,19 @@
#address-cells = <1>;
#size-cells = <0>;

imx219: imx219@10 {
imx219_1: imx219-1@10 {
status = "okay";
compatible = "sony,imx219";
reg = <0x10>;

clocks = <&ext_cam_clk_imx219>;
clock-names = "ext_cam_clk_imx219";

rotation = <180>;

rockchip,camera-module-index = <1>;
rockchip,camera-module-facing = "back";
clocks = <&ext_cam_clk_imx219_1>;
clock-names = "xvclk";
rockchip,camera-module-index = <0>;
rockchip,camera-module-facing = "front";
rockchip,camera-module-name = "RADXA-CAMERA-8M";
rockchip,camera-module-lens-name = "default";

port {
imx219_out: endpoint {
imx219_1_out: endpoint {
remote-endpoint = <&csi2dphy1_uCAM1>;
data-lanes = <1 2>;
};
Expand All @@ -86,7 +80,7 @@

csi2dphy1_uCAM1: endpoint@1 {
reg = <1>;
remote-endpoint = <&imx219_out>;
remote-endpoint = <&imx219_1_out>;
data-lanes = <1 2>;
};
};
Expand Down Expand Up @@ -133,11 +127,3 @@
&rkcif {
status = "okay";
};

&pinctrl {
camera {
cam_pwdn_gpio: cam-pwdn-gpio {
rockchip,pins = <3 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,23 @@
};
};

&{/} {
ext_cam_clk_imx219: ext-cam-clk-imx219 {
&{/} {
ext_cam_clk_imx219_2: ext-cam-clk-imx219-2 {
status = "okay";
compatible = "fixed-clock";
clock-frequency = <24000000>;
clock-output-names = "ext_cam_clk_imx219";
clock-output-names = "ext_cam_clk_imx219_2";
#clock-cells = <0>;
};

camera_pwdn_gpio: camera-pwdn-gpio {
imx219_2_pwdn_gpio: imx219-2-pwdn-gpio {
status = "okay";
compatible = "regulator-fixed";
regulator-name = "camera_pwdn_gpio";
regulator-name = "imx219_2_pwdn_gpio";
regulator-always-on;
regulator-boot-on;
enable-active-high;
pwdn-gpios = <&gpio4 RK_PC5 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&cam_pwdn_gpio>;
gpio = <&gpio4 RK_PC5 GPIO_ACTIVE_HIGH>;
};
};

Expand All @@ -43,50 +41,43 @@

#address-cells = <1>;
#size-cells = <0>;

imx219: imx219@10 {
imx219_2: imx219-2@10 {
status = "okay";
compatible = "sony,imx219";
reg = <0x10>;

clocks = <&ext_cam_clk_imx219>;
clock-names = "ext_cam_clk_imx219";

rotation = <180>;

clocks = <&ext_cam_clk_imx219_2>;
clock-names = "xvclk";
rockchip,camera-module-index = <1>;
rockchip,camera-module-facing = "back";
rockchip,camera-module-name = "RADXA-CAMERA-8M";
rockchip,camera-module-lens-name = "default";

port {
imx219_out: endpoint {
imx219_2_out: endpoint {
remote-endpoint = <&csi2dphy2_uCAM2>;
data-lanes = <1 2>;
};
};
};
};

&csi2_dphy_hw {
&csi2_dphy_hw{
status = "okay";
};

&csi2_dphy2 {
status = "okay";

ports {
#address-cells = <1>;
#size-cells = <0>;

port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;

csi2dphy2_uCAM2: endpoint@1 {
reg = <1>;
remote-endpoint = <&imx219_out>;
remote-endpoint = <&imx219_2_out>;
data-lanes = <1 2>;
};
};
Expand All @@ -98,22 +89,73 @@

csi2dphy2_out: endpoint@1 {
reg = <1>;
remote-endpoint = <&isp0_in>;
remote-endpoint = <&mipi_csi2_input>;
};
};
};
};

&rkisp_vir0 {
&mipi_csi2 {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;

port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;

mipi_csi2_input: endpoint@1 {
reg = <1>;
remote-endpoint = <&csi2dphy2_out>;
data-lanes = <1 2>;
};
};

port@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
mipi_csi2_output: endpoint@0 {
reg = <0>;
remote-endpoint = <&cif_mipi_in>;
data-lanes = <1 2>;
};
};
};
};

&rkcif_mipi_lvds {
status = "okay";
port {
cif_mipi_in: endpoint {
remote-endpoint = <&mipi_csi2_output>;
data-lanes = <1 2>;
};
};
};

&rkcif_mipi_lvds_sditf {
status = "okay";
port {
mipi_lvds_sditf: endpoint {
remote-endpoint = <&isp1_in>;
data-lanes = <1 2>;
};
};
};

&rkisp_vir1 {
status = "okay";

port {
#address-cells = <1>;
#size-cells = <0>;

isp0_in: endpoint@0 {
isp1_in: endpoint@0 {
reg = <0>;
remote-endpoint = <&csi2dphy2_out>;
remote-endpoint = <&mipi_lvds_sditf>;
};
};
};
Expand All @@ -133,11 +175,3 @@
&rkcif {
status = "okay";
};

&pinctrl {
camera {
cam_pwdn_gpio: cam-pwdn-gpio {
rockchip,pins = <4 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

/ {
metadata {
title = "Enable Raspberry Pi Camera v1.3 on CAM1";
title = "Enable Raspberry Pi Camera v1.3 on CAM1.";
compatible = "radxa,cm3i-io";
category = "camera";
exclusive = "csi2_dphy1";
Expand All @@ -15,36 +15,47 @@
};

&{/} {
ext_cam_ov5647_clk: external-camera-ov5647-clock {
ext_cam_ov5647_clk_1: ext-cam-ov5647-clk-1 {
status = "okay";
compatible = "fixed-clock";
clock-frequency = <25000000>;
clock-output-names = "ext_cam_ov5647_clk";
clock-output-names = "ext_cam_ov5647_clk_1";
#clock-cells = <0>;
};

ov5647_1_pwdn_gpio: ov5647-1-pwdn-gpio {
status = "okay";
compatible = "regulator-fixed";
regulator-name = "ov5647_1_pwdn_gpio";
regulator-always-on;
regulator-boot-on;
enable-active-high;
gpio = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>;
};
};

&i2c0 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c0_xfer>;

#address-cells = <1>;
#size-cells = <0>;

ov5647: ov5647@36 {
ov5647_1: ov5647-1@36 {
status = "okay";
compatible = "ovti,ov5647";
reg = <0x36>;
clocks = <&ext_cam_ov5647_clk>;
clock-names = "ext_cam_ov5647_clk";
pwdn-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>;
clocks = <&ext_cam_ov5647_clk_1>;
clock-names = "xvclk";
rockchip,camera-module-index = <0>;
rockchip,camera-module-facing = "back";
rockchip,camera-module-facing = "front";
rockchip,camera-module-name = "rpi-camera-v1p3";
rockchip,camera-module-lens-name = "default";

port {
ov5647_out: endpoint {
remote-endpoint = <&csi2dphy1_ucam1>;
ov5647_1_out: endpoint {
remote-endpoint = <&csi2dphy1_uCAM1>;
data-lanes = <1 2>;
};
};
Expand All @@ -67,9 +78,9 @@
#address-cells = <1>;
#size-cells = <0>;

csi2dphy1_ucam1: endpoint@1 {
csi2dphy1_uCAM1: endpoint@1 {
reg = <1>;
remote-endpoint = <&ov5647_out>;
remote-endpoint = <&ov5647_1_out>;
data-lanes = <1 2>;
};
};
Expand Down
Loading

0 comments on commit 64366ca

Please sign in to comment.