Lines Matching refs:wm8994

42 	struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);  in wm8958_dsp2_fw()  local
51 if (wm8994->cur_fw == fw) in wm8958_dsp2_fw()
153 wm8994_bulk_write(wm8994->wm8994, in wm8958_dsp2_fw()
174 wm8994->cur_fw = fw; in wm8958_dsp2_fw()
194 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp_start_mbc() local
195 struct wm8994 *control = wm8994->wm8994; in wm8958_dsp_start_mbc()
203 if (wm8994->mbc) in wm8958_dsp_start_mbc()
204 wm8958_dsp2_fw(component, "MBC", wm8994->mbc, false); in wm8958_dsp_start_mbc()
212 = &control->pdata.mbc_cfgs[wm8994->mbc_cfg]; in wm8958_dsp_start_mbc()
238 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp_start_vss() local
239 struct wm8994 *control = wm8994->wm8994; in wm8958_dsp_start_vss()
242 if (wm8994->mbc_vss) in wm8958_dsp_start_vss()
243 wm8958_dsp2_fw(component, "MBC+VSS", wm8994->mbc_vss, false); in wm8958_dsp_start_vss()
251 = &control->pdata.mbc_cfgs[wm8994->mbc_cfg]; in wm8958_dsp_start_vss()
260 = &control->pdata.vss_cfgs[wm8994->vss_cfg]; in wm8958_dsp_start_vss()
268 = &control->pdata.vss_hpf_cfgs[wm8994->vss_hpf_cfg]; in wm8958_dsp_start_vss()
280 if (wm8994->mbc_ena[path]) in wm8958_dsp_start_vss()
282 if (wm8994->hpf2_ena[path]) in wm8958_dsp_start_vss()
284 if (wm8994->hpf1_ena[path]) in wm8958_dsp_start_vss()
286 if (wm8994->vss_ena[path]) in wm8958_dsp_start_vss()
299 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp_start_enh_eq() local
300 struct wm8994 *control = wm8994->wm8994; in wm8958_dsp_start_enh_eq()
303 wm8958_dsp2_fw(component, "ENH_EQ", wm8994->enh_eq, false); in wm8958_dsp_start_enh_eq()
311 = &control->pdata.enh_eq_cfgs[wm8994->enh_eq_cfg]; in wm8958_dsp_start_enh_eq()
330 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp_apply() local
353 ena = wm8994->mbc_ena[path] || wm8994->vss_ena[path] || in wm8958_dsp_apply()
354 wm8994->hpf1_ena[path] || wm8994->hpf2_ena[path] || in wm8958_dsp_apply()
355 wm8994->enh_eq_ena[path]; in wm8958_dsp_apply()
362 path, wm8994->dsp_active, start, pwr_reg, reg); in wm8958_dsp_apply()
382 if (wm8994->enh_eq_ena[path]) in wm8958_dsp_apply()
384 else if (wm8994->vss_ena[path] || wm8994->hpf1_ena[path] || in wm8958_dsp_apply()
385 wm8994->hpf2_ena[path]) in wm8958_dsp_apply()
387 else if (wm8994->mbc_ena[path]) in wm8958_dsp_apply()
390 wm8994->dsp_active = path; in wm8958_dsp_apply()
395 if (!start && wm8994->dsp_active == path) { in wm8958_dsp_apply()
409 wm8994->dsp_active = -1; in wm8958_dsp_apply()
438 static int wm8958_dsp2_busy(struct wm8994_priv *wm8994, int aif) in wm8958_dsp2_busy() argument
442 for (i = 0; i < ARRAY_SIZE(wm8994->mbc_ena); i++) { in wm8958_dsp2_busy()
445 if (wm8994->mbc_ena[i] || wm8994->vss_ena[i] || in wm8958_dsp2_busy()
446 wm8994->hpf1_ena[i] || wm8994->hpf2_ena[i]) in wm8958_dsp2_busy()
457 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_put_mbc_enum() local
458 struct wm8994 *control = wm8994->wm8994; in wm8958_put_mbc_enum()
470 wm8994->mbc_cfg = value; in wm8958_put_mbc_enum()
479 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_get_mbc_enum() local
481 ucontrol->value.enumerated.item[0] = wm8994->mbc_cfg; in wm8958_get_mbc_enum()
501 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mbc_get() local
503 ucontrol->value.integer.value[0] = wm8994->mbc_ena[mbc]; in wm8958_mbc_get()
513 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mbc_put() local
515 if (wm8994->mbc_ena[mbc] == ucontrol->value.integer.value[0]) in wm8958_mbc_put()
521 if (wm8958_dsp2_busy(wm8994, mbc)) { in wm8958_mbc_put()
526 if (wm8994->enh_eq_ena[mbc]) in wm8958_mbc_put()
529 wm8994->mbc_ena[mbc] = ucontrol->value.integer.value[0]; in wm8958_mbc_put()
531 wm8958_dsp_apply(component, mbc, wm8994->mbc_ena[mbc]); in wm8958_mbc_put()
547 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_put_vss_enum() local
548 struct wm8994 *control = wm8994->wm8994; in wm8958_put_vss_enum()
560 wm8994->vss_cfg = value; in wm8958_put_vss_enum()
569 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_get_vss_enum() local
571 ucontrol->value.enumerated.item[0] = wm8994->vss_cfg; in wm8958_get_vss_enum()
580 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_put_vss_hpf_enum() local
581 struct wm8994 *control = wm8994->wm8994; in wm8958_put_vss_hpf_enum()
593 wm8994->vss_hpf_cfg = value; in wm8958_put_vss_hpf_enum()
602 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_get_vss_hpf_enum() local
604 ucontrol->value.enumerated.item[0] = wm8994->vss_hpf_cfg; in wm8958_get_vss_hpf_enum()
624 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_vss_get() local
626 ucontrol->value.integer.value[0] = wm8994->vss_ena[vss]; in wm8958_vss_get()
636 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_vss_put() local
638 if (wm8994->vss_ena[vss] == ucontrol->value.integer.value[0]) in wm8958_vss_put()
644 if (!wm8994->mbc_vss) in wm8958_vss_put()
647 if (wm8958_dsp2_busy(wm8994, vss)) { in wm8958_vss_put()
652 if (wm8994->enh_eq_ena[vss]) in wm8958_vss_put()
655 wm8994->vss_ena[vss] = ucontrol->value.integer.value[0]; in wm8958_vss_put()
657 wm8958_dsp_apply(component, vss, wm8994->vss_ena[vss]); in wm8958_vss_put()
685 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_hpf_get() local
688 ucontrol->value.integer.value[0] = wm8994->hpf1_ena[hpf % 3]; in wm8958_hpf_get()
690 ucontrol->value.integer.value[0] = wm8994->hpf2_ena[hpf % 3]; in wm8958_hpf_get()
700 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_hpf_put() local
703 if (wm8994->hpf1_ena[hpf % 3] == in wm8958_hpf_put()
707 if (wm8994->hpf2_ena[hpf % 3] == in wm8958_hpf_put()
715 if (!wm8994->mbc_vss) in wm8958_hpf_put()
718 if (wm8958_dsp2_busy(wm8994, hpf % 3)) { in wm8958_hpf_put()
723 if (wm8994->enh_eq_ena[hpf % 3]) in wm8958_hpf_put()
727 wm8994->hpf1_ena[hpf % 3] = ucontrol->value.integer.value[0]; in wm8958_hpf_put()
729 wm8994->hpf2_ena[hpf % 3] = ucontrol->value.integer.value[0]; in wm8958_hpf_put()
747 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_put_enh_eq_enum() local
748 struct wm8994 *control = wm8994->wm8994; in wm8958_put_enh_eq_enum()
760 wm8994->enh_eq_cfg = value; in wm8958_put_enh_eq_enum()
769 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_get_enh_eq_enum() local
771 ucontrol->value.enumerated.item[0] = wm8994->enh_eq_cfg; in wm8958_get_enh_eq_enum()
791 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_enh_eq_get() local
793 ucontrol->value.integer.value[0] = wm8994->enh_eq_ena[eq]; in wm8958_enh_eq_get()
803 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_enh_eq_put() local
805 if (wm8994->enh_eq_ena[eq] == ucontrol->value.integer.value[0]) in wm8958_enh_eq_put()
811 if (!wm8994->enh_eq) in wm8958_enh_eq_put()
814 if (wm8958_dsp2_busy(wm8994, eq)) { in wm8958_enh_eq_put()
819 if (wm8994->mbc_ena[eq] || wm8994->vss_ena[eq] || in wm8958_enh_eq_put()
820 wm8994->hpf1_ena[eq] || wm8994->hpf2_ena[eq]) in wm8958_enh_eq_put()
823 wm8994->enh_eq_ena[eq] = ucontrol->value.integer.value[0]; in wm8958_enh_eq_put()
864 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_enh_eq_loaded() local
867 mutex_lock(&wm8994->fw_lock); in wm8958_enh_eq_loaded()
868 wm8994->enh_eq = fw; in wm8958_enh_eq_loaded()
869 mutex_unlock(&wm8994->fw_lock); in wm8958_enh_eq_loaded()
876 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mbc_vss_loaded() local
879 mutex_lock(&wm8994->fw_lock); in wm8958_mbc_vss_loaded()
880 wm8994->mbc_vss = fw; in wm8958_mbc_vss_loaded()
881 mutex_unlock(&wm8994->fw_lock); in wm8958_mbc_vss_loaded()
888 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mbc_loaded() local
891 mutex_lock(&wm8994->fw_lock); in wm8958_mbc_loaded()
892 wm8994->mbc = fw; in wm8958_mbc_loaded()
893 mutex_unlock(&wm8994->fw_lock); in wm8958_mbc_loaded()
899 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp2_init() local
900 struct wm8994 *control = wm8994->wm8994; in wm8958_dsp2_init()
904 wm8994->dsp_active = -1; in wm8958_dsp2_init()
927 SOC_ENUM_EXT("MBC Mode", wm8994->mbc_enum, in wm8958_dsp2_init()
932 wm8994->mbc_texts = kmalloc_array(pdata->num_mbc_cfgs, in wm8958_dsp2_init()
935 if (!wm8994->mbc_texts) in wm8958_dsp2_init()
939 wm8994->mbc_texts[i] = pdata->mbc_cfgs[i].name; in wm8958_dsp2_init()
941 wm8994->mbc_enum.items = pdata->num_mbc_cfgs; in wm8958_dsp2_init()
942 wm8994->mbc_enum.texts = wm8994->mbc_texts; in wm8958_dsp2_init()
944 ret = snd_soc_add_component_controls(wm8994->hubs.component, in wm8958_dsp2_init()
947 dev_err(wm8994->hubs.component->dev, in wm8958_dsp2_init()
953 SOC_ENUM_EXT("VSS Mode", wm8994->vss_enum, in wm8958_dsp2_init()
958 wm8994->vss_texts = kmalloc_array(pdata->num_vss_cfgs, in wm8958_dsp2_init()
961 if (!wm8994->vss_texts) in wm8958_dsp2_init()
965 wm8994->vss_texts[i] = pdata->vss_cfgs[i].name; in wm8958_dsp2_init()
967 wm8994->vss_enum.items = pdata->num_vss_cfgs; in wm8958_dsp2_init()
968 wm8994->vss_enum.texts = wm8994->vss_texts; in wm8958_dsp2_init()
970 ret = snd_soc_add_component_controls(wm8994->hubs.component, in wm8958_dsp2_init()
973 dev_err(wm8994->hubs.component->dev, in wm8958_dsp2_init()
979 SOC_ENUM_EXT("VSS HPF Mode", wm8994->vss_hpf_enum, in wm8958_dsp2_init()
985 wm8994->vss_hpf_texts = kmalloc_array(pdata->num_vss_hpf_cfgs, in wm8958_dsp2_init()
988 if (!wm8994->vss_hpf_texts) in wm8958_dsp2_init()
992 wm8994->vss_hpf_texts[i] = pdata->vss_hpf_cfgs[i].name; in wm8958_dsp2_init()
994 wm8994->vss_hpf_enum.items = pdata->num_vss_hpf_cfgs; in wm8958_dsp2_init()
995 wm8994->vss_hpf_enum.texts = wm8994->vss_hpf_texts; in wm8958_dsp2_init()
997 ret = snd_soc_add_component_controls(wm8994->hubs.component, in wm8958_dsp2_init()
1000 dev_err(wm8994->hubs.component->dev, in wm8958_dsp2_init()
1007 SOC_ENUM_EXT("Enhanced EQ Mode", wm8994->enh_eq_enum, in wm8958_dsp2_init()
1013 wm8994->enh_eq_texts = kmalloc_array(pdata->num_enh_eq_cfgs, in wm8958_dsp2_init()
1016 if (!wm8994->enh_eq_texts) in wm8958_dsp2_init()
1020 wm8994->enh_eq_texts[i] = pdata->enh_eq_cfgs[i].name; in wm8958_dsp2_init()
1022 wm8994->enh_eq_enum.items = pdata->num_enh_eq_cfgs; in wm8958_dsp2_init()
1023 wm8994->enh_eq_enum.texts = wm8994->enh_eq_texts; in wm8958_dsp2_init()
1025 ret = snd_soc_add_component_controls(wm8994->hubs.component, in wm8958_dsp2_init()
1028 dev_err(wm8994->hubs.component->dev, in wm8958_dsp2_init()