1 #include <asm/arch/gpio.h>
2 #include <asm/arch/mfp.h>
4 extern int sprd_gpio_request(struct gpio_chip *chip, unsigned offset);
5 extern void sprd_gpio_init(void);
6 static unsigned long pwr_gpio_cfg =
7 MFP_ANA_CFG_X(PBINT, AF0, DS1, F_PULL_UP,S_PULL_UP, IO_IE);
10 static unsigned long chg_gpio_cfg =
11 MFP_ANA_CFG_X(CHIP_RSTN, AF0, DS1, F_PULL_UP,S_PULL_UP, IO_IE);
14 int board_gpio_init(void)
18 sprd_mfp_config(&chg_gpio_cfg, 1);
19 sprd_gpio_request(NULL, CHG_GPIO_NUM);
20 sprd_gpio_direction_input(NULL,CHG_GPIO_NUM);
22 // config power button
23 sprd_mfp_config(&pwr_gpio_cfg, 1);
24 sprd_gpio_request(NULL, POWER_BUTTON_GPIO_NUM);
25 sprd_gpio_direction_input(NULL,POWER_BUTTON_GPIO_NUM);