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

i2S-6UB核心板支持GPIO的矩阵键盘,根据所需要的,可以配置相应的键值。需要在i2c6ulx-i2s6ull-nand.dtsi中添加以下代码。

	matrix_keypad: matrix-keypad@0 {
		compatible = "gpio-matrix-keypad";
		col-gpios = <
			&gpio5 0 GPIO_ACTIVE_HIGH
			&gpio5 1 GPIO_ACTIVE_HIGH
			&gpio5 2 GPIO_ACTIVE_HIGH
			&gpio5 3 GPIO_ACTIVE_HIGH
		>;
		row-gpios = <
			&gpio5 4 GPIO_ACTIVE_HIGH
			&gpio5 5 GPIO_ACTIVE_HIGH
			&gpio5 6 GPIO_ACTIVE_HIGH
			&gpio5 7 GPIO_ACTIVE_HIGH
		>;
		/* sample keymap */
		linux,keymap = <
			0x00000074 /* row 0, col 0, KEY_POWER */
			0x00010052 /* row 0, col 1, KEY_KP0 */
			0x0002004f /* row 0, col 2, KEY_KP1 */
			0x00030050 /* row 0, col 3, KEY_KP2 */
			0x01000051 /* row 1, col 0, KEY_KP3 */
			0x0101004b /* row 1, col 1, KEY_KP4 */
			0x0102004c /* row 1, col 2, KEY_KP5 */
			0x0103004d /* row 1, col 3, KEY_KP6 */
			0x02000047 /* row 2, col 0, KEY_KP7 */
			0x02010048 /* row 2, col 1, KEY_KP8 */
			0x02020049 /* row 2, col 2, KEY_KP9 */
		>;
		gpio-activelow;
		linux,wakeup;
		debounce-delay-ms = <100>;
		col-scan-delay-us = <5000>;
		linux,no-autorepeat;
	};


  • No labels
Write a comment…