Skip to content

Commit

Permalink
dtoverlays: Add VCM option to Arducam64MP
Browse files Browse the repository at this point in the history
VCM is enabled by default, but you can use 'vcm=off' to disable VCM support.

Signed-off-by: Lee Jackson <[email protected]>
  • Loading branch information
Lee Jackson authored and pelwell committed Mar 2, 2023
1 parent 2e66dac commit 744b8fc
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 32 deletions.
2 changes: 2 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,8 @@ Params: rotation Mounting rotation of the camera sensor (0 or
configuring the sensor (default on)
cam0 Adopt the default configuration for CAM0 on a
Compute Module (CSI0, i2c_vc, and cam0_reg).
vcm Select lens driver state. Default is enabled,
but vcm=off will disable.


Name: arducam-pivariety
Expand Down
61 changes: 29 additions & 32 deletions arch/arm/boot/dts/overlays/arducam-64mp-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,7 @@
#size-cells = <0>;
status = "okay";

arducam_64mp: arducam_64mp@1a {
compatible = "arducam,64mp";
reg = <0x1a>;
status = "okay";

clocks = <&cam1_clk>;
clock-names = "xclk";

VANA-supply = <&cam1_reg>; /* 2.8v */
VDIG-supply = <&cam_dummy_reg>; /* 1.8v */
VDDL-supply = <&cam_dummy_reg>; /* 1.2v */

rotation = <0>;
orientation = <2>;

port {
arducam_64mp_0: endpoint {
remote-endpoint = <&csi1_ep>;
clock-lanes = <0>;
data-lanes = <1 2>;
clock-noncontinuous;
link-frequencies =
/bits/ 64 <456000000>;
};
};
};
#include "arducam-64mp.dtsi"
};
};

Expand All @@ -49,8 +24,8 @@
brcm,media-controller;

port{
csi1_ep: endpoint{
remote-endpoint = <&arducam_64mp_0>;
csi_ep: endpoint{
remote-endpoint = <&cam_endpoint>;
clock-lanes = <0>;
data-lanes = <1 2>;
clock-noncontinuous;
Expand Down Expand Up @@ -81,14 +56,36 @@
};
};

fragment@5 {
target = <&cam_node>;
__overlay__ {
lens-focus = <&vcm_node>;
};
};

__overrides__ {
rotation = <&arducam_64mp>,"rotation:0";
orientation = <&arducam_64mp>,"orientation:0";
rotation = <&cam_node>,"rotation:0";
orientation = <&cam_node>,"orientation:0";
media-controller = <&csi>,"brcm,media-controller?";
cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
<&csi_frag>, "target:0=",<&csi0>,
<&clk_frag>, "target:0=",<&cam0_clk>,
<&arducam_64mp>, "clocks:0=",<&cam0_clk>,
<&arducam_64mp>, "VANA-supply:0=",<&cam0_reg>;
<&cam_node>, "clocks:0=",<&cam0_clk>,
<&cam_node>, "VANA-supply:0=",<&cam0_reg>,
<&vcm_node>, "VDD-supply:0=", <&cam0_reg>;
vcm = <&vcm_node>, "status",
<0>, "=5";
};
};

&cam_node {
status = "okay";
};

&cam_endpoint {
remote-endpoint = <&csi_ep>;
};

&vcm_node {
status = "okay";
};
34 changes: 34 additions & 0 deletions arch/arm/boot/dts/overlays/arducam-64mp.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Fragment that configures a Arducam64MP

cam_node: arducam_64mp@1a {
compatible = "arducam,64mp";
reg = <0x1a>;
status = "disabled";

clocks = <&cam1_clk>;
clock-names = "xclk";

VANA-supply = <&cam1_reg>; /* 2.8v */
VDIG-supply = <&cam_dummy_reg>; /* 1.8v */
VDDL-supply = <&cam_dummy_reg>; /* 1.2v */

rotation = <0>;
orientation = <2>;

port {
cam_endpoint: endpoint {
clock-lanes = <0>;
data-lanes = <1 2>;
clock-noncontinuous;
link-frequencies =
/bits/ 64 <456000000>;
};
};
};

vcm_node: dw9817_arducam64mp@c {
compatible = "dongwoon,dw9817-vcm";
reg = <0x0c>;
status = "disabled";
VDD-supply = <&cam1_reg>;
};

0 comments on commit 744b8fc

Please sign in to comment.