Merge commit '21cc4fd00cd2cb5e19ce6fe626a07351dcbffc34'

* commit '21cc4fd00cd2cb5e19ce6fe626a07351dcbffc34': (30 commits)
  media: i2c: imx415: adjusting the power on timing
  media: i2c: rk628: set default timings when query timing if hdmi unplug
  drm/rockchip: dw-dp: support more color format
  media: i2c: rk628: add CSI error interrupts to haldle csi errors
  media: i2c: rk628: fix get capture when capture mode is 0
  arm64: dts: rockchip: px30-evb-ddr3-v10: reduce power consumption by reducing voltage
  media: i2c: maxim: driver version v3.01.00
  arm64: dts: rockchip: rk3588-evb7-imx415: remove cam_ircut0
  media: i2c: sc450ai adapt sleep_wakeup
  media: i2c: rk628: fix CTS HF2-23 test fail
  media: i2c: rk628: fix CTS HF2-86 test fail
  media: i2c: rk628: fix CTS test fail
  media: i2c: rk628: add hdmirx cec support
  media: i2c: rk628: disable character error detection
  media: i2c: rk628: fix resolution change but not recognized
  ARM: dts: rockchip: rv1106g-evb2-v12-wakeup: fix false wakeup issue
  drm/rockchip: vop: add csc_mode regs for PX30/RK3366/RV1126
  arm64: dts: rockchip: rk3588-vehicle-evb-v22.dts: fix max96712 dphy3 lock gpio error
  input: sensor: fix compile errors on kernel-6.1
  Revert "ARM: dts: rockchip: Add dtsi file for rk628"
  ...

Change-Id: I93c1f3c95752a236a6d742d2a6232a183169edee
This commit is contained in:
Tao Huang
2024-01-24 11:08:54 +08:00
121 changed files with 1601 additions and 3632 deletions

View File

@@ -1,121 +0,0 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
// Copyright (c) 2020 Fuzhou Rockchip Electronics Co., Ltd
/dts-v1/;
#include "rk3288-evb-rk628.dtsi"
/ {
model = "Rockchip RK3288 EVB RK628 Board";
compatible = "rockchip,rk3288-evb-rk628", "rockchip,rk3288";
chosen {
bootargs = "rootwait earlycon=uart8250,mmio32,0xff690000 vmalloc=496M console=ttyFIQ0 androidboot.baseband=N/A androidboot.veritymode=enforcing androidboot.hardware=rk30board androidboot.console=ttyFIQ0 init=/init kpti=0 androidboot.selinux=permissive";
};
hdmiin-sound {
compatible = "rockchip,rockchip-rt5651-rk628-sound";
rockchip,cpu = <&i2s>;
rockchip,codec = <&rt5651>;
status = "okay";
};
};
&video_phy {
status = "okay";
};
&hdmi {
status = "okay";
};
&hdmi_in_vopb {
status = "disabled";
};
&hdmi_in_vopl {
status = "okay";
};
&route_hdmi {
connect = <&vopl_out_hdmi>;
status = "disabled";
};
&rk628 {
reg = <0x51>;
interrupt-parent = <&gpio7>;
interrupts = <11 IRQ_TYPE_LEVEL_HIGH>;
enable-gpios = <&gpio5 RK_PC3 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio7 RK_PB4 GPIO_ACTIVE_LOW>;
status = "okay";
};
&rk628_combrxphy {
status = "okay";
};
&rk628_combtxphy {
status = "okay";
};
&rk628_csi {
status = "okay";
plugin-det-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
power-gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>;
rockchip,camera-module-index = <0>;
rockchip,camera-module-facing = "back";
rockchip,camera-module-name = "RK628-CSI";
rockchip,camera-module-lens-name = "NC";
port {
hdmiin_out0: endpoint {
remote-endpoint = <&hdmi2mipi_in>;
data-lanes = <1 2 3 4>;
};
};
};
&mipi_phy_rx0 {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
hdmi2mipi_in: endpoint@1 {
reg = <1>;
remote-endpoint = <&hdmiin_out0>;
data-lanes = <1 2 3 4>;
};
};
port@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
dphy_rx_out: endpoint@0 {
reg = <0>;
remote-endpoint = <&isp_mipi_in>;
};
};
};
};
&rkisp1 {
status = "okay";
port {
#address-cells = <1>;
#size-cells = <0>;
isp_mipi_in: endpoint@0 {
reg = <0>;
remote-endpoint = <&dphy_rx_out>;
};
};
};

View File

@@ -1,333 +0,0 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
// Copyright (c) 2020 Fuzhou Rockchip Electronics Co., Ltd
/dts-v1/;
#include "rk3288-evb-rk628.dtsi"
&rk628_dsi0 {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
dsi0_in_post_process: endpoint {
remote-endpoint = <&post_process_out_dsi0>;
};
};
};
panel@0 {
compatible = "simple-panel-dsi";
reg = <0>;
backlight = <&backlight>;
enable-gpios = <&gpio7 RK_PA2 GPIO_ACTIVE_HIGH>;
prepare-delay-ms = <120>;
enable-delay-ms = <120>;
disable-delay-ms = <120>;
unprepare-delay-ms = <120>;
init-delay-ms = <120>;
dsi,flags = <(MIPI_DSI_MODE_VIDEO |
MIPI_DSI_MODE_VIDEO_BURST |
MIPI_DSI_MODE_LPM |
MIPI_DSI_MODE_EOT_PACKET)>;
dsi,format = <MIPI_DSI_FMT_RGB888>;
dsi,lanes = <4>;
panel-init-sequence = [
39 00 04 ff 98 81 03
39 00 02 01 00
39 00 02 02 00
39 00 02 03 53
39 00 02 04 53
39 00 02 05 13
39 00 02 06 04
39 00 02 07 02
39 00 02 08 02
39 00 02 09 00
39 00 02 0a 00
39 00 02 0b 00
39 00 02 0c 00
39 00 02 0d 00
39 00 02 0e 00
39 00 02 0f 00
39 00 02 10 00
39 00 02 11 00
39 00 02 12 00
39 00 02 13 00
39 00 02 14 00
39 00 02 15 08
39 00 02 16 10
39 00 02 17 00
39 00 02 18 08
39 00 02 19 00
39 00 02 1a 00
39 00 02 1b 00
39 00 02 1c 00
39 00 02 1d 00
39 00 02 1e c0
39 00 02 1f 80
39 00 02 20 02
39 00 02 21 09
39 00 02 22 00
39 00 02 23 00
39 00 02 24 00
39 00 02 25 00
39 00 02 26 00
39 00 02 27 00
39 00 02 28 55
39 00 02 29 03
39 00 02 2a 00
39 00 02 2b 00
39 00 02 2c 00
39 00 02 2d 00
39 00 02 2e 00
39 00 02 2f 00
39 00 02 30 00
39 00 02 31 00
39 00 02 32 00
39 00 02 33 00
39 00 02 34 04
39 00 02 35 05
39 00 02 36 05
39 00 02 37 00
39 00 02 38 3c
39 00 02 39 35
39 00 02 3a 00
39 00 02 3b 40
39 00 02 3c 00
39 00 02 3d 00
39 00 02 3e 00
39 00 02 3f 00
39 00 02 40 00
39 00 02 41 88
39 00 02 42 00
39 00 02 43 00
39 00 02 44 1f
39 00 02 50 01
39 00 02 51 23
39 00 02 52 45
39 00 02 53 67
39 00 02 54 89
39 00 02 55 ab
39 00 02 56 01
39 00 02 57 23
39 00 02 58 45
39 00 02 59 67
39 00 02 5a 89
39 00 02 5b ab
39 00 02 5c cd
39 00 02 5d ef
39 00 02 5e 03
39 00 02 5f 14
39 00 02 60 15
39 00 02 61 0c
39 00 02 62 0d
39 00 02 63 0e
39 00 02 64 0f
39 00 02 65 10
39 00 02 66 11
39 00 02 67 08
39 00 02 68 02
39 00 02 69 0a
39 00 02 6a 02
39 00 02 6b 02
39 00 02 6c 02
39 00 02 6d 02
39 00 02 6e 02
39 00 02 6f 02
39 00 02 70 02
39 00 02 71 02
39 00 02 72 06
39 00 02 73 02
39 00 02 74 02
39 00 02 75 14
39 00 02 76 15
39 00 02 77 0f
39 00 02 78 0e
39 00 02 79 0d
39 00 02 7a 0c
39 00 02 7b 11
39 00 02 7c 10
39 00 02 7d 06
39 00 02 7e 02
39 00 02 7f 0a
39 00 02 80 02
39 00 02 81 02
39 00 02 82 02
39 00 02 83 02
39 00 02 84 02
39 00 02 85 02
39 00 02 86 02
39 00 02 87 02
39 00 02 88 08
39 00 02 89 02
39 00 02 8a 02
39 00 04 ff 98 81 04
39 00 02 00 80
39 00 02 70 00
39 00 02 71 00
39 00 02 66 fe
39 00 02 82 15
39 00 02 84 15
39 00 02 85 15
39 00 02 3a 24
39 00 02 32 ac
39 00 02 8c 80
39 00 02 3c f5
39 00 02 88 33
39 00 04 ff 98 81 01
39 00 02 22 0a
39 00 02 31 00
39 00 02 53 78
39 00 02 55 7b
39 00 02 60 20
39 00 02 61 00
39 00 02 62 0d
39 00 02 63 00
39 00 02 a0 00
39 00 02 a1 10
39 00 02 a2 1c
39 00 02 a3 13
39 00 02 a4 15
39 00 02 a5 26
39 00 02 a6 1a
39 00 02 a7 1d
39 00 02 a8 67
39 00 02 a9 1c
39 00 02 aa 29
39 00 02 ab 58
39 00 02 ac 26
39 00 02 ad 28
39 00 02 ae 5c
39 00 02 af 30
39 00 02 b0 31
39 00 02 b1 32
39 00 02 b2 00
39 00 02 c0 00
39 00 02 c1 10
39 00 02 c2 1c
39 00 02 c3 13
39 00 02 c4 15
39 00 02 c5 26
39 00 02 c6 1a
39 00 02 c7 1d
39 00 02 c8 67
39 00 02 c9 1c
39 00 02 ca 29
39 00 02 cb 5b
39 00 02 cc 26
39 00 02 cd 28
39 00 02 ce 5c
39 00 02 cf 30
39 00 02 d0 31
39 00 02 d1 2e
39 00 02 d2 32
39 00 02 d3 00
39 00 04 ff 98 81 00
05 fa 01 11
05 14 01 29
];
panel-exit-sequence = [
05 00 01 28
05 00 01 10
];
display-timings {
native-mode = <&timing0>;
timing0: timing0 {
clock-frequency = <64000000>;
hactive = <720>;
vactive = <1280>;
hfront-porch = <40>;
hsync-len = <10>;
hback-porch = <40>;
vfront-porch = <22>;
vsync-len = <4>;
vback-porch = <11>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
};
};
};
&rk628_combtxphy {
status = "okay";
};
&rk628_post_process {
pinctrl-names = "default";
pinctrl-0 = <&rk628_vop_pins>;
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
post_process_in_rgb: endpoint {
remote-endpoint = <&rgb_out_post_process>;
};
};
port@1 {
reg = <1>;
post_process_out_dsi0: endpoint {
remote-endpoint = <&dsi0_in_post_process>;
};
};
};
};
&rgb {
status = "okay";
ports {
port@1 {
reg = <1>;
rgb_out_post_process: endpoint {
remote-endpoint = <&post_process_in_rgb>;
};
};
};
};
&video_phy {
status = "okay";
};
&rgb_in_vopb {
status = "disabled";
};
&rgb_in_vopl {
status = "okay";
};
&route_rgb {
connect = <&vopl_out_rgb>;
status = "disabled";
};
&vopb {
assigned-clocks = <&cru DCLK_VOP0>;
assigned-clock-parents = <&cru PLL_GPLL>;
};
&vopl {
assigned-clocks = <&cru DCLK_VOP1>;
assigned-clock-parents = <&cru PLL_CPLL>;
};

View File

@@ -1,95 +0,0 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
// Copyright (c) 2020 Fuzhou Rockchip Electronics Co., Ltd
/dts-v1/;
#include "rk3288-evb-rk628.dtsi"
&sound {
status = "okay";
};
&rk628_hdmi {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
hdmi_in_post_process: endpoint {
remote-endpoint = <&post_process_out_hdmi>;
};
};
};
};
&rk628_post_process {
pinctrl-names = "default";
pinctrl-0 = <&rk628_vop_pins>;
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
post_process_in_rgb: endpoint {
remote-endpoint = <&rgb_out_post_process>;
};
};
port@1 {
reg = <1>;
post_process_out_hdmi: endpoint {
remote-endpoint = <&hdmi_in_post_process>;
};
};
};
};
&rgb {
status = "okay";
ports {
port@1 {
reg = <1>;
rgb_out_post_process: endpoint {
remote-endpoint = <&post_process_in_rgb>;
};
};
};
};
&video_phy {
status = "okay";
};
&rgb_in_vopb {
status = "disabled";
};
&rgb_in_vopl {
status = "okay";
};
&route_rgb {
connect = <&vopl_out_rgb>;
status = "disabled";
};
&vopb {
assigned-clocks = <&cru DCLK_VOP0>;
assigned-clock-parents = <&cru PLL_CPLL>;
};
&vopl {
assigned-clocks = <&cru DCLK_VOP1>;
assigned-clock-parents = <&cru PLL_GPLL>;
};

View File

@@ -1,144 +0,0 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
// Copyright (c) 2020 Fuzhou Rockchip Electronics Co., Ltd
/dts-v1/;
#include "rk3288-evb-rk628.dtsi"
/ {
model = "Rockchip RK3288 EVB RK628 Board";
compatible = "rockchip,rk3288-evb-rk628", "rockchip,rk3288";
panel {
compatible = "simple-panel";
backlight = <&backlight>;
enable-gpios = <&gpio7 RK_PA2 GPIO_ACTIVE_HIGH>;
prepare-delay-ms = <20>;
enable-delay-ms = <20>;
disable-delay-ms = <20>;
unprepare-delay-ms = <20>;
bus-format = <MEDIA_BUS_FMT_RGB888_1X7X4_SPWG>;
display-timings {
native-mode = <&timing0>;
timing0: timing0 {
clock-frequency = <48000000>;
hactive = <1024>;
vactive = <600>;
hback-porch = <90>;
hfront-porch = <90>;
vback-porch = <10>;
vfront-porch = <10>;
hsync-len = <90>;
vsync-len = <10>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
};
port {
panel_in_lvds: endpoint {
remote-endpoint = <&lvds_out_panel>;
};
};
};
};
&rk628_lvds {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
lvds_in_post_process: endpoint {
remote-endpoint = <&post_process_out_lvds>;
};
};
port@1 {
reg = <1>;
lvds_out_panel: endpoint {
remote-endpoint = <&panel_in_lvds>;
};
};
};
};
&rk628_combtxphy {
status = "okay";
};
&rk628_post_process {
pinctrl-names = "default";
pinctrl-0 = <&rk628_vop_pins>;
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
post_process_in_rgb: endpoint {
remote-endpoint = <&rgb_out_post_process>;
};
};
port@1 {
reg = <1>;
post_process_out_lvds: endpoint {
remote-endpoint = <&lvds_in_post_process>;
};
};
};
};
&rgb {
status = "okay";
ports {
port@1 {
reg = <1>;
rgb_out_post_process: endpoint {
remote-endpoint = <&post_process_in_rgb>;
};
};
};
};
&video_phy {
status = "okay";
};
&rgb_in_vopb {
status = "disabled";
};
&rgb_in_vopl {
status = "okay";
};
&route_rgb {
connect = <&vopl_out_rgb>;
status = "disabled";
};
&vopb {
assigned-clocks = <&cru DCLK_VOP0>;
assigned-clock-parents = <&cru PLL_GPLL>;
};
&vopl {
assigned-clocks = <&cru DCLK_VOP1>;
assigned-clock-parents = <&cru PLL_CPLL>;
};

View File

@@ -1,151 +0,0 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
// Copyright (c) 2020 Fuzhou Rockchip Electronics Co., Ltd
/dts-v1/;
#include "rk3288-evb-rk628.dtsi"
/ {
vcc33_lcd: vcc33-lcd {
compatible = "regulator-fixed";
regulator-name = "vcc33_lcd";
regulator-boot-on;
gpio = <&gpio7 RK_PA2 GPIO_ACTIVE_HIGH>;
enable-active-high;
};
panel {
compatible = "simple-panel";
backlight = <&backlight>;
power-supply = <&vcc33_lcd>;
enable-gpios = <&gpio5 RK_PC1 GPIO_ACTIVE_HIGH>;
prepare-delay-ms = <20>;
enable-delay-ms = <20>;
disable-delay-ms = <20>;
unprepare-delay-ms = <20>;
bus-format = <MEDIA_BUS_FMT_RGB888_1X7X4_SPWG>;
display-timings {
native-mode = <&timing0>;
timing0: timing0 {
clock-frequency = <149000000>;
hactive = <1920>;
vactive = <1080>;
hback-porch = <96>;
hfront-porch = <120>;
vback-porch = <8>;
vfront-porch = <33>;
hsync-len = <64>;
vsync-len = <4>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
};
port {
panel_in_lvds: endpoint {
remote-endpoint = <&lvds_out_panel>;
};
};
};
};
&rk628_lvds {
rockchip,link-type = "dual-link-even-odd-pixels";
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
lvds_in_post_process: endpoint {
remote-endpoint = <&post_process_out_lvds>;
};
};
port@1 {
reg = <1>;
lvds_out_panel: endpoint {
remote-endpoint = <&panel_in_lvds>;
};
};
};
};
&rk628_combtxphy {
status = "okay";
};
&rk628_post_process {
pinctrl-names = "default";
pinctrl-0 = <&rk628_vop_pins>;
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
post_process_in_rgb: endpoint {
remote-endpoint = <&rgb_out_post_process>;
};
};
port@1 {
reg = <1>;
post_process_out_lvds: endpoint {
remote-endpoint = <&lvds_in_post_process>;
};
};
};
};
&rgb {
status = "okay";
ports {
port@1 {
reg = <1>;
rgb_out_post_process: endpoint {
remote-endpoint = <&post_process_in_rgb>;
};
};
};
};
&video_phy {
status = "okay";
};
&rgb_in_vopb {
status = "disabled";
};
&rgb_in_vopl {
status = "okay";
};
&route_rgb {
connect = <&vopl_out_rgb>;
status = "disabled";
};
&vopb {
assigned-clocks = <&cru DCLK_VOP0>;
assigned-clock-parents = <&cru PLL_GPLL>;
};
&vopl {
assigned-clocks = <&cru DCLK_VOP1>;
assigned-clock-parents = <&cru PLL_CPLL>;
};

