Lines Matching refs:component
54 struct snd_soc_component *component; member
1472 static int wm8962_dsp2_write_config(struct snd_soc_component *component) in wm8962_dsp2_write_config() argument
1474 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in wm8962_dsp2_write_config()
1480 static int wm8962_dsp2_set_enable(struct snd_soc_component *component, u16 val) in wm8962_dsp2_set_enable() argument
1482 u16 adcl = snd_soc_component_read(component, WM8962_LEFT_ADC_VOLUME); in wm8962_dsp2_set_enable()
1483 u16 adcr = snd_soc_component_read(component, WM8962_RIGHT_ADC_VOLUME); in wm8962_dsp2_set_enable()
1484 u16 dac = snd_soc_component_read(component, WM8962_ADC_DAC_CONTROL_1); in wm8962_dsp2_set_enable()
1487 snd_soc_component_write(component, WM8962_LEFT_ADC_VOLUME, 0); in wm8962_dsp2_set_enable()
1488 snd_soc_component_write(component, WM8962_RIGHT_ADC_VOLUME, WM8962_ADC_VU); in wm8962_dsp2_set_enable()
1489 snd_soc_component_update_bits(component, WM8962_ADC_DAC_CONTROL_1, in wm8962_dsp2_set_enable()
1492 snd_soc_component_write(component, WM8962_SOUNDSTAGE_ENABLES_0, val); in wm8962_dsp2_set_enable()
1495 snd_soc_component_write(component, WM8962_LEFT_ADC_VOLUME, adcl); in wm8962_dsp2_set_enable()
1496 snd_soc_component_write(component, WM8962_RIGHT_ADC_VOLUME, adcr); in wm8962_dsp2_set_enable()
1497 snd_soc_component_update_bits(component, WM8962_ADC_DAC_CONTROL_1, in wm8962_dsp2_set_enable()
1503 static int wm8962_dsp2_start(struct snd_soc_component *component) in wm8962_dsp2_start() argument
1505 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in wm8962_dsp2_start()
1507 wm8962_dsp2_write_config(component); in wm8962_dsp2_start()
1509 snd_soc_component_write(component, WM8962_DSP2_EXECCONTROL, WM8962_DSP2_RUNR); in wm8962_dsp2_start()
1511 wm8962_dsp2_set_enable(component, wm8962->dsp2_ena); in wm8962_dsp2_start()
1516 static int wm8962_dsp2_stop(struct snd_soc_component *component) in wm8962_dsp2_stop() argument
1518 wm8962_dsp2_set_enable(component, 0); in wm8962_dsp2_stop()
1520 snd_soc_component_write(component, WM8962_DSP2_EXECCONTROL, WM8962_DSP2_STOP); in wm8962_dsp2_stop()
1547 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8962_dsp2_ena_get() local
1548 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in wm8962_dsp2_ena_get()
1559 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8962_dsp2_ena_put() local
1560 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in wm8962_dsp2_ena_put()
1563 int dsp2_running = snd_soc_component_read(component, WM8962_DSP2_POWER_MANAGEMENT) & in wm8962_dsp2_ena_put()
1580 wm8962_dsp2_set_enable(component, wm8962->dsp2_ena); in wm8962_dsp2_ena_put()
1582 wm8962_dsp2_stop(component); in wm8962_dsp2_ena_put()
1597 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8962_put_hp_sw() local
1606 ret = snd_soc_component_read(component, WM8962_PWR_MGMT_2); in wm8962_put_hp_sw()
1608 snd_soc_component_write(component, WM8962_HPOUTL_VOLUME, in wm8962_put_hp_sw()
1609 snd_soc_component_read(component, WM8962_HPOUTL_VOLUME)); in wm8962_put_hp_sw()
1615 snd_soc_component_write(component, WM8962_HPOUTR_VOLUME, in wm8962_put_hp_sw()
1616 snd_soc_component_read(component, WM8962_HPOUTR_VOLUME)); in wm8962_put_hp_sw()
1627 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8962_put_spk_sw() local
1636 ret = snd_soc_component_read(component, WM8962_PWR_MGMT_2); in wm8962_put_spk_sw()
1638 snd_soc_component_write(component, WM8962_SPKOUTL_VOLUME, in wm8962_put_spk_sw()
1639 snd_soc_component_read(component, WM8962_SPKOUTL_VOLUME)); in wm8962_put_spk_sw()
1645 snd_soc_component_write(component, WM8962_SPKOUTR_VOLUME, in wm8962_put_spk_sw()
1646 snd_soc_component_read(component, WM8962_SPKOUTR_VOLUME)); in wm8962_put_spk_sw()
1847 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in tp_event() local
1849 ret = pm_runtime_resume_and_get(component->dev); in tp_event()
1851 dev_err(component->dev, "Failed to resume device: %d\n", ret); in tp_event()
1864 pm_runtime_put(component->dev); in tp_event()
1873 ret = snd_soc_component_update_bits(component, reg, mask, val); in tp_event()
1877 pm_runtime_put(component->dev); in tp_event()
1881 pm_runtime_put(component->dev); in tp_event()
1905 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in hp_event() local
1913 snd_soc_component_update_bits(component, WM8962_ANALOGUE_HP_0, in hp_event()
1918 snd_soc_component_update_bits(component, WM8962_ANALOGUE_HP_0, in hp_event()
1923 snd_soc_component_update_bits(component, WM8962_DC_SERVO_1, in hp_event()
1935 reg = snd_soc_component_read(component, WM8962_DC_SERVO_6); in hp_event()
1937 dev_err(component->dev, in hp_event()
1942 dev_dbg(component->dev, "DCS status: %x\n", reg); in hp_event()
1946 dev_err(component->dev, "DC servo timed out\n"); in hp_event()
1948 dev_dbg(component->dev, "DC servo complete after %dms\n", in hp_event()
1951 snd_soc_component_update_bits(component, WM8962_ANALOGUE_HP_0, in hp_event()
1958 snd_soc_component_update_bits(component, WM8962_ANALOGUE_HP_0, in hp_event()
1966 snd_soc_component_update_bits(component, WM8962_ANALOGUE_HP_0, in hp_event()
1972 snd_soc_component_update_bits(component, WM8962_DC_SERVO_1, in hp_event()
1978 snd_soc_component_update_bits(component, WM8962_ANALOGUE_HP_0, in hp_event()
1999 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in out_pga_event() local
2022 return snd_soc_component_write(component, reg, in out_pga_event()
2023 snd_soc_component_read(component, reg)); in out_pga_event()
2033 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in dsp2_event() local
2034 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in dsp2_event()
2039 wm8962_dsp2_start(component); in dsp2_event()
2044 wm8962_dsp2_stop(component); in dsp2_event()
2417 static int wm8962_add_widgets(struct snd_soc_component *component) in wm8962_add_widgets() argument
2419 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in wm8962_add_widgets()
2421 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8962_add_widgets()
2423 snd_soc_add_component_controls(component, wm8962_snd_controls, in wm8962_add_widgets()
2426 snd_soc_add_component_controls(component, wm8962_spk_mono_controls, in wm8962_add_widgets()
2429 snd_soc_add_component_controls(component, wm8962_spk_stereo_controls, in wm8962_add_widgets()
2466 static void wm8962_configure_bclk(struct snd_soc_component *component) in wm8962_configure_bclk() argument
2468 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in wm8962_configure_bclk()
2476 dev_dbg(component->dev, "No SYSCLK configured\n"); in wm8962_configure_bclk()
2481 dev_dbg(component->dev, "No audio clocks configured\n"); in wm8962_configure_bclk()
2493 dev_err(component->dev, "Unsupported sysclk ratio %d\n", in wm8962_configure_bclk()
2498 dev_dbg(component->dev, "Selected sysclk ratio %d\n", sysclk_rates[i]); in wm8962_configure_bclk()
2500 snd_soc_component_update_bits(component, WM8962_CLOCKING_4, in wm8962_configure_bclk()
2507 if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_ON) in wm8962_configure_bclk()
2508 snd_soc_component_update_bits(component, WM8962_CLOCKING2, in wm8962_configure_bclk()
2519 dspclk = snd_soc_component_read(component, WM8962_CLOCKING1); in wm8962_configure_bclk()
2521 if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_ON) in wm8962_configure_bclk()
2522 snd_soc_component_update_bits(component, WM8962_CLOCKING2, in wm8962_configure_bclk()
2526 dev_err(component->dev, "Failed to read DSPCLK: %d\n", dspclk); in wm8962_configure_bclk()
2542 dev_warn(component->dev, "Unknown DSPCLK divisor read back\n"); in wm8962_configure_bclk()
2546 dev_dbg(component->dev, "DSPCLK is %dHz, BCLK %d\n", dspclk, wm8962->bclk); in wm8962_configure_bclk()
2565 dev_dbg(component->dev, "Selected BCLK_DIV %d for %dHz\n", in wm8962_configure_bclk()
2569 dev_dbg(component->dev, "Selected LRCLK divisor %d for %dHz\n", in wm8962_configure_bclk()
2572 snd_soc_component_update_bits(component, WM8962_CLOCKING2, in wm8962_configure_bclk()
2574 snd_soc_component_update_bits(component, WM8962_AUDIO_INTERFACE_2, in wm8962_configure_bclk()
2578 static int wm8962_set_bias_level(struct snd_soc_component *component, in wm8962_set_bias_level() argument
2587 snd_soc_component_update_bits(component, WM8962_PWR_MGMT_1, in wm8962_set_bias_level()
2590 wm8962_configure_bclk(component); in wm8962_set_bias_level()
2595 snd_soc_component_update_bits(component, WM8962_PWR_MGMT_1, in wm8962_set_bias_level()
2598 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) in wm8962_set_bias_level()
2630 struct snd_soc_component *component = dai->component; in wm8962_hw_params() local
2631 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in wm8962_hw_params()
2649 dev_err(component->dev, "Unsupported rate %dHz\n", wm8962->lrclk); in wm8962_hw_params()
2672 snd_soc_component_update_bits(component, WM8962_AUDIO_INTERFACE_0, in wm8962_hw_params()
2674 snd_soc_component_update_bits(component, WM8962_ADDITIONAL_CONTROL_3, in wm8962_hw_params()
2678 dev_dbg(component->dev, "hw_params set BCLK %dHz LRCLK %dHz\n", in wm8962_hw_params()
2681 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_ON) in wm8962_hw_params()
2682 wm8962_configure_bclk(component); in wm8962_hw_params()
2690 struct snd_soc_component *component = dai->component; in wm8962_set_dai_sysclk() local
2691 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in wm8962_set_dai_sysclk()
2707 snd_soc_component_update_bits(component, WM8962_CLOCKING2, WM8962_SYSCLK_SRC_MASK, in wm8962_set_dai_sysclk()
2717 struct snd_soc_component *component = dai->component; in wm8962_set_dai_fmt() local
2774 snd_soc_component_update_bits(component, WM8962_AUDIO_INTERFACE_0, in wm8962_set_dai_fmt()
2884 static int wm8962_set_fll(struct snd_soc_component *component, int fll_id, int source, in wm8962_set_fll() argument
2887 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in wm8962_set_fll()
2899 dev_dbg(component->dev, "FLL disabled\n"); in wm8962_set_fll()
2904 snd_soc_component_update_bits(component, WM8962_FLL_CONTROL_1, in wm8962_set_fll()
2907 pm_runtime_put(component->dev); in wm8962_set_fll()
2917 snd_soc_component_update_bits(component, WM8962_FLL_CONTROL_1, WM8962_FLL_ENA, 0); in wm8962_set_fll()
2926 snd_soc_component_update_bits(component, WM8962_PLL2, in wm8962_set_fll()
2930 snd_soc_component_update_bits(component, WM8962_FLL_CONTROL_1, in wm8962_set_fll()
2932 snd_soc_component_update_bits(component, WM8962_FLL_CONTROL_5, in wm8962_set_fll()
2936 dev_err(component->dev, "Unknown FLL source %d\n", source); in wm8962_set_fll()
2944 snd_soc_component_update_bits(component, WM8962_FLL_CONTROL_1, WM8962_FLL_ENA, 0); in wm8962_set_fll()
2946 snd_soc_component_update_bits(component, WM8962_FLL_CONTROL_2, in wm8962_set_fll()
2952 snd_soc_component_update_bits(component, WM8962_FLL_CONTROL_3, in wm8962_set_fll()
2955 snd_soc_component_write(component, WM8962_FLL_CONTROL_6, fll_div.theta); in wm8962_set_fll()
2956 snd_soc_component_write(component, WM8962_FLL_CONTROL_7, fll_div.lambda); in wm8962_set_fll()
2957 snd_soc_component_write(component, WM8962_FLL_CONTROL_8, fll_div.n); in wm8962_set_fll()
2961 ret = pm_runtime_resume_and_get(component->dev); in wm8962_set_fll()
2963 dev_err(component->dev, "Failed to resume device: %d\n", ret); in wm8962_set_fll()
2967 snd_soc_component_update_bits(component, WM8962_FLL_CONTROL_1, in wm8962_set_fll()
2971 dev_dbg(component->dev, "FLL configured for %dHz->%dHz\n", Fref, Fout); in wm8962_set_fll()
2985 dev_err(component->dev, "FLL lock timed out"); in wm8962_set_fll()
2986 snd_soc_component_update_bits(component, WM8962_FLL_CONTROL_1, in wm8962_set_fll()
2988 pm_runtime_put(component->dev); in wm8962_set_fll()
3001 struct snd_soc_component *component = dai->component; in wm8962_mute() local
3013 ret = snd_soc_component_update_bits(component, WM8962_CLASS_D_CONTROL_1, in wm8962_mute()
3018 return snd_soc_component_update_bits(component, WM8962_ADC_DAC_CONTROL_1, in wm8962_mute()
3061 struct snd_soc_component *component = wm8962->component; in wm8962_mic_work() local
3066 reg = snd_soc_component_read(component, WM8962_ADDITIONAL_CONTROL_4); in wm8962_mic_work()
3081 snd_soc_component_update_bits(component, WM8962_MICINT_SOURCE_POL, in wm8962_mic_work()
3189 int wm8962_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *jack) in wm8962_mic_detect() argument
3191 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in wm8962_mic_detect()
3192 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8962_mic_detect()
3204 snd_soc_component_update_bits(component, WM8962_INTERRUPT_STATUS_2_MASK, in wm8962_mic_detect()
3206 snd_soc_component_update_bits(component, WM8962_ADDITIONAL_CONTROL_4, in wm8962_mic_detect()
3237 struct snd_soc_component *component = wm8962->component; in wm8962_beep_work() local
3238 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8962_beep_work()
3250 dev_dbg(component->dev, "Set beep rate %dHz for requested %dHz\n", in wm8962_beep_work()
3257 dev_dbg(component->dev, "Disabling beep\n"); in wm8962_beep_work()
3261 snd_soc_component_update_bits(component, WM8962_BEEP_GENERATOR_1, in wm8962_beep_work()
3273 struct snd_soc_component *component = input_get_drvdata(dev); in wm8962_beep_event() local
3274 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in wm8962_beep_event()
3276 dev_dbg(component->dev, "Beep event %x %x\n", code, hz); in wm8962_beep_event()
3313 static void wm8962_init_beep(struct snd_soc_component *component) in wm8962_init_beep() argument
3315 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in wm8962_init_beep()
3318 wm8962->beep = devm_input_allocate_device(component->dev); in wm8962_init_beep()
3320 dev_err(component->dev, "Failed to allocate beep device\n"); in wm8962_init_beep()
3328 wm8962->beep->phys = dev_name(component->dev); in wm8962_init_beep()
3334 wm8962->beep->dev.parent = component->dev; in wm8962_init_beep()
3335 input_set_drvdata(wm8962->beep, component); in wm8962_init_beep()
3340 dev_err(component->dev, "Failed to register beep device\n"); in wm8962_init_beep()
3343 ret = device_create_file(component->dev, &dev_attr_beep); in wm8962_init_beep()
3345 dev_err(component->dev, "Failed to create keyclick file: %d\n", in wm8962_init_beep()
3350 static void wm8962_free_beep(struct snd_soc_component *component) in wm8962_free_beep() argument
3352 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in wm8962_free_beep()
3354 device_remove_file(component->dev, &dev_attr_beep); in wm8962_free_beep()
3358 snd_soc_component_update_bits(component, WM8962_BEEP_GENERATOR_1, WM8962_BEEP_ENA,0); in wm8962_free_beep()
3413 struct snd_soc_component *component = wm8962->component; in wm8962_gpio_set() local
3415 snd_soc_component_update_bits(component, WM8962_GPIO_BASE + offset, in wm8962_gpio_set()
3423 struct snd_soc_component *component = wm8962->component; in wm8962_gpio_direction_out() local
3429 ret = snd_soc_component_update_bits(component, WM8962_GPIO_BASE + offset, in wm8962_gpio_direction_out()
3446 static void wm8962_init_gpio(struct snd_soc_component *component) in wm8962_init_gpio() argument
3448 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in wm8962_init_gpio()
3454 wm8962->gpio_chip.parent = component->dev; in wm8962_init_gpio()
3463 dev_err(component->dev, "Failed to add GPIOs: %d\n", ret); in wm8962_init_gpio()
3466 static void wm8962_free_gpio(struct snd_soc_component *component) in wm8962_free_gpio() argument
3468 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in wm8962_free_gpio()
3473 static void wm8962_init_gpio(struct snd_soc_component *component) in wm8962_init_gpio() argument
3477 static void wm8962_free_gpio(struct snd_soc_component *component) in wm8962_free_gpio() argument
3482 static int wm8962_probe(struct snd_soc_component *component) in wm8962_probe() argument
3484 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8962_probe()
3486 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in wm8962_probe()
3490 wm8962->component = component; in wm8962_probe()
3507 dev_err(component->dev, in wm8962_probe()
3513 wm8962_add_widgets(component); in wm8962_probe()
3525 switch (snd_soc_component_read(component, WM8962_GPIO_BASE + i) in wm8962_probe()
3538 dev_dbg(component->dev, "DMIC not in use, disabling\n"); in wm8962_probe()
3542 dev_warn(component->dev, "DMIC GPIOs partially configured\n"); in wm8962_probe()
3544 wm8962_init_beep(component); in wm8962_probe()
3545 wm8962_init_gpio(component); in wm8962_probe()
3550 static void wm8962_remove(struct snd_soc_component *component) in wm8962_remove() argument
3552 struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); in wm8962_remove()
3556 wm8962_free_gpio(component); in wm8962_remove()
3557 wm8962_free_beep(component); in wm8962_remove()