.. | .. |
---|
111 | 111 | struct rk_headset_pdata *pdata = headset_info->pdata; |
---|
112 | 112 | static unsigned int old_status = 0; |
---|
113 | 113 | int i, level = 0; |
---|
| 114 | + int ret; |
---|
114 | 115 | |
---|
115 | 116 | disable_irq_nosync(headset_info->irq[HEADSET]); |
---|
116 | 117 | if (headset_info->heatset_irq_working == BUSY || |
---|
.. | .. |
---|
161 | 162 | goto out; |
---|
162 | 163 | } |
---|
163 | 164 | |
---|
164 | | - pr_info("(headset in is %s)headset status is %s\n", |
---|
| 165 | + pr_info("(myttest headset in is %s)headset status is %s\n", |
---|
165 | 166 | pdata->headset_insert_type ? "high level" : "low level", |
---|
166 | 167 | headset_info->headset_status ? "in" : "out"); |
---|
167 | 168 | |
---|
168 | 169 | if (headset_info->headset_status == HEADSET_IN) { |
---|
| 170 | + ret = gpio_direction_output(pdata->spk_ctl_gpio,1); |
---|
| 171 | + if (ret < 0) { |
---|
| 172 | + printk("spk_ctl_gpio set direction fail\n"); |
---|
| 173 | + } |
---|
169 | 174 | if (pdata->chan != 0) { |
---|
170 | 175 | /* detect Hook key */ |
---|
171 | 176 | schedule_delayed_work( |
---|
.. | .. |
---|
186 | 191 | irq_set_irq_type(headset_info->irq[HEADSET], |
---|
187 | 192 | IRQF_TRIGGER_RISING); |
---|
188 | 193 | } else if (headset_info->headset_status == HEADSET_OUT) { |
---|
| 194 | + ret = gpio_direction_output(pdata->spk_ctl_gpio,0); |
---|
| 195 | + if (ret < 0) { |
---|
| 196 | + printk("spk_ctl_gpio set direction fail\n"); |
---|
| 197 | + } |
---|
189 | 198 | headset_info->cur_headset_status = HEADSET_OUT; |
---|
190 | 199 | cancel_delayed_work(&headset_info->hook_work); |
---|
191 | 200 | if (headset_info->isMic) { |
---|