aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi_txx9.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/spi_txx9.c')
-rw-r--r--drivers/spi/spi_txx9.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/spi/spi_txx9.c b/drivers/spi/spi_txx9.c
index 8e36b2153d9a..96057de133ad 100644
--- a/drivers/spi/spi_txx9.c
+++ b/drivers/spi/spi_txx9.c
@@ -110,17 +110,11 @@ static void txx9spi_cs_func(struct spi_device *spi, struct txx9spi *c,
110 ndelay(cs_delay); /* CS Setup Time / CS Recovery Time */ 110 ndelay(cs_delay); /* CS Setup Time / CS Recovery Time */
111} 111}
112 112
113/* the spi->mode bits understood by this driver: */
114#define MODEBITS (SPI_CS_HIGH|SPI_CPOL|SPI_CPHA)
115
116static int txx9spi_setup(struct spi_device *spi) 113static int txx9spi_setup(struct spi_device *spi)
117{ 114{
118 struct txx9spi *c = spi_master_get_devdata(spi->master); 115 struct txx9spi *c = spi_master_get_devdata(spi->master);
119 u8 bits_per_word; 116 u8 bits_per_word;
120 117
121 if (spi->mode & ~MODEBITS)
122 return -EINVAL;
123
124 if (!spi->max_speed_hz 118 if (!spi->max_speed_hz
125 || spi->max_speed_hz > c->max_speed_hz 119 || spi->max_speed_hz > c->max_speed_hz
126 || spi->max_speed_hz < c->min_speed_hz) 120 || spi->max_speed_hz < c->min_speed_hz)
@@ -414,6 +408,9 @@ static int __init txx9spi_probe(struct platform_device *dev)
414 (unsigned long long)res->start, irq, 408 (unsigned long long)res->start, irq,
415 (c->baseclk + 500000) / 1000000); 409 (c->baseclk + 500000) / 1000000);
416 410
411 /* the spi->mode bits understood by this driver: */
412 master->mode_bits = SPI_CS_HIGH | SPI_CPOL | SPI_CPHA;
413
417 master->bus_num = dev->id; 414 master->bus_num = dev->id;
418 master->setup = txx9spi_setup; 415 master->setup = txx9spi_setup;
419 master->transfer = txx9spi_transfer; 416 master->transfer = txx9spi_transfer;