diff mbox series

[OpenWrt-Devel] ath79: convert devices to interrupt-driven gpio-keys

Message ID 20190802144610.1229-1-freifunk@adrianschmutzler.de
State Superseded
Headers show
Series [OpenWrt-Devel] ath79: convert devices to interrupt-driven gpio-keys | expand

Commit Message

Adrian Schmutzler Aug. 2, 2019, 2:46 p.m. UTC
This converts all remaining devices to use interrupt-driven
gpio-keys compatible instead of gpio-keys-polled.
The poll-interval is removed.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
---
 target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts         | 3 +--
 target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts      | 3 +--
 target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts           | 3 +--
 target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts             | 3 +--
 target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi        | 3 +--
 target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts          | 3 +--
 target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi         | 3 +--
 target/linux/ath79/dts/ar7240_tplink_tl-wr74xn-v1.dtsi       | 3 +--
 target/linux/ath79/dts/ar7241_tplink.dtsi                    | 3 +--
 target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts        | 3 +--
 target/linux/ath79/dts/ar7241_ubnt_unifi.dts                 | 4 ++--
 target/linux/ath79/dts/ar7241_ubnt_xm.dtsi                   | 4 ++--
 target/linux/ath79/dts/ar7242_avm_fritz300e.dts              | 3 +--
 target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi           | 3 +--
 target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts  | 3 +--
 target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts        | 3 +--
 target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts            | 3 +--
 target/linux/ath79/dts/ar9330_pqi_air-pen.dts                | 3 +--
 target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts     | 3 +--
 target/linux/ath79/dts/ar9331_etactica_eg200.dts             | 3 +--
 target/linux/ath79/dts/ar9331_pisen_wmm003n.dts              | 3 +--
 target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts        | 3 +--
 target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi | 3 +--
 target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts        | 3 +--
 target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi      | 3 +--
 target/linux/ath79/dts/ar9341_pcs_cr3000.dts                 | 3 +--
 target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts         | 3 +--
 target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts        | 3 +--
 target/linux/ath79/dts/ar9342_iodata_etg3-r.dts              | 3 +--
 target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts        | 3 +--
 target/linux/ath79/dts/ar9344_ocedo_raccoon.dts              | 3 +--
 target/linux/ath79/dts/ar9344_pcs_cap324.dts                 | 3 +--
 target/linux/ath79/dts/ar9344_pcs_cr5000.dts                 | 3 +--
 target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi         | 3 +--
 target/linux/ath79/dts/ar9344_winchannel_wb2000.dts          | 3 +--
 target/linux/ath79/dts/qca9531_comfast_cf-e5.dts             | 3 +--
 target/linux/ath79/dts/qca9531_engenius_ews511ap.dts         | 3 +--
 target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi         | 4 ++--
 target/linux/ath79/dts/qca9531_glinet_gl-x750.dts            | 3 +--
 target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts       | 3 +--
 target/linux/ath79/dts/qca9533_tplink_cpe210.dtsi            | 3 +--
 target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts         | 3 +--
 target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi         | 3 +--
 target/linux/ath79/dts/qca9558_engenius_epg5000.dts          | 3 +--
 target/linux/ath79/dts/qca9558_ocedo_koala.dts               | 3 +--
 target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts       | 3 +--
 target/linux/ath79/dts/qca9561_avm_fritz4020.dts             | 3 +--
 target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi        | 3 +--
 target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts       | 3 +--
 target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts          | 3 +--
 target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dts          | 4 ++--
 target/linux/ath79/dts/qca9563_phicomm_k2t.dts               | 3 +--
 52 files changed, 56 insertions(+), 104 deletions(-)

Comments

