static void detect_gpio_work_func(struct work_struct *work) { int insert = 0; int ret = 0; HS_DBG(); if ((hi->pdata.eng_cfg == HS_EDE_U) || (hi->pdata.eng_cfg == HS_EDE_TD) || (hi->pdata.eng_cfg == HS_BLE)) { aic3008_set_mic_bias(1); } if ((hi->pdata.eng_cfg == HS_QUO_F_U)) { regulator = regulator_get(NULL, "v_aud_2v85"); if (IS_ERR_OR_NULL(regulator)) { pr_err("htc_headset_gpio_probe:Couldn't get regulator v_aud_2v85\n"); regulator = NULL; return; } regulator_enable(regulator); } insert = gpio_get_value(hi->pdata.hpin_gpio) ? 0 : 1; if (hi->headset_state == insert) return; hi->headset_state = insert; hs_notify_plug_event(insert); if (hi->pdata.key_gpio){ if(!hi->key_irq){ ret = gpio_to_irq(hi->pdata.key_gpio); if (ret < 0) HS_ERR("gpio_to_irq"); hi->key_irq = (unsigned int) ret; ret = request_irq(hi->key_irq, button_irq_handler, hi->key_irq_type, "HS_GPIO_BUTTON", NULL); if (ret < 0) HS_ERR("request irq error;"); disable_irq_nosync(hi->key_irq); } if (hi->key_irq){ if (hi->headset_state == 1){ ret = irq_set_irq_wake(hi->key_irq, 1); if (ret < 0) HS_ERR("set irq wake error"); enable_irq(hi->key_irq); }else{ ret = irq_set_irq_wake(hi->key_irq, 0); if (ret < 0) HS_ERR("set irq wake error"); disable_irq_nosync(hi->key_irq); } } } }
static void detect_35mm_do_work(struct work_struct *work) { int insert = 0; HS_DBG(); insert = gpio_get_value(hi->pdata.hpin_gpio) ? 0 : 1; hs_notify_plug_event(insert); }
static void detect_pmic_work_func(struct work_struct *work) { int insert = 0; HS_DBG(); insert = gpio_get_value_cansleep(hi->pdata.hpin_gpio) ? 0 : 1; hs_notify_plug_event(insert); }
static void detect_35mm_do_work(struct work_struct *work) { int insert = 0; HS_DBG_LOG(); insert = gpio_get_value(pmic_info->pdata.hpin_gpio) ? 0 : 1; hs_notify_plug_event(insert); pmic_info->hpin_debounce = (insert) ? HS_JIFFIES_REMOVE : HS_JIFFIES_INSERT; }
static void detect_gpio_work_func(struct work_struct *work) { int insert = 0; HS_DBG(); insert = gpio_get_value(hi->pdata.hpin_gpio) ? 0 : 1; if (hi->headset_state == insert) return; hi->headset_state = insert; hs_notify_plug_event(insert, 0); }
static void detect_gpio_work_func(struct work_struct *work) { int insert = 0; HS_DBG_LOG(); insert = gpio_get_value(hi->pdata.hpin_gpio) ? 0 : 1; if (hi->headset_state == insert) return; hi->headset_state = insert; hs_notify_plug_event(insert); hi->hpin_debounce = (insert) ? HS_JIFFIES_REMOVE : HS_JIFFIES_INSERT; }