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 <shawn.guo@linaro.org>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Shawn Guo
2011-06-22 22:41:31 +08:00
committed by Sascha Hauer
parent 3622360430
commit 2e534b21a5
6 changed files with 20 additions and 22 deletions

View File

@@ -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;