Page tree
Skip to end of metadata
Go to start of metadata

产品中需要使用GPIO作为KEY按键,需要编写下面的dts代码。

&iomuxc {
		imx6ul-i2s6ull {
				pinctrl_gpio_key: keygrp {
						fsl,pins = <
								MX6UL_PAD_NAND_CE1_B__GPIO4_IO14 0x1b0b0
						>;
				};
		};
};

gpio-keys {
		compatible = "gpio-keys";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gpio_key>;

		user {
				label = "User Button";
				gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
				gpio-key,wakeup;
				linux,code = <KEY_1>;
		};
};



  • No labels
Write a comment…