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

* Re: [PATCH v1 1/1] surface pro 3: add a warning when switching to tablet mode
  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 12:32   ` Andy Shevchenko
  0 siblings, 2 replies; 4+ messages in thread
From: Darren Hart @ 2016-05-11 19:56 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: platform-driver-x86, Chen Yu

On Tue, May 10, 2016 at 02:49:55PM +0300, Andy Shevchenko wrote:
> 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.
> 

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.

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

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.

-- 
Darren Hart
Intel Open Source Technology Center

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

* Re: [PATCH v1 1/1] surface pro 3: add a warning when switching to tablet mode
       [not found]   ` <36DF59CE26D8EE47B0655C516E9CE640287599DE@shsmsx102.ccr.corp.intel.com>
@ 2016-05-12 11:11     ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2016-05-12 11:11 UTC (permalink / raw)
  To: Chen, Yu C; +Cc: Darren Hart, platform-driver-x86

Mailing list missed by some reason, return it back.

On Thu, 2016-05-12 at 01:02 +0000, Chen, Yu C wrote:
> Hi Andy,
> 
> > On Tue, May 10, 2016 at 02:49:55PM +0300, Andy Shevchenko wrote:
> > > 
> > > 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.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

* Re: [PATCH v1 1/1] surface pro 3: add a warning when switching to tablet mode
  2016-05-11 19:56 ` Darren Hart
       [not found]   ` <36DF59CE26D8EE47B0655C516E9CE640287599DE@shsmsx102.ccr.corp.intel.com>
@ 2016-05-12 12:32   ` Andy Shevchenko
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2016-05-12 12:32 UTC (permalink / raw)
  To: Darren Hart; +Cc: platform-driver-x86, Chen Yu

On Wed, 2016-05-11 at 12:56 -0700, Darren Hart wrote:
> On Tue, May 10, 2016 at 02:49:55PM +0300, Andy Shevchenko wrote:
> > 
> > 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.
> > 
> 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.

> 
> I dropped the last bit about GGIV entirely as I try to leave
> speculative stuff
> out of the commit logs where possible.
> 
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 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!

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[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.