diff options
-rw-r--r-- | arch/blackfin/include/asm/bfin5xx_spi.h | 2 | ||||
-rw-r--r-- | drivers/spi/spi_bfin5xx.c | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/arch/blackfin/include/asm/bfin5xx_spi.h b/arch/blackfin/include/asm/bfin5xx_spi.h index 0292d58f9362..ea2d24af9542 100644 --- a/arch/blackfin/include/asm/bfin5xx_spi.h +++ b/arch/blackfin/include/asm/bfin5xx_spi.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef _SPI_CHANNEL_H_ | 11 | #ifndef _SPI_CHANNEL_H_ |
12 | #define _SPI_CHANNEL_H_ | 12 | #define _SPI_CHANNEL_H_ |
13 | 13 | ||
14 | #define MIN_SPI_BAUD_VAL 2 | ||
15 | |||
14 | #define SPI_READ 0 | 16 | #define SPI_READ 0 |
15 | #define SPI_WRITE 1 | 17 | #define SPI_WRITE 1 |
16 | 18 | ||
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c index e440718b3209..a3e06283f74d 100644 --- a/drivers/spi/spi_bfin5xx.c +++ b/drivers/spi/spi_bfin5xx.c | |||
@@ -158,6 +158,9 @@ static u16 hz_to_spi_baud(u32 speed_hz) | |||
158 | if ((sclk % (2 * speed_hz)) > 0) | 158 | if ((sclk % (2 * speed_hz)) > 0) |
159 | spi_baud++; | 159 | spi_baud++; |
160 | 160 | ||
161 | if (spi_baud < MIN_SPI_BAUD_VAL) | ||
162 | spi_baud = MIN_SPI_BAUD_VAL; | ||
163 | |||
161 | return spi_baud; | 164 | return spi_baud; |
162 | } | 165 | } |
163 | 166 | ||