Loading sound/soc/codecs/wcd-mbhc-v2.c +8 −1 Original line number Diff line number Diff line Loading @@ -657,6 +657,7 @@ static void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion, hphrocp_off_report(mbhc, SND_JACK_OC_HPHR); hphlocp_off_report(mbhc, SND_JACK_OC_HPHL); mbhc->current_plug = MBHC_PLUG_TYPE_NONE; mbhc->force_linein = false; } else { /* * Report removal of current jack type. Loading Loading @@ -712,6 +713,7 @@ static void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion, SND_JACK_LINEOUT | SND_JACK_ANC_HEADPHONE | SND_JACK_UNSUPPORTED); mbhc->force_linein = false; } if (mbhc->current_plug == MBHC_PLUG_TYPE_HEADSET && Loading Loading @@ -746,6 +748,7 @@ static void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion, mbhc->zr < MAX_IMPED) && (jack_type == SND_JACK_HEADPHONE)) { jack_type = SND_JACK_LINEOUT; mbhc->force_linein = true; mbhc->current_plug = MBHC_PLUG_TYPE_HIGH_HPH; if (mbhc->hph_status) { mbhc->hph_status &= ~(SND_JACK_HEADSET | Loading Loading @@ -1439,6 +1442,10 @@ correct_plug_type: if (!wrk_complete && mbhc->btn_press_intr) { pr_debug("%s: Can be slow insertion of headphone\n", __func__); wcd_cancel_btn_work(mbhc); /* Report as headphone only if previously * not reported as lineout */ if (!mbhc->force_linein) plug_type = MBHC_PLUG_TYPE_HEADPHONE; } /* Loading sound/soc/codecs/wcd-mbhc-v2.h +1 −0 Original line number Diff line number Diff line Loading @@ -470,6 +470,7 @@ struct wcd_mbhc { struct notifier_block psy_nb; struct power_supply *usb_psy; struct work_struct usbc_analog_work; bool force_linein; }; #define WCD_MBHC_CAL_SIZE(buttons, rload) ( \ sizeof(struct wcd_mbhc_general_cfg) + \ Loading Loading
sound/soc/codecs/wcd-mbhc-v2.c +8 −1 Original line number Diff line number Diff line Loading @@ -657,6 +657,7 @@ static void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion, hphrocp_off_report(mbhc, SND_JACK_OC_HPHR); hphlocp_off_report(mbhc, SND_JACK_OC_HPHL); mbhc->current_plug = MBHC_PLUG_TYPE_NONE; mbhc->force_linein = false; } else { /* * Report removal of current jack type. Loading Loading @@ -712,6 +713,7 @@ static void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion, SND_JACK_LINEOUT | SND_JACK_ANC_HEADPHONE | SND_JACK_UNSUPPORTED); mbhc->force_linein = false; } if (mbhc->current_plug == MBHC_PLUG_TYPE_HEADSET && Loading Loading @@ -746,6 +748,7 @@ static void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion, mbhc->zr < MAX_IMPED) && (jack_type == SND_JACK_HEADPHONE)) { jack_type = SND_JACK_LINEOUT; mbhc->force_linein = true; mbhc->current_plug = MBHC_PLUG_TYPE_HIGH_HPH; if (mbhc->hph_status) { mbhc->hph_status &= ~(SND_JACK_HEADSET | Loading Loading @@ -1439,6 +1442,10 @@ correct_plug_type: if (!wrk_complete && mbhc->btn_press_intr) { pr_debug("%s: Can be slow insertion of headphone\n", __func__); wcd_cancel_btn_work(mbhc); /* Report as headphone only if previously * not reported as lineout */ if (!mbhc->force_linein) plug_type = MBHC_PLUG_TYPE_HEADPHONE; } /* Loading
sound/soc/codecs/wcd-mbhc-v2.h +1 −0 Original line number Diff line number Diff line Loading @@ -470,6 +470,7 @@ struct wcd_mbhc { struct notifier_block psy_nb; struct power_supply *usb_psy; struct work_struct usbc_analog_work; bool force_linein; }; #define WCD_MBHC_CAL_SIZE(buttons, rload) ( \ sizeof(struct wcd_mbhc_general_cfg) + \ Loading