ASoC: SOF: mediatek: remove unused variables
Subsystems (4)
cover ASoC: SOF: mediatek: remove unused variables
There are some variables that are no longer being used because they were declared for the deprecated memory layout. Currently, these code sections confuse the users. Therefore, this series removes the code that was implemented for those variables.
Trevor Wu (3):
ASoC: SOF: mediatek: mt8195: clean up unused code
ASoC: SOF: mediatek: mt8186: clean up unused code
ASoC: SOF: mediatek: remove unused variables
sound/soc/sof/mediatek/adsp_helper.h | 4 --- sound/soc/sof/mediatek/mt8186/mt8186.c | 49 -------------------------- sound/soc/sof/mediatek/mt8195/mt8195.c | 49 -------------------------- 3 files changed, 102 deletions(-)
Signature · 1 line
2.18.0
PATCH 1/3 ASoC: SOF: mediatek: mt8195: clean up unused code
Since there are some variables that are no longer being used, we remove the code that was implemented for those variables.
--- sound/soc/sof/mediatek/mt8195/mt8195.c | 49 -------------------------- 1 file changed, 49 deletions(-)
sound/soc/sof/mediatek/mt8195/mt8195.c +0 -49
@@ -96,29 +96,6 @@ static int platform_parse_resource(struct platform_device *pdev, void *data)struct mtk_adsp_chip_info *adsp = data;int ret; - mem_region =of_parse_phandle (dev->of_node,"memory-region" ,0 ); -if (!mem_region) { -dev_err (dev,"no dma memory-region phandle\n" ); -return -ENODEV ; - } - - ret =of_address_to_resource (mem_region,0 , &res); -of_node_put (mem_region); -if (ret) { -dev_err (dev,"of_address_to_resource dma failed\n" ); -return ret; - } - -dev_dbg (dev,"DMA %pR\n" , &res); - - adsp->pa_shared_dram = (phys_addr_t )res.start; - adsp->shared_size =resource_size (&res); -if (adsp->pa_shared_dram &DRAM_REMAP_MASK ) { -dev_err (dev,"adsp shared dma memory(%#x) is not 4K-aligned\n" , - (u32 )adsp->pa_shared_dram); -return -EINVAL ; - } - ret =of_reserved_mem_device_init (dev);if (ret) {dev_err (dev,"of_reserved_mem_device_init failed\n" );
@@ -238,26 +215,6 @@ static int adsp_memory_remap_init(struct device *dev, struct mtk_adsp_chip_inforeturn 0 ; } -static int adsp_shared_base_ioremap (struct platform_device *pdev,void *data) -{ -struct device *dev = &pdev->dev; -struct mtk_adsp_chip_info *adsp = data; - -/* remap shared-dram base to be non-cachable */ - adsp->shared_dram =devm_ioremap (dev, adsp->pa_shared_dram, - adsp->shared_size); -if (!adsp->shared_dram) { -dev_err (dev,"failed to ioremap base %pa size %#x\n" , - adsp->shared_dram, adsp->shared_size); -return -ENOMEM ; - } - -dev_dbg (dev,"shared-dram vbase=%p, phy addr :%pa, size=%#x\n" , - adsp->shared_dram, &adsp->pa_shared_dram, adsp->shared_size); - -return 0 ; -} -static int mt8195_run (struct snd_sof_dev *sdev) {u32 adsp_bootup_addr;
@@ -338,12 +295,6 @@ static int mt8195_dsp_probe(struct snd_sof_dev *sdev) } priv->adsp->va_dram = sdev->bar[SOF_FW_BLK_TYPE_SRAM ]; - ret =adsp_shared_base_ioremap (pdev, priv->adsp); -if (ret) { -dev_err (sdev->dev,"adsp_shared_base_ioremap fail!\n" ); - goto err_adsp_sram_power_off; - } - sdev->bar[DSP_REG_BAR ] = priv->adsp->va_cfgreg; sdev->mmio_bar =SOF_FW_BLK_TYPE_SRAM ;
Signature · 1 line
2.18.0
Re: [PATCH 1/3] ASoC: SOF: mediatek: mt8195: clean up unused code
Il 03/11/23 10:54, Trevor Wu ha scritto:
Quoted 5 lines
Since there are some variables that are no longer being used, we remove the code that was implemented for those variables.
Signed-off-by Trevor Wu <[email protected]>Reviewed-by Yaochun Hung <[email protected]>
On MT8195 Cherry Tomato:
PATCH 2/3 ASoC: SOF: mediatek: mt8186: clean up unused code
In reply to Trevor WuSince there are some variables that are no longer being used, we remove the code that was implemented for those variables.
--- sound/soc/sof/mediatek/mt8186/mt8186.c | 49 -------------------------- 1 file changed, 49 deletions(-)
sound/soc/sof/mediatek/mt8186/mt8186.c +0 -49
@@ -96,29 +96,6 @@ static int platform_parse_resource(struct platform_device *pdev, void *data)struct mtk_adsp_chip_info *adsp = data;int ret; - mem_region =of_parse_phandle (dev->of_node,"memory-region" ,0 ); -if (!mem_region) { -dev_err (dev,"no dma memory-region phandle\n" ); -return -ENODEV ; - } - - ret =of_address_to_resource (mem_region,0 , &res); -of_node_put (mem_region); -if (ret) { -dev_err (dev,"of_address_to_resource dma failed\n" ); -return ret; - } - -dev_dbg (dev,"DMA %pR\n" , &res); - - adsp->pa_shared_dram = (phys_addr_t )res.start; - adsp->shared_size =resource_size (&res); -if (adsp->pa_shared_dram &DRAM_REMAP_MASK ) { -dev_err (dev,"adsp shared dma memory(%#x) is not 4K-aligned\n" , - (u32 )adsp->pa_shared_dram); -return -EINVAL ; - } - ret =of_reserved_mem_device_init (dev);if (ret) {dev_err (dev,"of_reserved_mem_device_init failed\n" );
@@ -248,26 +225,6 @@ static int adsp_memory_remap_init(struct snd_sof_dev *sdev, struct mtk_adsp_chipreturn 0 ; } -static int adsp_shared_base_ioremap (struct platform_device *pdev,void *data) -{ -struct device *dev = &pdev->dev; -struct mtk_adsp_chip_info *adsp = data; - -/* remap shared-dram base to be non-cachable */ - adsp->shared_dram =devm_ioremap (dev, adsp->pa_shared_dram, - adsp->shared_size); -if (!adsp->shared_dram) { -dev_err (dev,"failed to ioremap base %pa size %#x\n" , - adsp->shared_dram, adsp->shared_size); -return -ENOMEM ; - } - -dev_dbg (dev,"shared-dram vbase=%p, phy addr :%pa, size=%#x\n" , - adsp->shared_dram, &adsp->pa_shared_dram, adsp->shared_size); - -return 0 ; -} -static int mt8186_run (struct snd_sof_dev *sdev) {u32 adsp_bootup_addr;
@@ -324,12 +281,6 @@ static int mt8186_dsp_probe(struct snd_sof_dev *sdev) priv->adsp->va_dram = sdev->bar[SOF_FW_BLK_TYPE_SRAM ]; - ret =adsp_shared_base_ioremap (pdev, priv->adsp); -if (ret) { -dev_err (sdev->dev,"adsp_shared_base_ioremap fail!\n" ); -return ret; - } - sdev->bar[DSP_REG_BAR ] = priv->adsp->va_cfgreg; sdev->bar[DSP_SECREG_BAR ] = priv->adsp->va_secreg; sdev->bar[DSP_BUSREG_BAR ] = priv->adsp->va_busreg;
Signature · 1 line
2.18.0
Re: [PATCH 2/3] ASoC: SOF: mediatek: mt8186: clean up unused code
Il 03/11/23 10:54, Trevor Wu ha scritto:
Quoted 5 lines
Since there are some variables that are no longer being used, we remove the code that was implemented for those variables.
Signed-off-by Trevor Wu <[email protected]>Reviewed-by Yaochun Hung <[email protected]>
PATCH 3/3 ASoC: SOF: mediatek: remove unused variables
In reply to Trevor WuTo prevent confusion on the follow-up platform, it is necessary to remove any unused variables within the struct mtk_adsp_chip_info.
--- sound/soc/sof/mediatek/adsp_helper.h | 4 ---- 1 file changed, 4 deletions(-)
sound/soc/sof/mediatek/adsp_helper.h +0 -4
@@ -15,17 +15,13 @@struct mtk_adsp_chip_info {phys_addr_t pa_sram;phys_addr_t pa_dram;/* adsp dram physical base */ -phys_addr_t pa_shared_dram;/* adsp dram physical base */ phys_addr_t pa_cfgreg;u32 sramsize;u32 dramsize;u32 cfgregsize; -u32 shared_size;void __iomem *va_sram;/* corresponding to pa_sram */ void __iomem *va_dram;/* corresponding to pa_dram */ void __iomem *va_cfgreg; -void __iomem *shared_sram;/* part of va_sram */ -void __iomem *shared_dram;/* part of va_dram */ phys_addr_t adsp_bootup_addr;int dram_offset;/*dram offset between system and dsp view*/
Signature · 1 line
2.18.0
Il 03/11/23 10:54, Trevor Wu ha scritto:
Quoted 5 lines
To prevent confusion on the follow-up platform, it is necessary to remove any unused variables within the struct
mtk_adsp_chip_info.Signed-off-by Trevor Wu <[email protected]>Reviewed-by Yaochun Hung <[email protected]>
Mark Brown
maintainerQuoted 11 lines · Trevor Wu
There are some variables that are no longer being used because they were declared for the deprecated memory layout. Currently, these code sections confuse the users. Therefore, this series removes the code that was implemented for those variables.
Trevor Wu (3):
ASoC: SOF: mediatek: mt8195: clean up unused code
ASoC: SOF: mediatek: mt8186: clean up unused code
ASoC: SOF: mediatek: remove unused variables[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/3] ASoC: SOF: mediatek: mt8195: clean up unused code
commit: ab475966455ce285c2c9978a3e3bfe97d75ff8d4
[2/3] ASoC: SOF: mediatek: mt8186: clean up unused code
commit: a4de5a345cf76c6f294a906e11c2fb675a46fd3d
[3/3] ASoC: SOF: mediatek: remove unused variables
commit: 82e340ca3f25dc3ddd20e88e3606ed9006f90f5dAll being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark