Lines Matching refs:component
466 static int _wm8993_set_fll(struct snd_soc_component *component, int fll_id, int source, in _wm8993_set_fll() argument
469 struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); in _wm8993_set_fll()
470 struct i2c_client *i2c = to_i2c_client(component->dev); in _wm8993_set_fll()
482 dev_dbg(component->dev, "FLL disabled\n"); in _wm8993_set_fll()
486 reg1 = snd_soc_component_read(component, WM8993_FLL_CONTROL_1); in _wm8993_set_fll()
488 snd_soc_component_write(component, WM8993_FLL_CONTROL_1, reg1); in _wm8993_set_fll()
497 reg5 = snd_soc_component_read(component, WM8993_FLL_CONTROL_5); in _wm8993_set_fll()
513 dev_err(component->dev, "Unknown FLL ID %d\n", fll_id); in _wm8993_set_fll()
519 reg1 = snd_soc_component_read(component, WM8993_FLL_CONTROL_1); in _wm8993_set_fll()
521 snd_soc_component_write(component, WM8993_FLL_CONTROL_1, reg1); in _wm8993_set_fll()
528 snd_soc_component_write(component, WM8993_FLL_CONTROL_1, reg1); in _wm8993_set_fll()
530 snd_soc_component_write(component, WM8993_FLL_CONTROL_2, in _wm8993_set_fll()
533 snd_soc_component_write(component, WM8993_FLL_CONTROL_3, fll_div.k); in _wm8993_set_fll()
535 reg4 = snd_soc_component_read(component, WM8993_FLL_CONTROL_4); in _wm8993_set_fll()
538 snd_soc_component_write(component, WM8993_FLL_CONTROL_4, reg4); in _wm8993_set_fll()
542 snd_soc_component_write(component, WM8993_FLL_CONTROL_5, reg5); in _wm8993_set_fll()
555 snd_soc_component_write(component, WM8993_FLL_CONTROL_1, reg1 | WM8993_FLL_ENA); in _wm8993_set_fll()
559 dev_warn(component->dev, "Timed out waiting for FLL\n"); in _wm8993_set_fll()
561 dev_dbg(component->dev, "FLL enabled at %dHz->%dHz\n", Fref, Fout); in _wm8993_set_fll()
573 return _wm8993_set_fll(dai->component, fll_id, source, Fref, Fout); in wm8993_set_fll()
576 static int configure_clock(struct snd_soc_component *component) in configure_clock() argument
578 struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); in configure_clock()
584 dev_dbg(component->dev, "Using %dHz MCLK\n", wm8993->mclk_rate); in configure_clock()
586 reg = snd_soc_component_read(component, WM8993_CLOCKING_2); in configure_clock()
595 snd_soc_component_write(component, WM8993_CLOCKING_2, reg); in configure_clock()
599 dev_dbg(component->dev, "Using %dHz FLL clock\n", in configure_clock()
602 reg = snd_soc_component_read(component, WM8993_CLOCKING_2); in configure_clock()
611 snd_soc_component_write(component, WM8993_CLOCKING_2, reg); in configure_clock()
615 dev_err(component->dev, "System clock not configured\n"); in configure_clock()
619 dev_dbg(component->dev, "CLK_SYS is %dHz\n", wm8993->sysclk_rate); in configure_clock()
809 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in clk_sys_event() local
813 return configure_clock(component); in clk_sys_event()
972 static int wm8993_set_bias_level(struct snd_soc_component *component, in wm8993_set_bias_level() argument
975 struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); in wm8993_set_bias_level()
978 wm_hubs_set_bias_level(component, level); in wm8993_set_bias_level()
984 snd_soc_component_update_bits(component, WM8993_POWER_MANAGEMENT_1, in wm8993_set_bias_level()
986 snd_soc_component_update_bits(component, WM8993_POWER_MANAGEMENT_2, in wm8993_set_bias_level()
991 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { in wm8993_set_bias_level()
1000 wm_hubs_vmid_ena(component); in wm8993_set_bias_level()
1003 snd_soc_component_update_bits(component, WM8993_ANTIPOP2, in wm8993_set_bias_level()
1017 snd_soc_component_update_bits(component, WM8993_ANTIPOP1, in wm8993_set_bias_level()
1022 snd_soc_component_update_bits(component, WM8993_POWER_MANAGEMENT_1, in wm8993_set_bias_level()
1029 snd_soc_component_update_bits(component, WM8993_ANTIPOP2, in wm8993_set_bias_level()
1035 snd_soc_component_update_bits(component, WM8993_POWER_MANAGEMENT_1, in wm8993_set_bias_level()
1038 snd_soc_component_update_bits(component, WM8993_POWER_MANAGEMENT_2, in wm8993_set_bias_level()
1043 snd_soc_component_update_bits(component, WM8993_ANTIPOP1, in wm8993_set_bias_level()
1046 snd_soc_component_update_bits(component, WM8993_POWER_MANAGEMENT_1, in wm8993_set_bias_level()
1050 snd_soc_component_update_bits(component, WM8993_ANTIPOP2, in wm8993_set_bias_level()
1070 struct snd_soc_component *component = codec_dai->component; in wm8993_set_sysclk() local
1071 struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); in wm8993_set_sysclk()
1091 struct snd_soc_component *component = dai->component; in wm8993_set_dai_fmt() local
1092 struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); in wm8993_set_dai_fmt()
1093 unsigned int aif1 = snd_soc_component_read(component, WM8993_AUDIO_INTERFACE_1); in wm8993_set_dai_fmt()
1094 unsigned int aif4 = snd_soc_component_read(component, WM8993_AUDIO_INTERFACE_4); in wm8993_set_dai_fmt()
1178 snd_soc_component_write(component, WM8993_AUDIO_INTERFACE_1, aif1); in wm8993_set_dai_fmt()
1179 snd_soc_component_write(component, WM8993_AUDIO_INTERFACE_4, aif4); in wm8993_set_dai_fmt()
1188 struct snd_soc_component *component = dai->component; in wm8993_hw_params() local
1189 struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); in wm8993_hw_params()
1193 clocking1 = snd_soc_component_read(component, WM8993_CLOCKING_1); in wm8993_hw_params()
1196 clocking3 = snd_soc_component_read(component, WM8993_CLOCKING_3); in wm8993_hw_params()
1199 aif1 = snd_soc_component_read(component, WM8993_AUDIO_INTERFACE_1); in wm8993_hw_params()
1202 aif4 = snd_soc_component_read(component, WM8993_AUDIO_INTERFACE_4); in wm8993_hw_params()
1209 dev_dbg(component->dev, "Configuring for %d %d bit TDM slots\n", in wm8993_hw_params()
1234 dev_dbg(component->dev, "Target BCLK is %dHz\n", wm8993->bclk); in wm8993_hw_params()
1236 ret = configure_clock(component); in wm8993_hw_params()
1252 dev_dbg(component->dev, "Selected CLK_SYS_RATIO of %d\n", in wm8993_hw_params()
1268 dev_dbg(component->dev, "Selected SAMPLE_RATE of %dHz\n", in wm8993_hw_params()
1287 dev_dbg(component->dev, "Selected BCLK_DIV of %d for %dHz BCLK\n", in wm8993_hw_params()
1292 dev_dbg(component->dev, "LRCLK_RATE is %d\n", wm8993->bclk / wm8993->fs); in wm8993_hw_params()
1295 snd_soc_component_write(component, WM8993_CLOCKING_1, clocking1); in wm8993_hw_params()
1296 snd_soc_component_write(component, WM8993_CLOCKING_3, clocking3); in wm8993_hw_params()
1297 snd_soc_component_write(component, WM8993_AUDIO_INTERFACE_1, aif1); in wm8993_hw_params()
1298 snd_soc_component_write(component, WM8993_AUDIO_INTERFACE_4, aif4); in wm8993_hw_params()
1302 u16 eq1 = snd_soc_component_read(component, WM8993_EQ1); in wm8993_hw_params()
1318 dev_dbg(component->dev, "ReTune Mobile %s tuned for %dHz\n", in wm8993_hw_params()
1322 snd_soc_component_update_bits(component, WM8993_EQ1, WM8993_EQ_ENA, 0); in wm8993_hw_params()
1325 snd_soc_component_write(component, WM8993_EQ1 + i, s->config[i]); in wm8993_hw_params()
1327 snd_soc_component_update_bits(component, WM8993_EQ1, WM8993_EQ_ENA, eq1); in wm8993_hw_params()
1335 struct snd_soc_component *component = codec_dai->component; in wm8993_mute() local
1338 reg = snd_soc_component_read(component, WM8993_DAC_CTRL); in wm8993_mute()
1345 snd_soc_component_write(component, WM8993_DAC_CTRL, reg); in wm8993_mute()
1353 struct snd_soc_component *component = dai->component; in wm8993_set_tdm_slot() local
1354 struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); in wm8993_set_tdm_slot()
1396 snd_soc_component_update_bits(component, WM8993_AUDIO_INTERFACE_1, in wm8993_set_tdm_slot()
1398 snd_soc_component_update_bits(component, WM8993_AUDIO_INTERFACE_2, in wm8993_set_tdm_slot()
1482 static int wm8993_probe(struct snd_soc_component *component) in wm8993_probe() argument
1484 struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); in wm8993_probe()
1485 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8993_probe()
1493 snd_soc_component_update_bits(component, WM8993_RIGHT_DAC_DIGITAL_VOLUME, in wm8993_probe()
1495 snd_soc_component_update_bits(component, WM8993_RIGHT_ADC_DIGITAL_VOLUME, in wm8993_probe()
1500 snd_soc_component_update_bits(component, WM8993_ANALOGUE_HP_0, in wm8993_probe()
1504 snd_soc_component_update_bits(component, WM8993_CLOCKING_4, WM8993_SR_MODE, 0); in wm8993_probe()
1506 wm_hubs_handle_analogue_pdata(component, wm8993->pdata.lineout1_diff, in wm8993_probe()
1517 snd_soc_add_component_controls(component, wm8993_snd_controls, in wm8993_probe()
1520 dev_dbg(component->dev, "Using ReTune Mobile\n"); in wm8993_probe()
1522 dev_dbg(component->dev, "No ReTune Mobile, using normal EQ\n"); in wm8993_probe()
1523 snd_soc_add_component_controls(component, wm8993_eq_controls, in wm8993_probe()
1529 wm_hubs_add_analogue_controls(component); in wm8993_probe()
1532 wm_hubs_add_analogue_routes(component, wm8993->pdata.lineout1_diff, in wm8993_probe()
1546 static int wm8993_suspend(struct snd_soc_component *component) in wm8993_suspend() argument
1548 struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); in wm8993_suspend()
1554 ret = _wm8993_set_fll(component, 0, 0, 0, 0); in wm8993_suspend()
1556 dev_err(component->dev, "Failed to stop FLL\n"); in wm8993_suspend()
1563 snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); in wm8993_suspend()
1568 static int wm8993_resume(struct snd_soc_component *component) in wm8993_resume() argument
1570 struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); in wm8993_resume()
1573 snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); in wm8993_resume()
1583 ret = _wm8993_set_fll(component, 0, wm8993->fll_src, in wm8993_resume()
1586 dev_err(component->dev, "Failed to restart FLL\n"); in wm8993_resume()