Lines Matching refs:da7218
429 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_mixin_gain_put() local
438 if ((ret == 1) && (da7218->alc_en)) in da7218_mixin_gain_put()
450 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_alc_sw_put() local
458 if ((lvalue || rvalue) && (!da7218->alc_en)) in da7218_alc_sw_put()
462 da7218->alc_en &= ~mask; in da7218_alc_sw_put()
463 da7218->alc_en |= (lvalue << lshift) | (rvalue << rshift); in da7218_alc_sw_put()
473 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_tonegen_freq_get() local
484 ret = regmap_raw_read(da7218->regmap, reg, &val, 2); in da7218_tonegen_freq_get()
497 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_tonegen_freq_put() local
510 return regmap_raw_write(da7218->regmap, reg, &val, 2); in da7218_tonegen_freq_put()
517 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_mic_lvl_det_sw_put() local
526 da7218->mic_lvl_det_en &= ~mask; in da7218_mic_lvl_det_sw_put()
527 da7218->mic_lvl_det_en |= (lvalue << lshift) | (rvalue << rshift); in da7218_mic_lvl_det_sw_put()
537 (da7218->in_filt_en & da7218->mic_lvl_det_en)); in da7218_mic_lvl_det_sw_put()
544 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_mic_lvl_det_sw_get() local
553 (da7218->mic_lvl_det_en & lmask) >> lshift; in da7218_mic_lvl_det_sw_get()
555 (da7218->mic_lvl_det_en & rmask) >> rshift; in da7218_mic_lvl_det_sw_get()
564 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_biquad_coeff_get() local
571 memcpy(ucontrol->value.bytes.data, da7218->biq_5stage_coeff, in da7218_biquad_coeff_get()
575 memcpy(ucontrol->value.bytes.data, da7218->stbiq_3stage_coeff, in da7218_biquad_coeff_get()
589 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_biquad_coeff_put() local
603 memcpy(da7218->biq_5stage_coeff, ucontrol->value.bytes.data, in da7218_biquad_coeff_put()
608 memcpy(da7218->stbiq_3stage_coeff, ucontrol->value.bytes.data, in da7218_biquad_coeff_put()
623 regmap_raw_write(da7218->regmap, reg, cfg, DA7218_BIQ_CFG_SIZE); in da7218_biquad_coeff_put()
1349 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_in_filter_event() local
1371 da7218->in_filt_en |= mask; in da7218_in_filter_event()
1377 if (mask & da7218->mic_lvl_det_en) in da7218_in_filter_event()
1381 da7218->in_filt_en &= ~mask; in da7218_in_filter_event()
1389 (da7218->in_filt_en & da7218->mic_lvl_det_en)); in da7218_in_filter_event()
1398 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_dai_event() local
1405 if (da7218->master) in da7218_dai_event()
1466 if (da7218->master) in da7218_dai_event()
1481 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_cp_event() local
1487 if (da7218->hp_single_supply) in da7218_cp_event()
1813 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_set_dai_sysclk() local
1816 if (da7218->mclk_rate == freq) in da7218_set_dai_sysclk()
1840 if (da7218->mclk) { in da7218_set_dai_sysclk()
1841 freq = clk_round_rate(da7218->mclk, freq); in da7218_set_dai_sysclk()
1842 ret = clk_set_rate(da7218->mclk, freq); in da7218_set_dai_sysclk()
1850 da7218->mclk_rate = freq; in da7218_set_dai_sysclk()
1859 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_set_dai_pll() local
1867 if (da7218->mclk_rate < 2000000) { in da7218_set_dai_pll()
1869 da7218->mclk_rate); in da7218_set_dai_pll()
1871 } else if (da7218->mclk_rate <= 4500000) { in da7218_set_dai_pll()
1874 } else if (da7218->mclk_rate <= 9000000) { in da7218_set_dai_pll()
1877 } else if (da7218->mclk_rate <= 18000000) { in da7218_set_dai_pll()
1880 } else if (da7218->mclk_rate <= 36000000) { in da7218_set_dai_pll()
1883 } else if (da7218->mclk_rate <= 54000000) { in da7218_set_dai_pll()
1888 da7218->mclk_rate); in da7218_set_dai_pll()
1891 freq_ref = (da7218->mclk_rate / indiv); in da7218_set_dai_pll()
1934 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_set_dai_fmt() local
1939 da7218->master = true; in da7218_set_dai_fmt()
1942 da7218->master = false; in da7218_set_dai_fmt()
2209 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_hpldet() local
2211 if (da7218->dev_id == DA7217_DEV_ID) in da7218_hpldet()
2214 da7218->jack = jack; in da7218_hpldet()
2235 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_hpldet_irq() local
2246 snd_soc_jack_report(da7218->jack, report, SND_JACK_HEADPHONE); in da7218_hpldet_irq()
2435 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_of_to_pdata() local
2501 if (da7218->dev_id == DA7217_DEV_ID) { in da7218_of_to_pdata()
2506 if (da7218->dev_id == DA7218_DEV_ID) { in da7218_of_to_pdata()
2564 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_set_bias_level() local
2573 if (da7218->mclk) { in da7218_set_bias_level()
2574 ret = clk_prepare_enable(da7218->mclk); in da7218_set_bias_level()
2596 if (da7218->mclk) in da7218_set_bias_level()
2597 clk_disable_unprepare(da7218->mclk); in da7218_set_bias_level()
2602 if (!da7218->jack) { in da7218_set_bias_level()
2625 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_handle_supplies() local
2632 da7218->supplies[i].supply = da7218_supply_names[i]; in da7218_handle_supplies()
2635 da7218->supplies); in da7218_handle_supplies()
2642 vddio = da7218->supplies[DA7218_SUPPLY_VDDIO].consumer; in da7218_handle_supplies()
2650 ret = regulator_bulk_enable(DA7218_NUM_SUPPLIES, da7218->supplies); in da7218_handle_supplies()
2667 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_handle_pdata() local
2668 struct da7218_pdata *pdata = da7218->pdata; in da7218_handle_pdata()
2790 if (da7218->dev_id == DA7217_DEV_ID) { in da7218_handle_pdata()
2791 da7218->hp_single_supply = in da7218_handle_pdata()
2794 if (da7218->hp_single_supply) { in da7218_handle_pdata()
2804 if ((da7218->dev_id == DA7218_DEV_ID) && in da7218_handle_pdata()
2869 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_probe() local
2879 da7218->pdata = da7218_of_to_pdata(component); in da7218_probe()
2881 da7218->pdata = dev_get_platdata(component->dev); in da7218_probe()
2886 da7218->mclk = devm_clk_get_optional(component->dev, "mclk"); in da7218_probe()
2887 if (IS_ERR(da7218->mclk)) { in da7218_probe()
2888 ret = PTR_ERR(da7218->mclk); in da7218_probe()
2944 if (da7218->dev_id == DA7217_DEV_ID) { in da7218_probe()
2954 if (da7218->irq) { in da7218_probe()
2955 ret = devm_request_threaded_irq(component->dev, da7218->irq, NULL, in da7218_probe()
2961 da7218->irq, ret); in da7218_probe()
2970 regulator_bulk_disable(DA7218_NUM_SUPPLIES, da7218->supplies); in da7218_probe()
2977 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_remove() local
2979 regulator_bulk_disable(DA7218_NUM_SUPPLIES, da7218->supplies); in da7218_remove()
2985 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_suspend() local
2990 if (!da7218->jack) in da7218_suspend()
2998 struct da7218_priv *da7218 = snd_soc_component_get_drvdata(component); in da7218_resume() local
3001 if (!da7218->jack) in da7218_resume()
3248 struct da7218_priv *da7218; in da7218_i2c_probe() local
3251 da7218 = devm_kzalloc(&i2c->dev, sizeof(*da7218), GFP_KERNEL); in da7218_i2c_probe()
3252 if (!da7218) in da7218_i2c_probe()
3255 i2c_set_clientdata(i2c, da7218); in da7218_i2c_probe()
3257 da7218->dev_id = (uintptr_t)i2c_get_match_data(i2c); in da7218_i2c_probe()
3259 if ((da7218->dev_id != DA7217_DEV_ID) && in da7218_i2c_probe()
3260 (da7218->dev_id != DA7218_DEV_ID)) { in da7218_i2c_probe()
3265 da7218->irq = i2c->irq; in da7218_i2c_probe()
3267 da7218->regmap = devm_regmap_init_i2c(i2c, &da7218_regmap_config); in da7218_i2c_probe()
3268 if (IS_ERR(da7218->regmap)) { in da7218_i2c_probe()
3269 ret = PTR_ERR(da7218->regmap); in da7218_i2c_probe()