Lines Matching refs:component
30 static int es8396_set_bias_level(struct snd_soc_component *component,
186 struct snd_soc_component *component; member
308 struct snd_soc_component *component = es8396->component; in pcm_shutdown_depop_events() local
311 snd_soc_component_update_bits(component, ES8396_SDP1_IN_FMT_REG1F, in pcm_shutdown_depop_events()
321 struct snd_soc_component *component = es8396->component; in voice_shutdown_depop_events() local
324 snd_soc_component_update_bits(component, ES8396_SDP2_IN_FMT_REG22, in voice_shutdown_depop_events()
328 snd_soc_component_write(component, 0x1A, 0x00); in voice_shutdown_depop_events()
329 snd_soc_component_write(component, 0x67, 0x00); in voice_shutdown_depop_events()
330 snd_soc_component_write(component, 0x69, 0x00); in voice_shutdown_depop_events()
331 snd_soc_component_write(component, 0x66, 0x00); in voice_shutdown_depop_events()
340 struct snd_soc_component *component = es8396->component; in init_cali_work_events() local
347 snd_soc_component_write(component, ES8396_DAC_OFFSET_CALI_REG6F, 0x83); in init_cali_work_events()
353 snd_soc_component_write(component, ES8396_ADC_ANALOG_CTRL_REG5E, 0x3C); in init_cali_work_events()
357 snd_soc_component_write(component, 0x4E, 0x80); in init_cali_work_events()
358 snd_soc_component_write(component, 0x4F, 0x81); in init_cali_work_events()
359 snd_soc_component_write(component, 0x4A, 0x60); in init_cali_work_events()
360 snd_soc_component_write(component, 0x4B, 0x60); in init_cali_work_events()
369 struct snd_soc_component *component = es8396->component; in voice_pop_work_events() local
380 snd_soc_component_update_bits(component, ES8396_SDP2_IN_FMT_REG22, in voice_pop_work_events()
382 snd_soc_component_update_bits(component, ES8396_SDP2_OUT_FMT_REG23, in voice_pop_work_events()
385 snd_soc_component_write(component, 0x4E, 0x80); in voice_pop_work_events()
386 snd_soc_component_write(component, 0x4F, 0x81); in voice_pop_work_events()
387 snd_soc_component_write(component, 0x4A, 0x60); in voice_pop_work_events()
388 snd_soc_component_write(component, 0x4B, 0x60); in voice_pop_work_events()
389 snd_soc_component_write(component, 0x1A, 0x40); /* Enable HPOUT */ in voice_pop_work_events()
392 snd_soc_component_write(component, 0x66, 0x00); in voice_pop_work_events()
395 snd_soc_component_write(component, 0x6A, 120 - i); in voice_pop_work_events()
396 snd_soc_component_write(component, 0x6B, 120 - i); in voice_pop_work_events()
407 struct snd_soc_component *component = es8396->component; in pcm_pop_work_events() local
413 snd_soc_component_write(component, ES8396_SYS_VMID_REF_REG71, 0xFC); in pcm_pop_work_events()
416 snd_soc_component_write(component, 0x4E, 0x80); in pcm_pop_work_events()
417 snd_soc_component_write(component, 0x4F, 0x81); in pcm_pop_work_events()
418 snd_soc_component_write(component, 0x4A, 0x60); in pcm_pop_work_events()
419 snd_soc_component_write(component, 0x4B, 0x60); in pcm_pop_work_events()
420 snd_soc_component_update_bits(component, ES8396_DAC_CSM_REG66, 0x03, 0x00); in pcm_pop_work_events()
421 snd_soc_component_update_bits(component, ES8396_SDP1_IN_FMT_REG1F, 0x40, 0x00); in pcm_pop_work_events()
423 snd_soc_component_write(component, 0x6A, 120 - i); in pcm_pop_work_events()
424 snd_soc_component_write(component, 0x6B, 120 - i); in pcm_pop_work_events()
437 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in classd_event() local
438 struct es8396_private *es8396 = snd_soc_component_get_drvdata(component); in classd_event()
445 regv1 = snd_soc_component_read(component, ES8396_CLK_CTRL_REG08); in classd_event()
448 snd_soc_component_write(component, ES8396_CLK_CTRL_REG08, regv1); in classd_event()
450 snd_soc_component_update_bits(component, ES8396_DAC_CSM_REG66, 0xFE, 0x00); in classd_event()
452 snd_soc_component_update_bits(component, ES8396_DAC_REF_PWR_CTRL_REG6E, in classd_event()
455 regv2 = snd_soc_component_read(component, ES8396_SPK_CTRL_1_REG3C); in classd_event()
472 snd_soc_component_write(component, ES8396_SPK_CTRL_1_REG3C, regv1); in classd_event()
474 snd_soc_component_write(component, ES8396_SPK_CTRL_2_REG3D, 0x10); in classd_event()
476 regv1 = snd_soc_component_read(component, ES8396_SPK_MIXER_REG26); in classd_event()
479 snd_soc_component_write(component, ES8396_SPK_MIXER_REG26, regv1); in classd_event()
480 snd_soc_component_write(component, ES8396_SPK_MIXER_VOL_REG28, 0x33); in classd_event()
482 snd_soc_component_write(component, ES8396_SPK_CTRL_SRC_REG3A, 0xA9); in classd_event()
484 snd_soc_component_write(component, ES8396_DAC_LDAC_VOL_REG6A, 0x00); in classd_event()
485 snd_soc_component_write(component, ES8396_DAC_RDAC_VOL_REG6B, 0x00); in classd_event()
487 regv1 = snd_soc_component_read(component, ES8396_HP_MIXER_BOOST_REG2B); in classd_event()
489 snd_soc_component_write(component, ES8396_HP_MIXER_BOOST_REG2B, regv1); in classd_event()
491 regv1 = snd_soc_component_read(component, ES8396_CPHP_CTRL_3_REG44); in classd_event()
493 snd_soc_component_write(component, ES8396_CPHP_CTRL_3_REG44, regv1); in classd_event()
495 regv1 = snd_soc_component_read(component, ES8396_CPHP_CTRL_1_REG42); in classd_event()
497 snd_soc_component_write(component, ES8396_CPHP_CTRL_1_REG42, regv1); in classd_event()
499 regv1 = snd_soc_component_read(component, ES8396_CPHP_CTRL_2_REG43); in classd_event()
501 snd_soc_component_write(component, ES8396_CPHP_CTRL_2_REG43, regv1); in classd_event()
512 regv1 = snd_soc_component_read(component, ES8396_CLK_CTRL_REG08); in classd_event()
515 snd_soc_component_write(component, ES8396_CLK_CTRL_REG08, regv1); in classd_event()
519 regv1 = snd_soc_component_read(component, ES8396_SPK_EN_VOL_REG3B); in classd_event()
522 snd_soc_component_write(component, ES8396_SPK_EN_VOL_REG3B, regv1); in classd_event()
524 regv1 = snd_soc_component_read(component, ES8396_SPK_CTRL_SRC_REG3A); in classd_event()
526 snd_soc_component_write(component, ES8396_SPK_CTRL_SRC_REG3A, regv1); in classd_event()
527 regv1 = snd_soc_component_read(component, ES8396_SPK_MIXER_REG26); in classd_event()
530 snd_soc_component_write(component, ES8396_SPK_MIXER_REG26, regv1); in classd_event()
531 snd_soc_component_update_bits(component, ES8396_SPK_CTRL_1_REG3C, 0x20, in classd_event()
546 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in micbias_event() local
547 struct es8396_private *es8396 = snd_soc_component_get_drvdata(component); in micbias_event()
560 snd_soc_component_write(component, ES8396_SYS_MICBIAS_CTRL_REG74, in micbias_event()
563 regv = snd_soc_component_read(component, ES8396_ALRCK_GPIO_SEL_REG15); in micbias_event()
570 snd_soc_component_write(component, ES8396_ALRCK_GPIO_SEL_REG15, regv); in micbias_event()
573 regv = snd_soc_component_read(component, ES8396_ALRCK_GPIO_SEL_REG15); in micbias_event()
575 snd_soc_component_write(component, ES8396_ALRCK_GPIO_SEL_REG15, regv); in micbias_event()
588 struct snd_soc_component *component = es8396->component; in adc_depop_work_events() local
592 snd_soc_component_update_bits(component, ES8396_SDP1_OUT_FMT_REG20, 0x40, 0x00); in adc_depop_work_events()
600 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in adc_event() local
601 struct es8396_private *es8396 = snd_soc_component_get_drvdata(component); in adc_event()
608 snd_soc_component_update_bits(component, ES8396_SDP1_OUT_FMT_REG20, 0x40, in adc_event()
611 snd_soc_component_write(component, ES8396_ADC_ALC_CTRL_1_REG58, 0xC6); in adc_event()
612 snd_soc_component_write(component, ES8396_ADC_ALC_CTRL_2_REG59, 0x12); in adc_event()
613 snd_soc_component_write(component, ES8396_ADC_ALC_CTRL_4_REG5B, 0x04); in adc_event()
614 snd_soc_component_write(component, ES8396_ADC_ALC_CTRL_5_REG5C, 0xC8); in adc_event()
615 snd_soc_component_write(component, ES8396_ADC_ALC_CTRL_6_REG5D, 0x11); in adc_event()
616 snd_soc_component_write(component, ES8396_ADC_ANALOG_CTRL_REG5E, 0x0); in adc_event()
618 snd_soc_component_write(component, ES8396_SYS_MIC_IBIAS_EN_REG75, 0x02); in adc_event()
621 regv = snd_soc_component_read(component, ES8396_AX_MIXER_BOOST_REG2F); in adc_event()
623 snd_soc_component_write(component, ES8396_AX_MIXER_BOOST_REG2F, regv); in adc_event()
625 snd_soc_component_write(component, ES8396_AX_MIXER_VOL_REG30, 0xaa); in adc_event()
627 snd_soc_component_write(component, ES8396_AX_MIXER_REF_LP_REG31, 0x02); in adc_event()
630 regv = snd_soc_component_read(component, ES8396_MN_MIXER_BOOST_REG37); in adc_event()
632 snd_soc_component_write(component, ES8396_MN_MIXER_BOOST_REG37, regv); in adc_event()
634 snd_soc_component_write(component, ES8396_MN_MIXER_VOL_REG38, 0x44); in adc_event()
636 snd_soc_component_write(component, ES8396_MN_MIXER_REF_LP_REG39, 0x02); in adc_event()
640 snd_soc_component_write(component, ES8396_ADC_CSM_REG53, 0x00); in adc_event()
642 snd_soc_component_write(component, ES8396_ADC_FORCE_REG77, 0x40); in adc_event()
643 snd_soc_component_write(component, ES8396_ADC_FORCE_REG77, 0x0); in adc_event()
645 snd_soc_component_write(component, ES8396_ADC_LADC_VOL_REG56, 0x0); in adc_event()
646 snd_soc_component_write(component, ES8396_ADC_RADC_VOL_REG57, 0x0); in adc_event()
647 snd_soc_component_write(component, ES8396_ADC_CLK_DIV_REG09, 0x04); in adc_event()
655 snd_soc_component_write(component, ES8396_ADC_CSM_REG53, 0x20); in adc_event()
656 snd_soc_component_write(component, ES8396_ADC_CLK_DIV_REG09, 0x04); in adc_event()
672 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in hpamp_event() local
673 struct es8396_private *es8396 = snd_soc_component_get_drvdata(component); in hpamp_event()
692 snd_soc_component_update_bits(component, ES8396_DAC_CSM_REG66, 0x42, 0x00); in hpamp_event()
698 snd_soc_component_update_bits(component, ES8396_DAC_CSM_REG66, 0x40, 0x40); in hpamp_event()
700 snd_soc_component_update_bits(component, ES8396_DAC_REF_PWR_CTRL_REG6E, in hpamp_event()
703 regv = snd_soc_component_read(component, ES8396_CLK_CTRL_REG08); in hpamp_event()
706 snd_soc_component_write(component, ES8396_CLK_CTRL_REG08, regv); in hpamp_event()
708 regv = snd_soc_component_read(component, ES8396_HP_MIXER_BOOST_REG2B); in hpamp_event()
710 snd_soc_component_write(component, ES8396_HP_MIXER_BOOST_REG2B, regv); in hpamp_event()
1948 struct snd_soc_component *component = dai->component; in es8396_set_pll() local
1949 struct es8396_private *priv = snd_soc_component_get_drvdata(component); in es8396_set_pll()
1960 snd_soc_component_write(component, ES8396_PLL_CTRL_1_REG02, 0x81); in es8396_set_pll()
1970 reg = snd_soc_component_read(component, ES8396_CLK_SRC_SEL_REG01); in es8396_set_pll()
1977 snd_soc_component_write(component, ES8396_CLK_SRC_SEL_REG01, reg); in es8396_set_pll()
1978 reg = snd_soc_component_read(component, ES8396_CLK_CTRL_REG08); in es8396_set_pll()
1980 snd_soc_component_write(component, ES8396_CLK_CTRL_REG08, reg); in es8396_set_pll()
1984 reg = snd_soc_component_read(component, ES8396_CLK_SRC_SEL_REG01); in es8396_set_pll()
1988 snd_soc_component_write(component, ES8396_CLK_SRC_SEL_REG01, reg); in es8396_set_pll()
1989 reg = snd_soc_component_read(component, ES8396_CLK_CTRL_REG08); in es8396_set_pll()
1991 snd_soc_component_write(component, ES8396_CLK_CTRL_REG08, reg); in es8396_set_pll()
1995 reg = snd_soc_component_read(component, ES8396_CLK_SRC_SEL_REG01); in es8396_set_pll()
1999 snd_soc_component_write(component, ES8396_CLK_SRC_SEL_REG01, reg); in es8396_set_pll()
2000 reg = snd_soc_component_read(component, ES8396_CLK_CTRL_REG08); in es8396_set_pll()
2002 snd_soc_component_write(component, ES8396_CLK_CTRL_REG08, reg); in es8396_set_pll()
2033 snd_soc_component_write(component, ES8396_PLL_N_REG04, N); in es8396_set_pll()
2034 snd_soc_component_write(component, ES8396_PLL_K2_REG05, K3); in es8396_set_pll()
2035 snd_soc_component_write(component, ES8396_PLL_K1_REG06, K2); in es8396_set_pll()
2036 snd_soc_component_write(component, ES8396_PLL_K0_REG07, K1); in es8396_set_pll()
2039 snd_soc_component_update_bits(component, in es8396_set_pll()
2044 snd_soc_component_update_bits(component, in es8396_set_pll()
2049 snd_soc_component_update_bits(component, ES8396_PLL_CTRL_1_REG02, in es8396_set_pll()
2056 snd_soc_component_update_bits(component, in es8396_set_pll()
2062 snd_soc_component_update_bits(component, in es8396_set_pll()
2068 snd_soc_component_update_bits(component, in es8396_set_pll()
2074 snd_soc_component_update_bits(component, in es8396_set_pll()
2080 snd_soc_component_update_bits(component, ES8396_PLL_CTRL_1_REG02, in es8396_set_pll()
2083 snd_soc_component_update_bits(component, ES8396_PLL_CTRL_1_REG02, in es8396_set_pll()
2086 snd_soc_component_write(component, ES8396_PLL_N_REG04, 0x08); in es8396_set_pll()
2087 snd_soc_component_write(component, ES8396_PLL_K2_REG05, 0X1D); in es8396_set_pll()
2088 snd_soc_component_write(component, ES8396_PLL_K1_REG06, 0XC3); in es8396_set_pll()
2089 snd_soc_component_write(component, ES8396_PLL_K0_REG07, 0XB8); in es8396_set_pll()
2104 struct snd_soc_component *component = dai->component; in es8396_set_dai_sysclk() local
2105 struct es8396_private *priv = snd_soc_component_get_drvdata(component); in es8396_set_dai_sysclk()
2119 reg = snd_soc_component_read(component, ES8396_CLK_SRC_SEL_REG01); in es8396_set_dai_sysclk()
2122 snd_soc_component_write(component, ES8396_CLK_SRC_SEL_REG01, reg); in es8396_set_dai_sysclk()
2125 reg = snd_soc_component_read(component, ES8396_CLK_CTRL_REG08); in es8396_set_dai_sysclk()
2127 snd_soc_component_write(component, ES8396_CLK_CTRL_REG08, reg); in es8396_set_dai_sysclk()
2133 snd_soc_component_update_bits(component, ES8396_CLK_SRC_SEL_REG01, in es8396_set_dai_sysclk()
2139 snd_soc_component_update_bits(component, ES8396_BCLK_DIV_M1_REG0E, in es8396_set_dai_sysclk()
2142 snd_soc_component_update_bits(component, ES8396_LRCK_DIV_M3_REG10, in es8396_set_dai_sysclk()
2148 snd_soc_component_update_bits(component, ES8396_BCLK_DIV_M2_REG0F, in es8396_set_dai_sysclk()
2151 snd_soc_component_update_bits(component, ES8396_LRCK_DIV_M4_REG11, in es8396_set_dai_sysclk()
2161 reg = snd_soc_component_read(component, ES8396_CLK_SRC_SEL_REG01); in es8396_set_dai_sysclk()
2164 snd_soc_component_write(component, ES8396_CLK_SRC_SEL_REG01, reg); in es8396_set_dai_sysclk()
2166 reg = snd_soc_component_read(component, ES8396_CLK_CTRL_REG08); in es8396_set_dai_sysclk()
2168 snd_soc_component_write(component, ES8396_CLK_CTRL_REG08, reg); in es8396_set_dai_sysclk()
2174 snd_soc_component_update_bits(component, ES8396_CLK_SRC_SEL_REG01, in es8396_set_dai_sysclk()
2180 snd_soc_component_update_bits(component, ES8396_BCLK_DIV_M1_REG0E, in es8396_set_dai_sysclk()
2183 snd_soc_component_update_bits(component, ES8396_LRCK_DIV_M3_REG10, in es8396_set_dai_sysclk()
2189 snd_soc_component_update_bits(component, ES8396_BCLK_DIV_M2_REG0F, in es8396_set_dai_sysclk()
2192 snd_soc_component_update_bits(component, ES8396_LRCK_DIV_M4_REG11, in es8396_set_dai_sysclk()
2205 snd_soc_component_update_bits(component, ES8396_BCLK_DIV_M1_REG0E, in es8396_set_dai_sysclk()
2208 snd_soc_component_update_bits(component, ES8396_LRCK_DIV_M3_REG10, in es8396_set_dai_sysclk()
2213 snd_soc_component_update_bits(component, ES8396_BCLK_DIV_M1_REG0E, in es8396_set_dai_sysclk()
2216 snd_soc_component_update_bits(component, ES8396_LRCK_DIV_M3_REG10, in es8396_set_dai_sysclk()
2221 snd_soc_component_update_bits(component, ES8396_BCLK_DIV_M2_REG0F, in es8396_set_dai_sysclk()
2224 snd_soc_component_update_bits(component, ES8396_LRCK_DIV_M4_REG11, in es8396_set_dai_sysclk()
2296 struct snd_soc_component *component = codec_dai->component; in es8396_set_dai_fmt() local
2297 struct es8396_private *priv = snd_soc_component_get_drvdata(component); in es8396_set_dai_fmt()
2304 spc = snd_soc_component_read(component, ES8396_SDP1_IN_FMT_REG1F) & 0x3f; in es8396_set_dai_fmt()
2305 mmcc = snd_soc_component_read(component, ES8396_SDP_1_MS_REG12); in es8396_set_dai_fmt()
2308 spc = snd_soc_component_read(component, ES8396_SDP2_IN_FMT_REG22) & 0x3f; in es8396_set_dai_fmt()
2309 mmcc = snd_soc_component_read(component, ES8396_SDP_2_MS_REG13); in es8396_set_dai_fmt()
2312 spc = snd_soc_component_read(component, ES8396_SDP3_IN_FMT_REG24) & 0x3f; in es8396_set_dai_fmt()
2313 mmcc = snd_soc_component_read(component, ES8396_SDP_3_MS_REG14); in es8396_set_dai_fmt()
2374 snd_soc_component_write(component, ES8396_SDP1_IN_FMT_REG1F, 00); in es8396_set_dai_fmt()
2387 struct snd_soc_component *component = dai->component; in es8396_pcm_hw_params() local
2388 struct es8396_private *priv = snd_soc_component_get_drvdata(component); in es8396_pcm_hw_params()
2401 bdiv = snd_soc_component_read(component, ES8396_BCLK_DIV_M2_REG0F); in es8396_pcm_hw_params()
2404 lrdiv = snd_soc_component_read(component, ES8396_LRCK_DIV_M4_REG11); in es8396_pcm_hw_params()
2407 snd_soc_component_write(component, ES8396_BCLK_DIV_M2_REG0F, bdiv); in es8396_pcm_hw_params()
2408 snd_soc_component_write(component, ES8396_LRCK_DIV_M4_REG11, lrdiv); in es8396_pcm_hw_params()
2415 bdiv = snd_soc_component_read(component, ES8396_BCLK_DIV_M1_REG0E); in es8396_pcm_hw_params()
2418 lrdiv = snd_soc_component_read(component, ES8396_LRCK_DIV_M3_REG10); in es8396_pcm_hw_params()
2421 snd_soc_component_write(component, ES8396_BCLK_DIV_M1_REG0E, bdiv); in es8396_pcm_hw_params()
2422 snd_soc_component_write(component, ES8396_LRCK_DIV_M3_REG10, lrdiv); in es8396_pcm_hw_params()
2434 static int es8396_set_bias_level(struct snd_soc_component *component, in es8396_set_bias_level() argument
2438 struct es8396_private *es8396 = snd_soc_component_get_drvdata(component); in es8396_set_bias_level()
2449 snd_soc_component_write(component, 0x4E, 0x80); in es8396_set_bias_level()
2450 snd_soc_component_write(component, 0x4F, 0x81); in es8396_set_bias_level()
2458 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { in es8396_set_bias_level()
2459 snd_soc_component_write(component, ES8396_SYS_VMID_REF_REG71, in es8396_set_bias_level()
2464 snd_soc_component_write(component, 0x70, value); in es8396_set_bias_level()
2485 struct snd_soc_component *component = dai->component; in es8396_set_tristate() local
2492 return snd_soc_component_update_bits(component, ES8396_SDP1_DGAIN_TDM_REG21, in es8396_set_tristate()
2507 struct snd_soc_component *component = dai->component; in es8396_pcm_startup() local
2508 struct es8396_private *es8396 = snd_soc_component_get_drvdata(component); in es8396_pcm_startup()
2514 ret = snd_soc_component_read(component, ES8396_ADC_CSM_REG53); in es8396_pcm_startup()
2524 snd_soc_component_write(component, 0x1A, 0x00); in es8396_pcm_startup()
2525 snd_soc_component_write(component, 0x8, 0x10); in es8396_pcm_startup()
2526 snd_soc_component_write(component, 0xd, 0x00); in es8396_pcm_startup()
2527 snd_soc_component_write(component, 0x9, 0x04); in es8396_pcm_startup()
2528 snd_soc_component_write(component, 0x69, 0x00); in es8396_pcm_startup()
2529 snd_soc_component_write(component, 0x67, 0x00); in es8396_pcm_startup()
2532 snd_soc_component_write(component, 0x18, 0x00); /* set eq source */ in es8396_pcm_startup()
2533 snd_soc_component_write(component, 0x19, 0x51); /* set eq source */ in es8396_pcm_startup()
2535 snd_soc_component_write(component, 0x1A, 0x40); in es8396_pcm_startup()
2536 snd_soc_component_write(component, 0x8, 0x10); in es8396_pcm_startup()
2537 snd_soc_component_write(component, 0xd, 0x00); in es8396_pcm_startup()
2538 snd_soc_component_write(component, 0x9, 0x04); in es8396_pcm_startup()
2539 snd_soc_component_write(component, 0x67, 0x0c); in es8396_pcm_startup()
2540 snd_soc_component_write(component, 0x69, 0x04); in es8396_pcm_startup()
2546 snd_soc_component_write(component, 0x66, 0x01); in es8396_pcm_startup()
2548 snd_soc_component_write(component, 0x6A, i + 1); in es8396_pcm_startup()
2549 snd_soc_component_write(component, 0x6B, i + 1); in es8396_pcm_startup()
2561 snd_soc_component_update_bits(component, ES8396_SDP1_OUT_FMT_REG20, 0x40, in es8396_pcm_startup()
2564 snd_soc_component_write(component, ES8396_ADC_ALC_CTRL_1_REG58, 0xC6); in es8396_pcm_startup()
2565 snd_soc_component_write(component, ES8396_ADC_ALC_CTRL_2_REG59, 0x12); in es8396_pcm_startup()
2566 snd_soc_component_write(component, ES8396_ADC_ALC_CTRL_4_REG5B, 0x04); in es8396_pcm_startup()
2567 snd_soc_component_write(component, ES8396_ADC_ALC_CTRL_5_REG5C, 0xC8); in es8396_pcm_startup()
2568 snd_soc_component_write(component, ES8396_ADC_ALC_CTRL_6_REG5D, 0x11); in es8396_pcm_startup()
2569 snd_soc_component_write(component, ES8396_ADC_ANALOG_CTRL_REG5E, 0x0); in es8396_pcm_startup()
2571 snd_soc_component_write(component, ES8396_SYS_MIC_IBIAS_EN_REG75, 0x02); in es8396_pcm_startup()
2574 regv = snd_soc_component_read(component, ES8396_AX_MIXER_BOOST_REG2F); in es8396_pcm_startup()
2576 snd_soc_component_write(component, ES8396_AX_MIXER_BOOST_REG2F, regv); in es8396_pcm_startup()
2578 snd_soc_component_write(component, ES8396_AX_MIXER_VOL_REG30, 0xaa); in es8396_pcm_startup()
2580 snd_soc_component_write(component, ES8396_AX_MIXER_REF_LP_REG31, 0x02); in es8396_pcm_startup()
2581 snd_soc_component_write(component, 0x33, 0); in es8396_pcm_startup()
2583 regv = snd_soc_component_read(component, ES8396_MN_MIXER_BOOST_REG37); in es8396_pcm_startup()
2585 snd_soc_component_write(component, ES8396_MN_MIXER_BOOST_REG37, regv); in es8396_pcm_startup()
2587 snd_soc_component_write(component, ES8396_MN_MIXER_VOL_REG38, 0x44); in es8396_pcm_startup()
2589 snd_soc_component_write(component, ES8396_MN_MIXER_REF_LP_REG39, 0x02); in es8396_pcm_startup()
2592 snd_soc_component_write(component, ES8396_ADC_CSM_REG53, 0x00); in es8396_pcm_startup()
2594 snd_soc_component_write(component, ES8396_ADC_FORCE_REG77, 0x40); in es8396_pcm_startup()
2595 snd_soc_component_write(component, ES8396_ADC_FORCE_REG77, 0x0); in es8396_pcm_startup()
2597 snd_soc_component_write(component, ES8396_ADC_LADC_VOL_REG56, 0x0); in es8396_pcm_startup()
2598 snd_soc_component_write(component, ES8396_ADC_RADC_VOL_REG57, 0x0); in es8396_pcm_startup()
2599 snd_soc_component_write(component, ES8396_ADC_CLK_DIV_REG09, 0x04); in es8396_pcm_startup()
2611 struct snd_soc_component *component = dai->component; in es8396_pcm_shutdown() local
2612 struct es8396_private *es8396 = snd_soc_component_get_drvdata(component); in es8396_pcm_shutdown()
2625 snd_soc_component_update_bits(component, ES8396_SDP1_OUT_FMT_REG20, 0x40, in es8396_pcm_shutdown()
2636 struct snd_soc_component *component = dai->component; in es8396_voice_startup() local
2637 struct es8396_private *es8396 = snd_soc_component_get_drvdata(component); in es8396_voice_startup()
2646 snd_soc_component_write(component, 0x4e, 0x84); in es8396_voice_startup()
2647 snd_soc_component_write(component, 0x4f, 0x85); in es8396_voice_startup()
2650 snd_soc_component_write(component, 0x6A, i + 1); in es8396_voice_startup()
2651 snd_soc_component_write(component, 0x6B, i + 1); in es8396_voice_startup()
2656 snd_soc_component_write(component, 0x66, 0x01); in es8396_voice_startup()
2658 snd_soc_component_update_bits(component, ES8396_SDP2_IN_FMT_REG22, in es8396_voice_startup()
2660 snd_soc_component_write(component, 0x18, 0x51); /* set eq source */ in es8396_voice_startup()
2661 snd_soc_component_write(component, 0x19, 0x51); /* set eq source */ in es8396_voice_startup()
2662 snd_soc_component_write(component, 0x8, 0x10); in es8396_voice_startup()
2663 snd_soc_component_write(component, 0xd, 0x00); in es8396_voice_startup()
2664 snd_soc_component_write(component, 0x9, 0x04); in es8396_voice_startup()
2667 snd_soc_component_write(component, 0x67, 0x0c); in es8396_voice_startup()
2668 snd_soc_component_write(component, 0x69, 0x04); in es8396_voice_startup()
2670 snd_soc_component_write(component, 0x67, 0x0c); in es8396_voice_startup()
2671 snd_soc_component_write(component, 0x69, 0x04); in es8396_voice_startup()
2674 snd_soc_component_write(component, ES8396_EQ_CLK_OSR_SEL_REG1C, 0x35); in es8396_voice_startup()
2675 snd_soc_component_write(component, ES8396_SHARED_ADDR_REG1D, 0x00); in es8396_voice_startup()
2678 snd_soc_component_write(component, ES8396_SHARED_DATA_REG1E, in es8396_voice_startup()
2681 snd_soc_component_write(component, ES8396_SHARED_ADDR_REG1D, 0xbb); in es8396_voice_startup()
2682 snd_soc_component_write(component, ES8396_SHARED_DATA_REG1E, in es8396_voice_startup()
2691 snd_soc_component_write(component, ES8396_ADC_ALC_CTRL_1_REG58, 0xC6); in es8396_voice_startup()
2692 snd_soc_component_write(component, ES8396_ADC_ALC_CTRL_2_REG59, 0x12); in es8396_voice_startup()
2693 snd_soc_component_write(component, ES8396_ADC_ALC_CTRL_4_REG5B, 0x04); in es8396_voice_startup()
2694 snd_soc_component_write(component, ES8396_ADC_ALC_CTRL_5_REG5C, 0xC8); in es8396_voice_startup()
2695 snd_soc_component_write(component, ES8396_ADC_ALC_CTRL_6_REG5D, 0x11); in es8396_voice_startup()
2696 snd_soc_component_write(component, ES8396_ADC_ANALOG_CTRL_REG5E, 0x0); in es8396_voice_startup()
2697 snd_soc_component_write(component, ES8396_SYS_MIC_IBIAS_EN_REG75, 0x02); in es8396_voice_startup()
2700 regv = snd_soc_component_read(component, ES8396_AX_MIXER_BOOST_REG2F); in es8396_voice_startup()
2702 snd_soc_component_write(component, ES8396_AX_MIXER_BOOST_REG2F, regv); in es8396_voice_startup()
2704 snd_soc_component_write(component, ES8396_AX_MIXER_VOL_REG30, 0xaa); in es8396_voice_startup()
2706 snd_soc_component_write(component, ES8396_AX_MIXER_REF_LP_REG31, 0x02); in es8396_voice_startup()
2707 snd_soc_component_write(component, 0x33, 0); in es8396_voice_startup()
2709 regv = snd_soc_component_read(component, ES8396_MN_MIXER_BOOST_REG37); in es8396_voice_startup()
2711 snd_soc_component_write(component, ES8396_MN_MIXER_BOOST_REG37, regv); in es8396_voice_startup()
2713 snd_soc_component_write(component, ES8396_MN_MIXER_VOL_REG38, 0x44); in es8396_voice_startup()
2715 snd_soc_component_write(component, ES8396_MN_MIXER_REF_LP_REG39, 0x02); in es8396_voice_startup()
2718 snd_soc_component_write(component, ES8396_ADC_CSM_REG53, 0x00); in es8396_voice_startup()
2720 snd_soc_component_write(component, ES8396_ADC_FORCE_REG77, 0x40); in es8396_voice_startup()
2721 snd_soc_component_write(component, ES8396_ADC_FORCE_REG77, 0x0); in es8396_voice_startup()
2723 snd_soc_component_write(component, ES8396_ADC_LADC_VOL_REG56, 0x0); in es8396_voice_startup()
2724 snd_soc_component_write(component, ES8396_ADC_RADC_VOL_REG57, 0x0); in es8396_voice_startup()
2727 snd_soc_component_update_bits(component, ES8396_SDP2_OUT_FMT_REG23, in es8396_voice_startup()
2736 struct snd_soc_component *component = dai->component; in es8396_voice_shutdown() local
2737 struct es8396_private *es8396 = snd_soc_component_get_drvdata(component); in es8396_voice_shutdown()
2744 snd_soc_component_write(component, 0x66, 0x01); in es8396_voice_shutdown()
2751 snd_soc_component_update_bits(component, ES8396_SDP2_OUT_FMT_REG23, in es8396_voice_shutdown()
2762 struct snd_soc_component *component = codec_dai->component; in es8396_aif1_mute() local
2763 struct es8396_private *es8396 = snd_soc_component_get_drvdata(component); in es8396_aif1_mute()
2784 struct snd_soc_component *component = codec_dai->component; in es8396_aif2_mute() local
2785 struct es8396_private *es8396 = snd_soc_component_get_drvdata(component); in es8396_aif2_mute()
2856 struct snd_soc_component *component = es8396->component; in es8396_suspend() local
2858 snd_soc_component_write(component, 0x4e, 0x84); in es8396_suspend()
2859 snd_soc_component_write(component, 0x4f, 0x85); in es8396_suspend()
2860 snd_soc_component_write(component, 0x66, 0x01); in es8396_suspend()
2861 snd_soc_component_write(component, 0x6e, 0x00); in es8396_suspend()
2869 struct snd_soc_component *component = es8396->component; in es8396_resume() local
2873 snd_soc_component_write(component, 0x6e, 0x00); in es8396_resume()
2874 snd_soc_component_write(component, 0x66, 0x00); in es8396_resume()
2875 snd_soc_component_write(component, 0x4e, 0x80); in es8396_resume()
2876 snd_soc_component_write(component, 0x4f, 0x81); in es8396_resume()
2880 static int es8396_probe(struct snd_soc_component *component) in es8396_probe() argument
2882 struct es8396_private *es8396 = snd_soc_component_get_drvdata(component); in es8396_probe()
2886 es8396->component = component; in es8396_probe()
2887 es8396->mclk_clock = devm_clk_get(component->dev, "mclk"); in es8396_probe()
2894 regv = snd_soc_component_read(component, ES8396_PLL_K2_REG05); in es8396_probe()
2900 snd_soc_component_write(component, ES8396_DLL_CTRL_REG0D, 0x20); in es8396_probe()
2901 snd_soc_component_write(component, ES8396_CLK_SRC_SEL_REG01, 0x04); in es8396_probe()
2902 snd_soc_component_write(component, ES8396_PLL_CTRL_1_REG02, 0xc1); in es8396_probe()
2903 snd_soc_component_write(component, ES8396_PLL_CTRL_2_REG03, 0x00); in es8396_probe()
2904 snd_soc_component_write(component, ES8396_PLL_N_REG04, 0x08); in es8396_probe()
2905 snd_soc_component_write(component, ES8396_PLL_K2_REG05, 0X1d); in es8396_probe()
2906 snd_soc_component_write(component, ES8396_PLL_K1_REG06, 0Xc3); in es8396_probe()
2907 snd_soc_component_write(component, ES8396_PLL_K0_REG07, 0Xb8); in es8396_probe()
2908 snd_soc_component_write(component, ES8396_PLL_CTRL_1_REG02, 0x41); in es8396_probe()
2911 snd_soc_component_write(component, ES8396_CLK_CTRL_REG08, 0x00); in es8396_probe()
2913 snd_soc_component_write(component, ES8396_ADC_CLK_DIV_REG09, 0x04); in es8396_probe()
2915 snd_soc_component_write(component, ES8396_DAC_CLK_DIV_REG0A, 0x01); in es8396_probe()
2916 snd_soc_component_write(component, ES8396_BCLK_DIV_M2_REG0F, 0x24); in es8396_probe()
2917 snd_soc_component_write(component, ES8396_LRCK_DIV_M4_REG11, 0x22); in es8396_probe()
2920 snd_soc_component_write(component, ES8396_SYS_VMID_REF_REG71, 0xFC); in es8396_probe()
2921 snd_soc_component_write(component, 0x72, 0xFF); in es8396_probe()
2922 snd_soc_component_write(component, 0x73, 0xFF); in es8396_probe()
2929 snd_soc_component_write(component, ES8396_SYS_CHIP_ANA_CTL_REG70, value); in es8396_probe()
2931 snd_soc_component_write(component, ES8396_SYS_MIC_IBIAS_EN_REG75, 0x01); in es8396_probe()
2933 snd_soc_component_write(component, ES8396_TEST_MODE_REG76, 0xA0); in es8396_probe()
2934 snd_soc_component_write(component, ES8396_NGTH_REG7A, 0x20); in es8396_probe()
2938 snd_soc_component_write(component, ES8396_ADC_ANALOG_CTRL_REG5E, 0x00); in es8396_probe()
2939 snd_soc_component_write(component, ES8396_DAC_REF_PWR_CTRL_REG6E, 0x00); in es8396_probe()
2941 snd_soc_component_write(component, ES8396_DAC_LDAC_VOL_REG6A, 0x01); in es8396_probe()
2942 snd_soc_component_write(component, ES8396_DAC_RDAC_VOL_REG6B, 0x01); in es8396_probe()
2944 snd_soc_component_write(component, ES8396_ADC_LADC_VOL_REG56, 0x84); in es8396_probe()
2945 snd_soc_component_write(component, ES8396_ADC_RADC_VOL_REG57, 0xdc); in es8396_probe()
2946 snd_soc_component_write(component, ES8396_DAC_OFFSET_CALI_REG6F, 0x06); in es8396_probe()
2947 snd_soc_component_write(component, ES8396_DAC_RAMP_RATE_REG67, 0x00); in es8396_probe()
2949 snd_soc_component_write(component, ES8396_DAC_CSM_REG66, 0x00); in es8396_probe()
2950 snd_soc_component_write(component, ES8396_ADC_CSM_REG53, 0x00); in es8396_probe()
2951 snd_soc_component_write(component, ES8396_ADC_FORCE_REG77, 0x40); in es8396_probe()
2952 snd_soc_component_write(component, ES8396_ADC_FORCE_REG77, 0x00); in es8396_probe()
2953 snd_soc_component_write(component, ES8396_DLL_CTRL_REG0D, 0x00); in es8396_probe()
2955 snd_soc_component_write(component, ES8396_DAC_CSM_REG66, 0x00); in es8396_probe()
2956 snd_soc_component_write(component, ES8396_ADC_ANALOG_CTRL_REG5E, 0x00); in es8396_probe()
2957 snd_soc_component_write(component, 0x5f, 0xf2); in es8396_probe()
2958 snd_soc_component_write(component, 0x1f, 0x00); in es8396_probe()
2959 snd_soc_component_write(component, 0x20, 0x40); in es8396_probe()
2962 snd_soc_component_write(component, 0x65, 0x88); in es8396_probe()
2963 snd_soc_component_write(component, 0x2E, 0x88); in es8396_probe()
2964 snd_soc_component_write(component, 0x2F, 0x00); in es8396_probe()
2965 snd_soc_component_write(component, 0x30, 0xBB); in es8396_probe()
2975 snd_soc_component_write(component, ES8396_SYS_MICBIAS_CTRL_REG74, value); in es8396_probe()
2977 snd_soc_component_write(component, ES8396_ADC_CSM_REG53, 0x20); in es8396_probe()
2978 snd_soc_component_write(component, ES8396_ADC_PGA_GAIN_REG61, 0x33); in es8396_probe()
2979 snd_soc_component_write(component, ES8396_ADC_MICBOOST_REG60, 0x22); in es8396_probe()
2982 snd_soc_component_write(component, ES8396_ADC_DMIC_RAMPRATE_REG54, in es8396_probe()
2986 snd_soc_component_write(component, ES8396_ADC_DMIC_RAMPRATE_REG54, in es8396_probe()
2990 snd_soc_component_write(component, ES8396_ADC_HPF_COMP_DASEL_REG55, 0x31); in es8396_probe()
2997 snd_soc_component_write(component, ES8396_ALRCK_GPIO_SEL_REG15, 0xfa); in es8396_probe()
2998 snd_soc_component_write(component, ES8396_DAC_JACK_DET_COMP_REG69, 0x00); in es8396_probe()
3001 snd_soc_component_write(component, ES8396_DAC_JACK_DET_COMP_REG69, in es8396_probe()
3005 snd_soc_component_write(component, ES8396_GPIO_IRQ_REG16, in es8396_probe()
3009 snd_soc_component_write(component, ES8396_GPIO_IRQ_REG16, in es8396_probe()
3012 snd_soc_component_write(component, ES8396_GPIO_IRQ_REG16, 0x00); in es8396_probe()
3021 snd_soc_component_update_bits(component, ES8396_MN_MIXER_REF_LP_REG39, in es8396_probe()
3024 snd_soc_component_update_bits(component, ES8396_MN_MIXER_REF_LP_REG39, in es8396_probe()
3027 snd_soc_component_write(component, ES8396_DAC_JACK_DET_COMP_REG69, 0x00); in es8396_probe()
3028 snd_soc_component_write(component, ES8396_BCLK_DIV_M1_REG0E, 0x24); in es8396_probe()
3029 snd_soc_component_write(component, ES8396_LRCK_DIV_M3_REG10, 0x22); in es8396_probe()
3030 snd_soc_component_write(component, ES8396_SDP_2_MS_REG13, 0x00); in es8396_probe()
3053 snd_soc_component_write(component, 0x6f, 0x83); in es8396_probe()
3054 snd_soc_component_write(component, ES8396_SYS_VMID_REF_REG71, 0xFC); in es8396_probe()
3056 snd_soc_component_write(component, 0x4E, 0x84); in es8396_probe()
3057 snd_soc_component_write(component, 0x4F, 0x85); in es8396_probe()
3058 snd_soc_component_write(component, 0x4A, 0x60); in es8396_probe()
3059 snd_soc_component_write(component, 0x4B, 0x60); in es8396_probe()
3068 static void es8396_remove(struct snd_soc_component *component) in es8396_remove() argument
3070 snd_soc_component_write(component, 0X4E, 0x84); in es8396_remove()
3071 snd_soc_component_write(component, 0X4F, 0x85); in es8396_remove()
3072 snd_soc_component_write(component, 0X4A, 0x80); in es8396_remove()
3073 snd_soc_component_write(component, 0X4B, 0x80); in es8396_remove()
3074 snd_soc_component_write(component, 0x70, 0xd4); in es8396_remove()
3168 struct snd_soc_component *component = es8396->component; in es8396_i2c_shutdown() local
3174 snd_soc_component_write(component, 0X4E, 0x84); in es8396_i2c_shutdown()
3175 snd_soc_component_write(component, 0X4F, 0x85); in es8396_i2c_shutdown()
3176 snd_soc_component_write(component, 0X4a, 0x80); in es8396_i2c_shutdown()
3177 snd_soc_component_write(component, 0X4b, 0x80); in es8396_i2c_shutdown()
3178 snd_soc_component_write(component, 0x70, 0xd4); in es8396_i2c_shutdown()