diff options
| -rw-r--r-- | sound/soc/intel/sst-haswell-dsp.c | 3 | ||||
| -rw-r--r-- | sound/soc/intel/sst-haswell-ipc.c | 32 |
2 files changed, 24 insertions, 11 deletions
diff --git a/sound/soc/intel/sst-haswell-dsp.c b/sound/soc/intel/sst-haswell-dsp.c index c42ffae5fe9f..402b728c0a06 100644 --- a/sound/soc/intel/sst-haswell-dsp.c +++ b/sound/soc/intel/sst-haswell-dsp.c | |||
| @@ -207,9 +207,6 @@ static int hsw_parse_fw_image(struct sst_fw *sst_fw) | |||
| 207 | module = (void *)module + sizeof(*module) + module->mod_size; | 207 | module = (void *)module + sizeof(*module) + module->mod_size; |
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | /* allocate scratch mem regions */ | ||
| 211 | sst_block_alloc_scratch(dsp); | ||
| 212 | |||
| 213 | return 0; | 210 | return 0; |
| 214 | } | 211 | } |
| 215 | 212 | ||
diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c index 394af5684c05..863a9ca34b8e 100644 --- a/sound/soc/intel/sst-haswell-ipc.c +++ b/sound/soc/intel/sst-haswell-ipc.c | |||
| @@ -1732,6 +1732,7 @@ static void sst_hsw_drop_all(struct sst_hsw *hsw) | |||
| 1732 | int sst_hsw_dsp_load(struct sst_hsw *hsw) | 1732 | int sst_hsw_dsp_load(struct sst_hsw *hsw) |
| 1733 | { | 1733 | { |
| 1734 | struct sst_dsp *dsp = hsw->dsp; | 1734 | struct sst_dsp *dsp = hsw->dsp; |
| 1735 | struct sst_fw *sst_fw, *t; | ||
| 1735 | int ret; | 1736 | int ret; |
| 1736 | 1737 | ||
| 1737 | dev_dbg(hsw->dev, "loading audio DSP...."); | 1738 | dev_dbg(hsw->dev, "loading audio DSP...."); |
| @@ -1748,12 +1749,17 @@ int sst_hsw_dsp_load(struct sst_hsw *hsw) | |||
| 1748 | return ret; | 1749 | return ret; |
| 1749 | } | 1750 | } |
| 1750 | 1751 | ||
| 1751 | ret = sst_fw_reload(hsw->sst_fw); | 1752 | list_for_each_entry_safe_reverse(sst_fw, t, &dsp->fw_list, list) { |
| 1752 | if (ret < 0) { | 1753 | ret = sst_fw_reload(sst_fw); |
| 1753 | dev_err(hsw->dev, "error: SST FW reload failed\n"); | 1754 | if (ret < 0) { |
| 1754 | sst_dsp_dma_put_channel(dsp); | 1755 | dev_err(hsw->dev, "error: SST FW reload failed\n"); |
| 1755 | return -ENOMEM; | 1756 | sst_dsp_dma_put_channel(dsp); |
| 1757 | return -ENOMEM; | ||
| 1758 | } | ||
| 1756 | } | 1759 | } |
| 1760 | ret = sst_block_alloc_scratch(hsw->dsp); | ||
| 1761 | if (ret < 0) | ||
| 1762 | return -EINVAL; | ||
| 1757 | 1763 | ||
| 1758 | sst_dsp_dma_put_channel(dsp); | 1764 | sst_dsp_dma_put_channel(dsp); |
| 1759 | return 0; | 1765 | return 0; |
| @@ -1809,12 +1815,17 @@ int sst_hsw_dsp_runtime_suspend(struct sst_hsw *hsw) | |||
| 1809 | 1815 | ||
| 1810 | int sst_hsw_dsp_runtime_sleep(struct sst_hsw *hsw) | 1816 | int sst_hsw_dsp_runtime_sleep(struct sst_hsw *hsw) |
| 1811 | { | 1817 | { |
| 1812 | sst_fw_unload(hsw->sst_fw); | 1818 | struct sst_fw *sst_fw, *t; |
| 1813 | sst_block_free_scratch(hsw->dsp); | 1819 | struct sst_dsp *dsp = hsw->dsp; |
| 1820 | |||
| 1821 | list_for_each_entry_safe(sst_fw, t, &dsp->fw_list, list) { | ||
| 1822 | sst_fw_unload(sst_fw); | ||
| 1823 | } | ||
| 1824 | sst_block_free_scratch(dsp); | ||
| 1814 | 1825 | ||
| 1815 | hsw->boot_complete = false; | 1826 | hsw->boot_complete = false; |
| 1816 | 1827 | ||
| 1817 | sst_dsp_sleep(hsw->dsp); | 1828 | sst_dsp_sleep(dsp); |
| 1818 | 1829 | ||
| 1819 | return 0; | 1830 | return 0; |
| 1820 | } | 1831 | } |
| @@ -1943,6 +1954,11 @@ int sst_hsw_dsp_init(struct device *dev, struct sst_pdata *pdata) | |||
| 1943 | goto fw_err; | 1954 | goto fw_err; |
| 1944 | } | 1955 | } |
| 1945 | 1956 | ||
| 1957 | /* allocate scratch mem regions */ | ||
| 1958 | ret = sst_block_alloc_scratch(hsw->dsp); | ||
| 1959 | if (ret < 0) | ||
| 1960 | goto boot_err; | ||
| 1961 | |||
| 1946 | /* wait for DSP boot completion */ | 1962 | /* wait for DSP boot completion */ |
| 1947 | sst_dsp_boot(hsw->dsp); | 1963 | sst_dsp_boot(hsw->dsp); |
| 1948 | ret = wait_event_timeout(hsw->boot_wait, hsw->boot_complete, | 1964 | ret = wait_event_timeout(hsw->boot_wait, hsw->boot_complete, |
