提交 3b690ebb 编写于 作者: S Sanjeev Premi 提交者: Albert ARIBAUD

omap: gpio: generic changes after changing API

This patch contains the generic changes required after
change to generic API in the previous patch.
Signed-off-by: NSanjeev Premi <premi@ti.com>
Signed-off-by: NSandeep Paulraj <s-paulraj@ti.com>
上级 81bdc155
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
*/ */
#include <common.h> #include <common.h>
#include <asm/omap_common.h> #include <asm/omap_common.h>
#include <asm/gpio.h>
#include <asm/arch/clocks.h> #include <asm/arch/clocks.h>
#include <asm/arch/sys_proto.h> #include <asm/arch/sys_proto.h>
#include <asm/utils.h> #include <asm/utils.h>
...@@ -481,8 +482,8 @@ static void do_scale_tps62361(u32 reg, u32 volt_mv) ...@@ -481,8 +482,8 @@ static void do_scale_tps62361(u32 reg, u32 volt_mv)
* VSEL1 is grounded on board. So the following selects * VSEL1 is grounded on board. So the following selects
* VSEL1 = 0 and VSEL0 = 1 * VSEL1 = 0 and VSEL0 = 1
*/ */
omap_set_gpio_direction(TPS62361_VSEL0_GPIO, 0); gpio_direction_output(TPS62361_VSEL0_GPIO, 0);
omap_set_gpio_dataout(TPS62361_VSEL0_GPIO, 1); gpio_set_value(TPS62361_VSEL0_GPIO, 1);
temp = TPS62361_I2C_SLAVE_ADDR | temp = TPS62361_I2C_SLAVE_ADDR |
(reg << PRM_VC_VAL_BYPASS_REGADDR_SHIFT) | (reg << PRM_VC_VAL_BYPASS_REGADDR_SHIFT) |
......
...@@ -98,24 +98,24 @@ gpio ...@@ -98,24 +98,24 @@ gpio
To set a bit : To set a bit :
if (!omap_request_gpio(N)) { if (!gpio_request(N, "")) {
omap_set_gpio_direction(N, 0); gpio_direction_output(N, 0);
omap_set_gpio_dataout(N, 1); gpio_set_value(N, 1);
} }
To clear a bit : To clear a bit :
if (!omap_request_gpio(N)) { if (!gpio_request(N, "")) {
omap_set_gpio_direction(N, 0); gpio_direction_output(N, 0);
omap_set_gpio_dataout(N, 0); gpio_set_value(N, 0);
} }
To read a bit : To read a bit :
if (!omap_request_gpio(N)) { if (!gpio_request(N, "")) {
omap_set_gpio_direction(N, 1); gpio_direction_input(N);
val = omap_get_gpio_datain(N); val = gpio_get_value(N);
omap_free_gpio(N); gpio_free(N);
} }
if (val) if (val)
printf("GPIO N is set\n"); printf("GPIO N is set\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册