参考链接: https://whycan.cn/t_2227.html
修改的是这个文件: drivers/pinctrl/sunxi/pinctrl-sun8i-v3s.c
添加:
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 12),
SUNXI_FUNCTION(0x0, "gpio_in"),
SUNXI_FUNCTION(0x1, "gpio_out"),
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)), /* PB_EINT12 */
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 13),
SUNXI_FUNCTION(0x0, "gpio_in"),
SUNXI_FUNCTION(0x1, "gpio_out"),
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 13)), /* PB_EINT13 */
重烧 zImage 之后, 执行出错:
# echo 44 > /sys/class/gpio/export;
sh: write error: Device or resource busy
离线
echo 44 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio44/direction
echo 1 > /sys/class/gpio/gpio44/value ### PB12 输出高电平
echo 0 > /sys/class/gpio/gpio44/value ### PB12 输出低电平
换了一台电脑,重新按一楼修改,编译烧录,测试完全正常了.
离线