Lines Matching refs:component
439 struct snd_soc_component *component; member
470 static int rt5645_reset(struct snd_soc_component *component) in rt5645_reset() argument
472 return snd_soc_component_write(component, RT5645_RESET, 0); in rt5645_reset()
703 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); in rt5645_hweq_get() local
704 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in rt5645_hweq_get()
729 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); in rt5645_hweq_put() local
730 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in rt5645_hweq_put()
771 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); in rt5645_spk_put_volsw() local
772 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in rt5645_spk_put_volsw()
876 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in set_dmic_clk() local
877 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in set_dmic_clk()
884 dev_err(component->dev, "Failed to set DMIC clock\n"); in set_dmic_clk()
886 snd_soc_component_update_bits(component, RT5645_DMIC_CTRL1, in set_dmic_clk()
894 struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); in is_sys_clk_from_pll() local
897 val = snd_soc_component_read(component, RT5645_GLB_CLK); in is_sys_clk_from_pll()
908 struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); in is_using_asrc() local
940 val = (snd_soc_component_read(component, reg) >> shift) & 0xf; in is_using_asrc()
953 static int rt5645_enable_hweq(struct snd_soc_component *component) in rt5645_enable_hweq() argument
955 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in rt5645_enable_hweq()
983 int rt5645_sel_asrc_clk_src(struct snd_soc_component *component, in rt5645_sel_asrc_clk_src() argument
1039 snd_soc_component_update_bits(component, RT5645_ASRC_2, in rt5645_sel_asrc_clk_src()
1043 snd_soc_component_update_bits(component, RT5645_ASRC_3, in rt5645_sel_asrc_clk_src()
1672 static void hp_amp_power(struct snd_soc_component *component, int on) in hp_amp_power() argument
1675 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in hp_amp_power()
1681 snd_soc_component_write(component, RT5645_DEPOP_M2, 0x3100); in hp_amp_power()
1682 snd_soc_component_write(component, RT5645_CHARGE_PUMP, in hp_amp_power()
1684 snd_soc_component_write(component, RT5645_DEPOP_M1, 0x000d); in hp_amp_power()
1694 snd_soc_component_update_bits(component, RT5645_DEPOP_M1, in hp_amp_power()
1698 snd_soc_component_write(component, RT5645_DEPOP_M3, 0x0737); in hp_amp_power()
1701 snd_soc_component_write(component, RT5645_DEPOP_M2, 0x1140); in hp_amp_power()
1702 snd_soc_component_update_bits(component, RT5645_PWR_ANLG1, in hp_amp_power()
1708 snd_soc_component_update_bits(component, RT5645_DEPOP_M2, in hp_amp_power()
1710 snd_soc_component_write(component, RT5645_DEPOP_M1, 0x000d); in hp_amp_power()
1715 snd_soc_component_update_bits(component, RT5645_PWR_ANLG1, in hp_amp_power()
1717 snd_soc_component_update_bits(component, RT5645_PWR_VOL, in hp_amp_power()
1720 snd_soc_component_update_bits(component, RT5645_PWR_ANLG1, in hp_amp_power()
1726 snd_soc_component_update_bits(component, RT5645_PWR_ANLG1, in hp_amp_power()
1730 snd_soc_component_update_bits(component, RT5645_DEPOP_M1, in hp_amp_power()
1746 snd_soc_component_write(component, RT5645_DEPOP_M3, 0x0737); in hp_amp_power()
1749 snd_soc_component_write(component, RT5645_DEPOP_M2, 0x1140); in hp_amp_power()
1751 snd_soc_component_write(component, RT5645_DEPOP_M1, 0x0001); in hp_amp_power()
1752 snd_soc_component_update_bits(component, RT5645_PWR_ANLG1, in hp_amp_power()
1755 snd_soc_component_update_bits(component, RT5645_DEPOP_M1, in hp_amp_power()
1763 snd_soc_component_write(component, RT5645_DEPOP_M1, 0x0000); in hp_amp_power()
1764 snd_soc_component_update_bits(component, RT5645_PWR_ANLG1, in hp_amp_power()
1767 snd_soc_component_update_bits(component, RT5645_DEPOP_M2, in hp_amp_power()
1777 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in rt5645_hp_event() local
1778 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in rt5645_hp_event()
1782 hp_amp_power(component, 1); in rt5645_hp_event()
1785 snd_soc_component_update_bits(component, RT5645_DEPOP_M3, in rt5645_hp_event()
1793 snd_soc_component_update_bits(component, RT5645_DEPOP_M1, in rt5645_hp_event()
1795 snd_soc_component_update_bits(component, RT5645_DEPOP_M1, in rt5645_hp_event()
1797 snd_soc_component_update_bits(component, RT5645_DEPOP_M1, in rt5645_hp_event()
1802 snd_soc_component_update_bits(component, RT5645_DEPOP_M1, in rt5645_hp_event()
1812 snd_soc_component_update_bits(component, RT5645_DEPOP_M3, in rt5645_hp_event()
1820 snd_soc_component_update_bits(component, RT5645_DEPOP_M1, in rt5645_hp_event()
1822 snd_soc_component_update_bits(component, RT5645_DEPOP_M1, in rt5645_hp_event()
1824 snd_soc_component_update_bits(component, RT5645_DEPOP_M1, in rt5645_hp_event()
1830 hp_amp_power(component, 0); in rt5645_hp_event()
1843 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in rt5645_spk_event() local
1847 rt5645_enable_hweq(component); in rt5645_spk_event()
1848 snd_soc_component_update_bits(component, RT5645_PWR_DIG1, in rt5645_spk_event()
1853 snd_soc_component_update_bits(component, RT5645_GEN_CTRL3, in rt5645_spk_event()
1858 snd_soc_component_update_bits(component, RT5645_GEN_CTRL3, in rt5645_spk_event()
1860 snd_soc_component_write(component, RT5645_EQ_CTRL2, 0); in rt5645_spk_event()
1861 snd_soc_component_update_bits(component, RT5645_PWR_DIG1, in rt5645_spk_event()
1876 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in rt5645_lout_event() local
1880 hp_amp_power(component, 1); in rt5645_lout_event()
1881 snd_soc_component_update_bits(component, RT5645_PWR_ANLG1, in rt5645_lout_event()
1883 snd_soc_component_update_bits(component, RT5645_LOUT1, in rt5645_lout_event()
1888 snd_soc_component_update_bits(component, RT5645_LOUT1, in rt5645_lout_event()
1891 snd_soc_component_update_bits(component, RT5645_PWR_ANLG1, in rt5645_lout_event()
1893 hp_amp_power(component, 0); in rt5645_lout_event()
1906 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in rt5645_bst2_event() local
1910 snd_soc_component_update_bits(component, RT5645_PWR_ANLG2, in rt5645_bst2_event()
1915 snd_soc_component_update_bits(component, RT5645_PWR_ANLG2, in rt5645_bst2_event()
1929 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in rt5645_set_micbias1_event() local
1933 snd_soc_component_update_bits(component, RT5645_GEN_CTRL2, in rt5645_set_micbias1_event()
1939 snd_soc_component_update_bits(component, RT5645_GEN_CTRL2, in rt5645_set_micbias1_event()
1954 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in rt5645_set_micbias2_event() local
1958 snd_soc_component_update_bits(component, RT5645_GEN_CTRL2, in rt5645_set_micbias2_event()
1964 snd_soc_component_update_bits(component, RT5645_GEN_CTRL2, in rt5645_set_micbias2_event()
2750 struct snd_soc_component *component = dai->component; in rt5645_hw_params() local
2751 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in rt5645_hw_params()
2758 dev_err(component->dev, "Unsupported clock setting\n"); in rt5645_hw_params()
2763 dev_err(component->dev, "Unsupported frame size: %d\n", frame_size); in rt5645_hw_params()
2804 snd_soc_component_update_bits(component, RT5645_I2S1_SDP, in rt5645_hw_params()
2806 snd_soc_component_update_bits(component, RT5645_ADDA_CLK1, mask_clk, val_clk); in rt5645_hw_params()
2812 snd_soc_component_update_bits(component, RT5645_I2S2_SDP, in rt5645_hw_params()
2814 snd_soc_component_update_bits(component, RT5645_ADDA_CLK1, mask_clk, val_clk); in rt5645_hw_params()
2817 dev_err(component->dev, "Invalid dai->id: %d\n", dai->id); in rt5645_hw_params()
2826 struct snd_soc_component *component = dai->component; in rt5645_set_dai_fmt() local
2827 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in rt5645_set_dai_fmt()
2878 snd_soc_component_update_bits(component, RT5645_I2S1_SDP, in rt5645_set_dai_fmt()
2883 snd_soc_component_update_bits(component, RT5645_I2S2_SDP, in rt5645_set_dai_fmt()
2888 dev_err(component->dev, "Invalid dai->id: %d\n", dai->id); in rt5645_set_dai_fmt()
2897 struct snd_soc_component *component = dai->component; in rt5645_set_dai_sysclk() local
2898 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in rt5645_set_dai_sysclk()
2915 dev_err(component->dev, "Invalid clock id (%d)\n", clk_id); in rt5645_set_dai_sysclk()
2918 snd_soc_component_update_bits(component, RT5645_GLB_CLK, in rt5645_set_dai_sysclk()
2931 struct snd_soc_component *component = dai->component; in rt5645_set_dai_pll() local
2932 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in rt5645_set_dai_pll()
2941 dev_dbg(component->dev, "PLL disabled\n"); in rt5645_set_dai_pll()
2945 snd_soc_component_update_bits(component, RT5645_GLB_CLK, in rt5645_set_dai_pll()
2952 snd_soc_component_update_bits(component, RT5645_GLB_CLK, in rt5645_set_dai_pll()
2959 snd_soc_component_update_bits(component, RT5645_GLB_CLK, in rt5645_set_dai_pll()
2963 snd_soc_component_update_bits(component, RT5645_GLB_CLK, in rt5645_set_dai_pll()
2967 dev_err(component->dev, "Invalid dai->id: %d\n", dai->id); in rt5645_set_dai_pll()
2972 dev_err(component->dev, "Unknown PLL source %d\n", source); in rt5645_set_dai_pll()
2978 dev_err(component->dev, "Unsupported input clock %d\n", freq_in); in rt5645_set_dai_pll()
2982 dev_dbg(component->dev, "bypass=%d m=%d n=%d k=%d\n", in rt5645_set_dai_pll()
2986 snd_soc_component_write(component, RT5645_PLL_CTRL1, in rt5645_set_dai_pll()
2988 snd_soc_component_write(component, RT5645_PLL_CTRL2, in rt5645_set_dai_pll()
3002 struct snd_soc_component *component = dai->component; in rt5645_set_tdm_slot() local
3003 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in rt5645_set_tdm_slot()
3026 snd_soc_component_update_bits(component, RT5645_BASS_BACK, in rt5645_set_tdm_slot()
3060 snd_soc_component_update_bits(component, RT5645_TDM_CTRL_1, mask, val); in rt5645_set_tdm_slot()
3065 static int rt5645_set_bias_level(struct snd_soc_component *component, in rt5645_set_bias_level() argument
3068 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in rt5645_set_bias_level()
3072 if (SND_SOC_BIAS_STANDBY == snd_soc_component_get_bias_level(component)) { in rt5645_set_bias_level()
3073 snd_soc_component_update_bits(component, RT5645_PWR_ANLG1, in rt5645_set_bias_level()
3079 snd_soc_component_update_bits(component, RT5645_PWR_ANLG1, in rt5645_set_bias_level()
3082 snd_soc_component_update_bits(component, RT5645_GEN_CTRL1, in rt5645_set_bias_level()
3088 snd_soc_component_update_bits(component, RT5645_PWR_ANLG1, in rt5645_set_bias_level()
3094 snd_soc_component_update_bits(component, RT5645_PWR_ANLG1, in rt5645_set_bias_level()
3097 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { in rt5645_set_bias_level()
3098 snd_soc_component_write(component, RT5645_DEPOP_M2, 0x1140); in rt5645_set_bias_level()
3108 snd_soc_component_write(component, RT5645_DEPOP_M2, 0x1100); in rt5645_set_bias_level()
3110 snd_soc_component_update_bits(component, RT5645_GEN_CTRL1, in rt5645_set_bias_level()
3112 snd_soc_component_update_bits(component, RT5645_PWR_ANLG1, in rt5645_set_bias_level()
3125 static void rt5645_enable_push_button_irq(struct snd_soc_component *component, in rt5645_enable_push_button_irq() argument
3128 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in rt5645_enable_push_button_irq()
3135 snd_soc_component_update_bits(component, RT5650_4BTN_IL_CMD1, 0x3, 0x3); in rt5645_enable_push_button_irq()
3136 snd_soc_component_update_bits(component, in rt5645_enable_push_button_irq()
3138 snd_soc_component_update_bits(component, in rt5645_enable_push_button_irq()
3140 snd_soc_component_read(component, RT5650_4BTN_IL_CMD1); in rt5645_enable_push_button_irq()
3142 snd_soc_component_read(component, RT5650_4BTN_IL_CMD1)); in rt5645_enable_push_button_irq()
3144 snd_soc_component_update_bits(component, RT5650_4BTN_IL_CMD2, 0x8000, 0x0); in rt5645_enable_push_button_irq()
3145 snd_soc_component_update_bits(component, RT5645_INT_IRQ_ST, 0x8, 0x0); in rt5645_enable_push_button_irq()
3153 static int rt5645_jack_detect(struct snd_soc_component *component, int jack_insert) in rt5645_jack_detect() argument
3155 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in rt5645_jack_detect()
3156 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in rt5645_jack_detect()
3193 dev_dbg(component->dev, "val = %d\n", val); in rt5645_jack_detect()
3198 rt5645_enable_push_button_irq(component, true); in rt5645_jack_detect()
3202 rt5645_enable_push_button_irq(component, false); in rt5645_jack_detect()
3226 rt5645_enable_push_button_irq(component, false); in rt5645_jack_detect()
3243 static int rt5645_button_detect(struct snd_soc_component *component) in rt5645_button_detect() argument
3247 val = snd_soc_component_read(component, RT5650_4BTN_IL_CMD1); in rt5645_button_detect()
3250 snd_soc_component_write(component, RT5650_4BTN_IL_CMD1, val); in rt5645_button_detect()
3257 int rt5645_set_jack_detect(struct snd_soc_component *component, in rt5645_set_jack_detect() argument
3261 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in rt5645_set_jack_detect()
3281 static int rt5645_component_set_jack(struct snd_soc_component *component, in rt5645_component_set_jack() argument
3298 return rt5645_set_jack_detect(component, hs_jack, mic_jack, btn_jack); in rt5645_component_set_jack()
3307 if (!rt5645->component) in rt5645_jack_detect_work()
3318 dev_dbg(rt5645->component->dev, "gpio_state = %d\n", in rt5645_jack_detect_work()
3320 report = rt5645_jack_detect(rt5645->component, gpio_state); in rt5645_jack_detect_work()
3329 val = snd_soc_component_read(rt5645->component, RT5645_A_JD_CTRL1) & 0x0020; in rt5645_jack_detect_work()
3332 val = snd_soc_component_read(rt5645->component, RT5645_INT_IRQ_ST) & 0x1000; in rt5645_jack_detect_work()
3338 report = rt5645_jack_detect(rt5645->component, 1); in rt5645_jack_detect_work()
3342 if (snd_soc_component_read(rt5645->component, RT5645_INT_IRQ_ST) & 0x4) { in rt5645_jack_detect_work()
3345 btn_type = rt5645_button_detect(rt5645->component); in rt5645_jack_detect_work()
3375 dev_err(rt5645->component->dev, in rt5645_jack_detect_work()
3390 snd_soc_component_update_bits(rt5645->component, in rt5645_jack_detect_work()
3392 rt5645_jack_detect(rt5645->component, 0); in rt5645_jack_detect_work()
3432 static int rt5645_probe(struct snd_soc_component *component) in rt5645_probe() argument
3434 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in rt5645_probe()
3435 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in rt5645_probe()
3437 rt5645->component = component; in rt5645_probe()
3463 snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); in rt5645_probe()
3473 component->card->long_name = rt5645->pdata.long_name; in rt5645_probe()
3475 rt5645->eq_param = devm_kcalloc(component->dev, in rt5645_probe()
3485 static void rt5645_remove(struct snd_soc_component *component) in rt5645_remove() argument
3487 rt5645_reset(component); in rt5645_remove()
3491 static int rt5645_suspend(struct snd_soc_component *component) in rt5645_suspend() argument
3493 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in rt5645_suspend()
3501 static int rt5645_resume(struct snd_soc_component *component) in rt5645_resume() argument
3503 struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component); in rt5645_resume()