Lines Matching refs:wcd934x
2420 struct wcd934x_codec *wcd934x = snd_soc_component_get_drvdata(component); in wcd934x_micbias_control() local
2442 mutex_lock(&wcd934x->micb_lock); in wcd934x_micbias_control()
2446 wcd934x->pullup_ref[micb_index]++; in wcd934x_micbias_control()
2447 if ((wcd934x->pullup_ref[micb_index] == 1) && in wcd934x_micbias_control()
2448 (wcd934x->micb_ref[micb_index] == 0)) in wcd934x_micbias_control()
2454 if (wcd934x->pullup_ref[micb_index] > 0) in wcd934x_micbias_control()
2455 wcd934x->pullup_ref[micb_index]--; in wcd934x_micbias_control()
2457 if ((wcd934x->pullup_ref[micb_index] == 0) && in wcd934x_micbias_control()
2458 (wcd934x->micb_ref[micb_index] == 0)) in wcd934x_micbias_control()
2463 wcd934x->micb_ref[micb_index]++; in wcd934x_micbias_control()
2464 if (wcd934x->micb_ref[micb_index] == 1) { in wcd934x_micbias_control()
2469 wcd_mbhc_event_notify(wcd934x->mbhc, in wcd934x_micbias_control()
2474 wcd_mbhc_event_notify(wcd934x->mbhc, in wcd934x_micbias_control()
2478 if (wcd934x->micb_ref[micb_index] > 0) in wcd934x_micbias_control()
2479 wcd934x->micb_ref[micb_index]--; in wcd934x_micbias_control()
2481 if ((wcd934x->micb_ref[micb_index] == 0) && in wcd934x_micbias_control()
2482 (wcd934x->pullup_ref[micb_index] > 0)) in wcd934x_micbias_control()
2486 else if ((wcd934x->micb_ref[micb_index] == 0) && in wcd934x_micbias_control()
2487 (wcd934x->pullup_ref[micb_index] == 0)) { in wcd934x_micbias_control()
2489 wcd_mbhc_event_notify(wcd934x->mbhc, in wcd934x_micbias_control()
2495 wcd_mbhc_event_notify(wcd934x->mbhc, in wcd934x_micbias_control()
2499 wcd_mbhc_event_notify(wcd934x->mbhc, in wcd934x_micbias_control()
2504 mutex_unlock(&wcd934x->micb_lock); in wcd934x_micbias_control()
2554 struct wcd934x_codec *wcd934x = snd_soc_component_get_drvdata(component); in wcd934x_mbhc_micb_adjust_voltage() local
2573 mutex_lock(&wcd934x->micb_lock); in wcd934x_mbhc_micb_adjust_voltage()
2618 mutex_unlock(&wcd934x->micb_lock); in wcd934x_mbhc_micb_adjust_voltage()
2625 struct wcd934x_codec *wcd934x = snd_soc_component_get_drvdata(component); in wcd934x_mbhc_micb_ctrl_threshold_mic() local
2635 if (wcd934x->micb2_mv >= WCD_MBHC_THR_HS_MICB_MV) in wcd934x_mbhc_micb_ctrl_threshold_mic()
2638 micb_mv = req_en ? WCD_MBHC_THR_HS_MICB_MV : wcd934x->micb2_mv; in wcd934x_mbhc_micb_ctrl_threshold_mic()
2645 static void wcd934x_mbhc_get_result_params(struct wcd934x_codec *wcd934x, in wcd934x_mbhc_get_result_params() argument
2658 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_ZDET, 0x20, 0x20); in wcd934x_mbhc_get_result_params()
2660 regmap_read(wcd934x->regmap, WCD934X_ANA_MBHC_RESULT_2, &val); in wcd934x_mbhc_get_result_params()
2665 regmap_read(wcd934x->regmap, WCD934X_ANA_MBHC_RESULT_1, &val1); in wcd934x_mbhc_get_result_params()
2667 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_ZDET, 0x20, 0x00); in wcd934x_mbhc_get_result_params()
2675 dev_err(wcd934x->dev, "%s: Impedance detect ramp error, c1=%d, x1=0x%x\n", in wcd934x_mbhc_get_result_params()
2686 dev_dbg(wcd934x->dev, "%s: d1=%d, c1=%d, x1=0x%x, z_val=%di (milliohm)\n", in wcd934x_mbhc_get_result_params()
2692 regmap_read(wcd934x->regmap, WCD934X_ANA_MBHC_RESULT_1, &val); in wcd934x_mbhc_get_result_params()
2693 regmap_read(wcd934x->regmap, WCD934X_ANA_MBHC_RESULT_2, &val1); in wcd934x_mbhc_get_result_params()
2707 struct wcd934x_codec *wcd934x = dev_get_drvdata(component->dev); in wcd934x_mbhc_zdet_ramp() local
2726 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_ZDET, 0x80, 0x80); in wcd934x_mbhc_zdet_ramp()
2727 wcd934x_mbhc_get_result_params(wcd934x, d1_a, zdet_param->noff, &zdet); in wcd934x_mbhc_zdet_ramp()
2728 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_ZDET, 0x80, 0x00); in wcd934x_mbhc_zdet_ramp()
2736 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_ZDET, 0x40, 0x40); in wcd934x_mbhc_zdet_ramp()
2737 wcd934x_mbhc_get_result_params(wcd934x, d1_a, zdet_param->noff, &zdet); in wcd934x_mbhc_zdet_ramp()
2738 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_ZDET, 0x40, 0x00); in wcd934x_mbhc_zdet_ramp()
2766 struct wcd934x_codec *wcd934x = dev_get_drvdata(component->dev); in wcd934x_wcd_mbhc_calc_impedance() local
2794 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_ELECT, 0x80, 0x00); in wcd934x_wcd_mbhc_calc_impedance()
2798 if (wcd934x->mbhc_cfg.hphl_swh) in wcd934x_wcd_mbhc_calc_impedance()
2799 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_MECH, 0x80, 0x00); in wcd934x_wcd_mbhc_calc_impedance()
2802 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_MECH, 0x01, 0x00); in wcd934x_wcd_mbhc_calc_impedance()
2886 wcd_mbhc_set_hph_type(wcd934x->mbhc, WCD_MBHC_HPH_MONO); in wcd934x_wcd_mbhc_calc_impedance()
2910 wcd_mbhc_set_hph_type(wcd934x->mbhc, WCD_MBHC_HPH_STEREO); in wcd934x_wcd_mbhc_calc_impedance()
2914 wcd_mbhc_set_hph_type(wcd934x->mbhc, WCD_MBHC_HPH_MONO); in wcd934x_wcd_mbhc_calc_impedance()
2922 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_MECH, 0x01, 0x01); in wcd934x_wcd_mbhc_calc_impedance()
2925 if (wcd934x->mbhc_cfg.hphl_swh) in wcd934x_wcd_mbhc_calc_impedance()
2926 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_MECH, 0x80, 0x80); in wcd934x_wcd_mbhc_calc_impedance()
2931 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_ELECT, 0x80, 0x80); in wcd934x_wcd_mbhc_calc_impedance()