Adrian Schmutzler Aug. 2, 2019, 2:50 p.m. UTC | #1
Anything speaking against doing the same for ramips mt7620a, mt7621, mt7628?

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org] On
> Behalf Of Adrian Schmutzler
> Sent: Freitag, 2. August 2019 16:46
> To: openwrt-devel@lists.openwrt.org
> Subject: [OpenWrt-Devel] [PATCH] ath79: convert devices to interrupt-driven
> gpio-keys
> 
> This converts all remaining devices to use interrupt-driven
> gpio-keys compatible instead of gpio-keys-polled.
> The poll-interval is removed.
> 
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> ---
>  target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts         | 3 +--
>  target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts      | 3 +--
>  target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts           | 3 +--
>  target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts             | 3 +--
>  target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi        | 3 +--
>  target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts          | 3 +--
>  target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi         | 3 +--
>  target/linux/ath79/dts/ar7240_tplink_tl-wr74xn-v1.dtsi       | 3 +--
>  target/linux/ath79/dts/ar7241_tplink.dtsi                    | 3 +--
>  target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts        | 3 +--
>  target/linux/ath79/dts/ar7241_ubnt_unifi.dts                 | 4 ++--
>  target/linux/ath79/dts/ar7241_ubnt_xm.dtsi                   | 4 ++--
>  target/linux/ath79/dts/ar7242_avm_fritz300e.dts              | 3 +--
>  target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi           | 3 +--
>  target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts  | 3 +--
>  target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts        | 3 +--
>  target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts            | 3 +--
>  target/linux/ath79/dts/ar9330_pqi_air-pen.dts                | 3 +--
>  target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts     | 3 +--
>  target/linux/ath79/dts/ar9331_etactica_eg200.dts             | 3 +--
>  target/linux/ath79/dts/ar9331_pisen_wmm003n.dts              | 3 +--
>  target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts        | 3 +--
>  target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi | 3 +--
>  target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts        | 3 +--
>  target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi      | 3 +--
>  target/linux/ath79/dts/ar9341_pcs_cr3000.dts                 | 3 +--
>  target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts         | 3 +--
>  target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts        | 3 +--
>  target/linux/ath79/dts/ar9342_iodata_etg3-r.dts              | 3 +--
>  target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts        | 3 +--
>  target/linux/ath79/dts/ar9344_ocedo_raccoon.dts              | 3 +--
>  target/linux/ath79/dts/ar9344_pcs_cap324.dts                 | 3 +--
>  target/linux/ath79/dts/ar9344_pcs_cr5000.dts                 | 3 +--
>  target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi         | 3 +--
>  target/linux/ath79/dts/ar9344_winchannel_wb2000.dts          | 3 +--
>  target/linux/ath79/dts/qca9531_comfast_cf-e5.dts             | 3 +--
>  target/linux/ath79/dts/qca9531_engenius_ews511ap.dts         | 3 +--
>  target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi         | 4 ++--
>  target/linux/ath79/dts/qca9531_glinet_gl-x750.dts            | 3 +--
>  target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts       | 3 +--
>  target/linux/ath79/dts/qca9533_tplink_cpe210.dtsi            | 3 +--
>  target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts         | 3 +--
>  target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi         | 3 +--
>  target/linux/ath79/dts/qca9558_engenius_epg5000.dts          | 3 +--
>  target/linux/ath79/dts/qca9558_ocedo_koala.dts               | 3 +--
>  target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts       | 3 +--
>  target/linux/ath79/dts/qca9561_avm_fritz4020.dts             | 3 +--
>  target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi        | 3 +--
>  target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts       | 3 +--
>  target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts          | 3 +--
>  target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dts          | 4 ++--
>  target/linux/ath79/dts/qca9563_phicomm_k2t.dts               | 3 +--
>  52 files changed, 56 insertions(+), 104 deletions(-)
> 
> diff --git a/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts
> b/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts
> index 5ad8196a15..64f471649e 100644
> --- a/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts
> +++ b/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts
> @@ -55,8 +55,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		eco {
>  			label = "eco";
> diff --git a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts
> b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts
> index df22eb8dc4..f51bc0f771 100644
> --- a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts
> +++ b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts
> @@ -81,8 +81,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			linux,code = <KEY_RESTART>;
> diff --git a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts
> b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts
> index da19921973..87ad6e914c 100644
> --- a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts
> +++ b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts
> @@ -81,8 +81,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts
> b/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts
> index 76f140fa55..8cd1268fd8 100644
> --- a/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts
> +++ b/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts
> @@ -53,8 +53,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		sw1 {
>  			label = "sw1";
> diff --git a/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi
> b/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi
> index 6e4361f10f..f21ffecc05 100644
> --- a/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi
> +++ b/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi
> @@ -35,8 +35,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		wps {
>  			label = "sw4";
> diff --git a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts
> b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts
> index 042219b234..fcd17b8d13 100644
> --- a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts
> +++ b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts
> @@ -17,8 +17,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		router_on {
>  			label = "router_on";
> diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi
> b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi
> index 8e934429a3..7b5f0ca70b 100644
> --- a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi
> +++ b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi
> @@ -15,8 +15,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wr74xn-v1.dtsi
> b/target/linux/ath79/dts/ar7240_tplink_tl-wr74xn-v1.dtsi
> index b7db74d937..c4e10d9729 100644
> --- a/target/linux/ath79/dts/ar7240_tplink_tl-wr74xn-v1.dtsi
> +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wr74xn-v1.dtsi
> @@ -14,8 +14,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/ar7241_tplink.dtsi
> b/target/linux/ath79/dts/ar7241_tplink.dtsi
> index fa6ba71925..1433d7c6a1 100644
> --- a/target/linux/ath79/dts/ar7241_tplink.dtsi
> +++ b/target/linux/ath79/dts/ar7241_tplink.dtsi
> @@ -14,8 +14,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts
> b/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts
> index 282446b1e1..bf11340a67 100644
> --- a/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts
> +++ b/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts
> @@ -18,8 +18,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		rfkill {
>  			label = "rfkill";
> diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts
> b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts
> index 27aec88cca..b8228c8982 100644
> --- a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts
> +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts
> @@ -24,8 +24,8 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> +
>  		reset {
>  			linux,code = <KEY_RESTART>;
>  			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
> diff --git a/target/linux/ath79/dts/ar7241_ubnt_xm.dtsi
> b/target/linux/ath79/dts/ar7241_ubnt_xm.dtsi
> index 5466575229..5aa05c00cf 100644
> --- a/target/linux/ath79/dts/ar7241_ubnt_xm.dtsi
> +++ b/target/linux/ath79/dts/ar7241_ubnt_xm.dtsi
> @@ -16,8 +16,8 @@
>  	};
>  */
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> +
>  		reset {
>  			linux,code = <KEY_RESTART>;
>  			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
> diff --git a/target/linux/ath79/dts/ar7242_avm_fritz300e.dts
> b/target/linux/ath79/dts/ar7242_avm_fritz300e.dts
> index 3621714d9d..acda2213ee 100644
> --- a/target/linux/ath79/dts/ar7242_avm_fritz300e.dts
> +++ b/target/linux/ath79/dts/ar7242_avm_fritz300e.dts
> @@ -18,8 +18,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		wps {
>  			label = "wps";
> diff --git a/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi
> b/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi
> index 70ce41b84d..3b5a4dd13d 100644
> --- a/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi
> +++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi
> @@ -20,8 +20,7 @@
>  	};
> 
>  	keys: keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		usb {
>  			label = "usb";
> diff --git a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts
> b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts
> index 97bfd0f842..8ac4df2194 100644
> --- a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts
> +++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts
> @@ -23,8 +23,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts
> b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts
> index c42207e6cf..7a7790c1cb 100644
> --- a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts
> +++ b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts
> @@ -28,8 +28,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts
> b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts
> index 76f6e80236..92f900f305 100644
> --- a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts
> +++ b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts
> @@ -38,8 +38,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <100>;
> +		compatible = "gpio-keys";
> 
>  		manual {
>  			label = "manual";
> diff --git a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts
> b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts
> index 06f728b267..ffb28c7417 100644
> --- a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts
> +++ b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts
> @@ -33,8 +33,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <100>;
> +		compatible = "gpio-keys";
> 
>  		wps {
>  			label = "wps";
> diff --git a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts
> b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts
> index d0e0169f1b..311a506b5d 100644
> --- a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts
> +++ b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts
> @@ -28,8 +28,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <100>;
> +		compatible = "gpio-keys";
> 
>  		wps {
>  			label = "wps";
> diff --git a/target/linux/ath79/dts/ar9331_etactica_eg200.dts
> b/target/linux/ath79/dts/ar9331_etactica_eg200.dts
> index d18a239d32..721e676ed7 100644
> --- a/target/linux/ath79/dts/ar9331_etactica_eg200.dts
> +++ b/target/linux/ath79/dts/ar9331_etactica_eg200.dts
> @@ -15,8 +15,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <50>;
> +		compatible = "gpio-keys";
> 
>  		restore {
>  			linux,code = <KEY_WPS_BUTTON>;
> diff --git a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts
> b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts
> index b3bc2e4c45..6fb11545ad 100644
> --- a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts
> +++ b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts
> @@ -19,8 +19,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts
> b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts
> index ebf4d4485f..a970d9920f 100644
> --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts
> +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts
> @@ -40,8 +40,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi
> b/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi
> index ffd3d71a62..f395d82e93 100644
> --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi
> +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi
> @@ -16,8 +16,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts
> b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts
> index 056e9fa512..9a57ae82d9 100644
> --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts
> +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts
> @@ -19,8 +19,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi
> b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi
> index e4b59f1591..1b763153a8 100644
> --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi
> +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi
> @@ -19,8 +19,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/ar9341_pcs_cr3000.dts
> b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts
> index 9a0b084a72..79611a687d 100644
> --- a/target/linux/ath79/dts/ar9341_pcs_cr3000.dts
> +++ b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts
> @@ -19,8 +19,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&jtag_disable_pins>;
> diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts
> b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts
> index ec89be5318..3f47cd35c1 100644
> --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts
> +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts
> @@ -19,8 +19,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&jtag_disable_pins>;
> diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts
> b/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts
> index c7a251cbf1..4d223c915a 100644
> --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts
> +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts
> @@ -19,8 +19,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&jtag_disable_pins>;
> diff --git a/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts
> b/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts
> index bd2489aa28..5daa06711b 100644
> --- a/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts
> +++ b/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts
> @@ -33,8 +33,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts
> b/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts
> index b0fdce77a6..632f5962db 100644
> --- a/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts
> +++ b/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts
> @@ -61,8 +61,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts
> b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts
> index 812da3dea5..9e3177acae 100644
> --- a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts
> +++ b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts
> @@ -53,8 +53,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			linux,code = <KEY_RESTART>;
> diff --git a/target/linux/ath79/dts/ar9344_pcs_cap324.dts
> b/target/linux/ath79/dts/ar9344_pcs_cap324.dts
> index 7a211e9088..390beebab5 100644
> --- a/target/linux/ath79/dts/ar9344_pcs_cap324.dts
> +++ b/target/linux/ath79/dts/ar9344_pcs_cap324.dts
> @@ -19,8 +19,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&jtag_disable_pins>;
> diff --git a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts
> b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts
> index 0b4a0ea374..211e339f30 100644
> --- a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts
> +++ b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts
> @@ -19,8 +19,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&jtag_disable_pins>;
> diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi
> b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi
> index 6be197c0cf..b600b1f6e0 100644
> --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi
> +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi
> @@ -59,8 +59,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			linux,code = <KEY_RESTART>;
> diff --git a/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts
> b/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts
> index 6895a22e12..4ee3ace829 100644
> --- a/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts
> +++ b/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts
> @@ -59,8 +59,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <50>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			linux,code = <KEY_RESTART>;
> diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts
> b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts
> index c181b32aa6..a71f333fa6 100644
> --- a/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts
> +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts
> @@ -11,8 +11,7 @@
>  	model = "COMFAST CF-E5/E7";
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		button0 {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts
> b/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts
> index 4e0ae73d0d..2ece81e0c9 100644
> --- a/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts
> +++ b/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts
> @@ -11,9 +11,8 @@
>  	model = "EnGenius EWS511AP";
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> +		compatible = "gpio-keys";
> 
> -		poll-interval = <20>;
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&jtag_disable_pins>;
> 
> diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
> b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
> index 8b127ed1d8..4e5428b4c1 100644
> --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
> +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
> @@ -14,8 +14,8 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> +
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&jtag_disable_pins>;
> 
> diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts
> b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts
> index ddaf7709b7..de28f6c3f0 100644
> --- a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts
> +++ b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts
> @@ -11,9 +11,8 @@
>  	model = "GL.iNet GL-X750";
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> +		compatible = "gpio-keys";
> 
> -		poll-interval = <20>;
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&jtag_disable_pins>;
> 
> diff --git a/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts
> b/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts
> index 4bada93452..d6eef42f3f 100644
> --- a/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts
> +++ b/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts
> @@ -65,8 +65,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/qca9533_tplink_cpe210.dtsi
> b/target/linux/ath79/dts/qca9533_tplink_cpe210.dtsi
> index f86ff30fc7..5f15cae7a0 100644
> --- a/target/linux/ath79/dts/qca9533_tplink_cpe210.dtsi
> +++ b/target/linux/ath79/dts/qca9533_tplink_cpe210.dtsi
> @@ -48,8 +48,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <100>;
> +		compatible = "gpio-keys";
> 
>  		reset_button {
>  			label = "Reset button";
> diff --git a/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts
> b/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts
> index 995ecb3b73..fc5df53fa9 100644
> --- a/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts
> +++ b/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts
> @@ -47,8 +47,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi
> b/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi
> index 86b97437ea..0f7838fd56 100644
> --- a/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi
> +++ b/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi
> @@ -51,8 +51,7 @@
>  	};
> 
>  	keys: keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		eco {
>  			label = "eco";
> diff --git a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
> b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
> index 6179150fdb..9545a85d62 100644
> --- a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
> +++ b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
> @@ -54,8 +54,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/qca9558_ocedo_koala.dts
> b/target/linux/ath79/dts/qca9558_ocedo_koala.dts
> index a80155b08c..b5899b6b16 100644
> --- a/target/linux/ath79/dts/qca9558_ocedo_koala.dts
> +++ b/target/linux/ath79/dts/qca9558_ocedo_koala.dts
> @@ -49,8 +49,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <100>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts
> b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts
> index b6dc43fbfc..7d7433d44e 100644
> --- a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts
> +++ b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts
> @@ -42,8 +42,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <100>;
> +		compatible = "gpio-keys";
> 
>  		button0 {
>  			label = "reset";
> diff --git a/target/linux/ath79/dts/qca9561_avm_fritz4020.dts
> b/target/linux/ath79/dts/qca9561_avm_fritz4020.dts
> index e98d6688d1..5a850c7064 100644
> --- a/target/linux/ath79/dts/qca9561_avm_fritz4020.dts
> +++ b/target/linux/ath79/dts/qca9561_avm_fritz4020.dts
> @@ -84,8 +84,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <100>;
> +		compatible = "gpio-keys";
> 
>  		wps_button {
>  			label = "WPS button";
> diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi
> b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi
> index 6d32fa3fc4..75777149a5 100644
> --- a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi
> +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi
> @@ -33,8 +33,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <100>;
> +		compatible = "gpio-keys";
> 
>  		wps_button {
>  			label = "WPS button";
> diff --git a/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts
> b/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts
> index 8b8818c82f..e4c737b8ff 100644
> --- a/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts
> +++ b/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts
> @@ -22,8 +22,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <100>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			label = "Reset button";
> diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts
> b/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts
> index 8bd9067afa..a17d9f263a 100644
> --- a/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts
> +++ b/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts
> @@ -47,8 +47,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		wps {
>  			linux,code = <KEY_RESTART>;
> diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dts
> b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dts
> index 0145a24fba..24198e8043 100644
> --- a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dts
> +++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dts
> @@ -22,8 +22,8 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> +
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&jtag_disable_pins>;
> 
> diff --git a/target/linux/ath79/dts/qca9563_phicomm_k2t.dts
> b/target/linux/ath79/dts/qca9563_phicomm_k2t.dts
> index d819a76fd2..cb5c01b01c 100644
> --- a/target/linux/ath79/dts/qca9563_phicomm_k2t.dts
> +++ b/target/linux/ath79/dts/qca9563_phicomm_k2t.dts
> @@ -41,8 +41,7 @@
>  	};
> 
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
> 
>  		reset {
>  			linux,code = <KEY_RESTART>;
> --
> 2.20.1
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Dmitry Tunin Aug. 2, 2019, 4:50 p.m. UTC | #2
пт, 2 авг. 2019 г. в 17:46, Adrian Schmutzler <freifunk@adrianschmutzler.de>:
>
> This converts all remaining devices to use interrupt-driven
> gpio-keys compatible instead of gpio-keys-polled.
> The poll-interval is removed.
>

When I ported DIR-825-b1 to ath79 last year, "gpio-keys" where very
unreliable and I had to switch to "gpio-keys-polled".
I didn't test it since. I'll be able to test only next week.
Jeff Kletsky Aug. 2, 2019, 6:03 p.m. UTC | #3
On 8/2/19 7:46 AM, Adrian Schmutzler wrote:
> This converts all remaining devices to use interrupt-driven
> gpio-keys compatible instead of gpio-keys-polled.
> The poll-interval is removed.
>

Not that this proposed change makes the situation any different, but 
many devices have switches that are poorly handled by the "key-press" 
approach.

One specific case that has bothered me (but not enough to dig into it) 
is the Archer C7v2 that has an "rfkill" switch. Not only is it 
"backwards" (label "Off" is really "wireless on"), but it only responds 
to changes in state, so its state at boot is not respected. You can't, 
as I recall, set it for "wireless off", plug in the device, and have the 
wireless be off when OpenWrt boots.

The GL-AR300M series and the GL-AR750S also have a multi-position "mode" 
switch.

Right now, all these switches have to be toggled twice to have their 
position be properly respected by the OS if they're not in the 
"expected" position.

It would seem that, at some point, switches like these would be better 
served by a driver that can both detect position, as well as transition. 
This would likely also require a way to poll the position at 
"impacted-service start" and ubus support along with changes in existing 
hotplug scripts.


Jeff
Michal Cieslakiewicz Aug. 2, 2019, 6:47 p.m. UTC | #4
On Fri,  2 Aug 2019 16:46:10 +0200
Adrian Schmutzler <freifunk@adrianschmutzler.de> wrote:

> This converts all remaining devices to use interrupt-driven
> gpio-keys compatible instead of gpio-keys-polled.
> The poll-interval is removed.
> 
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> ---
> [...]
> diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi
> b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi index
> 8e934429a3..7b5f0ca70b 100644 ---
> a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi +++
> b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi @@ -15,8 +15,7
> @@ };
>  
>  	keys {
> -		compatible = "gpio-keys-polled";
> -		poll-interval = <20>;
> +		compatible = "gpio-keys";
>  
>  		reset {
>  			label = "reset";
> [...]

Hello all,

Please clarify the scope of above change - AFAIK there is no GPIO IRQ
for wireless chips (or please correct me if I am utterly wrong), hence
ath9k-connected buttons will not work with this setting.

I've built an ath79 image for Netgear WNR612v2 with this patch applied
and indeed, at startup it gives an error:

gpio-keys keys: failed to get irq for gpio:507

which points to reset button wired to ar9285 at pin 7. As expected
with this sort of problem, reset button does not trigger any action at
all.

Currently I'm porting some older WNR* routers to DTS and ath79, most of
them have all or at least some buttons wired to wireless chip, so I
would like to see your opinion on following:

0. Buttons for ath9k-phy GPIOs should remain polled.
1. If above is true and we want to use mixed (irq/polled) configuration,
maybe it is advisable to split DTS definitions into 'keys' and
'ath9k-keys', identical to LEDs setup.
2. Or alternatively, because we need to poll ath9k GPIO pins
anyway, we keep all buttons in polled section.

Cheers
Micu
Christian Lamparter Aug. 2, 2019, 8:21 p.m. UTC | #5
On Friday, August 2, 2019 8:03:17 PM CEST Jeff Kletsky wrote:
> 
> On 8/2/19 7:46 AM, Adrian Schmutzler wrote:
> > This converts all remaining devices to use interrupt-driven
> > gpio-keys compatible instead of gpio-keys-polled.
> > The poll-interval is removed.
> >
> 
> Not that this proposed change makes the situation any different, but 
> many devices have switches that are poorly handled by the "key-press" 
> approach.
> 
> One specific case that has bothered me (but not enough to dig into it) 
> is the Archer C7v2 that has an "rfkill" switch. Not only is it 
> "backwards" (label "Off" is really "wireless on"), but it only responds 
> to changes in state, so its state at boot is not respected. You can't, 
> as I recall, set it for "wireless off", plug in the device, and have the 
> wireless be off when OpenWrt boots.
> 
> The GL-AR300M series and the GL-AR750S also have a multi-position "mode" 
> switch.
> 
> Right now, all these switches have to be toggled twice to have their 
> position be properly respected by the OS if they're not in the 
> "expected" position.
> 
> It would seem that, at some point, switches like these would be better 
> served by a driver that can both detect position, as well as transition. 
> This would likely also require a way to poll the position at 
> "impacted-service start" and ubus support along with changes in existing 
> hotplug scripts.

From playing around with gpio-keys and the openwrt's gpio-button-hotplug.c
in the past few weeks, I think I can tell you what's happening here.
One (there are more) of the problems is that gpio-keys module gets loaded
even before the procd enters its "preinit" phase (the module is part of 
/etc/modules-boot.d/30-gpio-button-hotplug). And the bad news is that
even once procd hits the preinit phase, it intentionally forwards everything
to the failsafe button events script:

|	[ "if",
|		[ "eq", "SUBSYSTEM", "button" ],
|		[ "exec", "/etc/rc.button/failsafe" ]
|  ]

<https://github.com/openwrt/openwrt/blob/master/package/system/procd/files/hotplug-preinit.json#L15>

/etc/rc.button/failsafe itself is also very telling:

|#!/bin/sh
|
|[ "${TYPE}" = "switch" ] || echo ${BUTTON} > /tmp/failsafe_button
|
|return 0

The long and short of this is that initial switch state event is
generated but it has no change of getting processed properly
at the time the driver is loaded as the system isn't ready.

Note: If it was loaded later when procd is in the "init" phase,
then it works because events are then processed by hotplug.json,
which does:
 
	[ "if",
		[ "and",
			[ "has", "BUTTON" ],
			[ "eq", "SUBSYSTEM", "button" ]
		],
		[ "button", "/etc/rc.button/%BUTTON%" ]
],

<https://github.com/openwrt/openwrt/blob/master/package/system/procd/files/hotplug.json#L58>

Then everything would work as you expect.
so, it's not the driver that lets you down here, because it can't
do much about these userspace antics.

(Note: OpenWrt's gpio-button-hotplug.c uses the BUTTON subsystem
event type for both EV_KEY (button) and EV_SW (switches) events.
So don't let this confuse you).

Regards,
Christian
Adrian Schmutzler Aug. 5, 2019, 1:53 p.m. UTC | #6
> -----Original Message-----
> From: Dmitry Tunin [mailto:hanipouspilot@gmail.com]
> Sent: Freitag, 2. August 2019 18:51
> To: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> Cc: OpenWrt Development List <openwrt-devel@lists.openwrt.org>
> Subject: Re: [OpenWrt-Devel] [PATCH] ath79: convert devices to interrupt-
> driven gpio-keys
> 
> пт, 2 авг. 2019 г. в 17:46, Adrian Schmutzler <freifunk@adrianschmutzler.de>:
> >
> > This converts all remaining devices to use interrupt-driven
> > gpio-keys compatible instead of gpio-keys-polled.
> > The poll-interval is removed.
> >
> 
> When I ported DIR-825-b1 to ath79 last year, "gpio-keys" where very
> unreliable and I had to switch to "gpio-keys-polled".
> I didn't test it since. I'll be able to test only next week.

I mostly have TP-Link devices, and I've never experienced any issues with those.
Looking forward to your test!

Best

Adrian
Dmitry Tunin Aug. 5, 2019, 3:54 p.m. UTC | #7
пн, 5 авг. 2019 г. в 16:53, Adrian Schmutzler <mail@adrianschmutzler.de>:
>
> > -----Original Message-----
> > From: Dmitry Tunin [mailto:hanipouspilot@gmail.com]
> > Sent: Freitag, 2. August 2019 18:51
> > To: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> > Cc: OpenWrt Development List <openwrt-devel@lists.openwrt.org>
> > Subject: Re: [OpenWrt-Devel] [PATCH] ath79: convert devices to interrupt-
> > driven gpio-keys
> >
> > пт, 2 авг. 2019 г. в 17:46, Adrian Schmutzler <freifunk@adrianschmutzler.de>:
> > >
> > > This converts all remaining devices to use interrupt-driven
> > > gpio-keys compatible instead of gpio-keys-polled.
> > > The poll-interval is removed.
> > >
> >
> > When I ported DIR-825-b1 to ath79 last year, "gpio-keys" where very
> > unreliable and I had to switch to "gpio-keys-polled".
> > I didn't test it since. I'll be able to test only next week.
>
> I mostly have TP-Link devices, and I've never experienced any issues with those.
> Looking forward to your test!

This is not about vendor, but about SoC. ar7100 may be different from
other devicex on ar9xxx.
Adrian Schmutzler Aug. 5, 2019, 4:09 p.m. UTC | #8
> -----Original Message-----
> From: Dmitry Tunin [mailto:hanipouspilot@gmail.com]
> Sent: Montag, 5. August 2019 17:55
> To: Adrian Schmutzler <mail@adrianschmutzler.de>
> Cc: OpenWrt Development List <openwrt-devel@lists.openwrt.org>
> Subject: Re: [OpenWrt-Devel] [PATCH] ath79: convert devices to interrupt-
> driven gpio-keys
> 
> пн, 5 авг. 2019 г. в 16:53, Adrian Schmutzler <mail@adrianschmutzler.de>:
> >
> > > -----Original Message-----
> > > From: Dmitry Tunin [mailto:hanipouspilot@gmail.com]
> > > Sent: Freitag, 2. August 2019 18:51
> > > To: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> > > Cc: OpenWrt Development List <openwrt-devel@lists.openwrt.org>
> > > Subject: Re: [OpenWrt-Devel] [PATCH] ath79: convert devices to interrupt-
> > > driven gpio-keys
> > >
> > > пт, 2 авг. 2019 г. в 17:46, Adrian Schmutzler
> <freifunk@adrianschmutzler.de>:
> > > >
> > > > This converts all remaining devices to use interrupt-driven
> > > > gpio-keys compatible instead of gpio-keys-polled.
> > > > The poll-interval is removed.
> > > >
> > >
> > > When I ported DIR-825-b1 to ath79 last year, "gpio-keys" where very
> > > unreliable and I had to switch to "gpio-keys-polled".
> > > I didn't test it since. I'll be able to test only next week.
> >
> > I mostly have TP-Link devices, and I've never experienced any issues with
> those.
> > Looking forward to your test!
> 
> This is not about vendor, but about SoC. ar7100 may be different from
> other devicex on ar9xxx.

This recent Pull Request used gpio-keys on ar7100: https://github.com/openwrt/openwrt/pull/1359

However, I cannot extract how well this was tested.
Dmitry Tunin Aug. 5, 2019, 4:27 p.m. UTC | #9
> This recent Pull Request used gpio-keys on ar7100: https://github.com/openwrt/openwrt/pull/1359
>
> However, I cannot extract how well this was tested.

I will have a device for testing around the next weekend. I'll report back.
Dmitry Tunin Aug. 10, 2019, 9:52 a.m. UTC | #10
I tested gpio-keys on dir825b1 and didn't see a noticable change
against gpio-keys-polled. Both miss events and work poorly.
So no objections for a switch.

пн, 5 авг. 2019 г. в 19:27, Dmitry Tunin <hanipouspilot@gmail.com>:
>
> > This recent Pull Request used gpio-keys on ar7100: https://github.com/openwrt/openwrt/pull/1359
> >
> > However, I cannot extract how well this was tested.
>
> I will have a device for testing around the next weekend. I'll report back.
Adrian Schmutzler Aug. 10, 2019, 2:35 p.m. UTC | #11
> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> On Behalf Of Dmitry Tunin
> Sent: Samstag, 10. August 2019 11:53
> To: Adrian Schmutzler <mail@adrianschmutzler.de>
> Cc: OpenWrt Development List <openwrt-devel@lists.openwrt.org>
> Subject: Re: [OpenWrt-Devel] [PATCH] ath79: convert devices to interrupt-
> driven gpio-keys
> 
> I tested gpio-keys on dir825b1 and didn't see a noticable change against gpio-
> keys-polled. Both miss events and work poorly.
> So no objections for a switch.

Can I add your Tested-by?

> 
> пн, 5 авг. 2019 г. в 19:27, Dmitry Tunin <hanipouspilot@gmail.com>:
> >
> > > This recent Pull Request used gpio-keys on ar7100:
> > > https://github.com/openwrt/openwrt/pull/1359
> > >
> > > However, I cannot extract how well this was tested.
> >
> > I will have a device for testing around the next weekend. I'll report back.
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Dmitry Tunin Aug. 10, 2019, 4:25 p.m. UTC | #12
> Can I add your Tested-by?

I tested only one target, it makes no sense to add this. And I what
about ath9k keys. They are a problem.
Dmitry Tunin Aug. 10, 2019, 4:41 p.m. UTC | #13
If you will be pushing it some way, remove debounce-interval too.
Without it gpio-keys work better.
Adrian Schmutzler Aug. 10, 2019, 4:46 p.m. UTC | #14
> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> On Behalf Of Dmitry Tunin
> Sent: Samstag, 10. August 2019 18:25
> To: Adrian Schmutzler <mail@adrianschmutzler.de>
> Cc: OpenWrt Development List <openwrt-devel@lists.openwrt.org>
> Subject: Re: [OpenWrt-Devel] [PATCH] ath79: convert devices to interrupt-
> driven gpio-keys
> 
> > Can I add your Tested-by?
> 
> I tested only one target, it makes no sense to add this. And I what about
> ath9k keys. They are a problem.

So should it remove the change for ath9k keys and only do the other ones at the moment?
Dmitry Tunin Aug. 10, 2019, 4:51 p.m. UTC | #15
> So should it remove the change for ath9k keys and only do the other ones at the moment?

That's a good question. I suggest to leave devices that HAVE some keys
attached to ath9k keys using 'gpio-keys-polled'.
It makes no sense to use both drivers.
diff mbox series

Patch

diff --git a/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts b/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts
index 5ad8196a15..64f471649e 100644
--- a/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts
+++ b/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts
@@ -55,8 +55,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		eco {
 			label = "eco";
diff --git a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts
index df22eb8dc4..f51bc0f771 100644
--- a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts
+++ b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts
@@ -81,8 +81,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			linux,code = <KEY_RESTART>;
diff --git a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts
index da19921973..87ad6e914c 100644
--- a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts
+++ b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts
@@ -81,8 +81,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "reset";
diff --git a/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts b/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts
index 76f140fa55..8cd1268fd8 100644
--- a/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts
+++ b/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts
@@ -53,8 +53,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		sw1 {
 			label = "sw1";
diff --git a/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi b/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi
index 6e4361f10f..f21ffecc05 100644
--- a/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi
+++ b/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi
@@ -35,8 +35,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		wps {
 			label = "sw4";
diff --git a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts
index 042219b234..fcd17b8d13 100644
--- a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts
+++ b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts
@@ -17,8 +17,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		router_on {
 			label = "router_on";
diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi
index 8e934429a3..7b5f0ca70b 100644
--- a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi
+++ b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi
@@ -15,8 +15,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "reset";
diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wr74xn-v1.dtsi b/target/linux/ath79/dts/ar7240_tplink_tl-wr74xn-v1.dtsi
index b7db74d937..c4e10d9729 100644
--- a/target/linux/ath79/dts/ar7240_tplink_tl-wr74xn-v1.dtsi
+++ b/target/linux/ath79/dts/ar7240_tplink_tl-wr74xn-v1.dtsi
@@ -14,8 +14,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "reset";
diff --git a/target/linux/ath79/dts/ar7241_tplink.dtsi b/target/linux/ath79/dts/ar7241_tplink.dtsi
index fa6ba71925..1433d7c6a1 100644
--- a/target/linux/ath79/dts/ar7241_tplink.dtsi
+++ b/target/linux/ath79/dts/ar7241_tplink.dtsi
@@ -14,8 +14,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "reset";
diff --git a/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts b/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts
index 282446b1e1..bf11340a67 100644
--- a/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts
+++ b/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts
@@ -18,8 +18,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		rfkill {
 			label = "rfkill";
diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts
index 27aec88cca..b8228c8982 100644
--- a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts
+++ b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts
@@ -24,8 +24,8 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
+
 		reset {
 			linux,code = <KEY_RESTART>;
 			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
diff --git a/target/linux/ath79/dts/ar7241_ubnt_xm.dtsi b/target/linux/ath79/dts/ar7241_ubnt_xm.dtsi
index 5466575229..5aa05c00cf 100644
--- a/target/linux/ath79/dts/ar7241_ubnt_xm.dtsi
+++ b/target/linux/ath79/dts/ar7241_ubnt_xm.dtsi
@@ -16,8 +16,8 @@ 
 	};
 */
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
+
 		reset {
 			linux,code = <KEY_RESTART>;
 			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
diff --git a/target/linux/ath79/dts/ar7242_avm_fritz300e.dts b/target/linux/ath79/dts/ar7242_avm_fritz300e.dts
index 3621714d9d..acda2213ee 100644
--- a/target/linux/ath79/dts/ar7242_avm_fritz300e.dts
+++ b/target/linux/ath79/dts/ar7242_avm_fritz300e.dts
@@ -18,8 +18,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		wps {
 			label = "wps";
diff --git a/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi b/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi
index 70ce41b84d..3b5a4dd13d 100644
--- a/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi
+++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi
@@ -20,8 +20,7 @@ 
 	};
 
 	keys: keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		usb {
 			label = "usb";
diff --git a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts
index 97bfd0f842..8ac4df2194 100644
--- a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts
+++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts
@@ -23,8 +23,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "reset";
diff --git a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts
index c42207e6cf..7a7790c1cb 100644
--- a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts
+++ b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts
@@ -28,8 +28,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "reset";
diff --git a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts
index 76f6e80236..92f900f305 100644
--- a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts
+++ b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts
@@ -38,8 +38,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <100>;
+		compatible = "gpio-keys";
 
 		manual {
 			label = "manual";
diff --git a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts
index 06f728b267..ffb28c7417 100644
--- a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts
+++ b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts
@@ -33,8 +33,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <100>;
+		compatible = "gpio-keys";
 
 		wps {
 			label = "wps";
diff --git a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts
index d0e0169f1b..311a506b5d 100644
--- a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts
+++ b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts
@@ -28,8 +28,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <100>;
+		compatible = "gpio-keys";
 
 		wps {
 			label = "wps";
diff --git a/target/linux/ath79/dts/ar9331_etactica_eg200.dts b/target/linux/ath79/dts/ar9331_etactica_eg200.dts
index d18a239d32..721e676ed7 100644
--- a/target/linux/ath79/dts/ar9331_etactica_eg200.dts
+++ b/target/linux/ath79/dts/ar9331_etactica_eg200.dts
@@ -15,8 +15,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <50>;
+		compatible = "gpio-keys";
 
 		restore {
 			linux,code = <KEY_WPS_BUTTON>;
diff --git a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts
index b3bc2e4c45..6fb11545ad 100644
--- a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts
+++ b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts
@@ -19,8 +19,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "reset";
diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts
index ebf4d4485f..a970d9920f 100644
--- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts
+++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts
@@ -40,8 +40,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "reset";
diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi
index ffd3d71a62..f395d82e93 100644
--- a/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi
+++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi
@@ -16,8 +16,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "reset";
diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts
index 056e9fa512..9a57ae82d9 100644
--- a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts
+++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts
@@ -19,8 +19,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "reset";
diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi
index e4b59f1591..1b763153a8 100644
--- a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi
+++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi
@@ -19,8 +19,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "reset";
diff --git a/target/linux/ath79/dts/ar9341_pcs_cr3000.dts b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts
index 9a0b084a72..79611a687d 100644
--- a/target/linux/ath79/dts/ar9341_pcs_cr3000.dts
+++ b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts
@@ -19,8 +19,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		pinctrl-names = "default";
 		pinctrl-0 = <&jtag_disable_pins>;
diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts
index ec89be5318..3f47cd35c1 100644
--- a/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts
+++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts
@@ -19,8 +19,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		pinctrl-names = "default";
 		pinctrl-0 = <&jtag_disable_pins>;
diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts b/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts
index c7a251cbf1..4d223c915a 100644
--- a/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts
+++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts
@@ -19,8 +19,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		pinctrl-names = "default";
 		pinctrl-0 = <&jtag_disable_pins>;
diff --git a/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts b/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts
index bd2489aa28..5daa06711b 100644
--- a/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts
+++ b/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts
@@ -33,8 +33,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "reset";
diff --git a/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts b/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts
index b0fdce77a6..632f5962db 100644
--- a/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts
+++ b/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts
@@ -61,8 +61,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "reset";
diff --git a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts
index 812da3dea5..9e3177acae 100644
--- a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts
+++ b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts
@@ -53,8 +53,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			linux,code = <KEY_RESTART>;
diff --git a/target/linux/ath79/dts/ar9344_pcs_cap324.dts b/target/linux/ath79/dts/ar9344_pcs_cap324.dts
index 7a211e9088..390beebab5 100644
--- a/target/linux/ath79/dts/ar9344_pcs_cap324.dts
+++ b/target/linux/ath79/dts/ar9344_pcs_cap324.dts
@@ -19,8 +19,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		pinctrl-names = "default";
 		pinctrl-0 = <&jtag_disable_pins>;
diff --git a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts
index 0b4a0ea374..211e339f30 100644
--- a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts
+++ b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts
@@ -19,8 +19,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		pinctrl-names = "default";
 		pinctrl-0 = <&jtag_disable_pins>;
diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi
index 6be197c0cf..b600b1f6e0 100644
--- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi
+++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi
@@ -59,8 +59,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			linux,code = <KEY_RESTART>;
diff --git a/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts b/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts
index 6895a22e12..4ee3ace829 100644
--- a/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts
+++ b/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts
@@ -59,8 +59,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <50>;
+		compatible = "gpio-keys";
 
 		reset {
 			linux,code = <KEY_RESTART>;
diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts
index c181b32aa6..a71f333fa6 100644
--- a/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts
+++ b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts
@@ -11,8 +11,7 @@ 
 	model = "COMFAST CF-E5/E7";
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		button0 {
 			label = "reset";
diff --git a/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts b/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts
index 4e0ae73d0d..2ece81e0c9 100644
--- a/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts
+++ b/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts
@@ -11,9 +11,8 @@ 
 	model = "EnGenius EWS511AP";
 
 	keys {
-		compatible = "gpio-keys-polled";
+		compatible = "gpio-keys";
 
-		poll-interval = <20>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&jtag_disable_pins>;
 
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
index 8b127ed1d8..4e5428b4c1 100644
--- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
@@ -14,8 +14,8 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
+
 		pinctrl-names = "default";
 		pinctrl-0 = <&jtag_disable_pins>;
 
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts
index ddaf7709b7..de28f6c3f0 100644
--- a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts
@@ -11,9 +11,8 @@ 
 	model = "GL.iNet GL-X750";
 
 	keys {
-		compatible = "gpio-keys-polled";
+		compatible = "gpio-keys";
 
-		poll-interval = <20>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&jtag_disable_pins>;
 
diff --git a/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts b/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts
index 4bada93452..d6eef42f3f 100644
--- a/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts
+++ b/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts
@@ -65,8 +65,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "reset";
diff --git a/target/linux/ath79/dts/qca9533_tplink_cpe210.dtsi b/target/linux/ath79/dts/qca9533_tplink_cpe210.dtsi
index f86ff30fc7..5f15cae7a0 100644
--- a/target/linux/ath79/dts/qca9533_tplink_cpe210.dtsi
+++ b/target/linux/ath79/dts/qca9533_tplink_cpe210.dtsi
@@ -48,8 +48,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <100>;
+		compatible = "gpio-keys";
 
 		reset_button {
 			label = "Reset button";
diff --git a/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts b/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts
index 995ecb3b73..fc5df53fa9 100644
--- a/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts
+++ b/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts
@@ -47,8 +47,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "reset";
diff --git a/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi b/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi
index 86b97437ea..0f7838fd56 100644
--- a/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi
+++ b/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi
@@ -51,8 +51,7 @@ 
 	};
 
 	keys: keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		eco {
 			label = "eco";
diff --git a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
index 6179150fdb..9545a85d62 100644
--- a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
+++ b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
@@ -54,8 +54,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "reset";
diff --git a/target/linux/ath79/dts/qca9558_ocedo_koala.dts b/target/linux/ath79/dts/qca9558_ocedo_koala.dts
index a80155b08c..b5899b6b16 100644
--- a/target/linux/ath79/dts/qca9558_ocedo_koala.dts
+++ b/target/linux/ath79/dts/qca9558_ocedo_koala.dts
@@ -49,8 +49,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <100>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "reset";
diff --git a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts
index b6dc43fbfc..7d7433d44e 100644
--- a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts
+++ b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts
@@ -42,8 +42,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <100>;
+		compatible = "gpio-keys";
 
 		button0 {
 			label = "reset";
diff --git a/target/linux/ath79/dts/qca9561_avm_fritz4020.dts b/target/linux/ath79/dts/qca9561_avm_fritz4020.dts
index e98d6688d1..5a850c7064 100644
--- a/target/linux/ath79/dts/qca9561_avm_fritz4020.dts
+++ b/target/linux/ath79/dts/qca9561_avm_fritz4020.dts
@@ -84,8 +84,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <100>;
+		compatible = "gpio-keys";
 
 		wps_button {
 			label = "WPS button";
diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi
index 6d32fa3fc4..75777149a5 100644
--- a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi
+++ b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi
@@ -33,8 +33,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <100>;
+		compatible = "gpio-keys";
 
 		wps_button {
 			label = "WPS button";
diff --git a/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts b/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts
index 8b8818c82f..e4c737b8ff 100644
--- a/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts
+++ b/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts
@@ -22,8 +22,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <100>;
+		compatible = "gpio-keys";
 
 		reset {
 			label = "Reset button";
diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts b/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts
index 8bd9067afa..a17d9f263a 100644
--- a/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts
+++ b/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts
@@ -47,8 +47,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		wps {
 			linux,code = <KEY_RESTART>;
diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dts b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dts
index 0145a24fba..24198e8043 100644
--- a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dts
+++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dts
@@ -22,8 +22,8 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
+
 		pinctrl-names = "default";
 		pinctrl-0 = <&jtag_disable_pins>;
 
diff --git a/target/linux/ath79/dts/qca9563_phicomm_k2t.dts b/target/linux/ath79/dts/qca9563_phicomm_k2t.dts
index d819a76fd2..cb5c01b01c 100644
--- a/target/linux/ath79/dts/qca9563_phicomm_k2t.dts
+++ b/target/linux/ath79/dts/qca9563_phicomm_k2t.dts
@@ -41,8 +41,7 @@ 
 	};
 
 	keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <20>;
+		compatible = "gpio-keys";
 
 		reset {
 			linux,code = <KEY_RESTART>;