View File

@@ -1,614 +0,0 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
// Copyright (c) 2020 Fuzhou Rockchip Electronics Co., Ltd
#include <dt-bindings/pwm/pwm.h>
#include <dt-bindings/input/input.h>
#include "rk3288.dtsi"
#include "rk3288-android.dtsi"
/ {
model = "Rockchip RK3288 EVB RK628 Board";
compatible = "rockchip,rk3288-evb-rk628", "rockchip,rk3288";
chosen: chosen {
bootargs = "rootwait earlycon=uart8250,mmio32,0xff690000 vmalloc=496M console=ttyFIQ0 androidboot.baseband=N/A androidboot.veritymode=enforcing androidboot.hardware=rk30board androidboot.console=ttyFIQ0 init=/init kpti=0";
};
adc-keys {
compatible = "adc-keys";
io-channels = <&saradc 1>;
io-channel-names = "buttons";
keyup-threshold-microvolt = <1800000>;
poll-interval = <100>;
vol-up-key {
label = "volume up";
linux,code = <KEY_VOLUMEUP>;
press-threshold-microvolt = <1000>;
};
vol-down-key {
label = "volume down";
linux,code = <KEY_VOLUMEDOWN>;
press-threshold-microvolt = <170000>;
};
menu {
label = "menu";
linux,code = <KEY_MENU>;
press-threshold-microvolt = <640000>;
};
esc {
label = "esc";
linux,code = <KEY_ESC>;
press-threshold-microvolt = <1000000>;
};
home {
label = "home";
linux,code = <KEY_HOME>;
press-threshold-microvolt = <1300000>;
};
};
backlight: backlight {
compatible = "pwm-backlight";
pwms = <&pwm0 0 1000000 0>;
brightness-levels = <
0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15
16 17 18 19 20 21 22 23
24 25 26 27 28 29 30 31
32 33 34 35 36 37 38 39
40 41 42 43 44 45 46 47
48 49 50 51 52 53 54 55
56 57 58 59 60 61 62 63
64 65 66 67 68 69 70 71
72 73 74 75 76 77 78 79
80 81 82 83 84 85 86 87
88 89 90 91 92 93 94 95
96 97 98 99 100 101 102 103
104 105 106 107 108 109 110 111
112 113 114 115 116 117 118 119
120 121 122 123 124 125 126 127
128 129 130 131 132 133 134 135
136 137 138 139 140 141 142 143
144 145 146 147 148 149 150 151
152 153 154 155 156 157 158 159
160 161 162 163 164 165 166 167
168 169 170 171 172 173 174 175
176 177 178 179 180 181 182 183
184 185 186 187 188 189 190 191
192 193 194 195 196 197 198 199
200 201 202 203 204 205 206 207
208 209 210 211 212 213 214 215
216 217 218 219 220 221 222 223
224 225 226 227 228 229 230 231
232 233 234 235 236 237 238 239
240 241 242 243 244 245 246 247
248 249 250 251 252 253 254 255>;
default-brightness-level = <128>;
};
i2s_mclkin: i2s-mclkin {
compatible = "fixed-factor-clock";
#clock-cells = <0>;
clocks = <&cru SCLK_I2S0_OUT>;
clock-mult = <1>;
clock-div = <1>;
clock-output-names = "i2s_mclkin";
};
sound: sound {
compatible = "simple-audio-card";
simple-audio-card,format = "i2s";
simple-audio-card,name = "realtek,rt5651-codec";
simple-audio-card,mclk-fs = <256>;
simple-audio-card,widgets =
"Microphone", "Microphone Jack",
"Headphone", "Headphone Jack";
simple-audio-card,routing =
"MIC1", "Microphone Jack",
"MIC2", "Microphone Jack",
"Microphone Jack", "micbias1",
"Headphone Jack", "HPOL",
"Headphone Jack", "HPOR";
status = "disabled";
simple-audio-card,dai-link@0 {
format = "i2s";
cpu {
sound-dai = <&i2s>;
};
codec {
sound-dai = <&rt5651>;
};
};
simple-audio-card,dai-link@1 {
format = "i2s";
cpu {
sound-dai = <&i2s>;
};
codec {
sound-dai = <&rk628_hdmi>;
};
};
};
vcc_host: vcc-host-regulator {
compatible = "regulator-fixed";
enable-active-high;
gpio = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&host_vbus_drv>;
regulator-name = "vcc_host";
regulator-always-on;
regulator-boot-on;
};
vcc_sys: vsys-regulator {
compatible = "regulator-fixed";
regulator-name = "vcc_sys";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-always-on;
regulator-boot-on;
};
vdd_log: vdd-logic {
compatible = "pwm-regulator";
rockchip,pwm_id = <1>;
rockchip,pwm_voltage = <1100000>;
pwms = <&pwm1 0 25000 1>;
regulator-name = "vcc_log";
regulator-min-microvolt = <860000>;
regulator-max-microvolt = <1360000>;
regulator-always-on;
regulator-boot-on;
};
xin32k: xin32k {
compatible = "fixed-clock";
clock-frequency = <32768>;
clock-output-names = "xin32k";
#clock-cells = <0>;
};
};
&backlight {
/delete-property/ enable-gpios;
};
&cpu0 {
cpu-supply = <&vdd_cpu>;
};
&dfi {
status = "okay";
};
&dmc {
center-supply = <&vdd_log>;
status = "okay";
};
&gpu {
mali-supply = <&vdd_gpu>;
status = "okay";
};
&i2c0 {
clock-frequency = <400000>;
status = "okay";
rk808: pmic@1b {
compatible = "rockchip,rk808";
reg = <0x1b>;
interrupt-parent = <&gpio0>;
interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&pmic_int &global_pwroff>;
rockchip,system-power-controller;
wakeup-source;
#clock-cells = <1>;
clock-output-names = "rk808-clkout1", "rk808-clkout2";
vcc1-supply = <&vcc_sys>;
vcc2-supply = <&vcc_sys>;
vcc3-supply = <&vcc_sys>;
vcc4-supply = <&vcc_sys>;
vcc6-supply = <&vcc_sys>;
vcc8-supply = <&vcc_io>;
vcc9-supply = <&vcc_io>;
vcc12-supply = <&vcc_io>;
vddio-supply = <&vcc_io>;
regulators {
vdd_cpu: DCDC_REG1 {
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <750000>;
regulator-max-microvolt = <1400000>;
regulator-name = "vdd_arm";
regulator-state-mem {
regulator-off-in-suspend;
};
};
vdd_gpu: DCDC_REG2 {
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <850000>;
regulator-max-microvolt = <1250000>;
regulator-name = "vdd_gpu";
regulator-ramp-delay = <6000>;
regulator-state-mem {
regulator-off-in-suspend;
};
};
vcc_ddr: DCDC_REG3 {
regulator-always-on;
regulator-boot-on;
regulator-name = "vcc_ddr";
regulator-state-mem {
regulator-on-in-suspend;
};
};
vcc_io: DCDC_REG4 {
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vcc_io";
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <3300000>;
};
};
vcc_tp: LDO_REG1 {
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vcc_tp";
regulator-state-mem {
regulator-off-in-suspend;
};
};
vcca_codec: LDO_REG2 {
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vcca_codec";
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <3300000>;
};
};
vdd_10: LDO_REG3 {
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <1000000>;
regulator-name = "vdd_10";
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <1000000>;
};
};
vccio_wl: LDO_REG4 {
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-name = "vccio_wl";
regulator-state-mem {
regulator-on-in-suspend;
};
};
vccio_sd: LDO_REG5 {
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vccio_sd";
regulator-state-mem {
regulator-off-in-suspend;
};
};
vdd10_lcd: LDO_REG6 {
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <1000000>;
regulator-name = "vdd10_lcd";
regulator-state-mem {
regulator-off-in-suspend;
};
};
vcc_18: LDO_REG7 {
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-name = "vcc_18";
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <1800000>;
};
};
vcc18_lcd: LDO_REG8 {
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-name = "vcc18_lcd";
regulator-state-mem {
regulator-off-in-suspend;
};
};
vcc_sd: SWITCH_REG1 {
regulator-always-on;
regulator-boot-on;
regulator-name = "vcc_sd";
regulator-state-mem {
regulator-off-in-suspend;
};
};
vcc_lcd: SWITCH_REG2 {
regulator-always-on;
regulator-boot-on;
regulator-name = "vcc_lcd";
regulator-state-mem {
regulator-off-in-suspend;
};
};
};
};
};
&i2c1 {
clock-frequency = <400000>;
status = "okay";
rk628: rk628@50 {
reg = <0x50>;
interrupt-parent = <&gpio7>;
interrupts = <15 IRQ_TYPE_LEVEL_HIGH>;
enable-gpios = <&gpio5 RK_PC2 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio7 RK_PB6 GPIO_ACTIVE_LOW>;
status = "okay";
};
};
&i2c2 {
status = "okay";
rt5651: rt5651@1a {
compatible = "rockchip,rt5651";
reg = <0x1a>;
clocks = <&cru SCLK_I2S0_OUT>;
clock-names = "mclk";
pinctrl-names = "default";
pinctrl-0 = <&i2s0_mclk>;
spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_LOW>;
#sound-dai-cells = <0>;
};
};
&i2s {
#sound-dai-cells = <0>;
status = "okay";
};
#include "rk628.dtsi"
&io_domains {
audio-supply = <&vcc_io>;
bb-supply = <&vcc_io>;
dvp-supply = <&vcc_io>;
flash0-supply = <&vcc_18>;
gpio30-supply = <&vcc_io>;
gpio1830 = <&vcc_io>;
lcdc-supply = <&vcc_lcd>;
sdcard-supply = <&vccio_sd>;
wifi-supply = <&vccio_wl>;
status = "okay";
};
&rockchip_suspend {
rockchip,pwm-regulator-config = <
(0
| PWM1_REGULATOR_EN
)
>;
status = "okay";
};
&pwm0 {
status = "okay";
};
&pwm1 {
pinctrl-names = "active";
pinctrl-0 = <&pwm1_pin_pull_down>;
status = "okay";
};
&emmc {
bus-width = <8>;
cap-mmc-highspeed;
disable-wp;
non-removable;
num-slots = <1>;
pinctrl-names = "default";
pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>;
max-frequency = <100000000>;
mmc-hs200-1_8v;
mmc-ddr-1_8v;
status = "okay";
};
&saradc {
vref-supply = <&vcc_18>;
status = "okay";
};
&sdmmc {
no-sdio;
no-mmc;
bus-width = <4>;
cap-mmc-highspeed;
sd-uhs-sdr12;
sd-uhs-sdr25;
sd-uhs-sdr50;
sd-uhs-sdr104;
cap-sd-highspeed;
card-detect-delay = <200>;
disable-wp; /* wp not hooked up */
num-slots = <1>;
pinctrl-names = "default";
pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
vmmc-supply = <&vcc_sd>;
vqmmc-supply = <&vccio_sd>;
no-sdio;
no-mmc;
status = "okay";
};
&wdt {
status = "okay";
};
&pwm0 {
status = "okay";
};
&backlight {
status = "okay";
};
&rga {
status = "okay";
};
&tsadc {
rockchip,hw-tshut-polarity = <0>;
status = "okay";
};
&usbphy {
status = "okay";
};
&usb_host0_ehci {
rockchip-relinquish-port;
status = "okay";
};
&usb_host0_ohci {
status = "okay";
};
&usb_host1 {
status = "okay";
};
&usb_otg {
status = "okay";
};
&vopb {
status = "okay";
};
&vopb_mmu {
status = "okay";
};
&vopl {
status = "okay";
};
&vopl_mmu {
status = "okay";
};
&pinctrl {
pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
drive-strength = <8>;
};
pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
bias-pull-up;
drive-strength = <8>;
};
pmic {
pmic_int: pmic-int {
rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
sdmmc {
/*
* Default drive strength isn't enough to achieve even
* high-speed mode on EVB board so bump up to 8ma.
*/
sdmmc_bus4: sdmmc-bus4 {
rockchip,pins = <6 RK_PC0 1 &pcfg_pull_up_drv_8ma>,
<6 RK_PC1 1 &pcfg_pull_up_drv_8ma>,
<6 RK_PC2 1 &pcfg_pull_up_drv_8ma>,
<6 RK_PC3 1 &pcfg_pull_up_drv_8ma>;
};
sdmmc_clk: sdmmc-clk {
rockchip,pins = <6 RK_PC4 1 &pcfg_pull_none_drv_8ma>;
};
sdmmc_cmd: sdmmc-cmd {
rockchip,pins = <6 RK_PC5 1 &pcfg_pull_up_drv_8ma>;
};
sdmmc_pwr: sdmmc-pwr {
rockchip,pins = <7 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
usb {
host_vbus_drv: host-vbus-drv {
rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
};

View File

@@ -1,391 +0,0 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
// Copyright (c) 2020 Fuzhou Rockchip Electronics Co., Ltd
#include <dt-bindings/reset/rk628-rgu.h>
#include <dt-bindings/clock/rk628-cgu.h>
/ {
rk628_xin_osc0_func: rk628-xin-osc0-func {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <24000000>;
clock-output-names = "rk628_xin_osc0_func";
};
rk628_xin_osc0_half: rk628-xin-osc0-half {
compatible = "fixed-factor-clock";
#clock-cells = <0>;
clocks = <&rk628_xin_osc0_func>;
clock-mult = <1>;
clock-div = <2>;
clock-output-names = "rk628_xin_osc0_half";
};
};
&rk628 {
compatible = "rockchip,rk628";
rk628_cru: cru {
compatible = "rockchip,rk628-cru";
#clock-cells = <1>;
#reset-cells = <1>;
status = "okay";
};
rk628_efuse: efuse {
compatible = "rockchip,rk628-efuse";
clocks = <&rk628_cru CGU_PCLK_EFUSE>;
clock-names = "pclk";
resets = <&rk628_cru RGU_EFUSE>;
#phy-cells = <0>;
status = "disabled";
};
rk628_pinctrl: pinctrl {
compatible = "rockchip,rk628-pinctrl";
status = "okay";
rk628_gpio0: rk628-gpio0 {
clocks = <&rk628_cru CGU_PCLK_GPIO0>;
clock-names = "pclk";
resets = <&rk628_cru RGU_GPIO0>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
};
rk628_gpio1: rk628-gpio1 {
clocks = <&rk628_cru CGU_PCLK_GPIO1>;
clock-names = "pclk";
resets = <&rk628_cru RGU_GPIO1>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
};
rk628_gpio2: rk628-gpio2 {
clocks = <&rk628_cru CGU_PCLK_GPIO2>;
clock-names = "pclk";
resets = <&rk628_cru RGU_GPIO2>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
};
rk628_gpio3: rk628-gpio3 {
clocks = <&rk628_cru CGU_PCLK_GPIO3>;
clock-names = "pclk";
resets = <&rk628_cru RGU_GPIO3>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
};
rk628_i2sm0_pins: i2sm0 {
pins = "gpio0a2", /* i2sm0_sck */
"gpio0a3", /* i2sm0_lr */
"gpio0a4", /* i2sm0_d0 */
"gpio0a5", /* i2sm0_d1 */
"gpio0a6", /* i2sm0_d2 */
"gpio0a7"; /* i2sm0_d3 */
function = "i2sm0";
};
rk628_hpd_in_pins: hpd-in {
pins = "gpio0b0";
function = "hpd_in";
};
rk628_ddc_tx_pins: ddc-tx {
pins = "gpio0b1", /* ddc_tx_sda */
"gpio0b2"; /* ddc_tx_scl */
function = "ddc_tx";
};
rk628_cec_tx_pins: cec-tx {
pins = "gpio0b3";
function = "cec_tx";
};
rk628_test_clkout_pins: test-clkout {
pins = "gpio1a0";
function = "test_clkout";
};
rk628_i2sm1_pins: i2sm1 {
pins = "gpio1a2", /* i2sm1_sck */
"gpio1a3", /* i2sm1_lr */
"gpio1a4", /* i2sm1_d0 */
"gpio1a5", /* i2sm1_d1 */
"gpio1a6", /* i2sm1_d2 */
"gpio1a7"; /* i2sm1_d3 */
function = "i2sm1";
};
rk628_hpdm0_out_pins: hpdm0-out {
pins = "gpio1b0";
function = "hpdm0_out";
};
rk628_ddcm0_rx_pins: ddcm0-rx {
pins = "gpio1b1", /* ddcm0_rx_sda */
"gpio1b2"; /* ddcm0_rx_scl */
function = "ddcm0_rx";
};
rk628_cecm0_rx_pins: cecm0_rx {
pins = "gpio1b3";
function = "cecm0_rx";
};
rk628_vop_pins: vop {
pins = "gpio2a0", /* vop_d0 */
"gpio2a1", /* vop_d1 */
"gpio2a2", /* vop_d2 */
"gpio2a3", /* vop_d3 */
"gpio2a4", /* vop_d4 */
"gpio2a5", /* vop_d5 */
"gpio2a6", /* vop_d6 */
"gpio2a7", /* vop_d7 */
"gpio2b0", /* vop_d8 */
"gpio2b1", /* vop_d9 */
"gpio2b2", /* vop_d10 */
"gpio2b3", /* vop_d11 */
"gpio2b4", /* vop_d12 */
"gpio2b5", /* vop_d13 */
"gpio2b6", /* vop_d14 */
"gpio2b7", /* vop_d15 */
"gpio2c0", /* vop_d16 */
"gpio2c1", /* vop_d17 */
"gpio2c2", /* vop_d18 */
"gpio2c3", /* vop_d19 */
"gpio2c4", /* vop_d20 */
"gpio2c5", /* vop_d21 */
"gpio2c6", /* vop_d22 */
"gpio2c7", /* vop_d23 */
"gpio3a0", /* vop_den */
"gpio3a1", /* vop_hsync */
"gpio3a3", /* vop_vsync */
"gpio3b0"; /* vop_dclk */
function = "vop";
drive-strength = <1>;
};
rk628_hpdm1_out: hpdm1-out {
pins = "gpio3a4";
function = "hpdm1_out";
};
rk628_ddcm1_rx_pins: ddcm1-rx {
pins = "gpio3a5", /* ddcm1_rx_sda */
"gpio3a6"; /* ddcm1_rx_scl */
function = "ddcm1_rx";
};
rk628_cecm1_rx_pins: cecm1-rx {
pins = "gpio3a7";
function = "cecm1_rx";
};
rk628_gvi_hpd_pins: gvi-hpd {
pins = "gpio3b1";
function = "gvi_hpd";
};
rk628_gvi_lock_pins: gvi-lock {
pins = "gpio3b2";
function = "gvi_lock";
};
rk628_hdmirx_cec0: hdmirx-cec0 {
pins = "hdmirx_cec";
function = "hdmirx_cec0";
};
rk628_hdmirx_cec1: hdmirx-cec1 {
pins = "hdmirx_cec";
function = "hdmirx_cec1";
};
rk628_rxddc_input0: rxddc-input0 {
pins = "rxddc_scl",
"rxddc_sda";
function = "rxddc_input0";
};
rk628_rxddc_input1: rxddc-input1 {
pins = "rxddc_scl",
"rxddc_sda";
function = "rxddc_input1";
};
rk628_i2sm0_input: i2sm0-input {
pins = "i2sm_sck",
"i2sm_d",
"i2sm_lr";
function = "i2sm0_input";
};
rk628_i2sm1_input: i2sm1-input {
pins = "i2sm_sck",
"i2sm_d",
"i2sm_lr";
function = "i2sm1_input";
};
};
rk628_combtxphy: combtxphy {
compatible = "rockchip,rk628-combtxphy";
clocks = <&rk628_cru CGU_PCLK_TXPHY_CON>, <&rk628_cru CGU_SCLK_VOP>;
clock-names = "pclk", "ref_clk";
resets = <&rk628_cru RGU_TXPHY_CON>;
#phy-cells = <0>;
status = "disabled";
};
rk628_combrxphy: combrxphy {
compatible = "rockchip,rk628-combrxphy";
clocks = <&rk628_cru CGU_PCLK_RXPHY>;
clock-names = "pclk";
resets = <&rk628_cru RGU_RXPHY>;
#phy-cells = <0>;
status = "disabled";
};
rk628_dsi0: dsi0 {
compatible = "rockchip,rk628-dsi0";
clocks = <&rk628_cru CGU_PCLK_DSI0>,
<&rk628_cru CGU_CLK_CFG_DPHY0>;
clock-names = "pclk", "cfg";
resets = <&rk628_cru RGU_DSI0>;
phys = <&rk628_combtxphy>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};
rk628_dsi1: dsi1 {
compatible = "rockchip,rk628-dsi1";
clocks = <&rk628_cru CGU_PCLK_DSI1>,
<&rk628_cru CGU_CLK_CFG_DPHY1>;
clock-names = "pclk", "cfg";
resets = <&rk628_cru RGU_DSI1>;
phys = <&rk628_combtxphy>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};
rk628_lvds: lvds {
compatible = "rockchip,rk628-lvds";
phys = <&rk628_combtxphy>;
status = "disabled";
};
rk628_gvi: gvi {
compatible = "rockchip,rk628-gvi";
clocks = <&rk628_cru CGU_PCLK_GVIHOST>;
clock-names = "pclk";
resets = <&rk628_cru RGU_GVIHOST>;
phys = <&rk628_combtxphy>;
status = "disabled";
};
rk628_rgb_tx: rgb-tx {
compatible = "rockchip,rk628-rgb-tx";
status = "disabled";
};
rk628_yuv_rx: yuv-rx {
compatible = "rockchip,rk628-yuv-rx";
status = "disabled";
};
rk628_yuv_tx: yuv-tx {
compatible = "rockchip,rk628-yuv-tx";
status = "disabled";
};
rk628_bt1120_rx: bt1120-rx {
compatible = "rockchip,rk628-bt1120-rx";
clocks = <&rk628_cru CGU_BT1120DEC>;
clock-names = "bt1120dec";
resets = <&rk628_cru RGU_BT1120DEC>;
status = "disabled";
};
rk628_bt1120_tx: bt1120-tx {
compatible = "rockchip,rk628-bt1120-tx";
status = "disabled";
};
rk628_post_process: post-process {
compatible = "rockchip,rk628-post-process";
clocks = <&rk628_cru CGU_SCLK_VOP>,
<&rk628_cru CGU_CLK_RX_READ>;
clock-names = "sclk_vop", "rx_read";
resets = <&rk628_cru RGU_DECODER>,
<&rk628_cru RGU_CLK_RX>,
<&rk628_cru RGU_VOP>;
reset-names = "decoder", "clk_rx", "vop";
status = "disabled";
};
rk628_hdmi: hdmi {
compatible = "rockchip,rk628-hdmi";
clocks = <&rk628_cru CGU_PCLK_HDMITX>,
<&rk628_cru CGU_SCLK_VOP>;
clock-names = "pclk", "dclk";
pinctrl-names = "default";
pinctrl-0 = <&rk628_hpd_in_pins &rk628_ddc_tx_pins &rk628_i2sm0_pins>;
#sound-dai-cells = <0>;
status = "disabled";
};
rk628_hdmirx: hdmirx {
compatible = "rockchip,rk628-hdmirx";
clocks = <&rk628_cru CGU_PCLK_HDMIRX>,
<&rk628_cru CGU_CLK_HDMIRX_CEC>,
<&rk628_cru CGU_CLK_HDMIRX_AUD>,
<&rk628_cru CGU_CLK_IMODET>;
clock-names = "pclk", "cec", "audio", "imodet";
resets = <&rk628_cru RGU_HDMIRX>,
<&rk628_cru RGU_HDMIRX_PON>;
reset-names = "hdmirx", "hdmirx_pon";
phys = <&rk628_combrxphy>;
status = "disabled";
};
rk628_csi: csi {
compatible = "rockchip,rk628-csi";
clocks = <&rk628_cru CGU_PCLK_HDMIRX>,
<&rk628_cru CGU_CLK_IMODET>,
<&rk628_cru CGU_CLK_HDMIRX_AUD>,
<&rk628_cru CGU_CLK_HDMIRX_CEC>,
<&rk628_cru CGU_SCLK_VOP>,
<&rk628_cru CGU_CLK_RX_READ>,
<&rk628_cru CGU_PCLK_CSI>,
<&rk628_cru CGU_CLK_TESTOUT>;
clock-names = "hdmirx", "imodet", "hdmirx_aud", "hdmirx_cec",
"vop", "rx_read", "csi0", "i2s_mclk";
assigned-clocks = <&rk628_cru CGU_CLK_TESTOUT>;
assigned-clock-parents = <&rk628_cru CGU_CLK_HDMIRX_AUD>;
resets = <&rk628_cru RGU_HDMIRX>,
<&rk628_cru RGU_HDMIRX_PON>,
<&rk628_cru RGU_DECODER>,
<&rk628_cru RGU_CLK_RX>,
<&rk628_cru RGU_VOP>,
<&rk628_cru RGU_CSI>;
reset-names = "hdmirx", "hdmirx_pon", "decoder", "clk_rx",
"vop", "csi0";
phys = <&rk628_combrxphy>, <&rk628_combtxphy>;
phy-names = "combrxphy", "combtxphy";
pinctrl-names = "default";
pinctrl-0 = <&rk628_hpdm0_out_pins &rk628_ddcm0_rx_pins &rk628_i2sm0_pins &rk628_test_clkout_pins>;
status = "disabled";
};
};

View File

@@ -76,7 +76,7 @@
&pinctrl {
buttons {
pwr_key: pwr-key {
rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_down>;
};
};
};

View File

@@ -185,10 +185,6 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb4-lp3-v10.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb5-ddr4-v10.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb6-ddr3-v10.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb6-ddr3-v10-linux.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb6-ddr3-v10-rk628-bt1120-to-hdmi.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb6-ddr3-v10-rk628-rgb2dsi.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb6-ddr3-v10-rk628-rgb2hdmi.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb6-ddr3-v10-rk628-rgb2lvds.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb6-ddr3-v10-rk630-bt656-to-cvbs.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb7-ddr4-v10.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb8-lp4-v10.dtb

View File

@@ -345,13 +345,13 @@
vcc_3v0: DCDC_REG4 {
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3000000>;
regulator-initial-mode = <0x2>;
regulator-name = "vcc_3v0";
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <3300000>;
regulator-suspend-microvolt = <3000000>;
};
};
@@ -396,13 +396,13 @@
vcc3v0_pmu: LDO_REG4 {
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3000000>;
regulator-name = "vcc3v0_pmu";
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <3300000>;
regulator-suspend-microvolt = <3000000>;
};
};

View File

@@ -1,127 +0,0 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2020 Rockchip Electronics Co., Ltd.
*/
#include "rk3568-evb6-ddr3-v10.dtsi"
#include "rk3568-android.dtsi"
&dsi0 {
status = "disabled";
};
&i2c3 {
clock-frequency = <400000>;
status = "okay";
rk628: rk628@50 {
reg = <0x50>;
interrupt-parent = <&gpio0>;
interrupts = <RK_PA0 IRQ_TYPE_LEVEL_HIGH>;
enable-gpios = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_LOW>;
status = "okay";
};
};
&video_phy0 {
status = "disabled";
};
#include <arm/rk628.dtsi>
&rk628_hdmi {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
hdmi_in_post_process: endpoint {
remote-endpoint = <&post_process_out_hdmi>;
};
};
};
};
&rk628_post_process {
pinctrl-names = "default";
pinctrl-0 = <&rk628_vop_pins>;
status = "okay";
mode-sync-pol = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
post_process_in_bt1120: endpoint {
remote-endpoint = <&bt1120_out_post_process>;
};
};
port@1 {
reg = <1>;
post_process_out_hdmi: endpoint {
remote-endpoint = <&hdmi_in_post_process>;
};
};
};
};
&rk628_bt1120_rx {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
bt1120_in_rgb: endpoint {
remote-endpoint = <&rgb_out_bt1120>;
};
};
port@1 {
reg = <1>;
bt1120_out_post_process: endpoint {
remote-endpoint = <&post_process_in_bt1120>;
};
};
};
};
&rgb {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&bt1120_pins>;
ports {
port@1 {
reg = <1>;
rgb_out_bt1120: endpoint {
remote-endpoint = <&bt1120_in_rgb>;
};
};
};
};
&rgb_in_vp2 {
status = "okay";
};
&vcc3v3_lcd1_n {
status = "disabled";
gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
enable-active-high;
};

