Lines Matching refs:codec

388 	struct snd_soc_codec *codec;  member
488 static void wm8995_update_class_w(struct snd_soc_codec *codec) in wm8995_update_class_w() argument
495 reg = snd_soc_read(codec, WM8995_DAC1_LEFT_MIXER_ROUTING); in wm8995_update_class_w()
498 dev_dbg(codec->dev, "Class W source AIF2DAC\n"); in wm8995_update_class_w()
502 dev_dbg(codec->dev, "Class W source AIF1DAC2\n"); in wm8995_update_class_w()
506 dev_dbg(codec->dev, "Class W source AIF1DAC1\n"); in wm8995_update_class_w()
510 dev_dbg(codec->dev, "DAC mixer setting: %x\n", reg); in wm8995_update_class_w()
515 reg_r = snd_soc_read(codec, WM8995_DAC1_RIGHT_MIXER_ROUTING); in wm8995_update_class_w()
517 dev_dbg(codec->dev, "Left and right DAC mixers different\n"); in wm8995_update_class_w()
522 dev_dbg(codec->dev, "Class W enabled\n"); in wm8995_update_class_w()
523 snd_soc_update_bits(codec, WM8995_CLASS_W_1, in wm8995_update_class_w()
528 dev_dbg(codec->dev, "Class W disabled\n"); in wm8995_update_class_w()
529 snd_soc_update_bits(codec, WM8995_CLASS_W_1, in wm8995_update_class_w()
537 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm); in check_clk_sys() local
541 reg = snd_soc_read(codec, WM8995_CLOCKING_1); in check_clk_sys()
553 struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol); in wm8995_put_class_w() local
557 wm8995_update_class_w(codec); in wm8995_put_class_w()
564 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in hp_supply_event() local
569 snd_soc_update_bits(codec, WM8995_POWER_MANAGEMENT_1, in hp_supply_event()
576 snd_soc_update_bits(codec, WM8995_ANALOGUE_HP_1, in hp_supply_event()
583 snd_soc_update_bits(codec, WM8995_CHARGE_PUMP_1, in hp_supply_event()
591 static void dc_servo_cmd(struct snd_soc_codec *codec, in dc_servo_cmd() argument
596 dev_dbg(codec->dev, "%s: reg = %#x, val = %#x, mask = %#x\n", in dc_servo_cmd()
599 snd_soc_write(codec, reg, val); in dc_servo_cmd()
602 val = snd_soc_read(codec, WM8995_DC_SERVO_READBACK_0); in dc_servo_cmd()
607 dev_err(codec->dev, "Timed out waiting for DC Servo\n"); in dc_servo_cmd()
613 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in hp_event() local
616 reg = snd_soc_read(codec, WM8995_ANALOGUE_HP_1); in hp_event()
620 snd_soc_update_bits(codec, WM8995_CHARGE_PUMP_1, in hp_event()
625 snd_soc_update_bits(codec, WM8995_POWER_MANAGEMENT_1, in hp_event()
633 snd_soc_write(codec, WM8995_ANALOGUE_HP_1, reg); in hp_event()
635 snd_soc_write(codec, WM8995_DC_SERVO_1, WM8995_DCS_ENA_CHAN_0 | in hp_event()
638 dc_servo_cmd(codec, WM8995_DC_SERVO_2, in hp_event()
646 snd_soc_write(codec, WM8995_ANALOGUE_HP_1, reg); in hp_event()
650 snd_soc_update_bits(codec, WM8995_ANALOGUE_HP_1, in hp_event()
656 snd_soc_update_bits(codec, WM8995_ANALOGUE_HP_1, in hp_event()
660 snd_soc_write(codec, WM8995_DC_SERVO_1, 0); in hp_event()
662 snd_soc_update_bits(codec, WM8995_POWER_MANAGEMENT_1, in hp_event()
672 static int configure_aif_clock(struct snd_soc_codec *codec, int aif) in configure_aif_clock() argument
679 wm8995 = snd_soc_codec_get_drvdata(codec); in configure_aif_clock()
710 dev_dbg(codec->dev, "Dividing AIF%d clock to %dHz\n", in configure_aif_clock()
716 snd_soc_update_bits(codec, WM8995_AIF1_CLOCKING_1 + offset, in configure_aif_clock()
722 static int configure_clock(struct snd_soc_codec *codec) in configure_clock() argument
727 wm8995 = snd_soc_codec_get_drvdata(codec); in configure_clock()
730 configure_aif_clock(codec, 0); in configure_clock()
731 configure_aif_clock(codec, 1); in configure_clock()
749 change = snd_soc_update_bits(codec, WM8995_CLOCKING_1, in configure_clock()
754 snd_soc_dapm_sync(&codec->dapm); in configure_clock()
762 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in clk_sys_event() local
766 return configure_clock(codec); in clk_sys_event()
769 configure_clock(codec); in clk_sys_event()
1424 struct snd_soc_codec *codec = dai->codec; in wm8995_aif_mute() local
1438 snd_soc_update_bits(codec, mute_reg, WM8995_AIF1DAC1_MUTE_MASK, in wm8995_aif_mute()
1445 struct snd_soc_codec *codec; in wm8995_set_dai_fmt() local
1449 codec = dai->codec; in wm8995_set_dai_fmt()
1521 snd_soc_update_bits(codec, WM8995_AIF1_CONTROL_1, in wm8995_set_dai_fmt()
1525 snd_soc_update_bits(codec, WM8995_AIF1_MASTER_SLAVE, in wm8995_set_dai_fmt()
1548 struct snd_soc_codec *codec; in wm8995_hw_params() local
1559 codec = dai->codec; in wm8995_hw_params()
1560 wm8995 = snd_soc_codec_get_drvdata(codec); in wm8995_hw_params()
1572 dev_dbg(codec->dev, "AIF1 using split LRCLK\n"); in wm8995_hw_params()
1584 dev_dbg(codec->dev, "AIF2 using split LRCLK\n"); in wm8995_hw_params()
1670 snd_soc_update_bits(codec, aif1_reg, in wm8995_hw_params()
1672 snd_soc_update_bits(codec, bclk_reg, in wm8995_hw_params()
1674 snd_soc_update_bits(codec, lrclk_reg, in wm8995_hw_params()
1676 snd_soc_update_bits(codec, rate_reg, in wm8995_hw_params()
1684 struct snd_soc_codec *codec = codec_dai->codec; in wm8995_set_tristate() local
1709 return snd_soc_update_bits(codec, reg, mask, val); in wm8995_set_tristate()
1799 struct snd_soc_codec *codec; in wm8995_set_fll() local
1805 codec = dai->codec; in wm8995_set_fll()
1806 wm8995 = snd_soc_codec_get_drvdata(codec); in wm8995_set_fll()
1808 aif1 = snd_soc_read(codec, WM8995_AIF1_CLOCKING_1) in wm8995_set_fll()
1811 aif2 = snd_soc_read(codec, WM8995_AIF2_CLOCKING_1) in wm8995_set_fll()
1860 snd_soc_update_bits(codec, WM8995_AIF1_CLOCKING_1, in wm8995_set_fll()
1862 snd_soc_update_bits(codec, WM8995_AIF2_CLOCKING_1, in wm8995_set_fll()
1866 snd_soc_update_bits(codec, WM8995_FLL1_CONTROL_1 + reg_offset, in wm8995_set_fll()
1871 snd_soc_update_bits(codec, WM8995_FLL1_CONTROL_2 + reg_offset, in wm8995_set_fll()
1875 snd_soc_write(codec, WM8995_FLL1_CONTROL_3 + reg_offset, fll.k); in wm8995_set_fll()
1877 snd_soc_update_bits(codec, WM8995_FLL1_CONTROL_4 + reg_offset, in wm8995_set_fll()
1881 snd_soc_update_bits(codec, WM8995_FLL1_CONTROL_5 + reg_offset, in wm8995_set_fll()
1888 snd_soc_update_bits(codec, WM8995_FLL1_CONTROL_1 + reg_offset, in wm8995_set_fll()
1896 snd_soc_update_bits(codec, WM8995_AIF1_CLOCKING_1, in wm8995_set_fll()
1898 snd_soc_update_bits(codec, WM8995_AIF2_CLOCKING_1, in wm8995_set_fll()
1901 configure_clock(codec); in wm8995_set_fll()
1909 struct snd_soc_codec *codec; in wm8995_set_dai_sysclk() local
1912 codec = dai->codec; in wm8995_set_dai_sysclk()
1913 wm8995 = snd_soc_codec_get_drvdata(codec); in wm8995_set_dai_sysclk()
1951 configure_clock(codec); in wm8995_set_dai_sysclk()
1956 static int wm8995_set_bias_level(struct snd_soc_codec *codec, in wm8995_set_bias_level() argument
1962 wm8995 = snd_soc_codec_get_drvdata(codec); in wm8995_set_bias_level()
1968 if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { in wm8995_set_bias_level()
1976 dev_err(codec->dev, in wm8995_set_bias_level()
1981 snd_soc_update_bits(codec, WM8995_POWER_MANAGEMENT_1, in wm8995_set_bias_level()
1986 snd_soc_update_bits(codec, WM8995_POWER_MANAGEMENT_1, in wm8995_set_bias_level()
1993 codec->dapm.bias_level = level; in wm8995_set_bias_level()
1997 static int wm8995_remove(struct snd_soc_codec *codec) in wm8995_remove() argument
2002 wm8995 = snd_soc_codec_get_drvdata(codec); in wm8995_remove()
2012 static int wm8995_probe(struct snd_soc_codec *codec) in wm8995_probe() argument
2018 wm8995 = snd_soc_codec_get_drvdata(codec); in wm8995_probe()
2019 wm8995->codec = codec; in wm8995_probe()
2024 ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(wm8995->supplies), in wm8995_probe()
2027 dev_err(codec->dev, "Failed to request supplies: %d\n", ret); in wm8995_probe()
2045 dev_err(codec->dev, in wm8995_probe()
2054 dev_err(codec->dev, "Failed to enable supplies: %d\n", ret); in wm8995_probe()
2058 ret = snd_soc_read(codec, WM8995_SOFTWARE_RESET); in wm8995_probe()
2060 dev_err(codec->dev, "Failed to read device ID: %d\n", ret); in wm8995_probe()
2065 dev_err(codec->dev, "Invalid device ID: %#x\n", ret); in wm8995_probe()
2070 ret = snd_soc_write(codec, WM8995_SOFTWARE_RESET, 0); in wm8995_probe()
2072 dev_err(codec->dev, "Failed to issue reset: %d\n", ret); in wm8995_probe()
2077 snd_soc_update_bits(codec, WM8995_AIF1_DAC1_RIGHT_VOLUME, in wm8995_probe()
2079 snd_soc_update_bits(codec, WM8995_AIF1_DAC2_RIGHT_VOLUME, in wm8995_probe()
2081 snd_soc_update_bits(codec, WM8995_AIF2_DAC_RIGHT_VOLUME, in wm8995_probe()
2083 snd_soc_update_bits(codec, WM8995_AIF1_ADC1_RIGHT_VOLUME, in wm8995_probe()
2085 snd_soc_update_bits(codec, WM8995_AIF1_ADC2_RIGHT_VOLUME, in wm8995_probe()
2087 snd_soc_update_bits(codec, WM8995_AIF2_ADC_RIGHT_VOLUME, in wm8995_probe()
2089 snd_soc_update_bits(codec, WM8995_DAC1_RIGHT_VOLUME, in wm8995_probe()
2091 snd_soc_update_bits(codec, WM8995_DAC2_RIGHT_VOLUME, in wm8995_probe()
2093 snd_soc_update_bits(codec, WM8995_RIGHT_LINE_INPUT_1_VOLUME, in wm8995_probe()
2096 wm8995_update_class_w(codec); in wm8995_probe()