Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1736068

RE: [PATCH] platform/x86: intel-hid: Power button suspend on Dell Latitude 7275

From <Mario.Limonciello@dell.com>
Newsgroups linux.kernel
Subject RE: [PATCH] platform/x86: intel-hid: Power button suspend on Dell Latitude 7275
Date 2017-09-20 22:10 +0200
Message-ID <urTtM-7M2-25@gated-at.bofh.it> (permalink)
References <uqQHD-5Tq-1@gated-at.bofh.it> <urbM6-3wY-9@gated-at.bofh.it> <urd1v-4cQ-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> -----Original Message-----
> From: Jérôme de Bretagne [mailto:jerome.debretagne@gmail.com]
> Sent: Monday, September 18, 2017 5:41 PM
> To: Limonciello, Mario <Mario_Limonciello@Dell.com>
> Cc: platform-driver-x86@vger.kernel.org; Darren Hart <dvhart@infradead.org>;
> LKML <linux-kernel@vger.kernel.org>; ACPI Devel Maling List <linux-
> acpi@vger.kernel.org>; Rafael J. Wysocki <rjw@rjwysocki.net>; Andy Shevchenko
> <andy.shevchenko@gmail.com>; Alex Hung <alex.hung@canonical.com>
> Subject: Re: [PATCH] platform/x86: intel-hid: Power button suspend on Dell
> Latitude 7275
> 
> 2017-09-18 23:29 GMT+02:00  <Mario.Limonciello@dell.com>:
> >> -----Original Message-----
> >> From: Jérôme de Bretagne [mailto:jerome.debretagne@gmail.com]
> >> Sent: Sunday, September 17, 2017 5:57 PM
> >> To: platform-driver-x86@vger.kernel.org
> >> Cc: Darren Hart <dvhart@infradead.org>; LKML <linux-kernel@vger.kernel.org>;
> >> Linux ACPI <linux-acpi@vger.kernel.org>; Rafael J. Wysocki
> <rjw@rjwysocki.net>;
> >> Andy Shevchenko <andy.shevchenko@gmail.com>; Limonciello, Mario
> >> <Mario_Limonciello@Dell.com>; Alex Hung <alex.hung@canonical.com>
> >> Subject: [PATCH] platform/x86: intel-hid: Power button suspend on Dell Latitude
> >> 7275
> >>
> >> From: Jérôme de Bretagne <jerome.debretagne@gmail.com>
> >>
> >> On Dell Latitude 7275 the 5-button array is not exposed in the
> >> ACPI tables, but still notifies are sent to the Intel HID device
> >> object (device ID INT33D5) in response to power button actions.
> >> They were ignored as the intel-hid driver was not prepared to
> >> take care of them until recently.
> >>
> >> Power button wakeup from suspend-to-idle was added in:
> >> 635173a17b03 ("intel-hid: Wake up Dell Latitude 7275 from
> >> suspend-to-idle"). However power button suspend doesn't work
> >> yet on this platform so it would be good to add it also.
> >>
> >> On the affected platform (for which priv->array is NULL), add
> >> a new upfront check against the power button press notification
> >> (0xCE) to notify_handler(), outside the wakeup mode this time,
> >> which allows to report the power button press event and
> >> trigger the suspend. Also catch and ignore the corresponding
> >> power button release notification (0xCF) to stop it from being
> >> reported as an "unknown event" in the logs.
> >>
> >> Link: https://bugzilla.kernel.org/show_bug.cgi?id=196115
> >> Tested-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
> >> Signed-off-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
> >> ---
> >>  drivers/platform/x86/intel-hid.c | 16 ++++++++++++++++
> >>  1 file changed, 16 insertions(+)
> >>
> >> diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c
> >> index a782c78e7c63..b19f8dcf9d8c 100644
> >> --- a/drivers/platform/x86/intel-hid.c
> >> +++ b/drivers/platform/x86/intel-hid.c
> >> @@ -226,6 +226,22 @@ static void notify_handler(acpi_handle handle, u32
> event,
> >> void *context)
> >>               return;
> >>       }
> >>
> >> +     /*
> >> +      * Needed for suspend to work on some platforms that don't expose
> >> +      * the 5-button array, but still send notifies with power button
> >> +      * event code to this device object on power button actions.
> >> +      *
> >> +      * Report the power button press; catch and ignore the button release.
> >> +      */
> >> +     if (!priv->array) {
> >> +             if (event == 0xce) {
> >> +                     input_report_key(priv->input_dev, KEY_POWER, 1);
> >> +                     input_sync(priv->input_dev);
> >> +                     return;
> >> +             } else if (event == 0xcf)
> >> +                     return;
> >> +     }
> >> +
> >>       /* 0xC0 is for HID events, other values are for 5 button array */
> >>       if (event != 0xc0) {
> >>               if (!priv->array ||
> >
> > LGTM, it's improved from what you posted to that bug already.
> >
> > Acked-By: Mario Limonciello <mario.limonciello@dell.com>
> 
> Thanks Mario.
> 
> In fact, I updated my initial fix proposal on the 12th in [1] and
> this patch matches exactly the updated version. You didn't receive
> the update notification from Bugzilla?
> 
> [1] https://bugzilla.kernel.org/show_bug.cgi?id=196115#c12

No I didn't get one (or some enterprise spam filter helpfully avoided
letting it into my inbox).


Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] platform/x86: intel-hid: Power button suspend on Dell Latitude 7275 Jérôme de Bretagne          <jerome.debretagne@gmail.com> - 2017-09-18 01:00 +0200
  RE: [PATCH] platform/x86: intel-hid: Power button suspend on Dell  Latitude 7275 <Mario.Limonciello@dell.com> - 2017-09-18 23:30 +0200
    Re: [PATCH] platform/x86: intel-hid: Power button suspend on Dell  Latitude 7275 Jérôme de Bretagne          <jerome.debretagne@gmail.com> - 2017-09-19 00:50 +0200
      RE: [PATCH] platform/x86: intel-hid: Power button suspend on Dell  Latitude 7275 <Mario.Limonciello@dell.com> - 2017-09-20 22:10 +0200
  Re: [PATCH] platform/x86: intel-hid: Power button suspend on Dell  Latitude 7275 Darren Hart <dvhart@infradead.org> - 2017-09-23 01:50 +0200
    Re: [PATCH] platform/x86: intel-hid: Power button suspend on Dell  Latitude 7275 Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-09-25 13:00 +0200

csiph-web