mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
dmaengine: imx-sdma: pass sdma firmware name via platform data
It is not good to have cpu_name and to_version encoded into sdma firmware name as variables. For example, there are three TOs of imx51 soc, the sdma script never changes since TO1, which means all three TOs of imx51 uses TO1 version of sdma script. But we have to prepare three identical firmwares, sdma-imx51-to1.bin sdma-imx51-to2.bin and sdma-imx51-to3.bin, to have the kernel capable of running on all three TOs. The patch removes cpu_name and to_version from sdma platform data, and instead uses fw_name to pass the firmware name, so that we can pass the TO version where it's relevant and skip it where only one firmware exists. Signed-off-by: Shawn Guo <[email protected]> Acked-by: Vinod Koul <[email protected]> Signed-off-by: Sascha Hauer <[email protected]>
This commit is contained in:
parent
3622360430
commit
2e534b21a5
6 changed files with 20 additions and 22 deletions
|
|
@ -1105,7 +1105,7 @@ static void sdma_add_scripts(struct sdma_engine *sdma,
|
|||
}
|
||||
|
||||
static int __init sdma_get_firmware(struct sdma_engine *sdma,
|
||||
const char *cpu_name, int to_version)
|
||||
const char *fw_name)
|
||||
{
|
||||
const struct firmware *fw;
|
||||
char *fwname;
|
||||
|
|
@ -1114,7 +1114,7 @@ static int __init sdma_get_firmware(struct sdma_engine *sdma,
|
|||
const struct sdma_script_start_addrs *addr;
|
||||
unsigned short *ram_code;
|
||||
|
||||
fwname = kasprintf(GFP_KERNEL, "sdma-%s-to%d.bin", cpu_name, to_version);
|
||||
fwname = kasprintf(GFP_KERNEL, "%s", fw_name);
|
||||
if (!fwname)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -1317,7 +1317,7 @@ static int __init sdma_probe(struct platform_device *pdev)
|
|||
if (pdata->script_addrs)
|
||||
sdma_add_scripts(sdma, pdata->script_addrs);
|
||||
|
||||
sdma_get_firmware(sdma, pdata->cpu_name, pdata->to_version);
|
||||
sdma_get_firmware(sdma, pdata->fw_name);
|
||||
|
||||
sdma->dma_device.dev = &pdev->dev;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue