Lines Matching refs:wm8804

3  * wm8804.c  --  WM8804 S/PDIF transceiver driver
27 #include "wm8804.h"
85 struct wm8804_priv *wm8804 = container_of(nb, struct wm8804_priv, \
88 regcache_mark_dirty(wm8804->regmap); \
137 struct wm8804_priv *wm8804 = snd_soc_component_get_drvdata(component);
142 if (!wm8804->aif_pwr)
144 wm8804->aif_pwr++;
148 wm8804->aif_pwr--;
149 if (!wm8804->aif_pwr)
210 static int wm8804_soft_reset(struct wm8804_priv *wm8804)
212 return regmap_write(wm8804->regmap, WM8804_RST_DEVID1, 0x0);
405 struct wm8804_priv *wm8804 = snd_soc_component_get_drvdata(component);
410 regmap_update_bits_check(wm8804->regmap, WM8804_PWRDN,
413 pm_runtime_put(wm8804->dev);
419 wm8804->mclk_div);
424 regmap_update_bits_check(wm8804->regmap, WM8804_PWRDN,
427 pm_runtime_get_sync(wm8804->dev);
486 struct wm8804_priv *wm8804;
495 wm8804 = snd_soc_component_get_drvdata(component);
496 wm8804->mclk_div = div;
522 .name = "wm8804-spdif",
565 struct wm8804_priv *wm8804;
569 wm8804 = devm_kzalloc(dev, sizeof(*wm8804), GFP_KERNEL);
570 if (!wm8804)
573 dev_set_drvdata(dev, wm8804);
575 wm8804->dev = dev;
576 wm8804->regmap = regmap;
578 wm8804->reset = devm_gpiod_get_optional(dev, "wlf,reset",
580 if (IS_ERR(wm8804->reset)) {
581 ret = PTR_ERR(wm8804->reset);
586 for (i = 0; i < ARRAY_SIZE(wm8804->supplies); i++)
587 wm8804->supplies[i].supply = wm8804_supply_names[i];
589 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(wm8804->supplies),
590 wm8804->supplies);
596 wm8804->disable_nb[0].notifier_call = wm8804_regulator_event_0;
597 wm8804->disable_nb[1].notifier_call = wm8804_regulator_event_1;
600 for (i = 0; i < ARRAY_SIZE(wm8804->supplies); i++) {
601 struct regulator *regulator = wm8804->supplies[i].consumer;
604 &wm8804->disable_nb[i]);
613 ret = regulator_bulk_enable(ARRAY_SIZE(wm8804->supplies),
614 wm8804->supplies);
620 gpiod_set_value_cansleep(wm8804->reset, 1);
650 if (!wm8804->reset) {
651 ret = wm8804_soft_reset(wm8804);
672 regulator_bulk_disable(ARRAY_SIZE(wm8804->supplies), wm8804->supplies);
686 struct wm8804_priv *wm8804 = dev_get_drvdata(dev);
689 ret = regulator_bulk_enable(ARRAY_SIZE(wm8804->supplies),
690 wm8804->supplies);
692 dev_err(wm8804->dev, "Failed to enable supplies: %d\n", ret);
696 regcache_sync(wm8804->regmap);
699 regmap_update_bits(wm8804->regmap, WM8804_PWRDN, 0x8, 0x0);
706 struct wm8804_priv *wm8804 = dev_get_drvdata(dev);
709 regmap_update_bits(wm8804->regmap, WM8804_PWRDN, 0x8, 0x8);
711 regulator_bulk_disable(ARRAY_SIZE(wm8804->supplies),
712 wm8804->supplies);