View File

@@ -1,419 +0,0 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2020 Rockchip Electronics Co., Ltd.
*/
#include "rk3568-evb6-ddr3-v10.dtsi"
#include "rk3568-android.dtsi"
&dsi0 {
status = "disabled";
};
&video_phy0 {
status = "disabled";
};
&i2c3 {
clock-frequency = <400000>;
status = "okay";
rk628: rk628@50 {
reg = <0x50>;
interrupt-parent = <&gpio0>;
interrupts = <RK_PA0 IRQ_TYPE_LEVEL_HIGH>;
enable-gpios = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_LOW>;
status = "okay";
};
};
#include <arm/rk628.dtsi>
&backlight {
pwms = <&pwm14 0 25000 0>;
};
&pwm14 {
status = "okay";
};
&rk628_dsi0 {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
dsi0_in_post_process: endpoint {
remote-endpoint = <&post_process_out_dsi0>;
};
};
};
panel@0 {
compatible = "simple-panel-dsi";
reg = <0>;
backlight = <&backlight>;
enable-gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
prepare-delay-ms = <120>;
enable-delay-ms = <120>;
disable-delay-ms = <120>;
unprepare-delay-ms = <120>;
init-delay-ms = <120>;
dsi,flags = <(MIPI_DSI_MODE_VIDEO |
MIPI_DSI_MODE_VIDEO_BURST |
MIPI_DSI_MODE_LPM |
MIPI_DSI_MODE_EOT_PACKET)>;
dsi,format = <MIPI_DSI_FMT_RGB888>;
dsi,lanes = <4>;
panel-init-sequence = [
23 00 02 FE 21
23 00 02 04 00
23 00 02 00 64
23 00 02 2A 00
23 00 02 26 64
23 00 02 54 00
23 00 02 50 64
23 00 02 7B 00
23 00 02 77 64
23 00 02 A2 00
23 00 02 9D 64
23 00 02 C9 00
23 00 02 C5 64
23 00 02 01 71
23 00 02 27 71
23 00 02 51 71
23 00 02 78 71
23 00 02 9E 71
23 00 02 C6 71
23 00 02 02 89
23 00 02 28 89
23 00 02 52 89
23 00 02 79 89
23 00 02 9F 89
23 00 02 C7 89
23 00 02 03 9E
23 00 02 29 9E
23 00 02 53 9E
23 00 02 7A 9E
23 00 02 A0 9E
23 00 02 C8 9E
23 00 02 09 00
23 00 02 05 B0
23 00 02 31 00
23 00 02 2B B0
23 00 02 5A 00
23 00 02 55 B0
23 00 02 80 00
23 00 02 7C B0
23 00 02 A7 00
23 00 02 A3 B0
23 00 02 CE 00
23 00 02 CA B0
23 00 02 06 C0
23 00 02 2D C0
23 00 02 56 C0
23 00 02 7D C0
23 00 02 A4 C0
23 00 02 CB C0
23 00 02 07 CF
23 00 02 2F CF
23 00 02 58 CF
23 00 02 7E CF
23 00 02 A5 CF
23 00 02 CC CF
23 00 02 08 DD
23 00 02 30 DD
23 00 02 59 DD
23 00 02 7F DD
23 00 02 A6 DD
23 00 02 CD DD
23 00 02 0E 15
23 00 02 0A E9
23 00 02 36 15
23 00 02 32 E9
23 00 02 5F 15
23 00 02 5B E9
23 00 02 85 15
23 00 02 81 E9
23 00 02 AD 15
23 00 02 A9 E9
23 00 02 D3 15
23 00 02 CF E9
23 00 02 0B 14
23 00 02 33 14
23 00 02 5C 14
23 00 02 82 14
23 00 02 AA 14
23 00 02 D0 14
23 00 02 0C 36
23 00 02 34 36
23 00 02 5D 36
23 00 02 83 36
23 00 02 AB 36
23 00 02 D1 36
23 00 02 0D 6B
23 00 02 35 6B
23 00 02 5E 6B
23 00 02 84 6B
23 00 02 AC 6B
23 00 02 D2 6B
23 00 02 13 5A
23 00 02 0F 94
23 00 02 3B 5A
23 00 02 37 94
23 00 02 64 5A
23 00 02 60 94
23 00 02 8A 5A
23 00 02 86 94
23 00 02 B2 5A
23 00 02 AE 94
23 00 02 D8 5A
23 00 02 D4 94
23 00 02 10 D1
23 00 02 38 D1
23 00 02 61 D1
23 00 02 87 D1
23 00 02 AF D1
23 00 02 D5 D1
23 00 02 11 04
23 00 02 39 04
23 00 02 62 04
23 00 02 88 04
23 00 02 B0 04
23 00 02 D6 04
23 00 02 12 05
23 00 02 3A 05
23 00 02 63 05
23 00 02 89 05
23 00 02 B1 05
23 00 02 D7 05
23 00 02 18 AA
23 00 02 14 36
23 00 02 42 AA
23 00 02 3D 36
23 00 02 69 AA
23 00 02 65 36
23 00 02 8F AA
23 00 02 8B 36
23 00 02 B7 AA
23 00 02 B3 36
23 00 02 DD AA
23 00 02 D9 36
23 00 02 15 74
23 00 02 3F 74
23 00 02 66 74
23 00 02 8C 74
23 00 02 B4 74
23 00 02 DA 74
23 00 02 16 9F
23 00 02 40 9F
23 00 02 67 9F
23 00 02 8D 9F
23 00 02 B5 9F
23 00 02 DB 9F
23 00 02 17 DC
23 00 02 41 DC
23 00 02 68 DC
23 00 02 8E DC
23 00 02 B6 DC
23 00 02 DC DC
23 00 02 1D FF
23 00 02 19 03
23 00 02 47 FF
23 00 02 43 03
23 00 02 6E FF
23 00 02 6A 03
23 00 02 94 FF
23 00 02 90 03
23 00 02 BC FF
23 00 02 B8 03
23 00 02 E2 FF
23 00 02 DE 03
23 00 02 1A 35
23 00 02 44 35
23 00 02 6B 35
23 00 02 91 35
23 00 02 B9 35
23 00 02 DF 35
23 00 02 1B 45
23 00 02 45 45
23 00 02 6C 45
23 00 02 92 45
23 00 02 BA 45
23 00 02 E0 45
23 00 02 1C 55
23 00 02 46 55
23 00 02 6D 55
23 00 02 93 55
23 00 02 BB 55
23 00 02 E1 55
23 00 02 22 FF
23 00 02 1E 68
23 00 02 4C FF
23 00 02 48 68
23 00 02 73 FF
23 00 02 6F 68
23 00 02 99 FF
23 00 02 95 68
23 00 02 C1 FF
23 00 02 BD 68
23 00 02 E7 FF
23 00 02 E3 68
23 00 02 1F 7E
23 00 02 49 7E
23 00 02 70 7E
23 00 02 96 7E
23 00 02 BE 7E
23 00 02 E4 7E
23 00 02 20 97
23 00 02 4A 97
23 00 02 71 97
23 00 02 97 97
23 00 02 BF 97
23 00 02 E5 97
23 00 02 21 B5
23 00 02 4B B5
23 00 02 72 B5
23 00 02 98 B5
23 00 02 C0 B5
23 00 02 E6 B5
23 00 02 25 F0
23 00 02 23 E8
23 00 02 4F F0
23 00 02 4D E8
23 00 02 76 F0
23 00 02 74 E8
23 00 02 9C F0
23 00 02 9A E8
23 00 02 C4 F0
23 00 02 C2 E8
23 00 02 EA F0
23 00 02 E8 E8
23 00 02 24 FF
23 00 02 4E FF
23 00 02 75 FF
23 00 02 9B FF
23 00 02 C3 FF
23 00 02 E9 FF
23 00 02 FE 3D
23 00 02 00 04
23 00 02 FE 23
23 00 02 08 82
23 00 02 0A 00
23 00 02 0B 00
23 00 02 0C 01
23 00 02 16 00
23 00 02 18 02
23 00 02 1B 04
23 00 02 19 04
23 00 02 1C 81
23 00 02 1F 00
23 00 02 20 03
23 00 02 23 04
23 00 02 21 01
23 00 02 54 63
23 00 02 55 54
23 00 02 6E 45
23 00 02 6D 36
23 00 02 FE 3D
23 00 02 55 78
23 00 02 FE 20
23 00 02 26 30
23 00 02 FE 3D
23 00 02 20 71
23 00 02 50 8F
23 00 02 51 8F
23 00 02 FE 00
23 00 02 35 00
05 78 01 11
05 1E 01 29
];
panel-exit-sequence = [
05 00 01 28
05 00 01 10
];
disp_timings3: display-timings {
native-mode = <&dsi0_timing3>;
dsi0_timing3: timing0 {
clock-frequency = <132000000>;
hactive = <1080>;
vactive = <1920>;
hfront-porch = <15>;
hsync-len = <2>;
hback-porch = <30>;
vfront-porch = <15>;
vsync-len = <2>;
vback-porch = <15>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <1>;
};
};
};
};
&rk628_combtxphy {
status = "okay";
};
&rk628_post_process {
pinctrl-names = "default";
pinctrl-0 = <&rk628_vop_pins>;
status = "okay";
mode-sync-pol = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
post_process_in_rgb: endpoint {
remote-endpoint = <&rgb_out_post_process>;
};
};
port@1 {
reg = <1>;
post_process_out_dsi0: endpoint {
remote-endpoint = <&dsi0_in_post_process>;
};
};
};
};
&rgb {
status = "okay";
ports {
port@1 {
reg = <1>;
rgb_out_post_process: endpoint {
remote-endpoint = <&post_process_in_rgb>;
};
};
};
};
&rgb_in_vp2 {
status = "okay";
};
&vcc3v3_lcd1_n {
status = "disabled";
gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
enable-active-high;
};

