static int ad1980_reset(struct snd_soc_component *component, int try_warm) { struct snd_ac97 *ac97 = snd_soc_component_get_drvdata(component); unsigned int retry_cnt = 0; int ret; do { ret = snd_ac97_reset(ac97, true, AD1980_VENDOR_ID, AD1980_VENDOR_MASK); if (ret >= 0) return 0; /* * Set bit 16slot in register 74h, then every slot will has only * 16 bits. This command is sent out in 20bit mode, in which * case the first nibble of data is eaten by the addr. (Tag is * always 16 bit) */ snd_soc_component_write(component, AC97_AD_SERIAL_CFG, 0x9900); } while (retry_cnt++ < 10); dev_err(component->dev, "Failed to reset: AC97 link error\n"); return -EIO; }
static int wm9712_soc_resume(struct snd_soc_codec *codec) { struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec); int ret; ret = snd_ac97_reset(wm9712->ac97, true, WM9712_VENDOR_ID, WM9712_VENDOR_ID_MASK); if (ret < 0) return ret; snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); if (ret == 0) regcache_sync(codec->component.regmap); return ret; }