#include <asm/arch/hardware.h>
#include <asm/arch/davinci_misc.h>
-
static struct gpio_registry {
int is_registered;
char name[GPIO_NAME_SIZE];
} gpio_registry[MAX_NUM_GPIOS];
-
#define pinmux(x) (&davinci_syscfg_regs->pinmux[x])
static const struct pinmux_config gpio_pinmux[] = {
{ pinmux(18), 8, 2 },
};
-
-
int gpio_request(int gp, const char *label)
{
if (gp >= MAX_NUM_GPIOS)
return 0;
}
-
void gpio_free(int gp)
{
gpio_registry[gp].is_registered = 0;
}
-
void gpio_toggle_value(int gp)
{
struct davinci_gpio *bank;
gpio_set_value(gp, !gpio_get_value(gp));
}
-
int gpio_direction_input(int gp)
{
struct davinci_gpio *bank;
return 0;
}
-
int gpio_direction_output(int gp, int value)
{
struct davinci_gpio *bank;
return 0;
}
-
int gpio_get_value(int gp)
{
struct davinci_gpio *bank;
return ip ? 1 : 0;
}
-
void gpio_set_value(int gp, int value)
{
struct davinci_gpio *bank;
bank->clr_data = 1U << GPIO_BIT(gp);
}
-
void gpio_info(void)
{
int gp, dir, val;