Lines Matching refs:wm8731
98 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec); in wm8731_set_deemph() local
104 if (wm8731->deemph) { in wm8731_set_deemph()
107 if (abs(wm8731_deemph[i] - wm8731->playback_fs) < in wm8731_set_deemph()
108 abs(wm8731_deemph[best] - wm8731->playback_fs)) in wm8731_set_deemph()
128 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec); in wm8731_get_deemph() local
130 ucontrol->value.integer.value[0] = wm8731->deemph; in wm8731_get_deemph()
139 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec); in wm8731_put_deemph() local
146 mutex_lock(&wm8731->lock); in wm8731_put_deemph()
147 if (wm8731->deemph != deemph) { in wm8731_put_deemph()
148 wm8731->deemph = deemph; in wm8731_put_deemph()
154 mutex_unlock(&wm8731->lock); in wm8731_put_deemph()
223 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec); in wm8731_check_osc() local
225 return wm8731->sysclk_type == WM8731_SYSCLK_XTAL; in wm8731_check_osc()
346 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec); in wm8731_hw_params() local
348 int i = get_coeff(wm8731->sysclk, params_rate(params)); in wm8731_hw_params()
352 wm8731->playback_fs = params_rate(params); in wm8731_hw_params()
390 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec); in wm8731_set_dai_sysclk() local
395 if (wm8731->mclk && clk_set_rate(wm8731->mclk, freq)) in wm8731_set_dai_sysclk()
397 wm8731->sysclk_type = clk_id; in wm8731_set_dai_sysclk()
405 wm8731->constraints = NULL; in wm8731_set_dai_sysclk()
408 wm8731->constraints = &wm8731_constraints_12000000; in wm8731_set_dai_sysclk()
412 wm8731->constraints = &wm8731_constraints_12288000_18432000; in wm8731_set_dai_sysclk()
416 wm8731->constraints = &wm8731_constraints_11289600_16934400; in wm8731_set_dai_sysclk()
422 wm8731->sysclk = freq; in wm8731_set_dai_sysclk()
492 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec); in wm8731_set_bias_level() local
498 if (wm8731->mclk) in wm8731_set_bias_level()
499 clk_prepare_enable(wm8731->mclk); in wm8731_set_bias_level()
505 ret = regulator_bulk_enable(ARRAY_SIZE(wm8731->supplies), in wm8731_set_bias_level()
506 wm8731->supplies); in wm8731_set_bias_level()
510 regcache_sync(wm8731->regmap); in wm8731_set_bias_level()
518 if (wm8731->mclk) in wm8731_set_bias_level()
519 clk_disable_unprepare(wm8731->mclk); in wm8731_set_bias_level()
521 regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), in wm8731_set_bias_level()
522 wm8731->supplies); in wm8731_set_bias_level()
523 regcache_mark_dirty(wm8731->regmap); in wm8731_set_bias_level()
533 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(dai->codec); in wm8731_startup() local
535 if (wm8731->constraints) in wm8731_startup()
538 wm8731->constraints); in wm8731_startup()
576 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec); in wm8731_probe() local
579 for (i = 0; i < ARRAY_SIZE(wm8731->supplies); i++) in wm8731_probe()
580 wm8731->supplies[i].supply = wm8731_supply_names[i]; in wm8731_probe()
582 ret = devm_regulator_bulk_get(codec->dev, ARRAY_SIZE(wm8731->supplies), in wm8731_probe()
583 wm8731->supplies); in wm8731_probe()
589 ret = regulator_bulk_enable(ARRAY_SIZE(wm8731->supplies), in wm8731_probe()
590 wm8731->supplies); in wm8731_probe()
614 regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); in wm8731_probe()
619 regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); in wm8731_probe()
627 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec); in wm8731_remove() local
629 regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); in wm8731_remove()
671 struct wm8731_priv *wm8731; in wm8731_spi_probe() local
674 wm8731 = devm_kzalloc(&spi->dev, sizeof(*wm8731), GFP_KERNEL); in wm8731_spi_probe()
675 if (wm8731 == NULL) in wm8731_spi_probe()
678 wm8731->mclk = devm_clk_get(&spi->dev, "mclk"); in wm8731_spi_probe()
679 if (IS_ERR(wm8731->mclk)) { in wm8731_spi_probe()
680 ret = PTR_ERR(wm8731->mclk); in wm8731_spi_probe()
682 wm8731->mclk = NULL; in wm8731_spi_probe()
691 mutex_init(&wm8731->lock); in wm8731_spi_probe()
693 wm8731->regmap = devm_regmap_init_spi(spi, &wm8731_regmap); in wm8731_spi_probe()
694 if (IS_ERR(wm8731->regmap)) { in wm8731_spi_probe()
695 ret = PTR_ERR(wm8731->regmap); in wm8731_spi_probe()
701 spi_set_drvdata(spi, wm8731); in wm8731_spi_probe()
734 struct wm8731_priv *wm8731; in wm8731_i2c_probe() local
737 wm8731 = devm_kzalloc(&i2c->dev, sizeof(struct wm8731_priv), in wm8731_i2c_probe()
739 if (wm8731 == NULL) in wm8731_i2c_probe()
742 wm8731->mclk = devm_clk_get(&i2c->dev, "mclk"); in wm8731_i2c_probe()
743 if (IS_ERR(wm8731->mclk)) { in wm8731_i2c_probe()
744 ret = PTR_ERR(wm8731->mclk); in wm8731_i2c_probe()
746 wm8731->mclk = NULL; in wm8731_i2c_probe()
755 mutex_init(&wm8731->lock); in wm8731_i2c_probe()
757 wm8731->regmap = devm_regmap_init_i2c(i2c, &wm8731_regmap); in wm8731_i2c_probe()
758 if (IS_ERR(wm8731->regmap)) { in wm8731_i2c_probe()
759 ret = PTR_ERR(wm8731->regmap); in wm8731_i2c_probe()
765 i2c_set_clientdata(i2c, wm8731); in wm8731_i2c_probe()