]> git.sur5r.net Git - u-boot/blobdiff - drivers/spi/bfin_spi6xx.c
i2c: sh_i2c: bugfix: i2c probe command does not work
[u-boot] / drivers / spi / bfin_spi6xx.c
index 07b833d3a3de22b134b6d9ee4b1ffc6b422034f8..eba01d16f50d7d6f095cf87625624a7b33fd1ef7 100644 (file)
@@ -22,6 +22,7 @@
 #include <spi.h>
 
 #include <asm/blackfin.h>
+#include <asm/clock.h>
 #include <asm/gpio.h>
 #include <asm/portmux.h>
 #include <asm/mach-common/bits/spi6xx.h>
@@ -135,11 +136,11 @@ static const unsigned short cs_pins[][7] = {
 void spi_set_speed(struct spi_slave *slave, uint hz)
 {
        struct bfin_spi_slave *bss = to_bfin_spi_slave(slave);
-       ulong sclk;
+       ulong clk;
        u32 clock;
 
-       sclk = get_sclk1();
-       clock = sclk / hz;
+       clk = get_spi_clk();
+       clock = clk / hz;
        if (clock)
                clock--;
        bss->clock = clock;