mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
dmaengine: imx-sdma: use platform_device_id to identify sdma version
It might be not good to use software defined version to identify sdma device type, when hardware does not define such version. Instead, soc name is stable enough to define the device type. The patch uses platform_device_id rather than version number passed by platform data to identify sdma device type/version. Signed-off-by: Shawn Guo <[email protected]> Cc: Vinod Koul <[email protected]> Cc: Sascha Hauer <[email protected]> Acked-by: Grant Likely <[email protected]> Acked-by: Vinod Koul <[email protected]>
This commit is contained in:
parent
abfafc2d10
commit
62550cd7c0
13 changed files with 51 additions and 31 deletions
|
|
@ -308,7 +308,8 @@ static struct clk_lookup lookups[] = {
|
|||
_REGISTER_CLOCK(NULL, "audmux", audmux_clk)
|
||||
_REGISTER_CLOCK("flexcan.0", NULL, can1_clk)
|
||||
_REGISTER_CLOCK("flexcan.1", NULL, can2_clk)
|
||||
_REGISTER_CLOCK("imx-sdma", NULL, sdma_clk)
|
||||
/* i.mx25 has the i.mx35 type sdma */
|
||||
_REGISTER_CLOCK("imx35-sdma", NULL, sdma_clk)
|
||||
};
|
||||
|
||||
int __init mx25_clocks_init(void)
|
||||
|
|
|
|||
|
|
@ -565,7 +565,7 @@ static struct clk_lookup lookups[] = {
|
|||
_REGISTER_CLOCK(NULL, "ata", ata_clk)
|
||||
_REGISTER_CLOCK(NULL, "rtic", rtic_clk)
|
||||
_REGISTER_CLOCK(NULL, "rng", rng_clk)
|
||||
_REGISTER_CLOCK("imx-sdma", NULL, sdma_clk1)
|
||||
_REGISTER_CLOCK("imx31-sdma", NULL, sdma_clk1)
|
||||
_REGISTER_CLOCK(NULL, "sdma_ipg", sdma_clk2)
|
||||
_REGISTER_CLOCK(NULL, "mstick", mstick1_clk)
|
||||
_REGISTER_CLOCK(NULL, "mstick", mstick2_clk)
|
||||
|
|
|
|||
|
|
@ -482,7 +482,7 @@ static struct clk_lookup lookups[] = {
|
|||
_REGISTER_CLOCK(NULL, "rtc", rtc_clk)
|
||||
_REGISTER_CLOCK(NULL, "rtic", rtic_clk)
|
||||
_REGISTER_CLOCK(NULL, "scc", scc_clk)
|
||||
_REGISTER_CLOCK("imx-sdma", NULL, sdma_clk)
|
||||
_REGISTER_CLOCK("imx35-sdma", NULL, sdma_clk)
|
||||
_REGISTER_CLOCK(NULL, "spba", spba_clk)
|
||||
_REGISTER_CLOCK(NULL, "spdif", spdif_clk)
|
||||
_REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
|
||||
|
|
|
|||
|
|
@ -79,7 +79,6 @@ static struct sdma_script_start_addrs imx25_sdma_script __initdata = {
|
|||
};
|
||||
|
||||
static struct sdma_platform_data imx25_sdma_pdata __initdata = {
|
||||
.sdma_version = 2,
|
||||
.fw_name = "sdma-imx25.bin",
|
||||
.script_addrs = &imx25_sdma_script,
|
||||
};
|
||||
|
|
@ -92,5 +91,6 @@ void __init imx25_soc_init(void)
|
|||
mxc_register_gpio("imx31-gpio", 2, MX25_GPIO3_BASE_ADDR, SZ_16K, MX25_INT_GPIO3, 0);
|
||||
mxc_register_gpio("imx31-gpio", 3, MX25_GPIO4_BASE_ADDR, SZ_16K, MX25_INT_GPIO4, 0);
|
||||
|
||||
imx_add_imx_sdma(MX25_SDMA_BASE_ADDR, MX25_INT_SDMA, &imx25_sdma_pdata);
|
||||
/* i.mx25 has the i.mx35 type sdma */
|
||||
imx_add_imx_sdma("imx35-sdma", MX25_SDMA_BASE_ADDR, MX25_INT_SDMA, &imx25_sdma_pdata);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ static struct sdma_script_start_addrs imx31_to2_sdma_script __initdata = {
|
|||
};
|
||||
|
||||
static struct sdma_platform_data imx31_sdma_pdata __initdata = {
|
||||
.sdma_version = 1,
|
||||
.fw_name = "sdma-imx31-to2.bin",
|
||||
.script_addrs = &imx31_to2_sdma_script,
|
||||
};
|
||||
|
|
@ -88,5 +87,5 @@ void __init imx31_soc_init(void)
|
|||
imx31_sdma_pdata.script_addrs = &imx31_to1_sdma_script;
|
||||
}
|
||||
|
||||
imx_add_imx_sdma(MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata);
|
||||
imx_add_imx_sdma("imx31-sdma", MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,6 @@ static struct sdma_script_start_addrs imx35_to2_sdma_script __initdata = {
|
|||
};
|
||||
|
||||
static struct sdma_platform_data imx35_sdma_pdata __initdata = {
|
||||
.sdma_version = 2,
|
||||
.fw_name = "sdma-imx35-to2.bin",
|
||||
.script_addrs = &imx35_to2_sdma_script,
|
||||
};
|
||||
|
|
@ -106,5 +105,5 @@ void __init imx35_soc_init(void)
|
|||
imx35_sdma_pdata.script_addrs = &imx35_to1_sdma_script;
|
||||
}
|
||||
|
||||
imx_add_imx_sdma(MX35_SDMA_BASE_ADDR, MX35_INT_SDMA, &imx35_sdma_pdata);
|
||||
imx_add_imx_sdma("imx35-sdma", MX35_SDMA_BASE_ADDR, MX35_INT_SDMA, &imx35_sdma_pdata);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1448,7 +1448,8 @@ static struct clk_lookup mx51_lookups[] = {
|
|||
_REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
|
||||
_REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
|
||||
_REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk)
|
||||
_REGISTER_CLOCK("imx-sdma", NULL, sdma_clk)
|
||||
/* i.mx51 has the i.mx35 type sdma */
|
||||
_REGISTER_CLOCK("imx35-sdma", NULL, sdma_clk)
|
||||
_REGISTER_CLOCK(NULL, "ckih", ckih_clk)
|
||||
_REGISTER_CLOCK(NULL, "ckih2", ckih2_clk)
|
||||
_REGISTER_CLOCK(NULL, "gpt_32k", gpt_32k_clk)
|
||||
|
|
@ -1496,7 +1497,8 @@ static struct clk_lookup mx53_lookups[] = {
|
|||
_REGISTER_CLOCK("sdhci-esdhc-imx53.3", NULL, esdhc4_mx53_clk)
|
||||
_REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk)
|
||||
_REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk)
|
||||
_REGISTER_CLOCK("imx-sdma", NULL, sdma_clk)
|
||||
/* i.mx53 has the i.mx35 type sdma */
|
||||
_REGISTER_CLOCK("imx35-sdma", NULL, sdma_clk)
|
||||
_REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
|
||||
_REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
|
||||
_REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk)
|
||||
|
|
|
|||
|
|
@ -115,7 +115,6 @@ static struct sdma_script_start_addrs imx51_sdma_script __initdata = {
|
|||
};
|
||||
|
||||
static struct sdma_platform_data imx51_sdma_pdata __initdata = {
|
||||
.sdma_version = 2,
|
||||
.fw_name = "sdma-imx51.bin",
|
||||
.script_addrs = &imx51_sdma_script,
|
||||
};
|
||||
|
|
@ -135,7 +134,6 @@ static struct sdma_script_start_addrs imx53_sdma_script __initdata = {
|
|||
};
|
||||
|
||||
static struct sdma_platform_data imx53_sdma_pdata __initdata = {
|
||||
.sdma_version = 2,
|
||||
.fw_name = "sdma-imx53.bin",
|
||||
.script_addrs = &imx53_sdma_script,
|
||||
};
|
||||
|
|
@ -148,7 +146,8 @@ void __init imx51_soc_init(void)
|
|||
mxc_register_gpio("imx31-gpio", 2, MX51_GPIO3_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO3_LOW, MX51_MXC_INT_GPIO3_HIGH);
|
||||
mxc_register_gpio("imx31-gpio", 3, MX51_GPIO4_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO4_LOW, MX51_MXC_INT_GPIO4_HIGH);
|
||||
|
||||
imx_add_imx_sdma(MX51_SDMA_BASE_ADDR, MX51_INT_SDMA, &imx51_sdma_pdata);
|
||||
/* i.mx51 has the i.mx35 type sdma */
|
||||
imx_add_imx_sdma("imx35-sdma", MX51_SDMA_BASE_ADDR, MX51_INT_SDMA, &imx51_sdma_pdata);
|
||||
}
|
||||
|
||||
void __init imx53_soc_init(void)
|
||||
|
|
@ -162,5 +161,6 @@ void __init imx53_soc_init(void)
|
|||
mxc_register_gpio("imx31-gpio", 5, MX53_GPIO6_BASE_ADDR, SZ_16K, MX53_INT_GPIO6_LOW, MX53_INT_GPIO6_HIGH);
|
||||
mxc_register_gpio("imx31-gpio", 6, MX53_GPIO7_BASE_ADDR, SZ_16K, MX53_INT_GPIO7_LOW, MX53_INT_GPIO7_HIGH);
|
||||
|
||||
imx_add_imx_sdma(MX53_SDMA_BASE_ADDR, MX53_INT_SDMA, &imx53_sdma_pdata);
|
||||
/* i.mx53 has the i.mx35 type sdma */
|
||||
imx_add_imx_sdma("imx35-sdma", MX53_SDMA_BASE_ADDR, MX53_INT_SDMA, &imx53_sdma_pdata);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct platform_device __init __maybe_unused *imx_add_imx_dma(void)
|
|||
"imx-dma", -1, NULL, 0, NULL, 0);
|
||||
}
|
||||
|
||||
struct platform_device __init __maybe_unused *imx_add_imx_sdma(
|
||||
struct platform_device __init __maybe_unused *imx_add_imx_sdma(char *name,
|
||||
resource_size_t iobase, int irq, struct sdma_platform_data *pdata)
|
||||
{
|
||||
struct resource res[] = {
|
||||
|
|
@ -29,6 +29,6 @@ struct platform_device __init __maybe_unused *imx_add_imx_sdma(
|
|||
},
|
||||
};
|
||||
|
||||
return platform_device_register_resndata(&mxc_ahb_bus, "imx-sdma",
|
||||
return platform_device_register_resndata(&mxc_ahb_bus, name,
|
||||
-1, res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -299,5 +299,5 @@ struct platform_device *__init imx_add_spi_imx(
|
|||
const struct spi_imx_master *pdata);
|
||||
|
||||
struct platform_device *imx_add_imx_dma(void);
|
||||
struct platform_device *imx_add_imx_sdma(
|
||||
struct platform_device *imx_add_imx_sdma(char *name,
|
||||
resource_size_t iobase, int irq, struct sdma_platform_data *pdata);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,8 @@ static inline int imx_dma_is_ipu(struct dma_chan *chan)
|
|||
|
||||
static inline int imx_dma_is_general_purpose(struct dma_chan *chan)
|
||||
{
|
||||
return !strcmp(dev_name(chan->device->dev), "imx-sdma") ||
|
||||
return !strcmp(dev_name(chan->device->dev), "imx31-sdma") ||
|
||||
!strcmp(dev_name(chan->device->dev), "imx35-sdma") ||
|
||||
!strcmp(dev_name(chan->device->dev), "imx-dma");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,12 +48,10 @@ struct sdma_script_start_addrs {
|
|||
/**
|
||||
* struct sdma_platform_data - platform specific data for SDMA engine
|
||||
*
|
||||
* @sdma_version The version of this SDMA engine
|
||||
* @fw_name The firmware name
|
||||
* @script_addrs SDMA scripts addresses in SDMA ROM
|
||||
*/
|
||||
struct sdma_platform_data {
|
||||
int sdma_version;
|
||||
char *fw_name;
|
||||
struct sdma_script_start_addrs *script_addrs;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue