Lines Matching refs:codec

342 	struct snd_soc_codec *codec = codec_dai->codec;  in wm8940_set_dai_fmt()  local
343 u16 iface = snd_soc_read(codec, WM8940_IFACE) & 0xFE67; in wm8940_set_dai_fmt()
344 u16 clk = snd_soc_read(codec, WM8940_CLOCK) & 0x1fe; in wm8940_set_dai_fmt()
355 snd_soc_write(codec, WM8940_CLOCK, clk); in wm8940_set_dai_fmt()
388 snd_soc_write(codec, WM8940_IFACE, iface); in wm8940_set_dai_fmt()
397 struct snd_soc_codec *codec = dai->codec; in wm8940_i2s_hw_params() local
398 u16 iface = snd_soc_read(codec, WM8940_IFACE) & 0xFD9F; in wm8940_i2s_hw_params()
399 u16 addcntrl = snd_soc_read(codec, WM8940_ADDCNTRL) & 0xFFF1; in wm8940_i2s_hw_params()
400 u16 companding = snd_soc_read(codec, in wm8940_i2s_hw_params()
429 ret = snd_soc_write(codec, WM8940_ADDCNTRL, addcntrl); in wm8940_i2s_hw_params()
449 ret = snd_soc_write(codec, WM8940_COMPANDINGCTL, companding); in wm8940_i2s_hw_params()
452 ret = snd_soc_write(codec, WM8940_IFACE, iface); in wm8940_i2s_hw_params()
460 struct snd_soc_codec *codec = dai->codec; in wm8940_mute() local
461 u16 mute_reg = snd_soc_read(codec, WM8940_DAC) & 0xffbf; in wm8940_mute()
466 return snd_soc_write(codec, WM8940_DAC, mute_reg); in wm8940_mute()
469 static int wm8940_set_bias_level(struct snd_soc_codec *codec, in wm8940_set_bias_level() argument
472 struct wm8940_priv *wm8940 = snd_soc_codec_get_drvdata(codec); in wm8940_set_bias_level()
474 u16 pwr_reg = snd_soc_read(codec, WM8940_POWER1) & 0x1F0; in wm8940_set_bias_level()
482 val = snd_soc_read(codec, WM8940_OUTPUTCTL); in wm8940_set_bias_level()
483 ret = snd_soc_write(codec, WM8940_OUTPUTCTL, val | 0x2); in wm8940_set_bias_level()
487 ret = snd_soc_write(codec, WM8940_POWER1, pwr_reg | 0x1); in wm8940_set_bias_level()
492 ret = snd_soc_write(codec, WM8940_POWER1, pwr_reg | 0x1); in wm8940_set_bias_level()
495 if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF) { in wm8940_set_bias_level()
498 dev_err(codec->dev, "Failed to sync cache: %d\n", ret); in wm8940_set_bias_level()
506 ret = snd_soc_write(codec, WM8940_POWER1, pwr_reg | 0x2); in wm8940_set_bias_level()
509 ret = snd_soc_write(codec, WM8940_POWER1, pwr_reg); in wm8940_set_bias_level()
579 struct snd_soc_codec *codec = codec_dai->codec; in wm8940_set_dai_pll() local
583 reg = snd_soc_read(codec, WM8940_POWER1); in wm8940_set_dai_pll()
584 snd_soc_write(codec, WM8940_POWER1, reg & 0x1df); in wm8940_set_dai_pll()
588 reg = snd_soc_read(codec, WM8940_CLOCK); in wm8940_set_dai_pll()
589 snd_soc_write(codec, WM8940_CLOCK, reg & 0x0ff); in wm8940_set_dai_pll()
591 snd_soc_write(codec, WM8940_PLLN, (1 << 7)); in wm8940_set_dai_pll()
598 snd_soc_write(codec, WM8940_PLLN, in wm8940_set_dai_pll()
601 snd_soc_write(codec, WM8940_PLLN, in wm8940_set_dai_pll()
603 snd_soc_write(codec, WM8940_PLLK1, pll_div.k >> 18); in wm8940_set_dai_pll()
604 snd_soc_write(codec, WM8940_PLLK2, (pll_div.k >> 9) & 0x1ff); in wm8940_set_dai_pll()
605 snd_soc_write(codec, WM8940_PLLK3, pll_div.k & 0x1ff); in wm8940_set_dai_pll()
607 reg = snd_soc_read(codec, WM8940_POWER1); in wm8940_set_dai_pll()
608 snd_soc_write(codec, WM8940_POWER1, reg | 0x020); in wm8940_set_dai_pll()
611 reg = snd_soc_read(codec, WM8940_CLOCK); in wm8940_set_dai_pll()
612 snd_soc_write(codec, WM8940_CLOCK, reg | 0x100); in wm8940_set_dai_pll()
620 struct snd_soc_codec *codec = codec_dai->codec; in wm8940_set_dai_sysclk() local
621 struct wm8940_priv *wm8940 = snd_soc_codec_get_drvdata(codec); in wm8940_set_dai_sysclk()
638 struct snd_soc_codec *codec = codec_dai->codec; in wm8940_set_dai_clkdiv() local
644 reg = snd_soc_read(codec, WM8940_CLOCK) & 0xFFE3; in wm8940_set_dai_clkdiv()
645 ret = snd_soc_write(codec, WM8940_CLOCK, reg | (div << 2)); in wm8940_set_dai_clkdiv()
648 reg = snd_soc_read(codec, WM8940_CLOCK) & 0xFF1F; in wm8940_set_dai_clkdiv()
649 ret = snd_soc_write(codec, WM8940_CLOCK, reg | (div << 5)); in wm8940_set_dai_clkdiv()
652 reg = snd_soc_read(codec, WM8940_GPIO) & 0xFFCF; in wm8940_set_dai_clkdiv()
653 ret = snd_soc_write(codec, WM8940_GPIO, reg | (div << 4)); in wm8940_set_dai_clkdiv()
696 static int wm8940_probe(struct snd_soc_codec *codec) in wm8940_probe() argument
698 struct wm8940_setup_data *pdata = codec->dev->platform_data; in wm8940_probe()
702 ret = wm8940_reset(codec); in wm8940_probe()
704 dev_err(codec->dev, "Failed to issue reset\n"); in wm8940_probe()
708 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); in wm8940_probe()
710 ret = snd_soc_write(codec, WM8940_POWER1, 0x180); in wm8940_probe()
715 dev_warn(codec->dev, "No platform data supplied\n"); in wm8940_probe()
717 reg = snd_soc_read(codec, WM8940_OUTPUTCTL); in wm8940_probe()
718 ret = snd_soc_write(codec, WM8940_OUTPUTCTL, reg | pdata->vroi); in wm8940_probe()