驱动程序 RK3568 红外电路
如何对RK3568-ANDROID11 PWM背光和红外电路进行调试呢?
回帖(1)
2022-3-2 16:26:08
调试一:IR(PWM15_M1)
PWM15,模式一
RK3568kernelarcharm64bootdtsrockchiprk3568.dtsi
pwm15: pwm@fe700030 {
compatible = "rockchip,rk3568-pwm", "rockchip,rk3328-pwm";
reg = <0x0 0xfe700030 0x0 0x10>;
interrupts = ,
;
#pwm-cells = <3>;
pinctrl-names = "active";
pinctrl-0 = <&pwm15m1_pins>;
clocks = <&cru CLK_PWM3>, <&cru PCLK_PWM3>;
clock-names = "pwm", "pclk";
status = "disabled";
};
让引脚设置到pinctrl-0 = <&pwm15m1_pins>;
RK3568kernelarcharm64bootdtsrockchiprk3568-evb.dtsi
&pwm15 {
status = "okay";
compatible = "rockchip,remotectl-pwm";
remote_pwm_id = <3>;
handle_cpu_id = <1>;
remote_support_psci = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pwm15m1_pins>;
ir_key1 {
rockchip,usercode = <0xf708>;
rockchip,key_table =
<0x23 KEY_BACK>,
<0x6d KEY_UP>,
<0x27 KEY_DOWN>,
<0x68 KEY_LEFT>,
<0x60 KEY_RIGHT>,
<0x7c KEY_VOLUMEUP>,
<0x79 KEY_VOLUMEDOWN>,
<0x7d KEY_SEARCH>,
<0x28 KEY_POWER>,
<0x20 KEY_MUTE>,
<0x2b KEY_MENU>,
<0x64 KEY_ENTER>,
<0x6a KEY_1>,
<0x66 KEY_2>,
<0x62 KEY_3>,
<0x29 KEY_4>,
<0x25 KEY_5>,
<0x21 KEY_6>,
<0x69 KEY_7>,
<0x65 KEY_8>,
<0x61 KEY_9>,
<0x26 KEY_0>;
};
ir_key2 {
rockchip,usercode = <0xff00>;
rockchip,key_table =
<0xf9 KEY_HOME>,
<0xbf KEY_BACK>,
<0xfb KEY_MENU>,
.......
};
ir_key3 {
rockchip,usercode = <0x1dcc>;
rockchip,key_table =
<0xee KEY_REPLY>,
.......
};
};
键码值可以使用
echo 1 > /sys/module/rockchip_pwm_remotectl/parameters/code_print
调试二:背光(PWM14_M0)和使能
RK3568kernelarcharm64bootdtsrockchiprk3568.dtsi
pwm14: pwm@fe700020 {
compatible = "rockchip,rk3568-pwm", "rockchip,rk3328-pwm";
reg = <0x0 0xfe700020 0x0 0x10>;
#pwm-cells = <3>;
pinctrl-names = "active";
pinctrl-0 = <&pwm14m0_pins>;
clocks = <&cru CLK_PWM3>, <&cru PCLK_PWM3>;
clock-names = "pwm", "pclk";
status = "disabled";
};
让引脚设置到pinctrl-0 = <&pwm14m0_pins>;
RK3568kernelarcharm64bootdtsrockchiprk3568-evb.dtsi
backlight: backlight {
compatible = "pwm-backlight";
status = "okay";
pwms = <&pwm14 0 100000 1>;
brightness-levels = <
20 20 20 21 21 22 22 23
23 24 24 25 25 26 26 27
27 28 28 29 29 30 30 31
31 32 32 33 33 34 34 35
35 36 36 37 37 38 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 = <200>;
};
&pwm14 {
status = "okay";
};
PWM14已经配置好了
RK3568kernelarcharm64bootdtsrockchiprk3568-evb.dtsi
edp_panel: edp-panel {
compatible = "simple-panel";
status = "okay";
enable-gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>;
prepare-delay-ms = <201>;
enable-delay-ms = <201>;
backlight = <&backlight>;
display-timings {
native-mode = <&timing0>;
timing0: timing0 {
clock-frequency = <140000000>;
hactive = <1920>;
vactive = <1080>;
hfront-porch = <80>;
hsync-len = <20>;
hback-porch = <80>;
vfront-porch = <12>;
vsync-len = <24>;
vback-porch = <12>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
};
ports {
panel_in_edp: endpoint {
remote-endpoint = <&edp_out_panel>;
};
};
};
};
点屏的时候加载这句,背光就有输出了:backlight = <&backlight>;
加载这一句就有使能了:enable-gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>;
仅供参考!
调试一:IR(PWM15_M1)
PWM15,模式一
RK3568kernelarcharm64bootdtsrockchiprk3568.dtsi
pwm15: pwm@fe700030 {
compatible = "rockchip,rk3568-pwm", "rockchip,rk3328-pwm";
reg = <0x0 0xfe700030 0x0 0x10>;
interrupts = ,
;
#pwm-cells = <3>;
pinctrl-names = "active";
pinctrl-0 = <&pwm15m1_pins>;
clocks = <&cru CLK_PWM3>, <&cru PCLK_PWM3>;
clock-names = "pwm", "pclk";
status = "disabled";
};
让引脚设置到pinctrl-0 = <&pwm15m1_pins>;
RK3568kernelarcharm64bootdtsrockchiprk3568-evb.dtsi
&pwm15 {
status = "okay";
compatible = "rockchip,remotectl-pwm";
remote_pwm_id = <3>;
handle_cpu_id = <1>;
remote_support_psci = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pwm15m1_pins>;
ir_key1 {
rockchip,usercode = <0xf708>;
rockchip,key_table =
<0x23 KEY_BACK>,
<0x6d KEY_UP>,
<0x27 KEY_DOWN>,
<0x68 KEY_LEFT>,
<0x60 KEY_RIGHT>,
<0x7c KEY_VOLUMEUP>,
<0x79 KEY_VOLUMEDOWN>,
<0x7d KEY_SEARCH>,
<0x28 KEY_POWER>,
<0x20 KEY_MUTE>,
<0x2b KEY_MENU>,
<0x64 KEY_ENTER>,
<0x6a KEY_1>,
<0x66 KEY_2>,
<0x62 KEY_3>,
<0x29 KEY_4>,
<0x25 KEY_5>,
<0x21 KEY_6>,
<0x69 KEY_7>,
<0x65 KEY_8>,
<0x61 KEY_9>,
<0x26 KEY_0>;
};
ir_key2 {
rockchip,usercode = <0xff00>;
rockchip,key_table =
<0xf9 KEY_HOME>,
<0xbf KEY_BACK>,
<0xfb KEY_MENU>,
.......
};
ir_key3 {
rockchip,usercode = <0x1dcc>;
rockchip,key_table =
<0xee KEY_REPLY>,
.......
};
};
键码值可以使用
echo 1 > /sys/module/rockchip_pwm_remotectl/parameters/code_print
调试二:背光(PWM14_M0)和使能
RK3568kernelarcharm64bootdtsrockchiprk3568.dtsi
pwm14: pwm@fe700020 {
compatible = "rockchip,rk3568-pwm", "rockchip,rk3328-pwm";
reg = <0x0 0xfe700020 0x0 0x10>;
#pwm-cells = <3>;
pinctrl-names = "active";
pinctrl-0 = <&pwm14m0_pins>;
clocks = <&cru CLK_PWM3>, <&cru PCLK_PWM3>;
clock-names = "pwm", "pclk";
status = "disabled";
};
让引脚设置到pinctrl-0 = <&pwm14m0_pins>;
RK3568kernelarcharm64bootdtsrockchiprk3568-evb.dtsi
backlight: backlight {
compatible = "pwm-backlight";
status = "okay";
pwms = <&pwm14 0 100000 1>;
brightness-levels = <
20 20 20 21 21 22 22 23
23 24 24 25 25 26 26 27
27 28 28 29 29 30 30 31
31 32 32 33 33 34 34 35
35 36 36 37 37 38 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 = <200>;
};
&pwm14 {
status = "okay";
};
PWM14已经配置好了
RK3568kernelarcharm64bootdtsrockchiprk3568-evb.dtsi
edp_panel: edp-panel {
compatible = "simple-panel";
status = "okay";
enable-gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>;
prepare-delay-ms = <201>;
enable-delay-ms = <201>;
backlight = <&backlight>;
display-timings {
native-mode = <&timing0>;
timing0: timing0 {
clock-frequency = <140000000>;
hactive = <1920>;
vactive = <1080>;
hfront-porch = <80>;
hsync-len = <20>;
hback-porch = <80>;
vfront-porch = <12>;
vsync-len = <24>;
vback-porch = <12>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
};
ports {
panel_in_edp: endpoint {
remote-endpoint = <&edp_out_panel>;
};
};
};
};
点屏的时候加载这句,背光就有输出了:backlight = <&backlight>;
加载这一句就有使能了:enable-gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>;
仅供参考!
举报
更多回帖