All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: ideapad-laptop: Ignore VPC event bit 10
@ 2021-05-23 17:23 Hans de Goede
  2021-05-25 12:45 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2021-05-23 17:23 UTC (permalink / raw)
  To: Mark Gross, Andy Shevchenko
  Cc: Hans de Goede, Barnabás Pőcze, platform-driver-x86

VPC event bit 10 gets set on a Yoga 300-11IBR when the EC believes that the
device has changed between laptop/tent/stand/tablet mode.

The EC relies on getting angle info from 2 accelerometers through a special
windows service calling a DSM on the DUAL250E ACPI-device. Linux does not
do this, making the laptop/tent/stand/tablet mode info unreliable.

Ignore VPC event bit 10 to avoid the warnings triggered by the default case
in ideapad_acpi_notify().

Note that the plan for Linux is to have iio-sensor-proxy read the 2
accelerometers and have it provide info about which mode 360° hinges
2-in-1s to the rest of userspace:
https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/issues/216

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/ideapad-laptop.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 387817290921..784326bd72f0 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -1408,6 +1408,18 @@ static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data)
 		case 6:
 			ideapad_input_report(priv, bit);
 			break;
+		case 10:
+			/*
+			 * This event gets send on a Yoga 300-11IBR when the EC
+			 * believes that the device has changed between laptop/
+			 * tent/stand/tablet mode. The EC relies on getting
+			 * angle info from 2 accelerometers through a special
+			 * windows service calling a DSM on the DUAL250E ACPI-
+			 * device. Linux does not do this, making the laptop/
+			 * tent/stand/tablet mode info unreliable, so we simply
+			 * ignore these events.
+			 */
+			break;
 		case 9:
 			ideapad_sync_rfk_state(priv);
 			break;
-- 
2.31.1


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

* Re: [PATCH] platform/x86: ideapad-laptop: Ignore VPC event bit 10
  2021-05-23 17:23 [PATCH] platform/x86: ideapad-laptop: Ignore VPC event bit 10 Hans de Goede
@ 2021-05-25 12:45 ` Hans de Goede
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2021-05-25 12:45 UTC (permalink / raw)
  To: Mark Gross, Andy Shevchenko; +Cc: Barnabás Pőcze, platform-driver-x86

Hi,

On 5/23/21 7:23 PM, Hans de Goede wrote:
> VPC event bit 10 gets set on a Yoga 300-11IBR when the EC believes that the
> device has changed between laptop/tent/stand/tablet mode.
> 
> The EC relies on getting angle info from 2 accelerometers through a special
> windows service calling a DSM on the DUAL250E ACPI-device. Linux does not
> do this, making the laptop/tent/stand/tablet mode info unreliable.
> 
> Ignore VPC event bit 10 to avoid the warnings triggered by the default case
> in ideapad_acpi_notify().
> 
> Note that the plan for Linux is to have iio-sensor-proxy read the 2
> accelerometers and have it provide info about which mode 360° hinges
> 2-in-1s to the rest of userspace:
> https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/issues/216
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

I've merged this into my review-hans (and soon also for-next) branch
now.

Regards,

Hans


> ---
>  drivers/platform/x86/ideapad-laptop.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
> index 387817290921..784326bd72f0 100644
> --- a/drivers/platform/x86/ideapad-laptop.c
> +++ b/drivers/platform/x86/ideapad-laptop.c
> @@ -1408,6 +1408,18 @@ static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data)
>  		case 6:
>  			ideapad_input_report(priv, bit);
>  			break;
> +		case 10:
> +			/*
> +			 * This event gets send on a Yoga 300-11IBR when the EC
> +			 * believes that the device has changed between laptop/
> +			 * tent/stand/tablet mode. The EC relies on getting
> +			 * angle info from 2 accelerometers through a special
> +			 * windows service calling a DSM on the DUAL250E ACPI-
> +			 * device. Linux does not do this, making the laptop/
> +			 * tent/stand/tablet mode info unreliable, so we simply
> +			 * ignore these events.
> +			 */
> +			break;
>  		case 9:
>  			ideapad_sync_rfk_state(priv);
>  			break;
> 


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

end of thread, other threads:[~2021-05-25 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-23 17:23 [PATCH] platform/x86: ideapad-laptop: Ignore VPC event bit 10 Hans de Goede
2021-05-25 12:45 ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.