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: Sanjeev Premi <premi@ti.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
This commit is contained in:
Sanjeev Premi
2011-09-08 10:48:39 -04:00
committed by Albert ARIBAUD
parent 81bdc155c7
commit 3b690ebbbf
2 changed files with 13 additions and 12 deletions

View File

@@ -98,24 +98,24 @@ gpio
To set a bit :
if (!omap_request_gpio(N)) {
omap_set_gpio_direction(N, 0);
omap_set_gpio_dataout(N, 1);
if (!gpio_request(N, "")) {
gpio_direction_output(N, 0);
gpio_set_value(N, 1);
}
To clear a bit :
if (!omap_request_gpio(N)) {
omap_set_gpio_direction(N, 0);
omap_set_gpio_dataout(N, 0);
if (!gpio_request(N, "")) {
gpio_direction_output(N, 0);
gpio_set_value(N, 0);
}
To read a bit :
if (!omap_request_gpio(N)) {
omap_set_gpio_direction(N, 1);
val = omap_get_gpio_datain(N);
omap_free_gpio(N);
if (!gpio_request(N, "")) {
gpio_direction_input(N);
val = gpio_get_value(N);
gpio_free(N);
}
if (val)
printf("GPIO N is set\n");