Lines Matching refs:component
338 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in speaker_mode_get() local
341 reg = snd_soc_component_read(component, WM9081_ANALOGUE_SPEAKER_2); in speaker_mode_get()
359 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in speaker_mode_put() local
360 unsigned int reg_pwr = snd_soc_component_read(component, WM9081_POWER_MANAGEMENT); in speaker_mode_put()
361 unsigned int reg2 = snd_soc_component_read(component, WM9081_ANALOGUE_SPEAKER_2); in speaker_mode_put()
382 snd_soc_component_write(component, WM9081_ANALOGUE_SPEAKER_2, reg2); in speaker_mode_put()
545 static int wm9081_set_fll(struct snd_soc_component *component, int fll_id, in wm9081_set_fll() argument
548 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); in wm9081_set_fll()
560 dev_dbg(component->dev, "FLL disabled\n"); in wm9081_set_fll()
571 reg5 = snd_soc_component_read(component, WM9081_FLL_CONTROL_5); in wm9081_set_fll()
580 dev_err(component->dev, "Unknown FLL ID %d\n", fll_id); in wm9081_set_fll()
585 clk_sys_reg = snd_soc_component_read(component, WM9081_CLOCK_CONTROL_3); in wm9081_set_fll()
587 snd_soc_component_write(component, WM9081_CLOCK_CONTROL_3, in wm9081_set_fll()
592 reg1 = snd_soc_component_read(component, WM9081_FLL_CONTROL_1); in wm9081_set_fll()
594 snd_soc_component_write(component, WM9081_FLL_CONTROL_1, reg1); in wm9081_set_fll()
601 snd_soc_component_write(component, WM9081_FLL_CONTROL_1, reg1); in wm9081_set_fll()
603 snd_soc_component_write(component, WM9081_FLL_CONTROL_2, in wm9081_set_fll()
606 snd_soc_component_write(component, WM9081_FLL_CONTROL_3, fll_div.k); in wm9081_set_fll()
608 reg4 = snd_soc_component_read(component, WM9081_FLL_CONTROL_4); in wm9081_set_fll()
611 snd_soc_component_write(component, WM9081_FLL_CONTROL_4, reg4); in wm9081_set_fll()
615 snd_soc_component_write(component, WM9081_FLL_CONTROL_5, reg5); in wm9081_set_fll()
618 snd_soc_component_update_bits(component, WM9081_FLL_CONTROL_4, in wm9081_set_fll()
622 snd_soc_component_write(component, WM9081_FLL_CONTROL_1, reg1 | WM9081_FLL_ENA); in wm9081_set_fll()
626 snd_soc_component_write(component, WM9081_CLOCK_CONTROL_3, clk_sys_reg); in wm9081_set_fll()
628 dev_dbg(component->dev, "FLL enabled at %dHz->%dHz\n", Fref, Fout); in wm9081_set_fll()
636 static int configure_clock(struct snd_soc_component *component) in configure_clock() argument
638 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); in configure_clock()
653 wm9081_set_fll(component, WM9081_SYSCLK_FLL_MCLK, 0, 0); in configure_clock()
694 ret = wm9081_set_fll(component, WM9081_SYSCLK_FLL_MCLK, in configure_clock()
710 reg = snd_soc_component_read(component, WM9081_CLOCK_CONTROL_1); in configure_clock()
715 snd_soc_component_write(component, WM9081_CLOCK_CONTROL_1, reg); in configure_clock()
717 reg = snd_soc_component_read(component, WM9081_CLOCK_CONTROL_3); in configure_clock()
722 snd_soc_component_write(component, WM9081_CLOCK_CONTROL_3, reg); in configure_clock()
724 dev_dbg(component->dev, "CLK_SYS is %dHz\n", wm9081->sysclk_rate); in configure_clock()
732 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in clk_sys_event() local
733 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); in clk_sys_event()
738 dev_dbg(component->dev, "Using %dHz MCLK\n", wm9081->mclk_rate); in clk_sys_event()
741 dev_dbg(component->dev, "Using %dHz MCLK with FLL\n", in clk_sys_event()
745 dev_err(component->dev, "System clock not configured\n"); in clk_sys_event()
751 configure_clock(component); in clk_sys_event()
756 wm9081_set_fll(component, 0, 0, 0); in clk_sys_event()
815 static int wm9081_set_bias_level(struct snd_soc_component *component, in wm9081_set_bias_level() argument
818 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); in wm9081_set_bias_level()
826 snd_soc_component_update_bits(component, WM9081_VMID_CONTROL, in wm9081_set_bias_level()
830 snd_soc_component_update_bits(component, WM9081_BIAS_CONTROL_1, in wm9081_set_bias_level()
836 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { in wm9081_set_bias_level()
841 snd_soc_component_update_bits(component, WM9081_ANTI_POP_CONTROL, in wm9081_set_bias_level()
845 snd_soc_component_update_bits(component, WM9081_BIAS_CONTROL_1, in wm9081_set_bias_level()
850 snd_soc_component_update_bits(component, WM9081_VMID_CONTROL, in wm9081_set_bias_level()
858 snd_soc_component_update_bits(component, WM9081_VMID_CONTROL, in wm9081_set_bias_level()
862 snd_soc_component_update_bits(component, WM9081_BIAS_CONTROL_1, in wm9081_set_bias_level()
867 snd_soc_component_update_bits(component, WM9081_VMID_CONTROL, in wm9081_set_bias_level()
871 snd_soc_component_update_bits(component, WM9081_BIAS_CONTROL_1, in wm9081_set_bias_level()
878 snd_soc_component_update_bits(component, WM9081_BIAS_CONTROL_1, in wm9081_set_bias_level()
883 snd_soc_component_update_bits(component, WM9081_VMID_CONTROL, in wm9081_set_bias_level()
888 snd_soc_component_update_bits(component, WM9081_ANTI_POP_CONTROL, in wm9081_set_bias_level()
902 struct snd_soc_component *component = dai->component; in wm9081_set_dai_fmt() local
903 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); in wm9081_set_dai_fmt()
904 unsigned int aif2 = snd_soc_component_read(component, WM9081_AUDIO_INTERFACE_2); in wm9081_set_dai_fmt()
986 snd_soc_component_write(component, WM9081_AUDIO_INTERFACE_2, aif2); in wm9081_set_dai_fmt()
995 struct snd_soc_component *component = dai->component; in wm9081_hw_params() local
996 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); in wm9081_hw_params()
1000 clk_ctrl2 = snd_soc_component_read(component, WM9081_CLOCK_CONTROL_2); in wm9081_hw_params()
1003 aif1 = snd_soc_component_read(component, WM9081_AUDIO_INTERFACE_1); in wm9081_hw_params()
1005 aif2 = snd_soc_component_read(component, WM9081_AUDIO_INTERFACE_2); in wm9081_hw_params()
1008 aif3 = snd_soc_component_read(component, WM9081_AUDIO_INTERFACE_3); in wm9081_hw_params()
1011 aif4 = snd_soc_component_read(component, WM9081_AUDIO_INTERFACE_4); in wm9081_hw_params()
1047 dev_dbg(component->dev, "Target BCLK is %dHz\n", wm9081->bclk); in wm9081_hw_params()
1049 ret = configure_clock(component); in wm9081_hw_params()
1065 dev_dbg(component->dev, "Selected CLK_SYS_RATIO of %d\n", in wm9081_hw_params()
1081 dev_dbg(component->dev, "Selected SAMPLE_RATE of %dHz\n", in wm9081_hw_params()
1100 dev_dbg(component->dev, "Selected BCLK_DIV of %d for %dHz BCLK\n", in wm9081_hw_params()
1105 dev_dbg(component->dev, "LRCLK_RATE is %d\n", wm9081->bclk / wm9081->fs); in wm9081_hw_params()
1126 dev_dbg(component->dev, "ReTune Mobile %s tuned for %dHz\n", in wm9081_hw_params()
1130 eq1 = snd_soc_component_read(component, WM9081_EQ_1) & WM9081_EQ_ENA; in wm9081_hw_params()
1132 snd_soc_component_write(component, WM9081_EQ_1, 0); in wm9081_hw_params()
1136 snd_soc_component_write(component, WM9081_EQ_1 + i, s->config[i]); in wm9081_hw_params()
1139 snd_soc_component_write(component, WM9081_EQ_1, eq1); in wm9081_hw_params()
1142 snd_soc_component_write(component, WM9081_CLOCK_CONTROL_2, clk_ctrl2); in wm9081_hw_params()
1143 snd_soc_component_write(component, WM9081_AUDIO_INTERFACE_2, aif2); in wm9081_hw_params()
1144 snd_soc_component_write(component, WM9081_AUDIO_INTERFACE_3, aif3); in wm9081_hw_params()
1145 snd_soc_component_write(component, WM9081_AUDIO_INTERFACE_4, aif4); in wm9081_hw_params()
1152 struct snd_soc_component *component = codec_dai->component; in wm9081_mute() local
1155 reg = snd_soc_component_read(component, WM9081_DAC_DIGITAL_2); in wm9081_mute()
1162 snd_soc_component_write(component, WM9081_DAC_DIGITAL_2, reg); in wm9081_mute()
1167 static int wm9081_set_sysclk(struct snd_soc_component *component, int clk_id, in wm9081_set_sysclk() argument
1170 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); in wm9081_set_sysclk()
1189 struct snd_soc_component *component = dai->component; in wm9081_set_tdm_slot() local
1190 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); in wm9081_set_tdm_slot()
1191 unsigned int aif1 = snd_soc_component_read(component, WM9081_AUDIO_INTERFACE_1); in wm9081_set_tdm_slot()
1221 snd_soc_component_write(component, WM9081_AUDIO_INTERFACE_1, aif1); in wm9081_set_tdm_slot()
1255 static int wm9081_probe(struct snd_soc_component *component) in wm9081_probe() argument
1257 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); in wm9081_probe()
1260 snd_soc_component_update_bits(component, WM9081_ANALOGUE_LINEOUT, in wm9081_probe()
1262 snd_soc_component_update_bits(component, WM9081_ANALOGUE_SPEAKER_PGA, in wm9081_probe()
1266 dev_dbg(component->dev, in wm9081_probe()
1268 snd_soc_add_component_controls(component, wm9081_eq_controls, in wm9081_probe()