Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291966
b: refs/heads/master
c: 87bf5ab
h: refs/heads/master
v: v3
  • Loading branch information
Sebastian Andrzej Siewior authored and Grant Likely committed Mar 15, 2012
1 parent e91fd00 commit 29d84d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 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: 35faa55cff56441477973e454f62408714f35cd3
refs/heads/master: 87bf5ab82884c829366914aaa813cc8b07b9fe58
10 changes: 6 additions & 4 deletions trunk/drivers/spi/spi-fsl-espi.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,18 @@ static int fsl_espi_setup_transfer(struct spi_device *spi,
cs->hw_mode |= CSMODE_DIV16;
pm = DIV_ROUND_UP(mpc8xxx_spi->spibrg, hz * 16 * 4);

WARN_ONCE(pm > 16, "%s: Requested speed is too low: %d Hz. "
WARN_ONCE(pm > 33, "%s: Requested speed is too low: %d Hz. "
"Will use %d Hz instead.\n", dev_name(&spi->dev),
hz, mpc8xxx_spi->spibrg / 1024);
if (pm > 16)
pm = 16;
hz, mpc8xxx_spi->spibrg / (4 * 16 * (32 + 1)));
if (pm > 33)
pm = 33;
} else {
pm = DIV_ROUND_UP(mpc8xxx_spi->spibrg, hz * 4);
}
if (pm)
pm--;
if (pm < 2)
pm = 2;

cs->hw_mode |= CSMODE_PM(pm);

Expand Down

0 comments on commit 29d84d8

Please sign in to comment.