Lines Matching refs:wm8731
70 struct wm8731_priv *wm8731 = snd_soc_component_get_drvdata(component); in wm8731_set_deemph() local
76 if (wm8731->deemph) { in wm8731_set_deemph()
79 if (abs(wm8731_deemph[i] - wm8731->playback_fs) < in wm8731_set_deemph()
80 abs(wm8731_deemph[best] - wm8731->playback_fs)) in wm8731_set_deemph()
100 struct wm8731_priv *wm8731 = snd_soc_component_get_drvdata(component); in wm8731_get_deemph() local
102 ucontrol->value.integer.value[0] = wm8731->deemph; in wm8731_get_deemph()
111 struct wm8731_priv *wm8731 = snd_soc_component_get_drvdata(component); in wm8731_put_deemph() local
118 mutex_lock(&wm8731->lock); in wm8731_put_deemph()
119 if (wm8731->deemph != deemph) { in wm8731_put_deemph()
120 wm8731->deemph = deemph; in wm8731_put_deemph()
126 mutex_unlock(&wm8731->lock); in wm8731_put_deemph()
195 struct wm8731_priv *wm8731 = snd_soc_component_get_drvdata(component); in wm8731_check_osc() local
197 return wm8731->sysclk_type == WM8731_SYSCLK_XTAL; in wm8731_check_osc()
318 struct wm8731_priv *wm8731 = snd_soc_component_get_drvdata(component); in wm8731_hw_params() local
320 int i = get_coeff(wm8731->sysclk, params_rate(params)); in wm8731_hw_params()
324 wm8731->playback_fs = params_rate(params); in wm8731_hw_params()
366 struct wm8731_priv *wm8731 = snd_soc_component_get_drvdata(component); in wm8731_set_dai_sysclk() local
371 if (wm8731->mclk && clk_set_rate(wm8731->mclk, freq)) in wm8731_set_dai_sysclk()
373 wm8731->sysclk_type = clk_id; in wm8731_set_dai_sysclk()
381 wm8731->constraints = NULL; in wm8731_set_dai_sysclk()
384 wm8731->constraints = &wm8731_constraints_12000000; in wm8731_set_dai_sysclk()
388 wm8731->constraints = &wm8731_constraints_12288000_18432000; in wm8731_set_dai_sysclk()
392 wm8731->constraints = &wm8731_constraints_11289600_16934400; in wm8731_set_dai_sysclk()
398 wm8731->sysclk = freq; in wm8731_set_dai_sysclk()
467 struct wm8731_priv *wm8731 = snd_soc_component_get_drvdata(component); in wm8731_set_bias_level() local
473 if (wm8731->mclk) { in wm8731_set_bias_level()
474 ret = clk_prepare_enable(wm8731->mclk); in wm8731_set_bias_level()
483 ret = regulator_bulk_enable(ARRAY_SIZE(wm8731->supplies), in wm8731_set_bias_level()
484 wm8731->supplies); in wm8731_set_bias_level()
488 regcache_sync(wm8731->regmap); in wm8731_set_bias_level()
496 if (wm8731->mclk) in wm8731_set_bias_level()
497 clk_disable_unprepare(wm8731->mclk); in wm8731_set_bias_level()
499 regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), in wm8731_set_bias_level()
500 wm8731->supplies); in wm8731_set_bias_level()
501 regcache_mark_dirty(wm8731->regmap); in wm8731_set_bias_level()
510 struct wm8731_priv *wm8731 = snd_soc_component_get_drvdata(dai->component); in wm8731_startup() local
512 if (wm8731->constraints) in wm8731_startup()
515 wm8731->constraints); in wm8731_startup()
566 int wm8731_init(struct device *dev, struct wm8731_priv *wm8731) in wm8731_init() argument
570 wm8731->mclk = devm_clk_get(dev, "mclk"); in wm8731_init()
571 if (IS_ERR(wm8731->mclk)) { in wm8731_init()
572 ret = PTR_ERR(wm8731->mclk); in wm8731_init()
574 wm8731->mclk = NULL; in wm8731_init()
582 mutex_init(&wm8731->lock); in wm8731_init()
584 for (i = 0; i < ARRAY_SIZE(wm8731->supplies); i++) in wm8731_init()
585 wm8731->supplies[i].supply = wm8731_supply_names[i]; in wm8731_init()
587 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(wm8731->supplies), in wm8731_init()
588 wm8731->supplies); in wm8731_init()
594 ret = regulator_bulk_enable(ARRAY_SIZE(wm8731->supplies), in wm8731_init()
595 wm8731->supplies); in wm8731_init()
601 ret = wm8731_reset(wm8731->regmap); in wm8731_init()
608 regmap_write(wm8731->regmap, WM8731_PWR, 0x7f); in wm8731_init()
611 regmap_update_bits(wm8731->regmap, WM8731_LOUT1V, 0x100, 0); in wm8731_init()
612 regmap_update_bits(wm8731->regmap, WM8731_ROUT1V, 0x100, 0); in wm8731_init()
613 regmap_update_bits(wm8731->regmap, WM8731_LINVOL, 0x100, 0); in wm8731_init()
614 regmap_update_bits(wm8731->regmap, WM8731_RINVOL, 0x100, 0); in wm8731_init()
617 regmap_update_bits(wm8731->regmap, WM8731_APANA, 0x8, 0); in wm8731_init()
619 regcache_mark_dirty(wm8731->regmap); in wm8731_init()
632 regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); in wm8731_init()