View File

@@ -1,96 +0,0 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2020 Rockchip Electronics Co., Ltd.
*/
#include "rk3568-evb6-ddr3-v10.dtsi"
#include "rk3568-android.dtsi"
&dsi0 {
status = "disabled";
};
&i2c3 {
clock-frequency = <400000>;
status = "okay";
rk628: rk628@50 {
reg = <0x50>;
interrupt-parent = <&gpio0>;
interrupts = <RK_PA0 IRQ_TYPE_LEVEL_HIGH>;
enable-gpios = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_LOW>;
status = "okay";
};
};
#include <arm/rk628.dtsi>
&rk628_hdmi {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
hdmi_in_post_process: endpoint {
remote-endpoint = <&post_process_out_hdmi>;
};
};
};
};
&rk628_post_process {
pinctrl-names = "default";
pinctrl-0 = <&rk628_vop_pins>;
status = "okay";
mode-sync-pol = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
post_process_in_rgb: endpoint {
remote-endpoint = <&rgb_out_post_process>;
};
};
port@1 {
reg = <1>;
post_process_out_hdmi: endpoint {
remote-endpoint = <&hdmi_in_post_process>;
};
};
};
};
&rgb {
status = "okay";
ports {
port@1 {
reg = <1>;
rgb_out_post_process: endpoint {
remote-endpoint = <&post_process_in_rgb>;
};
};
};
};
&rgb_in_vp2 {
status = "okay";
};
&vcc3v3_lcd1_n {
status = "disabled";
gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
enable-active-high;
};

View File

@@ -1,173 +0,0 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2020 Rockchip Electronics Co., Ltd.
*/
#include <dt-bindings/display/media-bus-format.h>
#include "rk3568-evb6-ddr3-v10.dtsi"
#include "rk3568-android.dtsi"
/ {
vcc33_lcd: vcc33-lcd {
compatible = "regulator-fixed";
regulator-name = "vcc33_lcd";
regulator-boot-on;
regulator-always-on;
gpio = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
enable-active-high;
};
panel {
compatible = "simple-panel";
power-supply = <&vcc33_lcd>;
backlight = <&backlight>;
enable-gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>;
prepare-delay-ms = <20>;
enable-delay-ms = <20>;
disable-delay-ms = <20>;
unprepare-delay-ms = <20>;
bus-format = <MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA>;
display-timings {
native-mode = <&timing0>;
timing0: timing0 {
clock-frequency = <66600000>;
hactive = <800>;
vactive = <1280>;
hback-porch = <30>;
hfront-porch = <30>;
vback-porch = <3>;
vfront-porch = <3>;
hsync-len = <4>;
vsync-len = <2>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
};
port {
panel_in_lvds: endpoint {
remote-endpoint = <&lvds_out_panel>;
};
};
};
};
&dsi0 {
status = "disabled";
};
&video_phy0 {
status = "disabled";
};
&i2c3 {
clock-frequency = <400000>;
status = "okay";
rk628: rk628@50 {
reg = <0x50>;
interrupt-parent = <&gpio0>;
interrupts = <RK_PA0 IRQ_TYPE_LEVEL_HIGH>;
enable-gpios = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_LOW>;
status = "okay";
};
};
#include <arm/rk628.dtsi>
&backlight {
pwms = <&pwm14 0 25000 0>;
};
&pwm14 {
status = "okay";
};
&rk628_lvds {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
lvds_in_post_process: endpoint {
remote-endpoint = <&post_process_out_lvds>;
};
};
port@1 {
reg = <1>;
lvds_out_panel: endpoint {
remote-endpoint = <&panel_in_lvds>;
};
};
};
};
&rk628_combtxphy {
status = "okay";
};
&rk628_post_process {
pinctrl-names = "default";
pinctrl-0 = <&rk628_vop_pins>;
status = "okay";
mode-sync-pol = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
post_process_in_rgb: endpoint {
remote-endpoint = <&rgb_out_post_process>;
};
};
port@1 {
reg = <1>;
post_process_out_lvds: endpoint {
remote-endpoint = <&lvds_in_post_process>;
};
};
};
};
&rgb {
status = "okay";
ports {
port@1 {
reg = <1>;
rgb_out_post_process: endpoint {
remote-endpoint = <&post_process_in_rgb>;
};
};
};
};
&rgb_in_vp2 {
status = "okay";
};
&vcc3v3_lcd1_n {
status = "disabled";
gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
enable-active-high;
};
&gmac1 {
status = "disabled";
};

View File

@@ -5,14 +5,6 @@
*/
/ {
cam_ircut0: cam_ircut {
status = "okay";
compatible = "rockchip,ircut";
ircut-open-gpios = <&gpio4 RK_PA0 GPIO_ACTIVE_HIGH>;
ircut-close-gpios = <&gpio4 RK_PA1 GPIO_ACTIVE_HIGH>;
rockchip,camera-module-index = <0>;
rockchip,camera-module-facing = "back";
};
vcc_mipidphy0: vcc-mipidcphy0-regulator {
compatible = "regulator-fixed";
gpio = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>;
@@ -74,7 +66,6 @@
rockchip,camera-module-facing = "back";
rockchip,camera-module-name = "CMK-OT2022-PX1";
rockchip,camera-module-lens-name = "IR0147-50IRC-8M-F20";
lens-focus = <&cam_ircut0>;
port {
imx415_out0: endpoint {
remote-endpoint = <&mipidphy0_in_ucam0>;

View File

@@ -349,6 +349,10 @@
vin-supply = <&dphy3_vcc12v_buck>;
};
&max96712_dphy3 {
lock-gpios = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>;
};
&max96756_dphy0_vcc1v2 {
vin-supply = <&vcc5v0_buck>;
};

View File

@@ -8,9 +8,3 @@ config CLK_RK618
depends on MFD_RK618
default MFD_RK618
select COMMON_CLK_ROCKCHIP_REGMAP
config CLK_RK628
tristate "Clock driver for Rockchip RK628"
depends on MFD_RK628
default MFD_RK628
select COMMON_CLK_ROCKCHIP_REGMAP

View File

@@ -10,4 +10,3 @@ clk-rockchip-regmap-objs := clk-regmap-mux.o \
clk-regmap-pll.o
obj-$(CONFIG_CLK_RK618) += clk-rk618.o
obj-$(CONFIG_CLK_RK628) += clk-rk628.o

View File

@@ -154,23 +154,6 @@ struct clk_composite_data {
.flags = _flags, \
}
#define COMPOSITE_NOMUX(_id, _name, _parent_name, \
_div_reg, _div_shift, _div_width, \
_gate_reg, _gate_shift, _flags) \
{ \
.id = _id, \
.name = _name, \
.parent_names = (const char *[]){ _parent_name }, \
.num_parents = 1, \
.div_reg = _div_reg, \
.div_shift = _div_shift, \
.div_width = _div_width, \
.div_flags = CLK_DIVIDER_HIWORD_MASK, \
.gate_reg = _gate_reg, \
.gate_shift = _gate_shift, \
.flags = _flags, \
}
#define COMPOSITE_NODIV(_id, _name, _parent_names, \
_mux_reg, _mux_shift, _mux_width, \
_gate_reg, _gate_shift, _flags) \
@@ -197,20 +180,6 @@ struct clk_composite_data {
.flags = _flags, \
}
#define COMPOSITE_FRAC_NOMUX(_id, _name, _parent_name, \
_div_reg, \
_gate_reg, _gate_shift, _flags) \
{ \
.id = _id, \
.name = _name, \
.parent_names = (const char *[]){ _parent_name }, \
.num_parents = 1, \
.div_reg = _div_reg, \
.gate_reg = _gate_reg, \
.gate_shift = _gate_shift, \
.flags = _flags, \
}
#define COMPOSITE_FRAC_NOGATE(_id, _name, _parent_names, \
_mux_reg, _mux_shift, _mux_width, \
_div_reg, \

View File

