cat /sys/kernel/debug/gpio
we can see that
GPIOs 0-23, platform/pinctrl, gpio0:
gpio-0 ( |vsel ) out lo
gpio-5 ( |GPIO Key Power ) in hi
gpio-8 ( |rk818_dc_det ) in lo
gpio-12 ( |otg_drv_gpio ) out lo
gpio-14 ( |vcc_host ) out hi
gpio-17 ( |vcc18_dvp ) out lo
GPIOs 24-55, platform/pinctrl, gpio1:
GPIOs 56-87, platform/pinctrl, gpio2:
gpio-71 ( |pwdn ) out lo
GPIOs 88-119, platform/pinctrl, gpio3:
GPIOs 120-151, platform/pinctrl, gpio4:
gpio-139 ( |bt_default_rts ) in hi
gpio-146 ( |bt_default_wake ) in hi
gpio-148 ( |reset ) out hi
gpio-149 ( |bt_default_reset ) out lo
gpio-151 ( |bt_default_wake_host) in hi
GPIOs 152-183, platform/pinctrl, gpio5:
GPIOs 184-215, platform/pinctrl, gpio6:
GPIOs 216-247, platform/pinctrl, gpio7:
gpio-217 ( |enable ) out hi
gpio-218 ( |enable ) out hi
gpio-219 ( |vcc_lcd ) out hi
gpio-220 ( |reset ) out hi
gpio-221 ( |GTP_RST_PORT ) in hi
gpio-222 ( |GTP_INT_IRQ ) in hi
gpio-223 ( |hp det ) in lo
gpio-224 ( |host_drv_gpio ) out hi
gpio-231 ( |? ) out lo
GPIOs 248-263, platform/pinctrl, gpio8:
we can know that, gpio8 is begin with 248, then , we cloud know GPIO8_A4 is 248+4=252
now, let control GPIO08_A4:
echo 252 > /sys/class/gpio/export //open GPIO8_A4
echo out > /sys/class/gpio/gpio252/direction //make GPIO8_A4 as output
echo 1 >/sys/class/gpio/gpio252/value //pull up GPIO8_A4
echo 0 >/sys/class/gpio/gpio252/value //pull down GPIO8_A4
if you wanna to setup this GPIO as input mode,just run
echo in > /sys/class/gpio/gpio252/direction
then, the fllowing scripts is for reading:
cat /sys/class/gpio/gpio252/value
if you wanna to disable this GPIO, just run the fllowing scripts:
echo 252 > /sys/class/gpio/unexport