Skip to content

Commit 9336eb8

Browse files
oli-benmmind
authored andcommitted
arm64: dts: rockchip: describe I2c Bus 1 and IMX258 world camera on PinePhone Pro
Add the description of the rear/world camera (IMX258) on the PinePhone Pro to the device dts file. It receives commands on the I2C Bus 1 at address 0x1a and transmits data over CSI-MIPI. The I2C address for IMX258 can be found in the IMX258-0AQH5 Software Reference Manual, page 24, section 2.3.1: 0b0011010 = 0x1a. Section 3 indicates the module has 4 pairs of data lines. While 4-lane mode is nominal, 2-lane mode should also be supported. The pin muxing info was extracted from the PinePhone Pro schematic v1.0 as well as the RK3399 datasheet revision 1.8. Table 2-3 in section 2.8 of the RK3399 datasheet contains the mapping of IO functions for the SoC pins. Page 52 shows GPIO1_A0, page 54 shows GPIO2_D4. For I2C power, the PinePhone Pro schematic page 11 quadrants A4 and A5: RK3399_J.AA8 and RK3399_J.Y8 get power from vcaa1v8_codec, so turn it on The IMX258 also uses the following regulators, expected by its driver: - vana (2.8V analog), called AVDD2V8_DVP on P.18 q.C1 and derived from VCC1V8_S3 on P.13 q.B2 - vdig (1.2V digital core), called DVDD_DVP on P.18 q.C1 and shown on P.18 q.D3 to be equivalent to VCC1V2_DVP derived from VCC3V3_SYS on P.13 q.B3. Note that this regulator's voltage is inconsistently labeled either 1.2V or 1.5V RK3399_J.AG1 is GPIO4_A1/I2C1_SDA, RK3399_J.Y6 is GPIO4_A2/I2C1_SCL This is the default pinctrl "i2c1_xfer" for i2c1 from rk3399-base. For the reset (RESET) signal: page 11 quadrant D2 | p.18 q.C3-4 | p.18 q.C2 RK3399_E.R25 -> GPIO1_A0 -> Camera_RST -> MIPI_RST0 -> IMX258.12 For the powerdown (PWDN) signal: page 11 quadrants B4-5 | p.18 q.C2 RK3399_G.AF8 -> GPIO2_D4 -> DVP_PDN1_H -> IMX258.14 Helped-by: Dragan Simic <[email protected]> Co-developed-by: Ondrej Jirman <[email protected]> Signed-off-by: Ondrej Jirman <[email protected]> Signed-off-by: Olivier Benjamin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Stuebner <[email protected]>
1 parent f2792bf commit 9336eb8

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,16 @@
104104
regulator-boot-on;
105105
};
106106

107+
avdd2v8_dvp: regulator-avdd2v8-dvp {
108+
compatible = "regulator-fixed";
109+
regulator-name = "avdd2v8_dvp";
110+
regulator-always-on;
111+
regulator-boot-on;
112+
regulator-min-microvolt = <2800000>;
113+
regulator-max-microvolt = <2800000>;
114+
vin-supply = <&vcc3v3_sys>;
115+
};
116+
107117
vcc3v3_sys: regulator-vcc3v3-sys {
108118
compatible = "regulator-fixed";
109119
regulator-name = "vcc3v3_sys";
@@ -136,6 +146,16 @@
136146
vin-supply = <&vcc3v3_sys>;
137147
};
138148

149+
vcc1v2_dvp: regulator-vcc1v2-dvp {
150+
compatible = "regulator-fixed";
151+
regulator-name = "vcc1v2_dvp";
152+
regulator-always-on;
153+
regulator-boot-on;
154+
regulator-min-microvolt = <1200000>;
155+
regulator-max-microvolt = <1200000>;
156+
vin-supply = <&vcca1v8_s3>;
157+
};
158+
139159
wifi_pwrseq: sdio-wifi-pwrseq {
140160
compatible = "mmc-pwrseq-simple";
141161
clocks = <&rk818 1>;
@@ -312,6 +332,8 @@
312332

313333
vcca1v8_codec: LDO_REG3 {
314334
regulator-name = "vcca1v8_codec";
335+
regulator-always-on;
336+
regulator-boot-on;
315337
regulator-min-microvolt = <1800000>;
316338
regulator-max-microvolt = <1800000>;
317339
};
@@ -420,6 +442,46 @@
420442
};
421443
};
422444

445+
&i2c1 {
446+
assigned-clocks = <&cru SCLK_CIF_OUT>;
447+
assigned-clock-rates = <24000000>;
448+
clock-frequency = <400000>;
449+
pinctrl-names = "default";
450+
pinctrl-0 = <&i2c1_xfer &cif_clkouta>;
451+
status = "okay";
452+
453+
wcam: camera@1a {
454+
compatible = "sony,imx258";
455+
reg = <0x1a>;
456+
clocks = <&cru SCLK_CIF_OUT>; /* MIPI_MCLK0, derived from CIF_CLKO */
457+
lens-focus = <&wcam_lens>;
458+
orientation = <1>; /* V4L2_CAMERA_ORIENTATION_BACK */
459+
pinctrl-names = "default";
460+
pinctrl-0 = <&camera_rst_l>;
461+
reset-gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_LOW>;
462+
rotation = <270>;
463+
/* Note: both cameras also depend on vcca1v8_codec to power the I2C bus. */
464+
vif-supply = <&vcc1v8_dvp>;
465+
vana-supply = <&avdd2v8_dvp>;
466+
vdig-supply = <&vcc1v2_dvp>; /* DVDD_DVP is the same as VCC1V2_DVP */
467+
468+
port {
469+
wcam_out: endpoint {
470+
data-lanes = <1 2 3 4>;
471+
link-frequencies = /bits/ 64 <636000000>;
472+
remote-endpoint = <&mipi_in_wcam>;
473+
};
474+
};
475+
};
476+
477+
wcam_lens: camera-lens@c {
478+
compatible = "dongwoon,dw9714";
479+
reg = <0x0c>;
480+
/* Same I2c bus as both cameras, depends on vcca1v8_codec for power. */
481+
vcc-supply = <&vcc1v8_dvp>;
482+
};
483+
};
484+
423485
&i2c3 {
424486
i2c-scl-rising-time-ns = <450>;
425487
i2c-scl-falling-time-ns = <15>;
@@ -462,6 +524,28 @@
462524
status = "okay";
463525
};
464526

527+
&isp1 {
528+
status = "okay";
529+
530+
ports {
531+
port@0 {
532+
mipi_in_wcam: endpoint@0 {
533+
reg = <0>;
534+
data-lanes = <1 2 3 4>;
535+
remote-endpoint = <&wcam_out>;
536+
};
537+
};
538+
};
539+
};
540+
541+
&mipi_dphy_rx0 {
542+
status = "okay";
543+
};
544+
545+
&isp1_mmu {
546+
status = "okay";
547+
};
548+
465549
&mipi_dsi {
466550
clock-master;
467551
status = "okay";
@@ -490,6 +574,10 @@
490574
};
491575
};
492576

577+
&mipi_dsi1 {
578+
status = "okay";
579+
};
580+
493581
&pmu_io_domains {
494582
pmu1830-supply = <&vcc_1v8>;
495583
status = "okay";
@@ -508,6 +596,12 @@
508596
};
509597
};
510598

599+
camera {
600+
camera_rst_l: camera-rst-l {
601+
rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
602+
};
603+
};
604+
511605
leds {
512606
red_led_pin: red-led-pin {
513607
rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;

0 commit comments

Comments
 (0)