Hi All,
I'm working on camera device, kernel version is 4.9.
We use pca953x extender to support more GPIOs, like button.
We enable pca953x and gpio_button_hotplug driver with following part of DTS.
+ gpio-keys {
+ compatible = "gpio-keys";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ button-reset {
+ linux,code = <171>;
+ label = "config";
+ gpios = <&pinctrl 513 GPIO_ACTIVE_LOW>;
+ debounce-interval= <20>;
+ };
+ };
I already checked the /sys/class/gpio/gpio513/value is working.
Set up configs, like
# cat /etc/config/system
config system
option timezone 'UTC'
option ttylogin '0'
option log_size '64'
option urandom_seed '0'
option hostname 'vx3-583c'
config timeserver 'ntp'
option enabled '1'
option enable_server '0'
list server '0.openwrt.pool.ntp.org'
list server '1.openwrt.pool.ntp.org'
list server '2.openwrt.pool.ntp.org'
list server '3.openwrt.pool.ntp.org'
config button
option button 'config'
option action 'pressed'
option handler 'logger config pressed; button.sh button config pressed;'
config button
option button 'config'
option action 'released'
option handler 'logger config released; button.sh button config released;'
# cat /etc/hotplug.d/button/00-button
#!/bin/sh
. /lib/functions.sh
do_button () {
local button
local action
local handler
local min
local max
config_get button "${1}" button
config_get action "${1}" action
config_get handler "${1}" handler
config_get min "${1}" min
config_get max "${1}" max
[ "${ACTION}" = "${action}" -a "${BUTTON}" = "${button}" -a -n "${handler}" ] && {
[ -z "${min}" -o -z "${max}" ] && eval ${handler}
[ -n "${min}" -a -n "${max}" ] && {
[ "${min}" -le "${SEEN}" -a "${max}" -ge "${SEEN}" ] && eval ${handler}
}
}
}
config_load system
config_foreach do_button button
Before using pca953x extender, we use normal GPIO from CPU, this feature is working.
Switch GPIO to extender, this feature is not working now.
Any suggestion to me about how to fix this problem? Thanks.