Part Number: AM4378
Tool/software: Linux
Hi Sir
We used TISDK 5.3.0.7 for development and used DTS to set GPIO function.
We found the the software /sys gpiochip mapping is different from hardware gpio port.
gpio0 -> gpiochip4
gpio1 -> gpiochip0
gpio2 -> gpiochip1
gpio3 -> gpiochip2
gpio4 -> gpiochip3
gpio5 -> gpiochip5
and saw the log message as below
root@am437x-evm:~# cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-31, parent: platform/4804c000.gpio, gpio:
gpio-16 ( |sysfs ) out hi
gpio-20 ( |vmmcwl_fixed ) out hi
gpiochip1: GPIOs 32-63, parent: platform/481ac000.gpio, gpio:
gpiochip2: GPIOs 64-95, parent: platform/481ae000.gpio, gpio:
gpio-83 ( |matrix_kbd_col ) out hi
gpio-84 ( |matrix_kbd_col ) out hi
gpiochip3: GPIOs 96-127, parent: platform/48320000.gpio, gpio:
gpio-98 ( |matrix_kbd_row ) in lo IRQ
gpio-99 ( |matrix_kbd_row ) in lo IRQ
gpiochip4: GPIOs 128-159, parent: platform/44e07000.gpio, gpio:
gpio-131 ( |matrix_kbd_row ) in hi IRQ
gpio-134 ( |cd ) in lo IRQ
gpio-151 ( |SelEMMCorNAND ) out lo
gpiochip5: GPIOs 160-191, parent: platform/48322000.gpio, gpio:
gpio-167 ( |vtt_fixed ) out hi
gpio-168 ( |SelLCDorHDMI ) out hi
//===============================================================//
DTS Setting
vtt_fixed: fixedregulator-vtt {
compatible = "regulator-fixed";
regulator-name = "vtt_fixed";
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <1500000>;
regulator-always-on;
regulator-boot-on;
enable-active-high;
gpio = <&gpio5 7 GPIO_ACTIVE_HIGH>;
};
vmmcwl_fixed: fixedregulator-mmcwl {
compatible = "regulator-fixed";
regulator-name = "vmmcwl_fixed";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
gpio = <&gpio1 20 GPIO_ACTIVE_HIGH>;
enable-active-high;
};
gpio0_pins: gpio0_pins {
pinctrl-single,pins = <
AM4372_IOPAD(0xa6c, PIN_OUTPUT | MUX_MODE9) /*
spi2_cs0.gpio0_23 SEL_eMMCorNANDn */
>;
};
&gpio0 {
pinctrl-names = "default";
pinctrl-0 = <&gpio0_pins>;
status = "okay";
p23 {
gpio-hog;
gpios = <23 GPIO_ACTIVE_HIGH>;
/* SelEMMCorNAND selects between eMMC and NAND:
* Low: NAND
* High: eMMC
* When changing this line make sure the newly
* selected device node is enabled and the previously
* selected device node is disabled.
*/
output-low;
line-name = "SelEMMCorNAND";
};
};
&gpio5 {
pinctrl-names = "default";
pinctrl-0 = <&display_mux_pins>;
status = "okay";
ti,no-reset-on-init;
p8 {
/*
* SelLCDorHDMI selects between display and audio paths:
* Low: HDMI display with audio via HDMI
* High: LCD display with analog audio via aic3111 codec
*/
gpio-hog;
gpios = <8 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "SelLCDorHDMI";
};
};
matrix_keypad: matrix_keypad0 {
compatible = "gpio-matrix-keypad";
debounce-delay-ms = <5>;
col-scan-delay-us = <2>;
pinctrl-names = "default", "sleep";
pinctrl-0 = <&matrix_keypad_default>;
pinctrl-1 = <&matrix_keypad_sleep>;
linux,wakeup;
row-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH /* Bank0, pin3 */
&gpio4 3 GPIO_ACTIVE_HIGH /* Bank4, pin3 */
&gpio4 2 GPIO_ACTIVE_HIGH>; /* Bank4, pin2 */
col-gpios = <&gpio3 19 GPIO_ACTIVE_HIGH /* Bank3, pin19 */
&gpio3 20 GPIO_ACTIVE_HIGH>; /* Bank3, pin20 */
linux,keymap = <0x00000201 /* P1 */
0x00010202 /* P2 */
0x01000067 /* UP */
0x0101006a /* RIGHT */
0x02000069 /* LEFT */
0x0201006c>; /* DOWN */
};
Does TI expert have any suggestion or we miss any setting ?
please advise
BR
YImin