forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/drivers/headset_observe/rk_headset.c
....@@ -153,9 +153,9 @@
153153 {
154154 int level = 0;
155155 int level2 = 0;
156
- int ret;
157156 struct rk_headset_pdata *pdata = headset_info->pdata;
158157 static unsigned int old_status = 0;
158
+ int ret;
159159
160160 printk("---headsetobserve_work---\n");
161161 mutex_lock(&headset_info->mutex_lock[HEADSET]);
....@@ -184,10 +184,9 @@
184184 if (headset_info->headset_status == HEADSET_IN) {
185185 headset_info->cur_headset_status = BIT_HEADSET_NO_MIC;
186186 ret = gpio_direction_output(pdata->spk_ctl_gpio,0);
187
- if (ret < 0) {
188
- printk("spk_ctl_gpio set direction fail\n");
189
- }
190
-
187
+ if (ret < 0) {
188
+ printk("spk_ctl_gpio set direction fail\n");
189
+ }
191190 if (pdata->headset_insert_type == HEADSET_IN_HIGH)
192191 irq_set_irq_type(headset_info->irq[HEADSET],
193192 IRQF_TRIGGER_FALLING);
....@@ -203,9 +202,9 @@
203202 }
204203 } else if (headset_info->headset_status == HEADSET_OUT) {
205204 ret = gpio_direction_output(pdata->spk_ctl_gpio,1);
206
- if (ret < 0) {
207
- printk("spk_ctl_gpio set direction fail\n");
208
- }
205
+ if (ret < 0) {
206
+ printk("spk_ctl_gpio set direction fail\n");
207
+ }
209208 headset_info->hook_status = HOOK_UP;
210209 if (headset_info->isHook_irq == enable) {
211210 DBG("disable headset_hook irq\n");