Lines Matching refs:wm8804
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); in wm8804_aif_event() local
143 if (!wm8804->aif_pwr) in wm8804_aif_event()
145 wm8804->aif_pwr++; in wm8804_aif_event()
149 wm8804->aif_pwr--; in wm8804_aif_event()
150 if (!wm8804->aif_pwr) in wm8804_aif_event()
211 static int wm8804_soft_reset(struct wm8804_priv *wm8804) in wm8804_soft_reset() argument
213 return regmap_write(wm8804->regmap, WM8804_RST_DEVID1, 0x0); in wm8804_soft_reset()
406 struct wm8804_priv *wm8804 = snd_soc_component_get_drvdata(component); in wm8804_set_pll() local
411 regmap_update_bits_check(wm8804->regmap, WM8804_PWRDN, in wm8804_set_pll()
414 pm_runtime_put(wm8804->dev); in wm8804_set_pll()
420 wm8804->mclk_div); in wm8804_set_pll()
425 regmap_update_bits_check(wm8804->regmap, WM8804_PWRDN, in wm8804_set_pll()
428 pm_runtime_get_sync(wm8804->dev); in wm8804_set_pll()
487 struct wm8804_priv *wm8804; in wm8804_set_clkdiv() local
496 wm8804 = snd_soc_component_get_drvdata(component); in wm8804_set_clkdiv()
497 wm8804->mclk_div = div; in wm8804_set_clkdiv()
567 struct wm8804_priv *wm8804; in wm8804_probe() local
571 wm8804 = devm_kzalloc(dev, sizeof(*wm8804), GFP_KERNEL); in wm8804_probe()
572 if (!wm8804) in wm8804_probe()
575 dev_set_drvdata(dev, wm8804); in wm8804_probe()
577 wm8804->dev = dev; in wm8804_probe()
578 wm8804->regmap = regmap; in wm8804_probe()
580 wm8804->reset = devm_gpiod_get_optional(dev, "wlf,reset", in wm8804_probe()
582 if (IS_ERR(wm8804->reset)) { in wm8804_probe()
583 ret = PTR_ERR(wm8804->reset); in wm8804_probe()
588 for (i = 0; i < ARRAY_SIZE(wm8804->supplies); i++) in wm8804_probe()
589 wm8804->supplies[i].supply = wm8804_supply_names[i]; in wm8804_probe()
591 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(wm8804->supplies), in wm8804_probe()
592 wm8804->supplies); in wm8804_probe()
598 wm8804->disable_nb[0].notifier_call = wm8804_regulator_event_0; in wm8804_probe()
599 wm8804->disable_nb[1].notifier_call = wm8804_regulator_event_1; in wm8804_probe()
602 for (i = 0; i < ARRAY_SIZE(wm8804->supplies); i++) { in wm8804_probe()
603 struct regulator *regulator = wm8804->supplies[i].consumer; in wm8804_probe()
606 &wm8804->disable_nb[i]); in wm8804_probe()
615 ret = regulator_bulk_enable(ARRAY_SIZE(wm8804->supplies), in wm8804_probe()
616 wm8804->supplies); in wm8804_probe()
622 gpiod_set_value_cansleep(wm8804->reset, 1); in wm8804_probe()
652 if (!wm8804->reset) { in wm8804_probe()
653 ret = wm8804_soft_reset(wm8804); in wm8804_probe()
674 regulator_bulk_disable(ARRAY_SIZE(wm8804->supplies), wm8804->supplies); in wm8804_probe()
688 struct wm8804_priv *wm8804 = dev_get_drvdata(dev); in wm8804_runtime_resume() local
691 ret = regulator_bulk_enable(ARRAY_SIZE(wm8804->supplies), in wm8804_runtime_resume()
692 wm8804->supplies); in wm8804_runtime_resume()
694 dev_err(wm8804->dev, "Failed to enable supplies: %d\n", ret); in wm8804_runtime_resume()
698 regcache_sync(wm8804->regmap); in wm8804_runtime_resume()
701 regmap_update_bits(wm8804->regmap, WM8804_PWRDN, 0x8, 0x0); in wm8804_runtime_resume()
708 struct wm8804_priv *wm8804 = dev_get_drvdata(dev); in wm8804_runtime_suspend() local
711 regmap_update_bits(wm8804->regmap, WM8804_PWRDN, 0x8, 0x8); in wm8804_runtime_suspend()
713 regulator_bulk_disable(ARRAY_SIZE(wm8804->supplies), in wm8804_runtime_suspend()
714 wm8804->supplies); in wm8804_runtime_suspend()