aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2011-07-09 13:16:39 -0400
committerGrant Likely <grant.likely@secretlab.ca>2011-07-14 15:47:02 -0400
commit04ee585495a6d474d1ff9a821b52abf7db99cad3 (patch)
treec32ed9c89d4d0939301561297abcaa380c3c9d33
parent2a64a90a2c64420e880b25dfeec6524ea78926fb (diff)
spi/imx: use soc name in spi device type naming scheme
Software defined version number is not stable enough to be used in device type naming scheme. The patch changes it to use implicit soc name for spi device type definition. In this way, we can easily align the naming scheme with device tree binding, which comes later. It removes fifosize from spi_imx_data and adds devtype there, so that fifosize can be set in an inline function according to devtype. Also, cpu_is_mx can be replaced by inline functions checking devtype. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
-rw-r--r--arch/arm/mach-imx/clock-imx25.c7
-rw-r--r--arch/arm/mach-mx5/clock-mx51-mx53.c11
-rw-r--r--arch/arm/plat-mxc/devices/platform-spi_imx.c12
-rw-r--r--drivers/spi/Kconfig12
-rw-r--r--drivers/spi/spi-imx.c208
5 files changed, 128 insertions, 122 deletions
diff --git a/arch/arm/mach-imx/clock-imx25.c b/arch/arm/mach-imx/clock-imx25.c
index a65838fc061c..af1c580b06bc 100644
--- a/arch/arm/mach-imx/clock-imx25.c
+++ b/arch/arm/mach-imx/clock-imx25.c
@@ -282,9 +282,10 @@ static struct clk_lookup lookups[] = {
282 _REGISTER_CLOCK("mxc-ehci.2", "usb", usbotg_clk) 282 _REGISTER_CLOCK("mxc-ehci.2", "usb", usbotg_clk)
283 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usbotg_clk) 283 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usbotg_clk)
284 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) 284 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
285 _REGISTER_CLOCK("imx25-cspi.0", NULL, cspi1_clk) 285 /* i.mx25 has the i.mx35 type cspi */
286 _REGISTER_CLOCK("imx25-cspi.1", NULL, cspi2_clk) 286 _REGISTER_CLOCK("imx35-cspi.0", NULL, cspi1_clk)
287 _REGISTER_CLOCK("imx25-cspi.2", NULL, cspi3_clk) 287 _REGISTER_CLOCK("imx35-cspi.1", NULL, cspi2_clk)
288 _REGISTER_CLOCK("imx35-cspi.2", NULL, cspi3_clk)
288 _REGISTER_CLOCK("mxc_pwm.0", NULL, pwm1_clk) 289 _REGISTER_CLOCK("mxc_pwm.0", NULL, pwm1_clk)
289 _REGISTER_CLOCK("mxc_pwm.1", NULL, pwm2_clk) 290 _REGISTER_CLOCK("mxc_pwm.1", NULL, pwm2_clk)
290 _REGISTER_CLOCK("mxc_pwm.2", NULL, pwm3_clk) 291 _REGISTER_CLOCK("mxc_pwm.2", NULL, pwm3_clk)
diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
index 6b89c1bf4eb2..cd79e3435e28 100644
--- a/arch/arm/mach-mx5/clock-mx51-mx53.c
+++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
@@ -1442,7 +1442,8 @@ static struct clk_lookup mx51_lookups[] = {
1442 _REGISTER_CLOCK(NULL, "gpt_32k", gpt_32k_clk) 1442 _REGISTER_CLOCK(NULL, "gpt_32k", gpt_32k_clk)
1443 _REGISTER_CLOCK("imx51-ecspi.0", NULL, ecspi1_clk) 1443 _REGISTER_CLOCK("imx51-ecspi.0", NULL, ecspi1_clk)
1444 _REGISTER_CLOCK("imx51-ecspi.1", NULL, ecspi2_clk) 1444 _REGISTER_CLOCK("imx51-ecspi.1", NULL, ecspi2_clk)
1445 _REGISTER_CLOCK("imx51-cspi.0", NULL, cspi_clk) 1445 /* i.mx51 has the i.mx35 type cspi */
1446 _REGISTER_CLOCK("imx35-cspi.0", NULL, cspi_clk)
1446 _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk) 1447 _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk)
1447 _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk) 1448 _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk)
1448 _REGISTER_CLOCK("sdhci-esdhc-imx.2", NULL, esdhc3_clk) 1449 _REGISTER_CLOCK("sdhci-esdhc-imx.2", NULL, esdhc3_clk)
@@ -1471,9 +1472,11 @@ static struct clk_lookup mx53_lookups[] = {
1471 _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_mx53_clk) 1472 _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_mx53_clk)
1472 _REGISTER_CLOCK("sdhci-esdhc-imx.2", NULL, esdhc3_mx53_clk) 1473 _REGISTER_CLOCK("sdhci-esdhc-imx.2", NULL, esdhc3_mx53_clk)
1473 _REGISTER_CLOCK("sdhci-esdhc-imx.3", NULL, esdhc4_mx53_clk) 1474 _REGISTER_CLOCK("sdhci-esdhc-imx.3", NULL, esdhc4_mx53_clk)
1474 _REGISTER_CLOCK("imx53-ecspi.0", NULL, ecspi1_clk) 1475 /* i.mx53 has the i.mx51 type ecspi */
1475 _REGISTER_CLOCK("imx53-ecspi.1", NULL, ecspi2_clk) 1476 _REGISTER_CLOCK("imx51-ecspi.0", NULL, ecspi1_clk)
1476 _REGISTER_CLOCK("imx53-cspi.0", NULL, cspi_clk) 1477 _REGISTER_CLOCK("imx51-ecspi.1", NULL, ecspi2_clk)
1478 /* i.mx53 has the i.mx25 type cspi */
1479 _REGISTER_CLOCK("imx35-cspi.0", NULL, cspi_clk)
1477 _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk) 1480 _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk)
1478 _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk) 1481 _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk)
1479}; 1482};
diff --git a/arch/arm/plat-mxc/devices/platform-spi_imx.c b/arch/arm/plat-mxc/devices/platform-spi_imx.c
index f97eb3615b2c..9bfae8bd5b8d 100644
--- a/arch/arm/plat-mxc/devices/platform-spi_imx.c
+++ b/arch/arm/plat-mxc/devices/platform-spi_imx.c
@@ -40,9 +40,10 @@ const struct imx_spi_imx_data imx21_cspi_data[] __initconst = {
40#endif 40#endif
41 41
42#ifdef CONFIG_SOC_IMX25 42#ifdef CONFIG_SOC_IMX25
43/* i.mx25 has the i.mx35 type cspi */
43const struct imx_spi_imx_data imx25_cspi_data[] __initconst = { 44const struct imx_spi_imx_data imx25_cspi_data[] __initconst = {
44#define imx25_cspi_data_entry(_id, _hwid) \ 45#define imx25_cspi_data_entry(_id, _hwid) \
45 imx_spi_imx_data_entry(MX25, CSPI, "imx25-cspi", _id, _hwid, SZ_16K) 46 imx_spi_imx_data_entry(MX25, CSPI, "imx35-cspi", _id, _hwid, SZ_16K)
46 imx25_cspi_data_entry(0, 1), 47 imx25_cspi_data_entry(0, 1),
47 imx25_cspi_data_entry(1, 2), 48 imx25_cspi_data_entry(1, 2),
48 imx25_cspi_data_entry(2, 3), 49 imx25_cspi_data_entry(2, 3),
@@ -79,8 +80,9 @@ const struct imx_spi_imx_data imx35_cspi_data[] __initconst = {
79#endif /* ifdef CONFIG_SOC_IMX35 */ 80#endif /* ifdef CONFIG_SOC_IMX35 */
80 81
81#ifdef CONFIG_SOC_IMX51 82#ifdef CONFIG_SOC_IMX51
83/* i.mx51 has the i.mx35 type cspi */
82const struct imx_spi_imx_data imx51_cspi_data __initconst = 84const struct imx_spi_imx_data imx51_cspi_data __initconst =
83 imx_spi_imx_data_entry_single(MX51, CSPI, "imx51-cspi", 2, , SZ_4K); 85 imx_spi_imx_data_entry_single(MX51, CSPI, "imx35-cspi", 2, , SZ_4K);
84 86
85const struct imx_spi_imx_data imx51_ecspi_data[] __initconst = { 87const struct imx_spi_imx_data imx51_ecspi_data[] __initconst = {
86#define imx51_ecspi_data_entry(_id, _hwid) \ 88#define imx51_ecspi_data_entry(_id, _hwid) \
@@ -91,12 +93,14 @@ const struct imx_spi_imx_data imx51_ecspi_data[] __initconst = {
91#endif /* ifdef CONFIG_SOC_IMX51 */ 93#endif /* ifdef CONFIG_SOC_IMX51 */
92 94
93#ifdef CONFIG_SOC_IMX53 95#ifdef CONFIG_SOC_IMX53
96/* i.mx53 has the i.mx35 type cspi */
94const struct imx_spi_imx_data imx53_cspi_data __initconst = 97const struct imx_spi_imx_data imx53_cspi_data __initconst =
95 imx_spi_imx_data_entry_single(MX53, CSPI, "imx53-cspi", 0, , SZ_4K); 98 imx_spi_imx_data_entry_single(MX53, CSPI, "imx35-cspi", 0, , SZ_4K);
96 99
100/* i.mx53 has the i.mx51 type ecspi */
97const struct imx_spi_imx_data imx53_ecspi_data[] __initconst = { 101const struct imx_spi_imx_data imx53_ecspi_data[] __initconst = {
98#define imx53_ecspi_data_entry(_id, _hwid) \ 102#define imx53_ecspi_data_entry(_id, _hwid) \
99 imx_spi_imx_data_entry(MX53, ECSPI, "imx53-ecspi", _id, _hwid, SZ_4K) 103 imx_spi_imx_data_entry(MX53, ECSPI, "imx51-ecspi", _id, _hwid, SZ_4K)
100 imx53_ecspi_data_entry(0, 1), 104 imx53_ecspi_data_entry(0, 1),
101 imx53_ecspi_data_entry(1, 2), 105 imx53_ecspi_data_entry(1, 2),
102}; 106};
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index c327cf3d8174..52e2900d9d8e 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -154,18 +154,6 @@ config SPI_GPIO
154 GPIO operations, you should be able to leverage that for better 154 GPIO operations, you should be able to leverage that for better
155 speed with a custom version of this driver; see the source code. 155 speed with a custom version of this driver; see the source code.
156 156
157config SPI_IMX_VER_IMX1
158 def_bool y if SOC_IMX1
159
160config SPI_IMX_VER_0_0
161 def_bool y if SOC_IMX21 || SOC_IMX27
162
163config SPI_IMX_VER_0_4
164 def_bool y if ARCH_MX25 || SOC_IMX31 || SOC_IMX35 || SOC_IMX51 || SOC_IMX53
165
166config SPI_IMX_VER_2_3
167 def_bool y if SOC_IMX51 || SOC_IMX53
168
169config SPI_IMX 157config SPI_IMX
170 tristate "Freescale i.MX SPI controllers" 158 tristate "Freescale i.MX SPI controllers"
171 depends on ARCH_MXC 159 depends on ARCH_MXC
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 615a84c8ccda..87981b417967 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -57,10 +57,12 @@ struct spi_imx_config {
57}; 57};
58 58
59enum spi_imx_devtype { 59enum spi_imx_devtype {
60 SPI_IMX_VER_IMX1, 60 IMX1_CSPI,
61 SPI_IMX_VER_0_0, 61 IMX21_CSPI,
62 SPI_IMX_VER_0_4, 62 IMX27_CSPI,
63 SPI_IMX_VER_2_3, 63 IMX31_CSPI,
64 IMX35_CSPI, /* CSPI on all i.mx except above */
65 IMX51_ECSPI, /* ECSPI on i.mx51 and later */
64}; 66};
65 67
66struct spi_imx_data; 68struct spi_imx_data;
@@ -71,7 +73,7 @@ struct spi_imx_devtype_data {
71 void (*trigger)(struct spi_imx_data *); 73 void (*trigger)(struct spi_imx_data *);
72 int (*rx_available)(struct spi_imx_data *); 74 int (*rx_available)(struct spi_imx_data *);
73 void (*reset)(struct spi_imx_data *); 75 void (*reset)(struct spi_imx_data *);
74 unsigned int fifosize; 76 enum spi_imx_devtype devtype;
75}; 77};
76 78
77struct spi_imx_data { 79struct spi_imx_data {
@@ -94,6 +96,21 @@ struct spi_imx_data {
94 struct spi_imx_devtype_data *devtype_data; 96 struct spi_imx_devtype_data *devtype_data;
95}; 97};
96 98
99static inline int is_imx27_cspi(struct spi_imx_data *d)
100{
101 return d->devtype_data->devtype == IMX27_CSPI;
102}
103
104static inline int is_imx35_cspi(struct spi_imx_data *d)
105{
106 return d->devtype_data->devtype == IMX35_CSPI;
107}
108
109static inline unsigned spi_imx_get_fifosize(struct spi_imx_data *d)
110{
111 return (d->devtype_data->devtype == IMX51_ECSPI) ? 64 : 8;
112}
113
97#define MXC_SPI_BUF_RX(type) \ 114#define MXC_SPI_BUF_RX(type) \
98static void spi_imx_buf_rx_##type(struct spi_imx_data *spi_imx) \ 115static void spi_imx_buf_rx_##type(struct spi_imx_data *spi_imx) \
99{ \ 116{ \
@@ -135,14 +152,9 @@ static int mxc_clkdivs[] = {0, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192,
135 152
136/* MX21, MX27 */ 153/* MX21, MX27 */
137static unsigned int spi_imx_clkdiv_1(unsigned int fin, 154static unsigned int spi_imx_clkdiv_1(unsigned int fin,
138 unsigned int fspi) 155 unsigned int fspi, unsigned int max)
139{ 156{
140 int i, max; 157 int i;
141
142 if (cpu_is_mx21())
143 max = 18;
144 else
145 max = 16;
146 158
147 for (i = 2; i < max; i++) 159 for (i = 2; i < max; i++)
148 if (fspi * mxc_clkdivs[i] >= fin) 160 if (fspi * mxc_clkdivs[i] >= fin)
@@ -347,7 +359,7 @@ static int __maybe_unused mx31_config(struct spi_imx_data *spi_imx,
347 reg |= spi_imx_clkdiv_2(spi_imx->spi_clk, config->speed_hz) << 359 reg |= spi_imx_clkdiv_2(spi_imx->spi_clk, config->speed_hz) <<
348 MX31_CSPICTRL_DR_SHIFT; 360 MX31_CSPICTRL_DR_SHIFT;
349 361
350 if (cpu_is_mx35()) { 362 if (is_imx35_cspi(spi_imx)) {
351 reg |= (config->bpw - 1) << MX35_CSPICTRL_BL_SHIFT; 363 reg |= (config->bpw - 1) << MX35_CSPICTRL_BL_SHIFT;
352 reg |= MX31_CSPICTRL_SSCTL; 364 reg |= MX31_CSPICTRL_SSCTL;
353 } else { 365 } else {
@@ -362,8 +374,8 @@ static int __maybe_unused mx31_config(struct spi_imx_data *spi_imx,
362 reg |= MX31_CSPICTRL_SSPOL; 374 reg |= MX31_CSPICTRL_SSPOL;
363 if (cs < 0) 375 if (cs < 0)
364 reg |= (cs + 32) << 376 reg |= (cs + 32) <<
365 (cpu_is_mx35() ? MX35_CSPICTRL_CS_SHIFT : 377 (is_imx35_cspi(spi_imx) ? MX35_CSPICTRL_CS_SHIFT :
366 MX31_CSPICTRL_CS_SHIFT); 378 MX31_CSPICTRL_CS_SHIFT);
367 379
368 writel(reg, spi_imx->base + MXC_CSPICTRL); 380 writel(reg, spi_imx->base + MXC_CSPICTRL);
369 381
@@ -421,8 +433,9 @@ static int __maybe_unused mx21_config(struct spi_imx_data *spi_imx,
421{ 433{
422 unsigned int reg = MX21_CSPICTRL_ENABLE | MX21_CSPICTRL_MASTER; 434 unsigned int reg = MX21_CSPICTRL_ENABLE | MX21_CSPICTRL_MASTER;
423 int cs = spi_imx->chipselect[config->cs]; 435 int cs = spi_imx->chipselect[config->cs];
436 unsigned int max = is_imx27_cspi(spi_imx) ? 16 : 18;
424 437
425 reg |= spi_imx_clkdiv_1(spi_imx->spi_clk, config->speed_hz) << 438 reg |= spi_imx_clkdiv_1(spi_imx->spi_clk, config->speed_hz, max) <<
426 MX21_CSPICTRL_DR_SHIFT; 439 MX21_CSPICTRL_DR_SHIFT;
427 reg |= config->bpw - 1; 440 reg |= config->bpw - 1;
428 441
@@ -511,51 +524,84 @@ static void __maybe_unused mx1_reset(struct spi_imx_data *spi_imx)
511 writel(1, spi_imx->base + MXC_RESET); 524 writel(1, spi_imx->base + MXC_RESET);
512} 525}
513 526
514/* 527static struct spi_imx_devtype_data imx1_cspi_devtype_data = {
515 * These version numbers are taken from the Freescale driver. Unfortunately it 528 .intctrl = mx1_intctrl,
516 * doesn't support i.MX1, so this entry doesn't match the scheme. :-( 529 .config = mx1_config,
517 */ 530 .trigger = mx1_trigger,
518static struct spi_imx_devtype_data spi_imx_devtype_data[] = { 531 .rx_available = mx1_rx_available,
519#ifdef CONFIG_SPI_IMX_VER_IMX1 532 .reset = mx1_reset,
520 [SPI_IMX_VER_IMX1] = { 533 .devtype = IMX1_CSPI,
521 .intctrl = mx1_intctrl, 534};
522 .config = mx1_config, 535
523 .trigger = mx1_trigger, 536static struct spi_imx_devtype_data imx21_cspi_devtype_data = {
524 .rx_available = mx1_rx_available, 537 .intctrl = mx21_intctrl,
525 .reset = mx1_reset, 538 .config = mx21_config,
526 .fifosize = 8, 539 .trigger = mx21_trigger,
527 }, 540 .rx_available = mx21_rx_available,
528#endif 541 .reset = mx21_reset,
529#ifdef CONFIG_SPI_IMX_VER_0_0 542 .devtype = IMX21_CSPI,
530 [SPI_IMX_VER_0_0] = { 543};
531 .intctrl = mx21_intctrl, 544
532 .config = mx21_config, 545static struct spi_imx_devtype_data imx27_cspi_devtype_data = {
533 .trigger = mx21_trigger, 546 /* i.mx27 cspi shares the functions with i.mx21 one */
534 .rx_available = mx21_rx_available, 547 .intctrl = mx21_intctrl,
535 .reset = mx21_reset, 548 .config = mx21_config,
536 .fifosize = 8, 549 .trigger = mx21_trigger,
537 }, 550 .rx_available = mx21_rx_available,
538#endif 551 .reset = mx21_reset,
539#ifdef CONFIG_SPI_IMX_VER_0_4 552 .devtype = IMX27_CSPI,
540 [SPI_IMX_VER_0_4] = { 553};
541 .intctrl = mx31_intctrl, 554
542 .config = mx31_config, 555static struct spi_imx_devtype_data imx31_cspi_devtype_data = {
543 .trigger = mx31_trigger, 556 .intctrl = mx31_intctrl,
544 .rx_available = mx31_rx_available, 557 .config = mx31_config,
545 .reset = mx31_reset, 558 .trigger = mx31_trigger,
546 .fifosize = 8, 559 .rx_available = mx31_rx_available,
547 }, 560 .reset = mx31_reset,
548#endif 561 .devtype = IMX31_CSPI,
549#ifdef CONFIG_SPI_IMX_VER_2_3 562};
550 [SPI_IMX_VER_2_3] = { 563
551 .intctrl = mx51_ecspi_intctrl, 564static struct spi_imx_devtype_data imx35_cspi_devtype_data = {
552 .config = mx51_ecspi_config, 565 /* i.mx35 and later cspi shares the functions with i.mx31 one */
553 .trigger = mx51_ecspi_trigger, 566 .intctrl = mx31_intctrl,
554 .rx_available = mx51_ecspi_rx_available, 567 .config = mx31_config,
555 .reset = mx51_ecspi_reset, 568 .trigger = mx31_trigger,
556 .fifosize = 64, 569 .rx_available = mx31_rx_available,
557 }, 570 .reset = mx31_reset,
558#endif 571 .devtype = IMX35_CSPI,
572};
573
574static struct spi_imx_devtype_data imx51_ecspi_devtype_data = {
575 .intctrl = mx51_ecspi_intctrl,
576 .config = mx51_ecspi_config,
577 .trigger = mx51_ecspi_trigger,
578 .rx_available = mx51_ecspi_rx_available,
579 .reset = mx51_ecspi_reset,
580 .devtype = IMX51_ECSPI,
581};
582
583static struct platform_device_id spi_imx_devtype[] = {
584 {
585 .name = "imx1-cspi",
586 .driver_data = (kernel_ulong_t) &imx1_cspi_devtype_data,
587 }, {
588 .name = "imx21-cspi",
589 .driver_data = (kernel_ulong_t) &imx21_cspi_devtype_data,
590 }, {
591 .name = "imx27-cspi",
592 .driver_data = (kernel_ulong_t) &imx27_cspi_devtype_data,
593 }, {
594 .name = "imx31-cspi",
595 .driver_data = (kernel_ulong_t) &imx31_cspi_devtype_data,
596 }, {
597 .name = "imx35-cspi",
598 .driver_data = (kernel_ulong_t) &imx35_cspi_devtype_data,
599 }, {
600 .name = "imx51-ecspi",
601 .driver_data = (kernel_ulong_t) &imx51_ecspi_devtype_data,
602 }, {
603 /* sentinel */
604 }
559}; 605};
560 606
561static void spi_imx_chipselect(struct spi_device *spi, int is_active) 607static void spi_imx_chipselect(struct spi_device *spi, int is_active)
@@ -573,7 +619,7 @@ static void spi_imx_chipselect(struct spi_device *spi, int is_active)
573 619
574static void spi_imx_push(struct spi_imx_data *spi_imx) 620static void spi_imx_push(struct spi_imx_data *spi_imx)
575{ 621{
576 while (spi_imx->txfifo < spi_imx->devtype_data->fifosize) { 622 while (spi_imx->txfifo < spi_imx_get_fifosize(spi_imx)) {
577 if (!spi_imx->count) 623 if (!spi_imx->count)
578 break; 624 break;
579 spi_imx->tx(spi_imx); 625 spi_imx->tx(spi_imx);
@@ -689,42 +735,6 @@ static void spi_imx_cleanup(struct spi_device *spi)
689{ 735{
690} 736}
691 737
692static struct platform_device_id spi_imx_devtype[] = {
693 {
694 .name = "imx1-cspi",
695 .driver_data = SPI_IMX_VER_IMX1,
696 }, {
697 .name = "imx21-cspi",
698 .driver_data = SPI_IMX_VER_0_0,
699 }, {
700 .name = "imx25-cspi",
701 .driver_data = SPI_IMX_VER_0_4,
702 }, {
703 .name = "imx27-cspi",
704 .driver_data = SPI_IMX_VER_0_0,
705 }, {
706 .name = "imx31-cspi",
707 .driver_data = SPI_IMX_VER_0_4,
708 }, {
709 .name = "imx35-cspi",
710 .driver_data = SPI_IMX_VER_0_4,
711 }, {
712 .name = "imx51-cspi",
713 .driver_data = SPI_IMX_VER_0_4,
714 }, {
715 .name = "imx51-ecspi",
716 .driver_data = SPI_IMX_VER_2_3,
717 }, {
718 .name = "imx53-cspi",
719 .driver_data = SPI_IMX_VER_0_4,
720 }, {
721 .name = "imx53-ecspi",
722 .driver_data = SPI_IMX_VER_2_3,
723 }, {
724 /* sentinel */
725 }
726};
727
728static int __devinit spi_imx_probe(struct platform_device *pdev) 738static int __devinit spi_imx_probe(struct platform_device *pdev)
729{ 739{
730 struct spi_imx_master *mxc_platform_info; 740 struct spi_imx_master *mxc_platform_info;
@@ -777,7 +787,7 @@ static int __devinit spi_imx_probe(struct platform_device *pdev)
777 init_completion(&spi_imx->xfer_done); 787 init_completion(&spi_imx->xfer_done);
778 788
779 spi_imx->devtype_data = 789 spi_imx->devtype_data =
780 &spi_imx_devtype_data[pdev->id_entry->driver_data]; 790 (struct spi_imx_devtype_data *) pdev->id_entry->driver_data;
781 791
782 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 792 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
783 if (!res) { 793 if (!res) {