aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/omap_uwire.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-09-14 00:16:56 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-09-14 00:16:56 -0400
commitfc8e1ead9314cf0e0f1922e661428b93d3a50d88 (patch)
treef3cb97c4769b74f6627a59769f1ed5c92a13c58a /drivers/spi/omap_uwire.c
parent2bcaa6a4238094c5695d5b1943078388d82d3004 (diff)
parent9de48cc300fb10f7d9faa978670becf5e352462a (diff)
Merge branch 'next' into for-linus
Diffstat (limited to 'drivers/spi/omap_uwire.c')
-rw-r--r--drivers/spi/omap_uwire.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/spi/omap_uwire.c b/drivers/spi/omap_uwire.c
index fe8b9ac0ccef..8980a5640bd9 100644
--- a/drivers/spi/omap_uwire.c
+++ b/drivers/spi/omap_uwire.c
@@ -339,8 +339,6 @@ static int uwire_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
339 bits = spi->bits_per_word; 339 bits = spi->bits_per_word;
340 if (t != NULL && t->bits_per_word) 340 if (t != NULL && t->bits_per_word)
341 bits = t->bits_per_word; 341 bits = t->bits_per_word;
342 if (!bits)
343 bits = 8;
344 342
345 if (bits > 16) { 343 if (bits > 16) {
346 pr_debug("%s: wordsize %d?\n", dev_name(&spi->dev), bits); 344 pr_debug("%s: wordsize %d?\n", dev_name(&spi->dev), bits);
@@ -449,19 +447,10 @@ done:
449 return status; 447 return status;
450} 448}
451 449
452/* the spi->mode bits understood by this driver: */
453#define MODEBITS (SPI_CPOL | SPI_CPHA | SPI_CS_HIGH)
454
455static int uwire_setup(struct spi_device *spi) 450static int uwire_setup(struct spi_device *spi)
456{ 451{
457 struct uwire_state *ust = spi->controller_state; 452 struct uwire_state *ust = spi->controller_state;
458 453
459 if (spi->mode & ~MODEBITS) {
460 dev_dbg(&spi->dev, "setup: unsupported mode bits %x\n",
461 spi->mode & ~MODEBITS);
462 return -EINVAL;
463 }
464
465 if (ust == NULL) { 454 if (ust == NULL) {
466 ust = kzalloc(sizeof(*ust), GFP_KERNEL); 455 ust = kzalloc(sizeof(*ust), GFP_KERNEL);
467 if (ust == NULL) 456 if (ust == NULL)
@@ -522,6 +511,11 @@ static int __init uwire_probe(struct platform_device *pdev)
522 511
523 uwire_write_reg(UWIRE_SR3, 1); 512 uwire_write_reg(UWIRE_SR3, 1);
524 513
514 /* the spi->mode bits understood by this driver: */
515 master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
516
517 master->flags = SPI_MASTER_HALF_DUPLEX;
518
525 master->bus_num = 2; /* "official" */ 519 master->bus_num = 2; /* "official" */
526 master->num_chipselect = 4; 520 master->num_chipselect = 4;
527 master->setup = uwire_setup; 521 master->setup = uwire_setup;