mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +00:00
ASoC: SOF: amd: Use the basefw firmware container directly
Switch to access to the firmware struct via sdev->basefw container to unblock the removal of the firmware information from plat_data. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Chao Song <chao.song@intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20221020121238.18339-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
4f373ccf22
commit
b9bed09aa9
1 changed files with 2 additions and 4 deletions
|
@ -48,7 +48,6 @@ EXPORT_SYMBOL_NS(acp_dsp_block_read, SND_SOC_SOF_AMD_COMMON);
|
|||
int acp_dsp_block_write(struct snd_sof_dev *sdev, enum snd_sof_fw_blk_type blk_type,
|
||||
u32 offset, void *src, size_t size)
|
||||
{
|
||||
struct snd_sof_pdata *plat_data = sdev->pdata;
|
||||
struct pci_dev *pci = to_pci_dev(sdev->dev);
|
||||
const struct sof_amd_acp_desc *desc = get_chip_info(sdev->pdata);
|
||||
struct acp_dev_data *adata;
|
||||
|
@ -61,7 +60,7 @@ int acp_dsp_block_write(struct snd_sof_dev *sdev, enum snd_sof_fw_blk_type blk_t
|
|||
switch (blk_type) {
|
||||
case SOF_FW_BLK_TYPE_IRAM:
|
||||
if (!adata->bin_buf) {
|
||||
size_fw = plat_data->fw->size;
|
||||
size_fw = sdev->basefw.fw->size;
|
||||
page_count = PAGE_ALIGN(size_fw) >> PAGE_SHIFT;
|
||||
dma_size = page_count * ACP_PAGE_SIZE;
|
||||
adata->bin_buf = dma_alloc_coherent(&pci->dev, dma_size,
|
||||
|
@ -152,7 +151,6 @@ static void configure_pte_for_fw_loading(int type, int num_pages, struct acp_dev
|
|||
int acp_dsp_pre_fw_run(struct snd_sof_dev *sdev)
|
||||
{
|
||||
struct pci_dev *pci = to_pci_dev(sdev->dev);
|
||||
struct snd_sof_pdata *plat_data = sdev->pdata;
|
||||
struct acp_dev_data *adata;
|
||||
unsigned int src_addr, size_fw;
|
||||
u32 page_count, dma_size;
|
||||
|
@ -186,7 +184,7 @@ int acp_dsp_pre_fw_run(struct snd_sof_dev *sdev)
|
|||
dev_err(sdev->dev, "acp dma transfer status: %d\n", ret);
|
||||
|
||||
/* Free memory once DMA is complete */
|
||||
dma_size = (PAGE_ALIGN(plat_data->fw->size) >> PAGE_SHIFT) * ACP_PAGE_SIZE;
|
||||
dma_size = (PAGE_ALIGN(sdev->basefw.fw->size) >> PAGE_SHIFT) * ACP_PAGE_SIZE;
|
||||
dma_free_coherent(&pci->dev, dma_size, adata->bin_buf, adata->sha_dma_addr);
|
||||
dma_free_coherent(&pci->dev, ACP_DEFAULT_DRAM_LENGTH, adata->data_buf, adata->dma_addr);
|
||||
adata->bin_buf = NULL;
|
||||
|
|
Loading…
Reference in a new issue