Lines Matching refs:codec

354 		dev_err(max98090->codec->dev,  in max98090_reset()
430 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in max98090_get_enab_tlv() local
431 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_get_enab_tlv()
435 unsigned int val = snd_soc_read(codec, mc->reg); in max98090_get_enab_tlv()
470 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in max98090_put_enab_tlv() local
471 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_put_enab_tlv()
476 unsigned int val = snd_soc_read(codec, mc->reg); in max98090_put_enab_tlv()
505 snd_soc_update_bits(codec, mc->reg, in max98090_put_enab_tlv()
809 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in max98090_micinput_event() local
810 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_micinput_event()
812 unsigned int val = snd_soc_read(codec, w->reg); in max98090_micinput_event()
844 snd_soc_update_bits(codec, w->reg, M98090_MIC_PA1EN_MASK, in max98090_micinput_event()
847 snd_soc_update_bits(codec, w->reg, M98090_MIC_PA2EN_MASK, in max98090_micinput_event()
1500 static int max98090_add_widgets(struct snd_soc_codec *codec) in max98090_add_widgets() argument
1502 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_add_widgets()
1503 struct snd_soc_dapm_context *dapm = &codec->dapm; in max98090_add_widgets()
1505 snd_soc_add_codec_controls(codec, max98090_snd_controls, in max98090_add_widgets()
1509 snd_soc_add_codec_controls(codec, max98091_snd_controls, in max98090_add_widgets()
1556 static void max98090_configure_bclk(struct snd_soc_codec *codec) in max98090_configure_bclk() argument
1558 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_configure_bclk()
1563 dev_err(codec->dev, "No SYSCLK configured\n"); in max98090_configure_bclk()
1568 dev_err(codec->dev, "No audio clocks configured\n"); in max98090_configure_bclk()
1573 if (!(snd_soc_read(codec, M98090_REG_MASTER_MODE) & in max98090_configure_bclk()
1582 dev_dbg(codec->dev, in max98090_configure_bclk()
1586 snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE, in max98090_configure_bclk()
1589 snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE, in max98090_configure_bclk()
1599 dev_dbg(codec->dev, in max98090_configure_bclk()
1601 dev_dbg(codec->dev, "i %d ni %lld mi %lld\n", in max98090_configure_bclk()
1604 snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE, in max98090_configure_bclk()
1606 snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE, in max98090_configure_bclk()
1610 snd_soc_write(codec, M98090_REG_CLOCK_RATIO_NI_MSB, in max98090_configure_bclk()
1612 snd_soc_write(codec, M98090_REG_CLOCK_RATIO_NI_LSB, in max98090_configure_bclk()
1614 snd_soc_write(codec, M98090_REG_CLOCK_RATIO_MI_MSB, in max98090_configure_bclk()
1616 snd_soc_write(codec, M98090_REG_CLOCK_RATIO_MI_LSB, in max98090_configure_bclk()
1626 snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE, in max98090_configure_bclk()
1628 snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE, in max98090_configure_bclk()
1639 dev_info(codec->dev, "No better method found\n"); in max98090_configure_bclk()
1640 dev_info(codec->dev, "Calculating ni %lld with mi 65536\n", ni); in max98090_configure_bclk()
1641 snd_soc_write(codec, M98090_REG_CLOCK_RATIO_NI_MSB, in max98090_configure_bclk()
1643 snd_soc_write(codec, M98090_REG_CLOCK_RATIO_NI_LSB, ni & 0xFF); in max98090_configure_bclk()
1649 struct snd_soc_codec *codec = codec_dai->codec; in max98090_dai_set_fmt() local
1650 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_dai_set_fmt()
1664 snd_soc_write(codec, in max98090_dai_set_fmt()
1666 snd_soc_write(codec, in max98090_dai_set_fmt()
1668 snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE, in max98090_dai_set_fmt()
1692 dev_err(codec->dev, "DAI clock mode unsupported"); in max98090_dai_set_fmt()
1695 snd_soc_write(codec, M98090_REG_MASTER_MODE, regval); in max98090_dai_set_fmt()
1710 dev_err(codec->dev, "DAI format unsupported"); in max98090_dai_set_fmt()
1727 dev_err(codec->dev, "DAI invert mode unsupported"); in max98090_dai_set_fmt()
1740 snd_soc_write(codec, in max98090_dai_set_fmt()
1750 struct snd_soc_codec *codec = codec_dai->codec; in max98090_set_tdm_slot() local
1751 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_set_tdm_slot()
1763 snd_soc_write(codec, M98090_REG_TDM_FORMAT, in max98090_set_tdm_slot()
1769 snd_soc_update_bits(codec, M98090_REG_TDM_CONTROL, in max98090_set_tdm_slot()
1783 static int max98090_set_bias_level(struct snd_soc_codec *codec, in max98090_set_bias_level() argument
1786 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_set_bias_level()
1802 if (codec->dapm.bias_level == SND_SOC_BIAS_ON) in max98090_set_bias_level()
1810 if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { in max98090_set_bias_level()
1813 dev_err(codec->dev, in max98090_set_bias_level()
1822 snd_soc_update_bits(codec, M98090_REG_JACK_DETECT, in max98090_set_bias_level()
1827 codec->dapm.bias_level = level; in max98090_set_bias_level()
1984 struct snd_soc_codec *codec = dai->codec; in max98090_dai_hw_params() local
1985 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_dai_hw_params()
1997 snd_soc_update_bits(codec, M98090_REG_INTERFACE_FORMAT, in max98090_dai_hw_params()
2005 max98090_configure_bclk(codec); in max98090_dai_hw_params()
2011 snd_soc_update_bits(codec, M98090_REG_FILTER_CONFIG, in max98090_dai_hw_params()
2014 snd_soc_update_bits(codec, M98090_REG_FILTER_CONFIG, in max98090_dai_hw_params()
2019 snd_soc_update_bits(codec, M98090_REG_FILTER_CONFIG, in max98090_dai_hw_params()
2022 snd_soc_update_bits(codec, M98090_REG_FILTER_CONFIG, in max98090_dai_hw_params()
2037 struct snd_soc_codec *codec = dai->codec; in max98090_dai_set_sysclk() local
2038 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_dai_set_sysclk()
2055 snd_soc_write(codec, M98090_REG_SYSTEM_CLOCK, in max98090_dai_set_sysclk()
2059 snd_soc_write(codec, M98090_REG_SYSTEM_CLOCK, in max98090_dai_set_sysclk()
2063 snd_soc_write(codec, M98090_REG_SYSTEM_CLOCK, in max98090_dai_set_sysclk()
2067 dev_err(codec->dev, "Invalid master clock frequency\n"); in max98090_dai_set_sysclk()
2078 struct snd_soc_codec *codec = codec_dai->codec; in max98090_dai_digital_mute() local
2082 snd_soc_update_bits(codec, M98090_REG_DAI_PLAYBACK_LEVEL, in max98090_dai_digital_mute()
2091 struct snd_soc_codec *codec = dai->codec; in max98090_dai_trigger() local
2092 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_dai_trigger()
2121 struct snd_soc_codec *codec = max98090->codec; in max98090_pll_det_enable_work() local
2144 snd_soc_update_bits(codec, M98090_REG_INTERRUPT_S, in max98090_pll_det_enable_work()
2153 struct snd_soc_codec *codec = max98090->codec; in max98090_pll_det_disable_work() local
2158 snd_soc_update_bits(codec, M98090_REG_INTERRUPT_S, in max98090_pll_det_disable_work()
2166 struct snd_soc_codec *codec = max98090->codec; in max98090_pll_work() local
2168 if (!snd_soc_codec_is_active(codec)) in max98090_pll_work()
2171 dev_info(codec->dev, "PLL unlocked\n"); in max98090_pll_work()
2174 snd_soc_update_bits(codec, M98090_REG_DEVICE_SHUTDOWN, in max98090_pll_work()
2177 snd_soc_update_bits(codec, M98090_REG_DEVICE_SHUTDOWN, in max98090_pll_work()
2189 struct snd_soc_codec *codec = max98090->codec; in max98090_jack_work() local
2190 struct snd_soc_dapm_context *dapm = &codec->dapm; in max98090_jack_work()
2198 snd_soc_update_bits(codec, M98090_REG_JACK_DETECT, in max98090_jack_work()
2203 reg = snd_soc_read(codec, M98090_REG_JACK_STATUS); in max98090_jack_work()
2206 snd_soc_update_bits(codec, M98090_REG_JACK_DETECT, in max98090_jack_work()
2209 reg = snd_soc_read(codec, M98090_REG_JACK_STATUS); in max98090_jack_work()
2212 reg = snd_soc_read(codec, M98090_REG_JACK_STATUS); in max98090_jack_work()
2216 dev_dbg(codec->dev, "No Headset Detected\n"); in max98090_jack_work()
2228 dev_dbg(codec->dev, in max98090_jack_work()
2245 dev_dbg(codec->dev, "Headphone Detected\n"); in max98090_jack_work()
2254 dev_dbg(codec->dev, "Headset Detected\n"); in max98090_jack_work()
2263 dev_dbg(codec->dev, "Unrecognized Jack Status\n"); in max98090_jack_work()
2276 struct snd_soc_codec *codec = max98090->codec; in max98090_interrupt() local
2282 if (codec == NULL) in max98090_interrupt()
2285 dev_dbg(codec->dev, "***** max98090_interrupt *****\n"); in max98090_interrupt()
2290 dev_err(codec->dev, in max98090_interrupt()
2299 dev_err(codec->dev, in max98090_interrupt()
2305 dev_dbg(codec->dev, "active=0x%02x mask=0x%02x -> active=0x%02x\n", in max98090_interrupt()
2314 dev_err(codec->dev, "M98090_CLD_MASK\n"); in max98090_interrupt()
2317 dev_dbg(codec->dev, "M98090_SLD_MASK\n"); in max98090_interrupt()
2320 dev_dbg(codec->dev, "M98090_ULK_MASK\n"); in max98090_interrupt()
2325 dev_dbg(codec->dev, "M98090_JDET_MASK\n"); in max98090_interrupt()
2327 pm_wakeup_event(codec->dev, 100); in max98090_interrupt()
2335 dev_dbg(codec->dev, "M98090_DRCACT_MASK\n"); in max98090_interrupt()
2338 dev_err(codec->dev, "M98090_DRCCLP_MASK\n"); in max98090_interrupt()
2356 int max98090_mic_detect(struct snd_soc_codec *codec, in max98090_mic_detect() argument
2359 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_mic_detect()
2361 dev_dbg(codec->dev, "max98090_mic_detect\n"); in max98090_mic_detect()
2365 snd_soc_update_bits(codec, M98090_REG_INTERRUPT_S, in max98090_mic_detect()
2369 snd_soc_update_bits(codec, M98090_REG_INTERRUPT_S, in max98090_mic_detect()
2419 static int max98090_probe(struct snd_soc_codec *codec) in max98090_probe() argument
2421 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_probe()
2426 dev_dbg(codec->dev, "max98090_probe\n"); in max98090_probe()
2428 max98090->mclk = devm_clk_get(codec->dev, "mclk"); in max98090_probe()
2432 max98090->codec = codec; in max98090_probe()
2451 ret = snd_soc_read(codec, M98090_REG_REVISION_ID); in max98090_probe()
2453 dev_err(codec->dev, "Failed to read device revision: %d\n", in max98090_probe()
2460 dev_info(codec->dev, "MAX98090 REVID=0x%02x\n", ret); in max98090_probe()
2463 dev_info(codec->dev, "MAX98091 REVID=0x%02x\n", ret); in max98090_probe()
2466 dev_err(codec->dev, "Unrecognized revision 0x%02x\n", ret); in max98090_probe()
2470 dev_warn(codec->dev, "Mismatch in DT specified CODEC type.\n"); in max98090_probe()
2484 snd_soc_write(codec, M98090_REG_JACK_DETECT, in max98090_probe()
2492 snd_soc_read(codec, M98090_REG_DEVICE_STATUS); in max98090_probe()
2495 snd_soc_update_bits(codec, M98090_REG_DAC_CONTROL, in max98090_probe()
2498 snd_soc_update_bits(codec, M98090_REG_DAC_CONTROL, in max98090_probe()
2501 snd_soc_update_bits(codec, M98090_REG_ADC_CONTROL, in max98090_probe()
2506 snd_soc_write(codec, M98090_REG_BIAS_CONTROL, in max98090_probe()
2509 snd_soc_update_bits(codec, M98090_REG_MIC_BIAS_VOLTAGE, in max98090_probe()
2512 max98090_add_widgets(codec); in max98090_probe()
2518 static int max98090_remove(struct snd_soc_codec *codec) in max98090_remove() argument
2520 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_remove()
2526 max98090->codec = NULL; in max98090_remove()