]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/cbus/cbus.c
use standard gpio get/set calls (OMAP tree only)
[linux-2.6-omap-h63xx.git] / drivers / cbus / cbus.c
index eff38be50880e9c8a3e2ee28aec88ce7c4730cd0..de3440944a942fb59504a01726ee9e38ed6ba324 100644 (file)
@@ -29,8 +29,8 @@
 #include <linux/delay.h>
 #include <linux/spinlock.h>
 
-#include <asm/arch/gpio.h>
-#include <asm/arch/board.h>
+#include <mach/gpio.h>
+#include <mach/board.h>
 
 #include <asm/io.h>
 
@@ -102,28 +102,28 @@ static u8 cbus_receive_bit(struct cbus_host *host, u32 base)
 #else
 
 #define cbus_set_gpio_direction(base, gpio, is_input) omap_set_gpio_direction(gpio, is_input)
-#define cbus_set_gpio_dataout(base, gpio, enable) omap_set_gpio_dataout(gpio, enable)
-#define cbus_get_gpio_datain(base, int, gpio) omap_get_gpio_datain(gpio)
+#define cbus_set_gpio_dataout(base, gpio, enable) gpio_set_value(gpio, enable)
+#define cbus_get_gpio_datain(base, int, gpio) gpio_get_value(gpio)
 
 static void _cbus_send_bit(struct cbus_host *host, int bit, int set_to_input)
 {
-       omap_set_gpio_dataout(host->dat_gpio, bit ? 1 : 0);
-       omap_set_gpio_dataout(host->clk_gpio, 1);
+       gpio_set_value(host->dat_gpio, bit ? 1 : 0);
+       gpio_set_value(host->clk_gpio, 1);
 
        /* The data bit is read on the rising edge of CLK */
        if (set_to_input)
                omap_set_gpio_direction(host->dat_gpio, 1);
 
-       omap_set_gpio_dataout(host->clk_gpio, 0);
+       gpio_set_value(host->clk_gpio, 0);
 }
 
 static u8 _cbus_receive_bit(struct cbus_host *host)
 {
        u8 ret;
 
-       omap_set_gpio_dataout(host->clk_gpio, 1);
-       ret = omap_get_gpio_datain(host->dat_gpio);
-       omap_set_gpio_dataout(host->clk_gpio, 0);
+       gpio_set_value(host->clk_gpio, 1);
+       ret = gpio_get_value(host->dat_gpio);
+       gpio_set_value(host->clk_gpio, 0);
 
        return ret;
 }
@@ -141,7 +141,7 @@ static int cbus_transfer(struct cbus_host *host, int dev, int reg, int data)
        u32 base;
 
 #ifdef CONFIG_ARCH_OMAP1
-       base = (u32) io_p2v(OMAP_MPUIO_BASE);
+       base = OMAP1_IO_ADDRESS(OMAP_MPUIO_BASE);
 #else
        base = 0;
 #endif
@@ -260,15 +260,15 @@ int __init cbus_bus_init(void)
        if ((ret = omap_request_gpio(chost->sel_gpio)) < 0)
                goto exit3;
 
-       omap_set_gpio_dataout(chost->clk_gpio, 0);
-       omap_set_gpio_dataout(chost->sel_gpio, 1);
+       gpio_set_value(chost->clk_gpio, 0);
+       gpio_set_value(chost->sel_gpio, 1);
 
        omap_set_gpio_direction(chost->clk_gpio, 0);
        omap_set_gpio_direction(chost->dat_gpio, 1);
        omap_set_gpio_direction(chost->sel_gpio, 0);
 
-       omap_set_gpio_dataout(chost->clk_gpio, 1);
-       omap_set_gpio_dataout(chost->clk_gpio, 0);
+       gpio_set_value(chost->clk_gpio, 1);
+       gpio_set_value(chost->clk_gpio, 0);
 
        cbus_host = chost;