Lines Matching refs:component

41 static int wm8958_dsp2_fw(struct snd_soc_component *component, const char *name,  in wm8958_dsp2_fw()  argument
44 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp2_fw()
57 dev_err(component->dev, "%s: firmware too short (%zd bytes)\n", in wm8958_dsp2_fw()
64 dev_err(component->dev, "%s: firmware has bad file magic %08x\n", in wm8958_dsp2_fw()
73 dev_err(component->dev, "%s: unsupported firmware version %d\n", in wm8958_dsp2_fw()
78 dev_err(component->dev, "%s: unsupported target device %d\n", in wm8958_dsp2_fw()
83 dev_err(component->dev, "%s: unsupported target core %d\n", in wm8958_dsp2_fw()
90 dev_info(component->dev, "%s timestamp %llx\n", name, data64); in wm8958_dsp2_fw()
92 snd_soc_component_write(component, 0x102, 0x2); in wm8958_dsp2_fw()
93 snd_soc_component_write(component, 0x900, 0x2); in wm8958_dsp2_fw()
100 dev_err(component->dev, "%s short data block of %zd\n", in wm8958_dsp2_fw()
107 dev_err(component->dev, "%zd byte block longer than file\n", in wm8958_dsp2_fw()
112 dev_err(component->dev, "Zero length block\n"); in wm8958_dsp2_fw()
127 dev_info(component->dev, "%s: %s\n", name, str); in wm8958_dsp2_fw()
130 dev_err(component->dev, "Out of memory\n"); in wm8958_dsp2_fw()
140 dev_dbg(component->dev, "%s: %zd bytes of %x@%x\n", name, in wm8958_dsp2_fw()
156 dev_warn(component->dev, "%s: unknown block type %d\n", in wm8958_dsp2_fw()
169 dev_dbg(component->dev, "%s: download done\n", name); in wm8958_dsp2_fw()
172 dev_info(component->dev, "%s: got firmware\n", name); in wm8958_dsp2_fw()
181 snd_soc_component_write(component, 0x900, 0x0); in wm8958_dsp2_fw()
182 snd_soc_component_write(component, 0x102, 0x0); in wm8958_dsp2_fw()
188 static void wm8958_dsp_start_mbc(struct snd_soc_component *component, int path) in wm8958_dsp_start_mbc() argument
190 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp_start_mbc()
195 if (snd_soc_component_read(component, WM8958_DSP2_PROGRAM) & WM8958_DSP2_ENA) in wm8958_dsp_start_mbc()
200 wm8958_dsp2_fw(component, "MBC", wm8994->mbc, false); in wm8958_dsp_start_mbc()
202 snd_soc_component_update_bits(component, WM8958_DSP2_PROGRAM, in wm8958_dsp_start_mbc()
211 snd_soc_component_write(component, i + WM8958_MBC_BAND_1_K_1, in wm8958_dsp_start_mbc()
215 snd_soc_component_write(component, in wm8958_dsp_start_mbc()
221 snd_soc_component_write(component, WM8958_DSP2_EXECCONTROL, in wm8958_dsp_start_mbc()
225 snd_soc_component_update_bits(component, WM8958_DSP2_CONFIG, in wm8958_dsp_start_mbc()
232 static void wm8958_dsp_start_vss(struct snd_soc_component *component, int path) in wm8958_dsp_start_vss() argument
234 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp_start_vss()
239 wm8958_dsp2_fw(component, "MBC+VSS", wm8994->mbc_vss, false); in wm8958_dsp_start_vss()
241 snd_soc_component_update_bits(component, WM8958_DSP2_PROGRAM, in wm8958_dsp_start_vss()
250 snd_soc_component_write(component, i + 0x2800, in wm8958_dsp_start_vss()
259 snd_soc_component_write(component, i + 0x2600, cfg->regs[i]); in wm8958_dsp_start_vss()
267 snd_soc_component_write(component, i + 0x2400, cfg->regs[i]); in wm8958_dsp_start_vss()
271 snd_soc_component_write(component, WM8958_DSP2_EXECCONTROL, in wm8958_dsp_start_vss()
285 snd_soc_component_write(component, 0x2201, ena); in wm8958_dsp_start_vss()
288 snd_soc_component_update_bits(component, WM8958_DSP2_CONFIG, in wm8958_dsp_start_vss()
293 static void wm8958_dsp_start_enh_eq(struct snd_soc_component *component, int path) in wm8958_dsp_start_enh_eq() argument
295 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp_start_enh_eq()
299 wm8958_dsp2_fw(component, "ENH_EQ", wm8994->enh_eq, false); in wm8958_dsp_start_enh_eq()
301 snd_soc_component_update_bits(component, WM8958_DSP2_PROGRAM, in wm8958_dsp_start_enh_eq()
310 snd_soc_component_write(component, i + 0x2200, in wm8958_dsp_start_enh_eq()
315 snd_soc_component_write(component, WM8958_DSP2_EXECCONTROL, in wm8958_dsp_start_enh_eq()
319 snd_soc_component_update_bits(component, WM8958_DSP2_CONFIG, in wm8958_dsp_start_enh_eq()
324 static void wm8958_dsp_apply(struct snd_soc_component *component, int path, int start) in wm8958_dsp_apply() argument
326 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp_apply()
327 int pwr_reg = snd_soc_component_read(component, WM8994_POWER_MANAGEMENT_5); in wm8958_dsp_apply()
355 reg = snd_soc_component_read(component, WM8958_DSP2_PROGRAM); in wm8958_dsp_apply()
357 dev_dbg(component->dev, "DSP path %d %d startup: %d, power: %x, DSP: %x\n", in wm8958_dsp_apply()
366 if (!(snd_soc_component_read(component, WM8994_AIF1_CLOCKING_1) in wm8958_dsp_apply()
368 !(snd_soc_component_read(component, WM8994_AIF2_CLOCKING_1) in wm8958_dsp_apply()
373 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in wm8958_dsp_apply()
379 wm8958_dsp_start_enh_eq(component, path); in wm8958_dsp_apply()
382 wm8958_dsp_start_vss(component, path); in wm8958_dsp_apply()
384 wm8958_dsp_start_mbc(component, path); in wm8958_dsp_apply()
388 dev_dbg(component->dev, "DSP running in path %d\n", path); in wm8958_dsp_apply()
396 snd_soc_component_update_bits(component, WM8958_DSP2_CONFIG, in wm8958_dsp_apply()
398 snd_soc_component_write(component, WM8958_DSP2_EXECCONTROL, in wm8958_dsp_apply()
400 snd_soc_component_update_bits(component, WM8958_DSP2_PROGRAM, in wm8958_dsp_apply()
402 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in wm8958_dsp_apply()
407 dev_dbg(component->dev, "DSP stopped\n"); in wm8958_dsp_apply()
414 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wm8958_aif_ev() local
415 struct wm8994 *control = dev_get_drvdata(component->dev->parent); in wm8958_aif_ev()
425 wm8958_dsp_apply(component, i, 1); in wm8958_aif_ev()
430 wm8958_dsp_apply(component, i, 0); in wm8958_aif_ev()
456 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_put_mbc_enum() local
457 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_put_mbc_enum()
463 reg = snd_soc_component_read(component, WM8994_CLOCKING_1); in wm8958_put_mbc_enum()
478 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_get_mbc_enum() local
479 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_get_mbc_enum()
500 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_mbc_get() local
501 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mbc_get()
512 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_mbc_put() local
513 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mbc_put()
522 dev_dbg(component->dev, "DSP2 active on %d already\n", mbc); in wm8958_mbc_put()
531 wm8958_dsp_apply(component, mbc, wm8994->mbc_ena[mbc]); in wm8958_mbc_put()
546 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_put_vss_enum() local
547 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_put_vss_enum()
553 reg = snd_soc_component_read(component, WM8994_CLOCKING_1); in wm8958_put_vss_enum()
568 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_get_vss_enum() local
569 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_get_vss_enum()
579 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_put_vss_hpf_enum() local
580 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_put_vss_hpf_enum()
586 reg = snd_soc_component_read(component, WM8994_CLOCKING_1); in wm8958_put_vss_hpf_enum()
601 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_get_vss_hpf_enum() local
602 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_get_vss_hpf_enum()
623 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_vss_get() local
624 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_vss_get()
635 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_vss_put() local
636 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_vss_put()
648 dev_dbg(component->dev, "DSP2 active on %d already\n", vss); in wm8958_vss_put()
657 wm8958_dsp_apply(component, vss, wm8994->vss_ena[vss]); in wm8958_vss_put()
684 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_hpf_get() local
685 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_hpf_get()
699 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_hpf_put() local
700 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_hpf_put()
719 dev_dbg(component->dev, "DSP2 active on %d already\n", hpf); in wm8958_hpf_put()
731 wm8958_dsp_apply(component, hpf % 3, ucontrol->value.integer.value[0]); in wm8958_hpf_put()
746 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_put_enh_eq_enum() local
747 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_put_enh_eq_enum()
753 reg = snd_soc_component_read(component, WM8994_CLOCKING_1); in wm8958_put_enh_eq_enum()
768 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_get_enh_eq_enum() local
769 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_get_enh_eq_enum()
790 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_enh_eq_get() local
791 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_enh_eq_get()
802 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_enh_eq_put() local
803 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_enh_eq_put()
815 dev_dbg(component->dev, "DSP2 active on %d already\n", eq); in wm8958_enh_eq_put()
825 wm8958_dsp_apply(component, eq, ucontrol->value.integer.value[0]); in wm8958_enh_eq_put()
863 struct snd_soc_component *component = context; in wm8958_enh_eq_loaded() local
864 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_enh_eq_loaded()
866 if (fw && (wm8958_dsp2_fw(component, "ENH_EQ", fw, true) == 0)) { in wm8958_enh_eq_loaded()
875 struct snd_soc_component *component = context; in wm8958_mbc_vss_loaded() local
876 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mbc_vss_loaded()
878 if (fw && (wm8958_dsp2_fw(component, "MBC+VSS", fw, true) == 0)) { in wm8958_mbc_vss_loaded()
887 struct snd_soc_component *component = context; in wm8958_mbc_loaded() local
888 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mbc_loaded()
890 if (fw && (wm8958_dsp2_fw(component, "MBC", fw, true) == 0)) { in wm8958_mbc_loaded()
897 void wm8958_dsp2_init(struct snd_soc_component *component) in wm8958_dsp2_init() argument
899 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp2_init()
906 snd_soc_add_component_controls(component, wm8958_mbc_snd_controls, in wm8958_dsp2_init()
908 snd_soc_add_component_controls(component, wm8958_vss_snd_controls, in wm8958_dsp2_init()
910 snd_soc_add_component_controls(component, wm8958_enh_eq_snd_controls, in wm8958_dsp2_init()
916 "wm8958_mbc.wfw", component->dev, GFP_KERNEL, in wm8958_dsp2_init()
917 component, wm8958_mbc_loaded); in wm8958_dsp2_init()
919 "wm8958_mbc_vss.wfw", component->dev, GFP_KERNEL, in wm8958_dsp2_init()
920 component, wm8958_mbc_vss_loaded); in wm8958_dsp2_init()
922 "wm8958_enh_eq.wfw", component->dev, GFP_KERNEL, in wm8958_dsp2_init()
923 component, wm8958_enh_eq_loaded); 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()
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()
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()
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()