Lines Matching refs:codec

287 		dev_err(max98090->codec->dev,  in max98090_reset()
357 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in max98090_get_enab_tlv() local
358 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_get_enab_tlv()
362 unsigned int val = snd_soc_read(codec, mc->reg); in max98090_get_enab_tlv()
397 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in max98090_put_enab_tlv() local
398 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_put_enab_tlv()
403 unsigned int val = snd_soc_read(codec, mc->reg); in max98090_put_enab_tlv()
432 snd_soc_update_bits(codec, mc->reg, in max98090_put_enab_tlv()
736 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in max98090_micinput_event() local
737 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_micinput_event()
739 unsigned int val = snd_soc_read(codec, w->reg); in max98090_micinput_event()
771 snd_soc_update_bits(codec, w->reg, M98090_MIC_PA1EN_MASK, in max98090_micinput_event()
774 snd_soc_update_bits(codec, w->reg, M98090_MIC_PA2EN_MASK, in max98090_micinput_event()
783 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in max98090_shdn_event() local
784 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_shdn_event()
1444 static int max98090_add_widgets(struct snd_soc_codec *codec) in max98090_add_widgets() argument
1446 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_add_widgets()
1447 struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); in max98090_add_widgets()
1449 snd_soc_add_codec_controls(codec, max98090_snd_controls, in max98090_add_widgets()
1453 snd_soc_add_codec_controls(codec, max98091_snd_controls, in max98090_add_widgets()
1500 static void max98090_configure_bclk(struct snd_soc_codec *codec) in max98090_configure_bclk() argument
1502 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_configure_bclk()
1507 dev_err(codec->dev, "No SYSCLK configured\n"); in max98090_configure_bclk()
1512 dev_err(codec->dev, "No audio clocks configured\n"); in max98090_configure_bclk()
1517 if (!(snd_soc_read(codec, M98090_REG_MASTER_MODE) & in max98090_configure_bclk()
1526 dev_dbg(codec->dev, in max98090_configure_bclk()
1530 snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE, in max98090_configure_bclk()
1533 snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE, in max98090_configure_bclk()
1543 dev_dbg(codec->dev, in max98090_configure_bclk()
1545 dev_dbg(codec->dev, "i %d ni %lld mi %lld\n", in max98090_configure_bclk()
1548 snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE, in max98090_configure_bclk()
1550 snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE, in max98090_configure_bclk()
1554 snd_soc_write(codec, M98090_REG_CLOCK_RATIO_NI_MSB, in max98090_configure_bclk()
1556 snd_soc_write(codec, M98090_REG_CLOCK_RATIO_NI_LSB, in max98090_configure_bclk()
1558 snd_soc_write(codec, M98090_REG_CLOCK_RATIO_MI_MSB, in max98090_configure_bclk()
1560 snd_soc_write(codec, M98090_REG_CLOCK_RATIO_MI_LSB, in max98090_configure_bclk()
1570 snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE, in max98090_configure_bclk()
1572 snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE, in max98090_configure_bclk()
1583 dev_info(codec->dev, "No better method found\n"); in max98090_configure_bclk()
1584 dev_info(codec->dev, "Calculating ni %lld with mi 65536\n", ni); in max98090_configure_bclk()
1585 snd_soc_write(codec, M98090_REG_CLOCK_RATIO_NI_MSB, in max98090_configure_bclk()
1587 snd_soc_write(codec, M98090_REG_CLOCK_RATIO_NI_LSB, ni & 0xFF); in max98090_configure_bclk()
1593 struct snd_soc_codec *codec = codec_dai->codec; in max98090_dai_set_fmt() local
1594 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_dai_set_fmt()
1608 snd_soc_write(codec, in max98090_dai_set_fmt()
1610 snd_soc_write(codec, in max98090_dai_set_fmt()
1612 snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE, in max98090_dai_set_fmt()
1636 dev_err(codec->dev, "DAI clock mode unsupported"); in max98090_dai_set_fmt()
1639 snd_soc_write(codec, M98090_REG_MASTER_MODE, regval); in max98090_dai_set_fmt()
1654 dev_err(codec->dev, "DAI format unsupported"); in max98090_dai_set_fmt()
1671 dev_err(codec->dev, "DAI invert mode unsupported"); in max98090_dai_set_fmt()
1684 snd_soc_write(codec, in max98090_dai_set_fmt()
1694 struct snd_soc_codec *codec = codec_dai->codec; in max98090_set_tdm_slot() local
1695 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_set_tdm_slot()
1707 snd_soc_write(codec, M98090_REG_TDM_FORMAT, in max98090_set_tdm_slot()
1713 snd_soc_update_bits(codec, M98090_REG_TDM_CONTROL, in max98090_set_tdm_slot()
1727 static int max98090_set_bias_level(struct snd_soc_codec *codec, in max98090_set_bias_level() argument
1730 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_set_bias_level()
1748 if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_ON) { in max98090_set_bias_level()
1758 if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF) { in max98090_set_bias_level()
1761 dev_err(codec->dev, in max98090_set_bias_level()
1770 snd_soc_update_bits(codec, M98090_REG_JACK_DETECT, in max98090_set_bias_level()
1931 struct snd_soc_codec *codec = dai->codec; in max98090_dai_hw_params() local
1932 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_dai_hw_params()
1944 snd_soc_update_bits(codec, M98090_REG_INTERFACE_FORMAT, in max98090_dai_hw_params()
1952 max98090_configure_bclk(codec); in max98090_dai_hw_params()
1958 snd_soc_update_bits(codec, M98090_REG_FILTER_CONFIG, in max98090_dai_hw_params()
1961 snd_soc_update_bits(codec, M98090_REG_FILTER_CONFIG, in max98090_dai_hw_params()
1966 snd_soc_update_bits(codec, M98090_REG_FILTER_CONFIG, in max98090_dai_hw_params()
1969 snd_soc_update_bits(codec, M98090_REG_FILTER_CONFIG, in max98090_dai_hw_params()
1984 struct snd_soc_codec *codec = dai->codec; in max98090_dai_set_sysclk() local
1985 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_dai_set_sysclk()
2002 snd_soc_write(codec, M98090_REG_SYSTEM_CLOCK, in max98090_dai_set_sysclk()
2006 snd_soc_write(codec, M98090_REG_SYSTEM_CLOCK, in max98090_dai_set_sysclk()
2010 snd_soc_write(codec, M98090_REG_SYSTEM_CLOCK, in max98090_dai_set_sysclk()
2014 dev_err(codec->dev, "Invalid master clock frequency\n"); in max98090_dai_set_sysclk()
2025 struct snd_soc_codec *codec = codec_dai->codec; in max98090_dai_digital_mute() local
2029 snd_soc_update_bits(codec, M98090_REG_DAI_PLAYBACK_LEVEL, in max98090_dai_digital_mute()
2038 struct snd_soc_codec *codec = dai->codec; in max98090_dai_trigger() local
2039 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_dai_trigger()
2068 struct snd_soc_codec *codec = max98090->codec; in max98090_pll_det_enable_work() local
2091 snd_soc_update_bits(codec, M98090_REG_INTERRUPT_S, in max98090_pll_det_enable_work()
2100 struct snd_soc_codec *codec = max98090->codec; in max98090_pll_det_disable_work() local
2105 snd_soc_update_bits(codec, M98090_REG_INTERRUPT_S, in max98090_pll_det_disable_work()
2113 struct snd_soc_codec *codec = max98090->codec; in max98090_pll_work() local
2115 if (!snd_soc_codec_is_active(codec)) in max98090_pll_work()
2118 dev_info(codec->dev, "PLL unlocked\n"); in max98090_pll_work()
2121 snd_soc_update_bits(codec, M98090_REG_DEVICE_SHUTDOWN, in max98090_pll_work()
2124 snd_soc_update_bits(codec, M98090_REG_DEVICE_SHUTDOWN, in max98090_pll_work()
2136 struct snd_soc_codec *codec = max98090->codec; in max98090_jack_work() local
2144 snd_soc_update_bits(codec, M98090_REG_JACK_DETECT, in max98090_jack_work()
2149 reg = snd_soc_read(codec, M98090_REG_JACK_STATUS); in max98090_jack_work()
2152 snd_soc_update_bits(codec, M98090_REG_JACK_DETECT, in max98090_jack_work()
2155 reg = snd_soc_read(codec, M98090_REG_JACK_STATUS); in max98090_jack_work()
2158 reg = snd_soc_read(codec, M98090_REG_JACK_STATUS); in max98090_jack_work()
2162 dev_dbg(codec->dev, "No Headset Detected\n"); in max98090_jack_work()
2174 dev_dbg(codec->dev, in max98090_jack_work()
2191 dev_dbg(codec->dev, "Headphone Detected\n"); in max98090_jack_work()
2200 dev_dbg(codec->dev, "Headset Detected\n"); in max98090_jack_work()
2209 dev_dbg(codec->dev, "Unrecognized Jack Status\n"); in max98090_jack_work()
2220 struct snd_soc_codec *codec = max98090->codec; in max98090_interrupt() local
2226 if (codec == NULL) in max98090_interrupt()
2229 dev_dbg(codec->dev, "***** max98090_interrupt *****\n"); in max98090_interrupt()
2234 dev_err(codec->dev, in max98090_interrupt()
2243 dev_err(codec->dev, in max98090_interrupt()
2249 dev_dbg(codec->dev, "active=0x%02x mask=0x%02x -> active=0x%02x\n", in max98090_interrupt()
2258 dev_err(codec->dev, "M98090_CLD_MASK\n"); in max98090_interrupt()
2261 dev_dbg(codec->dev, "M98090_SLD_MASK\n"); in max98090_interrupt()
2264 dev_dbg(codec->dev, "M98090_ULK_MASK\n"); in max98090_interrupt()
2269 dev_dbg(codec->dev, "M98090_JDET_MASK\n"); in max98090_interrupt()
2271 pm_wakeup_event(codec->dev, 100); in max98090_interrupt()
2279 dev_dbg(codec->dev, "M98090_DRCACT_MASK\n"); in max98090_interrupt()
2282 dev_err(codec->dev, "M98090_DRCCLP_MASK\n"); in max98090_interrupt()
2300 int max98090_mic_detect(struct snd_soc_codec *codec, in max98090_mic_detect() argument
2303 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_mic_detect()
2305 dev_dbg(codec->dev, "max98090_mic_detect\n"); in max98090_mic_detect()
2309 snd_soc_update_bits(codec, M98090_REG_INTERRUPT_S, in max98090_mic_detect()
2313 snd_soc_update_bits(codec, M98090_REG_INTERRUPT_S, in max98090_mic_detect()
2363 static int max98090_probe(struct snd_soc_codec *codec) in max98090_probe() argument
2365 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_probe()
2372 dev_dbg(codec->dev, "max98090_probe\n"); in max98090_probe()
2374 max98090->mclk = devm_clk_get(codec->dev, "mclk"); in max98090_probe()
2378 max98090->codec = codec; in max98090_probe()
2397 ret = snd_soc_read(codec, M98090_REG_REVISION_ID); in max98090_probe()
2399 dev_err(codec->dev, "Failed to read device revision: %d\n", in max98090_probe()
2406 dev_info(codec->dev, "MAX98090 REVID=0x%02x\n", ret); in max98090_probe()
2409 dev_info(codec->dev, "MAX98091 REVID=0x%02x\n", ret); in max98090_probe()
2412 dev_err(codec->dev, "Unrecognized revision 0x%02x\n", ret); in max98090_probe()
2416 dev_warn(codec->dev, "Mismatch in DT specified CODEC type.\n"); in max98090_probe()
2430 snd_soc_write(codec, M98090_REG_JACK_DETECT, in max98090_probe()
2438 snd_soc_read(codec, M98090_REG_DEVICE_STATUS); in max98090_probe()
2441 snd_soc_update_bits(codec, M98090_REG_DAC_CONTROL, in max98090_probe()
2444 snd_soc_update_bits(codec, M98090_REG_DAC_CONTROL, in max98090_probe()
2447 snd_soc_update_bits(codec, M98090_REG_ADC_CONTROL, in max98090_probe()
2452 snd_soc_write(codec, M98090_REG_BIAS_CONTROL, in max98090_probe()
2455 err = device_property_read_u32(codec->dev, "maxim,micbias", &micbias); in max98090_probe()
2458 dev_info(codec->dev, "use default 2.8v micbias\n"); in max98090_probe()
2460 dev_err(codec->dev, "micbias out of range 0x%x\n", micbias); in max98090_probe()
2464 snd_soc_update_bits(codec, M98090_REG_MIC_BIAS_VOLTAGE, in max98090_probe()
2467 max98090_add_widgets(codec); in max98090_probe()
2473 static int max98090_remove(struct snd_soc_codec *codec) in max98090_remove() argument
2475 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_remove()
2481 max98090->codec = NULL; in max98090_remove()
2489 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm); in max98090_seq_notifier() local
2490 struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); in max98090_seq_notifier()
2493 snd_soc_update_bits(codec, M98090_REG_DEVICE_SHUTDOWN, in max98090_seq_notifier()
2496 snd_soc_update_bits(codec, M98090_REG_DEVICE_SHUTDOWN, in max98090_seq_notifier()