Lines Matching refs:component

314 static int wm8904_configure_clocking(struct snd_soc_component *component)  in wm8904_configure_clocking()  argument
316 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_configure_clocking()
320 clock2 = snd_soc_component_read(component, WM8904_CLOCK_RATES_2); in wm8904_configure_clocking()
321 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_2, in wm8904_configure_clocking()
327 dev_dbg(component->dev, "Using %dHz MCLK\n", wm8904->mclk_rate); in wm8904_configure_clocking()
333 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in wm8904_configure_clocking()
338 dev_dbg(component->dev, "Using %dHz FLL clock\n", in wm8904_configure_clocking()
346 dev_err(component->dev, "System clock not configured\n"); in wm8904_configure_clocking()
359 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_0, WM8904_MCLK_DIV, in wm8904_configure_clocking()
362 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_2, in wm8904_configure_clocking()
365 dev_dbg(component->dev, "CLK_SYS is %dHz\n", wm8904->sysclk_rate); in wm8904_configure_clocking()
370 static void wm8904_set_drc(struct snd_soc_component *component) in wm8904_set_drc() argument
372 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_set_drc()
377 save = snd_soc_component_read(component, WM8904_DRC_0); in wm8904_set_drc()
380 snd_soc_component_update_bits(component, WM8904_DRC_0 + i, 0xffff, in wm8904_set_drc()
384 snd_soc_component_update_bits(component, WM8904_DRC_0, in wm8904_set_drc()
391 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8904_put_drc_enum() local
392 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_put_drc_enum()
401 wm8904_set_drc(component); in wm8904_put_drc_enum()
409 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8904_get_drc_enum() local
410 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_get_drc_enum()
417 static void wm8904_set_retune_mobile(struct snd_soc_component *component) in wm8904_set_retune_mobile() argument
419 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_set_retune_mobile()
442 dev_dbg(component->dev, "ReTune Mobile %s/%dHz for %dHz sample rate\n", in wm8904_set_retune_mobile()
450 save = snd_soc_component_read(component, WM8904_EQ1); in wm8904_set_retune_mobile()
453 snd_soc_component_update_bits(component, WM8904_EQ1 + i, 0xffff, in wm8904_set_retune_mobile()
456 snd_soc_component_update_bits(component, WM8904_EQ1, WM8904_EQ_ENA, save); in wm8904_set_retune_mobile()
462 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8904_put_retune_mobile_enum() local
463 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_put_retune_mobile_enum()
472 wm8904_set_retune_mobile(component); in wm8904_put_retune_mobile_enum()
480 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8904_get_retune_mobile_enum() local
481 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_get_retune_mobile_enum()
490 static int wm8904_set_deemph(struct snd_soc_component *component) in wm8904_set_deemph() argument
492 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_set_deemph()
511 dev_dbg(component->dev, "Set deemphasis %d\n", val); in wm8904_set_deemph()
513 return snd_soc_component_update_bits(component, WM8904_DAC_DIGITAL_1, in wm8904_set_deemph()
520 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8904_get_deemph() local
521 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_get_deemph()
530 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8904_put_deemph() local
531 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_put_deemph()
539 return wm8904_set_deemph(component); in wm8904_put_deemph()
558 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8904_adc_osr_put() local
571 snd_soc_component_update_bits(component, WM8904_ADC_TEST_0, in wm8904_adc_osr_put()
656 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in sysclk_event() local
657 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in sysclk_event()
668 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in sysclk_event()
672 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in sysclk_event()
683 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in sysclk_event()
694 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in out_pga_event() local
695 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in out_pga_event()
737 snd_soc_component_update_bits(component, pwr_reg, in out_pga_event()
742 snd_soc_component_update_bits(component, reg, in out_pga_event()
748 snd_soc_component_update_bits(component, reg, in out_pga_event()
753 snd_soc_component_update_bits(component, WM8904_DC_SERVO_0, in out_pga_event()
760 dev_dbg(component->dev, "Restoring DC servo state\n"); in out_pga_event()
762 snd_soc_component_write(component, dcs_l_reg, in out_pga_event()
764 snd_soc_component_write(component, dcs_r_reg, in out_pga_event()
767 snd_soc_component_write(component, WM8904_DC_SERVO_1, dcs_mask); in out_pga_event()
771 dev_dbg(component->dev, "Calibrating DC servo\n"); in out_pga_event()
773 snd_soc_component_write(component, WM8904_DC_SERVO_1, in out_pga_event()
782 val = snd_soc_component_read(component, WM8904_DC_SERVO_READBACK_0); in out_pga_event()
790 dev_warn(component->dev, "DC servo timed out\n"); in out_pga_event()
792 dev_dbg(component->dev, "DC servo ready\n"); in out_pga_event()
795 snd_soc_component_update_bits(component, reg, in out_pga_event()
800 val = snd_soc_component_read(component, an_out_reg); in out_pga_event()
801 snd_soc_component_write(component, an_out_reg, val); in out_pga_event()
806 snd_soc_component_update_bits(component, reg, in out_pga_event()
816 snd_soc_component_update_bits(component, reg, in out_pga_event()
824 wm8904->dcs_state[dcs_l] = snd_soc_component_read(component, dcs_l_reg); in out_pga_event()
825 wm8904->dcs_state[dcs_r] = snd_soc_component_read(component, dcs_r_reg); in out_pga_event()
827 snd_soc_component_update_bits(component, WM8904_DC_SERVO_0, in out_pga_event()
831 snd_soc_component_update_bits(component, reg, in out_pga_event()
838 snd_soc_component_update_bits(component, pwr_reg, in out_pga_event()
1184 static int wm8904_add_widgets(struct snd_soc_component *component) in wm8904_add_widgets() argument
1186 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_add_widgets()
1187 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8904_add_widgets()
1196 snd_soc_add_component_controls(component, wm8904_adc_snd_controls, in wm8904_add_widgets()
1198 snd_soc_add_component_controls(component, wm8904_dac_snd_controls, in wm8904_add_widgets()
1200 snd_soc_add_component_controls(component, wm8904_snd_controls, in wm8904_add_widgets()
1219 snd_soc_add_component_controls(component, wm8904_dac_snd_controls, in wm8904_add_widgets()
1297 struct snd_soc_component *component = dai->component; in wm8904_hw_params() local
1298 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_hw_params()
1309 dev_dbg(component->dev, "Configuring for %d %d bit TDM slots\n", in wm8904_hw_params()
1335 dev_dbg(component->dev, "Target BCLK is %dHz\n", wm8904->bclk); in wm8904_hw_params()
1337 ret = wm8904_configure_clocking(component); in wm8904_hw_params()
1353 dev_dbg(component->dev, "Selected CLK_SYS_RATIO of %d\n", in wm8904_hw_params()
1369 dev_dbg(component->dev, "Selected SAMPLE_RATE of %dHz\n", in wm8904_hw_params()
1392 dev_dbg(component->dev, "Selected BCLK_DIV of %d for %dHz BCLK\n", in wm8904_hw_params()
1397 dev_dbg(component->dev, "LRCLK_RATE is %d\n", wm8904->bclk / wm8904->fs); in wm8904_hw_params()
1401 snd_soc_component_update_bits(component, WM8904_DAC_DIGITAL_1, in wm8904_hw_params()
1403 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_1, in wm8904_hw_params()
1405 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_2, in wm8904_hw_params()
1407 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_3, in wm8904_hw_params()
1409 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_1, in wm8904_hw_params()
1414 wm8904_set_retune_mobile(component); in wm8904_hw_params()
1415 wm8904_set_deemph(component); in wm8904_hw_params()
1422 struct snd_soc_component *component = dai->component; in wm8904_set_fmt() local
1500 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_1, in wm8904_set_fmt()
1503 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_3, in wm8904_set_fmt()
1513 struct snd_soc_component *component = dai->component; in wm8904_set_tdm_slot() local
1514 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_set_tdm_slot()
1552 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_1, in wm8904_set_tdm_slot()
1670 struct snd_soc_component *component = dai->component; in wm8904_set_fll() local
1671 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_set_fll()
1681 clock2 = snd_soc_component_read(component, WM8904_CLOCK_RATES_2); in wm8904_set_fll()
1684 dev_dbg(component->dev, "FLL disabled\n"); in wm8904_set_fll()
1690 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_2, in wm8904_set_fll()
1693 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in wm8904_set_fll()
1710 dev_dbg(component->dev, "Using free running FLL\n"); in wm8904_set_fll()
1720 dev_err(component->dev, "Unknown FLL ID %d\n", fll_id); in wm8904_set_fll()
1726 fll1 = snd_soc_component_read(component, WM8904_FLL_CONTROL_1); in wm8904_set_fll()
1727 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_2, in wm8904_set_fll()
1729 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in wm8904_set_fll()
1733 snd_soc_component_update_bits(component, WM8904_CONTROL_INTERFACE_TEST_1, in wm8904_set_fll()
1742 snd_soc_component_update_bits(component, WM8904_FLL_NCO_TEST_1, WM8904_FLL_FRC_NCO, in wm8904_set_fll()
1744 snd_soc_component_update_bits(component, WM8904_CONTROL_INTERFACE_TEST_1, in wm8904_set_fll()
1749 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_5, in wm8904_set_fll()
1754 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_5, in wm8904_set_fll()
1759 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_5, in wm8904_set_fll()
1768 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in wm8904_set_fll()
1771 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_2, in wm8904_set_fll()
1776 snd_soc_component_write(component, WM8904_FLL_CONTROL_3, fll_div.k); in wm8904_set_fll()
1778 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_4, WM8904_FLL_N_MASK, in wm8904_set_fll()
1781 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_5, in wm8904_set_fll()
1786 dev_dbg(component->dev, "FLL configured for %dHz->%dHz\n", Fref, Fout); in wm8904_set_fll()
1793 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in wm8904_set_fll()
1795 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in wm8904_set_fll()
1800 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_2, in wm8904_set_fll()
1809 struct snd_soc_component *component = dai->component; in wm8904_set_sysclk() local
1810 struct wm8904_priv *priv = snd_soc_component_get_drvdata(component); in wm8904_set_sysclk()
1851 wm8904_configure_clocking(component); in wm8904_set_sysclk()
1858 struct snd_soc_component *component = codec_dai->component; in wm8904_mute() local
1866 snd_soc_component_update_bits(component, WM8904_DAC_DIGITAL_1, WM8904_DAC_MUTE, val); in wm8904_mute()
1871 static int wm8904_set_bias_level(struct snd_soc_component *component, in wm8904_set_bias_level() argument
1874 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_set_bias_level()
1883 snd_soc_component_update_bits(component, WM8904_VMID_CONTROL_0, in wm8904_set_bias_level()
1888 snd_soc_component_update_bits(component, WM8904_BIAS_CONTROL_0, in wm8904_set_bias_level()
1893 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { in wm8904_set_bias_level()
1897 dev_err(component->dev, in wm8904_set_bias_level()
1905 dev_err(component->dev, in wm8904_set_bias_level()
1916 snd_soc_component_update_bits(component, WM8904_BIAS_CONTROL_0, in wm8904_set_bias_level()
1920 snd_soc_component_update_bits(component, WM8904_VMID_CONTROL_0, in wm8904_set_bias_level()
1931 snd_soc_component_update_bits(component, WM8904_VMID_CONTROL_0, in wm8904_set_bias_level()
1936 snd_soc_component_update_bits(component, WM8904_BIAS_CONTROL_0, in wm8904_set_bias_level()
1942 snd_soc_component_update_bits(component, WM8904_VMID_CONTROL_0, in wm8904_set_bias_level()
1946 snd_soc_component_update_bits(component, WM8904_BIAS_CONTROL_0, in wm8904_set_bias_level()
1949 snd_soc_component_write(component, WM8904_SW_RESET_AND_ID, 0); in wm8904_set_bias_level()
1996 static void wm8904_handle_retune_mobile_pdata(struct snd_soc_component *component) in wm8904_handle_retune_mobile_pdata() argument
1998 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_handle_retune_mobile_pdata()
2041 dev_dbg(component->dev, "Allocated %d unique ReTune Mobile names\n", in wm8904_handle_retune_mobile_pdata()
2047 ret = snd_soc_add_component_controls(component, &control, 1); in wm8904_handle_retune_mobile_pdata()
2049 dev_err(component->dev, in wm8904_handle_retune_mobile_pdata()
2053 static void wm8904_handle_pdata(struct snd_soc_component *component) in wm8904_handle_pdata() argument
2055 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_handle_pdata()
2060 snd_soc_add_component_controls(component, wm8904_eq_controls, in wm8904_handle_pdata()
2065 dev_dbg(component->dev, "%d DRC configurations\n", pdata->num_drc_cfgs); in wm8904_handle_pdata()
2085 ret = snd_soc_add_component_controls(component, &control, 1); in wm8904_handle_pdata()
2087 dev_err(component->dev, in wm8904_handle_pdata()
2090 wm8904_set_drc(component); in wm8904_handle_pdata()
2093 dev_dbg(component->dev, "%d ReTune Mobile configurations\n", in wm8904_handle_pdata()
2097 wm8904_handle_retune_mobile_pdata(component); in wm8904_handle_pdata()
2099 snd_soc_add_component_controls(component, wm8904_eq_controls, in wm8904_handle_pdata()
2104 static int wm8904_probe(struct snd_soc_component *component) in wm8904_probe() argument
2106 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_probe()
2115 dev_err(component->dev, "Unknown device type %d\n", in wm8904_probe()
2120 wm8904_handle_pdata(component); in wm8904_probe()
2122 wm8904_add_widgets(component); in wm8904_probe()
2127 static void wm8904_remove(struct snd_soc_component *component) in wm8904_remove() argument
2129 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_remove()