Lines Matching refs:component
548 struct snd_soc_component *component; member
1511 struct snd_soc_component *comp = dai->component; in wcd934x_set_prim_interpolator_rate()
1568 struct snd_soc_component *component = dai->component; in wcd934x_set_mix_interpolator_rate() local
1569 struct wcd934x_codec *wcd = dev_get_drvdata(component->dev); in wcd934x_set_mix_interpolator_rate()
1578 val = snd_soc_component_read(component, in wcd934x_set_mix_interpolator_rate()
1590 dev_err(component->dev, in wcd934x_set_mix_interpolator_rate()
1596 snd_soc_component_update_bits(component, in wcd934x_set_mix_interpolator_rate()
1637 struct snd_soc_component *comp = dai->component; in wcd934x_set_decimator_rate()
1801 wcd = snd_soc_component_get_drvdata(dai->component); in wcd934x_hw_params()
1885 wcd = snd_soc_component_get_drvdata(dai->component); in wcd934x_hw_free()
1901 wcd = snd_soc_component_get_drvdata(dai->component); in wcd934x_trigger()
1933 wcd = snd_soc_component_get_drvdata(dai->component); in wcd934x_set_channel_map()
1970 wcd = snd_soc_component_get_drvdata(dai->component); in wcd934x_get_channel_map()
2269 static int wcd934x_comp_init(struct snd_soc_component *component) in wcd934x_comp_init() argument
2271 struct wcd934x_codec *wcd = dev_get_drvdata(component->dev); in wcd934x_comp_init()
2358 static void wcd934x_mbhc_clk_setup(struct snd_soc_component *component, in wcd934x_mbhc_clk_setup() argument
2361 snd_soc_component_write_field(component, WCD934X_MBHC_NEW_CTL_1, in wcd934x_mbhc_clk_setup()
2365 static void wcd934x_mbhc_mbhc_bias_control(struct snd_soc_component *component, in wcd934x_mbhc_mbhc_bias_control() argument
2368 snd_soc_component_write_field(component, WCD934X_ANA_MBHC_ELECT, in wcd934x_mbhc_mbhc_bias_control()
2372 static void wcd934x_mbhc_program_btn_thr(struct snd_soc_component *component, in wcd934x_mbhc_program_btn_thr() argument
2379 dev_err(component->dev, "%s: invalid number of buttons: %d\n", in wcd934x_mbhc_program_btn_thr()
2386 snd_soc_component_write_field(component, WCD934X_ANA_MBHC_BTN0 + i, in wcd934x_mbhc_program_btn_thr()
2391 static bool wcd934x_mbhc_micb_en_status(struct snd_soc_component *component, int micb_num) in wcd934x_mbhc_micb_en_status() argument
2396 val = snd_soc_component_read_field(component, WCD934X_ANA_MICB2, in wcd934x_mbhc_micb_en_status()
2404 static void wcd934x_mbhc_hph_l_pull_up_control(struct snd_soc_component *component, in wcd934x_mbhc_hph_l_pull_up_control() argument
2413 snd_soc_component_write_field(component, WCD934X_MBHC_NEW_PLUG_DETECT_CTL, in wcd934x_mbhc_hph_l_pull_up_control()
2417 static int wcd934x_micbias_control(struct snd_soc_component *component, in wcd934x_micbias_control() argument
2420 struct wcd934x_codec *wcd934x = snd_soc_component_get_drvdata(component); in wcd934x_micbias_control()
2438 dev_err(component->dev, "%s: Invalid micbias number: %d\n", in wcd934x_micbias_control()
2449 snd_soc_component_write_field(component, micb_reg, in wcd934x_micbias_control()
2459 snd_soc_component_write_field(component, micb_reg, in wcd934x_micbias_control()
2465 snd_soc_component_write_field(component, micb_reg, in wcd934x_micbias_control()
2483 snd_soc_component_write_field(component, micb_reg, in wcd934x_micbias_control()
2492 snd_soc_component_write_field(component, micb_reg, in wcd934x_micbias_control()
2509 static int wcd934x_mbhc_request_micbias(struct snd_soc_component *component, in wcd934x_mbhc_request_micbias() argument
2512 struct wcd934x_codec *wcd = dev_get_drvdata(component->dev); in wcd934x_mbhc_request_micbias()
2518 ret = wcd934x_micbias_control(component, micb_num, req, false); in wcd934x_mbhc_request_micbias()
2526 static void wcd934x_mbhc_micb_ramp_control(struct snd_soc_component *component, in wcd934x_mbhc_micb_ramp_control() argument
2530 snd_soc_component_write_field(component, WCD934X_ANA_MICB2_RAMP, in wcd934x_mbhc_micb_ramp_control()
2532 snd_soc_component_write_field(component, WCD934X_ANA_MICB2_RAMP, in wcd934x_mbhc_micb_ramp_control()
2535 snd_soc_component_write_field(component, WCD934X_ANA_MICB2_RAMP, in wcd934x_mbhc_micb_ramp_control()
2537 snd_soc_component_write_field(component, WCD934X_ANA_MICB2_RAMP, in wcd934x_mbhc_micb_ramp_control()
2551 static int wcd934x_mbhc_micb_adjust_voltage(struct snd_soc_component *component, in wcd934x_mbhc_micb_adjust_voltage() argument
2554 struct wcd934x_codec *wcd934x = snd_soc_component_get_drvdata(component); in wcd934x_mbhc_micb_adjust_voltage()
2582 micb_en = snd_soc_component_read_field(component, micb_reg, in wcd934x_mbhc_micb_adjust_voltage()
2584 cur_vout_ctl = snd_soc_component_read_field(component, micb_reg, in wcd934x_mbhc_micb_adjust_voltage()
2599 snd_soc_component_write_field(component, micb_reg, in wcd934x_mbhc_micb_adjust_voltage()
2603 snd_soc_component_write_field(component, micb_reg, in wcd934x_mbhc_micb_adjust_voltage()
2608 snd_soc_component_write_field(component, micb_reg, in wcd934x_mbhc_micb_adjust_voltage()
2622 static int wcd934x_mbhc_micb_ctrl_threshold_mic(struct snd_soc_component *component, in wcd934x_mbhc_micb_ctrl_threshold_mic() argument
2625 struct wcd934x_codec *wcd934x = snd_soc_component_get_drvdata(component); in wcd934x_mbhc_micb_ctrl_threshold_mic()
2640 rc = wcd934x_mbhc_micb_adjust_voltage(component, micb_mv, MIC_BIAS_2); in wcd934x_mbhc_micb_ctrl_threshold_mic()
2703 static void wcd934x_mbhc_zdet_ramp(struct snd_soc_component *component, in wcd934x_mbhc_zdet_ramp() argument
2707 struct wcd934x_codec *wcd934x = dev_get_drvdata(component->dev); in wcd934x_mbhc_zdet_ramp()
2710 snd_soc_component_write_field(component, WCD934X_MBHC_NEW_ZDET_ANA_CTL, in wcd934x_mbhc_zdet_ramp()
2712 snd_soc_component_update_bits(component, WCD934X_ANA_MBHC_BTN5, in wcd934x_mbhc_zdet_ramp()
2714 snd_soc_component_update_bits(component, WCD934X_ANA_MBHC_BTN6, in wcd934x_mbhc_zdet_ramp()
2716 snd_soc_component_update_bits(component, WCD934X_ANA_MBHC_BTN7, in wcd934x_mbhc_zdet_ramp()
2718 snd_soc_component_write_field(component, WCD934X_MBHC_NEW_ZDET_ANA_CTL, in wcd934x_mbhc_zdet_ramp()
2720 snd_soc_component_update_bits(component, WCD934X_MBHC_NEW_ZDET_RAMP_CTL, in wcd934x_mbhc_zdet_ramp()
2743 static void wcd934x_wcd_mbhc_qfuse_cal(struct snd_soc_component *component, in wcd934x_wcd_mbhc_qfuse_cal() argument
2750 q1 = snd_soc_component_read(component, in wcd934x_wcd_mbhc_qfuse_cal()
2753 q1 = snd_soc_component_read(component, in wcd934x_wcd_mbhc_qfuse_cal()
2763 static void wcd934x_wcd_mbhc_calc_impedance(struct snd_soc_component *component, in wcd934x_wcd_mbhc_calc_impedance() argument
2766 struct wcd934x_codec *wcd934x = dev_get_drvdata(component->dev); in wcd934x_wcd_mbhc_calc_impedance()
2786 reg0 = snd_soc_component_read(component, WCD934X_ANA_MBHC_BTN5); in wcd934x_wcd_mbhc_calc_impedance()
2787 reg1 = snd_soc_component_read(component, WCD934X_ANA_MBHC_BTN6); in wcd934x_wcd_mbhc_calc_impedance()
2788 reg2 = snd_soc_component_read(component, WCD934X_ANA_MBHC_BTN7); in wcd934x_wcd_mbhc_calc_impedance()
2789 reg3 = snd_soc_component_read(component, WCD934X_MBHC_CTL_CLK); in wcd934x_wcd_mbhc_calc_impedance()
2790 reg4 = snd_soc_component_read(component, WCD934X_MBHC_NEW_ZDET_ANA_CTL); in wcd934x_wcd_mbhc_calc_impedance()
2792 if (snd_soc_component_read(component, WCD934X_ANA_MBHC_ELECT) & 0x80) { in wcd934x_wcd_mbhc_calc_impedance()
2807 wcd934x_mbhc_zdet_ramp(component, zdet_param_ptr, &z1L, NULL, d1); in wcd934x_wcd_mbhc_calc_impedance()
2824 wcd934x_mbhc_zdet_ramp(component, zdet_param_ptr, &z1L, NULL, d1); in wcd934x_wcd_mbhc_calc_impedance()
2834 wcd934x_wcd_mbhc_qfuse_cal(component, zl, 0); in wcd934x_wcd_mbhc_calc_impedance()
2836 dev_info(component->dev, "%s: impedance on HPH_L = %d(ohms)\n", in wcd934x_wcd_mbhc_calc_impedance()
2840 wcd934x_mbhc_zdet_ramp(component, zdet_param_ptr, NULL, &z1R, d1); in wcd934x_wcd_mbhc_calc_impedance()
2858 wcd934x_mbhc_zdet_ramp(component, zdet_param_ptr, NULL, &z1R, d1); in wcd934x_wcd_mbhc_calc_impedance()
2866 wcd934x_wcd_mbhc_qfuse_cal(component, zr, 1); in wcd934x_wcd_mbhc_calc_impedance()
2868 dev_err(component->dev, "%s: impedance on HPH_R = %d(ohms)\n", in wcd934x_wcd_mbhc_calc_impedance()
2874 dev_dbg(component->dev, in wcd934x_wcd_mbhc_calc_impedance()
2883 dev_dbg(component->dev, in wcd934x_wcd_mbhc_calc_impedance()
2889 snd_soc_component_write_field(component, WCD934X_HPH_R_ATEST, in wcd934x_wcd_mbhc_calc_impedance()
2891 snd_soc_component_write_field(component, WCD934X_HPH_PA_CTL2, in wcd934x_wcd_mbhc_calc_impedance()
2894 wcd934x_mbhc_zdet_ramp(component, &zdet_param[0], &z1Ls, NULL, d1); in wcd934x_wcd_mbhc_calc_impedance()
2896 wcd934x_mbhc_zdet_ramp(component, &zdet_param[1], &z1Ls, NULL, d1); in wcd934x_wcd_mbhc_calc_impedance()
2897 snd_soc_component_write_field(component, WCD934X_HPH_PA_CTL2, in wcd934x_wcd_mbhc_calc_impedance()
2899 snd_soc_component_write_field(component, WCD934X_HPH_R_ATEST, in wcd934x_wcd_mbhc_calc_impedance()
2902 wcd934x_wcd_mbhc_qfuse_cal(component, &z1Ls, 0); in wcd934x_wcd_mbhc_calc_impedance()
2908 dev_err(component->dev, "%s: stereo plug type detected\n", in wcd934x_wcd_mbhc_calc_impedance()
2912 dev_err(component->dev, "%s: MONO plug type detected\n", in wcd934x_wcd_mbhc_calc_impedance()
2918 snd_soc_component_write(component, WCD934X_ANA_MBHC_BTN5, reg0); in wcd934x_wcd_mbhc_calc_impedance()
2919 snd_soc_component_write(component, WCD934X_ANA_MBHC_BTN6, reg1); in wcd934x_wcd_mbhc_calc_impedance()
2920 snd_soc_component_write(component, WCD934X_ANA_MBHC_BTN7, reg2); in wcd934x_wcd_mbhc_calc_impedance()
2928 snd_soc_component_write(component, WCD934X_MBHC_NEW_ZDET_ANA_CTL, reg4); in wcd934x_wcd_mbhc_calc_impedance()
2929 snd_soc_component_write(component, WCD934X_MBHC_CTL_CLK, reg3); in wcd934x_wcd_mbhc_calc_impedance()
2934 static void wcd934x_mbhc_gnd_det_ctrl(struct snd_soc_component *component, in wcd934x_mbhc_gnd_det_ctrl() argument
2938 snd_soc_component_write_field(component, WCD934X_ANA_MBHC_MECH, in wcd934x_mbhc_gnd_det_ctrl()
2940 snd_soc_component_write_field(component, WCD934X_ANA_MBHC_MECH, in wcd934x_mbhc_gnd_det_ctrl()
2943 snd_soc_component_write_field(component, WCD934X_ANA_MBHC_MECH, in wcd934x_mbhc_gnd_det_ctrl()
2945 snd_soc_component_write_field(component, WCD934X_ANA_MBHC_MECH, in wcd934x_mbhc_gnd_det_ctrl()
2950 static void wcd934x_mbhc_hph_pull_down_ctrl(struct snd_soc_component *component, in wcd934x_mbhc_hph_pull_down_ctrl() argument
2953 snd_soc_component_write_field(component, WCD934X_HPH_PA_CTL2, in wcd934x_mbhc_hph_pull_down_ctrl()
2955 snd_soc_component_write_field(component, WCD934X_HPH_PA_CTL2, in wcd934x_mbhc_hph_pull_down_ctrl()
2976 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wcd934x_get_hph_type() local
2977 struct wcd934x_codec *wcd = snd_soc_component_get_drvdata(component); in wcd934x_get_hph_type()
2990 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wcd934x_hph_impedance_get() local
2991 struct wcd934x_codec *wcd = snd_soc_component_get_drvdata(component); in wcd934x_hph_impedance_get()
2996 dev_dbg(component->dev, "%s: zl=%u(ohms), zr=%u(ohms)\n", __func__, zl, zr); in wcd934x_hph_impedance_get()
3013 static int wcd934x_mbhc_init(struct snd_soc_component *component) in wcd934x_mbhc_init() argument
3015 struct wcd934x_ddata *data = dev_get_drvdata(component->dev->parent); in wcd934x_mbhc_init()
3016 struct wcd934x_codec *wcd = snd_soc_component_get_drvdata(component); in wcd934x_mbhc_init()
3034 wcd->mbhc = wcd_mbhc_init(component, &mbhc_cb, intr_ids, wcd_mbhc_fields, true); in wcd934x_mbhc_init()
3040 snd_soc_add_component_controls(component, impedance_detect_controls, in wcd934x_mbhc_init()
3042 snd_soc_add_component_controls(component, hph_type_detect_controls, in wcd934x_mbhc_init()
3048 static void wcd934x_mbhc_deinit(struct snd_soc_component *component) in wcd934x_mbhc_deinit() argument
3050 struct wcd934x_codec *wcd = snd_soc_component_get_drvdata(component); in wcd934x_mbhc_deinit()
3058 static int wcd934x_comp_probe(struct snd_soc_component *component) in wcd934x_comp_probe() argument
3060 struct wcd934x_codec *wcd = dev_get_drvdata(component->dev); in wcd934x_comp_probe()
3063 snd_soc_component_init_regmap(component, wcd->regmap); in wcd934x_comp_probe()
3064 wcd->component = component; in wcd934x_comp_probe()
3067 wcd->clsh_ctrl = wcd_clsh_ctrl_alloc(component, wcd->version); in wcd934x_comp_probe()
3074 wcd934x_comp_init(component); in wcd934x_comp_probe()
3079 wcd934x_init_dmic(component); in wcd934x_comp_probe()
3081 if (wcd934x_mbhc_init(component)) in wcd934x_comp_probe()
3082 dev_err(component->dev, "Failed to Initialize MBHC\n"); in wcd934x_comp_probe()
3114 static uint32_t get_iir_band_coeff(struct snd_soc_component *component, in get_iir_band_coeff() argument
3124 snd_soc_component_write(component, reg, in get_iir_band_coeff()
3128 value |= snd_soc_component_read(component, b2_reg); in get_iir_band_coeff()
3129 snd_soc_component_write(component, reg, in get_iir_band_coeff()
3133 value |= (snd_soc_component_read(component, b2_reg) << 8); in get_iir_band_coeff()
3134 snd_soc_component_write(component, reg, in get_iir_band_coeff()
3138 value |= (snd_soc_component_read(component, b2_reg) << 16); in get_iir_band_coeff()
3139 snd_soc_component_write(component, reg, in get_iir_band_coeff()
3144 value |= (snd_soc_component_read(component, b2_reg) << 24); in get_iir_band_coeff()
3148 static void set_iir_band_coeff(struct snd_soc_component *component, in set_iir_band_coeff() argument
3153 snd_soc_component_write(component, reg, (value & 0xFF)); in set_iir_band_coeff()
3154 snd_soc_component_write(component, reg, (value >> 8) & 0xFF); in set_iir_band_coeff()
3155 snd_soc_component_write(component, reg, (value >> 16) & 0xFF); in set_iir_band_coeff()
3157 snd_soc_component_write(component, reg, (value >> 24) & 0x3F); in set_iir_band_coeff()
3164 struct snd_soc_component *component = in wcd934x_put_iir_band_audio_mixer() local
3178 snd_soc_component_write(component, reg, (band_idx * BAND_MAX * in wcd934x_put_iir_band_audio_mixer()
3181 set_iir_band_coeff(component, iir_idx, band_idx, coeff[0]); in wcd934x_put_iir_band_audio_mixer()
3182 set_iir_band_coeff(component, iir_idx, band_idx, coeff[1]); in wcd934x_put_iir_band_audio_mixer()
3183 set_iir_band_coeff(component, iir_idx, band_idx, coeff[2]); in wcd934x_put_iir_band_audio_mixer()
3184 set_iir_band_coeff(component, iir_idx, band_idx, coeff[3]); in wcd934x_put_iir_band_audio_mixer()
3185 set_iir_band_coeff(component, iir_idx, band_idx, coeff[4]); in wcd934x_put_iir_band_audio_mixer()
3193 struct snd_soc_component *component = in wcd934x_get_iir_band_audio_mixer() local
3202 coeff[0] = get_iir_band_coeff(component, iir_idx, band_idx, 0); in wcd934x_get_iir_band_audio_mixer()
3203 coeff[1] = get_iir_band_coeff(component, iir_idx, band_idx, 1); in wcd934x_get_iir_band_audio_mixer()
3204 coeff[2] = get_iir_band_coeff(component, iir_idx, band_idx, 2); in wcd934x_get_iir_band_audio_mixer()
3205 coeff[3] = get_iir_band_coeff(component, iir_idx, band_idx, 3); in wcd934x_get_iir_band_audio_mixer()
3206 coeff[4] = get_iir_band_coeff(component, iir_idx, band_idx, 4); in wcd934x_get_iir_band_audio_mixer()
3229 struct snd_soc_component *component = snd_soc_kcontrol_component(kc); in wcd934x_compander_get() local
3231 struct wcd934x_codec *wcd = dev_get_drvdata(component->dev); in wcd934x_compander_get()
3241 struct snd_soc_component *component = snd_soc_kcontrol_component(kc); in wcd934x_compander_set() local
3242 struct wcd934x_codec *wcd = dev_get_drvdata(component->dev); in wcd934x_compander_set()
3258 snd_soc_component_update_bits(component, WCD934X_HPH_L_EN, in wcd934x_compander_set()
3263 snd_soc_component_update_bits(component, WCD934X_HPH_R_EN, in wcd934x_compander_set()
3282 struct snd_soc_component *component = snd_soc_kcontrol_component(kc); in wcd934x_rx_hph_mode_get() local
3283 struct wcd934x_codec *wcd = dev_get_drvdata(component->dev); in wcd934x_rx_hph_mode_get()
3293 struct snd_soc_component *component = snd_soc_kcontrol_component(kc); in wcd934x_rx_hph_mode_put() local
3294 struct wcd934x_codec *wcd = dev_get_drvdata(component->dev); in wcd934x_rx_hph_mode_put()
3416 struct snd_soc_component *component; in wcd934x_int_dem_inp_mux_put() local
3419 component = snd_soc_dapm_kcontrol_component(kc); in wcd934x_int_dem_inp_mux_put()
3432 snd_soc_component_update_bits(component, reg, in wcd934x_int_dem_inp_mux_put()
3436 snd_soc_component_update_bits(component, reg, in wcd934x_int_dem_inp_mux_put()
4144 struct snd_soc_component *component) in wcd934x_codec_enable_int_port() argument
4149 struct wcd934x_codec *wcd = dev_get_drvdata(component->dev); in wcd934x_codec_enable_int_port()
4184 static void wcd934x_codec_hd2_control(struct snd_soc_component *component, in wcd934x_codec_hd2_control() argument
4204 snd_soc_component_update_bits(component, hd2_scale_reg, in wcd934x_codec_hd2_control()
4207 snd_soc_component_update_bits(component, hd2_enable_reg, in wcd934x_codec_hd2_control()
4213 snd_soc_component_update_bits(component, hd2_enable_reg, in wcd934x_codec_hd2_control()
4216 snd_soc_component_update_bits(component, hd2_scale_reg, in wcd934x_codec_hd2_control()
5166 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd934x_codec_enable_micbias() local
5171 wcd934x_micbias_control(component, micb_num, MICB_ENABLE, true); in wcd934x_codec_enable_micbias()
5178 wcd934x_micbias_control(component, micb_num, MICB_DISABLE, true); in wcd934x_codec_enable_micbias()