Part Number: AM3359
Hi,
Customer wants to add GPIO input detection in Uboot. Please help check below code:
board/ti/am335x/board.c
#define GPIO_1_15 GPIO_TO_PIN(1, 15)//add
int board_late_init(void)
{
u32 reg_val;
...
gpio_request(GPIO_1_15, "key");//add
gpio_direction_input(GPIO_1_15);//add
mdelay(300);//add
reg_val = gpio_get_value(GPIO_1_15);//add
}
board/ti/am335x/mux.c
static struct module_pin_mux gpio1_15_pin_mux[] = {
{OFFSET(gpmc_ad15), (MODE(7) | PULLUP_EN)},
{-1},
};//add
void enable_board_pin_mux(void)
{
if(board_is_bone()) {
...
configure_module_pin_mux(spi0_pin_mux);
configure_module_pin_mux(gpio1_15_pin_mux);//add
}
He can't acquire value from gpio_get_value.