Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105437
b: refs/heads/master
c: a61f534
h: refs/heads/master
i:
  105435: 92a9d12
v: v3
  • Loading branch information
Chen Gong authored and Linus Torvalds committed Jul 24, 2008
1 parent 0efe857 commit 2484fed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 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: 708d8cefd0f6d8dc13027f899e865ccfa5f63871
refs/heads/master: a61f5345eba34772a71523227de890a28410f320
29 changes: 16 additions & 13 deletions trunk/drivers/spi/spi_mpc83xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,21 +266,24 @@ int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)

cs->hw_mode |= SPMODE_LEN(bits_per_word);

if ((mpc83xx_spi->spibrg / hz) >= 64) {
pm = mpc83xx_spi->spibrg / (hz * 64) - 1;
if (pm > 0x0f) {
dev_err(&spi->dev, "Requested speed is too "
"low: %d Hz. Will use %d Hz instead.\n",
hz, mpc83xx_spi->spibrg / 1024);
pm = 0x0f;
if ((mpc83xx_spi->spibrg / hz) > 64) {
pm = mpc83xx_spi->spibrg / (hz * 64);
if (pm > 16) {
cs->hw_mode |= SPMODE_DIV16;
pm /= 16;
if (pm > 16) {
dev_err(&spi->dev, "Requested speed is too "
"low: %d Hz. Will use %d Hz instead.\n",
hz, mpc83xx_spi->spibrg / 1024);
pm = 16;
}
}
cs->hw_mode |= SPMODE_PM(pm) | SPMODE_DIV16;
} else {
} else
pm = mpc83xx_spi->spibrg / (hz * 4);
if (pm)
pm--;
cs->hw_mode |= SPMODE_PM(pm);
}
if (pm)
pm--;

cs->hw_mode |= SPMODE_PM(pm);
regval = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode);
if (cs->hw_mode != regval) {
unsigned long flags;
Expand Down

0 comments on commit 2484fed

Please sign in to comment.