Lines Matching refs:headset_info

89 static struct headset_priv *headset_info;  variable
98 gpio_set_value(headset_info->pdata->mic_switch_gpio, in Modem_Mic_switch()
99 headset_info->pdata->hp_mic_io_value); in Modem_Mic_switch()
101 gpio_set_value(headset_info->pdata->mic_switch_gpio, in Modem_Mic_switch()
102 headset_info->pdata->main_mic_io_value); in Modem_Mic_switch()
107 if (headset_info->cur_headset_status == 1) in Modem_Mic_release()
108 gpio_set_value(headset_info->pdata->mic_switch_gpio, in Modem_Mic_release()
109 headset_info->pdata->hp_mic_io_value); in Modem_Mic_release()
111 gpio_set_value(headset_info->pdata->mic_switch_gpio, in Modem_Mic_release()
112 headset_info->pdata->main_mic_io_value); in Modem_Mic_release()
138 schedule_delayed_work(&headset_info->h_delayed_work[HEADSET], in headset_interrupt()
147 schedule_delayed_work(&headset_info->h_delayed_work[HOOK], in hook_interrupt()
156 struct rk_headset_pdata *pdata = headset_info->pdata; in headsetobserve_work()
160 mutex_lock(&headset_info->mutex_lock[HEADSET]); in headsetobserve_work()
170 old_status = headset_info->headset_status; in headsetobserve_work()
172 headset_info->headset_status = level ? HEADSET_IN : HEADSET_OUT; in headsetobserve_work()
174 headset_info->headset_status = level ? HEADSET_OUT : HEADSET_IN; in headsetobserve_work()
176 if (old_status == headset_info->headset_status) { in headsetobserve_work()
182 headset_info->headset_status ? "in" : "out"); in headsetobserve_work()
183 if (headset_info->headset_status == HEADSET_IN) { in headsetobserve_work()
184 headset_info->cur_headset_status = BIT_HEADSET_NO_MIC; in headsetobserve_work()
186 irq_set_irq_type(headset_info->irq[HEADSET], in headsetobserve_work()
189 irq_set_irq_type(headset_info->irq[HEADSET], in headsetobserve_work()
193 del_timer(&headset_info->headset_timer); in headsetobserve_work()
194 headset_info->headset_timer.expires = jiffies + 100; in headsetobserve_work()
195 add_timer(&headset_info->headset_timer); in headsetobserve_work()
198 } else if (headset_info->headset_status == HEADSET_OUT) { in headsetobserve_work()
199 headset_info->hook_status = HOOK_UP; in headsetobserve_work()
200 if (headset_info->isHook_irq == enable) { in headsetobserve_work()
202 headset_info->isHook_irq = disable; in headsetobserve_work()
203 disable_irq(headset_info->irq[HOOK]); in headsetobserve_work()
205 headset_info->cur_headset_status = 0; in headsetobserve_work()
207 irq_set_irq_type(headset_info->irq[HEADSET], in headsetobserve_work()
210 irq_set_irq_type(headset_info->irq[HEADSET], in headsetobserve_work()
213 if (headset_info->cur_headset_status) in headsetobserve_work()
214 extcon_set_state_sync(headset_info->edev, EXTCON_JACK_HEADPHONE, in headsetobserve_work()
217 extcon_set_state_sync(headset_info->edev, EXTCON_JACK_HEADPHONE, in headsetobserve_work()
220 headset_info->cur_headset_status); in headsetobserve_work()
222 mutex_unlock(&headset_info->mutex_lock[HEADSET]); in headsetobserve_work()
228 struct rk_headset_pdata *pdata = headset_info->pdata; in hook_work()
231 mutex_lock(&headset_info->mutex_lock[HOOK]); in hook_work()
232 if (headset_info->headset_status == HEADSET_OUT) { in hook_work()
239 old_status = headset_info->hook_status; in hook_work()
242 headset_info->hook_status = in hook_work()
246 headset_info->hook_status = in hook_work()
249 if (old_status == headset_info->hook_status) { in hook_work()
254 headset_info->hook_status ? "key down" : "key up"); in hook_work()
255 if (headset_info->hook_status == HOOK_DOWN) { in hook_work()
257 irq_set_irq_type(headset_info->irq[HOOK], in hook_work()
260 irq_set_irq_type(headset_info->irq[HOOK], in hook_work()
264 irq_set_irq_type(headset_info->irq[HOOK], in hook_work()
267 irq_set_irq_type(headset_info->irq[HOOK], in hook_work()
270 input_report_key(headset_info->input_dev, HOOK_KEY_CODE, in hook_work()
271 headset_info->hook_status); in hook_work()
272 input_sync(headset_info->input_dev); in hook_work()
274 mutex_unlock(&headset_info->mutex_lock[HOOK]); in hook_work()
295 enable_irq(headset_info->irq[HOOK]); in headset_timer_callback()
297 headset_info->hook_status = HOOK_UP; in headset_timer_callback()
299 irq_set_irq_type(headset_info->irq[HOOK], in headset_timer_callback()
302 irq_set_irq_type(headset_info->irq[HOOK], in headset_timer_callback()
308 headset_info->cur_headset_status = headset_info->isMic ? 1 : 2; in headset_timer_callback()
310 extcon_set_state_sync(headset_info->edev, in headset_timer_callback()
313 extcon_set_state_sync(headset_info->edev, in headset_timer_callback()
316 headset_info->cur_headset_status); in headset_timer_callback()
324 schedule_delayed_work(&headset_info->h_delayed_work[HEADSET], in headset_early_resume()
362 headset_info = headset; in rk_headset_probe()