Lines Matching full:component
42 static int wm8958_dsp2_fw(struct snd_soc_component *component, const char *name, in wm8958_dsp2_fw() argument
45 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp2_fw()
58 dev_err(component->dev, "%s: firmware too short (%zd bytes)\n", in wm8958_dsp2_fw()
66 dev_err(component->dev, "%s: firmware has bad file magic %08x\n", in wm8958_dsp2_fw()
77 dev_err(component->dev, "%s: unsupported firmware version %d\n", in wm8958_dsp2_fw()
82 dev_err(component->dev, "%s: unsupported target device %d\n", in wm8958_dsp2_fw()
87 dev_err(component->dev, "%s: unsupported target core %d\n", in wm8958_dsp2_fw()
94 dev_info(component->dev, "%s timestamp %llx\n", in wm8958_dsp2_fw()
97 snd_soc_component_write(component, 0x102, 0x2); in wm8958_dsp2_fw()
98 snd_soc_component_write(component, 0x900, 0x2); in wm8958_dsp2_fw()
105 dev_err(component->dev, "%s short data block of %zd\n", in wm8958_dsp2_fw()
113 dev_err(component->dev, "%zd byte block longer than file\n", in wm8958_dsp2_fw()
118 dev_err(component->dev, "Zero length block\n"); in wm8958_dsp2_fw()
134 dev_info(component->dev, "%s: %s\n", name, str); in wm8958_dsp2_fw()
137 dev_err(component->dev, "Out of memory\n"); in wm8958_dsp2_fw()
147 dev_dbg(component->dev, "%s: %zd bytes of %x@%x\n", name, in wm8958_dsp2_fw()
163 dev_warn(component->dev, "%s: unknown block type %d\n", in wm8958_dsp2_fw()
176 dev_dbg(component->dev, "%s: download done\n", name); in wm8958_dsp2_fw()
179 dev_info(component->dev, "%s: got firmware\n", name); in wm8958_dsp2_fw()
188 snd_soc_component_write(component, 0x900, 0x0); in wm8958_dsp2_fw()
189 snd_soc_component_write(component, 0x102, 0x0); in wm8958_dsp2_fw()
195 static void wm8958_dsp_start_mbc(struct snd_soc_component *component, int path) in wm8958_dsp_start_mbc() argument
197 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp_start_mbc()
202 if (snd_soc_component_read32(component, WM8958_DSP2_PROGRAM) & WM8958_DSP2_ENA) in wm8958_dsp_start_mbc()
207 wm8958_dsp2_fw(component, "MBC", wm8994->mbc, false); in wm8958_dsp_start_mbc()
209 snd_soc_component_update_bits(component, WM8958_DSP2_PROGRAM, in wm8958_dsp_start_mbc()
218 snd_soc_component_write(component, i + WM8958_MBC_BAND_1_K_1, in wm8958_dsp_start_mbc()
222 snd_soc_component_write(component, in wm8958_dsp_start_mbc()
228 snd_soc_component_write(component, WM8958_DSP2_EXECCONTROL, in wm8958_dsp_start_mbc()
232 snd_soc_component_update_bits(component, WM8958_DSP2_CONFIG, in wm8958_dsp_start_mbc()
239 static void wm8958_dsp_start_vss(struct snd_soc_component *component, int path) in wm8958_dsp_start_vss() argument
241 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp_start_vss()
246 wm8958_dsp2_fw(component, "MBC+VSS", wm8994->mbc_vss, false); in wm8958_dsp_start_vss()
248 snd_soc_component_update_bits(component, WM8958_DSP2_PROGRAM, in wm8958_dsp_start_vss()
257 snd_soc_component_write(component, i + 0x2800, in wm8958_dsp_start_vss()
266 snd_soc_component_write(component, i + 0x2600, cfg->regs[i]); in wm8958_dsp_start_vss()
274 snd_soc_component_write(component, i + 0x2400, cfg->regs[i]); in wm8958_dsp_start_vss()
278 snd_soc_component_write(component, WM8958_DSP2_EXECCONTROL, in wm8958_dsp_start_vss()
292 snd_soc_component_write(component, 0x2201, ena); in wm8958_dsp_start_vss()
295 snd_soc_component_update_bits(component, WM8958_DSP2_CONFIG, in wm8958_dsp_start_vss()
300 static void wm8958_dsp_start_enh_eq(struct snd_soc_component *component, int path) in wm8958_dsp_start_enh_eq() argument
302 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp_start_enh_eq()
306 wm8958_dsp2_fw(component, "ENH_EQ", wm8994->enh_eq, false); in wm8958_dsp_start_enh_eq()
308 snd_soc_component_update_bits(component, WM8958_DSP2_PROGRAM, in wm8958_dsp_start_enh_eq()
317 snd_soc_component_write(component, i + 0x2200, in wm8958_dsp_start_enh_eq()
322 snd_soc_component_write(component, WM8958_DSP2_EXECCONTROL, in wm8958_dsp_start_enh_eq()
326 snd_soc_component_update_bits(component, WM8958_DSP2_CONFIG, in wm8958_dsp_start_enh_eq()
331 static void wm8958_dsp_apply(struct snd_soc_component *component, int path, int start) in wm8958_dsp_apply() argument
333 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp_apply()
334 int pwr_reg = snd_soc_component_read32(component, WM8994_POWER_MANAGEMENT_5); in wm8958_dsp_apply()
362 reg = snd_soc_component_read32(component, WM8958_DSP2_PROGRAM); in wm8958_dsp_apply()
364 dev_dbg(component->dev, "DSP path %d %d startup: %d, power: %x, DSP: %x\n", in wm8958_dsp_apply()
373 if (!(snd_soc_component_read32(component, WM8994_AIF1_CLOCKING_1) in wm8958_dsp_apply()
375 !(snd_soc_component_read32(component, WM8994_AIF2_CLOCKING_1) in wm8958_dsp_apply()
380 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in wm8958_dsp_apply()
386 wm8958_dsp_start_enh_eq(component, path); in wm8958_dsp_apply()
389 wm8958_dsp_start_vss(component, path); in wm8958_dsp_apply()
391 wm8958_dsp_start_mbc(component, path); in wm8958_dsp_apply()
395 dev_dbg(component->dev, "DSP running in path %d\n", path); in wm8958_dsp_apply()
403 snd_soc_component_update_bits(component, WM8958_DSP2_CONFIG, in wm8958_dsp_apply()
405 snd_soc_component_write(component, WM8958_DSP2_EXECCONTROL, in wm8958_dsp_apply()
407 snd_soc_component_update_bits(component, WM8958_DSP2_PROGRAM, in wm8958_dsp_apply()
409 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in wm8958_dsp_apply()
414 dev_dbg(component->dev, "DSP stopped\n"); in wm8958_dsp_apply()
421 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wm8958_aif_ev() local
422 struct wm8994 *control = dev_get_drvdata(component->dev->parent); in wm8958_aif_ev()
432 wm8958_dsp_apply(component, i, 1); in wm8958_aif_ev()
437 wm8958_dsp_apply(component, i, 0); in wm8958_aif_ev()
463 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_put_mbc_enum() local
464 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_put_mbc_enum()
470 reg = snd_soc_component_read32(component, WM8994_CLOCKING_1); in wm8958_put_mbc_enum()
485 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_get_mbc_enum() local
486 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_get_mbc_enum()
507 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_mbc_get() local
508 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mbc_get()
519 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_mbc_put() local
520 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mbc_put()
529 dev_dbg(component->dev, "DSP2 active on %d already\n", mbc); in wm8958_mbc_put()
538 wm8958_dsp_apply(component, mbc, wm8994->mbc_ena[mbc]); in wm8958_mbc_put()
553 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_put_vss_enum() local
554 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_put_vss_enum()
560 reg = snd_soc_component_read32(component, WM8994_CLOCKING_1); in wm8958_put_vss_enum()
575 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_get_vss_enum() local
576 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_get_vss_enum()
586 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_put_vss_hpf_enum() local
587 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_put_vss_hpf_enum()
593 reg = snd_soc_component_read32(component, WM8994_CLOCKING_1); in wm8958_put_vss_hpf_enum()
608 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_get_vss_hpf_enum() local
609 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_get_vss_hpf_enum()
630 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_vss_get() local
631 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_vss_get()
642 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_vss_put() local
643 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_vss_put()
655 dev_dbg(component->dev, "DSP2 active on %d already\n", vss); in wm8958_vss_put()
664 wm8958_dsp_apply(component, vss, wm8994->vss_ena[vss]); in wm8958_vss_put()
691 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_hpf_get() local
692 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_hpf_get()
706 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_hpf_put() local
707 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_hpf_put()
726 dev_dbg(component->dev, "DSP2 active on %d already\n", hpf); in wm8958_hpf_put()
738 wm8958_dsp_apply(component, hpf % 3, ucontrol->value.integer.value[0]); in wm8958_hpf_put()
753 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_put_enh_eq_enum() local
754 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_put_enh_eq_enum()
760 reg = snd_soc_component_read32(component, WM8994_CLOCKING_1); in wm8958_put_enh_eq_enum()
775 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_get_enh_eq_enum() local
776 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_get_enh_eq_enum()
797 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_enh_eq_get() local
798 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_enh_eq_get()
809 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8958_enh_eq_put() local
810 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_enh_eq_put()
822 dev_dbg(component->dev, "DSP2 active on %d already\n", eq); in wm8958_enh_eq_put()
832 wm8958_dsp_apply(component, eq, ucontrol->value.integer.value[0]); in wm8958_enh_eq_put()
870 struct snd_soc_component *component = context; in wm8958_enh_eq_loaded() local
871 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_enh_eq_loaded()
873 if (fw && (wm8958_dsp2_fw(component, "ENH_EQ", fw, true) == 0)) { in wm8958_enh_eq_loaded()
882 struct snd_soc_component *component = context; in wm8958_mbc_vss_loaded() local
883 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mbc_vss_loaded()
885 if (fw && (wm8958_dsp2_fw(component, "MBC+VSS", fw, true) == 0)) { in wm8958_mbc_vss_loaded()
894 struct snd_soc_component *component = context; in wm8958_mbc_loaded() local
895 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mbc_loaded()
897 if (fw && (wm8958_dsp2_fw(component, "MBC", fw, true) == 0)) { in wm8958_mbc_loaded()
904 void wm8958_dsp2_init(struct snd_soc_component *component) in wm8958_dsp2_init() argument
906 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_dsp2_init()
913 snd_soc_add_component_controls(component, wm8958_mbc_snd_controls, in wm8958_dsp2_init()
915 snd_soc_add_component_controls(component, wm8958_vss_snd_controls, in wm8958_dsp2_init()
917 snd_soc_add_component_controls(component, wm8958_enh_eq_snd_controls, in wm8958_dsp2_init()
923 "wm8958_mbc.wfw", component->dev, GFP_KERNEL, in wm8958_dsp2_init()
924 component, wm8958_mbc_loaded); in wm8958_dsp2_init()
926 "wm8958_mbc_vss.wfw", component->dev, GFP_KERNEL, in wm8958_dsp2_init()
927 component, wm8958_mbc_vss_loaded); in wm8958_dsp2_init()
929 "wm8958_enh_eq.wfw", component->dev, GFP_KERNEL, in wm8958_dsp2_init()
930 component, wm8958_enh_eq_loaded); in wm8958_dsp2_init()
951 ret = snd_soc_add_component_controls(wm8994->hubs.component, in wm8958_dsp2_init()
954 dev_err(wm8994->hubs.component->dev, in wm8958_dsp2_init()
977 ret = snd_soc_add_component_controls(wm8994->hubs.component, in wm8958_dsp2_init()
980 dev_err(wm8994->hubs.component->dev, in wm8958_dsp2_init()
1004 ret = snd_soc_add_component_controls(wm8994->hubs.component, in wm8958_dsp2_init()
1007 dev_err(wm8994->hubs.component->dev, in wm8958_dsp2_init()
1032 ret = snd_soc_add_component_controls(wm8994->hubs.component, in wm8958_dsp2_init()
1035 dev_err(wm8994->hubs.component->dev, in wm8958_dsp2_init()