Lines Matching refs:component
100 static bool plls_locked(struct snd_soc_component *component) in plls_locked() argument
106 ret = snd_soc_component_read(component, R_PLLCTL0); in plls_locked()
108 dev_err(component->dev, in plls_locked()
140 static int write_coeff_ram(struct snd_soc_component *component, u8 *coeff_ram, in write_coeff_ram() argument
143 struct tscs42xx *tscs42xx = snd_soc_component_get_drvdata(component); in write_coeff_ram()
151 ret = snd_soc_component_read(component, R_DACCRSTAT); in write_coeff_ram()
153 dev_err(component->dev, in write_coeff_ram()
163 dev_err(component->dev, in write_coeff_ram()
170 dev_err(component->dev, in write_coeff_ram()
179 dev_err(component->dev, in write_coeff_ram()
188 static int power_up_audio_plls(struct snd_soc_component *component) in power_up_audio_plls() argument
190 struct tscs42xx *tscs42xx = snd_soc_component_get_drvdata(component); in power_up_audio_plls()
208 dev_err(component->dev, in power_up_audio_plls()
215 ret = snd_soc_component_update_bits(component, R_PLLCTL1C, mask, val); in power_up_audio_plls()
217 dev_err(component->dev, "Failed to turn PLL on (%d)\n", ret); in power_up_audio_plls()
221 if (!plls_locked(component)) { in power_up_audio_plls()
222 dev_err(component->dev, "Failed to lock plls\n"); in power_up_audio_plls()
234 static int power_down_audio_plls(struct snd_soc_component *component) in power_down_audio_plls() argument
236 struct tscs42xx *tscs42xx = snd_soc_component_get_drvdata(component); in power_down_audio_plls()
241 ret = snd_soc_component_update_bits(component, R_PLLCTL1C, in power_down_audio_plls()
245 dev_err(component->dev, "Failed to turn PLL off (%d)\n", ret); in power_down_audio_plls()
248 ret = snd_soc_component_update_bits(component, R_PLLCTL1C, in power_down_audio_plls()
252 dev_err(component->dev, "Failed to turn PLL off (%d)\n", ret); in power_down_audio_plls()
266 struct snd_soc_component *component = in coeff_ram_get() local
268 struct tscs42xx *tscs42xx = snd_soc_component_get_drvdata(component); in coeff_ram_get()
286 struct snd_soc_component *component = in coeff_ram_put() local
288 struct tscs42xx *tscs42xx = snd_soc_component_get_drvdata(component); in coeff_ram_put()
304 if (plls_locked(component)) { in coeff_ram_put()
305 ret = write_coeff_ram(component, tscs42xx->coeff_ram, in coeff_ram_put()
308 dev_err(component->dev, in coeff_ram_put()
370 struct snd_soc_component *component = in pll_event() local
375 ret = power_up_audio_plls(component); in pll_event()
377 ret = power_down_audio_plls(component); in pll_event()
385 struct snd_soc_component *component = in dac_event() local
387 struct tscs42xx *tscs42xx = snd_soc_component_get_drvdata(component); in dac_event()
393 ret = write_coeff_ram(component, tscs42xx->coeff_ram, 0x00, in dac_event()
813 static int setup_sample_format(struct snd_soc_component *component, in setup_sample_format() argument
834 dev_err(component->dev, "Unsupported format width (%d)\n", ret); in setup_sample_format()
837 ret = snd_soc_component_update_bits(component, in setup_sample_format()
840 dev_err(component->dev, in setup_sample_format()
848 static int setup_sample_rate(struct snd_soc_component *component, in setup_sample_rate() argument
851 struct tscs42xx *tscs42xx = snd_soc_component_get_drvdata(component); in setup_sample_rate()
897 dev_err(component->dev, "Unsupported sample rate %d\n", rate); in setup_sample_rate()
902 ret = snd_soc_component_update_bits(component, in setup_sample_rate()
905 dev_err(component->dev, in setup_sample_rate()
909 ret = snd_soc_component_update_bits(component, in setup_sample_rate()
912 dev_err(component->dev, in setup_sample_rate()
916 ret = snd_soc_component_update_bits(component, in setup_sample_rate()
919 dev_err(component->dev, in setup_sample_rate()
923 ret = snd_soc_component_update_bits(component, in setup_sample_rate()
926 dev_err(component->dev, in setup_sample_rate()
1059 static int set_pll_ctl_from_input_freq(struct snd_soc_component *component, in set_pll_ctl_from_input_freq() argument
1069 dev_err(component->dev, "No PLL input entry for %d (%d)\n", in set_pll_ctl_from_input_freq()
1075 ret = snd_soc_component_update_bits(component, in set_pll_ctl_from_input_freq()
1080 dev_err(component->dev, "Failed to set pll ctl (%d)\n", in set_pll_ctl_from_input_freq()
1093 struct snd_soc_component *component = codec_dai->component; in tscs42xx_hw_params() local
1096 ret = setup_sample_format(component, params_format(params)); in tscs42xx_hw_params()
1098 dev_err(component->dev, "Failed to setup sample format (%d)\n", in tscs42xx_hw_params()
1103 ret = setup_sample_rate(component, params_rate(params)); in tscs42xx_hw_params()
1105 dev_err(component->dev, in tscs42xx_hw_params()
1113 static inline int dac_mute(struct snd_soc_component *component) in dac_mute() argument
1117 ret = snd_soc_component_update_bits(component, in dac_mute()
1121 dev_err(component->dev, "Failed to mute DAC (%d)\n", in dac_mute()
1129 static inline int dac_unmute(struct snd_soc_component *component) in dac_unmute() argument
1133 ret = snd_soc_component_update_bits(component, in dac_unmute()
1137 dev_err(component->dev, "Failed to unmute DAC (%d)\n", in dac_unmute()
1145 static inline int adc_mute(struct snd_soc_component *component) in adc_mute() argument
1149 ret = snd_soc_component_update_bits(component, in adc_mute()
1152 dev_err(component->dev, "Failed to mute ADC (%d)\n", in adc_mute()
1160 static inline int adc_unmute(struct snd_soc_component *component) in adc_unmute() argument
1164 ret = snd_soc_component_update_bits(component, in adc_unmute()
1167 dev_err(component->dev, "Failed to unmute ADC (%d)\n", in adc_unmute()
1177 struct snd_soc_component *component = dai->component; in tscs42xx_mute_stream() local
1182 ret = dac_mute(component); in tscs42xx_mute_stream()
1184 ret = adc_mute(component); in tscs42xx_mute_stream()
1187 ret = dac_unmute(component); in tscs42xx_mute_stream()
1189 ret = adc_unmute(component); in tscs42xx_mute_stream()
1197 struct snd_soc_component *component = codec_dai->component; in tscs42xx_set_dai_fmt() local
1203 ret = snd_soc_component_update_bits(component, in tscs42xx_set_dai_fmt()
1206 dev_err(component->dev, in tscs42xx_set_dai_fmt()
1213 dev_err(component->dev, "Unsupported format (%d)\n", ret); in tscs42xx_set_dai_fmt()
1223 struct snd_soc_component *component = codec_dai->component; in tscs42xx_set_dai_bclk_ratio() local
1224 struct tscs42xx *tscs42xx = snd_soc_component_get_drvdata(component); in tscs42xx_set_dai_bclk_ratio()
1239 dev_err(component->dev, "Unsupported bclk ratio (%d)\n", ret); in tscs42xx_set_dai_bclk_ratio()
1243 ret = snd_soc_component_update_bits(component, in tscs42xx_set_dai_bclk_ratio()
1246 dev_err(component->dev, in tscs42xx_set_dai_bclk_ratio()
1250 ret = snd_soc_component_update_bits(component, in tscs42xx_set_dai_bclk_ratio()
1253 dev_err(component->dev, in tscs42xx_set_dai_bclk_ratio()
1300 static int set_sysclk(struct snd_soc_component *component) in set_sysclk() argument
1302 struct tscs42xx *tscs42xx = snd_soc_component_get_drvdata(component); in set_sysclk()
1309 ret = snd_soc_component_write(component, R_PLLREFSEL, in set_sysclk()
1313 dev_err(component->dev, in set_sysclk()
1320 ret = snd_soc_component_write(component, R_PLLREFSEL, in set_sysclk()
1324 dev_err(component->dev, in set_sysclk()
1330 dev_err(component->dev, "pll src is unsupported\n"); in set_sysclk()
1335 ret = set_pll_ctl_from_input_freq(component, freq); in set_sysclk()
1337 dev_err(component->dev, in set_sysclk()
1345 static int tscs42xx_probe(struct snd_soc_component *component) in tscs42xx_probe() argument
1347 return set_sysclk(component); in tscs42xx_probe()