Permalink
Browse files

Merge pull request #146 from kamalmostafa/rpi-patches

spi/spi-bcm2708: respect per-transfer SPI clock speed_hz value
  • Loading branch information...
2 parents b8acea4 + 06165b5 commit 8fa2e19c4fdbe17704947e444674e19ea47c8ddd @popcornmix popcornmix committed Nov 4, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 drivers/spi/spi-bcm2708.c
@@ -259,6 +259,10 @@ static int bcm2708_setup_state(struct spi_master *master,
if (state) {
state->cs = cs;
state->cdiv = cdiv;
+ dev_dbg(dev, "setup: want %d Hz; "
+ "bus_hz=%lu / cdiv=%u == %lu Hz; "
+ "mode %u: cs 0x%08X\n",
+ hz, bus_hz, cdiv, bus_hz/cdiv, mode, cs);
}
return 0;
@@ -277,7 +281,8 @@ static int bcm2708_process_transfer(struct bcm2708_spi *bs,
if (xfer->bits_per_word || xfer->speed_hz) {
ret = bcm2708_setup_state(spi->master, &spi->dev, &state,
- spi->max_speed_hz, spi->chip_select, spi->mode,
+ xfer->speed_hz ? xfer->speed_hz : spi->max_speed_hz,
+ spi->chip_select, spi->mode,
spi->bits_per_word);
if (ret)
return ret;

0 comments on commit 8fa2e19

Please sign in to comment.