Modify

Opened 5 years ago

Closed 5 years ago

#13118 closed enhancement (invalid)

wndr3700: properly name wifi button

Reported by: raver@… Owned by: developers
Priority: normal Milestone:
Component: packages Version: Trunk
Keywords: wndr3700 wfi button Cc:

Description

Hello,
I'd like to suggest a patch to properly name the wifi button as 'wifi' instead of 'BTN_2'.
This approach could be applied also to many other devices.

Index: target/linux/generic/patches-3.8/411-add-KEY_WIFI_BUTTON-definition.patch
===================================================================
--- target/linux/generic/patches-3.8/411-add-KEY_WIFI_BUTTON-definition.patch	(revision 0)
+++ target/linux/generic/patches-3.8/411-add-KEY_WIFI_BUTTON-definition.patch	(working copy)
@@ -0,0 +1,10 @@
+--- a/include/uapi/linux/input.h	2013-03-01 02:15:09.099885288 +0000
++++ b/include/uapi/linux/input.h	2013-03-01 02:20:51.438706094 +0000
+@@ -701,6 +701,7 @@ struct input_keymap_entry {
+ #define KEY_CAMERA_DOWN		0x218
+ #define KEY_CAMERA_LEFT		0x219
+ #define KEY_CAMERA_RIGHT	0x21a
++#define KEY_WIFI_BUTTON		0x21b	/* WiFi toggle key */
+ 
+ #define BTN_TRIGGER_HAPPY		0x2c0
+ #define BTN_TRIGGER_HAPPY1		0x2c0
Index: target/linux/ar71xx/patches-3.8/616-MIPS-ath79-wndr3700-wifi-button-name-patch
===================================================================
--- target/linux/ar71xx/patches-3.8/616-MIPS-ath79-wndr3700-wifi-button-name-patch	(revision 0)
+++ target/linux/ar71xx/patches-3.8/616-MIPS-ath79-wndr3700-wifi-button-name-patch	(working copy)
@@ -0,0 +1,11 @@
+--- a/arch/mips/ath79/mach-wndr3700.c	2013-02-28 23:44:24.630816388 +0000
++++ b/arch/mips/ath79/mach-wndr3700.c	2013-02-28 23:50:55.271980731 +0000
+@@ -91,7 +91,7 @@ static struct gpio_keys_button wndr3700_
+ 	}, {
+ 		.desc		= "wifi",
+ 		.type		= EV_KEY,
+-		.code		= BTN_2,
++		.code		= KEY_WIFI_BUTTON,
+ 		.debounce_interval = WNDR3700_KEYS_DEBOUNCE_INTERVAL,
+ 		.gpio		= WNDR3700_GPIO_BTN_WIFI,
+ 		.active_low	= 1,
Index: package/system/gpio-button-hotplug/src/gpio-button-hotplug.c
===================================================================
--- package/system/gpio-button-hotplug/src/gpio-button-hotplug.c	(revision 35879)
+++ package/system/gpio-button-hotplug/src/gpio-button-hotplug.c	(working copy)
@@ -94,6 +94,9 @@
 #ifdef KEY_WPS_BUTTON
 	BH_MAP(KEY_WPS_BUTTON,	"wps"),
 #endif /* KEY_WPS_BUTTON */
+#ifdef KEY_WIFI_BUTTON
+        BH_MAP(KEY_WIFI_BUTTON,  "wifi"),
+#endif /* KEY_WIFI_BUTTON */
 };
 
 /* -------------------------------------------------------------------------*/

Attachments (1)

wndr3700-wifi-button-name-patch (2.1 KB) - added by raver@… 5 years ago.

Download all attachments as: .zip

Change History (2)

Changed 5 years ago by raver@…

comment:1 Changed 5 years ago by jogo

  • Resolution set to invalid
  • Status changed from new to closed

a) There's already KEY_WLAN, no need to reinvent the wheel.

b) Please submit patches according to SubmittingPatches, not as tickets to allow proper discussion.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.