Lines Matching refs:component

319 static int wm8904_configure_clocking(struct snd_soc_component *component)  in wm8904_configure_clocking()  argument
321 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_configure_clocking()
325 clock2 = snd_soc_component_read32(component, WM8904_CLOCK_RATES_2); in wm8904_configure_clocking()
326 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_2, in wm8904_configure_clocking()
332 dev_dbg(component->dev, "Using %dHz MCLK\n", wm8904->mclk_rate); in wm8904_configure_clocking()
338 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in wm8904_configure_clocking()
343 dev_dbg(component->dev, "Using %dHz FLL clock\n", in wm8904_configure_clocking()
351 dev_err(component->dev, "System clock not configured\n"); in wm8904_configure_clocking()
364 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_0, WM8904_MCLK_DIV, in wm8904_configure_clocking()
367 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_2, in wm8904_configure_clocking()
370 dev_dbg(component->dev, "CLK_SYS is %dHz\n", wm8904->sysclk_rate); in wm8904_configure_clocking()
375 static void wm8904_set_drc(struct snd_soc_component *component) in wm8904_set_drc() argument
377 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_set_drc()
382 save = snd_soc_component_read32(component, WM8904_DRC_0); in wm8904_set_drc()
385 snd_soc_component_update_bits(component, WM8904_DRC_0 + i, 0xffff, in wm8904_set_drc()
389 snd_soc_component_update_bits(component, WM8904_DRC_0, in wm8904_set_drc()
396 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8904_put_drc_enum() local
397 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_put_drc_enum()
406 wm8904_set_drc(component); in wm8904_put_drc_enum()
414 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8904_get_drc_enum() local
415 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_get_drc_enum()
422 static void wm8904_set_retune_mobile(struct snd_soc_component *component) in wm8904_set_retune_mobile() argument
424 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_set_retune_mobile()
447 dev_dbg(component->dev, "ReTune Mobile %s/%dHz for %dHz sample rate\n", in wm8904_set_retune_mobile()
455 save = snd_soc_component_read32(component, WM8904_EQ1); in wm8904_set_retune_mobile()
458 snd_soc_component_update_bits(component, WM8904_EQ1 + i, 0xffff, in wm8904_set_retune_mobile()
461 snd_soc_component_update_bits(component, WM8904_EQ1, WM8904_EQ_ENA, save); in wm8904_set_retune_mobile()
467 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8904_put_retune_mobile_enum() local
468 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_put_retune_mobile_enum()
477 wm8904_set_retune_mobile(component); in wm8904_put_retune_mobile_enum()
485 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8904_get_retune_mobile_enum() local
486 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_get_retune_mobile_enum()
495 static int wm8904_set_deemph(struct snd_soc_component *component) in wm8904_set_deemph() argument
497 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_set_deemph()
516 dev_dbg(component->dev, "Set deemphasis %d\n", val); in wm8904_set_deemph()
518 return snd_soc_component_update_bits(component, WM8904_DAC_DIGITAL_1, in wm8904_set_deemph()
525 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8904_get_deemph() local
526 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_get_deemph()
535 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8904_put_deemph() local
536 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_put_deemph()
544 return wm8904_set_deemph(component); in wm8904_put_deemph()
575 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8904_adc_osr_put() local
588 snd_soc_component_update_bits(component, WM8904_ADC_TEST_0, in wm8904_adc_osr_put()
676 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in sysclk_event() local
677 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in sysclk_event()
688 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in sysclk_event()
692 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in sysclk_event()
703 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in sysclk_event()
714 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in out_pga_event() local
715 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in out_pga_event()
754 snd_soc_component_update_bits(component, pwr_reg, in out_pga_event()
759 snd_soc_component_update_bits(component, reg, in out_pga_event()
765 snd_soc_component_update_bits(component, reg, in out_pga_event()
770 snd_soc_component_update_bits(component, WM8904_DC_SERVO_0, in out_pga_event()
777 dev_dbg(component->dev, "Restoring DC servo state\n"); in out_pga_event()
779 snd_soc_component_write(component, dcs_l_reg, in out_pga_event()
781 snd_soc_component_write(component, dcs_r_reg, in out_pga_event()
784 snd_soc_component_write(component, WM8904_DC_SERVO_1, dcs_mask); in out_pga_event()
788 dev_dbg(component->dev, "Calibrating DC servo\n"); in out_pga_event()
790 snd_soc_component_write(component, WM8904_DC_SERVO_1, in out_pga_event()
799 val = snd_soc_component_read32(component, WM8904_DC_SERVO_READBACK_0); in out_pga_event()
807 dev_warn(component->dev, "DC servo timed out\n"); in out_pga_event()
809 dev_dbg(component->dev, "DC servo ready\n"); in out_pga_event()
812 snd_soc_component_update_bits(component, reg, in out_pga_event()
819 snd_soc_component_update_bits(component, reg, in out_pga_event()
829 snd_soc_component_update_bits(component, reg, in out_pga_event()
837 wm8904->dcs_state[dcs_l] = snd_soc_component_read32(component, dcs_l_reg); in out_pga_event()
838 wm8904->dcs_state[dcs_r] = snd_soc_component_read32(component, dcs_r_reg); in out_pga_event()
840 snd_soc_component_update_bits(component, WM8904_DC_SERVO_0, in out_pga_event()
844 snd_soc_component_update_bits(component, reg, in out_pga_event()
851 snd_soc_component_update_bits(component, pwr_reg, in out_pga_event()
1168 static int wm8904_add_widgets(struct snd_soc_component *component) in wm8904_add_widgets() argument
1170 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_add_widgets()
1171 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8904_add_widgets()
1180 snd_soc_add_component_controls(component, wm8904_adc_snd_controls, in wm8904_add_widgets()
1182 snd_soc_add_component_controls(component, wm8904_dac_snd_controls, in wm8904_add_widgets()
1184 snd_soc_add_component_controls(component, wm8904_snd_controls, in wm8904_add_widgets()
1203 snd_soc_add_component_controls(component, wm8904_dac_snd_controls, in wm8904_add_widgets()
1281 struct snd_soc_component *component = dai->component; in wm8904_hw_params() local
1282 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_hw_params()
1293 dev_dbg(component->dev, "Configuring for %d %d bit TDM slots\n", in wm8904_hw_params()
1319 dev_dbg(component->dev, "Target BCLK is %dHz\n", wm8904->bclk); in wm8904_hw_params()
1321 ret = wm8904_configure_clocking(component); in wm8904_hw_params()
1337 dev_dbg(component->dev, "Selected CLK_SYS_RATIO of %d\n", in wm8904_hw_params()
1353 dev_dbg(component->dev, "Selected SAMPLE_RATE of %dHz\n", in wm8904_hw_params()
1376 dev_dbg(component->dev, "Selected BCLK_DIV of %d for %dHz BCLK\n", in wm8904_hw_params()
1381 dev_dbg(component->dev, "LRCLK_RATE is %d\n", wm8904->bclk / wm8904->fs); in wm8904_hw_params()
1385 snd_soc_component_update_bits(component, WM8904_DAC_DIGITAL_1, in wm8904_hw_params()
1387 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_1, in wm8904_hw_params()
1389 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_2, in wm8904_hw_params()
1391 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_3, in wm8904_hw_params()
1393 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_1, in wm8904_hw_params()
1398 wm8904_set_retune_mobile(component); in wm8904_hw_params()
1399 wm8904_set_deemph(component); in wm8904_hw_params()
1408 struct snd_soc_component *component = dai->component; in wm8904_set_sysclk() local
1409 struct wm8904_priv *priv = snd_soc_component_get_drvdata(component); in wm8904_set_sysclk()
1427 wm8904_configure_clocking(component); in wm8904_set_sysclk()
1434 struct snd_soc_component *component = dai->component; in wm8904_set_fmt() local
1512 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_1, in wm8904_set_fmt()
1515 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_3, in wm8904_set_fmt()
1525 struct snd_soc_component *component = dai->component; in wm8904_set_tdm_slot() local
1526 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_set_tdm_slot()
1564 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_1, in wm8904_set_tdm_slot()
1682 struct snd_soc_component *component = dai->component; in wm8904_set_fll() local
1683 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_set_fll()
1693 clock2 = snd_soc_component_read32(component, WM8904_CLOCK_RATES_2); in wm8904_set_fll()
1696 dev_dbg(component->dev, "FLL disabled\n"); in wm8904_set_fll()
1702 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_2, in wm8904_set_fll()
1705 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in wm8904_set_fll()
1722 dev_dbg(component->dev, "Using free running FLL\n"); in wm8904_set_fll()
1732 dev_err(component->dev, "Unknown FLL ID %d\n", fll_id); in wm8904_set_fll()
1738 fll1 = snd_soc_component_read32(component, WM8904_FLL_CONTROL_1); in wm8904_set_fll()
1739 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_2, in wm8904_set_fll()
1741 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in wm8904_set_fll()
1745 snd_soc_component_update_bits(component, WM8904_CONTROL_INTERFACE_TEST_1, in wm8904_set_fll()
1754 snd_soc_component_update_bits(component, WM8904_FLL_NCO_TEST_1, WM8904_FLL_FRC_NCO, in wm8904_set_fll()
1756 snd_soc_component_update_bits(component, WM8904_CONTROL_INTERFACE_TEST_1, in wm8904_set_fll()
1761 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_5, in wm8904_set_fll()
1766 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_5, in wm8904_set_fll()
1771 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_5, in wm8904_set_fll()
1780 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in wm8904_set_fll()
1783 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_2, in wm8904_set_fll()
1788 snd_soc_component_write(component, WM8904_FLL_CONTROL_3, fll_div.k); in wm8904_set_fll()
1790 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_4, WM8904_FLL_N_MASK, in wm8904_set_fll()
1793 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_5, in wm8904_set_fll()
1798 dev_dbg(component->dev, "FLL configured for %dHz->%dHz\n", Fref, Fout); in wm8904_set_fll()
1805 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in wm8904_set_fll()
1807 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in wm8904_set_fll()
1812 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_2, in wm8904_set_fll()
1820 struct snd_soc_component *component = codec_dai->component; in wm8904_digital_mute() local
1828 snd_soc_component_update_bits(component, WM8904_DAC_DIGITAL_1, WM8904_DAC_MUTE, val); in wm8904_digital_mute()
1833 static int wm8904_set_bias_level(struct snd_soc_component *component, in wm8904_set_bias_level() argument
1836 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_set_bias_level()
1848 snd_soc_component_update_bits(component, WM8904_VMID_CONTROL_0, in wm8904_set_bias_level()
1853 snd_soc_component_update_bits(component, WM8904_BIAS_CONTROL_0, in wm8904_set_bias_level()
1858 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { in wm8904_set_bias_level()
1862 dev_err(component->dev, in wm8904_set_bias_level()
1872 snd_soc_component_update_bits(component, WM8904_BIAS_CONTROL_0, in wm8904_set_bias_level()
1876 snd_soc_component_update_bits(component, WM8904_VMID_CONTROL_0, in wm8904_set_bias_level()
1887 snd_soc_component_update_bits(component, WM8904_VMID_CONTROL_0, in wm8904_set_bias_level()
1892 snd_soc_component_update_bits(component, WM8904_BIAS_CONTROL_0, in wm8904_set_bias_level()
1898 snd_soc_component_update_bits(component, WM8904_VMID_CONTROL_0, in wm8904_set_bias_level()
1902 snd_soc_component_update_bits(component, WM8904_BIAS_CONTROL_0, in wm8904_set_bias_level()
1950 static void wm8904_handle_retune_mobile_pdata(struct snd_soc_component *component) in wm8904_handle_retune_mobile_pdata() argument
1952 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_handle_retune_mobile_pdata()
1995 dev_dbg(component->dev, "Allocated %d unique ReTune Mobile names\n", in wm8904_handle_retune_mobile_pdata()
2001 ret = snd_soc_add_component_controls(component, &control, 1); in wm8904_handle_retune_mobile_pdata()
2003 dev_err(component->dev, in wm8904_handle_retune_mobile_pdata()
2007 static void wm8904_handle_pdata(struct snd_soc_component *component) in wm8904_handle_pdata() argument
2009 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_handle_pdata()
2014 snd_soc_add_component_controls(component, wm8904_eq_controls, in wm8904_handle_pdata()
2019 dev_dbg(component->dev, "%d DRC configurations\n", pdata->num_drc_cfgs); in wm8904_handle_pdata()
2039 ret = snd_soc_add_component_controls(component, &control, 1); in wm8904_handle_pdata()
2041 dev_err(component->dev, in wm8904_handle_pdata()
2044 wm8904_set_drc(component); in wm8904_handle_pdata()
2047 dev_dbg(component->dev, "%d ReTune Mobile configurations\n", in wm8904_handle_pdata()
2051 wm8904_handle_retune_mobile_pdata(component); in wm8904_handle_pdata()
2053 snd_soc_add_component_controls(component, wm8904_eq_controls, in wm8904_handle_pdata()
2058 static int wm8904_probe(struct snd_soc_component *component) in wm8904_probe() argument
2060 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_probe()
2069 dev_err(component->dev, "Unknown device type %d\n", in wm8904_probe()
2074 wm8904_handle_pdata(component); in wm8904_probe()
2076 wm8904_add_widgets(component); in wm8904_probe()
2081 static void wm8904_remove(struct snd_soc_component *component) in wm8904_remove() argument
2083 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_remove()