Lines Matching refs:wm8804

89 	struct wm8804_priv *wm8804 = container_of(nb, struct wm8804_priv, \
92 regcache_mark_dirty(wm8804->regmap); \
141 struct wm8804_priv *wm8804 = snd_soc_codec_get_drvdata(codec); in wm8804_aif_event() local
146 if (!wm8804->aif_pwr) in wm8804_aif_event()
148 wm8804->aif_pwr++; in wm8804_aif_event()
152 wm8804->aif_pwr--; in wm8804_aif_event()
153 if (!wm8804->aif_pwr) in wm8804_aif_event()
214 static int wm8804_soft_reset(struct wm8804_priv *wm8804) in wm8804_soft_reset() argument
216 return regmap_write(wm8804->regmap, WM8804_RST_DEVID1, 0x0); in wm8804_soft_reset()
409 struct wm8804_priv *wm8804 = snd_soc_codec_get_drvdata(codec); in wm8804_set_pll() local
414 regmap_update_bits_check(wm8804->regmap, WM8804_PWRDN, in wm8804_set_pll()
417 pm_runtime_put(wm8804->dev); in wm8804_set_pll()
423 wm8804->mclk_div); in wm8804_set_pll()
428 regmap_update_bits_check(wm8804->regmap, WM8804_PWRDN, in wm8804_set_pll()
431 pm_runtime_get_sync(wm8804->dev); in wm8804_set_pll()
490 struct wm8804_priv *wm8804; in wm8804_set_clkdiv() local
499 wm8804 = snd_soc_codec_get_drvdata(codec); in wm8804_set_clkdiv()
500 wm8804->mclk_div = div; in wm8804_set_clkdiv()
569 struct wm8804_priv *wm8804; in wm8804_probe() local
573 wm8804 = devm_kzalloc(dev, sizeof(*wm8804), GFP_KERNEL); in wm8804_probe()
574 if (!wm8804) in wm8804_probe()
577 dev_set_drvdata(dev, wm8804); in wm8804_probe()
579 wm8804->dev = dev; in wm8804_probe()
580 wm8804->regmap = regmap; in wm8804_probe()
582 wm8804->reset = devm_gpiod_get_optional(dev, "wlf,reset", in wm8804_probe()
584 if (IS_ERR(wm8804->reset)) { in wm8804_probe()
585 ret = PTR_ERR(wm8804->reset); in wm8804_probe()
590 for (i = 0; i < ARRAY_SIZE(wm8804->supplies); i++) in wm8804_probe()
591 wm8804->supplies[i].supply = wm8804_supply_names[i]; in wm8804_probe()
593 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(wm8804->supplies), in wm8804_probe()
594 wm8804->supplies); in wm8804_probe()
600 wm8804->disable_nb[0].notifier_call = wm8804_regulator_event_0; in wm8804_probe()
601 wm8804->disable_nb[1].notifier_call = wm8804_regulator_event_1; in wm8804_probe()
604 for (i = 0; i < ARRAY_SIZE(wm8804->supplies); i++) { in wm8804_probe()
605 struct regulator *regulator = wm8804->supplies[i].consumer; in wm8804_probe()
608 &wm8804->disable_nb[i]); in wm8804_probe()
617 ret = regulator_bulk_enable(ARRAY_SIZE(wm8804->supplies), in wm8804_probe()
618 wm8804->supplies); in wm8804_probe()
624 if (wm8804->reset) in wm8804_probe()
625 gpiod_set_value_cansleep(wm8804->reset, 1); in wm8804_probe()
655 if (!wm8804->reset) { in wm8804_probe()
656 ret = wm8804_soft_reset(wm8804); in wm8804_probe()
677 regulator_bulk_disable(ARRAY_SIZE(wm8804->supplies), wm8804->supplies); in wm8804_probe()
692 struct wm8804_priv *wm8804 = dev_get_drvdata(dev); in wm8804_runtime_resume() local
695 ret = regulator_bulk_enable(ARRAY_SIZE(wm8804->supplies), in wm8804_runtime_resume()
696 wm8804->supplies); in wm8804_runtime_resume()
698 dev_err(wm8804->dev, "Failed to enable supplies: %d\n", ret); in wm8804_runtime_resume()
702 regcache_sync(wm8804->regmap); in wm8804_runtime_resume()
705 regmap_update_bits(wm8804->regmap, WM8804_PWRDN, 0x8, 0x0); in wm8804_runtime_resume()
712 struct wm8804_priv *wm8804 = dev_get_drvdata(dev); in wm8804_runtime_suspend() local
715 regmap_update_bits(wm8804->regmap, WM8804_PWRDN, 0x8, 0x8); in wm8804_runtime_suspend()
717 regulator_bulk_disable(ARRAY_SIZE(wm8804->supplies), in wm8804_runtime_suspend()
718 wm8804->supplies); in wm8804_runtime_suspend()