Lines Matching defs:component

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