linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86/acer-wmi: Detect RF Button capability
@ 2017-06-06 20:07 João Paulo Rechi Vita
  2017-06-07 14:45 ` Andy Shevchenko
  2017-06-08 14:50 ` joeyli
  0 siblings, 2 replies; 4+ messages in thread
From: João Paulo Rechi Vita @ 2017-06-06 20:07 UTC (permalink / raw)
  To: Lee, Chun-Yi, Darren Hart, Andy Shevchenko
  Cc: linux, João Paulo Rechi Vita, platform-driver-x86, linux-kernel

If a machine reports a RF Button in the communication button device
bitmap, we need to remove it before calling Get Device Status otherwise
it will return the "Undefined device" (0xE2) error code.

Although this may be a BIOS bug, we don't really need to get or set the
RF Button status. The status indicator LED embedded in the button is
controlled by firmware logic, depending on the status of the wireless
radios present on the machine (WiFi || WWAN).

This commit fixes the wireless status indicator LED on the Acer
TravelMate P648-G2-MG, and cleans the following message from the kernel
log: "Get Current Device Status failed: 0xe2 - 0x0".

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
---
 drivers/platform/x86/acer-wmi.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 79fa5ab3fd00..3b381178039b 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -149,6 +149,8 @@ struct event_return_value {
 #define ACER_WMID3_GDS_THREEG		(1<<6)	/* 3G */
 #define ACER_WMID3_GDS_WIMAX		(1<<7)	/* WiMAX */
 #define ACER_WMID3_GDS_BLUETOOTH	(1<<11)	/* BT */
+#define ACER_WMID3_GDS_RFBTN		(1<<14)	/* RF Button */
+
 #define ACER_WMID3_GDS_TOUCHPAD		(1<<1)	/* Touchpad */
 
 /* Hotkey Customized Setting and Acer Application Status.
@@ -221,6 +223,7 @@ struct hotkey_function_type_aa {
 #define ACER_CAP_BRIGHTNESS		(1<<3)
 #define ACER_CAP_THREEG			(1<<4)
 #define ACER_CAP_ACCEL			(1<<5)
+#define ACER_CAP_RFBTN			(1<<6)
 #define ACER_CAP_ANY			(0xFFFFFFFF)
 
 /*
@@ -1264,6 +1267,10 @@ static void __init type_aa_dmi_decode(const struct dmi_header *header, void *d)
 		interface->capability |= ACER_CAP_THREEG;
 	if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_BLUETOOTH)
 		interface->capability |= ACER_CAP_BLUETOOTH;
+	if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_RFBTN) {
+		interface->capability |= ACER_CAP_RFBTN;
+		commun_func_bitmap &= ~ACER_WMID3_GDS_RFBTN;
+	}
 
 	commun_fn_key_number = type_aa->commun_fn_key_number;
 }
-- 
2.11.0

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

* Re: [PATCH] platform/x86/acer-wmi: Detect RF Button capability
  2017-06-06 20:07 [PATCH] platform/x86/acer-wmi: Detect RF Button capability João Paulo Rechi Vita
@ 2017-06-07 14:45 ` Andy Shevchenko
  2017-06-08 14:50 ` joeyli
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2017-06-07 14:45 UTC (permalink / raw)
  To: João Paulo Rechi Vita
  Cc: Lee, Chun-Yi, Darren Hart, Andy Shevchenko,
	Linux Upstreaming Team, João Paulo Rechi Vita,
	Platform Driver, linux-kernel

On Tue, Jun 6, 2017 at 11:07 PM, João Paulo Rechi Vita
<jprvita@gmail.com> wrote:
> If a machine reports a RF Button in the communication button device
> bitmap, we need to remove it before calling Get Device Status otherwise
> it will return the "Undefined device" (0xE2) error code.
>
> Although this may be a BIOS bug, we don't really need to get or set the
> RF Button status. The status indicator LED embedded in the button is
> controlled by firmware logic, depending on the status of the wireless
> radios present on the machine (WiFi || WWAN).
>
> This commit fixes the wireless status indicator LED on the Acer
> TravelMate P648-G2-MG, and cleans the following message from the kernel
> log: "Get Current Device Status failed: 0xe2 - 0x0".
>

Pushed to testing, thanks!

> Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
> ---
>  drivers/platform/x86/acer-wmi.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
> index 79fa5ab3fd00..3b381178039b 100644
> --- a/drivers/platform/x86/acer-wmi.c
> +++ b/drivers/platform/x86/acer-wmi.c
> @@ -149,6 +149,8 @@ struct event_return_value {
>  #define ACER_WMID3_GDS_THREEG          (1<<6)  /* 3G */
>  #define ACER_WMID3_GDS_WIMAX           (1<<7)  /* WiMAX */
>  #define ACER_WMID3_GDS_BLUETOOTH       (1<<11) /* BT */
> +#define ACER_WMID3_GDS_RFBTN           (1<<14) /* RF Button */
> +
>  #define ACER_WMID3_GDS_TOUCHPAD                (1<<1)  /* Touchpad */
>
>  /* Hotkey Customized Setting and Acer Application Status.
> @@ -221,6 +223,7 @@ struct hotkey_function_type_aa {
>  #define ACER_CAP_BRIGHTNESS            (1<<3)
>  #define ACER_CAP_THREEG                        (1<<4)
>  #define ACER_CAP_ACCEL                 (1<<5)
> +#define ACER_CAP_RFBTN                 (1<<6)
>  #define ACER_CAP_ANY                   (0xFFFFFFFF)
>
>  /*
> @@ -1264,6 +1267,10 @@ static void __init type_aa_dmi_decode(const struct dmi_header *header, void *d)
>                 interface->capability |= ACER_CAP_THREEG;
>         if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_BLUETOOTH)
>                 interface->capability |= ACER_CAP_BLUETOOTH;
> +       if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_RFBTN) {
> +               interface->capability |= ACER_CAP_RFBTN;
> +               commun_func_bitmap &= ~ACER_WMID3_GDS_RFBTN;
> +       }
>
>         commun_fn_key_number = type_aa->commun_fn_key_number;
>  }
> --
> 2.11.0
>



-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH] platform/x86/acer-wmi: Detect RF Button capability
  2017-06-06 20:07 [PATCH] platform/x86/acer-wmi: Detect RF Button capability João Paulo Rechi Vita
  2017-06-07 14:45 ` Andy Shevchenko
@ 2017-06-08 14:50 ` joeyli
  2017-06-08 18:22   ` Andy Shevchenko
  1 sibling, 1 reply; 4+ messages in thread
From: joeyli @ 2017-06-08 14:50 UTC (permalink / raw)
  To: João Paulo Rechi Vita
  Cc: Darren Hart, Andy Shevchenko, linux, João Paulo Rechi Vita,
	platform-driver-x86, linux-kernel

On Tue, Jun 06, 2017 at 01:07:22PM -0700, João Paulo Rechi Vita wrote:
> If a machine reports a RF Button in the communication button device
> bitmap, we need to remove it before calling Get Device Status otherwise
> it will return the "Undefined device" (0xE2) error code.
> 
> Although this may be a BIOS bug, we don't really need to get or set the

Yes, it's possible a BIOS bug.

Because the type aa reports that the 14 bit is raised in bitmap, but it can
not be used to query the device status.

> RF Button status. The status indicator LED embedded in the button is
> controlled by firmware logic, depending on the status of the wireless
> radios present on the machine (WiFi || WWAN).
> 
> This commit fixes the wireless status indicator LED on the Acer
> TravelMate P648-G2-MG, and cleans the following message from the kernel
> log: "Get Current Device Status failed: 0xe2 - 0x0".
> 
> Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>

Please feel free to add:
	Reviewed-by: "Lee, Chun-Yi" <joeyli.kernel@gmail.com>

Thanks a lot!
Joey Lee

> ---
>  drivers/platform/x86/acer-wmi.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
> index 79fa5ab3fd00..3b381178039b 100644
> --- a/drivers/platform/x86/acer-wmi.c
> +++ b/drivers/platform/x86/acer-wmi.c
> @@ -149,6 +149,8 @@ struct event_return_value {
>  #define ACER_WMID3_GDS_THREEG		(1<<6)	/* 3G */
>  #define ACER_WMID3_GDS_WIMAX		(1<<7)	/* WiMAX */
>  #define ACER_WMID3_GDS_BLUETOOTH	(1<<11)	/* BT */
> +#define ACER_WMID3_GDS_RFBTN		(1<<14)	/* RF Button */
> +
>  #define ACER_WMID3_GDS_TOUCHPAD		(1<<1)	/* Touchpad */
>  
>  /* Hotkey Customized Setting and Acer Application Status.
> @@ -221,6 +223,7 @@ struct hotkey_function_type_aa {
>  #define ACER_CAP_BRIGHTNESS		(1<<3)
>  #define ACER_CAP_THREEG			(1<<4)
>  #define ACER_CAP_ACCEL			(1<<5)
> +#define ACER_CAP_RFBTN			(1<<6)
>  #define ACER_CAP_ANY			(0xFFFFFFFF)
>  
>  /*
> @@ -1264,6 +1267,10 @@ static void __init type_aa_dmi_decode(const struct dmi_header *header, void *d)
>  		interface->capability |= ACER_CAP_THREEG;
>  	if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_BLUETOOTH)
>  		interface->capability |= ACER_CAP_BLUETOOTH;
> +	if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_RFBTN) {
> +		interface->capability |= ACER_CAP_RFBTN;
> +		commun_func_bitmap &= ~ACER_WMID3_GDS_RFBTN;
> +	}
>  
>  	commun_fn_key_number = type_aa->commun_fn_key_number;
>  }
> -- 
> 2.11.0
> 

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

* Re: [PATCH] platform/x86/acer-wmi: Detect RF Button capability
  2017-06-08 14:50 ` joeyli
@ 2017-06-08 18:22   ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2017-06-08 18:22 UTC (permalink / raw)
  To: joeyli
  Cc: João Paulo Rechi Vita, Darren Hart, Andy Shevchenko,
	Linux Upstreaming Team, João Paulo Rechi Vita,
	Platform Driver, linux-kernel

On Thu, Jun 8, 2017 at 5:50 PM, joeyli <jlee@suse.com> wrote:
> On Tue, Jun 06, 2017 at 01:07:22PM -0700, João Paulo Rechi Vita wrote:

>> Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
>
> Please feel free to add:
>         Reviewed-by: "Lee, Chun-Yi" <joeyli.kernel@gmail.com>

Patchwork by some reason doesn't recognize this tag (presumably it
doesn't allow leading spaces in that line). Thus, I would ask you to
start tags in new lines without leading spaces.
This one I'm about to apply manually, no need to resend.

-- 
With Best Regards,
Andy Shevchenko

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

end of thread, other threads:[~2017-06-08 18:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-06 20:07 [PATCH] platform/x86/acer-wmi: Detect RF Button capability João Paulo Rechi Vita
2017-06-07 14:45 ` Andy Shevchenko
2017-06-08 14:50 ` joeyli
2017-06-08 18:22   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).