diff options
Diffstat (limited to 'sound/soc/codecs/wm8958-dsp2.c')
-rw-r--r-- | sound/soc/codecs/wm8958-dsp2.c | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/sound/soc/codecs/wm8958-dsp2.c b/sound/soc/codecs/wm8958-dsp2.c index bff96500c3f3..b0710d817a65 100644 --- a/sound/soc/codecs/wm8958-dsp2.c +++ b/sound/soc/codecs/wm8958-dsp2.c | |||
@@ -195,7 +195,7 @@ ok: | |||
195 | static void wm8958_dsp_start_mbc(struct snd_soc_codec *codec, int path) | 195 | static void wm8958_dsp_start_mbc(struct snd_soc_codec *codec, int path) |
196 | { | 196 | { |
197 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 197 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
198 | struct wm8994_pdata *pdata = wm8994->pdata; | 198 | struct wm8994 *control = wm8994->wm8994; |
199 | int i; | 199 | int i; |
200 | 200 | ||
201 | /* If the DSP is already running then noop */ | 201 | /* If the DSP is already running then noop */ |
@@ -210,9 +210,9 @@ static void wm8958_dsp_start_mbc(struct snd_soc_codec *codec, int path) | |||
210 | WM8958_DSP2_ENA, WM8958_DSP2_ENA); | 210 | WM8958_DSP2_ENA, WM8958_DSP2_ENA); |
211 | 211 | ||
212 | /* If we've got user supplied MBC settings use them */ | 212 | /* If we've got user supplied MBC settings use them */ |
213 | if (pdata && pdata->num_mbc_cfgs) { | 213 | if (control->pdata.num_mbc_cfgs) { |
214 | struct wm8958_mbc_cfg *cfg | 214 | struct wm8958_mbc_cfg *cfg |
215 | = &pdata->mbc_cfgs[wm8994->mbc_cfg]; | 215 | = &control->pdata.mbc_cfgs[wm8994->mbc_cfg]; |
216 | 216 | ||
217 | for (i = 0; i < ARRAY_SIZE(cfg->coeff_regs); i++) | 217 | for (i = 0; i < ARRAY_SIZE(cfg->coeff_regs); i++) |
218 | snd_soc_write(codec, i + WM8958_MBC_BAND_1_K_1, | 218 | snd_soc_write(codec, i + WM8958_MBC_BAND_1_K_1, |
@@ -239,7 +239,7 @@ static void wm8958_dsp_start_mbc(struct snd_soc_codec *codec, int path) | |||
239 | static void wm8958_dsp_start_vss(struct snd_soc_codec *codec, int path) | 239 | static void wm8958_dsp_start_vss(struct snd_soc_codec *codec, int path) |
240 | { | 240 | { |
241 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 241 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
242 | struct wm8994_pdata *pdata = wm8994->pdata; | 242 | struct wm8994 *control = wm8994->wm8994; |
243 | int i, ena; | 243 | int i, ena; |
244 | 244 | ||
245 | if (wm8994->mbc_vss) | 245 | if (wm8994->mbc_vss) |
@@ -249,26 +249,26 @@ static void wm8958_dsp_start_vss(struct snd_soc_codec *codec, int path) | |||
249 | WM8958_DSP2_ENA, WM8958_DSP2_ENA); | 249 | WM8958_DSP2_ENA, WM8958_DSP2_ENA); |
250 | 250 | ||
251 | /* If we've got user supplied settings use them */ | 251 | /* If we've got user supplied settings use them */ |
252 | if (pdata && pdata->num_mbc_cfgs) { | 252 | if (control->pdata.num_mbc_cfgs) { |
253 | struct wm8958_mbc_cfg *cfg | 253 | struct wm8958_mbc_cfg *cfg |
254 | = &pdata->mbc_cfgs[wm8994->mbc_cfg]; | 254 | = &control->pdata.mbc_cfgs[wm8994->mbc_cfg]; |
255 | 255 | ||
256 | for (i = 0; i < ARRAY_SIZE(cfg->combined_regs); i++) | 256 | for (i = 0; i < ARRAY_SIZE(cfg->combined_regs); i++) |
257 | snd_soc_write(codec, i + 0x2800, | 257 | snd_soc_write(codec, i + 0x2800, |
258 | cfg->combined_regs[i]); | 258 | cfg->combined_regs[i]); |
259 | } | 259 | } |
260 | 260 | ||
261 | if (pdata && pdata->num_vss_cfgs) { | 261 | if (control->pdata.num_vss_cfgs) { |
262 | struct wm8958_vss_cfg *cfg | 262 | struct wm8958_vss_cfg *cfg |
263 | = &pdata->vss_cfgs[wm8994->vss_cfg]; | 263 | = &control->pdata.vss_cfgs[wm8994->vss_cfg]; |
264 | 264 | ||
265 | for (i = 0; i < ARRAY_SIZE(cfg->regs); i++) | 265 | for (i = 0; i < ARRAY_SIZE(cfg->regs); i++) |
266 | snd_soc_write(codec, i + 0x2600, cfg->regs[i]); | 266 | snd_soc_write(codec, i + 0x2600, cfg->regs[i]); |
267 | } | 267 | } |
268 | 268 | ||
269 | if (pdata && pdata->num_vss_hpf_cfgs) { | 269 | if (control->pdata.num_vss_hpf_cfgs) { |
270 | struct wm8958_vss_hpf_cfg *cfg | 270 | struct wm8958_vss_hpf_cfg *cfg |
271 | = &pdata->vss_hpf_cfgs[wm8994->vss_hpf_cfg]; | 271 | = &control->pdata.vss_hpf_cfgs[wm8994->vss_hpf_cfg]; |
272 | 272 | ||
273 | for (i = 0; i < ARRAY_SIZE(cfg->regs); i++) | 273 | for (i = 0; i < ARRAY_SIZE(cfg->regs); i++) |
274 | snd_soc_write(codec, i + 0x2400, cfg->regs[i]); | 274 | snd_soc_write(codec, i + 0x2400, cfg->regs[i]); |
@@ -300,7 +300,7 @@ static void wm8958_dsp_start_vss(struct snd_soc_codec *codec, int path) | |||
300 | static void wm8958_dsp_start_enh_eq(struct snd_soc_codec *codec, int path) | 300 | static void wm8958_dsp_start_enh_eq(struct snd_soc_codec *codec, int path) |
301 | { | 301 | { |
302 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 302 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
303 | struct wm8994_pdata *pdata = wm8994->pdata; | 303 | struct wm8994 *control = wm8994->wm8994; |
304 | int i; | 304 | int i; |
305 | 305 | ||
306 | wm8958_dsp2_fw(codec, "ENH_EQ", wm8994->enh_eq, false); | 306 | wm8958_dsp2_fw(codec, "ENH_EQ", wm8994->enh_eq, false); |
@@ -309,9 +309,9 @@ static void wm8958_dsp_start_enh_eq(struct snd_soc_codec *codec, int path) | |||
309 | WM8958_DSP2_ENA, WM8958_DSP2_ENA); | 309 | WM8958_DSP2_ENA, WM8958_DSP2_ENA); |
310 | 310 | ||
311 | /* If we've got user supplied settings use them */ | 311 | /* If we've got user supplied settings use them */ |
312 | if (pdata && pdata->num_enh_eq_cfgs) { | 312 | if (control->pdata.num_enh_eq_cfgs) { |
313 | struct wm8958_enh_eq_cfg *cfg | 313 | struct wm8958_enh_eq_cfg *cfg |
314 | = &pdata->enh_eq_cfgs[wm8994->enh_eq_cfg]; | 314 | = &control->pdata.enh_eq_cfgs[wm8994->enh_eq_cfg]; |
315 | 315 | ||
316 | for (i = 0; i < ARRAY_SIZE(cfg->regs); i++) | 316 | for (i = 0; i < ARRAY_SIZE(cfg->regs); i++) |
317 | snd_soc_write(codec, i + 0x2200, | 317 | snd_soc_write(codec, i + 0x2200, |
@@ -458,7 +458,7 @@ static int wm8958_put_mbc_enum(struct snd_kcontrol *kcontrol, | |||
458 | { | 458 | { |
459 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 459 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
460 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 460 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
461 | struct wm8994_pdata *pdata = wm8994->pdata; | 461 | struct wm8994 *control = wm8994->wm8994; |
462 | int value = ucontrol->value.integer.value[0]; | 462 | int value = ucontrol->value.integer.value[0]; |
463 | int reg; | 463 | int reg; |
464 | 464 | ||
@@ -467,7 +467,7 @@ static int wm8958_put_mbc_enum(struct snd_kcontrol *kcontrol, | |||
467 | if (reg < 0 || reg & WM8958_DSP2CLK_ENA) | 467 | if (reg < 0 || reg & WM8958_DSP2CLK_ENA) |
468 | return -EBUSY; | 468 | return -EBUSY; |
469 | 469 | ||
470 | if (value >= pdata->num_mbc_cfgs) | 470 | if (value >= control->pdata.num_mbc_cfgs) |
471 | return -EINVAL; | 471 | return -EINVAL; |
472 | 472 | ||
473 | wm8994->mbc_cfg = value; | 473 | wm8994->mbc_cfg = value; |
@@ -548,7 +548,7 @@ static int wm8958_put_vss_enum(struct snd_kcontrol *kcontrol, | |||
548 | { | 548 | { |
549 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 549 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
550 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 550 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
551 | struct wm8994_pdata *pdata = wm8994->pdata; | 551 | struct wm8994 *control = wm8994->wm8994; |
552 | int value = ucontrol->value.integer.value[0]; | 552 | int value = ucontrol->value.integer.value[0]; |
553 | int reg; | 553 | int reg; |
554 | 554 | ||
@@ -557,7 +557,7 @@ static int wm8958_put_vss_enum(struct snd_kcontrol *kcontrol, | |||
557 | if (reg < 0 || reg & WM8958_DSP2CLK_ENA) | 557 | if (reg < 0 || reg & WM8958_DSP2CLK_ENA) |
558 | return -EBUSY; | 558 | return -EBUSY; |
559 | 559 | ||
560 | if (value >= pdata->num_vss_cfgs) | 560 | if (value >= control->pdata.num_vss_cfgs) |
561 | return -EINVAL; | 561 | return -EINVAL; |
562 | 562 | ||
563 | wm8994->vss_cfg = value; | 563 | wm8994->vss_cfg = value; |
@@ -581,7 +581,7 @@ static int wm8958_put_vss_hpf_enum(struct snd_kcontrol *kcontrol, | |||
581 | { | 581 | { |
582 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 582 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
583 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 583 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
584 | struct wm8994_pdata *pdata = wm8994->pdata; | 584 | struct wm8994 *control = wm8994->wm8994; |
585 | int value = ucontrol->value.integer.value[0]; | 585 | int value = ucontrol->value.integer.value[0]; |
586 | int reg; | 586 | int reg; |
587 | 587 | ||
@@ -590,7 +590,7 @@ static int wm8958_put_vss_hpf_enum(struct snd_kcontrol *kcontrol, | |||
590 | if (reg < 0 || reg & WM8958_DSP2CLK_ENA) | 590 | if (reg < 0 || reg & WM8958_DSP2CLK_ENA) |
591 | return -EBUSY; | 591 | return -EBUSY; |
592 | 592 | ||
593 | if (value >= pdata->num_vss_hpf_cfgs) | 593 | if (value >= control->pdata.num_vss_hpf_cfgs) |
594 | return -EINVAL; | 594 | return -EINVAL; |
595 | 595 | ||
596 | wm8994->vss_hpf_cfg = value; | 596 | wm8994->vss_hpf_cfg = value; |
@@ -748,7 +748,7 @@ static int wm8958_put_enh_eq_enum(struct snd_kcontrol *kcontrol, | |||
748 | { | 748 | { |
749 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 749 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
750 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 750 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
751 | struct wm8994_pdata *pdata = wm8994->pdata; | 751 | struct wm8994 *control = wm8994->wm8994; |
752 | int value = ucontrol->value.integer.value[0]; | 752 | int value = ucontrol->value.integer.value[0]; |
753 | int reg; | 753 | int reg; |
754 | 754 | ||
@@ -757,7 +757,7 @@ static int wm8958_put_enh_eq_enum(struct snd_kcontrol *kcontrol, | |||
757 | if (reg < 0 || reg & WM8958_DSP2CLK_ENA) | 757 | if (reg < 0 || reg & WM8958_DSP2CLK_ENA) |
758 | return -EBUSY; | 758 | return -EBUSY; |
759 | 759 | ||
760 | if (value >= pdata->num_enh_eq_cfgs) | 760 | if (value >= control->pdata.num_enh_eq_cfgs) |
761 | return -EINVAL; | 761 | return -EINVAL; |
762 | 762 | ||
763 | wm8994->enh_eq_cfg = value; | 763 | wm8994->enh_eq_cfg = value; |
@@ -900,7 +900,8 @@ static void wm8958_mbc_loaded(const struct firmware *fw, void *context) | |||
900 | void wm8958_dsp2_init(struct snd_soc_codec *codec) | 900 | void wm8958_dsp2_init(struct snd_soc_codec *codec) |
901 | { | 901 | { |
902 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 902 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
903 | struct wm8994_pdata *pdata = wm8994->pdata; | 903 | struct wm8994 *control = wm8994->wm8994; |
904 | struct wm8994_pdata *pdata = &control->pdata; | ||
904 | int ret, i; | 905 | int ret, i; |
905 | 906 | ||
906 | wm8994->dsp_active = -1; | 907 | wm8994->dsp_active = -1; |
@@ -924,9 +925,6 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec) | |||
924 | "wm8958_enh_eq.wfw", codec->dev, GFP_KERNEL, | 925 | "wm8958_enh_eq.wfw", codec->dev, GFP_KERNEL, |
925 | codec, wm8958_enh_eq_loaded); | 926 | codec, wm8958_enh_eq_loaded); |
926 | 927 | ||
927 | if (!pdata) | ||
928 | return; | ||
929 | |||
930 | if (pdata->num_mbc_cfgs) { | 928 | if (pdata->num_mbc_cfgs) { |
931 | struct snd_kcontrol_new control[] = { | 929 | struct snd_kcontrol_new control[] = { |
932 | SOC_ENUM_EXT("MBC Mode", wm8994->mbc_enum, | 930 | SOC_ENUM_EXT("MBC Mode", wm8994->mbc_enum, |