Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299760
b: refs/heads/master
c: 8d9d2a4
h: refs/heads/master
v: v3
  • Loading branch information
Scott Jiang authored and Grant Likely committed Apr 27, 2012
1 parent 1a0ca53 commit e2ea68c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7666fd8b02af87a8b672b00d47e56d77f709127e
refs/heads/master: 8d9d2a4b6ca0013b62a438808d22bdd615abcd00
14 changes: 8 additions & 6 deletions trunk/drivers/spi/spi-bfin-sport.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,12 @@ bfin_sport_spi_pump_transfers(unsigned long data)
drv_data->cs_change = transfer->cs_change;

/* Bits per word setup */
bits_per_word = transfer->bits_per_word ? : message->spi->bits_per_word;
if (bits_per_word == 8)
drv_data->ops = &bfin_sport_transfer_ops_u8;
else
bits_per_word = transfer->bits_per_word ? :
message->spi->bits_per_word ? : 8;
if (bits_per_word % 16 == 0)
drv_data->ops = &bfin_sport_transfer_ops_u16;
else
drv_data->ops = &bfin_sport_transfer_ops_u8;
bfin_write(&drv_data->regs->tcr2, bits_per_word - 1);
bfin_write(&drv_data->regs->tfsdiv, bits_per_word - 1);
bfin_write(&drv_data->regs->rcr2, bits_per_word - 1);
Expand Down Expand Up @@ -597,11 +598,12 @@ bfin_sport_spi_setup(struct spi_device *spi)
}
chip->cs_chg_udelay = chip_info->cs_chg_udelay;
chip->idle_tx_val = chip_info->idle_tx_val;
spi->bits_per_word = chip_info->bits_per_word;
}
}

if (spi->bits_per_word != 8 && spi->bits_per_word != 16) {
if (spi->bits_per_word % 8) {
dev_err(&spi->dev, "%d bits_per_word is not supported\n",
spi->bits_per_word);
ret = -EINVAL;
goto error;
}
Expand Down

0 comments on commit e2ea68c

Please sign in to comment.