How to Use the imx6q GPIO function, imx6qgpio
Suppose we want to use the 11th-foot EIM_D18 of the expansion port.
Find EIM_18 in arch/arm/plat-mxc/include/mach/iomux-mx6q.h first,
You can find MX6Q_PAD_EIM_D18 _ xxx. Because it is used as gpio, mx6q_pad_eim_d181_gpio_3_18 is used,
Add it to the board-mx6q_sabresd.h.
Static iomux_v3_cfg_t mx6q_sabresd_pads [] = {
....
Mx6q_pad_eim_d1820.gpio_3_18
....
}
Then add
# Define SABRESD_GPIO_CTRL IMX_GPIO_NR (3, 18)
Static struct gpio_led imx6q_gpio_leds [] =
{
GPIO_LED (SABRESD_CHARGE_NOW, "chg_now_led", 0, 1, "charger-charging "),
GPIO_LED (SABRESD_GPIO_CTRL, "gpio_xxx", 0, 1, "xxx "),
};
Re-compile the kernel, burn and write, only write 0 or 1/
Echo 0/1> sys/class/leds/gpio_xxx/brightness
This node can control the level.
If you cannot control the configuration, you can find PAD_EIM_D18 in mx6q_sabresd_pads. Check whether another feature is reinitialized by another script after mx6q_pad_eim_d181_gpio_3_18.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.