All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] surface pro 3: add a warning when switching to tablet mode
@ 2016-05-10 11:49 Andy Shevchenko
  2016-05-11 19:56 ` Darren Hart
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2016-05-10 11:49 UTC (permalink / raw)
  To: platform-driver-x86, Chen Yu, Darren Hart; +Cc: Andy Shevchenko

Microsoft Surface Book has a tablet mode button. Print another message once on
this even instead of a bit annoying repetition of "Unknown event...".

Unfortunately we can't right now to implement the proper support of this since
_DSM method is very likely owned by Microsoft and it's not too easy to just run
it. Thus print a warning for now.

One may consider to evaluate GGIV method which seems responsible to return
current mode in use.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/platform/x86/surfacepro3_button.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/surfacepro3_button.c b/drivers/platform/x86/surfacepro3_button.c
index 700e0fa..6505c97 100644
--- a/drivers/platform/x86/surfacepro3_button.c
+++ b/drivers/platform/x86/surfacepro3_button.c
@@ -24,6 +24,8 @@
 #define SURFACE_BUTTON_OBJ_NAME		"VGBI"
 #define SURFACE_BUTTON_DEVICE_NAME	"Surface Pro 3/4 Buttons"
 
+#define SURFACE_BUTTON_NOTIFY_TABLET_MODE	0xc8
+
 #define SURFACE_BUTTON_NOTIFY_PRESS_POWER	0xc6
 #define SURFACE_BUTTON_NOTIFY_RELEASE_POWER	0xc7
 
@@ -33,7 +35,7 @@
 #define SURFACE_BUTTON_NOTIFY_PRESS_VOLUME_UP	0xc0
 #define SURFACE_BUTTON_NOTIFY_RELEASE_VOLUME_UP	0xc1
 
-#define SURFACE_BUTTON_NOTIFY_PRESS_VOLUME_DOWN	0xc2
+#define SURFACE_BUTTON_NOTIFY_PRESS_VOLUME_DOWN		0xc2
 #define SURFACE_BUTTON_NOTIFY_RELEASE_VOLUME_DOWN	0xc3
 
 ACPI_MODULE_NAME("surface pro 3 button");
@@ -105,9 +107,12 @@ static void surface_button_notify(struct acpi_device *device, u32 event)
 	case SURFACE_BUTTON_NOTIFY_RELEASE_VOLUME_DOWN:
 		key_code = KEY_VOLUMEDOWN;
 		break;
+	case SURFACE_BUTTON_NOTIFY_TABLET_MODE:
+		dev_warn_once(&device->dev, "Tablet mode is not supported\n");
+		break;
 	default:
 		dev_info_ratelimited(&device->dev,
-				  "Unsupported event [0x%x]\n", event);
+				     "Unsupported event [0x%x]\n", event);
 		break;
 	}
 	input = button->input;
-- 
2.8.1

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

end of thread, other threads:[~2016-05-12 12:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-10 11:49 [PATCH v1 1/1] surface pro 3: add a warning when switching to tablet mode Andy Shevchenko
2016-05-11 19:56 ` Darren Hart
     [not found]   ` <36DF59CE26D8EE47B0655C516E9CE640287599DE@shsmsx102.ccr.corp.intel.com>
2016-05-12 11:11     ` Andy Shevchenko
2016-05-12 12:32   ` Andy Shevchenko

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.