Hy.
I try to use the button by GPIO.
I don’t manage to find which gpio i must use
keys {
compatible = "gpio-keys";
pinctrl-0 = <&cp0_button_pin>;
pinctrl-names = "default";
button0{
/* SW3 button */
label = "SW3";
gpios = <&cp0_gpio2 0 GPIO_ACTIVE_LOW>;
linux,can-disable;
linux,code = <BTN_0>;
};
};
};
and
cp0_button_pin: cp0-button-pin {
marvell,pins = "mpp32";
marvell,function = "gpio";
};
# ls /sys/class/gpio/
export gpio42 gpiochip32 gpiochip64
gpio32 gpiochip0 gpiochip512 unexport
# ^C
#
# gpiodetect
gpiochip0 [0-0020] (16 lines)
gpiochip1 [f06f4000.system-controller:gpio] (20 lines)
gpiochip2 [f2440000.system-controller:gpio] (32 lines)
gpiochip3 [f2440000.system-controller:gpio] (31 lines)
# ^C
# gpioinfo gpiochip0
gpiochip0 - 16 lines:
line 0: unnamed "pcie1.0-clkreq" input active-low [used]
line 1: unnamed unused output active-high
line 2: unnamed unused output active-high
line 3: unnamed "pcie1.0-w-disable" output active-low [used]
line 4: unnamed "pcie2.0-clkreq" input active-low [used]
line 5: unnamed "usb3-current-limit" input active-low [used]
line 6: unnamed "usb3-power" output active-high [used]
line 7: unnamed "pcie2.0-w-disable" output active-low [used]
line 8: unnamed unused input active-high
line 9: unnamed unused input active-high
line 10: unnamed unused input active-high
line 11: unnamed "m.2 devslp" output active-high [used]
line 12: unnamed "los" input active-high [used]
line 13: unnamed "tx-fault" input active-high [used]
line 14: unnamed "tx-disable" input active-high [used]
line 15: unnamed "mod-def0" input active-low [used]
# gpioinfo gpiochip1
gpiochip1 - 20 lines:
line 0: unnamed unused input active-high
line 1: unnamed unused input active-high
line 2: unnamed unused input active-high
line 3: unnamed unused input active-high
line 4: unnamed unused input active-high
line 5: unnamed unused input active-high
line 6: unnamed unused input active-high
line 7: unnamed unused input active-high
line 8: unnamed unused input active-high
line 9: unnamed unused input active-high
line 10: unnamed unused input active-high
line 11: unnamed unused input active-high
line 12: unnamed unused input active-high
line 13: unnamed unused input active-high
line 14: unnamed unused input active-high
line 15: unnamed unused input active-high
line 16: unnamed unused input active-high
line 17: unnamed unused input active-high
line 18: unnamed unused input active-high
line 19: unnamed unused input active-high
# gpioinfo gpiochip2
gpiochip2 - 32 lines:
line 0: unnamed "sysfs" input active-high [used]
line 1: unnamed unused input active-high
line 2: unnamed unused input active-high
line 3: unnamed unused input active-high
line 4: unnamed unused input active-high
line 5: unnamed unused input active-high
line 6: unnamed unused input active-high
line 7: unnamed unused input active-high
line 8: unnamed unused input active-high
line 9: unnamed unused input active-high
line 10: unnamed "sysfs" input active-high [used]
line 11: unnamed unused input active-high
line 12: unnamed unused input active-high
line 13: unnamed unused input active-high
line 14: unnamed unused input active-high
line 15: unnamed unused input active-high
line 16: unnamed unused input active-high
line 17: unnamed unused input active-high
line 18: unnamed unused input active-high
line 19: unnamed unused input active-high
line 20: unnamed unused input active-high
line 21: unnamed unused input active-high
line 22: unnamed unused input active-high
line 23: unnamed unused input active-high
line 24: unnamed unused input active-high
line 25: unnamed unused input active-high
line 26: unnamed unused output active-high
line 27: unnamed "phy_reset" output active-high [used]
line 28: unnamed unused input active-high
line 29: unnamed unused input active-high
line 30: unnamed unused input active-high
line 31: unnamed unused input active-high
# gpioinfo gpiochip3
gpiochip3 - 31 lines:
line 0: unnamed unused input active-high
line 1: unnamed unused input active-high
line 2: unnamed unused input active-high
line 3: unnamed unused input active-high
line 4: unnamed unused input active-high
line 5: unnamed unused input active-high
line 6: unnamed unused input active-high
line 7: unnamed unused output active-high
line 8: unnamed unused input active-high
line 9: unnamed unused input active-high
line 10: unnamed unused input active-high
line 11: unnamed "cd" input active-low [used]
line 12: unnamed unused input active-high
line 13: unnamed unused input active-high
line 14: unnamed unused input active-high
line 15: unnamed unused input active-high
line 16: unnamed unused input active-high
line 17: unnamed unused input active-high
line 18: unnamed unused input active-high
line 19: unnamed unused input active-high
line 20: unnamed unused input active-high
line 21: unnamed unused input active-high
line 22: unnamed unused output active-high
line 23: unnamed unused input active-high
line 24: unnamed unused input active-high
line 25: unnamed unused input active-high
line 26: unnamed unused output active-high
line 27: unnamed unused input active-high
line 28: unnamed unused output active-high
line 29: unnamed unused output active-high
line 30: unnamed unused output active-high
Thank by advance