Loading sound/soc/codecs/wcd9xxx-mbhc.c +20 −5 Original line number Diff line number Diff line Loading @@ -140,6 +140,12 @@ #define WCD9XXX_BOX_CAR_AVRG_MIN 1 #define WCD9XXX_BOX_CAR_AVRG_MAX 10 /* * Need to report LINEIN if H/L impedance * is larger than 5K ohm */ #define WCD9XXX_LINEIN_THRESHOLD 5000000 static int impedance_detect_en; module_param(impedance_detect_en, int, S_IRUGO | S_IWUSR | S_IWGRP); Loading Loading @@ -933,8 +939,6 @@ static void wcd9xxx_report_plug(struct wcd9xxx_mbhc *mbhc, int insertion, } /* Report insertion */ mbhc->hph_status |= jack_type; if (jack_type == SND_JACK_HEADPHONE) { mbhc->current_plug = PLUG_TYPE_HEADPHONE; } else if (jack_type == SND_JACK_UNSUPPORTED) { Loading @@ -950,15 +954,26 @@ static void wcd9xxx_report_plug(struct wcd9xxx_mbhc *mbhc, int insertion, mbhc->current_plug = PLUG_TYPE_ANC_HEADPHONE; } if (mbhc->impedance_detect && impedance_detect_en) { wcd9xxx_detect_impedance(mbhc, &mbhc->zl, &mbhc->zr); if ((mbhc->zl > WCD9XXX_LINEIN_THRESHOLD) && (mbhc->zr > WCD9XXX_LINEIN_THRESHOLD)) { jack_type = SND_JACK_LINEOUT; mbhc->current_plug = PLUG_TYPE_HIGH_HPH; pr_debug("%s: Replace with SND_JACK_LINEOUT\n", __func__); } } mbhc->hph_status |= jack_type; if (mbhc->micbias_enable && mbhc->micbias_enable_cb) { pr_debug("%s: Enabling micbias\n", __func__); mbhc->micbias_enable_cb(mbhc->codec, true, mbhc->mbhc_cfg->micbias); } if (mbhc->impedance_detect && impedance_detect_en) wcd9xxx_detect_impedance(mbhc, &mbhc->zl, &mbhc->zr); pr_debug("%s: Reporting insertion %d(%x)\n", __func__, jack_type, mbhc->hph_status); wcd9xxx_jack_report(mbhc, &mbhc->headset_jack, Loading Loading
sound/soc/codecs/wcd9xxx-mbhc.c +20 −5 Original line number Diff line number Diff line Loading @@ -140,6 +140,12 @@ #define WCD9XXX_BOX_CAR_AVRG_MIN 1 #define WCD9XXX_BOX_CAR_AVRG_MAX 10 /* * Need to report LINEIN if H/L impedance * is larger than 5K ohm */ #define WCD9XXX_LINEIN_THRESHOLD 5000000 static int impedance_detect_en; module_param(impedance_detect_en, int, S_IRUGO | S_IWUSR | S_IWGRP); Loading Loading @@ -933,8 +939,6 @@ static void wcd9xxx_report_plug(struct wcd9xxx_mbhc *mbhc, int insertion, } /* Report insertion */ mbhc->hph_status |= jack_type; if (jack_type == SND_JACK_HEADPHONE) { mbhc->current_plug = PLUG_TYPE_HEADPHONE; } else if (jack_type == SND_JACK_UNSUPPORTED) { Loading @@ -950,15 +954,26 @@ static void wcd9xxx_report_plug(struct wcd9xxx_mbhc *mbhc, int insertion, mbhc->current_plug = PLUG_TYPE_ANC_HEADPHONE; } if (mbhc->impedance_detect && impedance_detect_en) { wcd9xxx_detect_impedance(mbhc, &mbhc->zl, &mbhc->zr); if ((mbhc->zl > WCD9XXX_LINEIN_THRESHOLD) && (mbhc->zr > WCD9XXX_LINEIN_THRESHOLD)) { jack_type = SND_JACK_LINEOUT; mbhc->current_plug = PLUG_TYPE_HIGH_HPH; pr_debug("%s: Replace with SND_JACK_LINEOUT\n", __func__); } } mbhc->hph_status |= jack_type; if (mbhc->micbias_enable && mbhc->micbias_enable_cb) { pr_debug("%s: Enabling micbias\n", __func__); mbhc->micbias_enable_cb(mbhc->codec, true, mbhc->mbhc_cfg->micbias); } if (mbhc->impedance_detect && impedance_detect_en) wcd9xxx_detect_impedance(mbhc, &mbhc->zl, &mbhc->zr); pr_debug("%s: Reporting insertion %d(%x)\n", __func__, jack_type, mbhc->hph_status); wcd9xxx_jack_report(mbhc, &mbhc->headset_jack, Loading