]> git.sur5r.net Git - u-boot/blobdiff - drivers/spi/bfin_spi.c
treewide: replace #include <asm/errno.h> with <linux/errno.h>
[u-boot] / drivers / spi / bfin_spi.c
index aa89d89a32afa3c9e2710ff0214f50050a23f60e..9a6fc781515ac9016c7c791712395ae8d2396a95 100644 (file)
@@ -9,10 +9,12 @@
 /*#define DEBUG*/
 
 #include <common.h>
+#include <console.h>
 #include <malloc.h>
 #include <spi.h>
 
 #include <asm/blackfin.h>
+#include <asm/clock.h>
 #include <asm/gpio.h>
 #include <asm/portmux.h>
 #include <asm/mach-common/bits/spi.h>
@@ -140,12 +142,12 @@ 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 baud;
 
-       sclk = get_sclk();
+       clk = get_spi_clk();
        /* baud should be rounded up */
-       baud = DIV_ROUND_UP(sclk, 2 * hz);
+       baud = DIV_ROUND_UP(clk, 2 * hz);
        if (baud < 2)
                baud = 2;
        else if (baud > (u16)-1)