@@ -1,609 +0,0 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2020 Rockchip Electronics Co. Ltd.
*
* Author: Wyon Bi <bivvy.bi@rock-chips.com>
*/
#include <linux/clk.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/clk-provider.h>
#include <linux/reset-controller.h>
#include <linux/mfd/rk628.h>
#include <dt-bindings/reset/rk628-rgu.h>
#include <dt-bindings/clock/rk628-cgu.h>
#include "clk-regmap.h"
#define RK628_PLL(_id, _name, _parent_name, _reg, _flags) \
PLL(_id, _name, _parent_name, _reg, 13, 12, 10, _flags)
#define REG(x) ((x) + 0xc0000)
#define CRU_CPLL_CON0 REG(0x0000)
#define CRU_CPLL_CON1 REG(0x0004)
#define CRU_CPLL_CON2 REG(0x0008)
#define CRU_CPLL_CON3 REG(0x000c)
#define CRU_CPLL_CON4 REG(0x0010)
#define CRU_GPLL_CON0 REG(0x0020)
#define CRU_GPLL_CON1 REG(0x0024)
#define CRU_GPLL_CON2 REG(0x0028)
#define CRU_GPLL_CON3 REG(0x002c)
#define CRU_GPLL_CON4 REG(0x0030)
#define CRU_MODE_CON REG(0x0060)
#define CRU_CLKSEL_CON00 REG(0x0080)
#define CRU_CLKSEL_CON01 REG(0x0084)
#define CRU_CLKSEL_CON02 REG(0x0088)
#define CRU_CLKSEL_CON03 REG(0x008c)
#define CRU_CLKSEL_CON04 REG(0x0090)
#define CRU_CLKSEL_CON05 REG(0x0094)
#define CRU_CLKSEL_CON06 REG(0x0098)
#define CRU_CLKSEL_CON07 REG(0x009c)
#define CRU_CLKSEL_CON08 REG(0x00a0)
#define CRU_CLKSEL_CON09 REG(0x00a4)
#define CRU_CLKSEL_CON10 REG(0x00a8)
#define CRU_CLKSEL_CON11 REG(0x00ac)
#define CRU_CLKSEL_CON12 REG(0x00b0)
#define CRU_CLKSEL_CON13 REG(0x00b4)
#define CRU_CLKSEL_CON14 REG(0x00b8)
#define CRU_CLKSEL_CON15 REG(0x00bc)
#define CRU_CLKSEL_CON16 REG(0x00c0)
#define CRU_CLKSEL_CON17 REG(0x00c4)
#define CRU_CLKSEL_CON18 REG(0x00c8)
#define CRU_CLKSEL_CON20 REG(0x00d0)
#define CRU_CLKSEL_CON21 REG(0x00d4)
#define CRU_GATE_CON00 REG(0x0180)
#define CRU_GATE_CON01 REG(0x0184)
#define CRU_GATE_CON02 REG(0x0188)
#define CRU_GATE_CON03 REG(0x018c)
#define CRU_GATE_CON04 REG(0x0190)
#define CRU_GATE_CON05 REG(0x0194)
#define CRU_SOFTRST_CON00 REG(0x0200)
#define CRU_SOFTRST_CON01 REG(0x0204)
#define CRU_SOFTRST_CON02 REG(0x0208)
#define CRU_SOFTRST_CON04 REG(0x0210)
#define CRU_MAX_REGISTER CRU_SOFTRST_CON04
#define reset_to_cru(_rst) container_of(_rst, struct rk628_cru, rcdev)
struct rk628_cru {
struct device *dev;
struct rk628 *parent;
struct regmap *regmap;
struct reset_controller_dev rcdev;
struct clk_onecell_data clk_data;
};
#define CNAME(x) "rk628_" x
#define PNAME(x) static const char *const x[]
PNAME(mux_cpll_osc_p) = { CNAME("xin_osc0_func"), CNAME("clk_cpll") };
PNAME(mux_gpll_osc_p) = { CNAME("xin_osc0_func"), CNAME("clk_gpll") };
PNAME(mux_cpll_gpll_mux_p) = { CNAME("clk_cpll_mux"), CNAME("clk_gpll_mux") };
PNAME(mux_mclk_i2s_8ch_p) = { CNAME("clk_i2s_8ch_src"),
CNAME("clk_i2s_8ch_frac"), CNAME("i2s_mclkin"),
CNAME("xin_osc0_half") };
PNAME(mux_i2s_mclkout_p) = { CNAME("mclk_i2s_8ch"), CNAME("xin_osc0_half") };
PNAME(mux_clk_testout_p) = { CNAME("xin_osc0_func"), CNAME("xin_osc0_half"),
CNAME("clk_gpll"), CNAME("clk_gpll_mux"),
CNAME("clk_cpll"), CNAME("clk_gpll_mux"),
CNAME("pclk_logic"), CNAME("sclk_vop"),
CNAME("mclk_i2s_8ch"), CNAME("i2s_mclkout"),
CNAME("dummy"), CNAME("clk_hdmirx_aud"),
CNAME("clk_hdmirx_cec"), CNAME("clk_imodet"),
CNAME("clk_txesc"), CNAME("clk_gpio_db0") };
static const struct clk_pll_data rk628_clk_plls[] = {
RK628_PLL(CGU_CLK_CPLL, CNAME("clk_cpll"), CNAME("xin_osc0_func"),
CRU_CPLL_CON0,
0),
RK628_PLL(CGU_CLK_GPLL, CNAME("clk_gpll"), CNAME("xin_osc0_func"),
CRU_GPLL_CON0,
0),
};
static const struct clk_mux_data rk628_clk_muxes[] = {
MUX(CGU_CLK_CPLL_MUX, CNAME("clk_cpll_mux"), mux_cpll_osc_p,
CRU_MODE_CON, 0, 1,
0),
MUX(CGU_CLK_GPLL_MUX, CNAME("clk_gpll_mux"), mux_gpll_osc_p,
CRU_MODE_CON, 2, 1,
CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT),
};
static const struct clk_gate_data rk628_clk_gates[] = {
GATE(CGU_PCLK_GPIO0, CNAME("pclk_gpio0"), CNAME("pclk_logic"),
CRU_GATE_CON01, 0,
0),
GATE(CGU_PCLK_GPIO1, CNAME("pclk_gpio1"), CNAME("pclk_logic"),
CRU_GATE_CON01, 1,
0),
GATE(CGU_PCLK_GPIO2, CNAME("pclk_gpio2"), CNAME("pclk_logic"),
CRU_GATE_CON01, 2,
0),
GATE(CGU_PCLK_GPIO3, CNAME("pclk_gpio3"), CNAME("pclk_logic"),
CRU_GATE_CON01, 3,
0),
GATE(CGU_PCLK_TXPHY_CON, CNAME("pclk_txphy_con"), CNAME("pclk_logic"),
CRU_GATE_CON02, 3,
CLK_IGNORE_UNUSED),
GATE(CGU_PCLK_EFUSE, CNAME("pclk_efuse"), CNAME("pclk_logic"),
CRU_GATE_CON00, 5,
0),
GATE(0, CNAME("pclk_i2c2apb"), CNAME("pclk_logic"),
CRU_GATE_CON00, 3,
CLK_IGNORE_UNUSED),
GATE(0, CNAME("pclk_cru"), CNAME("pclk_logic"),
CRU_GATE_CON00, 1,
CLK_IGNORE_UNUSED),
GATE(0, CNAME("pclk_adapter"), CNAME("pclk_logic"),
CRU_GATE_CON00, 7,
CLK_IGNORE_UNUSED),
GATE(0, CNAME("pclk_regfile"), CNAME("pclk_logic"),
CRU_GATE_CON00, 2,
CLK_IGNORE_UNUSED),
GATE(CGU_PCLK_DSI0, CNAME("pclk_dsi0"), CNAME("pclk_logic"),
CRU_GATE_CON02, 6,
0),
GATE(CGU_PCLK_DSI1, CNAME("pclk_dsi1"), CNAME("pclk_logic"),
CRU_GATE_CON02, 7,
0),
GATE(CGU_PCLK_CSI, CNAME("pclk_csi"), CNAME("pclk_logic"),
CRU_GATE_CON02, 8,
0),
GATE(CGU_PCLK_HDMITX, CNAME("pclk_hdmitx"), CNAME("pclk_logic"),
CRU_GATE_CON02, 4,
0),
GATE(CGU_PCLK_RXPHY, CNAME("pclk_rxphy"), CNAME("pclk_logic"),
CRU_GATE_CON02, 0,
0),
GATE(CGU_PCLK_HDMIRX, CNAME("pclk_hdmirx"), CNAME("pclk_logic"),
CRU_GATE_CON02, 2,
0),
GATE(CGU_PCLK_GVIHOST, CNAME("pclk_gvihost"), CNAME("pclk_logic"),
CRU_GATE_CON02, 5,
0),
GATE(CGU_CLK_CFG_DPHY0, CNAME("clk_cfg_dphy0"), CNAME("xin_osc0_func"),
CRU_GATE_CON02, 13,
0),
GATE(CGU_CLK_CFG_DPHY1, CNAME("clk_cfg_dphy1"), CNAME("xin_osc0_func"),
CRU_GATE_CON02, 14,
0),
GATE(CGU_CLK_TXESC, CNAME("clk_txesc"), CNAME("xin_osc0_func"),
CRU_GATE_CON02, 12,
0),
};
static const struct clk_composite_data rk628_clk_composites[] = {
COMPOSITE(CGU_CLK_IMODET, CNAME("clk_imodet"), mux_cpll_gpll_mux_p,
CRU_CLKSEL_CON05, 5, 1,
CRU_CLKSEL_CON05, 0, 5,
CRU_GATE_CON02, 11,
0),
COMPOSITE(CGU_CLK_HDMIRX_AUD, CNAME("clk_hdmirx_aud"),
mux_cpll_gpll_mux_p,
CRU_CLKSEL_CON05, 15, 1,
CRU_CLKSEL_CON05, 6, 8,
CRU_GATE_CON02, 10,
CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT),
COMPOSITE_FRAC_NOMUX(CGU_CLK_HDMIRX_CEC, CNAME("clk_hdmirx_cec"),
CNAME("xin_osc0_func"),
CRU_CLKSEL_CON12,
CRU_GATE_CON01, 15,
0),
COMPOSITE_FRAC(CGU_CLK_RX_READ, CNAME("clk_rx_read"),
mux_cpll_gpll_mux_p,
CRU_CLKSEL_CON02, 8, 1,
CRU_CLKSEL_CON14,
CRU_GATE_CON00, 11,
0),
COMPOSITE_FRAC(CGU_SCLK_VOP, CNAME("sclk_vop"), mux_cpll_gpll_mux_p,
CRU_CLKSEL_CON02, 9, 1,
CRU_CLKSEL_CON13,
CRU_GATE_CON00, 13,
CLK_SET_RATE_NO_REPARENT),
COMPOSITE(CGU_PCLK_LOGIC, CNAME("pclk_logic"), mux_cpll_gpll_mux_p,
CRU_CLKSEL_CON00, 7, 1,
CRU_CLKSEL_CON00, 0, 5,
CRU_GATE_CON00, 0,
0),
COMPOSITE_NOMUX(CGU_CLK_GPIO_DB0, CNAME("clk_gpio_db0"),
CNAME("xin_osc0_func"),
CRU_CLKSEL_CON08, 0, 10,
CRU_GATE_CON01, 4,
0),
COMPOSITE_NOMUX(CGU_CLK_GPIO_DB1, CNAME("clk_gpio_db1"),
CNAME("xin_osc0_func"),
CRU_CLKSEL_CON09, 0, 10,
CRU_GATE_CON01, 5,
0),
COMPOSITE_NOMUX(CGU_CLK_GPIO_DB2, CNAME("clk_gpio_db2"),
CNAME("xin_osc0_func"),
CRU_CLKSEL_CON10, 0, 10,
CRU_GATE_CON01, 6,
0),
COMPOSITE_NOMUX(CGU_CLK_GPIO_DB3, CNAME("clk_gpio_db3"),
CNAME("xin_osc0_func"),
CRU_CLKSEL_CON11, 0, 10,
CRU_GATE_CON01, 7,
0),
COMPOSITE(CGU_CLK_I2S_8CH_SRC, CNAME("clk_i2s_8ch_src"),
mux_cpll_gpll_mux_p,
CRU_CLKSEL_CON03, 13, 1,
CRU_CLKSEL_CON03, 8, 5,
CRU_GATE_CON03, 9,
0),
COMPOSITE_FRAC_NOMUX(CGU_CLK_I2S_8CH_FRAC, CNAME("clk_i2s_8ch_frac"),
CNAME("clk_i2s_8ch_src"),
CRU_CLKSEL_CON04,
CRU_GATE_CON03, 10,
0),
COMPOSITE_NODIV(CGU_MCLK_I2S_8CH, CNAME("mclk_i2s_8ch"),
mux_mclk_i2s_8ch_p,
CRU_CLKSEL_CON03, 14, 2,
CRU_GATE_CON03, 11,
CLK_SET_RATE_PARENT),
COMPOSITE_NODIV(CGU_I2S_MCLKOUT, CNAME("i2s_mclkout"),
mux_i2s_mclkout_p,
CRU_CLKSEL_CON03, 7, 1,
CRU_GATE_CON03, 12,
CLK_SET_RATE_PARENT),
COMPOSITE(CGU_BT1120DEC, CNAME("clk_bt1120dec"), mux_cpll_gpll_mux_p,
CRU_CLKSEL_CON02, 7, 1,
CRU_CLKSEL_CON02, 0, 5,
CRU_GATE_CON00, 12,
0),
COMPOSITE(CGU_CLK_TESTOUT, CNAME("clk_testout"), mux_clk_testout_p,
CRU_CLKSEL_CON06, 0, 4,
CRU_CLKSEL_CON06, 8, 6,
CRU_GATE_CON04, 7,
0),
};
static void rk628_clk_add_lookup(struct rk628_cru *cru, struct clk *clk,
unsigned int id)
{
if (cru->clk_data.clks && id)
cru->clk_data.clks[id] = clk;
}
static void rk628_clk_register_muxes(struct rk628_cru *cru)
{
struct clk *clk;
unsigned int i;
for (i = 0; i < ARRAY_SIZE(rk628_clk_muxes); i++) {
const struct clk_mux_data *data = &rk628_clk_muxes[i];
clk = devm_clk_regmap_register_mux(cru->dev, data->name,
data->parent_names,
data->num_parents,
cru->regmap, data->reg,
data->shift, data->width,
data->flags);
if (IS_ERR(clk)) {
dev_err(cru->dev, "failed to register clock %s\n",
data->name);
continue;
}
rk628_clk_add_lookup(cru, clk, data->id);
}
}
static void rk628_clk_register_gates(struct rk628_cru *cru)
{
struct clk *clk;
unsigned int i;
for (i = 0; i < ARRAY_SIZE(rk628_clk_gates); i++) {
const struct clk_gate_data *data = &rk628_clk_gates[i];
clk = devm_clk_regmap_register_gate(cru->dev, data->name,
data->parent_name,
cru->regmap,
data->reg, data->shift,
data->flags);
if (IS_ERR(clk)) {
dev_err(cru->dev, "failed to register clock %s\n",
data->name);
continue;
}
rk628_clk_add_lookup(cru, clk, data->id);
}
}
static void rk628_clk_register_composites(struct rk628_cru *cru)
{
struct clk *clk;
unsigned int i;
for (i = 0; i < ARRAY_SIZE(rk628_clk_composites); i++) {
const struct clk_composite_data *data =
&rk628_clk_composites[i];
clk = devm_clk_regmap_register_composite(cru->dev, data->name,
data->parent_names,
data->num_parents,
cru->regmap,
data->mux_reg,
data->mux_shift,
data->mux_width,
data->div_reg,
data->div_shift,
data->div_width,
data->div_flags,
data->gate_reg,
data->gate_shift,
data->flags);
if (IS_ERR(clk)) {
dev_err(cru->dev, "failed to register clock %s\n",
data->name);
continue;
}
rk628_clk_add_lookup(cru, clk, data->id);
}
}
static void rk628_clk_register_plls(struct rk628_cru *cru)
{
struct clk *clk;
unsigned int i;
for (i = 0; i < ARRAY_SIZE(rk628_clk_plls); i++) {
const struct clk_pll_data *data = &rk628_clk_plls[i];
clk = devm_clk_regmap_register_pll(cru->dev, data->name,
data->parent_name,
cru->regmap,
data->reg,
data->pd_shift,
data->dsmpd_shift,
data->lock_shift,
data->flags);
if (IS_ERR(clk)) {
dev_err(cru->dev, "failed to register clock %s\n",
data->name);
continue;
}
rk628_clk_add_lookup(cru, clk, data->id);
}
}
struct rk628_rgu_data {
unsigned int id;
unsigned int reg;
unsigned int bit;
};
#define RSTGEN(_id, _reg, _bit) \
{ \
.id = (_id), \
.reg = (_reg), \
.bit = (_bit), \
}
static const struct rk628_rgu_data rk628_rgu_data[] = {
RSTGEN(RGU_LOGIC, CRU_SOFTRST_CON00, 0),
RSTGEN(RGU_CRU, CRU_SOFTRST_CON00, 1),
RSTGEN(RGU_REGFILE, CRU_SOFTRST_CON00, 2),
RSTGEN(RGU_I2C2APB, CRU_SOFTRST_CON00, 3),
RSTGEN(RGU_EFUSE, CRU_SOFTRST_CON00, 5),
RSTGEN(RGU_ADAPTER, CRU_SOFTRST_CON00, 7),
RSTGEN(RGU_CLK_RX, CRU_SOFTRST_CON00, 11),
RSTGEN(RGU_BT1120DEC, CRU_SOFTRST_CON00, 12),
RSTGEN(RGU_VOP, CRU_SOFTRST_CON00, 13),
RSTGEN(RGU_GPIO0, CRU_SOFTRST_CON01, 0),
RSTGEN(RGU_GPIO1, CRU_SOFTRST_CON01, 1),
RSTGEN(RGU_GPIO2, CRU_SOFTRST_CON01, 2),
RSTGEN(RGU_GPIO3, CRU_SOFTRST_CON01, 3),
RSTGEN(RGU_GPIO_DB0, CRU_SOFTRST_CON01, 4),
RSTGEN(RGU_GPIO_DB1, CRU_SOFTRST_CON01, 5),
RSTGEN(RGU_GPIO_DB2, CRU_SOFTRST_CON01, 6),
RSTGEN(RGU_GPIO_DB3, CRU_SOFTRST_CON01, 7),
RSTGEN(RGU_RXPHY, CRU_SOFTRST_CON02, 0),
RSTGEN(RGU_HDMIRX, CRU_SOFTRST_CON02, 2),
RSTGEN(RGU_TXPHY_CON, CRU_SOFTRST_CON02, 3),
RSTGEN(RGU_HDMITX, CRU_SOFTRST_CON02, 4),
RSTGEN(RGU_GVIHOST, CRU_SOFTRST_CON02, 5),
RSTGEN(RGU_DSI0, CRU_SOFTRST_CON02, 6),
RSTGEN(RGU_DSI1, CRU_SOFTRST_CON02, 7),
RSTGEN(RGU_CSI, CRU_SOFTRST_CON02, 8),
RSTGEN(RGU_TXDATA, CRU_SOFTRST_CON02, 9),
RSTGEN(RGU_DECODER, CRU_SOFTRST_CON02, 10),
RSTGEN(RGU_ENCODER, CRU_SOFTRST_CON02, 11),
RSTGEN(RGU_HDMIRX_PON, CRU_SOFTRST_CON02, 12),
RSTGEN(RGU_TXBYTEHS, CRU_SOFTRST_CON02, 13),
RSTGEN(RGU_TXESC, CRU_SOFTRST_CON02, 14),
};
static int rk628_rgu_update(struct rk628_cru *cru, unsigned long id, int assert)
{
const struct rk628_rgu_data *data = &rk628_rgu_data[id];
return regmap_write(cru->regmap, data->reg,
BIT(data->bit + 16) | (assert << data->bit));
}
static int rk628_rgu_assert(struct reset_controller_dev *rcdev,
unsigned long id)
{
struct rk628_cru *cru = reset_to_cru(rcdev);
return rk628_rgu_update(cru, id, 1);
}
static int rk628_rgu_deassert(struct reset_controller_dev *rcdev,
unsigned long id)
{
struct rk628_cru *cru = reset_to_cru(rcdev);
return rk628_rgu_update(cru, id, 0);
}
static struct reset_control_ops rk628_rgu_ops = {
.assert = rk628_rgu_assert,
.deassert = rk628_rgu_deassert,
};
static int rk628_reset_controller_register(struct rk628_cru *cru)
{
struct device *dev = cru->dev;
cru->rcdev.owner = THIS_MODULE;
cru->rcdev.nr_resets = ARRAY_SIZE(rk628_rgu_data);
cru->rcdev.of_node = dev->of_node;
cru->rcdev.ops = &rk628_rgu_ops;
return devm_reset_controller_register(dev, &cru->rcdev);
}
static const struct regmap_range rk628_cru_readable_ranges[] = {
regmap_reg_range(CRU_CPLL_CON0, CRU_CPLL_CON4),
regmap_reg_range(CRU_GPLL_CON0, CRU_GPLL_CON4),
regmap_reg_range(CRU_MODE_CON, CRU_MODE_CON),
regmap_reg_range(CRU_CLKSEL_CON00, CRU_CLKSEL_CON21),
regmap_reg_range(CRU_GATE_CON00, CRU_GATE_CON05),
regmap_reg_range(CRU_SOFTRST_CON00, CRU_SOFTRST_CON04),
};
static const struct regmap_access_table rk628_cru_readable_table = {
.yes_ranges = rk628_cru_readable_ranges,
.n_yes_ranges = ARRAY_SIZE(rk628_cru_readable_ranges),
};
static const struct regmap_config rk628_cru_regmap_config = {
.name = "cru",
.reg_bits = 32,
.val_bits = 32,
.reg_stride = 4,
.max_register = CRU_MAX_REGISTER,
.reg_format_endian = REGMAP_ENDIAN_LITTLE,
.val_format_endian = REGMAP_ENDIAN_LITTLE,
.rd_table = &rk628_cru_readable_table,
};
static void rk628_cru_init(struct rk628_cru *cru)
{
u32 val = 0;
u8 mcu_mode;
regmap_read(cru->parent->grf, GRF_SYSTEM_STATUS0, &val);
mcu_mode = (val & I2C_ONLY_FLAG) ? 0 : 1;
if (mcu_mode)
return;
/* clock switch and first set gpll almost 99MHz */
regmap_write(cru->regmap, CRU_GPLL_CON0, 0xffff701d);
usleep_range(1000, 1100);
/* set clk_gpll_mux from gpll */
regmap_write(cru->regmap, CRU_MODE_CON, 0xffff0004);
usleep_range(1000, 1100);
/* set pclk_logic from clk_gpll_mux and set pclk div 4 */
regmap_write(cru->regmap, CRU_CLKSEL_CON00, 0xff0080);
regmap_write(cru->regmap, CRU_CLKSEL_CON00, 0xff0083);
/* set cpll almost 400MHz */
regmap_write(cru->regmap, CRU_CPLL_CON0, 0xffff3063);
usleep_range(1000, 1100);
/* set clk_cpll_mux from clk_cpll */
regmap_write(cru->regmap, CRU_MODE_CON, 0xffff0005);
/* set pclk use cpll, now div is 4 */
regmap_write(cru->regmap, CRU_CLKSEL_CON00, 0xff0003);
/* set pclk use cpll, now div is 12 */
regmap_write(cru->regmap, CRU_CLKSEL_CON00, 0xff000b);
/* gpll 983.04MHz */
regmap_write(cru->regmap, CRU_GPLL_CON0, 0xffff1028);
usleep_range(1000, 1100);
/* set pclk use gpll, nuw div is 0xb */
regmap_write(cru->regmap, CRU_CLKSEL_CON00, 0xff008b);
/* set cpll 1188MHz */
regmap_write(cru->regmap, CRU_CPLL_CON0, 0xffff1063);
usleep_range(1000, 1100);
/* set pclk use cpll, and set pclk 99MHz */
regmap_write(cru->regmap, CRU_CLKSEL_CON00, 0xff000b);
}
static int rk628_cru_probe(struct platform_device *pdev)
{
struct rk628 *rk628 = dev_get_drvdata(pdev->dev.parent);
struct device *dev = &pdev->dev;
struct rk628_cru *cru;
struct clk **clk_table;
unsigned int i;
int ret;
cru = devm_kzalloc(dev, sizeof(*cru), GFP_KERNEL);
if (!cru)
return -ENOMEM;
cru->dev = dev;
cru->parent = rk628;
platform_set_drvdata(pdev, cru);
cru->regmap = devm_regmap_init_i2c(rk628->client,
&rk628_cru_regmap_config);
if (IS_ERR(cru->regmap)) {
ret = PTR_ERR(cru->regmap);
dev_err(dev, "failed to allocate register map: %d\n", ret);
return ret;
}
rk628_cru_init(cru);
clk_table = devm_kcalloc(dev, CGU_NR_CLKS, sizeof(struct clk *),
GFP_KERNEL);
if (!clk_table)
return -ENOMEM;
for (i = 0; i < CGU_NR_CLKS; i++)
clk_table[i] = ERR_PTR(-ENOENT);
cru->clk_data.clks = clk_table;
cru->clk_data.clk_num = CGU_NR_CLKS;
rk628_clk_register_plls(cru);
rk628_clk_register_muxes(cru);
rk628_clk_register_gates(cru);
rk628_clk_register_composites(cru);
rk628_reset_controller_register(cru);
clk_prepare_enable(clk_table[CGU_PCLK_LOGIC]);
return of_clk_add_provider(dev->of_node, of_clk_src_onecell_get,
&cru->clk_data);
}
static int rk628_cru_remove(struct platform_device *pdev)
{
of_clk_del_provider(pdev->dev.of_node);
return 0;
}
static const struct of_device_id rk628_cru_of_match[] = {
{ .compatible = "rockchip,rk628-cru", },
{},
};
MODULE_DEVICE_TABLE(of, rk628_cru_of_match);
static struct platform_driver rk628_cru_driver = {
.driver = {
.name = "rk628-cru",
.of_match_table = of_match_ptr(rk628_cru_of_match),
},
.probe = rk628_cru_probe,
.remove = rk628_cru_remove,
};
module_platform_driver(rk628_cru_driver);
MODULE_AUTHOR("Wyon Bi <bivvy.bi@rock-chips.com>");
MODULE_DESCRIPTION("Rockchip RK628 CRU driver");
MODULE_LICENSE("GPL v2");

View File

@@ -933,6 +933,8 @@ static const struct drm_prop_enum_list color_format_enum_list[] = {
{ RK_IF_FORMAT_YCBCR444, "ycbcr444" },
{ RK_IF_FORMAT_YCBCR422, "ycbcr422" },
{ RK_IF_FORMAT_YCBCR420, "ycbcr420" },
{ RK_IF_FORMAT_YCBCR_HQ, "ycbcr_high_subsampling" },
{ RK_IF_FORMAT_YCBCR_LQ, "ycbcr_low_subsampling" },
};
static const struct dw_dp_output_format *dw_dp_get_output_format(u32 bus_format)
@@ -1360,7 +1362,7 @@ static int dw_dp_connector_atomic_check(struct drm_connector *conn,
}
if ((dp_new_state->color_format < RK_IF_FORMAT_RGB) ||
(dp_new_state->color_format > RK_IF_FORMAT_YCBCR420)) {
(dp_new_state->color_format > RK_IF_FORMAT_YCBCR_LQ)) {
dev_err(dp->dev, "set invalid color format:%d\n", dp_new_state->color_format);
return -EINVAL;
}
@@ -3250,6 +3252,21 @@ static struct edid *dw_dp_bridge_get_edid(struct drm_bridge *bridge,
return edid;
}
static void dw_dp_swap_fmts(u32 *fmt, int count)
{
int i;
u32 temp_fmt;
if (!count)
return;
for (i = 0; i < count / 2; i++) {
temp_fmt = fmt[i];
fmt[i] = fmt[count - i - 1];
fmt[count - i - 1] = temp_fmt;
}
}
static u32 *dw_dp_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
struct drm_bridge_state *bridge_state,
struct drm_crtc_state *crtc_state,
@@ -3314,7 +3331,11 @@ static u32 *dw_dp_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
continue;
if (dp_state->bpc != 0) {
if ((fmt->bpc != dp_state->bpc) ||
if (fmt->bpc != dp_state->bpc)
continue;
if (dp_state->color_format != RK_IF_FORMAT_YCBCR_HQ &&
dp_state->color_format != RK_IF_FORMAT_YCBCR_LQ &&
(fmt->color_format != BIT(dp_state->color_format)))
continue;
}
@@ -3325,6 +3346,9 @@ static u32 *dw_dp_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
output_fmts[j++] = fmt->bus_format;
}
if (dp_state->color_format == RK_IF_FORMAT_YCBCR_LQ)
dw_dp_swap_fmts(output_fmts, j);
*num_output_fmts = j;
return output_fmts;

