Lines Matching defs:wm8804

3  * wm8804.c  --  WM8804 S/PDIF transceiver driver
28 #include "wm8804.h"
86 struct wm8804_priv *wm8804 = container_of(nb, struct wm8804_priv, \
89 regcache_mark_dirty(wm8804->regmap); \
138 struct wm8804_priv *wm8804 = snd_soc_component_get_drvdata(component);
143 if (!wm8804->aif_pwr)
145 wm8804->aif_pwr++;
149 wm8804->aif_pwr--;
150 if (!wm8804->aif_pwr)
211 static int wm8804_soft_reset(struct wm8804_priv *wm8804)
213 return regmap_write(wm8804->regmap, WM8804_RST_DEVID1, 0x0);
406 struct wm8804_priv *wm8804 = snd_soc_component_get_drvdata(component);
411 regmap_update_bits_check(wm8804->regmap, WM8804_PWRDN,
414 pm_runtime_put(wm8804->dev);
420 wm8804->mclk_div);
425 regmap_update_bits_check(wm8804->regmap, WM8804_PWRDN,
428 pm_runtime_get_sync(wm8804->dev);
487 struct wm8804_priv *wm8804;
496 wm8804 = snd_soc_component_get_drvdata(component);
497 wm8804->mclk_div = div;
523 .name = "wm8804-spdif",
566 struct wm8804_priv *wm8804;
570 wm8804 = devm_kzalloc(dev, sizeof(*wm8804), GFP_KERNEL);
571 if (!wm8804)
574 dev_set_drvdata(dev, wm8804);
576 wm8804->dev = dev;
577 wm8804->regmap = regmap;
579 wm8804->reset = devm_gpiod_get_optional(dev, "wlf,reset",
581 if (IS_ERR(wm8804->reset)) {
582 ret = PTR_ERR(wm8804->reset);
587 for (i = 0; i < ARRAY_SIZE(wm8804->supplies); i++)
588 wm8804->supplies[i].supply = wm8804_supply_names[i];
590 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(wm8804->supplies),
591 wm8804->supplies);
597 wm8804->disable_nb[0].notifier_call = wm8804_regulator_event_0;
598 wm8804->disable_nb[1].notifier_call = wm8804_regulator_event_1;
601 for (i = 0; i < ARRAY_SIZE(wm8804->supplies); i++) {
602 struct regulator *regulator = wm8804->supplies[i].consumer;
605 &wm8804->disable_nb[i]);
614 ret = regulator_bulk_enable(ARRAY_SIZE(wm8804->supplies),
615 wm8804->supplies);
621 gpiod_set_value_cansleep(wm8804->reset, 1);
651 if (!wm8804->reset) {
652 ret = wm8804_soft_reset(wm8804);
673 regulator_bulk_disable(ARRAY_SIZE(wm8804->supplies), wm8804->supplies);
687 struct wm8804_priv *wm8804 = dev_get_drvdata(dev);
690 ret = regulator_bulk_enable(ARRAY_SIZE(wm8804->supplies),
691 wm8804->supplies);
693 dev_err(wm8804->dev, "Failed to enable supplies: %d\n", ret);
697 regcache_sync(wm8804->regmap);
700 regmap_update_bits(wm8804->regmap, WM8804_PWRDN, 0x8, 0x0);
707 struct wm8804_priv *wm8804 = dev_get_drvdata(dev);
710 regmap_update_bits(wm8804->regmap, WM8804_PWRDN, 0x8, 0x8);
712 regulator_bulk_disable(ARRAY_SIZE(wm8804->supplies),
713 wm8804->supplies);