Lines Matching refs:wm8804
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); in wm8804_aif_event() local
142 if (!wm8804->aif_pwr) in wm8804_aif_event()
144 wm8804->aif_pwr++; in wm8804_aif_event()
148 wm8804->aif_pwr--; in wm8804_aif_event()
149 if (!wm8804->aif_pwr) in wm8804_aif_event()
210 static int wm8804_soft_reset(struct wm8804_priv *wm8804) in wm8804_soft_reset() argument
212 return regmap_write(wm8804->regmap, WM8804_RST_DEVID1, 0x0); in wm8804_soft_reset()
405 struct wm8804_priv *wm8804 = snd_soc_component_get_drvdata(component); in wm8804_set_pll() local
410 regmap_update_bits_check(wm8804->regmap, WM8804_PWRDN, in wm8804_set_pll()
413 pm_runtime_put(wm8804->dev); in wm8804_set_pll()
419 wm8804->mclk_div); in wm8804_set_pll()
424 regmap_update_bits_check(wm8804->regmap, WM8804_PWRDN, in wm8804_set_pll()
427 pm_runtime_get_sync(wm8804->dev); in wm8804_set_pll()
486 struct wm8804_priv *wm8804; in wm8804_set_clkdiv() local
495 wm8804 = snd_soc_component_get_drvdata(component); in wm8804_set_clkdiv()
496 wm8804->mclk_div = div; in wm8804_set_clkdiv()
565 struct wm8804_priv *wm8804; in wm8804_probe() local
569 wm8804 = devm_kzalloc(dev, sizeof(*wm8804), GFP_KERNEL); in wm8804_probe()
570 if (!wm8804) in wm8804_probe()
573 dev_set_drvdata(dev, wm8804); in wm8804_probe()
575 wm8804->dev = dev; in wm8804_probe()
576 wm8804->regmap = regmap; in wm8804_probe()
578 wm8804->reset = devm_gpiod_get_optional(dev, "wlf,reset", in wm8804_probe()
580 if (IS_ERR(wm8804->reset)) { in wm8804_probe()
581 ret = PTR_ERR(wm8804->reset); in wm8804_probe()
586 for (i = 0; i < ARRAY_SIZE(wm8804->supplies); i++) in wm8804_probe()
587 wm8804->supplies[i].supply = wm8804_supply_names[i]; in wm8804_probe()
589 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(wm8804->supplies), in wm8804_probe()
590 wm8804->supplies); in wm8804_probe()
596 wm8804->disable_nb[0].notifier_call = wm8804_regulator_event_0; in wm8804_probe()
597 wm8804->disable_nb[1].notifier_call = wm8804_regulator_event_1; in wm8804_probe()
600 for (i = 0; i < ARRAY_SIZE(wm8804->supplies); i++) { in wm8804_probe()
601 struct regulator *regulator = wm8804->supplies[i].consumer; in wm8804_probe()
604 &wm8804->disable_nb[i]); in wm8804_probe()
613 ret = regulator_bulk_enable(ARRAY_SIZE(wm8804->supplies), in wm8804_probe()
614 wm8804->supplies); in wm8804_probe()
620 gpiod_set_value_cansleep(wm8804->reset, 1); in wm8804_probe()
650 if (!wm8804->reset) { in wm8804_probe()
651 ret = wm8804_soft_reset(wm8804); in wm8804_probe()
672 regulator_bulk_disable(ARRAY_SIZE(wm8804->supplies), wm8804->supplies); in wm8804_probe()
686 struct wm8804_priv *wm8804 = dev_get_drvdata(dev); in wm8804_runtime_resume() local
689 ret = regulator_bulk_enable(ARRAY_SIZE(wm8804->supplies), in wm8804_runtime_resume()
690 wm8804->supplies); in wm8804_runtime_resume()
692 dev_err(wm8804->dev, "Failed to enable supplies: %d\n", ret); in wm8804_runtime_resume()
696 regcache_sync(wm8804->regmap); in wm8804_runtime_resume()
699 regmap_update_bits(wm8804->regmap, WM8804_PWRDN, 0x8, 0x0); in wm8804_runtime_resume()
706 struct wm8804_priv *wm8804 = dev_get_drvdata(dev); in wm8804_runtime_suspend() local
709 regmap_update_bits(wm8804->regmap, WM8804_PWRDN, 0x8, 0x8); in wm8804_runtime_suspend()
711 regulator_bulk_disable(ARRAY_SIZE(wm8804->supplies), in wm8804_runtime_suspend()
712 wm8804->supplies); in wm8804_runtime_suspend()