hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
add audio
6 files modified
63 ■■■■■ changed files
kernel/arch/arm64/boot/dts/rockchip/NK-R36S0.dtsi 11 ●●●●● patch | view | raw | blame | history
kernel/arch/arm64/boot/dts/rockchip/rk3568-evb.dtsi 11 ●●●● patch | view | raw | blame | history
kernel/drivers/headset_observe/rk_headset.c 9 ●●●●● patch | view | raw | blame | history
kernel/drivers/headset_observe/rk_headset.h 1 ●●●● patch | view | raw | blame | history
kernel/drivers/headset_observe/rockchip_headset_core.c 28 ●●●●● patch | view | raw | blame | history
mk-rootfs.sh 3 ●●●● patch | view | raw | blame | history
kernel/arch/arm64/boot/dts/rockchip/NK-R36S0.dtsi
....@@ -34,15 +34,6 @@
3434 vin-supply = <&vcc3v3_sys>;
3535 };
3636
37
- vcc3v3_vga: vcc3v3-vga {
38
- compatible = "regulator-fixed";
39
- regulator-name = "vcc3v3_vga";
40
- regulator-always-on;
41
- regulator-boot-on;
42
- gpio = <&gpio0 RK_PD5 GPIO_ACTIVE_HIGH>;
43
- enable-active-high;
44
- vin-supply = <&vcc3v3_sys>;
45
- };
4637
4738 pcie30_avdd0v9: pcie30-avdd0v9 {
4839 compatible = "regulator-fixed";
....@@ -146,7 +137,7 @@
146137 };
147138
148139 hp_en {
149
- gpio_num = <&gpio3 RK_PA6 GPIO_ACTIVE_HIGH>;//HP_EN_GPIO3_A6_3V3
140
+ gpio_num = <&gpio3 RK_PA6 GPIO_ACTIVE_LOW>;//HP_EN_GPIO3_A6_3V3
150141 gpio_function = <0>;
151142 };
152143
kernel/arch/arm64/boot/dts/rockchip/rk3568-evb.dtsi
....@@ -216,13 +216,13 @@
216216 status = "okay";
217217 compatible = "rockchip,multicodecs-card";
218218 rockchip,card-name = "rockchip-rk809";
219
- hp-det-gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>;
219
+ hp-det-gpio = <&gpio0 RK_PD5 GPIO_ACTIVE_LOW>;
220220 rockchip,format = "i2s";
221221 rockchip,mclk-fs = <256>;
222222 rockchip,cpu = <&i2s1_8ch>;
223223 rockchip,codec = <&rk809_codec>;
224
- pinctrl-names = "default";
225
- pinctrl-0 = <&hp_det>;
224
+// pinctrl-names = "default";
225
+// pinctrl-0 = <&hp_det>;
226226 };
227227
228228 spdif-sound {
....@@ -1329,11 +1329,6 @@
13291329
13301330 &pinctrl {
13311331
1332
- headphone {
1333
- hp_det: hp-det {
1334
- rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_down>;
1335
- };
1336
- };
13371332
13381333 mxc6655xa {
13391334 mxc6655xa_irq_gpio: mxc6655xa_irq_gpio {
kernel/drivers/headset_observe/rk_headset.c
....@@ -155,6 +155,7 @@
155155 int level2 = 0;
156156 struct rk_headset_pdata *pdata = headset_info->pdata;
157157 static unsigned int old_status = 0;
158
+ int ret;
158159
159160 printk("---headsetobserve_work---\n");
160161 mutex_lock(&headset_info->mutex_lock[HEADSET]);
....@@ -182,6 +183,10 @@
182183 headset_info->headset_status ? "in" : "out");
183184 if (headset_info->headset_status == HEADSET_IN) {
184185 headset_info->cur_headset_status = BIT_HEADSET_NO_MIC;
186
+ ret = gpio_direction_output(pdata->spk_ctl_gpio,0);
187
+ if (ret < 0) {
188
+ printk("spk_ctl_gpio set direction fail\n");
189
+ }
185190 if (pdata->headset_insert_type == HEADSET_IN_HIGH)
186191 irq_set_irq_type(headset_info->irq[HEADSET],
187192 IRQF_TRIGGER_FALLING);
....@@ -196,6 +201,10 @@
196201 goto out;
197202 }
198203 } else if (headset_info->headset_status == HEADSET_OUT) {
204
+ ret = gpio_direction_output(pdata->spk_ctl_gpio,1);
205
+ if (ret < 0) {
206
+ printk("spk_ctl_gpio set direction fail\n");
207
+ }
199208 headset_info->hook_status = HOOK_UP;
200209 if (headset_info->isHook_irq == enable) {
201210 DBG("disable headset_hook irq\n");
kernel/drivers/headset_observe/rk_headset.h
....@@ -11,6 +11,7 @@
1111 struct rk_headset_pdata {
1212 /* heaset about */
1313 unsigned int headset_gpio;
14
+ unsigned int spk_ctl_gpio;
1415 /* Headphones into the state level */
1516 unsigned int headset_insert_type;
1617 /* hook about */
kernel/drivers/headset_observe/rockchip_headset_core.c
....@@ -73,6 +73,34 @@
7373 HEADSET_IN_LOW :
7474 HEADSET_IN_HIGH;
7575 }
76
+
77
+ /* spk-ctl */
78
+ ret = of_get_named_gpio_flags(node, "spk_ctl_gpio", 0, &flags);
79
+ if (ret < 0) {
80
+ dev_err(&pdev->dev, "Can not read property headset_gpio\n");
81
+ goto err;
82
+ } else {
83
+ pdata->spk_ctl_gpio = ret;
84
+ ret = devm_gpio_request(&pdev->dev, pdata->spk_ctl_gpio,
85
+ "spk_ctl_gpio");
86
+ if (ret < 0) {
87
+ dev_err(&pdev->dev, "spk_ctl_gpio request fail\n");
88
+ goto err;
89
+ }
90
+
91
+ ret = gpio_get_value(pdata->headset_gpio);
92
+ printk(" headset_gpio value : %d\n",ret);
93
+ if (ret == 0)
94
+ ret = gpio_direction_output(pdata->spk_ctl_gpio,0);
95
+ else
96
+ ret = gpio_direction_output(pdata->spk_ctl_gpio,1);
97
+ if (ret < 0) {
98
+ dev_err(&pdev->dev,
99
+ "spk_ctl_gpio set direction fail\n");
100
+ goto err;
101
+ }
102
+ }
103
+
76104 /* hook */
77105 ret = of_get_named_gpio_flags(node, "hook_gpio", 0, &pdata->hook_gpio);
78106 if (ret < 0) {
mk-rootfs.sh
....@@ -1,7 +1,8 @@
11 #!/bin/bash -e
22 #TARGET_ROOTFS_DIR=/home/data/rootfs/rk356x/ubuntu20-lxde/lxde_ubuntu20_rootfs
33 #TARGET_ROOTFS_DIR=/home/data/rootfs/rk356x/debian10/rk3568_likong
4
-TARGET_ROOTFS_DIR=/home/data/rootfs/rk356x/debian11/debian11_rootfs
4
+#TARGET_ROOTFS_DIR=/home/data/rootfs/rk356x/debian11/debian11_rootfs
5
+TARGET_ROOTFS_DIR=/home/data/rootfs/rk356x/debian10/debian_rootfs_5.10
56 MOUNTPOINT=./temp
67 ROOTFSIMAGE=rootfs.ext4
78 OUT=$PWD/tools/linux/Linux_Pack_Firmware/rockdev/Image/