Skip to content

Commit c8702c1

Browse files
6by9pelwell
authored andcommitted
dtoverlays: Add overlay for Sony IMX258 image sensor
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent 87b7309 commit c8702c1

File tree

3 files changed

+167
-0
lines changed

3 files changed

+167
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
9898
i2s-gpio28-31.dtbo \
9999
ilitek251x.dtbo \
100100
imx219.dtbo \
101+
imx258.dtbo \
101102
imx290.dtbo \
102103
imx378.dtbo \
103104
imx477.dtbo \

arch/arm/boot/dts/overlays/README

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,6 +1872,24 @@ Params: rotation Mounting rotation of the camera sensor (0 or
18721872
vcm Configure a VCM focus drive on the sensor.
18731873

18741874

1875+
Name: imx258
1876+
Info: Sony IMX258 camera module.
1877+
Uses Unicam 1, which is the standard camera connector on most Pi
1878+
variants.
1879+
Load: dtoverlay=imx258,<param>=<val>
1880+
Params: rotation Mounting rotation of the camera sensor (0 or
1881+
180, default 180)
1882+
orientation Sensor orientation (0 = front, 1 = rear,
1883+
2 = external, default external)
1884+
media-controller Configure use of Media Controller API for
1885+
configuring the sensor (default on)
1886+
cam0 Adopt the default configuration for CAM0 on a
1887+
Compute Module (CSI0, i2c_vc, and cam0_reg).
1888+
vcm Configure a VCM focus drive on the sensor.
1889+
4lane Enable 4 CSI2 lanes. This requires a Compute
1890+
Module (1, 3, or 4).
1891+
1892+
18751893
Name: imx290
18761894
Info: Sony IMX290 camera module.
18771895
Uses Unicam 1, which is the standard camera connector on most Pi
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
// Definitions for IMX258 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@2 {
12+
target = <&i2c0if>;
13+
__overlay__ {
14+
status = "okay";
15+
};
16+
};
17+
18+
clk_frag: fragment@3 {
19+
target = <&cam1_clk>;
20+
cam_clk: __overlay__ {
21+
clock-frequency = <24000000>;
22+
status = "okay";
23+
};
24+
};
25+
26+
fragment@4 {
27+
target = <&i2c0mux>;
28+
__overlay__ {
29+
status = "okay";
30+
};
31+
};
32+
33+
reg_frag: fragment@5 {
34+
target = <&cam1_reg>;
35+
cam_reg: __overlay__ {
36+
regulator-name = "imx258_vana";
37+
startup-delay-us = <300000>;
38+
regulator-min-microvolt = <2700000>;
39+
regulator-max-microvolt = <2700000>;
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+
imx258: imx258@10 {
51+
compatible = "sony,imx258";
52+
reg = <0x10>;
53+
status = "okay";
54+
55+
clocks = <&cam1_clk>;
56+
clock-names = "xclk";
57+
58+
vana-supply = <&cam1_reg>; /* 2.8v */
59+
vdig-supply = <&cam_dummy_reg>; /* 1.05v */
60+
vif-supply = <&cam_dummy_reg>; /* 1.8v */
61+
62+
rotation = <180>;
63+
orientation = <2>;
64+
65+
port {
66+
imx258_0: endpoint {
67+
remote-endpoint = <&csi_ep>;
68+
clock-lanes = <0>;
69+
clock-noncontinuous;
70+
link-frequencies =
71+
/bits/ 64 <633600000
72+
320000000>;
73+
};
74+
};
75+
};
76+
77+
vcm: ad5398@0c {
78+
compatible = "adi,ad5398";
79+
reg = <0x0c>;
80+
status = "disabled";
81+
VANA-supply = <&cam1_reg>;
82+
};
83+
};
84+
};
85+
86+
csi_frag: fragment@101 {
87+
target = <&csi1>;
88+
csi: __overlay__ {
89+
status = "okay";
90+
brcm,media-controller;
91+
92+
port {
93+
csi_ep: endpoint {
94+
remote-endpoint = <&imx258_0>;
95+
clock-lanes = <0>;
96+
clock-noncontinuous;
97+
};
98+
};
99+
};
100+
};
101+
102+
fragment@102 {
103+
target = <&imx258_0>;
104+
__overlay__ {
105+
data-lanes = <1 2>;
106+
link-frequencies = /bits/ 64 <633600000
107+
320000000>;
108+
};
109+
};
110+
111+
fragment@103 {
112+
target = <&imx258_0>;
113+
__dormant__ {
114+
data-lanes = <1 2 3 4>;
115+
link-frequencies =
116+
/bits/ 64 <633600000 320000000>;
117+
};
118+
};
119+
120+
fragment@104 {
121+
target = <&csi_ep>;
122+
__overlay__ {
123+
data-lanes = <1 2>;
124+
};
125+
};
126+
127+
fragment@105 {
128+
target = <&csi_ep>;
129+
__dormant__ {
130+
data-lanes = <1 2 3 4>;
131+
};
132+
};
133+
134+
__overrides__ {
135+
rotation = <&imx258>,"rotation:0";
136+
orientation = <&imx258>,"orientation:0";
137+
media-controller = <&csi>,"brcm,media-controller?";
138+
cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
139+
<&csi_frag>, "target:0=",<&csi0>,
140+
<&clk_frag>, "target:0=",<&cam0_clk>,
141+
<&reg_frag>, "target:0=",<&cam0_reg>,
142+
<&imx258>, "clocks:0=",<&cam0_clk>,
143+
<&imx258>, "vana-supply:0=",<&cam0_reg>;
144+
vcm = <&vcm>, "status=okay",
145+
<&imx258>,"lens-focus:0=", <&vcm>;
146+
4lane = <0>, "-102+103-104+105";
147+
};
148+
};

0 commit comments

Comments
 (0)