Lines Matching refs:component
39 static int wm8958_dsp2_fw(struct snd_soc_component *component, const char *name, in wm8958_dsp2_fw() argument
42 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp2_fw()
55 dev_err(component->dev, "%s: firmware too short (%zd bytes)\n", in wm8958_dsp2_fw()
63 dev_err(component->dev, "%s: firmware has bad file magic %08x\n", in wm8958_dsp2_fw()
74 dev_err(component->dev, "%s: unsupported firmware version %d\n", in wm8958_dsp2_fw()
79 dev_err(component->dev, "%s: unsupported target device %d\n", in wm8958_dsp2_fw()
84 dev_err(component->dev, "%s: unsupported target core %d\n", in wm8958_dsp2_fw()
91 dev_info(component->dev, "%s timestamp %llx\n", in wm8958_dsp2_fw()
94 snd_soc_component_write(component, 0x102, 0x2); in wm8958_dsp2_fw()
95 snd_soc_component_write(component, 0x900, 0x2); in wm8958_dsp2_fw()
102 dev_err(component->dev, "%s short data block of %zd\n", in wm8958_dsp2_fw()
110 dev_err(component->dev, "%zd byte block longer than file\n", in wm8958_dsp2_fw()
115 dev_err(component->dev, "Zero length block\n"); in wm8958_dsp2_fw()
131 dev_info(component->dev, "%s: %s\n", name, str); in wm8958_dsp2_fw()
134 dev_err(component->dev, "Out of memory\n"); in wm8958_dsp2_fw()
144 dev_dbg(component->dev, "%s: %zd bytes of %x@%x\n", name, in wm8958_dsp2_fw()
160 dev_warn(component->dev, "%s: unknown block type %d\n", in wm8958_dsp2_fw()
173 dev_dbg(component->dev, "%s: download done\n", name); in wm8958_dsp2_fw()
176 dev_info(component->dev, "%s: got firmware\n", name); in wm8958_dsp2_fw()
185 snd_soc_component_write(component, 0x900, 0x0); in wm8958_dsp2_fw()
186 snd_soc_component_write(component, 0x102, 0x0); in wm8958_dsp2_fw()
192 static void wm8958_dsp_start_mbc(struct snd_soc_component *component, int path) in wm8958_dsp_start_mbc() argument
194 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp_start_mbc()
199 if (snd_soc_component_read32(component, WM8958_DSP2_PROGRAM) & WM8958_DSP2_ENA) in wm8958_dsp_start_mbc()
204 wm8958_dsp2_fw(component, "MBC", wm8994->mbc, false); in wm8958_dsp_start_mbc()
206 snd_soc_component_update_bits(component, WM8958_DSP2_PROGRAM, in wm8958_dsp_start_mbc()
215 snd_soc_component_write(component, i + WM8958_MBC_BAND_1_K_1, in wm8958_dsp_start_mbc()
219 snd_soc_component_write(component, in wm8958_dsp_start_mbc()
225 snd_soc_component_write(component, WM8958_DSP2_EXECCONTROL, in wm8958_dsp_start_mbc()
229 snd_soc_component_update_bits(component, WM8958_DSP2_CONFIG, in wm8958_dsp_start_mbc()
236 static void wm8958_dsp_start_vss(struct snd_soc_component *component, int path) in wm8958_dsp_start_vss() argument
238 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp_start_vss()
243 wm8958_dsp2_fw(component, "MBC+VSS", wm8994->mbc_vss, false); in wm8958_dsp_start_vss()
245 snd_soc_component_update_bits(component, WM8958_DSP2_PROGRAM, in wm8958_dsp_start_vss()
254 snd_soc_component_write(component, i + 0x2800, in wm8958_dsp_start_vss()
263 snd_soc_component_write(component, i + 0x2600, cfg->regs[i]); in wm8958_dsp_start_vss()
271 snd_soc_component_write(component, i + 0x2400, cfg->regs[i]); in wm8958_dsp_start_vss()
275 snd_soc_component_write(component, WM8958_DSP2_EXECCONTROL, in wm8958_dsp_start_vss()
289 snd_soc_component_write(component, 0x2201, ena); in wm8958_dsp_start_vss()
292 snd_soc_component_update_bits(component, WM8958_DSP2_CONFIG, in wm8958_dsp_start_vss()
297 static void wm8958_dsp_start_enh_eq(struct snd_soc_component *component, int path) in wm8958_dsp_start_enh_eq() argument
299 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp_start_enh_eq()
303 wm8958_dsp2_fw(component, "ENH_EQ", wm8994->enh_eq, false); in wm8958_dsp_start_enh_eq()
305 snd_soc_component_update_bits(component, WM8958_DSP2_PROGRAM, in wm8958_dsp_start_enh_eq()
314 snd_soc_component_write(component, i + 0x2200, in wm8958_dsp_start_enh_eq()
319 snd_soc_component_write(component, WM8958_DSP2_EXECCONTROL, in wm8958_dsp_start_enh_eq()
323 snd_soc_component_update_bits(component, WM8958_DSP2_CONFIG, in wm8958_dsp_start_enh_eq()
328 static void wm8958_dsp_apply(struct snd_soc_component *component, int path, int start) in wm8958_dsp_apply() argument
330 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp_apply()
331 int pwr_reg = snd_soc_component_read32(component, WM8994_POWER_MANAGEMENT_5); in wm8958_dsp_apply()
359 reg = snd_soc_component_read32(component, WM8958_DSP2_PROGRAM); in wm8958_dsp_apply()
361 dev_dbg(component->dev, "DSP path %d %d startup: %d, power: %x, DSP: %x\n", in wm8958_dsp_apply()
370 if (!(snd_soc_component_read32(component, WM8994_AIF1_CLOCKING_1) in wm8958_dsp_apply()
372 !(snd_soc_component_read32(component, WM8994_AIF2_CLOCKING_1) in wm8958_dsp_apply()
377 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in wm8958_dsp_apply()
383 wm8958_dsp_start_enh_eq(component, path); in wm8958_dsp_apply()
386 wm8958_dsp_start_vss(component, path); in wm8958_dsp_apply()
388 wm8958_dsp_start_mbc(component, path); in wm8958_dsp_apply()
392 dev_dbg(component->dev, "DSP running in path %d\n", path); in wm8958_dsp_apply()
400 snd_soc_component_update_bits(component, WM8958_DSP2_CONFIG, in wm8958_dsp_apply()
402 snd_soc_component_write(component, WM8958_DSP2_EXECCONTROL, in wm8958_dsp_apply()
404 snd_soc_component_update_bits(component, WM8958_DSP2_PROGRAM, in wm8958_dsp_apply()
406 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in wm8958_dsp_apply()
411 dev_dbg(component->dev, "DSP stopped\n"); in wm8958_dsp_apply()
418 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wm8958_aif_ev() local
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_read32(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_read32(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_read32(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_read32(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()