diff options
| -rw-r--r-- | sound/soc/codecs/wm_adsp.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index b38f3506418f..53b6033658a6 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c | |||
| @@ -396,11 +396,12 @@ static int wm_coeff_write_control(struct snd_kcontrol *kcontrol, | |||
| 396 | ret = regmap_raw_write(adsp->regmap, reg, scratch, | 396 | ret = regmap_raw_write(adsp->regmap, reg, scratch, |
| 397 | ctl->len); | 397 | ctl->len); |
| 398 | if (ret) { | 398 | if (ret) { |
| 399 | adsp_err(adsp, "Failed to write %zu bytes to %x\n", | 399 | adsp_err(adsp, "Failed to write %zu bytes to %x: %d\n", |
| 400 | ctl->len, reg); | 400 | ctl->len, reg, ret); |
| 401 | kfree(scratch); | 401 | kfree(scratch); |
| 402 | return ret; | 402 | return ret; |
| 403 | } | 403 | } |
| 404 | adsp_dbg(adsp, "Wrote %zu bytes to %x\n", ctl->len, reg); | ||
| 404 | 405 | ||
| 405 | kfree(scratch); | 406 | kfree(scratch); |
| 406 | 407 | ||
| @@ -450,11 +451,12 @@ static int wm_coeff_read_control(struct snd_kcontrol *kcontrol, | |||
| 450 | 451 | ||
| 451 | ret = regmap_raw_read(adsp->regmap, reg, scratch, ctl->len); | 452 | ret = regmap_raw_read(adsp->regmap, reg, scratch, ctl->len); |
| 452 | if (ret) { | 453 | if (ret) { |
| 453 | adsp_err(adsp, "Failed to read %zu bytes from %x\n", | 454 | adsp_err(adsp, "Failed to read %zu bytes from %x: %d\n", |
| 454 | ctl->len, reg); | 455 | ctl->len, reg, ret); |
| 455 | kfree(scratch); | 456 | kfree(scratch); |
| 456 | return ret; | 457 | return ret; |
| 457 | } | 458 | } |
| 459 | adsp_dbg(adsp, "Read %zu bytes from %x\n", ctl->len, reg); | ||
| 458 | 460 | ||
| 459 | memcpy(buf, scratch, ctl->len); | 461 | memcpy(buf, scratch, ctl->len); |
| 460 | kfree(scratch); | 462 | kfree(scratch); |
| @@ -568,6 +570,7 @@ static int wm_adsp_load(struct wm_adsp *dsp) | |||
| 568 | file, header->ver); | 570 | file, header->ver); |
| 569 | goto out_fw; | 571 | goto out_fw; |
| 570 | } | 572 | } |
| 573 | adsp_info(dsp, "Firmware version: %d\n", header->ver); | ||
| 571 | 574 | ||
| 572 | if (header->core != dsp->type) { | 575 | if (header->core != dsp->type) { |
| 573 | adsp_err(dsp, "%s: invalid core %d != %d\n", | 576 | adsp_err(dsp, "%s: invalid core %d != %d\n", |
| @@ -689,7 +692,8 @@ static int wm_adsp_load(struct wm_adsp *dsp) | |||
| 689 | &buf_list); | 692 | &buf_list); |
| 690 | if (!buf) { | 693 | if (!buf) { |
| 691 | adsp_err(dsp, "Out of memory\n"); | 694 | adsp_err(dsp, "Out of memory\n"); |
| 692 | return -ENOMEM; | 695 | ret = -ENOMEM; |
| 696 | goto out_fw; | ||
| 693 | } | 697 | } |
| 694 | 698 | ||
| 695 | ret = regmap_raw_write_async(regmap, reg, buf->buf, | 699 | ret = regmap_raw_write_async(regmap, reg, buf->buf, |
| @@ -1313,8 +1317,8 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp) | |||
| 1313 | le32_to_cpu(blk->len)); | 1317 | le32_to_cpu(blk->len)); |
| 1314 | if (ret != 0) { | 1318 | if (ret != 0) { |
| 1315 | adsp_err(dsp, | 1319 | adsp_err(dsp, |
| 1316 | "%s.%d: Failed to write to %x in %s\n", | 1320 | "%s.%d: Failed to write to %x in %s: %d\n", |
| 1317 | file, blocks, reg, region_name); | 1321 | file, blocks, reg, region_name, ret); |
| 1318 | } | 1322 | } |
| 1319 | } | 1323 | } |
| 1320 | 1324 | ||
| @@ -1358,6 +1362,7 @@ int wm_adsp1_event(struct snd_soc_dapm_widget *w, | |||
| 1358 | struct snd_soc_codec *codec = w->codec; | 1362 | struct snd_soc_codec *codec = w->codec; |
| 1359 | struct wm_adsp *dsps = snd_soc_codec_get_drvdata(codec); | 1363 | struct wm_adsp *dsps = snd_soc_codec_get_drvdata(codec); |
| 1360 | struct wm_adsp *dsp = &dsps[w->shift]; | 1364 | struct wm_adsp *dsp = &dsps[w->shift]; |
| 1365 | struct wm_adsp_alg_region *alg_region; | ||
| 1361 | struct wm_coeff_ctl *ctl; | 1366 | struct wm_coeff_ctl *ctl; |
| 1362 | int ret; | 1367 | int ret; |
| 1363 | int val; | 1368 | int val; |
| @@ -1435,6 +1440,14 @@ int wm_adsp1_event(struct snd_soc_dapm_widget *w, | |||
| 1435 | 1440 | ||
| 1436 | list_for_each_entry(ctl, &dsp->ctl_list, list) | 1441 | list_for_each_entry(ctl, &dsp->ctl_list, list) |
| 1437 | ctl->enabled = 0; | 1442 | ctl->enabled = 0; |
| 1443 | |||
| 1444 | while (!list_empty(&dsp->alg_regions)) { | ||
| 1445 | alg_region = list_first_entry(&dsp->alg_regions, | ||
| 1446 | struct wm_adsp_alg_region, | ||
| 1447 | list); | ||
| 1448 | list_del(&alg_region->list); | ||
| 1449 | kfree(alg_region); | ||
| 1450 | } | ||
| 1438 | break; | 1451 | break; |
| 1439 | 1452 | ||
| 1440 | default: | 1453 | default: |
