diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-05 09:39:54 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-13 08:40:37 -0400 |
commit | f395a21853935ab7a2d0d760cda206ae55300194 (patch) | |
tree | d65dafe5364ebcface26a3bc7e57ac5e8c25148b /sound | |
parent | f6161aa153581da4a3867a2d1a7caf4be19b6ec9 (diff) |
ASoC: wm_adsp: Handle old .bin files
Older .bin files report the global coefficients as absolute address writes
to zero; maintain compatibility with them.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/wm_adsp.c | 26 | ||||
-rw-r--r-- | sound/soc/codecs/wm_adsp.h | 2 |
2 files changed, 24 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index f3f7e75f8628..febb4c76535e 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c | |||
@@ -549,8 +549,9 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp) | |||
549 | buf_size = sizeof(adsp1_id); | 549 | buf_size = sizeof(adsp1_id); |
550 | 550 | ||
551 | algs = be32_to_cpu(adsp1_id.algs); | 551 | algs = be32_to_cpu(adsp1_id.algs); |
552 | dsp->fw_id = be32_to_cpu(adsp1_id.fw.id); | ||
552 | adsp_info(dsp, "Firmware: %x v%d.%d.%d, %zu algorithms\n", | 553 | adsp_info(dsp, "Firmware: %x v%d.%d.%d, %zu algorithms\n", |
553 | be32_to_cpu(adsp1_id.fw.id), | 554 | dsp->fw_id, |
554 | (be32_to_cpu(adsp1_id.fw.ver) & 0xff0000) >> 16, | 555 | (be32_to_cpu(adsp1_id.fw.ver) & 0xff0000) >> 16, |
555 | (be32_to_cpu(adsp1_id.fw.ver) & 0xff00) >> 8, | 556 | (be32_to_cpu(adsp1_id.fw.ver) & 0xff00) >> 8, |
556 | be32_to_cpu(adsp1_id.fw.ver) & 0xff, | 557 | be32_to_cpu(adsp1_id.fw.ver) & 0xff, |
@@ -573,8 +574,9 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp) | |||
573 | buf_size = sizeof(adsp2_id); | 574 | buf_size = sizeof(adsp2_id); |
574 | 575 | ||
575 | algs = be32_to_cpu(adsp2_id.algs); | 576 | algs = be32_to_cpu(adsp2_id.algs); |
577 | dsp->fw_id = be32_to_cpu(adsp2_id.fw.id); | ||
576 | adsp_info(dsp, "Firmware: %x v%d.%d.%d, %zu algorithms\n", | 578 | adsp_info(dsp, "Firmware: %x v%d.%d.%d, %zu algorithms\n", |
577 | be32_to_cpu(adsp2_id.fw.id), | 579 | dsp->fw_id, |
578 | (be32_to_cpu(adsp2_id.fw.ver) & 0xff0000) >> 16, | 580 | (be32_to_cpu(adsp2_id.fw.ver) & 0xff0000) >> 16, |
579 | (be32_to_cpu(adsp2_id.fw.ver) & 0xff00) >> 8, | 581 | (be32_to_cpu(adsp2_id.fw.ver) & 0xff00) >> 8, |
580 | be32_to_cpu(adsp2_id.fw.ver) & 0xff, | 582 | be32_to_cpu(adsp2_id.fw.ver) & 0xff, |
@@ -781,8 +783,24 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp) | |||
781 | case (WMFW_INFO_TEXT << 8): | 783 | case (WMFW_INFO_TEXT << 8): |
782 | break; | 784 | break; |
783 | case (WMFW_ABSOLUTE << 8): | 785 | case (WMFW_ABSOLUTE << 8): |
784 | region_name = "register"; | 786 | /* |
785 | reg = offset; | 787 | * Old files may use this for global |
788 | * coefficients. | ||
789 | */ | ||
790 | if (le32_to_cpu(blk->id) == dsp->fw_id && | ||
791 | offset == 0) { | ||
792 | region_name = "global coefficients"; | ||
793 | mem = wm_adsp_find_region(dsp, type); | ||
794 | if (!mem) { | ||
795 | adsp_err(dsp, "No ZM\n"); | ||
796 | break; | ||
797 | } | ||
798 | reg = wm_adsp_region_to_reg(mem, 0); | ||
799 | |||
800 | } else { | ||
801 | region_name = "register"; | ||
802 | reg = offset; | ||
803 | } | ||
786 | break; | 804 | break; |
787 | 805 | ||
788 | case WMFW_ADSP1_DM: | 806 | case WMFW_ADSP1_DM: |
diff --git a/sound/soc/codecs/wm_adsp.h b/sound/soc/codecs/wm_adsp.h index cb8871a3ec00..d6fd8af53b5d 100644 --- a/sound/soc/codecs/wm_adsp.h +++ b/sound/soc/codecs/wm_adsp.h | |||
@@ -46,6 +46,8 @@ struct wm_adsp { | |||
46 | 46 | ||
47 | struct list_head alg_regions; | 47 | struct list_head alg_regions; |
48 | 48 | ||
49 | int fw_id; | ||
50 | |||
49 | const struct wm_adsp_region *mem; | 51 | const struct wm_adsp_region *mem; |
50 | int num_mems; | 52 | int num_mems; |
51 | 53 | ||