0d5ea3c188d2df101adf36e7cb5dc48dfd61bf7c
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0713-dtoverlays-Add-IMX477-sensor-overlay.patch
1 From 738defbb964c5d2a34b08c24ac0e7fd4afb16173 Mon Sep 17 00:00:00 2001
2 From: Naushir Patuck <naush@raspberrypi.com>
3 Date: Thu, 7 May 2020 15:50:04 +0100
4 Subject: [PATCH] dtoverlays: Add IMX477 sensor overlay
5
6 Add an overlay for the Sony IMX477 CMOS sensor device.
7 Also update overlay README and Makefile.
8
9 Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
10 ---
11 arch/arm/boot/dts/overlays/Makefile | 1 +
12 arch/arm/boot/dts/overlays/README | 8 ++
13 arch/arm/boot/dts/overlays/imx477-overlay.dts | 110 ++++++++++++++++++
14 3 files changed, 119 insertions(+)
15 create mode 100644 arch/arm/boot/dts/overlays/imx477-overlay.dts
16
17 --- a/arch/arm/boot/dts/overlays/Makefile
18 +++ b/arch/arm/boot/dts/overlays/Makefile
19 @@ -85,6 +85,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
20 i2s-gpio28-31.dtbo \
21 ilitek251x.dtbo \
22 imx219.dtbo \
23 + imx477.dtbo \
24 iqaudio-codec.dtbo \
25 iqaudio-dac.dtbo \
26 iqaudio-dacplus.dtbo \
27 --- a/arch/arm/boot/dts/overlays/README
28 +++ b/arch/arm/boot/dts/overlays/README
29 @@ -1390,6 +1390,14 @@ Load: dtoverlay=imx219
30 Params: <None>
31
32
33 +Name: imx477
34 +Info: Sony IMX477 camera module.
35 + Uses Unicam 1, which is the standard camera connector on most Pi
36 + variants.
37 +Load: dtoverlay=imx477
38 +Params: <None>
39 +
40 +
41 Name: iqaudio-codec
42 Info: Configures the IQaudio Codec audio card
43 Load: dtoverlay=iqaudio-codec
44 --- /dev/null
45 +++ b/arch/arm/boot/dts/overlays/imx477-overlay.dts
46 @@ -0,0 +1,110 @@
47 +// SPDX-License-Identifier: GPL-2.0-only
48 +// Definitions for IMX477 camera module on VC I2C bus
49 +/dts-v1/;
50 +/plugin/;
51 +
52 +#include <dt-bindings/gpio/gpio.h>
53 +
54 +/{
55 + compatible = "brcm,bcm2835";
56 +
57 + fragment@0 {
58 + target = <&i2c_csi_dsi>;
59 + __overlay__ {
60 + #address-cells = <1>;
61 + #size-cells = <0>;
62 + status = "okay";
63 +
64 + imx477: imx477@1a {
65 + compatible = "sony,imx477";
66 + reg = <0x1a>;
67 + status = "okay";
68 +
69 + clocks = <&imx477_clk>;
70 + clock-names = "xclk";
71 +
72 + VANA-supply = <&imx477_vana>; /* 2.8v */
73 + VDIG-supply = <&imx477_vdig>; /* 1.05v */
74 + VDDL-supply = <&imx477_vddl>; /* 1.8v */
75 +
76 + port {
77 + imx477_0: endpoint {
78 + remote-endpoint = <&csi1_ep>;
79 + clock-lanes = <0>;
80 + data-lanes = <1 2>;
81 + clock-noncontinuous;
82 + link-frequencies =
83 + /bits/ 64 <450000000>;
84 + };
85 + };
86 + };
87 + };
88 + };
89 +
90 + fragment@1 {
91 + target = <&csi1>;
92 + __overlay__ {
93 + status = "okay";
94 +
95 + port {
96 + csi1_ep: endpoint {
97 + remote-endpoint = <&imx477_0>;
98 + };
99 + };
100 + };
101 + };
102 +
103 + fragment@2 {
104 + target = <&i2c0if>;
105 + __overlay__ {
106 + status = "okay";
107 + };
108 + };
109 +
110 + fragment@3 {
111 + target-path="/";
112 + __overlay__ {
113 + imx477_vana: fixedregulator@0 {
114 + compatible = "regulator-fixed";
115 + regulator-name = "imx477_vana";
116 + regulator-min-microvolt = <2800000>;
117 + regulator-max-microvolt = <2800000>;
118 + gpio = <&gpio 41 GPIO_ACTIVE_HIGH>;
119 + enable-active-high;
120 + startup-delay-us = <300000>;
121 + };
122 + imx477_vdig: fixedregulator@1 {
123 + compatible = "regulator-fixed";
124 + regulator-name = "imx477_vdig";
125 + regulator-min-microvolt = <1050000>;
126 + regulator-max-microvolt = <1050000>;
127 + };
128 + imx477_vddl: fixedregulator@2 {
129 + compatible = "regulator-fixed";
130 + regulator-name = "imx477_vddl";
131 + regulator-min-microvolt = <1800000>;
132 + regulator-max-microvolt = <1800000>;
133 + };
134 + imx477_clk: camera-clk {
135 + compatible = "fixed-clock";
136 + #clock-cells = <0>;
137 + clock-frequency = <24000000>;
138 + };
139 + };
140 + };
141 +
142 + fragment@4 {
143 + target = <&i2c0mux>;
144 + __overlay__ {
145 + status = "okay";
146 + };
147 + };
148 +
149 + fragment@5 {
150 + target-path="/__overrides__";
151 + __overlay__ {
152 + cam0-pwdn-ctrl = <&imx477_vana>,"gpio:0";
153 + cam0-pwdn = <&imx477_vana>,"gpio:4";
154 + };
155 + };
156 +};