Lines Matching refs:codec
42 static int wm8958_dsp2_fw(struct snd_soc_codec *codec, const char *name, in wm8958_dsp2_fw() argument
45 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_dsp2_fw()
58 dev_err(codec->dev, "%s: firmware too short (%zd bytes)\n", in wm8958_dsp2_fw()
66 dev_err(codec->dev, "%s: firmware has bad file magic %08x\n", in wm8958_dsp2_fw()
77 dev_err(codec->dev, "%s: unsupported firmware version %d\n", in wm8958_dsp2_fw()
82 dev_err(codec->dev, "%s: unsupported target device %d\n", in wm8958_dsp2_fw()
87 dev_err(codec->dev, "%s: unsupported target core %d\n", in wm8958_dsp2_fw()
94 dev_info(codec->dev, "%s timestamp %llx\n", in wm8958_dsp2_fw()
97 snd_soc_write(codec, 0x102, 0x2); in wm8958_dsp2_fw()
98 snd_soc_write(codec, 0x900, 0x2); in wm8958_dsp2_fw()
105 dev_err(codec->dev, "%s short data block of %zd\n", in wm8958_dsp2_fw()
113 dev_err(codec->dev, "%zd byte block longer than file\n", in wm8958_dsp2_fw()
118 dev_err(codec->dev, "Zero length block\n"); in wm8958_dsp2_fw()
134 dev_info(codec->dev, "%s: %s\n", name, str); in wm8958_dsp2_fw()
137 dev_err(codec->dev, "Out of memory\n"); in wm8958_dsp2_fw()
147 dev_dbg(codec->dev, "%s: %zd bytes of %x@%x\n", name, in wm8958_dsp2_fw()
163 dev_warn(codec->dev, "%s: unknown block type %d\n", in wm8958_dsp2_fw()
176 dev_dbg(codec->dev, "%s: download done\n", name); in wm8958_dsp2_fw()
179 dev_info(codec->dev, "%s: got firmware\n", name); in wm8958_dsp2_fw()
188 snd_soc_write(codec, 0x900, 0x0); in wm8958_dsp2_fw()
189 snd_soc_write(codec, 0x102, 0x0); in wm8958_dsp2_fw()
195 static void wm8958_dsp_start_mbc(struct snd_soc_codec *codec, int path) in wm8958_dsp_start_mbc() argument
197 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_dsp_start_mbc()
202 if (snd_soc_read(codec, WM8958_DSP2_PROGRAM) & WM8958_DSP2_ENA) in wm8958_dsp_start_mbc()
207 wm8958_dsp2_fw(codec, "MBC", wm8994->mbc, false); in wm8958_dsp_start_mbc()
209 snd_soc_update_bits(codec, WM8958_DSP2_PROGRAM, in wm8958_dsp_start_mbc()
218 snd_soc_write(codec, i + WM8958_MBC_BAND_1_K_1, in wm8958_dsp_start_mbc()
222 snd_soc_write(codec, in wm8958_dsp_start_mbc()
228 snd_soc_write(codec, WM8958_DSP2_EXECCONTROL, in wm8958_dsp_start_mbc()
232 snd_soc_update_bits(codec, WM8958_DSP2_CONFIG, in wm8958_dsp_start_mbc()
239 static void wm8958_dsp_start_vss(struct snd_soc_codec *codec, int path) in wm8958_dsp_start_vss() argument
241 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_dsp_start_vss()
246 wm8958_dsp2_fw(codec, "MBC+VSS", wm8994->mbc_vss, false); in wm8958_dsp_start_vss()
248 snd_soc_update_bits(codec, WM8958_DSP2_PROGRAM, in wm8958_dsp_start_vss()
257 snd_soc_write(codec, i + 0x2800, in wm8958_dsp_start_vss()
266 snd_soc_write(codec, i + 0x2600, cfg->regs[i]); in wm8958_dsp_start_vss()
274 snd_soc_write(codec, i + 0x2400, cfg->regs[i]); in wm8958_dsp_start_vss()
278 snd_soc_write(codec, WM8958_DSP2_EXECCONTROL, in wm8958_dsp_start_vss()
292 snd_soc_write(codec, 0x2201, ena); in wm8958_dsp_start_vss()
295 snd_soc_update_bits(codec, WM8958_DSP2_CONFIG, in wm8958_dsp_start_vss()
300 static void wm8958_dsp_start_enh_eq(struct snd_soc_codec *codec, int path) in wm8958_dsp_start_enh_eq() argument
302 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_dsp_start_enh_eq()
306 wm8958_dsp2_fw(codec, "ENH_EQ", wm8994->enh_eq, false); in wm8958_dsp_start_enh_eq()
308 snd_soc_update_bits(codec, WM8958_DSP2_PROGRAM, in wm8958_dsp_start_enh_eq()
317 snd_soc_write(codec, i + 0x2200, in wm8958_dsp_start_enh_eq()
322 snd_soc_write(codec, WM8958_DSP2_EXECCONTROL, in wm8958_dsp_start_enh_eq()
326 snd_soc_update_bits(codec, WM8958_DSP2_CONFIG, in wm8958_dsp_start_enh_eq()
331 static void wm8958_dsp_apply(struct snd_soc_codec *codec, int path, int start) in wm8958_dsp_apply() argument
333 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_dsp_apply()
334 int pwr_reg = snd_soc_read(codec, WM8994_POWER_MANAGEMENT_5); in wm8958_dsp_apply()
362 reg = snd_soc_read(codec, WM8958_DSP2_PROGRAM); in wm8958_dsp_apply()
364 dev_dbg(codec->dev, "DSP path %d %d startup: %d, power: %x, DSP: %x\n", in wm8958_dsp_apply()
373 if (!(snd_soc_read(codec, WM8994_AIF1_CLOCKING_1) in wm8958_dsp_apply()
375 !(snd_soc_read(codec, WM8994_AIF2_CLOCKING_1) in wm8958_dsp_apply()
380 snd_soc_update_bits(codec, WM8994_CLOCKING_1, in wm8958_dsp_apply()
386 wm8958_dsp_start_enh_eq(codec, path); in wm8958_dsp_apply()
389 wm8958_dsp_start_vss(codec, path); in wm8958_dsp_apply()
391 wm8958_dsp_start_mbc(codec, path); in wm8958_dsp_apply()
395 dev_dbg(codec->dev, "DSP running in path %d\n", path); in wm8958_dsp_apply()
403 snd_soc_update_bits(codec, WM8958_DSP2_CONFIG, in wm8958_dsp_apply()
405 snd_soc_write(codec, WM8958_DSP2_EXECCONTROL, in wm8958_dsp_apply()
407 snd_soc_update_bits(codec, WM8958_DSP2_PROGRAM, in wm8958_dsp_apply()
409 snd_soc_update_bits(codec, WM8994_CLOCKING_1, in wm8958_dsp_apply()
414 dev_dbg(codec->dev, "DSP stopped\n"); in wm8958_dsp_apply()
421 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in wm8958_aif_ev() local
428 wm8958_dsp_apply(codec, i, 1); in wm8958_aif_ev()
433 wm8958_dsp_apply(codec, i, 0); in wm8958_aif_ev()
459 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8958_put_mbc_enum() local
460 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_put_mbc_enum()
466 reg = snd_soc_read(codec, WM8994_CLOCKING_1); in wm8958_put_mbc_enum()
481 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8958_get_mbc_enum() local
482 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_get_mbc_enum()
503 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8958_mbc_get() local
504 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_mbc_get()
515 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8958_mbc_put() local
516 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_mbc_put()
525 dev_dbg(codec->dev, "DSP2 active on %d already\n", mbc); in wm8958_mbc_put()
534 wm8958_dsp_apply(codec, mbc, wm8994->mbc_ena[mbc]); in wm8958_mbc_put()
549 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8958_put_vss_enum() local
550 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_put_vss_enum()
556 reg = snd_soc_read(codec, WM8994_CLOCKING_1); in wm8958_put_vss_enum()
571 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8958_get_vss_enum() local
572 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_get_vss_enum()
582 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8958_put_vss_hpf_enum() local
583 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_put_vss_hpf_enum()
589 reg = snd_soc_read(codec, WM8994_CLOCKING_1); in wm8958_put_vss_hpf_enum()
604 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8958_get_vss_hpf_enum() local
605 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_get_vss_hpf_enum()
626 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8958_vss_get() local
627 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_vss_get()
638 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8958_vss_put() local
639 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_vss_put()
651 dev_dbg(codec->dev, "DSP2 active on %d already\n", vss); in wm8958_vss_put()
660 wm8958_dsp_apply(codec, vss, wm8994->vss_ena[vss]); in wm8958_vss_put()
687 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8958_hpf_get() local
688 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_hpf_get()
702 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8958_hpf_put() local
703 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_hpf_put()
722 dev_dbg(codec->dev, "DSP2 active on %d already\n", hpf); in wm8958_hpf_put()
734 wm8958_dsp_apply(codec, hpf % 3, ucontrol->value.integer.value[0]); in wm8958_hpf_put()
749 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8958_put_enh_eq_enum() local
750 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_put_enh_eq_enum()
756 reg = snd_soc_read(codec, WM8994_CLOCKING_1); in wm8958_put_enh_eq_enum()
771 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8958_get_enh_eq_enum() local
772 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_get_enh_eq_enum()
793 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8958_enh_eq_get() local
794 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_enh_eq_get()
805 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8958_enh_eq_put() local
806 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_enh_eq_put()
818 dev_dbg(codec->dev, "DSP2 active on %d already\n", eq); in wm8958_enh_eq_put()
828 wm8958_dsp_apply(codec, eq, ucontrol->value.integer.value[0]); in wm8958_enh_eq_put()
866 struct snd_soc_codec *codec = context; in wm8958_enh_eq_loaded() local
867 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_enh_eq_loaded()
869 if (fw && (wm8958_dsp2_fw(codec, "ENH_EQ", fw, true) == 0)) { in wm8958_enh_eq_loaded()
878 struct snd_soc_codec *codec = context; in wm8958_mbc_vss_loaded() local
879 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_mbc_vss_loaded()
881 if (fw && (wm8958_dsp2_fw(codec, "MBC+VSS", fw, true) == 0)) { in wm8958_mbc_vss_loaded()
890 struct snd_soc_codec *codec = context; in wm8958_mbc_loaded() local
891 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_mbc_loaded()
893 if (fw && (wm8958_dsp2_fw(codec, "MBC", fw, true) == 0)) { in wm8958_mbc_loaded()
900 void wm8958_dsp2_init(struct snd_soc_codec *codec) in wm8958_dsp2_init() argument
902 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); in wm8958_dsp2_init()
909 snd_soc_add_codec_controls(codec, wm8958_mbc_snd_controls, in wm8958_dsp2_init()
911 snd_soc_add_codec_controls(codec, wm8958_vss_snd_controls, in wm8958_dsp2_init()
913 snd_soc_add_codec_controls(codec, wm8958_enh_eq_snd_controls, in wm8958_dsp2_init()
919 "wm8958_mbc.wfw", codec->dev, GFP_KERNEL, in wm8958_dsp2_init()
920 codec, wm8958_mbc_loaded); in wm8958_dsp2_init()
922 "wm8958_mbc_vss.wfw", codec->dev, GFP_KERNEL, in wm8958_dsp2_init()
923 codec, wm8958_mbc_vss_loaded); in wm8958_dsp2_init()
925 "wm8958_enh_eq.wfw", codec->dev, GFP_KERNEL, in wm8958_dsp2_init()
926 codec, wm8958_enh_eq_loaded); in wm8958_dsp2_init()
946 ret = snd_soc_add_codec_controls(wm8994->hubs.codec, in wm8958_dsp2_init()
949 dev_err(wm8994->hubs.codec->dev, in wm8958_dsp2_init()
971 ret = snd_soc_add_codec_controls(wm8994->hubs.codec, in wm8958_dsp2_init()
974 dev_err(wm8994->hubs.codec->dev, in wm8958_dsp2_init()
997 ret = snd_soc_add_codec_controls(wm8994->hubs.codec, in wm8958_dsp2_init()
1000 dev_err(wm8994->hubs.codec->dev, in wm8958_dsp2_init()
1024 ret = snd_soc_add_codec_controls(wm8994->hubs.codec, in wm8958_dsp2_init()
1027 dev_err(wm8994->hubs.codec->dev, in wm8958_dsp2_init()