.. | .. |
---|
153 | 153 | { |
---|
154 | 154 | int level = 0; |
---|
155 | 155 | int level2 = 0; |
---|
| 156 | + int ret; |
---|
156 | 157 | struct rk_headset_pdata *pdata = headset_info->pdata; |
---|
157 | 158 | static unsigned int old_status = 0; |
---|
158 | 159 | |
---|
.. | .. |
---|
177 | 178 | pr_warn("old_status == headset_info->headset_status\n"); |
---|
178 | 179 | goto out; |
---|
179 | 180 | } |
---|
180 | | - DBG("(headset in is %s)headset status is %s\n", |
---|
| 181 | + DBG("(troy test headset in is %s)headset status is %s\n", |
---|
181 | 182 | pdata->headset_insert_type ? "high level" : "low level", |
---|
182 | 183 | headset_info->headset_status ? "in" : "out"); |
---|
183 | 184 | if (headset_info->headset_status == HEADSET_IN) { |
---|
184 | 185 | headset_info->cur_headset_status = BIT_HEADSET_NO_MIC; |
---|
| 186 | + ret = gpio_direction_output(pdata->spk_ctl_gpio,1); |
---|
| 187 | + if (ret < 0) { |
---|
| 188 | + printk("spk_ctl_gpio set direction fail\n"); |
---|
| 189 | + } |
---|
185 | 190 | if (pdata->headset_insert_type == HEADSET_IN_HIGH) |
---|
186 | 191 | irq_set_irq_type(headset_info->irq[HEADSET], |
---|
187 | 192 | IRQF_TRIGGER_FALLING); |
---|
.. | .. |
---|
196 | 201 | goto out; |
---|
197 | 202 | } |
---|
198 | 203 | } else if (headset_info->headset_status == HEADSET_OUT) { |
---|
| 204 | + ret = gpio_direction_output(pdata->spk_ctl_gpio,0); |
---|
| 205 | + if (ret < 0) { |
---|
| 206 | + printk("spk_ctl_gpio set direction fail\n"); |
---|
| 207 | + } |
---|
199 | 208 | headset_info->hook_status = HOOK_UP; |
---|
200 | 209 | if (headset_info->isHook_irq == enable) { |
---|
201 | 210 | DBG("disable headset_hook irq\n"); |
---|