aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2011-07-13 09:33:17 -0400
committerShawn Guo <shawn.guo@linaro.org>2011-07-26 21:31:45 -0400
commit62550cd7c08f1a38d0ade1de18baec10f83412bb (patch)
treee7e826885d6a1bf98acee27d35dd01fcb4cf8308 /arch/arm
parentabfafc2d10ee2ad217be9ef06181819ca5dd6960 (diff)
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 <shawn.guo@linaro.org> Cc: Vinod Koul <vinod.koul@intel.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-imx/clock-imx25.c3
-rw-r--r--arch/arm/mach-imx/clock-imx31.c2
-rw-r--r--arch/arm/mach-imx/clock-imx35.c2
-rw-r--r--arch/arm/mach-imx/mm-imx25.c4
-rw-r--r--arch/arm/mach-imx/mm-imx31.c3
-rw-r--r--arch/arm/mach-imx/mm-imx35.c3
-rw-r--r--arch/arm/mach-mx5/clock-mx51-mx53.c6
-rw-r--r--arch/arm/mach-mx5/mm.c8
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx-dma.c4
-rw-r--r--arch/arm/plat-mxc/include/mach/devices-common.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/dma.h3
-rw-r--r--arch/arm/plat-mxc/include/mach/sdma.h2
12 files changed, 21 insertions, 21 deletions
diff --git a/arch/arm/mach-imx/clock-imx25.c b/arch/arm/mach-imx/clock-imx25.c
index 991ccc94d6f7..0fc7ba56d616 100644
--- a/arch/arm/mach-imx/clock-imx25.c
+++ b/arch/arm/mach-imx/clock-imx25.c
@@ -308,7 +308,8 @@ static struct clk_lookup lookups[] = {
308 _REGISTER_CLOCK(NULL, "audmux", audmux_clk) 308 _REGISTER_CLOCK(NULL, "audmux", audmux_clk)
309 _REGISTER_CLOCK("flexcan.0", NULL, can1_clk) 309 _REGISTER_CLOCK("flexcan.0", NULL, can1_clk)
310 _REGISTER_CLOCK("flexcan.1", NULL, can2_clk) 310 _REGISTER_CLOCK("flexcan.1", NULL, can2_clk)
311 _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk) 311 /* i.mx25 has the i.mx35 type sdma */
312 _REGISTER_CLOCK("imx35-sdma", NULL, sdma_clk)
312}; 313};
313 314
314int __init mx25_clocks_init(void) 315int __init mx25_clocks_init(void)
diff --git a/arch/arm/mach-imx/clock-imx31.c b/arch/arm/mach-imx/clock-imx31.c
index 8d212a93ee7f..d973770b1f96 100644
--- a/arch/arm/mach-imx/clock-imx31.c
+++ b/arch/arm/mach-imx/clock-imx31.c
@@ -565,7 +565,7 @@ static struct clk_lookup lookups[] = {
565 _REGISTER_CLOCK(NULL, "ata", ata_clk) 565 _REGISTER_CLOCK(NULL, "ata", ata_clk)
566 _REGISTER_CLOCK(NULL, "rtic", rtic_clk) 566 _REGISTER_CLOCK(NULL, "rtic", rtic_clk)
567 _REGISTER_CLOCK(NULL, "rng", rng_clk) 567 _REGISTER_CLOCK(NULL, "rng", rng_clk)
568 _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk1) 568 _REGISTER_CLOCK("imx31-sdma", NULL, sdma_clk1)
569 _REGISTER_CLOCK(NULL, "sdma_ipg", sdma_clk2) 569 _REGISTER_CLOCK(NULL, "sdma_ipg", sdma_clk2)
570 _REGISTER_CLOCK(NULL, "mstick", mstick1_clk) 570 _REGISTER_CLOCK(NULL, "mstick", mstick1_clk)
571 _REGISTER_CLOCK(NULL, "mstick", mstick2_clk) 571 _REGISTER_CLOCK(NULL, "mstick", mstick2_clk)
diff --git a/arch/arm/mach-imx/clock-imx35.c b/arch/arm/mach-imx/clock-imx35.c
index cecd63b5328e..88b62a071aea 100644
--- a/arch/arm/mach-imx/clock-imx35.c
+++ b/arch/arm/mach-imx/clock-imx35.c
@@ -482,7 +482,7 @@ static struct clk_lookup lookups[] = {
482 _REGISTER_CLOCK(NULL, "rtc", rtc_clk) 482 _REGISTER_CLOCK(NULL, "rtc", rtc_clk)
483 _REGISTER_CLOCK(NULL, "rtic", rtic_clk) 483 _REGISTER_CLOCK(NULL, "rtic", rtic_clk)
484 _REGISTER_CLOCK(NULL, "scc", scc_clk) 484 _REGISTER_CLOCK(NULL, "scc", scc_clk)
485 _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk) 485 _REGISTER_CLOCK("imx35-sdma", NULL, sdma_clk)
486 _REGISTER_CLOCK(NULL, "spba", spba_clk) 486 _REGISTER_CLOCK(NULL, "spba", spba_clk)
487 _REGISTER_CLOCK(NULL, "spdif", spdif_clk) 487 _REGISTER_CLOCK(NULL, "spdif", spdif_clk)
488 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) 488 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
diff --git a/arch/arm/mach-imx/mm-imx25.c b/arch/arm/mach-imx/mm-imx25.c
index 8bf029164652..cc4d152bd9bd 100644
--- a/arch/arm/mach-imx/mm-imx25.c
+++ b/arch/arm/mach-imx/mm-imx25.c
@@ -79,7 +79,6 @@ static struct sdma_script_start_addrs imx25_sdma_script __initdata = {
79}; 79};
80 80
81static struct sdma_platform_data imx25_sdma_pdata __initdata = { 81static struct sdma_platform_data imx25_sdma_pdata __initdata = {
82 .sdma_version = 2,
83 .fw_name = "sdma-imx25.bin", 82 .fw_name = "sdma-imx25.bin",
84 .script_addrs = &imx25_sdma_script, 83 .script_addrs = &imx25_sdma_script,
85}; 84};
@@ -92,5 +91,6 @@ void __init imx25_soc_init(void)
92 mxc_register_gpio("imx31-gpio", 2, MX25_GPIO3_BASE_ADDR, SZ_16K, MX25_INT_GPIO3, 0); 91 mxc_register_gpio("imx31-gpio", 2, MX25_GPIO3_BASE_ADDR, SZ_16K, MX25_INT_GPIO3, 0);
93 mxc_register_gpio("imx31-gpio", 3, MX25_GPIO4_BASE_ADDR, SZ_16K, MX25_INT_GPIO4, 0); 92 mxc_register_gpio("imx31-gpio", 3, MX25_GPIO4_BASE_ADDR, SZ_16K, MX25_INT_GPIO4, 0);
94 93
95 imx_add_imx_sdma(MX25_SDMA_BASE_ADDR, MX25_INT_SDMA, &imx25_sdma_pdata); 94 /* i.mx25 has the i.mx35 type sdma */
95 imx_add_imx_sdma("imx35-sdma", MX25_SDMA_BASE_ADDR, MX25_INT_SDMA, &imx25_sdma_pdata);
96} 96}
diff --git a/arch/arm/mach-imx/mm-imx31.c b/arch/arm/mach-imx/mm-imx31.c
index 61bff38cb955..b7c55e7db000 100644
--- a/arch/arm/mach-imx/mm-imx31.c
+++ b/arch/arm/mach-imx/mm-imx31.c
@@ -69,7 +69,6 @@ static struct sdma_script_start_addrs imx31_to2_sdma_script __initdata = {
69}; 69};
70 70
71static struct sdma_platform_data imx31_sdma_pdata __initdata = { 71static struct sdma_platform_data imx31_sdma_pdata __initdata = {
72 .sdma_version = 1,
73 .fw_name = "sdma-imx31-to2.bin", 72 .fw_name = "sdma-imx31-to2.bin",
74 .script_addrs = &imx31_to2_sdma_script, 73 .script_addrs = &imx31_to2_sdma_script,
75}; 74};
@@ -88,5 +87,5 @@ void __init imx31_soc_init(void)
88 imx31_sdma_pdata.script_addrs = &imx31_to1_sdma_script; 87 imx31_sdma_pdata.script_addrs = &imx31_to1_sdma_script;
89 } 88 }
90 89
91 imx_add_imx_sdma(MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata); 90 imx_add_imx_sdma("imx31-sdma", MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata);
92} 91}
diff --git a/arch/arm/mach-imx/mm-imx35.c b/arch/arm/mach-imx/mm-imx35.c
index 98769ae34377..f49bac7a1ede 100644
--- a/arch/arm/mach-imx/mm-imx35.c
+++ b/arch/arm/mach-imx/mm-imx35.c
@@ -86,7 +86,6 @@ static struct sdma_script_start_addrs imx35_to2_sdma_script __initdata = {
86}; 86};
87 87
88static struct sdma_platform_data imx35_sdma_pdata __initdata = { 88static struct sdma_platform_data imx35_sdma_pdata __initdata = {
89 .sdma_version = 2,
90 .fw_name = "sdma-imx35-to2.bin", 89 .fw_name = "sdma-imx35-to2.bin",
91 .script_addrs = &imx35_to2_sdma_script, 90 .script_addrs = &imx35_to2_sdma_script,
92}; 91};
@@ -106,5 +105,5 @@ void __init imx35_soc_init(void)
106 imx35_sdma_pdata.script_addrs = &imx35_to1_sdma_script; 105 imx35_sdma_pdata.script_addrs = &imx35_to1_sdma_script;
107 } 106 }
108 107
109 imx_add_imx_sdma(MX35_SDMA_BASE_ADDR, MX35_INT_SDMA, &imx35_sdma_pdata); 108 imx_add_imx_sdma("imx35-sdma", MX35_SDMA_BASE_ADDR, MX35_INT_SDMA, &imx35_sdma_pdata);
110} 109}
diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
index e3d3eb55e3f8..7f20308c4dbd 100644
--- a/arch/arm/mach-mx5/clock-mx51-mx53.c
+++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
@@ -1448,7 +1448,8 @@ static struct clk_lookup mx51_lookups[] = {
1448 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) 1448 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
1449 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) 1449 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
1450 _REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk) 1450 _REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk)
1451 _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk) 1451 /* i.mx51 has the i.mx35 type sdma */
1452 _REGISTER_CLOCK("imx35-sdma", NULL, sdma_clk)
1452 _REGISTER_CLOCK(NULL, "ckih", ckih_clk) 1453 _REGISTER_CLOCK(NULL, "ckih", ckih_clk)
1453 _REGISTER_CLOCK(NULL, "ckih2", ckih2_clk) 1454 _REGISTER_CLOCK(NULL, "ckih2", ckih2_clk)
1454 _REGISTER_CLOCK(NULL, "gpt_32k", gpt_32k_clk) 1455 _REGISTER_CLOCK(NULL, "gpt_32k", gpt_32k_clk)
@@ -1496,7 +1497,8 @@ static struct clk_lookup mx53_lookups[] = {
1496 _REGISTER_CLOCK("sdhci-esdhc-imx53.3", NULL, esdhc4_mx53_clk) 1497 _REGISTER_CLOCK("sdhci-esdhc-imx53.3", NULL, esdhc4_mx53_clk)
1497 _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk) 1498 _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk)
1498 _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk) 1499 _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk)
1499 _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk) 1500 /* i.mx53 has the i.mx35 type sdma */
1501 _REGISTER_CLOCK("imx35-sdma", NULL, sdma_clk)
1500 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) 1502 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
1501 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) 1503 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
1502 _REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk) 1504 _REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk)
diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c
index ef8aec9319b6..baea6e5cddd9 100644
--- a/arch/arm/mach-mx5/mm.c
+++ b/arch/arm/mach-mx5/mm.c
@@ -115,7 +115,6 @@ static struct sdma_script_start_addrs imx51_sdma_script __initdata = {
115}; 115};
116 116
117static struct sdma_platform_data imx51_sdma_pdata __initdata = { 117static struct sdma_platform_data imx51_sdma_pdata __initdata = {
118 .sdma_version = 2,
119 .fw_name = "sdma-imx51.bin", 118 .fw_name = "sdma-imx51.bin",
120 .script_addrs = &imx51_sdma_script, 119 .script_addrs = &imx51_sdma_script,
121}; 120};
@@ -135,7 +134,6 @@ static struct sdma_script_start_addrs imx53_sdma_script __initdata = {
135}; 134};
136 135
137static struct sdma_platform_data imx53_sdma_pdata __initdata = { 136static struct sdma_platform_data imx53_sdma_pdata __initdata = {
138 .sdma_version = 2,
139 .fw_name = "sdma-imx53.bin", 137 .fw_name = "sdma-imx53.bin",
140 .script_addrs = &imx53_sdma_script, 138 .script_addrs = &imx53_sdma_script,
141}; 139};
@@ -148,7 +146,8 @@ void __init imx51_soc_init(void)
148 mxc_register_gpio("imx31-gpio", 2, MX51_GPIO3_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO3_LOW, MX51_MXC_INT_GPIO3_HIGH); 146 mxc_register_gpio("imx31-gpio", 2, MX51_GPIO3_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO3_LOW, MX51_MXC_INT_GPIO3_HIGH);
149 mxc_register_gpio("imx31-gpio", 3, MX51_GPIO4_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO4_LOW, MX51_MXC_INT_GPIO4_HIGH); 147 mxc_register_gpio("imx31-gpio", 3, MX51_GPIO4_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO4_LOW, MX51_MXC_INT_GPIO4_HIGH);
150 148
151 imx_add_imx_sdma(MX51_SDMA_BASE_ADDR, MX51_INT_SDMA, &imx51_sdma_pdata); 149 /* i.mx51 has the i.mx35 type sdma */
150 imx_add_imx_sdma("imx35-sdma", MX51_SDMA_BASE_ADDR, MX51_INT_SDMA, &imx51_sdma_pdata);
152} 151}
153 152
154void __init imx53_soc_init(void) 153void __init imx53_soc_init(void)
@@ -162,5 +161,6 @@ void __init imx53_soc_init(void)
162 mxc_register_gpio("imx31-gpio", 5, MX53_GPIO6_BASE_ADDR, SZ_16K, MX53_INT_GPIO6_LOW, MX53_INT_GPIO6_HIGH); 161 mxc_register_gpio("imx31-gpio", 5, MX53_GPIO6_BASE_ADDR, SZ_16K, MX53_INT_GPIO6_LOW, MX53_INT_GPIO6_HIGH);
163 mxc_register_gpio("imx31-gpio", 6, MX53_GPIO7_BASE_ADDR, SZ_16K, MX53_INT_GPIO7_LOW, MX53_INT_GPIO7_HIGH); 162 mxc_register_gpio("imx31-gpio", 6, MX53_GPIO7_BASE_ADDR, SZ_16K, MX53_INT_GPIO7_LOW, MX53_INT_GPIO7_HIGH);
164 163
165 imx_add_imx_sdma(MX53_SDMA_BASE_ADDR, MX53_INT_SDMA, &imx53_sdma_pdata); 164 /* i.mx53 has the i.mx35 type sdma */
165 imx_add_imx_sdma("imx35-sdma", MX53_SDMA_BASE_ADDR, MX53_INT_SDMA, &imx53_sdma_pdata);
166} 166}
diff --git a/arch/arm/plat-mxc/devices/platform-imx-dma.c b/arch/arm/plat-mxc/devices/platform-imx-dma.c
index 2b0fdb23beb8..7fa7e9c92468 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-dma.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-dma.c
@@ -14,7 +14,7 @@ struct platform_device __init __maybe_unused *imx_add_imx_dma(void)
14 "imx-dma", -1, NULL, 0, NULL, 0); 14 "imx-dma", -1, NULL, 0, NULL, 0);
15} 15}
16 16
17struct platform_device __init __maybe_unused *imx_add_imx_sdma( 17struct platform_device __init __maybe_unused *imx_add_imx_sdma(char *name,
18 resource_size_t iobase, int irq, struct sdma_platform_data *pdata) 18 resource_size_t iobase, int irq, struct sdma_platform_data *pdata)
19{ 19{
20 struct resource res[] = { 20 struct resource res[] = {
@@ -29,6 +29,6 @@ struct platform_device __init __maybe_unused *imx_add_imx_sdma(
29 }, 29 },
30 }; 30 };
31 31
32 return platform_device_register_resndata(&mxc_ahb_bus, "imx-sdma", 32 return platform_device_register_resndata(&mxc_ahb_bus, name,
33 -1, res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); 33 -1, res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
34} 34}
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
index 3beef7729788..524538aabc4b 100644
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
+++ b/arch/arm/plat-mxc/include/mach/devices-common.h
@@ -299,5 +299,5 @@ struct platform_device *__init imx_add_spi_imx(
299 const struct spi_imx_master *pdata); 299 const struct spi_imx_master *pdata);
300 300
301struct platform_device *imx_add_imx_dma(void); 301struct platform_device *imx_add_imx_dma(void);
302struct platform_device *imx_add_imx_sdma( 302struct platform_device *imx_add_imx_sdma(char *name,
303 resource_size_t iobase, int irq, struct sdma_platform_data *pdata); 303 resource_size_t iobase, int irq, struct sdma_platform_data *pdata);
diff --git a/arch/arm/plat-mxc/include/mach/dma.h b/arch/arm/plat-mxc/include/mach/dma.h
index ef7751546f5f..233d0a5e2d68 100644
--- a/arch/arm/plat-mxc/include/mach/dma.h
+++ b/arch/arm/plat-mxc/include/mach/dma.h
@@ -60,7 +60,8 @@ static inline int imx_dma_is_ipu(struct dma_chan *chan)
60 60
61static inline int imx_dma_is_general_purpose(struct dma_chan *chan) 61static inline int imx_dma_is_general_purpose(struct dma_chan *chan)
62{ 62{
63 return !strcmp(dev_name(chan->device->dev), "imx-sdma") || 63 return !strcmp(dev_name(chan->device->dev), "imx31-sdma") ||
64 !strcmp(dev_name(chan->device->dev), "imx35-sdma") ||
64 !strcmp(dev_name(chan->device->dev), "imx-dma"); 65 !strcmp(dev_name(chan->device->dev), "imx-dma");
65} 66}
66 67
diff --git a/arch/arm/plat-mxc/include/mach/sdma.h b/arch/arm/plat-mxc/include/mach/sdma.h
index f495c87c113f..3a3942823c20 100644
--- a/arch/arm/plat-mxc/include/mach/sdma.h
+++ b/arch/arm/plat-mxc/include/mach/sdma.h
@@ -48,12 +48,10 @@ struct sdma_script_start_addrs {
48/** 48/**
49 * struct sdma_platform_data - platform specific data for SDMA engine 49 * struct sdma_platform_data - platform specific data for SDMA engine
50 * 50 *
51 * @sdma_version The version of this SDMA engine
52 * @fw_name The firmware name 51 * @fw_name The firmware name
53 * @script_addrs SDMA scripts addresses in SDMA ROM 52 * @script_addrs SDMA scripts addresses in SDMA ROM
54 */ 53 */
55struct sdma_platform_data { 54struct sdma_platform_data {
56 int sdma_version;
57 char *fw_name; 55 char *fw_name;
58 struct sdma_script_start_addrs *script_addrs; 56 struct sdma_script_start_addrs *script_addrs;
59}; 57};