diff options
Diffstat (limited to 'drivers/spi/omap_uwire.c')
-rw-r--r-- | drivers/spi/omap_uwire.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/spi/omap_uwire.c b/drivers/spi/omap_uwire.c index 95183e1df525..d275c615a73e 100644 --- a/drivers/spi/omap_uwire.c +++ b/drivers/spi/omap_uwire.c @@ -445,10 +445,19 @@ done: return status; } +/* the spi->mode bits understood by this driver: */ +#define MODEBITS (SPI_CPOL | SPI_CPHA | SPI_CS_HIGH) + static int uwire_setup(struct spi_device *spi) { struct uwire_state *ust = spi->controller_state; + if (spi->mode & ~MODEBITS) { + dev_dbg(&spi->dev, "setup: unsupported mode bits %x\n", + spi->mode & ~MODEBITS); + return -EINVAL; + } + if (ust == NULL) { ust = kzalloc(sizeof(*ust), GFP_KERNEL); if (ust == NULL) |