surface pro 3: add a warning when switching to tablet mode
PATCH 1/1 surface pro 3: add a warning when switching to tablet mode
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.
--- drivers/platform/x86/surfacepro3_button.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/platform/x86/surfacepro3_button.c +7 -2
@@ -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 0xc3ACPI_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;
Signature · 1 line
2.8.1
Quoted 10 lines · 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
_DSMmethod 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.
I cleaned up the language of this commit a bit to make it flow a bit better. Please do keep the line length under 75 (checkpatch will complain) as this avoids truncation with "git log".
I dropped the last bit about GGIV entirely as I try to leave speculative stuff out of the commit logs where possible.
Quoted 1 line
Signed-off-by Andy Shevchenko <[email protected]>
I've pushed this to for-next, thanks Andy. Please have a look and let me know if you disagree with any of the commit message changes, the code changes I left intact.
Signature · 2 lines
Darren Hart Intel Open Source Technology Center
Mailing list missed by some reason, return it back.
Quoted 9 lines · Yu C
Hi Andy,
Quoted 4 lines · Andy Shevchenko
Quoted 3 lines
Microsoft Surface Book has a tablet mode button. Print another message
I can not find this button on Surface Pro 3, is this Surface Book specific?
I suppose so.
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy
Quoted 17 lines · Darren Hart
Quoted 12 lines · 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
_DSMmethod is very likely owned by Microsoft and it's not too easy to just run
it. Thus print a warning for now.Quoted 4 lines
One may consider to evaluate GGIV method which seems responsible to return
current mode in use.
Quoted 5 lines
I cleaned up the language of this commit a bit to make it flow a bit better.
Please do keep the line length under 75 (checkpatch will complain) as this
avoids truncation with "git log".
Noted.
Quoted 6 lines
I dropped the last bit about GGIV entirely as I try to leave speculative stuff
out of the commit logs where possible.Quoted 1 line
Quoted 6 lines
Quoted 1 line
Signed-off-by Andy Shevchenko <[email protected]>I've pushed this to for-next, thanks Andy. Please have a look and let me know if
you disagree with any of the commit message changes, the code changes I left
intact.
I checked and found it nice and clean. Thanks, Darren!
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy