1 From 444149f35455bfe551ce9dfa21d00b5b34ffb04f Mon Sep 17 00:00:00 2001
2 From: Kamal Mostafa <kamal@whence.com>
3 Date: Mon, 22 Oct 2012 15:52:44 -0700
4 Subject: [PATCH 046/174] spi/spi-bcm2708: respect per-transfer SPI clock
7 The bcm2708 SPI driver's bcm2708_process_transfer() was ignoring the
8 per-transfer speed_hz value even when it was provided (it always just
9 used the spi device's max_speed_hz value). Now, per-transfer speed_hz
12 Also added debug print to bcm2708_setup_state() to help keep an eye on
13 the configured SPI parameters.
15 Signed-off-by: Kamal Mostafa <kamal@whence.com>
17 drivers/spi/spi-bcm2708.c | 7 ++++++-
18 1 file changed, 6 insertions(+), 1 deletion(-)
20 --- a/drivers/spi/spi-bcm2708.c
21 +++ b/drivers/spi/spi-bcm2708.c
22 @@ -259,6 +259,10 @@ static int bcm2708_setup_state(struct sp
26 + dev_dbg(dev, "setup: want %d Hz; "
27 + "bus_hz=%lu / cdiv=%u == %lu Hz; "
28 + "mode %u: cs 0x%08X\n",
29 + hz, bus_hz, cdiv, bus_hz/cdiv, mode, cs);
33 @@ -277,7 +281,8 @@ static int bcm2708_process_transfer(stru
35 if (xfer->bits_per_word || xfer->speed_hz) {
36 ret = bcm2708_setup_state(spi->master, &spi->dev, &state,
37 - spi->max_speed_hz, spi->chip_select, spi->mode,
38 + xfer->speed_hz ? xfer->speed_hz : spi->max_speed_hz,
39 + spi->chip_select, spi->mode,