linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Mario.Limonciello@dell.com>
To: <andy.shevchenko@gmail.com>, <notmart@gmail.com>
Cc: <linux-kernel@vger.kernel.org>, <mjg59@srcf.ucam.org>,
	<pali.rohar@gmail.com>, <dvhart@infradead.org>,
	<andy@infradead.org>, <bhush94@gmail.com>,
	<platform-driver-x86@vger.kernel.org>
Subject: RE: [PATCH] Support tablet mode switch for Dell laptops
Date: Thu, 18 Jan 2018 15:23:04 +0000	[thread overview]
Message-ID: <2125c5fc4eba44e5929600d3fbc0d456@ausx13mpc120.AMER.DELL.COM> (raw)
In-Reply-To: <CAHp75VcKgRCjqw0U=F3ez1XaMdY+e0oVRWvrjWxNyADv8+tsKA@mail.gmail.com>

> -----Original Message-----
> From: platform-driver-x86-owner@vger.kernel.org [mailto:platform-driver-x86-
> owner@vger.kernel.org] On Behalf Of Andy Shevchenko
> Sent: Thursday, January 18, 2018 9:13 AM
> To: Marco Martin <notmart@gmail.com>; Limonciello, Mario
> <Mario_Limonciello@Dell.com>
> Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>; Matthew Garrett
> <mjg59@srcf.ucam.org>; Pali Rohár <pali.rohar@gmail.com>; Darren Hart
> <dvhart@infradead.org>; Andy Shevchenko <andy@infradead.org>;
> bhush94@gmail.com; Platform Driver <platform-driver-x86@vger.kernel.org>
> Subject: Re: [PATCH] Support tablet mode switch for Dell laptops
> 
> On Thu, Jan 18, 2018 at 3:59 PM, Marco Martin <notmart@gmail.com> wrote:
> > Dell laptops send events to intel-vbtn.c
> > 0xCC when the laptop enters in tablet mode and
> > 0xCD when the laptop goes out of it
> >
> > This has been confirmed working on a Dell Inspiron 13-7352
> > and an Inspiron 13-7000
> >
> > I'm not sure intel-vbtn is the right place for it, as it
> > should be dell-specific, but this is the only device driver
> > where those events arrive at all
> > also, it would need a way to query the initial state of the switch
> 
> Yeah, to me sounds like a hack for now.
> So, I would like to hear from everyone: Pali, Mario, Darren?

AFAIK we don't have a public specification for the ACPI interface
that intel-vbtn uses, it's all reverse engineered.

I think the appropriate thing to do would be open a kernel Bugzilla for your
issue and attach:
1) kernel log without your patch (do you get unknown event index?)
2) your DSDT there to review.

You can subscribe us to it.

Also you should subscribe Alex Hung, who has done lots of work on intel-vbtn
and intel-hid.

> 
> > CC:platform-driver-x86@vger.kernel.org
> > CC:Matthew Garrett <mjg59@srcf.ucam.org>
> > CC:"Pali Rohár" <pali.rohar@gmail.com>
> > CC:Darren Hart <dvhart@infradead.org>
> > CC:Andy Shevchenko <andy@infradead.org>
> >
> > Signed-off-by: Marco Martin <notmart@gmail.com>
> > ---
> >  drivers/platform/x86/intel-vbtn.c | 12 +++++++++++-
> >  1 file changed, 11 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c
> > index 146d02f..1fa63e8 100644
> > --- a/drivers/platform/x86/intel-vbtn.c
> > +++ b/drivers/platform/x86/intel-vbtn.c
> > @@ -61,6 +61,10 @@ static int intel_vbtn_input_setup(struct platform_device
> *device)
> >         priv->input_dev->name = "Intel Virtual Button driver";
> >         priv->input_dev->id.bustype = BUS_HOST;
> >
> > +       input_set_capability(priv->input_dev, EV_SW, SW_TABLET_MODE);
> > +       /*TODO: query initial state (and if the switch is present*/
> > +       input_report_switch(priv->input_dev, SW_TABLET_MODE, 0);
> > +
> >         ret = input_register_device(priv->input_dev);
> >         if (ret)
> >                 goto err_free_device;
> > @@ -84,7 +88,13 @@ static void notify_handler(acpi_handle handle, u32 event,
> void *context)
> >         struct platform_device *device = context;
> >         struct intel_vbtn_priv *priv = dev_get_drvdata(&device->dev);
> >
> > -       if (!sparse_keymap_report_event(priv->input_dev, event, 1, true))
> > +       if (event == 0xCC) {
> > +               input_report_switch(priv->input_dev, SW_TABLET_MODE, 1);
> > +               input_sync(priv->input_dev);
> > +       } else if (event == 0xCD) {
> > +               input_report_switch(priv->input_dev, SW_TABLET_MODE, 0);
> > +               input_sync(priv->input_dev);
> > +       } else if (!sparse_keymap_report_event(priv->input_dev, event, 1, true))
> >                 dev_info(&device->dev, "unknown event index 0x%x\n",
> >                          event);
> >  }
> > --
> > 2.7.4
> >
> 
> 
> 
> --
> With Best Regards,
> Andy Shevchenko

  reply	other threads:[~2018-01-18 15:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-18 13:59 [PATCH] Support tablet mode switch for Dell laptops Marco Martin
2018-01-18 15:13 ` Andy Shevchenko
2018-01-18 15:23   ` Mario.Limonciello [this message]
2018-01-18 15:59     ` Marco Martin
2018-01-18 15:44 ` Pali Rohár
2018-01-19 16:01   ` Pali Rohár
2018-01-19 16:09     ` Mario.Limonciello
2018-01-19 17:29       ` Dmitry Torokhov
2018-01-22 11:59         ` Marco Martin
2018-01-22 12:50           ` Marco Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2125c5fc4eba44e5929600d3fbc0d456@ausx13mpc120.AMER.DELL.COM \
    --to=mario.limonciello@dell.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@infradead.org \
    --cc=bhush94@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=notmart@gmail.com \
    --cc=pali.rohar@gmail.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).