Skip to content

Commit ccbeaee

Browse files
kbinghampopcornmix
authored andcommitted
dtoverlays: Add overlay for the Sony IMX335 4-Lane camera
Provide support for the IMX335 sensor, which has upstream linux kernel drivers. Signed-off-by: Kieran Bingham <[email protected]>
1 parent 941622f commit ccbeaee

File tree

4 files changed

+158
-0
lines changed

4 files changed

+158
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
137137
imx290.dtbo \
138138
imx296.dtbo \
139139
imx327.dtbo \
140+
imx335.dtbo \
140141
imx378.dtbo \
141142
imx415.dtbo \
142143
imx462.dtbo \

arch/arm/boot/dts/overlays/README

+19
Original file line numberDiff line numberDiff line change
@@ -2826,6 +2826,25 @@ Params: 4lane Enable 4 CSI2 lanes. This requires a Compute
28262826
Compute Module (CSI0, i2c_vc, and cam0_reg).
28272827

28282828

2829+
Name: imx335
2830+
Info: Sony IMX335 camera module.
2831+
Uses Unicam 1, which is the standard camera connector on most Pi
2832+
variants.
2833+
Load: dtoverlay=imx335,<param>
2834+
Params: orientation Sensor orientation (0 = front, 1 = rear,
2835+
2 = external, default external)
2836+
rotation Mounting rotation of the camera sensor (0 or
2837+
180, default 0)
2838+
media-controller Configure use of Media Controller API for
2839+
configuring the sensor (default on)
2840+
link-frequency Allowable link frequency values to use in Hz:
2841+
594000000 (default), 445500000.
2842+
cam0 Adopt the default configuration for CAM0 on a
2843+
Compute Module (CSI0, i2c_vc, and cam0_reg).
2844+
4lane Enable 4 CSI2 lanes. This requires a Compute
2845+
Module (1, 3, 4, or 5) or Pi 5.
2846+
2847+
28292848
Name: imx378
28302849
Info: Sony IMX378 camera module.
28312850
Uses Unicam 1, which is the standard camera connector on most Pi
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
// Definitions for IMX335 camera module on VC I2C bus
3+
/dts-v1/;
4+
/plugin/;
5+
6+
#include <dt-bindings/gpio/gpio.h>
7+
8+
/{
9+
compatible = "brcm,bcm2835";
10+
11+
fragment@0 {
12+
target = <&i2c0if>;
13+
__overlay__ {
14+
status = "okay";
15+
};
16+
};
17+
18+
clk_frag: fragment@1 {
19+
target = <&cam1_clk>;
20+
__overlay__ {
21+
status = "okay";
22+
clock-frequency = <24000000>;
23+
};
24+
};
25+
26+
fragment@2 {
27+
target = <&i2c0mux>;
28+
__overlay__ {
29+
status = "okay";
30+
};
31+
};
32+
33+
reg_frag: fragment@3 {
34+
target = <&cam1_reg>;
35+
cam_reg: __overlay__ {
36+
startup-delay-us = <200000>;
37+
off-on-delay-us = <30000>;
38+
regulator-min-microvolt = <2900000>;
39+
regulator-max-microvolt = <2900000>;
40+
};
41+
};
42+
43+
i2c_frag: fragment@100 {
44+
target = <&i2c_csi_dsi>;
45+
__overlay__ {
46+
#address-cells = <1>;
47+
#size-cells = <0>;
48+
status = "okay";
49+
50+
#include "imx335.dtsi"
51+
};
52+
};
53+
54+
csi_frag: fragment@101 {
55+
target = <&csi1>;
56+
csi: __overlay__ {
57+
status = "okay";
58+
59+
port {
60+
csi_ep: endpoint {
61+
remote-endpoint = <&cam_endpoint>;
62+
clock-lanes = <0>;
63+
data-lanes = <1 2>;
64+
};
65+
};
66+
};
67+
};
68+
69+
fragment@102 {
70+
target = <&csi1>;
71+
__dormant__ {
72+
compatible = "brcm,bcm2835-unicam-legacy";
73+
};
74+
};
75+
76+
fragment@201 {
77+
target = <&csi_ep>;
78+
__dormant__ {
79+
data-lanes = <1 2 3 4>;
80+
};
81+
};
82+
83+
fragment@202 {
84+
target = <&cam_endpoint>;
85+
__dormant__ {
86+
data-lanes = <1 2 3 4>;
87+
};
88+
};
89+
90+
__overrides__ {
91+
rotation = <&cam_node>,"rotation:0";
92+
orientation = <&cam_node>,"orientation:0";
93+
media-controller = <0>,"!102";
94+
95+
cam0 = <&i2c_frag>, "target:0=",<&i2c_csi_dsi0>,
96+
<&csi_frag>, "target:0=",<&csi0>,
97+
<&clk_frag>, "target:0=",<&cam0_clk>,
98+
<&reg_frag>, "target:0=",<&cam0_reg>,
99+
<&cam_node>, "clocks:0=",<&cam0_clk>,
100+
<&cam_node>, "avdd-supply:0=",<&cam0_reg>;
101+
link-frequency = <&cam_endpoint>,"link-frequencies#0";
102+
4lane = <0>, "+201+202";
103+
};
104+
};
105+
106+
&cam_node {
107+
status = "okay";
108+
};
109+
110+
&cam_endpoint {
111+
remote-endpoint = <&csi_ep>;
112+
};
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
// Fragment that configures a Sony IMX335
3+
4+
cam_node: imx335@1a {
5+
compatible = "sony,imx335";
6+
reg = <0x1a>;
7+
status = "disabled";
8+
9+
clocks = <&cam1_clk>;
10+
clock-names = "xclk";
11+
12+
avdd-supply = <&cam1_reg>; /* Analog 2.9v */
13+
iovdd-supply = <&cam_dummy_reg>; /* Digital I/O 1.8v */
14+
dvdd-supply = <&cam_dummy_reg>; /* Digital Core 1.2v */
15+
16+
rotation = <180>;
17+
orientation = <2>;
18+
19+
port {
20+
cam_endpoint: endpoint {
21+
clock-lanes = <0>;
22+
data-lanes = <1 2>;
23+
link-frequencies = /bits/ 64 <594000000 445500000>;
24+
};
25+
};
26+
};

0 commit comments

Comments
 (0)