Commit 6ff554e0 authored by David Jander's avatar David Jander Committed by Sascha Hauer

spi/imx: Support different fifo sizes

The i.MX51 ECSPI has a fifo size of 64 entries instead of 8 entries as
found on the other cspi bus devices.

Cc: Jason Wang <jason77.wang@gmail.com>
Signed-off-by: default avatarDavid Jander <david@protonic.nl>
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
parent 4b5ee7a7
...@@ -77,6 +77,7 @@ struct spi_imx_devtype_data { ...@@ -77,6 +77,7 @@ struct spi_imx_devtype_data {
void (*trigger)(struct spi_imx_data *); void (*trigger)(struct spi_imx_data *);
int (*rx_available)(struct spi_imx_data *); int (*rx_available)(struct spi_imx_data *);
void (*reset)(struct spi_imx_data *); void (*reset)(struct spi_imx_data *);
unsigned int fifosize;
}; };
struct spi_imx_data { struct spi_imx_data {
...@@ -541,6 +542,7 @@ static struct spi_imx_devtype_data spi_imx_devtype_data[] __devinitdata = { ...@@ -541,6 +542,7 @@ static struct spi_imx_devtype_data spi_imx_devtype_data[] __devinitdata = {
.trigger = mx1_trigger, .trigger = mx1_trigger,
.rx_available = mx1_rx_available, .rx_available = mx1_rx_available,
.reset = mx1_reset, .reset = mx1_reset,
.fifosize = 8,
}, },
#endif #endif
#ifdef CONFIG_SPI_IMX_VER_0_0 #ifdef CONFIG_SPI_IMX_VER_0_0
...@@ -550,6 +552,7 @@ static struct spi_imx_devtype_data spi_imx_devtype_data[] __devinitdata = { ...@@ -550,6 +552,7 @@ static struct spi_imx_devtype_data spi_imx_devtype_data[] __devinitdata = {
.trigger = mx27_trigger, .trigger = mx27_trigger,
.rx_available = mx27_rx_available, .rx_available = mx27_rx_available,
.reset = spi_imx0_0_reset, .reset = spi_imx0_0_reset,
.fifosize = 8,
}, },
#endif #endif
#ifdef CONFIG_SPI_IMX_VER_0_4 #ifdef CONFIG_SPI_IMX_VER_0_4
...@@ -559,6 +562,7 @@ static struct spi_imx_devtype_data spi_imx_devtype_data[] __devinitdata = { ...@@ -559,6 +562,7 @@ static struct spi_imx_devtype_data spi_imx_devtype_data[] __devinitdata = {
.trigger = mx31_trigger, .trigger = mx31_trigger,
.rx_available = mx31_rx_available, .rx_available = mx31_rx_available,
.reset = spi_imx0_4_reset, .reset = spi_imx0_4_reset,
.fifosize = 8,
}, },
#endif #endif
#ifdef CONFIG_SPI_IMX_VER_0_7 #ifdef CONFIG_SPI_IMX_VER_0_7
...@@ -568,6 +572,7 @@ static struct spi_imx_devtype_data spi_imx_devtype_data[] __devinitdata = { ...@@ -568,6 +572,7 @@ static struct spi_imx_devtype_data spi_imx_devtype_data[] __devinitdata = {
.trigger = mx31_trigger, .trigger = mx31_trigger,
.rx_available = mx31_rx_available, .rx_available = mx31_rx_available,
.reset = spi_imx0_4_reset, .reset = spi_imx0_4_reset,
.fifosize = 8,
}, },
#endif #endif
#ifdef CONFIG_SPI_IMX_VER_2_3 #ifdef CONFIG_SPI_IMX_VER_2_3
...@@ -577,6 +582,7 @@ static struct spi_imx_devtype_data spi_imx_devtype_data[] __devinitdata = { ...@@ -577,6 +582,7 @@ static struct spi_imx_devtype_data spi_imx_devtype_data[] __devinitdata = {
.trigger = spi_imx2_3_trigger, .trigger = spi_imx2_3_trigger,
.rx_available = spi_imx2_3_rx_available, .rx_available = spi_imx2_3_rx_available,
.reset = spi_imx2_3_reset, .reset = spi_imx2_3_reset,
.fifosize = 64,
}, },
#endif #endif
}; };
...@@ -596,7 +602,7 @@ static void spi_imx_chipselect(struct spi_device *spi, int is_active) ...@@ -596,7 +602,7 @@ static void spi_imx_chipselect(struct spi_device *spi, int is_active)
static void spi_imx_push(struct spi_imx_data *spi_imx) static void spi_imx_push(struct spi_imx_data *spi_imx)
{ {
while (spi_imx->txfifo < 8) { while (spi_imx->txfifo < spi_imx->devtype_data.fifosize) {
if (!spi_imx->count) if (!spi_imx->count)
break; break;
spi_imx->tx(spi_imx); spi_imx->tx(spi_imx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment