aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorScott Jiang <scott.jiang.linux@gmail.com>2012-04-23 18:18:11 -0400
committerGrant Likely <grant.likely@secretlab.ca>2012-04-27 14:17:25 -0400
commit8d9d2a4b6ca0013b62a438808d22bdd615abcd00 (patch)
tree8b613741abafb594ce3fa9e1f1070dcfc73ae382 /drivers/spi
parent7666fd8b02af87a8b672b00d47e56d77f709127e (diff)
spi/spi_bfin_sport: drop bits_per_word from client data
Since the member was dropped from the common Blackfin header, we need to stop using it in the SPORT driver too. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-bfin-sport.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/spi/spi-bfin-sport.c b/drivers/spi/spi-bfin-sport.c
index bfd90474c7e2..1fe51198a622 100644
--- a/drivers/spi/spi-bfin-sport.c
+++ b/drivers/spi/spi-bfin-sport.c
@@ -416,11 +416,12 @@ bfin_sport_spi_pump_transfers(unsigned long data)
416 drv_data->cs_change = transfer->cs_change; 416 drv_data->cs_change = transfer->cs_change;
417 417
418 /* Bits per word setup */ 418 /* Bits per word setup */
419 bits_per_word = transfer->bits_per_word ? : message->spi->bits_per_word; 419 bits_per_word = transfer->bits_per_word ? :
420 if (bits_per_word == 8) 420 message->spi->bits_per_word ? : 8;
421 drv_data->ops = &bfin_sport_transfer_ops_u8; 421 if (bits_per_word % 16 == 0)
422 else
423 drv_data->ops = &bfin_sport_transfer_ops_u16; 422 drv_data->ops = &bfin_sport_transfer_ops_u16;
423 else
424 drv_data->ops = &bfin_sport_transfer_ops_u8;
424 bfin_write(&drv_data->regs->tcr2, bits_per_word - 1); 425 bfin_write(&drv_data->regs->tcr2, bits_per_word - 1);
425 bfin_write(&drv_data->regs->tfsdiv, bits_per_word - 1); 426 bfin_write(&drv_data->regs->tfsdiv, bits_per_word - 1);
426 bfin_write(&drv_data->regs->rcr2, bits_per_word - 1); 427 bfin_write(&drv_data->regs->rcr2, bits_per_word - 1);
@@ -597,11 +598,12 @@ bfin_sport_spi_setup(struct spi_device *spi)
597 } 598 }
598 chip->cs_chg_udelay = chip_info->cs_chg_udelay; 599 chip->cs_chg_udelay = chip_info->cs_chg_udelay;
599 chip->idle_tx_val = chip_info->idle_tx_val; 600 chip->idle_tx_val = chip_info->idle_tx_val;
600 spi->bits_per_word = chip_info->bits_per_word;
601 } 601 }
602 } 602 }
603 603
604 if (spi->bits_per_word != 8 && spi->bits_per_word != 16) { 604 if (spi->bits_per_word % 8) {
605 dev_err(&spi->dev, "%d bits_per_word is not supported\n",
606 spi->bits_per_word);
605 ret = -EINVAL; 607 ret = -EINVAL;
606 goto error; 608 goto error;
607 } 609 }