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",
567 struct wm8804_priv *wm8804;
571 wm8804 = devm_kzalloc(dev, sizeof(*wm8804), GFP_KERNEL);
572 if (!wm8804)
575 dev_set_drvdata(dev, wm8804);
577 wm8804->dev = dev;
578 wm8804->regmap = regmap;
580 wm8804->reset = devm_gpiod_get_optional(dev, "wlf,reset",
582 if (IS_ERR(wm8804->reset)) {
583 ret = PTR_ERR(wm8804->reset);
588 for (i = 0; i < ARRAY_SIZE(wm8804->supplies); i++)
589 wm8804->supplies[i].supply = wm8804_supply_names[i];
591 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(wm8804->supplies),
592 wm8804->supplies);
598 wm8804->disable_nb[0].notifier_call = wm8804_regulator_event_0;
599 wm8804->disable_nb[1].notifier_call = wm8804_regulator_event_1;
602 for (i = 0; i < ARRAY_SIZE(wm8804->supplies); i++) {
603 struct regulator *regulator = wm8804->supplies[i].consumer;
606 &wm8804->disable_nb[i]);
615 ret = regulator_bulk_enable(ARRAY_SIZE(wm8804->supplies),
616 wm8804->supplies);
622 gpiod_set_value_cansleep(wm8804->reset, 1);
652 if (!wm8804->reset) {
653 ret = wm8804_soft_reset(wm8804);
674 regulator_bulk_disable(ARRAY_SIZE(wm8804->supplies), wm8804->supplies);
688 struct wm8804_priv *wm8804 = dev_get_drvdata(dev);
691 ret = regulator_bulk_enable(ARRAY_SIZE(wm8804->supplies),
692 wm8804->supplies);
694 dev_err(wm8804->dev, "Failed to enable supplies: %d\n", ret);
698 regcache_sync(wm8804->regmap);
701 regmap_update_bits(wm8804->regmap, WM8804_PWRDN, 0x8, 0x0);
708 struct wm8804_priv *wm8804 = dev_get_drvdata(dev);
711 regmap_update_bits(wm8804->regmap, WM8804_PWRDN, 0x8, 0x8);
713 regulator_bulk_disable(ARRAY_SIZE(wm8804->supplies),
714 wm8804->supplies);