#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>
#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;
}
u32 base;
#ifdef CONFIG_ARCH_OMAP1
- base = (u32) io_p2v(OMAP_MPUIO_BASE);
+ base = OMAP1_IO_ADDRESS(OMAP_MPUIO_BASE);
#else
base = 0;
#endif
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;