Skip to contentSkip to conversation

asus-wmi: Ambient sensor toggle key

PATCH In review Nick Leiten 3 participants 3 messages Jun 19, 2016 – Jun 28, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 asus-wmi: Ambient sensor toggle key

Hi,
here is little patch for Fn+A key assignment in asus-nb-wmi.c file so userspace can control ALS (ambient light sensor) on/off state.

As I can see mentions in Internet Asus makes 0x7a code in all their laptops to be assigned to Toggle ALS. Tested on Asus U38N.

drivers/platform/x86/asus-nb-wmi.c +1 -0
diff -Npru a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c
@@ -356,6 +356,7 @@ static const struct key_entry asus_nb_wm
 	{ KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */
 	{ KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
 	{ KE_IGNORE, 0x6E, },  /* Low Battery notification */
+	{ KE_KEY, 0x7a, { KEY_ALS_TOGGLE } }, /* Ambient Light Sensor Toggle, Fn+A*/
 	{ KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
 	{ KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */
 	{ KE_KEY, 0x82, { KEY_CAMERA } },
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Nick Leiten

Hi,
here is little patch for Fn+A key assignment in asus-nb-wmi.c file so userspace can control ALS (ambient light sensor) on/off state.

As I can see mentions in Internet Asus makes 0x7a code in all their laptops to be assigned to Toggle ALS. Tested on Asus U38N.

diff -Npru a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c

drivers/platform/x86/asus-nb-wmi.c 2016-06-06 07:00:27.000000000 +0300 renamed from drivers/platform/x86/asus-nb-wmi.c 2016-05-16 01:43:13.000000000 +0300 +1 -1
@@ -356,6 +356,7 @@ static const struct key_entry asus_nb_wm
        { KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */
        { KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
        { KE_IGNORE, 0x6E, },  /* Low Battery notification */
+       { KE_KEY, 0x7a, { KEY_ALS_TOGGLE } }, /* Ambient Light Sensor Toggle, Fn+A*/
        { KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
        { KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */
        { KE_KEY, 0x82, { KEY_CAMERA } },
 
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Corentin Chary
http://xf.iksaif.net
#2 lore raw
In reply to Nick Leiten
Quoted 5 lines · Nick Leiten

Hi,
here is little patch for Fn+A key assignment in asus-nb-wmi.c file so userspace can control ALS (ambient light sensor) on/off state.

As I can see mentions in Internet Asus makes 0x7a code in all their laptops to be assigned to Toggle ALS. Tested on Asus U38N.

Hi Nick,

Thanks for the patch. The change is good, and I'll merge it for 4.8.

In the future, a few things to keep in mind.

1) Always Cc all maintainers and lists from the get_maintainer.pl script.
2) Check your patch with checkpatch and correct any errors. I'll adjust the longer than 80 chars this time as it's a trivial fix.
3) Read SubmittingPatches Section 1, 14) Canonical Patch Format and format your commit message body accordingly. Look at previous patches for examples.

Thanks,

Quoted 21 lines

diff -Npru a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c

drivers/platform/x86/asus-nb-wmi.c +1 -1
@@ -356,6 +356,7 @@ static const struct key_entry asus_nb_wm
 	{ KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */
 	{ KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
 	{ KE_IGNORE, 0x6E, },  /* Low Battery notification */
+	{ KE_KEY, 0x7a, { KEY_ALS_TOGGLE } }, /* Ambient Light Sensor Toggle, Fn+A*/
 	{ KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
 	{ KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */
 	{ KE_KEY, 0x82, { KEY_CAMERA } },
 
--

To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Darren Hart
Intel Open Source Technology Center