Lines Matching refs:component
70 static void rt5631_write_index(struct snd_soc_component *component, in rt5631_write_index() argument
73 snd_soc_component_write(component, RT5631_INDEX_ADD, reg); in rt5631_write_index()
74 snd_soc_component_write(component, RT5631_INDEX_DATA, value); in rt5631_write_index()
80 static unsigned int rt5631_read_index(struct snd_soc_component *component, in rt5631_read_index() argument
85 snd_soc_component_write(component, RT5631_INDEX_ADD, reg); in rt5631_read_index()
86 value = snd_soc_component_read(component, RT5631_INDEX_DATA); in rt5631_read_index()
91 static int rt5631_reset(struct snd_soc_component *component) in rt5631_reset() argument
93 return snd_soc_component_write(component, RT5631_RESET, 0); in rt5631_reset()
186 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in rt5631_dmic_get() local
187 struct rt5631_priv *rt5631 = snd_soc_component_get_drvdata(component); in rt5631_dmic_get()
197 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in rt5631_dmic_put() local
198 struct rt5631_priv *rt5631 = snd_soc_component_get_drvdata(component); in rt5631_dmic_put()
285 struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); in check_sysclk1_source() local
288 reg = snd_soc_component_read(component, RT5631_GLOBAL_CLK_CTRL); in check_sysclk1_source()
295 struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); in check_dmic_used() local
296 struct rt5631_priv *rt5631 = snd_soc_component_get_drvdata(component); in check_dmic_used()
303 struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); in check_dacl_to_outmixl() local
306 reg = snd_soc_component_read(component, RT5631_OUTMIXER_L_CTRL); in check_dacl_to_outmixl()
313 struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); in check_dacr_to_outmixr() local
316 reg = snd_soc_component_read(component, RT5631_OUTMIXER_R_CTRL); in check_dacr_to_outmixr()
323 struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); in check_dacl_to_spkmixl() local
326 reg = snd_soc_component_read(component, RT5631_SPK_MIXER_CTRL); in check_dacl_to_spkmixl()
333 struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); in check_dacr_to_spkmixr() local
336 reg = snd_soc_component_read(component, RT5631_SPK_MIXER_CTRL); in check_dacr_to_spkmixr()
343 struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); in check_adcl_select() local
346 reg = snd_soc_component_read(component, RT5631_ADC_REC_MIXER); in check_adcl_select()
353 struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); in check_adcr_select() local
356 reg = snd_soc_component_read(component, RT5631_ADC_REC_MIXER); in check_adcr_select()
367 static void onebit_depop_power_stage(struct snd_soc_component *component, int enable) in onebit_depop_power_stage() argument
372 snd_soc_component_update_bits(component, RT5631_DEPOP_FUN_CTRL_2, in onebit_depop_power_stage()
376 soft_vol = snd_soc_component_read(component, RT5631_SOFT_VOL_CTRL); in onebit_depop_power_stage()
377 snd_soc_component_write(component, RT5631_SOFT_VOL_CTRL, 0); in onebit_depop_power_stage()
378 hp_zc = snd_soc_component_read(component, RT5631_INT_ST_IRQ_CTRL_2); in onebit_depop_power_stage()
379 snd_soc_component_write(component, RT5631_INT_ST_IRQ_CTRL_2, hp_zc & 0xf7ff); in onebit_depop_power_stage()
382 rt5631_write_index(component, RT5631_TEST_MODE_CTRL, 0x84c0); in onebit_depop_power_stage()
383 rt5631_write_index(component, RT5631_SPK_INTL_CTRL, 0x309f); in onebit_depop_power_stage()
384 rt5631_write_index(component, RT5631_CP_INTL_REG2, 0x6530); in onebit_depop_power_stage()
386 snd_soc_component_write(component, RT5631_DEPOP_FUN_CTRL_2, in onebit_depop_power_stage()
390 snd_soc_component_write(component, RT5631_DEPOP_FUN_CTRL_2, 0); in onebit_depop_power_stage()
395 snd_soc_component_write(component, RT5631_SOFT_VOL_CTRL, soft_vol); in onebit_depop_power_stage()
396 snd_soc_component_write(component, RT5631_INT_ST_IRQ_CTRL_2, hp_zc); in onebit_depop_power_stage()
406 static void onebit_depop_mute_stage(struct snd_soc_component *component, int enable) in onebit_depop_mute_stage() argument
411 snd_soc_component_update_bits(component, RT5631_DEPOP_FUN_CTRL_2, in onebit_depop_mute_stage()
415 soft_vol = snd_soc_component_read(component, RT5631_SOFT_VOL_CTRL); in onebit_depop_mute_stage()
416 snd_soc_component_write(component, RT5631_SOFT_VOL_CTRL, 0); in onebit_depop_mute_stage()
417 hp_zc = snd_soc_component_read(component, RT5631_INT_ST_IRQ_CTRL_2); in onebit_depop_mute_stage()
418 snd_soc_component_write(component, RT5631_INT_ST_IRQ_CTRL_2, hp_zc & 0xf7ff); in onebit_depop_mute_stage()
422 rt5631_write_index(component, RT5631_SPK_INTL_CTRL, 0x307f); in onebit_depop_mute_stage()
423 snd_soc_component_update_bits(component, RT5631_HP_OUT_VOL, in onebit_depop_mute_stage()
427 snd_soc_component_update_bits(component, RT5631_HP_OUT_VOL, in onebit_depop_mute_stage()
434 snd_soc_component_write(component, RT5631_SOFT_VOL_CTRL, soft_vol); in onebit_depop_mute_stage()
435 snd_soc_component_write(component, RT5631_INT_ST_IRQ_CTRL_2, hp_zc); in onebit_depop_mute_stage()
445 static void depop_seq_power_stage(struct snd_soc_component *component, int enable) in depop_seq_power_stage() argument
450 snd_soc_component_update_bits(component, RT5631_DEPOP_FUN_CTRL_2, in depop_seq_power_stage()
454 soft_vol = snd_soc_component_read(component, RT5631_SOFT_VOL_CTRL); in depop_seq_power_stage()
455 snd_soc_component_write(component, RT5631_SOFT_VOL_CTRL, 0); in depop_seq_power_stage()
456 hp_zc = snd_soc_component_read(component, RT5631_INT_ST_IRQ_CTRL_2); in depop_seq_power_stage()
457 snd_soc_component_write(component, RT5631_INT_ST_IRQ_CTRL_2, hp_zc & 0xf7ff); in depop_seq_power_stage()
460 rt5631_write_index(component, RT5631_SPK_INTL_CTRL, 0x303e); in depop_seq_power_stage()
463 snd_soc_component_update_bits(component, RT5631_PWR_MANAG_ADD3, in depop_seq_power_stage()
470 snd_soc_component_write(component, RT5631_DEPOP_FUN_CTRL_1, in depop_seq_power_stage()
475 snd_soc_component_update_bits(component, RT5631_PWR_MANAG_ADD3, in depop_seq_power_stage()
479 rt5631_write_index(component, RT5631_SPK_INTL_CTRL, 0x303F); in depop_seq_power_stage()
480 snd_soc_component_write(component, RT5631_DEPOP_FUN_CTRL_1, in depop_seq_power_stage()
484 snd_soc_component_write(component, RT5631_DEPOP_FUN_CTRL_1, in depop_seq_power_stage()
489 snd_soc_component_update_bits(component, RT5631_PWR_MANAG_ADD3, in depop_seq_power_stage()
493 snd_soc_component_write(component, RT5631_DEPOP_FUN_CTRL_1, in depop_seq_power_stage()
497 snd_soc_component_write(component, RT5631_DEPOP_FUN_CTRL_1, in depop_seq_power_stage()
501 snd_soc_component_update_bits(component, RT5631_PWR_MANAG_ADD3, in depop_seq_power_stage()
507 snd_soc_component_write(component, RT5631_SOFT_VOL_CTRL, soft_vol); in depop_seq_power_stage()
508 snd_soc_component_write(component, RT5631_INT_ST_IRQ_CTRL_2, hp_zc); in depop_seq_power_stage()
518 static void depop_seq_mute_stage(struct snd_soc_component *component, int enable) in depop_seq_mute_stage() argument
523 snd_soc_component_update_bits(component, RT5631_DEPOP_FUN_CTRL_2, in depop_seq_mute_stage()
527 soft_vol = snd_soc_component_read(component, RT5631_SOFT_VOL_CTRL); in depop_seq_mute_stage()
528 snd_soc_component_write(component, RT5631_SOFT_VOL_CTRL, 0); in depop_seq_mute_stage()
529 hp_zc = snd_soc_component_read(component, RT5631_INT_ST_IRQ_CTRL_2); in depop_seq_mute_stage()
530 snd_soc_component_write(component, RT5631_INT_ST_IRQ_CTRL_2, hp_zc & 0xf7ff); in depop_seq_mute_stage()
535 rt5631_write_index(component, RT5631_SPK_INTL_CTRL, 0x302f); in depop_seq_mute_stage()
536 snd_soc_component_write(component, RT5631_DEPOP_FUN_CTRL_1, in depop_seq_mute_stage()
541 snd_soc_component_update_bits(component, RT5631_HP_OUT_VOL, in depop_seq_mute_stage()
546 rt5631_write_index(component, RT5631_SPK_INTL_CTRL, 0x302f); in depop_seq_mute_stage()
547 snd_soc_component_write(component, RT5631_DEPOP_FUN_CTRL_1, in depop_seq_mute_stage()
552 snd_soc_component_update_bits(component, RT5631_HP_OUT_VOL, in depop_seq_mute_stage()
559 snd_soc_component_write(component, RT5631_SOFT_VOL_CTRL, soft_vol); in depop_seq_mute_stage()
560 snd_soc_component_write(component, RT5631_INT_ST_IRQ_CTRL_2, hp_zc); in depop_seq_mute_stage()
566 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in hp_event() local
567 struct rt5631_priv *rt5631 = snd_soc_component_get_drvdata(component); in hp_event()
572 onebit_depop_mute_stage(component, 0); in hp_event()
573 onebit_depop_power_stage(component, 0); in hp_event()
575 depop_seq_mute_stage(component, 0); in hp_event()
576 depop_seq_power_stage(component, 0); in hp_event()
582 onebit_depop_power_stage(component, 1); in hp_event()
583 onebit_depop_mute_stage(component, 1); in hp_event()
585 depop_seq_power_stage(component, 1); in hp_event()
586 depop_seq_mute_stage(component, 1); in hp_event()
600 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in set_dmic_params() local
601 struct rt5631_priv *rt5631 = snd_soc_component_get_drvdata(component); in set_dmic_params()
606 snd_soc_component_update_bits(component, RT5631_DIG_MIC_CTRL, in set_dmic_params()
613 snd_soc_component_update_bits(component, RT5631_DIG_MIC_CTRL, in set_dmic_params()
621 snd_soc_component_update_bits(component, RT5631_DIG_MIC_CTRL, in set_dmic_params()
1355 struct snd_soc_component *component = dai->component; in rt5631_hifi_pcm_params() local
1356 struct rt5631_priv *rt5631 = snd_soc_component_get_drvdata(component); in rt5631_hifi_pcm_params()
1360 dev_dbg(component->dev, "enter %s\n", __func__); in rt5631_hifi_pcm_params()
1364 dev_err(component->dev, "Fail to get BCLK rate\n"); in rt5631_hifi_pcm_params()
1376 dev_err(component->dev, "Fail to get coeff\n"); in rt5631_hifi_pcm_params()
1396 snd_soc_component_update_bits(component, RT5631_SDP_CTRL, in rt5631_hifi_pcm_params()
1398 snd_soc_component_write(component, RT5631_STEREO_AD_DA_CLK_CTRL, in rt5631_hifi_pcm_params()
1407 struct snd_soc_component *component = codec_dai->component; in rt5631_hifi_codec_set_dai_fmt() local
1408 struct rt5631_priv *rt5631 = snd_soc_component_get_drvdata(component); in rt5631_hifi_codec_set_dai_fmt()
1411 dev_dbg(component->dev, "enter %s\n", __func__); in rt5631_hifi_codec_set_dai_fmt()
1451 snd_soc_component_write(component, RT5631_SDP_CTRL, iface); in rt5631_hifi_codec_set_dai_fmt()
1459 struct snd_soc_component *component = codec_dai->component; in rt5631_hifi_codec_set_dai_sysclk() local
1460 struct rt5631_priv *rt5631 = snd_soc_component_get_drvdata(component); in rt5631_hifi_codec_set_dai_sysclk()
1462 dev_dbg(component->dev, "enter %s, syclk=%d\n", __func__, freq); in rt5631_hifi_codec_set_dai_sysclk()
1475 struct snd_soc_component *component = codec_dai->component; in rt5631_codec_set_dai_pll() local
1476 struct rt5631_priv *rt5631 = snd_soc_component_get_drvdata(component); in rt5631_codec_set_dai_pll()
1479 dev_dbg(component->dev, "enter %s\n", __func__); in rt5631_codec_set_dai_pll()
1482 dev_dbg(component->dev, "PLL disabled\n"); in rt5631_codec_set_dai_pll()
1484 snd_soc_component_update_bits(component, RT5631_GLOBAL_CLK_CTRL, in rt5631_codec_set_dai_pll()
1495 dev_info(component->dev, in rt5631_codec_set_dai_pll()
1497 snd_soc_component_write(component, RT5631_PLL_CTRL, in rt5631_codec_set_dai_pll()
1501 snd_soc_component_update_bits(component, in rt5631_codec_set_dai_pll()
1514 dev_info(component->dev, in rt5631_codec_set_dai_pll()
1516 snd_soc_component_write(component, RT5631_PLL_CTRL, in rt5631_codec_set_dai_pll()
1520 snd_soc_component_update_bits(component, in rt5631_codec_set_dai_pll()
1534 static int rt5631_set_bias_level(struct snd_soc_component *component, in rt5631_set_bias_level() argument
1537 struct rt5631_priv *rt5631 = snd_soc_component_get_drvdata(component); in rt5631_set_bias_level()
1542 snd_soc_component_update_bits(component, RT5631_PWR_MANAG_ADD2, in rt5631_set_bias_level()
1548 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { in rt5631_set_bias_level()
1549 snd_soc_component_update_bits(component, RT5631_PWR_MANAG_ADD3, in rt5631_set_bias_level()
1553 snd_soc_component_update_bits(component, RT5631_PWR_MANAG_ADD3, in rt5631_set_bias_level()
1562 snd_soc_component_write(component, RT5631_PWR_MANAG_ADD1, 0x0000); in rt5631_set_bias_level()
1563 snd_soc_component_write(component, RT5631_PWR_MANAG_ADD2, 0x0000); in rt5631_set_bias_level()
1564 snd_soc_component_write(component, RT5631_PWR_MANAG_ADD3, 0x0000); in rt5631_set_bias_level()
1565 snd_soc_component_write(component, RT5631_PWR_MANAG_ADD4, 0x0000); in rt5631_set_bias_level()
1575 static int rt5631_probe(struct snd_soc_component *component) in rt5631_probe() argument
1577 struct rt5631_priv *rt5631 = snd_soc_component_get_drvdata(component); in rt5631_probe()
1580 val = rt5631_read_index(component, RT5631_ADDA_MIXER_INTL_REG3); in rt5631_probe()
1586 rt5631_reset(component); in rt5631_probe()
1587 snd_soc_component_update_bits(component, RT5631_PWR_MANAG_ADD3, in rt5631_probe()
1591 snd_soc_component_update_bits(component, RT5631_PWR_MANAG_ADD3, in rt5631_probe()
1594 snd_soc_component_write(component, RT5631_INT_ST_IRQ_CTRL_2, 0x0f18); in rt5631_probe()
1597 snd_soc_component_update_bits(component, RT5631_INT_ST_IRQ_CTRL_2, in rt5631_probe()
1600 snd_soc_component_update_bits(component, RT5631_INT_ST_IRQ_CTRL_2, in rt5631_probe()
1604 snd_soc_component_update_bits(component, RT5631_GPIO_CTRL, in rt5631_probe()
1609 snd_soc_component_update_bits(component, RT5631_DIG_MIC_CTRL, in rt5631_probe()
1616 snd_soc_component_init_bias_level(component, SND_SOC_BIAS_STANDBY); in rt5631_probe()