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_read32(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_read32(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_read32(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()
734 snd_soc_component_update_bits(component, pwr_reg, in out_pga_event()
739 snd_soc_component_update_bits(component, reg, in out_pga_event()
745 snd_soc_component_update_bits(component, reg, in out_pga_event()
750 snd_soc_component_update_bits(component, WM8904_DC_SERVO_0, in out_pga_event()
757 dev_dbg(component->dev, "Restoring DC servo state\n"); in out_pga_event()
759 snd_soc_component_write(component, dcs_l_reg, in out_pga_event()
761 snd_soc_component_write(component, dcs_r_reg, in out_pga_event()
764 snd_soc_component_write(component, WM8904_DC_SERVO_1, dcs_mask); in out_pga_event()
768 dev_dbg(component->dev, "Calibrating DC servo\n"); in out_pga_event()
770 snd_soc_component_write(component, WM8904_DC_SERVO_1, in out_pga_event()
779 val = snd_soc_component_read32(component, WM8904_DC_SERVO_READBACK_0); in out_pga_event()
787 dev_warn(component->dev, "DC servo timed out\n"); in out_pga_event()
789 dev_dbg(component->dev, "DC servo ready\n"); in out_pga_event()
792 snd_soc_component_update_bits(component, reg, in out_pga_event()
799 snd_soc_component_update_bits(component, reg, in out_pga_event()
809 snd_soc_component_update_bits(component, reg, in out_pga_event()
817 wm8904->dcs_state[dcs_l] = snd_soc_component_read32(component, dcs_l_reg); in out_pga_event()
818 wm8904->dcs_state[dcs_r] = snd_soc_component_read32(component, dcs_r_reg); in out_pga_event()
820 snd_soc_component_update_bits(component, WM8904_DC_SERVO_0, in out_pga_event()
824 snd_soc_component_update_bits(component, reg, in out_pga_event()
831 snd_soc_component_update_bits(component, pwr_reg, in out_pga_event()
1177 static int wm8904_add_widgets(struct snd_soc_component *component) in wm8904_add_widgets() argument
1179 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_add_widgets()
1180 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8904_add_widgets()
1189 snd_soc_add_component_controls(component, wm8904_adc_snd_controls, in wm8904_add_widgets()
1191 snd_soc_add_component_controls(component, wm8904_dac_snd_controls, in wm8904_add_widgets()
1193 snd_soc_add_component_controls(component, wm8904_snd_controls, in wm8904_add_widgets()
1212 snd_soc_add_component_controls(component, wm8904_dac_snd_controls, in wm8904_add_widgets()
1290 struct snd_soc_component *component = dai->component; in wm8904_hw_params() local
1291 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_hw_params()
1302 dev_dbg(component->dev, "Configuring for %d %d bit TDM slots\n", in wm8904_hw_params()
1328 dev_dbg(component->dev, "Target BCLK is %dHz\n", wm8904->bclk); in wm8904_hw_params()
1330 ret = wm8904_configure_clocking(component); in wm8904_hw_params()
1346 dev_dbg(component->dev, "Selected CLK_SYS_RATIO of %d\n", in wm8904_hw_params()
1362 dev_dbg(component->dev, "Selected SAMPLE_RATE of %dHz\n", in wm8904_hw_params()
1385 dev_dbg(component->dev, "Selected BCLK_DIV of %d for %dHz BCLK\n", in wm8904_hw_params()
1390 dev_dbg(component->dev, "LRCLK_RATE is %d\n", wm8904->bclk / wm8904->fs); in wm8904_hw_params()
1394 snd_soc_component_update_bits(component, WM8904_DAC_DIGITAL_1, in wm8904_hw_params()
1396 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_1, in wm8904_hw_params()
1398 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_2, in wm8904_hw_params()
1400 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_3, in wm8904_hw_params()
1402 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_1, in wm8904_hw_params()
1407 wm8904_set_retune_mobile(component); in wm8904_hw_params()
1408 wm8904_set_deemph(component); in wm8904_hw_params()
1417 struct snd_soc_component *component = dai->component; in wm8904_set_sysclk() local
1418 struct wm8904_priv *priv = snd_soc_component_get_drvdata(component); in wm8904_set_sysclk()
1436 wm8904_configure_clocking(component); in wm8904_set_sysclk()
1443 struct snd_soc_component *component = dai->component; in wm8904_set_fmt() local
1521 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_1, in wm8904_set_fmt()
1524 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_3, in wm8904_set_fmt()
1534 struct snd_soc_component *component = dai->component; in wm8904_set_tdm_slot() local
1535 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_set_tdm_slot()
1573 snd_soc_component_update_bits(component, WM8904_AUDIO_INTERFACE_1, in wm8904_set_tdm_slot()
1691 struct snd_soc_component *component = dai->component; in wm8904_set_fll() local
1692 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_set_fll()
1702 clock2 = snd_soc_component_read32(component, WM8904_CLOCK_RATES_2); in wm8904_set_fll()
1705 dev_dbg(component->dev, "FLL disabled\n"); in wm8904_set_fll()
1711 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_2, in wm8904_set_fll()
1714 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in wm8904_set_fll()
1731 dev_dbg(component->dev, "Using free running FLL\n"); in wm8904_set_fll()
1741 dev_err(component->dev, "Unknown FLL ID %d\n", fll_id); in wm8904_set_fll()
1747 fll1 = snd_soc_component_read32(component, WM8904_FLL_CONTROL_1); in wm8904_set_fll()
1748 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_2, in wm8904_set_fll()
1750 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in wm8904_set_fll()
1754 snd_soc_component_update_bits(component, WM8904_CONTROL_INTERFACE_TEST_1, in wm8904_set_fll()
1763 snd_soc_component_update_bits(component, WM8904_FLL_NCO_TEST_1, WM8904_FLL_FRC_NCO, in wm8904_set_fll()
1765 snd_soc_component_update_bits(component, WM8904_CONTROL_INTERFACE_TEST_1, in wm8904_set_fll()
1770 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_5, in wm8904_set_fll()
1775 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_5, in wm8904_set_fll()
1780 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_5, in wm8904_set_fll()
1789 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in wm8904_set_fll()
1792 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_2, in wm8904_set_fll()
1797 snd_soc_component_write(component, WM8904_FLL_CONTROL_3, fll_div.k); in wm8904_set_fll()
1799 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_4, WM8904_FLL_N_MASK, in wm8904_set_fll()
1802 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_5, in wm8904_set_fll()
1807 dev_dbg(component->dev, "FLL configured for %dHz->%dHz\n", Fref, Fout); in wm8904_set_fll()
1814 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in wm8904_set_fll()
1816 snd_soc_component_update_bits(component, WM8904_FLL_CONTROL_1, in wm8904_set_fll()
1821 snd_soc_component_update_bits(component, WM8904_CLOCK_RATES_2, in wm8904_set_fll()
1829 struct snd_soc_component *component = codec_dai->component; in wm8904_digital_mute() local
1837 snd_soc_component_update_bits(component, WM8904_DAC_DIGITAL_1, WM8904_DAC_MUTE, val); in wm8904_digital_mute()
1842 static int wm8904_set_bias_level(struct snd_soc_component *component, in wm8904_set_bias_level() argument
1845 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_set_bias_level()
1854 snd_soc_component_update_bits(component, WM8904_VMID_CONTROL_0, in wm8904_set_bias_level()
1859 snd_soc_component_update_bits(component, WM8904_BIAS_CONTROL_0, in wm8904_set_bias_level()
1864 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { in wm8904_set_bias_level()
1868 dev_err(component->dev, in wm8904_set_bias_level()
1876 dev_err(component->dev, in wm8904_set_bias_level()
1887 snd_soc_component_update_bits(component, WM8904_BIAS_CONTROL_0, in wm8904_set_bias_level()
1891 snd_soc_component_update_bits(component, WM8904_VMID_CONTROL_0, in wm8904_set_bias_level()
1902 snd_soc_component_update_bits(component, WM8904_VMID_CONTROL_0, in wm8904_set_bias_level()
1907 snd_soc_component_update_bits(component, WM8904_BIAS_CONTROL_0, in wm8904_set_bias_level()
1913 snd_soc_component_update_bits(component, WM8904_VMID_CONTROL_0, in wm8904_set_bias_level()
1917 snd_soc_component_update_bits(component, WM8904_BIAS_CONTROL_0, in wm8904_set_bias_level()
1965 static void wm8904_handle_retune_mobile_pdata(struct snd_soc_component *component) in wm8904_handle_retune_mobile_pdata() argument
1967 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_handle_retune_mobile_pdata()
2010 dev_dbg(component->dev, "Allocated %d unique ReTune Mobile names\n", in wm8904_handle_retune_mobile_pdata()
2016 ret = snd_soc_add_component_controls(component, &control, 1); in wm8904_handle_retune_mobile_pdata()
2018 dev_err(component->dev, in wm8904_handle_retune_mobile_pdata()
2022 static void wm8904_handle_pdata(struct snd_soc_component *component) in wm8904_handle_pdata() argument
2024 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_handle_pdata()
2029 snd_soc_add_component_controls(component, wm8904_eq_controls, in wm8904_handle_pdata()
2034 dev_dbg(component->dev, "%d DRC configurations\n", pdata->num_drc_cfgs); in wm8904_handle_pdata()
2054 ret = snd_soc_add_component_controls(component, &control, 1); in wm8904_handle_pdata()
2056 dev_err(component->dev, in wm8904_handle_pdata()
2059 wm8904_set_drc(component); in wm8904_handle_pdata()
2062 dev_dbg(component->dev, "%d ReTune Mobile configurations\n", in wm8904_handle_pdata()
2066 wm8904_handle_retune_mobile_pdata(component); in wm8904_handle_pdata()
2068 snd_soc_add_component_controls(component, wm8904_eq_controls, in wm8904_handle_pdata()
2073 static int wm8904_probe(struct snd_soc_component *component) in wm8904_probe() argument
2075 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_probe()
2084 dev_err(component->dev, "Unknown device type %d\n", in wm8904_probe()
2089 wm8904_handle_pdata(component); in wm8904_probe()
2091 wm8904_add_widgets(component); in wm8904_probe()
2096 static void wm8904_remove(struct snd_soc_component *component) in wm8904_remove() argument
2098 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); in wm8904_remove()