Skip to content

Commit dc32bac

Browse files
committed
overlay: Add ov4657 camera module support
Signed-off-by: zhu <[email protected]>
1 parent b5acf3a commit dc32bac

File tree

5 files changed

+58
-5
lines changed

5 files changed

+58
-5
lines changed

arch/arm64/boot/dts/rockchip/overlays-rockpi4/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ dtbo-$(CONFIG_ARCH_ROCKCHIP) += \
1515
hifiberry-dacplus.dtbo \
1616
raspberrypi-7-inch-lcd.dtbo \
1717
cpufreq.dtbo \
18-
imx219.dtbo
18+
imx219.dtbo \
19+
ov5647.dtbo
1920

2021
targets += dtbs dtbs_install
2122
targets += $(dtbo-y)

arch/arm64/boot/dts/rockchip/overlays-rockpi4/hw_intfc.conf

+5-2
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,8 @@ intfc:dtoverlay=console-on-ttyS2
5959
# setting cpu frequency over-2GHz
6060
#intfc:dtoverlay=cpufreq
6161

62-
# Add imx219 camera module support
63-
#intfc:dtoverlay=imx219
62+
# Add imx219 camera module support. Need disabled ov5647 camera module.
63+
#intfc:dtoverlay=imx219
64+
65+
# Add ov5647 camera module support. Need disabled imx219 camera module.
66+
#intfc:dtoverlay=ov5647
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/dts-v1/;
2+
/plugin/;
3+
4+
/ {
5+
model = "ROCK PI 4B";
6+
compatible = "rockchip,rockpi","rockchip,rk3399";
7+
8+
fragment@0 {
9+
target = <&i2c4>;
10+
11+
__overlay__ {
12+
status = "okay";
13+
};
14+
};
15+
16+
fragment@1 {
17+
target = <&camera2>;
18+
19+
__overlay__ {
20+
status = "okay";
21+
};
22+
};
23+
24+
fragment@2 {
25+
target = <&mipi_in_ucam0>;
26+
27+
__overlay__ {
28+
remote-endpoint = <&ucam_out1>;
29+
};
30+
};
31+
};

arch/arm64/boot/dts/rockchip/rockpi-4b-linux.dts

+19-1
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,23 @@
628628
};
629629
};
630630
};
631+
632+
camera2: camera-module@36 {
633+
status = "disabled";
634+
compatible = "ovti,ov5647";
635+
reg = <0x36>;
636+
637+
clocks = <&cru SCLK_CIF_OUT>;
638+
clock-names = "clk_cif_out";
639+
pinctrl-names = "rockchip,camera_default";
640+
641+
port {
642+
ucam_out1: endpoint {
643+
remote-endpoint = <&mipi_in_ucam0>;
644+
data-lanes = <1 2>;
645+
};
646+
};
647+
};
631648
};
632649

633650
&i2c2 {
@@ -961,7 +978,8 @@
961978
i2c4_xfer: i2c4-xfer {
962979
rockchip,pins =
963980
<1 12 RK_FUNC_1 &pcfg_pull_up>,
964-
<1 11 RK_FUNC_1 &pcfg_pull_up>;
981+
<1 11 RK_FUNC_1 &pcfg_pull_up>,
982+
<1 13 RK_FUNC_GPIO &pcfg_pull_up>; //camera module enable pin
965983
};
966984
};
967985
i2s0 {

drivers/media/i2c/ov5647.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ static int ov5647_probe(struct i2c_client *client,
857857
}
858858

859859
xclk_freq = clk_get_rate(sensor->xclk);
860-
if (xclk_freq != 25000000) {
860+
if (xclk_freq != 6000000) {
861861
dev_err(dev, "Unsupported clock frequency: %u\n", xclk_freq);
862862
return -EINVAL;
863863
}

0 commit comments

Comments
 (0)