From: ayman.bagabas@gmail.com
To: Randy Dunlap <rdunlap@infradead.org>,
Darren Hart <dvhart@infradead.org>,
Andy Shevchenko <andy@infradead.org>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Kailang Yang <kailang@realtek.com>,
Hui Wang <hui.wang@canonical.com>,
linux-kernel@vger.kernel.org,
platform-driver-x86@vger.kernel.org, alsa-devel@alsa-project.org
Subject: Re: [PATCH v9 2/3] x86: add support for Huawei WMI hotkeys.
Date: Tue, 04 Dec 2018 10:29:47 -0500 [thread overview]
Message-ID: <5d47df50508c040a029bee55161571522b69f307.camel@gmail.com> (raw)
In-Reply-To: <9d6d8211-6fdf-bfe4-82b5-272d67fbae23@infradead.org>
On Mon, 2018-12-03 at 11:41 -0800, Randy Dunlap wrote:
> On 12/3/18 10:53 AM, Ayman Bagabas wrote:
> > This driver adds support for missing hotkeys on some Huawei
> > laptops.
> > Laptops such as the Matebook X have non functioning hotkeys.
> > Whereas
> > newer laptops such as the Matebook X Pro come with working hotkeys
> > out
> > of the box.
> >
> > Old laptops, such as the Matebook X, report hotkey events through
> > ACPI
> > device "\WMI0". However, new laptops, such as the Matebook X Pro,
> > does not have this WMI device.
> >
> > All the hotkeys on the Matebook X Pro work fine
> > without this patch except (micmute, wlan, and huawei key). These
> > keys
> > and the brightness keys report events to "\AMW0" ACPI device. One
> > problem is that brightness keys on the Matebook X Pro work without
> > this
> > patch. This results in reporting two brightness key press
> > events one is captured by ACPI and another by this driver.
> >
> > A solution would be to check if such event came from the "\AMW0"
> > WMI driver
> > then skip reporting event. Another solution would be to leave this
> > to
> > user-space to handle. Which can be achieved by using "hwdb" tables
> > and
> > remap those keys to "unknown". This solution seems more natural to
> > me
> > because it leaves the decision to user-space.
> >
> > Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>
> > ---
> > drivers/platform/x86/Kconfig | 16 +++
> > drivers/platform/x86/Makefile | 1 +
> > drivers/platform/x86/huawei-wmi.c | 226
> > ++++++++++++++++++++++++++++++
> > 3 files changed, 243 insertions(+)
> > create mode 100644 drivers/platform/x86/huawei-wmi.c
> >
> > diff --git a/drivers/platform/x86/Kconfig
> > b/drivers/platform/x86/Kconfig
> > index 87f70e8f4dd0..27db3ce7a1e1 100644
> > --- a/drivers/platform/x86/Kconfig
> > +++ b/drivers/platform/x86/Kconfig
> > @@ -1292,6 +1292,22 @@ config INTEL_ATOMISP2_PM
> > To compile this driver as a module, choose M here: the module
> > will be called intel_atomisp2_pm.
> >
> > +config HUAWEI_WMI
> > + tristate "Huawei WMI hotkeys driver"
> > + depends on ACPI_WMI
> > + depends on INPUT
> > + select INPUT_SPARSEKMAP
> > + select LEDS_CLASS
>
> but LEDS_CLASS is only available if NEW_LEDS is set/enabled, so it
> either
> depends on LEDS_CLASS... or it needs to select NEW_LEDS, which is
> what other
> drivers in this Kconfig file do, even though our b.d. has said a few
> times
> that any one driver should not "select" => enable an entire
> subsystem,
> so they all should be "depends on NEW_LEDS" IMHO.
Noted, I'll select NEW_LEDS just like other drivers in Kconfig.
>
> > + select LEDS_TRIGGERS
> > + select LEDS_TRIGGER_AUDIO
> > + help
> > + This driver provides support for Huawei WMI hotkeys.
> > + It enables the missing keys and adds support to the micmute
> > + LED found on some of these laptops.
> > +
> > + To compile this driver as a module, choose M here: the module
> > + will be called huawei-wmi.
> > +
> > endif # X86_PLATFORM_DEVICES
> >
> > config PMC_ATOM
>
>
next prev parent reply other threads:[~2018-12-04 15:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-03 18:53 [PATCH v9 0/3] Huawei laptops Ayman Bagabas
2018-12-03 18:53 ` [PATCH v9 1/3] ALSA: hda: fix front speakers on Huawei MBXP Ayman Bagabas
2018-12-03 18:53 ` [PATCH v9 2/3] x86: add support for Huawei WMI hotkeys Ayman Bagabas
2018-12-03 19:04 ` Takashi Iwai
2018-12-03 19:17 ` Andy Shevchenko
2018-12-04 15:41 ` ayman.bagabas
[not found] ` <577ee93043ae7f2d3ff9818696c1b759efa5b1c8.camel@gmail.com>
2018-12-08 6:39 ` ayman.bagabas
2018-12-03 19:41 ` Randy Dunlap
2018-12-04 15:29 ` ayman.bagabas [this message]
2018-12-03 18:53 ` [PATCH v9 3/3] ALSA: hda: add support for Huawei WMI micmute LED Ayman Bagabas
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=5d47df50508c040a029bee55161571522b69f307.camel@gmail.com \
--to=ayman.bagabas@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=andy@infradead.org \
--cc=dvhart@infradead.org \
--cc=hui.wang@canonical.com \
--cc=kailang@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=tiwai@suse.com \
/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
all inboxes | Powered by JetHome®