X86 platform drivers
 help / color / mirror / Atom feed
* [PATCH] asus-wmi: Ambient sensor toggle key
@ 2016-06-19 11:59 Nick Leiten
  2016-06-19 13:52 ` Corentin Chary
  2016-06-28 18:18 ` Darren Hart
  0 siblings, 2 replies; 3+ messages in thread
From: Nick Leiten @ 2016-06-19 11:59 UTC (permalink / raw)
  To: platform-driver-x86@vger.kernel.org

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.


Signed-off-by: Nick Leiten <nickleiten@gmail.com>

diff -Npru a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c
--- linux-4.6-orig/drivers/platform/x86/asus-nb-wmi.c	2016-05-16 01:43:13.000000000 +0300
+++ linux-4.6-diff/drivers/platform/x86/asus-nb-wmi.c	2016-06-06 07:00:27.000000000 +0300
@@ -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 } },

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] asus-wmi: Ambient sensor toggle key
  2016-06-19 11:59 [PATCH] asus-wmi: Ambient sensor toggle key Nick Leiten
@ 2016-06-19 13:52 ` Corentin Chary
  2016-06-28 18:18 ` Darren Hart
  1 sibling, 0 replies; 3+ messages in thread
From: Corentin Chary @ 2016-06-19 13:52 UTC (permalink / raw)
  To: nickleiten; +Cc: platform-driver-x86@vger.kernel.org

On Sun, Jun 19, 2016 at 1:59 PM, Nick Leiten <nickleiten@gmail.com> wrote:
> 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.
>
>
> Signed-off-by: Nick Leiten <nickleiten@gmail.com>
>
> diff -Npru a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c
> --- linux-4.6-orig/drivers/platform/x86/asus-nb-wmi.c   2016-05-16 01:43:13.000000000 +0300
> +++ linux-4.6-diff/drivers/platform/x86/asus-nb-wmi.c   2016-06-06 07:00:27.000000000 +0300
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reviewed-By: Corentin Chary <corentin.chary@gmail.com>

-- 
Corentin Chary
http://xf.iksaif.net

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] asus-wmi: Ambient sensor toggle key
  2016-06-19 11:59 [PATCH] asus-wmi: Ambient sensor toggle key Nick Leiten
  2016-06-19 13:52 ` Corentin Chary
@ 2016-06-28 18:18 ` Darren Hart
  1 sibling, 0 replies; 3+ messages in thread
From: Darren Hart @ 2016-06-28 18:18 UTC (permalink / raw)
  To: Nick Leiten; +Cc: platform-driver-x86@vger.kernel.org

On Sun, Jun 19, 2016 at 02:59:26PM +0300, Nick Leiten wrote:
> 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,

> 
> 
> Signed-off-by: Nick Leiten <nickleiten@gmail.com>
> 
> diff -Npru a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c
> --- linux-4.6-orig/drivers/platform/x86/asus-nb-wmi.c	2016-05-16 01:43:13.000000000 +0300
> +++ linux-4.6-diff/drivers/platform/x86/asus-nb-wmi.c	2016-06-06 07:00:27.000000000 +0300
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
Darren Hart
Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-28 18:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-19 11:59 [PATCH] asus-wmi: Ambient sensor toggle key Nick Leiten
2016-06-19 13:52 ` Corentin Chary
2016-06-28 18:18 ` Darren Hart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox