Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: SOF: mediatek: remove unused variables

Merge series from Trevor Wu <trevor.wu@mediatek.com>:

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.

-102
-4
sound/soc/sof/mediatek/adsp_helper.h
··· 15 15 struct mtk_adsp_chip_info { 16 16 phys_addr_t pa_sram; 17 17 phys_addr_t pa_dram; /* adsp dram physical base */ 18 - phys_addr_t pa_shared_dram; /* adsp dram physical base */ 19 18 phys_addr_t pa_cfgreg; 20 19 u32 sramsize; 21 20 u32 dramsize; 22 21 u32 cfgregsize; 23 - u32 shared_size; 24 22 void __iomem *va_sram; /* corresponding to pa_sram */ 25 23 void __iomem *va_dram; /* corresponding to pa_dram */ 26 24 void __iomem *va_cfgreg; 27 - void __iomem *shared_sram; /* part of va_sram */ 28 - void __iomem *shared_dram; /* part of va_dram */ 29 25 phys_addr_t adsp_bootup_addr; 30 26 int dram_offset; /*dram offset between system and dsp view*/ 31 27
-49
sound/soc/sof/mediatek/mt8186/mt8186.c
··· 96 96 struct mtk_adsp_chip_info *adsp = data; 97 97 int ret; 98 98 99 - mem_region = of_parse_phandle(dev->of_node, "memory-region", 0); 100 - if (!mem_region) { 101 - dev_err(dev, "no dma memory-region phandle\n"); 102 - return -ENODEV; 103 - } 104 - 105 - ret = of_address_to_resource(mem_region, 0, &res); 106 - of_node_put(mem_region); 107 - if (ret) { 108 - dev_err(dev, "of_address_to_resource dma failed\n"); 109 - return ret; 110 - } 111 - 112 - dev_dbg(dev, "DMA %pR\n", &res); 113 - 114 - adsp->pa_shared_dram = (phys_addr_t)res.start; 115 - adsp->shared_size = resource_size(&res); 116 - if (adsp->pa_shared_dram & DRAM_REMAP_MASK) { 117 - dev_err(dev, "adsp shared dma memory(%#x) is not 4K-aligned\n", 118 - (u32)adsp->pa_shared_dram); 119 - return -EINVAL; 120 - } 121 - 122 99 ret = of_reserved_mem_device_init(dev); 123 100 if (ret) { 124 101 dev_err(dev, "of_reserved_mem_device_init failed\n"); ··· 225 248 return 0; 226 249 } 227 250 228 - static int adsp_shared_base_ioremap(struct platform_device *pdev, void *data) 229 - { 230 - struct device *dev = &pdev->dev; 231 - struct mtk_adsp_chip_info *adsp = data; 232 - 233 - /* remap shared-dram base to be non-cachable */ 234 - adsp->shared_dram = devm_ioremap(dev, adsp->pa_shared_dram, 235 - adsp->shared_size); 236 - if (!adsp->shared_dram) { 237 - dev_err(dev, "failed to ioremap base %pa size %#x\n", 238 - adsp->shared_dram, adsp->shared_size); 239 - return -ENOMEM; 240 - } 241 - 242 - dev_dbg(dev, "shared-dram vbase=%p, phy addr :%pa, size=%#x\n", 243 - adsp->shared_dram, &adsp->pa_shared_dram, adsp->shared_size); 244 - 245 - return 0; 246 - } 247 - 248 251 static int mt8186_run(struct snd_sof_dev *sdev) 249 252 { 250 253 u32 adsp_bootup_addr; ··· 280 323 } 281 324 282 325 priv->adsp->va_dram = sdev->bar[SOF_FW_BLK_TYPE_SRAM]; 283 - 284 - ret = adsp_shared_base_ioremap(pdev, priv->adsp); 285 - if (ret) { 286 - dev_err(sdev->dev, "adsp_shared_base_ioremap fail!\n"); 287 - return ret; 288 - } 289 326 290 327 sdev->bar[DSP_REG_BAR] = priv->adsp->va_cfgreg; 291 328 sdev->bar[DSP_SECREG_BAR] = priv->adsp->va_secreg;
-49
sound/soc/sof/mediatek/mt8195/mt8195.c
··· 96 96 struct mtk_adsp_chip_info *adsp = data; 97 97 int ret; 98 98 99 - mem_region = of_parse_phandle(dev->of_node, "memory-region", 0); 100 - if (!mem_region) { 101 - dev_err(dev, "no dma memory-region phandle\n"); 102 - return -ENODEV; 103 - } 104 - 105 - ret = of_address_to_resource(mem_region, 0, &res); 106 - of_node_put(mem_region); 107 - if (ret) { 108 - dev_err(dev, "of_address_to_resource dma failed\n"); 109 - return ret; 110 - } 111 - 112 - dev_dbg(dev, "DMA %pR\n", &res); 113 - 114 - adsp->pa_shared_dram = (phys_addr_t)res.start; 115 - adsp->shared_size = resource_size(&res); 116 - if (adsp->pa_shared_dram & DRAM_REMAP_MASK) { 117 - dev_err(dev, "adsp shared dma memory(%#x) is not 4K-aligned\n", 118 - (u32)adsp->pa_shared_dram); 119 - return -EINVAL; 120 - } 121 - 122 99 ret = of_reserved_mem_device_init(dev); 123 100 if (ret) { 124 101 dev_err(dev, "of_reserved_mem_device_init failed\n"); ··· 215 238 return 0; 216 239 } 217 240 218 - static int adsp_shared_base_ioremap(struct platform_device *pdev, void *data) 219 - { 220 - struct device *dev = &pdev->dev; 221 - struct mtk_adsp_chip_info *adsp = data; 222 - 223 - /* remap shared-dram base to be non-cachable */ 224 - adsp->shared_dram = devm_ioremap(dev, adsp->pa_shared_dram, 225 - adsp->shared_size); 226 - if (!adsp->shared_dram) { 227 - dev_err(dev, "failed to ioremap base %pa size %#x\n", 228 - adsp->shared_dram, adsp->shared_size); 229 - return -ENOMEM; 230 - } 231 - 232 - dev_dbg(dev, "shared-dram vbase=%p, phy addr :%pa, size=%#x\n", 233 - adsp->shared_dram, &adsp->pa_shared_dram, adsp->shared_size); 234 - 235 - return 0; 236 - } 237 - 238 241 static int mt8195_run(struct snd_sof_dev *sdev) 239 242 { 240 243 u32 adsp_bootup_addr; ··· 294 337 goto err_adsp_sram_power_off; 295 338 } 296 339 priv->adsp->va_dram = sdev->bar[SOF_FW_BLK_TYPE_SRAM]; 297 - 298 - ret = adsp_shared_base_ioremap(pdev, priv->adsp); 299 - if (ret) { 300 - dev_err(sdev->dev, "adsp_shared_base_ioremap fail!\n"); 301 - goto err_adsp_sram_power_off; 302 - } 303 340 304 341 sdev->bar[DSP_REG_BAR] = priv->adsp->va_cfgreg; 305 342