Lines Matching defs:wm8731
2 * wm8731.c -- WM8731 ALSA SoC Audio driver
33 #include "wm8731.h"
56 * wm8731 register cache
228 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec);
230 int i = get_coeff(wm8731->sysclk, params_rate(params));
295 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec);
303 wm8731->sysclk = freq;
372 struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec);
385 ret = regulator_bulk_enable(ARRAY_SIZE(wm8731->supplies),
386 wm8731->supplies);
409 regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies),
410 wm8731->supplies);
525 static int wm8731_register(struct wm8731_priv *wm8731,
529 struct snd_soc_codec *codec = &wm8731->codec;
541 snd_soc_codec_set_drvdata(codec, wm8731);
549 codec->reg_cache = &wm8731->reg_cache;
559 for (i = 0; i < ARRAY_SIZE(wm8731->supplies); i++)
560 wm8731->supplies[i].supply = wm8731_supply_names[i];
562 ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(wm8731->supplies),
563 wm8731->supplies);
569 ret = regulator_bulk_enable(ARRAY_SIZE(wm8731->supplies),
570 wm8731->supplies);
611 regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies);
618 regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies);
620 regulator_bulk_free(ARRAY_SIZE(wm8731->supplies), wm8731->supplies);
622 kfree(wm8731);
626 static void wm8731_unregister(struct wm8731_priv *wm8731)
628 wm8731_set_bias_level(&wm8731->codec, SND_SOC_BIAS_OFF);
630 snd_soc_unregister_codec(&wm8731->codec);
631 regulator_bulk_free(ARRAY_SIZE(wm8731->supplies), wm8731->supplies);
632 kfree(wm8731);
640 struct wm8731_priv *wm8731;
642 wm8731 = kzalloc(sizeof(struct wm8731_priv), GFP_KERNEL);
643 if (wm8731 == NULL)
646 codec = &wm8731->codec;
650 dev_set_drvdata(&spi->dev, wm8731);
652 return wm8731_register(wm8731, SND_SOC_SPI);
657 struct wm8731_priv *wm8731 = dev_get_drvdata(&spi->dev);
659 wm8731_unregister(wm8731);
666 .name = "wm8731",
679 struct wm8731_priv *wm8731;
682 wm8731 = kzalloc(sizeof(struct wm8731_priv), GFP_KERNEL);
683 if (wm8731 == NULL)
686 codec = &wm8731->codec;
688 i2c_set_clientdata(i2c, wm8731);
693 return wm8731_register(wm8731, SND_SOC_I2C);
698 struct wm8731_priv *wm8731 = i2c_get_clientdata(client);
699 wm8731_unregister(wm8731);
704 { "wm8731", 0 },
711 .name = "wm8731",