Lines Matching full:wcd934x

9 #include <linux/mfd/wcd934x/registers.h>
10 #include <linux/mfd/wcd934x/wcd934x.h>
1447 dev_info(wcd->dev, "WCD934X Minor:0x%x Version:0x%x\n", id_minor, ver); in wcd934x_get_version()
1774 dai_data->sruntime = slim_stream_allocate(wcd->sdev, "WCD934x-SLIM"); in wcd934x_slim_set_hw_params()
2412 struct wcd934x_codec *wcd934x = snd_soc_component_get_drvdata(component); in wcd934x_micbias_control() local
2434 mutex_lock(&wcd934x->micb_lock); in wcd934x_micbias_control()
2438 wcd934x->pullup_ref[micb_index]++; in wcd934x_micbias_control()
2439 if ((wcd934x->pullup_ref[micb_index] == 1) && in wcd934x_micbias_control()
2440 (wcd934x->micb_ref[micb_index] == 0)) in wcd934x_micbias_control()
2446 if (wcd934x->pullup_ref[micb_index] > 0) in wcd934x_micbias_control()
2447 wcd934x->pullup_ref[micb_index]--; in wcd934x_micbias_control()
2449 if ((wcd934x->pullup_ref[micb_index] == 0) && in wcd934x_micbias_control()
2450 (wcd934x->micb_ref[micb_index] == 0)) in wcd934x_micbias_control()
2455 wcd934x->micb_ref[micb_index]++; in wcd934x_micbias_control()
2456 if (wcd934x->micb_ref[micb_index] == 1) { in wcd934x_micbias_control()
2461 wcd_mbhc_event_notify(wcd934x->mbhc, in wcd934x_micbias_control()
2466 wcd_mbhc_event_notify(wcd934x->mbhc, in wcd934x_micbias_control()
2470 if (wcd934x->micb_ref[micb_index] > 0) in wcd934x_micbias_control()
2471 wcd934x->micb_ref[micb_index]--; in wcd934x_micbias_control()
2473 if ((wcd934x->micb_ref[micb_index] == 0) && in wcd934x_micbias_control()
2474 (wcd934x->pullup_ref[micb_index] > 0)) in wcd934x_micbias_control()
2478 else if ((wcd934x->micb_ref[micb_index] == 0) && in wcd934x_micbias_control()
2479 (wcd934x->pullup_ref[micb_index] == 0)) { in wcd934x_micbias_control()
2481 wcd_mbhc_event_notify(wcd934x->mbhc, in wcd934x_micbias_control()
2487 wcd_mbhc_event_notify(wcd934x->mbhc, in wcd934x_micbias_control()
2491 wcd_mbhc_event_notify(wcd934x->mbhc, in wcd934x_micbias_control()
2496 mutex_unlock(&wcd934x->micb_lock); in wcd934x_micbias_control()
2546 struct wcd934x_codec *wcd934x = snd_soc_component_get_drvdata(component); in wcd934x_mbhc_micb_adjust_voltage() local
2565 mutex_lock(&wcd934x->micb_lock); in wcd934x_mbhc_micb_adjust_voltage()
2610 mutex_unlock(&wcd934x->micb_lock); in wcd934x_mbhc_micb_adjust_voltage()
2617 struct wcd934x_codec *wcd934x = snd_soc_component_get_drvdata(component); in wcd934x_mbhc_micb_ctrl_threshold_mic() local
2627 if (wcd934x->micb2_mv >= WCD_MBHC_THR_HS_MICB_MV) in wcd934x_mbhc_micb_ctrl_threshold_mic()
2630 micb_mv = req_en ? WCD_MBHC_THR_HS_MICB_MV : wcd934x->micb2_mv; in wcd934x_mbhc_micb_ctrl_threshold_mic()
2637 static void wcd934x_mbhc_get_result_params(struct wcd934x_codec *wcd934x, in wcd934x_mbhc_get_result_params() argument
2650 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_ZDET, 0x20, 0x20); in wcd934x_mbhc_get_result_params()
2652 regmap_read(wcd934x->regmap, WCD934X_ANA_MBHC_RESULT_2, &val); in wcd934x_mbhc_get_result_params()
2657 regmap_read(wcd934x->regmap, WCD934X_ANA_MBHC_RESULT_1, &val1); in wcd934x_mbhc_get_result_params()
2659 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_ZDET, 0x20, 0x00); in wcd934x_mbhc_get_result_params()
2667 dev_err(wcd934x->dev, "%s: Impedance detect ramp error, c1=%d, x1=0x%x\n", in wcd934x_mbhc_get_result_params()
2678 dev_dbg(wcd934x->dev, "%s: d1=%d, c1=%d, x1=0x%x, z_val=%di (milliohm)\n", in wcd934x_mbhc_get_result_params()
2684 regmap_read(wcd934x->regmap, WCD934X_ANA_MBHC_RESULT_1, &val); in wcd934x_mbhc_get_result_params()
2685 regmap_read(wcd934x->regmap, WCD934X_ANA_MBHC_RESULT_2, &val1); in wcd934x_mbhc_get_result_params()
2699 struct wcd934x_codec *wcd934x = dev_get_drvdata(component->dev); in wcd934x_mbhc_zdet_ramp() local
2718 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_ZDET, 0x80, 0x80); in wcd934x_mbhc_zdet_ramp()
2719 wcd934x_mbhc_get_result_params(wcd934x, d1_a, zdet_param->noff, &zdet); in wcd934x_mbhc_zdet_ramp()
2720 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_ZDET, 0x80, 0x00); in wcd934x_mbhc_zdet_ramp()
2728 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_ZDET, 0x40, 0x40); in wcd934x_mbhc_zdet_ramp()
2729 wcd934x_mbhc_get_result_params(wcd934x, d1_a, zdet_param->noff, &zdet); in wcd934x_mbhc_zdet_ramp()
2730 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_ZDET, 0x40, 0x00); in wcd934x_mbhc_zdet_ramp()
2758 struct wcd934x_codec *wcd934x = dev_get_drvdata(component->dev); in wcd934x_wcd_mbhc_calc_impedance() local
2786 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_ELECT, 0x80, 0x00); in wcd934x_wcd_mbhc_calc_impedance()
2790 if (wcd934x->mbhc_cfg.hphl_swh) in wcd934x_wcd_mbhc_calc_impedance()
2791 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_MECH, 0x80, 0x00); in wcd934x_wcd_mbhc_calc_impedance()
2794 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_MECH, 0x01, 0x00); in wcd934x_wcd_mbhc_calc_impedance()
2878 wcd_mbhc_set_hph_type(wcd934x->mbhc, WCD_MBHC_HPH_MONO); in wcd934x_wcd_mbhc_calc_impedance()
2902 wcd_mbhc_set_hph_type(wcd934x->mbhc, WCD_MBHC_HPH_STEREO); in wcd934x_wcd_mbhc_calc_impedance()
2906 wcd_mbhc_set_hph_type(wcd934x->mbhc, WCD_MBHC_HPH_MONO); in wcd934x_wcd_mbhc_calc_impedance()
2914 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_MECH, 0x01, 0x01); in wcd934x_wcd_mbhc_calc_impedance()
2917 if (wcd934x->mbhc_cfg.hphl_swh) in wcd934x_wcd_mbhc_calc_impedance()
2918 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_MECH, 0x80, 0x80); in wcd934x_wcd_mbhc_calc_impedance()
2923 regmap_update_bits(wcd934x->regmap, WCD934X_ANA_MBHC_ELECT, 0x80, 0x80); in wcd934x_wcd_mbhc_calc_impedance()
5938 .name = "wcd934x-codec",
5948 .name = "wcd934x-codec",
5953 MODULE_DESCRIPTION("WCD934x codec driver");