View File

@@ -1443,6 +1443,7 @@ static const struct vop_win_phy rk3366_lit_win0_data = {
.enable = VOP_REG(RK3366_LIT_WIN0_CTRL0, 0x1, 0),
.format = VOP_REG(RK3366_LIT_WIN0_CTRL0, 0x7, 1),
.interlace_read = VOP_REG(RK3366_LIT_WIN0_CTRL0, 0x1, 8),
.csc_mode = VOP_REG(RK3366_LIT_WIN0_CTRL0, 0x3, 10),
.rb_swap = VOP_REG(RK3366_LIT_WIN0_CTRL0, 0x1, 12),
.act_info = VOP_REG(RK3366_LIT_WIN0_ACT_INFO, 0xffffffff, 0),
.dsp_info = VOP_REG(RK3366_LIT_WIN0_DSP_INFO, 0xffffffff, 0),
@@ -1626,6 +1627,7 @@ static const struct vop_win_phy px30_win23_data = {
.nformats = ARRAY_SIZE(formats_win_lite),
.gate = VOP_REG(RK3368_WIN2_CTRL0, 0x1, 0),
.enable = VOP_REG(RK3368_WIN2_CTRL0, 0x1, 4),
.csc_mode = VOP_REG(RK3368_WIN2_CTRL0, 0x3, 2),
.format = VOP_REG(RK3368_WIN2_CTRL0, 0x3, 5),
.rb_swap = VOP_REG(RK3368_WIN2_CTRL0, 0x1, 20),
.dsp_info = VOP_REG(RK3368_WIN2_DSP_INFO0, 0x0fff0fff, 0),

View File

@@ -2250,7 +2250,7 @@ static const struct i2c_device_id gsensor_bma2x2_id[] = {
static struct i2c_driver gsensor_bma2x2_driver = {
.probe = gsensor_bma2x2_probe,
.remove = gsensor_bma2x2_remove,
.remove = (void *)gsensor_bma2x2_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_bma2x2_id,
.driver = {

View File

@@ -325,7 +325,7 @@ static const struct i2c_device_id gsensor_da215s_id[] = {
static struct i2c_driver gsensor_da215s_driver = {
.probe = gsensor_da215s_probe,
.remove = gsensor_da215s_remove,
.remove = (void *)gsensor_da215s_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_da215s_id,
.driver = {

View File

@@ -881,7 +881,7 @@ static const struct i2c_device_id gsensor_mir3da_id[] = {
static struct i2c_driver gsensor_mir3da_driver = {
.probe = gsensor_mir3da_probe,
.remove = gsensor_mir3da_remove,
.remove = (void *)gsensor_mir3da_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_mir3da_id,
.driver = {

View File

@@ -326,7 +326,7 @@ static const struct i2c_device_id gsensor_da228e_id[] = {
static struct i2c_driver gsensor_da228e_driver = {
.probe = gsensor_da228e_probe,
.remove = gsensor_da228e_remove,
.remove = (void *)gsensor_da228e_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_da228e_id,
.driver = {

View File

@@ -435,7 +435,7 @@ static const struct i2c_device_id gsensor_dmard10_id[] = {
static struct i2c_driver gsensor_dmard10_driver = {
.probe = gsensor_dmard10_probe,
.remove = gsensor_dmard10_remove,
.remove = (void *)gsensor_dmard10_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_dmard10_id,
.driver = {

View File

@@ -221,7 +221,7 @@ static const struct i2c_device_id gsensor_iam20680_id[] = {
static struct i2c_driver gsensor_iam20680_driver = {
.probe = gsensor_iam20680_probe,
.remove = gsensor_iam20680_remove,
.remove = (void *)gsensor_iam20680_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_iam20680_id,
.driver = {

View File

@@ -242,7 +242,7 @@ static const struct i2c_device_id gsensor_icm2060x_id[] = {
static struct i2c_driver gsensor_icm2060x_driver = {
.probe = gsensor_icm2060x_probe,
.remove = gsensor_icm2060x_remove,
.remove = (void *)gsensor_icm2060x_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_icm2060x_id,
.driver = {

View File

@@ -451,7 +451,7 @@ static const struct i2c_device_id gsensor_icm4260x_id[] = {
static struct i2c_driver gsensor_icm4260x_driver = {
.probe = gsensor_icm4260x_probe,
.remove = gsensor_icm4260x_remove,
.remove = (void *)gsensor_icm4260x_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_icm4260x_id,
.driver = {

View File

@@ -341,7 +341,7 @@ static const struct i2c_device_id gsensor_kxtik_id[] = {
static struct i2c_driver gsensor_kxtik_driver = {
.probe = gsensor_kxtik_probe,
.remove = gsensor_kxtik_remove,
.remove = (void *)gsensor_kxtik_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_kxtik_id,
.driver = {

View File

@@ -314,7 +314,7 @@ static const struct i2c_device_id gsensor_kxtj9_id[] = {
static struct i2c_driver gsensor_kxtj9_driver = {
.probe = gsensor_kxtj9_probe,
.remove = gsensor_kxtj9_remove,
.remove = (void *)gsensor_kxtj9_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_kxtj9_id,
.driver = {

View File

@@ -285,7 +285,7 @@ static const struct i2c_device_id gsensor_lis3dh_id[] = {
static struct i2c_driver gsensor_lis3dh_driver = {
.probe = gsensor_lis3dh_probe,
.remove = gsensor_lis3dh_remove,
.remove = (void *)gsensor_lis3dh_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_lis3dh_id,
.driver = {

View File

@@ -344,7 +344,7 @@ static const struct i2c_device_id gsensor_lsm303d_id[] = {
static struct i2c_driver gsensor_lsm303d_driver = {
.probe = gsensor_lsm303d_probe,
.remove = gsensor_lsm303d_remove,
.remove = (void *)gsensor_lsm303d_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_lsm303d_id,
.driver = {

View File

@@ -260,7 +260,7 @@ static const struct i2c_device_id gsensor_lsm330_id[] = {
static struct i2c_driver gsensor_lsm330_driver = {
.probe = gsensor_lsm330_probe,
.remove = gsensor_lsm330_remove,
.remove = (void *)gsensor_lsm330_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_lsm330_id,
.driver = {

View File

@@ -1331,7 +1331,7 @@ static const struct i2c_device_id gsensor_mc3230_id[] = {
static struct i2c_driver gsensor_mc3230_driver = {
.probe = gsensor_mc3230_probe,
.remove = gsensor_mc3230_remove,
.remove = (void *)gsensor_mc3230_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_mc3230_id,
.driver = {

View File

@@ -240,7 +240,7 @@ static const struct i2c_device_id gsensor_mma7660_id[] = {
static struct i2c_driver gsensor_mma7660_driver = {
.probe = gsensor_mma7660_probe,
.remove = gsensor_mma7660_remove,
.remove = (void *)gsensor_mma7660_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_mma7660_id,
.driver = {

View File

@@ -406,7 +406,7 @@ static const struct i2c_device_id gsensor_mma8452_id[] = {
static struct i2c_driver gsensor_mma8452_driver = {
.probe = gsensor_mma8452_probe,
.remove = gsensor_mma8452_remove,
.remove = (void *)gsensor_mma8452_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_mma8452_id,
.driver = {

View File

@@ -282,7 +282,7 @@ static const struct i2c_device_id gsensor_mpu6500_id[] = {
static struct i2c_driver gsensor_mpu6500_driver = {
.probe = gsensor_mpu6500_probe,
.remove = gsensor_mpu6500_remove,
.remove = (void *)gsensor_mpu6500_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_mpu6500_id,
.driver = {

View File

@@ -278,7 +278,7 @@ static const struct i2c_device_id gsensor_mpu6880_id[] = {
static struct i2c_driver gsensor_mpu6880_driver = {
.probe = gsensor_mpu6880_probe,
.remove = gsensor_mpu6880_remove,
.remove = (void *)gsensor_mpu6880_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_mpu6880_id,
.driver = {

View File

@@ -266,7 +266,7 @@ static const struct i2c_device_id gsensor_mxc6225_id[] = {
static struct i2c_driver gsensor_mxc6225_driver = {
.probe = gsensor_mxc6225_probe,
.remove = gsensor_mxc6225_remove,
.remove = (void *)gsensor_mxc6225_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_mxc6225_id,
.driver = {

2
drivers/input/sensors/accel/mxc6655xa.c Executable file → Normal file
View File

@@ -244,7 +244,7 @@ static const struct i2c_device_id gsensor_mxc6655_id[] = {
static struct i2c_driver gsensor_mxc6655_driver = {
.probe = gsensor_mxc6655_probe,
.remove = gsensor_mxc6655_remove,
.remove = (void *)gsensor_mxc6655_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_mxc6655_id,
.driver = {

View File

@@ -1637,7 +1637,7 @@ static const struct i2c_device_id gsensor_sc7660_id[] = {
static struct i2c_driver gsensor_sc7660_driver = {
.probe = gsensor_sc7660_probe,
.remove = gsensor_sc7660_remove,
.remove = (void *)gsensor_sc7660_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_sc7660_id,
.driver = {

View File

@@ -1750,7 +1750,7 @@ static const struct i2c_device_id gsensor_sc7a20_id[] = {
static struct i2c_driver gsensor_sc7a20_driver = {
.probe = gsensor_sc7a20_probe,
.remove = gsensor_sc7a20_remove,
.remove = (void *)gsensor_sc7a20_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_sc7a20_id,
.driver = {

View File

@@ -1197,7 +1197,7 @@ static const struct i2c_device_id gsensor_sc7a30_id[] = {
static struct i2c_driver gsensor_sc7a30_driver = {
.probe = gsensor_sc7a30_probe,
.remove = gsensor_sc7a30_remove,
.remove = (void *)gsensor_sc7a30_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_sc7a30_id,
.driver = {

View File

@@ -938,7 +938,7 @@ static const struct i2c_device_id gsensor_stk8baxx_id[] = {
static struct i2c_driver gsensor_stk8baxx_driver = {
.probe = gsensor_stk8baxx_probe,
.remove = gsensor_stk8baxx_remove,
.remove = (void *)gsensor_stk8baxx_remove,
.shutdown = sensor_shutdown,
.id_table = gsensor_stk8baxx_id,
.driver = {

2
drivers/input/sensors/angle/angle_kxtik.c Executable file → Normal file
View File

@@ -380,7 +380,7 @@ static const struct i2c_device_id angle_kxtik_id[] = {
static struct i2c_driver angle_kxtik_driver = {
.probe = angle_kxtik_probe,
.remove = angle_kxtik_remove,
.remove = (void *)angle_kxtik_remove,
.shutdown = sensor_shutdown,
.id_table = angle_kxtik_id,
.driver = {

2
drivers/input/sensors/angle/angle_lis3dh.c Executable file → Normal file
View File

@@ -322,7 +322,7 @@ static const struct i2c_device_id angle_lis3dh_id[] = {
static struct i2c_driver angle_lis3dh_driver = {
.probe = angle_lis3dh_probe,
.remove = angle_lis3dh_remove,
.remove = (void *)angle_lis3dh_remove,
.shutdown = sensor_shutdown,
.id_table = angle_lis3dh_id,
.driver = {

View File

@@ -649,7 +649,7 @@ static const struct i2c_device_id compass_akm09911_id[] = {
static struct i2c_driver compass_akm09911_driver = {
.probe = compass_akm09911_probe,
.remove = compass_akm09911_remove,
.remove = (void *)compass_akm09911_remove,
.shutdown = sensor_shutdown,
.id_table = compass_akm09911_id,
.driver = {

View File

@@ -674,7 +674,7 @@ static const struct i2c_device_id compass_akm09918_id[] = {
static struct i2c_driver compass_akm09918_driver = {
.probe = compass_akm09918_probe,
.remove = compass_akm09918_remove,
.remove = (void *)compass_akm09918_remove,
.shutdown = sensor_shutdown,
.id_table = compass_akm09918_id,
.driver = {

View File

@@ -696,7 +696,7 @@ static const struct i2c_device_id compass_akm8963_id[] = {
static struct i2c_driver compass_akm8963_driver = {
.probe = compass_akm8963_probe,
.remove = compass_akm8963_remove,
.remove = (void *)compass_akm8963_remove,
.shutdown = sensor_shutdown,
.id_table = compass_akm8963_id,
.driver = {

View File

@@ -630,7 +630,7 @@ static const struct i2c_device_id compass_akm8975_id[] = {
static struct i2c_driver compass_akm8975_driver = {
.probe = compass_akm8975_probe,
.remove = compass_akm8975_remove,
.remove = (void *)compass_akm8975_remove,
.shutdown = sensor_shutdown,
.id_table = compass_akm8975_id,
.driver = {

View File

@@ -443,7 +443,7 @@ static const struct i2c_device_id gyro_ewtsa_id[] = {
static struct i2c_driver gyro_ewtsa_driver = {
.probe = gyro_ewtsa_probe,
.remove = gyro_ewtsa_remove,
.remove = (void *)gyro_ewtsa_remove,
.shutdown = sensor_shutdown,
.id_table = gyro_ewtsa_id,
.driver = {

View File

@@ -176,7 +176,7 @@ static const struct i2c_device_id gyro_iam20680_id[] = {
static struct i2c_driver gyro_iam20680_driver = {
.probe = gyro_iam20680_probe,
.remove = gyro_iam20680_remove,
.remove = (void *)gyro_iam20680_remove,
.shutdown = sensor_shutdown,
.id_table = gyro_iam20680_id,
.driver = {

View File

@@ -186,7 +186,7 @@ static const struct i2c_device_id gyro_icm2060x_id[] = {
static struct i2c_driver gyro_icm2060x_driver = {
.probe = gyro_icm2060x_probe,
.remove = gyro_icm2060x_remove,
.remove = (void *)gyro_icm2060x_remove,
.shutdown = sensor_shutdown,
.id_table = gyro_icm2060x_id,
.driver = {

View File

@@ -182,7 +182,7 @@ static const struct i2c_device_id gyro_icm4260x_id[] = {
static struct i2c_driver gyro_icm4260x_driver = {
.probe = gyro_icm4260x_probe,
.remove = gyro_icm4260x_remove,
.remove = (void *)gyro_icm4260x_remove,
.shutdown = sensor_shutdown,
.id_table = gyro_icm4260x_id,
.driver = {

View File

@@ -239,7 +239,7 @@ static const struct i2c_device_id gyro_l3g20d_id[] = {
static struct i2c_driver gyro_l3g20d_driver = {
.probe = gyro_l3g20d_probe,
.remove = gyro_l3g20d_remove,
.remove = (void *)gyro_l3g20d_remove,
.shutdown = sensor_shutdown,
.id_table = gyro_l3g20d_id,
.driver = {

View File

@@ -239,7 +239,7 @@ static const struct i2c_device_id gyro_l3g4200d_id[] = {
static struct i2c_driver gyro_l3g4200d_driver = {
.probe = gyro_l3g4200d_probe,
.remove = gyro_l3g4200d_remove,
.remove = (void *)gyro_l3g4200d_remove,
.shutdown = sensor_shutdown,
.id_table = gyro_l3g4200d_id,
.driver = {

View File

@@ -244,7 +244,7 @@ static const struct i2c_device_id gyro_lsm330_id[] = {
static struct i2c_driver gyro_lsm330_driver = {
.probe = gyro_lsm330_probe,
.remove = gyro_lsm330_remove,
.remove = (void *)gyro_lsm330_remove,
.shutdown = sensor_shutdown,
.id_table = gyro_lsm330_id,
.driver = {

View File

@@ -186,7 +186,7 @@ static const struct i2c_device_id gyro_mpu6500_id[] = {
static struct i2c_driver gyro_mpu6500_driver = {
.probe = gyro_mpu6500_probe,
.remove = gyro_mpu6500_remove,
.remove = (void *)gyro_mpu6500_remove,
.shutdown = sensor_shutdown,
.id_table = gyro_mpu6500_id,
.driver = {

View File

@@ -186,7 +186,7 @@ static const struct i2c_device_id gyro_mpu6880_id[] = {
static struct i2c_driver gyro_mpu6880_driver = {
.probe = gyro_mpu6880_probe,
.remove = gyro_mpu6880_remove,
.remove = (void *)gyro_mpu6880_remove,
.shutdown = sensor_shutdown,
.id_table = gyro_mpu6880_id,
.driver = {

View File

@@ -141,7 +141,7 @@ static const struct i2c_device_id hall_och165t_id[] = {
static struct i2c_driver hall_och165t_driver = {
.probe = hall_och165t_probe,
.remove = hall_och165t_remove,
.remove = (void *)hall_och165t_remove,
.shutdown = sensor_shutdown,
.id_table = hall_och165t_id,
.driver = {

2
drivers/input/sensors/lsensor/cm3217.c Executable file → Normal file
View File

@@ -220,7 +220,7 @@ static const struct i2c_device_id light_cm3217_id[] = {
static struct i2c_driver light_cm3217_driver = {
.probe = light_cm3217_probe,
.remove = light_cm3217_remove,
.remove = (void *)light_cm3217_remove,
.shutdown = sensor_shutdown,
.id_table = light_cm3217_id,
.driver = {

View File

@@ -397,7 +397,7 @@ static const struct i2c_device_id light_cm3218_id[] = {
static struct i2c_driver light_cm3218_driver = {
.probe = light_cm3218_probe,
.remove = light_cm3218_remove,
.remove = (void *)light_cm3218_remove,
.shutdown = sensor_shutdown,
.id_table = light_cm3218_id,
.driver = {

2
drivers/input/sensors/lsensor/cm3232.c Executable file → Normal file
View File

@@ -227,7 +227,7 @@ static const struct i2c_device_id light_cm3232_id[] = {
static struct i2c_driver light_cm3232_driver = {
.probe = light_cm3232_probe,
.remove = light_cm3232_remove,
.remove = (void *)light_cm3232_remove,
.shutdown = sensor_shutdown,
.id_table = light_cm3232_id,
.driver = {

2
drivers/input/sensors/lsensor/isl29023.c Executable file → Normal file
View File

@@ -255,7 +255,7 @@ static const struct i2c_device_id light_isl29023_id[] = {
static struct i2c_driver light_isl29023_driver = {
.probe = light_isl29023_probe,
.remove = light_isl29023_remove,
.remove = (void *)light_isl29023_remove,
.shutdown = sensor_shutdown,
.id_table = light_isl29023_id,
.driver = {

2
drivers/input/sensors/lsensor/ls_al3006.c Executable file → Normal file
View File

@@ -282,7 +282,7 @@ static const struct i2c_device_id light_al3006_id[] = {
static struct i2c_driver light_al3006_driver = {
.probe = light_al3006_probe,
.remove = light_al3006_remove,
.remove = (void *)light_al3006_remove,
.shutdown = sensor_shutdown,
.id_table = light_al3006_id,
.driver = {

View File

@@ -395,7 +395,7 @@ static const struct i2c_device_id light_ap321xx_id[] = {
static struct i2c_driver light_ap321xx_driver = {
.probe = light_ap321xx_probe,
.remove = light_ap321xx_remove,
.remove = (void *)light_ap321xx_remove,
.shutdown = sensor_shutdown,
.id_table = light_ap321xx_id,
.driver = {

View File

@@ -265,7 +265,7 @@ static const struct i2c_device_id light_em3071x_id[] = {
static struct i2c_driver light_em3071x_driver = {
.probe = light_em3071x_probe,
.remove = light_em3071x_remove,
.remove = (void *)light_em3071x_remove,
.shutdown = sensor_shutdown,
.id_table = light_em3071x_id,
.driver = {

2
drivers/input/sensors/lsensor/ls_stk3171.c Executable file → Normal file
View File

@@ -301,7 +301,7 @@ static const struct i2c_device_id light_stk3171_id[] = {
static struct i2c_driver light_stk3171_driver = {
.probe = light_stk3171_probe,
.remove = light_stk3171_remove,
.remove = (void *)light_stk3171_remove,
.shutdown = sensor_shutdown,
.id_table = light_stk3171_id,
.driver = {

View File

@@ -354,7 +354,7 @@ static const struct i2c_device_id light_stk3332_id[] = {
static struct i2c_driver light_stk3332_driver = {
.probe = light_stk3332_probe,
.remove = light_stk3332_remove,
.remove = (void *)light_stk3332_remove,
.shutdown = sensor_shutdown,
.id_table = light_stk3332_id,
.driver = {

View File

@@ -356,7 +356,7 @@ static const struct i2c_device_id light_stk3410_id[] = {
static struct i2c_driver light_stk3410_driver = {
.probe = light_stk3410_probe,
.remove = light_stk3410_remove,
.remove = (void *)light_stk3410_remove,
.shutdown = sensor_shutdown,
.id_table = light_stk3410_id,
.driver = {

View File

@@ -344,7 +344,7 @@ static const struct i2c_device_id light_ucs14620_id[] = {
static struct i2c_driver light_ucs14620_driver = {
.probe = light_ucs14620_probe,
.remove = light_ucs14620_remove,
.remove = (void *)light_ucs14620_remove,
.shutdown = sensor_shutdown,
.id_table = light_ucs14620_id,
.driver = {

View File

@@ -420,7 +420,7 @@ static const struct i2c_device_id light_us5152_id[] = {
static struct i2c_driver light_us5152_driver = {
.probe = light_us5152_probe,
.remove = light_us5152_remove,
.remove = (void *)light_us5152_remove,
.shutdown = sensor_shutdown,
.id_table = light_us5152_id,
.driver = {

2
drivers/input/sensors/pressure/pr_ms5607.c Executable file → Normal file
View File

@@ -279,7 +279,7 @@ static const struct i2c_device_id pressure_ms5607_id[] = {
static struct i2c_driver pressure_ms5607_driver = {
.probe = pressure_ms5607_probe,
.remove = pressure_ms5607_remove,
.remove = (void *)pressure_ms5607_remove,
.shutdown = sensor_shutdown,
.id_table = pressure_ms5607_id,
.driver = {

2
drivers/input/sensors/psensor/ps_al3006.c Executable file → Normal file
View File

@@ -243,7 +243,7 @@ static const struct i2c_device_id proximity_al3006_id[] = {
static struct i2c_driver proximity_al3006_driver = {
.probe = proximity_al3006_probe,
.remove = proximity_al3006_remove,
.remove = (void *)proximity_al3006_remove,
.shutdown = sensor_shutdown,
.id_table = proximity_al3006_id,
.driver = {

View File

@@ -307,7 +307,7 @@ static const struct i2c_device_id proximity_ap321xx_id[] = {
static struct i2c_driver proximity_ap321xx_driver = {
.probe = proximity_ap321xx_probe,
.remove = proximity_ap321xx_remove,
.remove = (void *)proximity_ap321xx_remove,
.shutdown = sensor_shutdown,
.id_table = proximity_ap321xx_id,
.driver = {

View File

@@ -262,7 +262,7 @@ static const struct i2c_device_id proximity_em3071x_id[] = {
static struct i2c_driver proximity_em3071x_driver = {
.probe = proximity_em3071x_probe,
.remove = proximity_em3071x_remove,
.remove = (void *)proximity_em3071x_remove,
.shutdown = sensor_shutdown,
.id_table = proximity_em3071x_id,
.driver = {

2
drivers/input/sensors/psensor/ps_stk3171.c Executable file → Normal file
View File

@@ -250,7 +250,7 @@ static const struct i2c_device_id proximity_stk3171_id[] = {
static struct i2c_driver proximity_stk3171_driver = {
.probe = proximity_stk3171_probe,
.remove = proximity_stk3171_remove,
.remove = (void *)proximity_stk3171_remove,
.shutdown = sensor_shutdown,
.id_table = proximity_stk3171_id,
.driver = {

View File

@@ -365,7 +365,7 @@ static const struct i2c_device_id proximity_stk3332_id[] = {
static struct i2c_driver proximity_stk3332_driver = {
.probe = proximity_stk3332_probe,
.remove = proximity_stk3332_remove,
.remove = (void *)proximity_stk3332_remove,
.shutdown = sensor_shutdown,
.id_table = proximity_stk3332_id,
.driver = {

View File

@@ -359,7 +359,7 @@ static const struct i2c_device_id proximity_stk3410_id[] = {
static struct i2c_driver proximity_stk3410_driver = {
.probe = proximity_stk3410_probe,
.remove = proximity_stk3410_remove,
.remove = (void *)proximity_stk3410_remove,
.shutdown = sensor_shutdown,
.id_table = proximity_stk3410_id,
.driver = {

View File

@@ -343,7 +343,7 @@ static const struct i2c_device_id proximity_ucs14620_id[] = {
static struct i2c_driver proximity_ucs14620_driver = {
.probe = proximity_ucs14620_probe,
.remove = proximity_ucs14620_remove,
.remove = (void *)proximity_ucs14620_remove,
.shutdown = sensor_shutdown,
.id_table = proximity_ucs14620_id,
.driver = {

0
drivers/input/sensors/sensor-i2c.c Executable file → Normal file
View File

2
drivers/input/sensors/temperature/tmp_ms5607.c Executable file → Normal file
View File

@@ -296,7 +296,7 @@ static const struct i2c_device_id temperature_ms5607_id[] = {
static struct i2c_driver temperature_ms5607_driver = {
.probe = temperature_ms5607_probe,
.remove = temperature_ms5607_remove,
.remove = (void *)temperature_ms5607_remove,
.shutdown = sensor_shutdown,
.id_table = temperature_ms5607_id,
.driver = {

View File

@@ -2457,15 +2457,15 @@ int __imx415_power_on(struct imx415 *imx415)
if (imx415->is_thunderboot)
return 0;
/* At least 20us between XCLR and I2C communication */
usleep_range(20*1000, 30*1000);
ret = regulator_bulk_enable(IMX415_NUM_SUPPLIES, imx415->supplies);
if (ret < 0) {
dev_err(dev, "Failed to enable regulators\n");
goto err_pinctrl;
}
/* At least 20us between XCLR and I2C communication */
usleep_range(20*1000, 30*1000);
return 0;
err_pinctrl:

View File

@@ -13,6 +13,7 @@
#include <linux/i2c.h>
#include <linux/i2c-mux.h>
#include "maxim2c_compact.h"
#include "maxim2c_i2c.h"
#include "maxim2c_link.h"
#include "maxim2c_video_pipe.h"

View File

@@ -0,0 +1,52 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2024 Rockchip Electronics Co., Ltd.
*
*/
#ifndef __MAXIM2C_COMPACT_H__
#define __MAXIM2C_COMPACT_H__
#include <linux/version.h>
#if KERNEL_VERSION(5, 10, 0) > LINUX_VERSION_CODE
enum rkmodule_pad_type {
PAD0,
PAD1,
PAD2,
PAD3,
PAD_MAX,
};
#ifndef fallthrough
#define fallthrough
#endif
#ifndef read_poll_timeout
#define read_poll_timeout(op, val, cond, sleep_us, timeout_us, \
sleep_before_read, args...) \
{ \
u64 __timeout_us = (timeout_us); \
unsigned long __sleep_us = (sleep_us); \
ktime_t __timeout = ktime_add_us(ktime_get(), __timeout_us); \
might_sleep_if((__sleep_us) != 0); \
if (sleep_before_read && __sleep_us) \
usleep_range((__sleep_us >> 2) + 1, __sleep_us); \
for (;;) { \
(val) = op(args); \
if (cond) \
break; \
if (__timeout_us && \
ktime_compare(ktime_get(), __timeout) > 0) { \
(val) = op(args); \
break; \
} \
if (__sleep_us) \
usleep_range((__sleep_us >> 2) + 1, __sleep_us); \
cpu_relax(); \
} \
(cond) ? 0 : -ETIMEDOUT; \
}
#endif /* read_poll_timeout */
#endif /* LINUX_VERSION_CODE */
#endif /* __MAXIM2C_COMPACT_H__ */

View File

@@ -24,6 +24,10 @@
* 2. remote serializer is abstracted as v4l2 subdev
* 3. remote camera is bound to remote serializer
*
* V3.01.00
* 1. fixed remote camera s_stream and s_power api return error.
* 2. compatible with kernel v4.19/v5.10/v6.1
*
*/
#include <linux/clk.h>
#include <linux/i2c.h>
@@ -51,7 +55,7 @@
#include "maxim2c_api.h"
#define DRIVER_VERSION KERNEL_VERSION(3, 0x00, 0x00)
#define DRIVER_VERSION KERNEL_VERSION(3, 0x01, 0x00)
#define MAXIM2C_XVCLK_FREQ 25000000
@@ -725,7 +729,11 @@ err_destroy_mutex:
return ret;
}
#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE
static int maxim2c_remove(struct i2c_client *client)
#else
static void maxim2c_remove(struct i2c_client *client)
#endif
{
struct v4l2_subdev *sd = i2c_get_clientdata(client);
maxim2c_t *maxim2c = v4l2_get_subdevdata(sd);
@@ -742,8 +750,9 @@ static int maxim2c_remove(struct i2c_client *client)
if (!pm_runtime_status_suspended(&client->dev))
maxim2c_device_power_off(maxim2c);
pm_runtime_set_suspended(&client->dev);
#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE
return 0;
#endif
}
static const struct of_device_id maxim2c_of_match[] = {

View File

@@ -36,7 +36,11 @@ static const struct maxim2c_mode maxim2c_pattern_mode = {
.link_freq_idx = 24,
.bus_fmt = MEDIA_BUS_FMT_RGB888_1X24,
.bpp = 24,
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
.vc[PAD0] = 0,
#else
.vc[PAD0] = V4L2_MBUS_CSI2_CHANNEL_0,
#endif
};
int maxim2c_pattern_enable(maxim2c_t *maxim2c, bool enable)

View File

@@ -24,7 +24,7 @@ int maxim2c_remote_devices_power(maxim2c_t *maxim2c, u8 link_mask, int on)
struct device_node *remote_cam_node = NULL;
struct i2c_client *remote_cam_client = NULL;
struct v4l2_subdev *remote_cam_sd = NULL;
int ret = 0, i = 0;
int ret = 0, error = 0, i = 0;
dev_dbg(dev, "%s: link mask = 0x%02x, on = %d\n", __func__, link_mask, on);
@@ -57,7 +57,11 @@ int maxim2c_remote_devices_power(maxim2c_t *maxim2c, u8 link_mask, int on)
}
dev_info(dev, "link id = %d remote camera power = %d\n", i, on);
ret |= v4l2_subdev_call(remote_cam_sd, core, s_power, on);
error = v4l2_subdev_call(remote_cam_sd, core, s_power, on);
if (error < 0) {
ret |= error;
dev_err(dev, "link id = %d remote camera power error = %d\n", i, error);
}
}
return ret;
@@ -72,7 +76,7 @@ int maxim2c_remote_devices_s_stream(maxim2c_t *maxim2c, u8 link_mask, int enable
struct device_node *remote_cam_node = NULL;
struct i2c_client *remote_cam_client = NULL;
struct v4l2_subdev *remote_cam_sd = NULL;
int ret = 0, i = 0;
int ret = 0, error = 0, i = 0;
dev_dbg(dev, "%s: link mask = 0x%02x, enable = %d\n", __func__, link_mask, enable);
@@ -105,7 +109,11 @@ int maxim2c_remote_devices_s_stream(maxim2c_t *maxim2c, u8 link_mask, int enable
}
dev_info(dev, "link id = %d remote camera s_stream = %d\n", i, enable);
ret |= v4l2_subdev_call(remote_cam_sd, video, s_stream, enable);
error = v4l2_subdev_call(remote_cam_sd, video, s_stream, enable);
if (error < 0) {
ret |= error;
dev_err(dev, "link id = %d remote camera s_stream error = %d\n", i, error);
}
}
return ret;

View File

@@ -66,10 +66,17 @@ static const struct maxim2c_mode maxim2c_def_mode = {
.link_freq_idx = 15,
.bus_fmt = MEDIA_BUS_FMT_UYVY8_2X8,
.bpp = 16,
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
.vc[PAD0] = 0,
.vc[PAD1] = 1,
.vc[PAD2] = 2,
.vc[PAD3] = 3,
#else
.vc[PAD0] = V4L2_MBUS_CSI2_CHANNEL_0,
.vc[PAD1] = V4L2_MBUS_CSI2_CHANNEL_1,
.vc[PAD2] = V4L2_MBUS_CSI2_CHANNEL_2,
.vc[PAD3] = V4L2_MBUS_CSI2_CHANNEL_3,
#endif /* LINUX_VERSION_CODE */
};
static struct rkmodule_csi_dphy_param rk3588_dcphy_param = {
@@ -212,8 +219,13 @@ static int maxim2c_support_mode_init(maxim2c_t *maxim2c)
static int maxim2c_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{
maxim2c_t *maxim2c = v4l2_get_subdevdata(sd);
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
struct v4l2_mbus_framefmt *try_fmt =
v4l2_subdev_get_try_format(sd, fh->state, 0);
#else
struct v4l2_mbus_framefmt *try_fmt =
v4l2_subdev_get_try_format(sd, fh->pad, 0);
#endif
const struct maxim2c_mode *def_mode = &maxim2c->supported_mode;
mutex_lock(&maxim2c->mutex);
@@ -598,7 +610,11 @@ static int maxim2c_s_stream(struct v4l2_subdev *sd, int on)
goto unlock_and_return;
if (on) {
#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE
ret = pm_runtime_resume_and_get(&client->dev);
#else
ret = pm_runtime_get_sync(&client->dev);
#endif
if (ret < 0)
goto unlock_and_return;
@@ -635,9 +651,15 @@ static int maxim2c_g_frame_interval(struct v4l2_subdev *sd,
return 0;
}
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int maxim2c_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
#else
static int maxim2c_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_mbus_code_enum *code)
#endif
{
maxim2c_t *maxim2c = v4l2_get_subdevdata(sd);
const struct maxim2c_mode *mode = maxim2c->cur_mode;
@@ -649,9 +671,15 @@ static int maxim2c_enum_mbus_code(struct v4l2_subdev *sd,
return 0;
}
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int maxim2c_enum_frame_sizes(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse)
#else
static int maxim2c_enum_frame_sizes(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_frame_size_enum *fse)
#endif
{
maxim2c_t *maxim2c = v4l2_get_subdevdata(sd);
@@ -669,10 +697,15 @@ static int maxim2c_enum_frame_sizes(struct v4l2_subdev *sd,
return 0;
}
static int
maxim2c_enum_frame_interval(struct v4l2_subdev *sd,
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int maxim2c_enum_frame_interval(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_interval_enum *fie)
#else
static int maxim2c_enum_frame_interval(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_frame_interval_enum *fie)
#endif
{
maxim2c_t *maxim2c = v4l2_get_subdevdata(sd);
@@ -687,9 +720,15 @@ maxim2c_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int maxim2c_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
#else
static int maxim2c_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_format *fmt)
#endif
{
maxim2c_t *maxim2c = v4l2_get_subdevdata(sd);
const struct maxim2c_mode *mode = maxim2c->cur_mode;
@@ -697,7 +736,11 @@ static int maxim2c_get_fmt(struct v4l2_subdev *sd,
mutex_lock(&maxim2c->mutex);
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
fmt->format = *v4l2_subdev_get_try_format(sd, sd_state, fmt->pad);
#else
fmt->format = *v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
#endif
#else
mutex_unlock(&maxim2c->mutex);
return -ENOTTY;
@@ -717,9 +760,15 @@ static int maxim2c_get_fmt(struct v4l2_subdev *sd,
return 0;
}
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int maxim2c_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
#else
static int maxim2c_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_format *fmt)
#endif
{
maxim2c_t *maxim2c = v4l2_get_subdevdata(sd);
struct device *dev = &maxim2c->client->dev;
@@ -737,7 +786,11 @@ static int maxim2c_set_fmt(struct v4l2_subdev *sd,
fmt->format.field = V4L2_FIELD_NONE;
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
*v4l2_subdev_get_try_format(sd, sd_state, fmt->pad) = fmt->format;
#else
*v4l2_subdev_get_try_format(sd, cfg, fmt->pad) = fmt->format;
#endif
#else
mutex_unlock(&maxim2c->mutex);
return -ENOTTY;
@@ -769,9 +822,15 @@ static int maxim2c_set_fmt(struct v4l2_subdev *sd,
return 0;
}
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int maxim2c_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel)
#else
static int maxim2c_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_selection *sel)
#endif
{
maxim2c_t *maxim2c = v4l2_get_subdevdata(sd);
@@ -786,6 +845,18 @@ static int maxim2c_get_selection(struct v4l2_subdev *sd,
return -EINVAL;
}
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int maxim2c_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
struct v4l2_mbus_config *config)
{
struct maxim2c *maxim2c = v4l2_get_subdevdata(sd);
config->type = V4L2_MBUS_CSI2_DPHY;
config->bus.mipi_csi2 = maxim2c->bus_cfg.bus.mipi_csi2;
return 0;
}
#elif KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE
static int maxim2c_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
struct v4l2_mbus_config *config)
{
@@ -804,6 +875,26 @@ static int maxim2c_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
return 0;
}
#else
static int maxim2c_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
maxim2c_t *maxim2c = v4l2_get_subdevdata(sd);
u32 val = 0;
u8 data_lanes = maxim2c->bus_cfg.bus.mipi_csi2.num_data_lanes;
val |= V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
val |= (1 << (data_lanes - 1));
val |= V4L2_MBUS_CSI2_CHANNEL_3 | V4L2_MBUS_CSI2_CHANNEL_2 |
V4L2_MBUS_CSI2_CHANNEL_1 | V4L2_MBUS_CSI2_CHANNEL_0;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
#endif /* LINUX_VERSION_CODE */
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
static const struct v4l2_subdev_internal_ops maxim2c_internal_ops = {
@@ -822,6 +913,9 @@ static const struct v4l2_subdev_core_ops maxim2c_core_ops = {
static const struct v4l2_subdev_video_ops maxim2c_video_ops = {
.s_stream = maxim2c_s_stream,
.g_frame_interval = maxim2c_g_frame_interval,
#if KERNEL_VERSION(5, 10, 0) > LINUX_VERSION_CODE
.g_mbus_config = maxim2c_g_mbus_config,
#endif
};
static const struct v4l2_subdev_pad_ops maxim2c_pad_ops = {
@@ -831,7 +925,9 @@ static const struct v4l2_subdev_pad_ops maxim2c_pad_ops = {
.get_fmt = maxim2c_get_fmt,
.set_fmt = maxim2c_set_fmt,
.get_selection = maxim2c_get_selection,
#if KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE
.get_mbus_config = maxim2c_g_mbus_config,
#endif
};
static const struct v4l2_subdev_ops maxim2c_subdev_ops = {
@@ -960,7 +1056,11 @@ int maxim2c_v4l2_subdev_init(maxim2c_t *maxim2c)
maxim2c->module_index, facing, MAXIM2C_NAME,
dev_name(sd->dev));
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
ret = v4l2_async_register_subdev_sensor(sd);
#else
ret = v4l2_async_register_subdev_sensor_common(sd);
#endif
if (ret) {
dev_err(dev, "v4l2 async register subdev failed\n");
goto err_clean_entity;

View File

@@ -13,6 +13,7 @@
#include <linux/i2c.h>
#include <linux/i2c-mux.h>
#include "maxim4c_compact.h"
#include "maxim4c_i2c.h"
#include "maxim4c_link.h"
#include "maxim4c_video_pipe.h"

View File

@@ -0,0 +1,52 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2024 Rockchip Electronics Co., Ltd.
*
*/
#ifndef __MAXIM4C_COMPACT_H__
#define __MAXIM4C_COMPACT_H__
#include <linux/version.h>
#if KERNEL_VERSION(5, 10, 0) > LINUX_VERSION_CODE
enum rkmodule_pad_type {
PAD0,
PAD1,
PAD2,
PAD3,
PAD_MAX,
};
#ifndef fallthrough
#define fallthrough
#endif
#ifndef read_poll_timeout
#define read_poll_timeout(op, val, cond, sleep_us, timeout_us, \
sleep_before_read, args...) \
({ \
u64 __timeout_us = (timeout_us); \
unsigned long __sleep_us = (sleep_us); \
ktime_t __timeout = ktime_add_us(ktime_get(), __timeout_us); \
might_sleep_if((__sleep_us) != 0); \
if (sleep_before_read && __sleep_us) \
usleep_range((__sleep_us >> 2) + 1, __sleep_us); \
for (;;) { \
(val) = op(args); \
if (cond) \
break; \
if (__timeout_us && \
ktime_compare(ktime_get(), __timeout) > 0) { \
(val) = op(args); \
break; \
} \
if (__sleep_us) \
usleep_range((__sleep_us >> 2) + 1, __sleep_us); \
cpu_relax(); \
} \
(cond) ? 0 : -ETIMEDOUT; \
})
#endif /* read_poll_timeout */
#endif /* LINUX_VERSION_CODE */
#endif /* __MAXIM4C_COMPACT_H__ */

View File

@@ -47,6 +47,10 @@
* 2. remote serializer is abstracted as v4l2 subdev
* 3. remote camera is bound to remote serializer
*
* V3.01.00
* 1. fixed remote camera s_stream and s_power api return error.
* 2. compatible with kernel v4.19/v5.10/v6.1
*
*/
#include <linux/clk.h>
#include <linux/i2c.h>
@@ -74,7 +78,7 @@
#include "maxim4c_api.h"
#define DRIVER_VERSION KERNEL_VERSION(3, 0x00, 0x00)
#define DRIVER_VERSION KERNEL_VERSION(3, 0x01, 0x00)
#define MAXIM4C_XVCLK_FREQ 25000000
@@ -799,7 +803,11 @@ err_destroy_mutex:
return ret;
}
#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE
static int maxim4c_remove(struct i2c_client *client)
#else
static void maxim4c_remove(struct i2c_client *client)
#endif
{
struct v4l2_subdev *sd = i2c_get_clientdata(client);
maxim4c_t *maxim4c = v4l2_get_subdevdata(sd);
@@ -818,8 +826,9 @@ static int maxim4c_remove(struct i2c_client *client)
if (!pm_runtime_status_suspended(&client->dev))
maxim4c_device_power_off(maxim4c);
pm_runtime_set_suspended(&client->dev);
#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE
return 0;
#endif
}
static const struct of_device_id maxim4c_of_match[] = {

View File

@@ -42,7 +42,11 @@ static const struct maxim4c_mode maxim4c_pattern_mode = {
.link_freq_idx = 15,
.bus_fmt = MEDIA_BUS_FMT_RGB888_1X24,
.bpp = 24,
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
.vc[PAD0] = 0,
#else
.vc[PAD0] = V4L2_MBUS_CSI2_CHANNEL_0,
#endif
};
/* VPG0 or VPG1 register */

View File

@@ -24,7 +24,7 @@ int maxim4c_remote_devices_power(maxim4c_t *maxim4c, u8 link_mask, int on)
struct device_node *remote_cam_node = NULL;
struct i2c_client *remote_cam_client = NULL;
struct v4l2_subdev *remote_cam_sd = NULL;
int ret = 0, i = 0;
int ret = 0, error = 0, i = 0;
dev_dbg(dev, "%s: link mask = 0x%02x, on = %d\n", __func__, link_mask, on);
@@ -57,7 +57,11 @@ int maxim4c_remote_devices_power(maxim4c_t *maxim4c, u8 link_mask, int on)
}
dev_info(dev, "link id = %d remote camera power = %d\n", i, on);
ret |= v4l2_subdev_call(remote_cam_sd, core, s_power, on);
error = v4l2_subdev_call(remote_cam_sd, core, s_power, on);
if (error < 0) {
ret |= error;
dev_err(dev, "link id = %d remote camera power error = %d\n", i, error);
}
}
return ret;
@@ -72,7 +76,7 @@ int maxim4c_remote_devices_s_stream(maxim4c_t *maxim4c, u8 link_mask, int enable
struct device_node *remote_cam_node = NULL;
struct i2c_client *remote_cam_client = NULL;
struct v4l2_subdev *remote_cam_sd = NULL;
int ret = 0, i = 0;
int ret = 0, error = 0, i = 0;
dev_dbg(dev, "%s: link mask = 0x%02x, enable = %d\n", __func__, link_mask, enable);
@@ -105,7 +109,11 @@ int maxim4c_remote_devices_s_stream(maxim4c_t *maxim4c, u8 link_mask, int enable
}
dev_info(dev, "link id = %d remote camera s_stream = %d\n", i, enable);
ret |= v4l2_subdev_call(remote_cam_sd, video, s_stream, enable);
error = v4l2_subdev_call(remote_cam_sd, video, s_stream, enable);
if (error < 0) {
ret |= error;
dev_err(dev, "link id = %d remote camera s_stream error = %d\n", i, error);
}
}
return ret;

View File

@@ -66,10 +66,17 @@ static const struct maxim4c_mode maxim4c_def_mode = {
.link_freq_idx = 15,
.bus_fmt = MEDIA_BUS_FMT_UYVY8_2X8,
.bpp = 16,
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
.vc[PAD0] = 0,
.vc[PAD1] = 1,
.vc[PAD2] = 2,
.vc[PAD3] = 3,
#else
.vc[PAD0] = V4L2_MBUS_CSI2_CHANNEL_0,
.vc[PAD1] = V4L2_MBUS_CSI2_CHANNEL_1,
.vc[PAD2] = V4L2_MBUS_CSI2_CHANNEL_2,
.vc[PAD3] = V4L2_MBUS_CSI2_CHANNEL_3,
#endif /* LINUX_VERSION_CODE */
};
static struct rkmodule_csi_dphy_param rk3588_dcphy_param = {
@@ -212,8 +219,13 @@ static int maxim4c_support_mode_init(maxim4c_t *maxim4c)
static int maxim4c_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{
maxim4c_t *maxim4c = v4l2_get_subdevdata(sd);
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
struct v4l2_mbus_framefmt *try_fmt =
v4l2_subdev_get_try_format(sd, fh->state, 0);
#else
struct v4l2_mbus_framefmt *try_fmt =
v4l2_subdev_get_try_format(sd, fh->pad, 0);
#endif
const struct maxim4c_mode *def_mode = &maxim4c->supported_mode;
mutex_lock(&maxim4c->mutex);
@@ -598,7 +610,11 @@ static int maxim4c_s_stream(struct v4l2_subdev *sd, int on)
goto unlock_and_return;
if (on) {
#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE
ret = pm_runtime_resume_and_get(&client->dev);
#else
ret = pm_runtime_get_sync(&client->dev);
#endif
if (ret < 0)
goto unlock_and_return;
@@ -635,9 +651,15 @@ static int maxim4c_g_frame_interval(struct v4l2_subdev *sd,
return 0;
}
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int maxim4c_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
#else
static int maxim4c_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_mbus_code_enum *code)
#endif
{
maxim4c_t *maxim4c = v4l2_get_subdevdata(sd);
const struct maxim4c_mode *mode = maxim4c->cur_mode;
@@ -649,9 +671,15 @@ static int maxim4c_enum_mbus_code(struct v4l2_subdev *sd,
return 0;
}
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int maxim4c_enum_frame_sizes(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse)
#else
static int maxim4c_enum_frame_sizes(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_frame_size_enum *fse)
#endif
{
maxim4c_t *maxim4c = v4l2_get_subdevdata(sd);
@@ -669,10 +697,15 @@ static int maxim4c_enum_frame_sizes(struct v4l2_subdev *sd,
return 0;
}
static int
maxim4c_enum_frame_interval(struct v4l2_subdev *sd,
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int maxim4c_enum_frame_interval(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_interval_enum *fie)
#else
static int maxim4c_enum_frame_interval(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_frame_interval_enum *fie)
#endif
{
maxim4c_t *maxim4c = v4l2_get_subdevdata(sd);
@@ -687,9 +720,15 @@ maxim4c_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int maxim4c_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
#else
static int maxim4c_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_format *fmt)
#endif
{
maxim4c_t *maxim4c = v4l2_get_subdevdata(sd);
const struct maxim4c_mode *mode = maxim4c->cur_mode;
@@ -697,7 +736,11 @@ static int maxim4c_get_fmt(struct v4l2_subdev *sd,
mutex_lock(&maxim4c->mutex);
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
fmt->format = *v4l2_subdev_get_try_format(sd, sd_state, fmt->pad);
#else
fmt->format = *v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
#endif
#else
mutex_unlock(&maxim4c->mutex);
return -ENOTTY;
@@ -717,9 +760,15 @@ static int maxim4c_get_fmt(struct v4l2_subdev *sd,
return 0;
}
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int maxim4c_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
#else
static int maxim4c_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_format *fmt)
#endif
{
maxim4c_t *maxim4c = v4l2_get_subdevdata(sd);
struct device *dev = &maxim4c->client->dev;
@@ -737,7 +786,11 @@ static int maxim4c_set_fmt(struct v4l2_subdev *sd,
fmt->format.field = V4L2_FIELD_NONE;
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
*v4l2_subdev_get_try_format(sd, sd_state, fmt->pad) = fmt->format;
#else
*v4l2_subdev_get_try_format(sd, cfg, fmt->pad) = fmt->format;
#endif
#else
mutex_unlock(&maxim4c->mutex);
return -ENOTTY;
@@ -769,9 +822,15 @@ static int maxim4c_set_fmt(struct v4l2_subdev *sd,
return 0;
}
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int maxim4c_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel)
#else
static int maxim4c_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_selection *sel)
#endif
{
maxim4c_t *maxim4c = v4l2_get_subdevdata(sd);
@@ -786,6 +845,18 @@ static int maxim4c_get_selection(struct v4l2_subdev *sd,
return -EINVAL;
}
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int maxim4c_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
struct v4l2_mbus_config *config)
{
struct maxim4c *maxim4c = v4l2_get_subdevdata(sd);
config->type = V4L2_MBUS_CSI2_DPHY;
config->bus.mipi_csi2 = maxim4c->bus_cfg.bus.mipi_csi2;
return 0;
}
#elif KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE
static int maxim4c_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
struct v4l2_mbus_config *config)
{
@@ -804,6 +875,26 @@ static int maxim4c_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
return 0;
}
#else
static int maxim4c_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
maxim4c_t *maxim4c = v4l2_get_subdevdata(sd);
u32 val = 0;
u8 data_lanes = maxim4c->bus_cfg.bus.mipi_csi2.num_data_lanes;
val |= V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
val |= (1 << (data_lanes - 1));
val |= V4L2_MBUS_CSI2_CHANNEL_3 | V4L2_MBUS_CSI2_CHANNEL_2 |
V4L2_MBUS_CSI2_CHANNEL_1 | V4L2_MBUS_CSI2_CHANNEL_0;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
#endif /* LINUX_VERSION_CODE */
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
static const struct v4l2_subdev_internal_ops maxim4c_internal_ops = {
@@ -822,6 +913,9 @@ static const struct v4l2_subdev_core_ops maxim4c_core_ops = {
static const struct v4l2_subdev_video_ops maxim4c_video_ops = {
.s_stream = maxim4c_s_stream,
.g_frame_interval = maxim4c_g_frame_interval,
#if KERNEL_VERSION(5, 10, 0) > LINUX_VERSION_CODE
.g_mbus_config = maxim4c_g_mbus_config,
#endif
};
static const struct v4l2_subdev_pad_ops maxim4c_pad_ops = {
@@ -831,7 +925,9 @@ static const struct v4l2_subdev_pad_ops maxim4c_pad_ops = {
.get_fmt = maxim4c_get_fmt,
.set_fmt = maxim4c_set_fmt,
.get_selection = maxim4c_get_selection,
#if KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE
.get_mbus_config = maxim4c_g_mbus_config,
#endif
};
static const struct v4l2_subdev_ops maxim4c_subdev_ops = {
@@ -960,7 +1056,11 @@ int maxim4c_v4l2_subdev_init(maxim4c_t *maxim4c)
maxim4c->module_index, facing, MAXIM4C_NAME,
dev_name(sd->dev));
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
ret = v4l2_async_register_subdev_sensor(sd);
#else
ret = v4l2_async_register_subdev_sensor_common(sd);
#endif
if (ret) {
dev_err(dev, "v4l2 async register subdev failed\n");
goto err_clean_entity;

View File

@@ -16,7 +16,7 @@
#include "maxim_remote.h"
#define DRIVER_VERSION KERNEL_VERSION(3, 0x00, 0x00)
#define DRIVER_VERSION KERNEL_VERSION(3, 0x01, 0x00)
#define MAX9295_NAME "max9295"
@@ -527,13 +527,19 @@ static int max9295_probe(struct i2c_client *client,
return 0;
}
#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE
static int max9295_remove(struct i2c_client *client)
#else
static void max9295_remove(struct i2c_client *client)
#endif
{
maxim_remote_ser_t *max9295 = i2c_get_clientdata(client);
mutex_destroy(&max9295->mutex);
#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE
return 0;
#endif
}
static const struct of_device_id max9295_of_match[] = {

View File

@@ -16,7 +16,7 @@
#include "maxim_remote.h"
#define DRIVER_VERSION KERNEL_VERSION(3, 0x00, 0x00)
#define DRIVER_VERSION KERNEL_VERSION(3, 0x01, 0x00)
#define MAX96715_NAME "max96715"
@@ -528,13 +528,19 @@ static int max96715_probe(struct i2c_client *client,
return 0;
}
#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE
static int max96715_remove(struct i2c_client *client)
#else
static void max96715_remove(struct i2c_client *client)
#endif
{
maxim_remote_ser_t *max96715 = i2c_get_clientdata(client);
mutex_destroy(&max96715->mutex);
#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE
return 0;
#endif
}
static const struct of_device_id max96715_of_match[] = {

View File

@@ -16,7 +16,7 @@
#include "maxim_remote.h"
#define DRIVER_VERSION KERNEL_VERSION(3, 0x00, 0x00)
#define DRIVER_VERSION KERNEL_VERSION(3, 0x01, 0x00)
#define MAX96717_NAME "maxim-max96717"
@@ -477,13 +477,19 @@ static int max96717_probe(struct i2c_client *client,
return 0;
}
#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE
static int max96717_remove(struct i2c_client *client)
#else
static void max96717_remove(struct i2c_client *client)
#endif
{
maxim_remote_ser_t *max96717 = i2c_get_clientdata(client);
mutex_destroy(&max96717->mutex);
#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE
return 0;
#endif
}
static const struct of_device_id max96717_of_match[] = {

Some files were not shown because too many files have changed in this diff Show More