Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 63858
b: refs/heads/master
c: a44648b
h: refs/heads/master
v: v3
  • Loading branch information
Anton Vorontsov authored and Linus Torvalds committed Aug 11, 2007
1 parent 4dc78ba commit 86bd9e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 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: e24a4d1ee337e3a67a502f3f19cdec3ffc45ad05
refs/heads/master: a44648b057f5331fe6c0e863dc693ed335490e7a
8 changes: 6 additions & 2 deletions trunk/drivers/spi/spi_mpc83xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, int value)
if (value == BITBANG_CS_ACTIVE) {
u32 regval = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode);
u32 len = spi->bits_per_word;
u8 pm;

if (len == 32)
len = 0;
else
Expand All @@ -170,7 +172,7 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, int value)
regval |= SPMODE_LEN(len);

if ((mpc83xx_spi->spibrg / spi->max_speed_hz) >= 64) {
u8 pm = mpc83xx_spi->spibrg / (spi->max_speed_hz * 64);
pm = mpc83xx_spi->spibrg / (spi->max_speed_hz * 64) - 1;
if (pm > 0x0f) {
dev_err(&spi->dev, "Requested speed is too "
"low: %d Hz. Will use %d Hz instead.\n",
Expand All @@ -180,7 +182,9 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, int value)
}
regval |= SPMODE_PM(pm) | SPMODE_DIV16;
} else {
u8 pm = mpc83xx_spi->spibrg / (spi->max_speed_hz * 4);
pm = mpc83xx_spi->spibrg / (spi->max_speed_hz * 4);
if (pm)
pm--;
regval |= SPMODE_PM(pm);
}

Expand Down

0 comments on commit 86bd9e8

Please sign in to comment.