Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1283650
| From | Pali Rohár <pali.rohar@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] dell-wmi: process Dell Instant Launch hotkey on Dell Vostro V131 |
| Date | 2015-12-04 09:50 +0100 |
| Message-ID | <qBUdY-kv-7@gated-at.bofh.it> (permalink) |
| References | <qAE1A-r5-17@gated-at.bofh.it> <qAZfJ-5yU-25@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tuesday 01 December 2015 20:51:34 Michał Kępień wrote:
> On some laptop models (e.g. Dell Vostro V131), pressing the Dell Instant
> Launch hotkey does not raise an i8042 interrupt - only WMI event 0xe025
> is generated. As there seems to be no ACPI method or SMI call to
> determine without possible side effects whether a given machine is
> capable of simulating a keypress when this hotkey is pressed, DMI
> matching is used to whitelist the models for which an input event should
> be generated when WMI event 0xe025 is received.
>
> Signed-off-by: Michał Kępień <kernel@kempniu.pl>
> ---
> Changes from v1:
>
> - Use DMI matching instead of a module parameter
> - Change flag name to improve readability
>
> Darren, I am aware this patch conflicts with Andy's WMI rework series
> posted yesterday, so please just let me know if you want me to rebase.
>
> drivers/platform/x86/dell-wmi.c | 39 ++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 38 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
> index 8cb0f57..27c8f49 100644
> --- a/drivers/platform/x86/dell-wmi.c
> +++ b/drivers/platform/x86/dell-wmi.c
> @@ -47,6 +47,38 @@ static int acpi_video;
>
> MODULE_ALIAS("wmi:"DELL_EVENT_GUID);
>
> +struct quirk_entry {
> + bool process_dell_instant_launch;
> +};
> +
> +static struct quirk_entry *quirks;
> +
> +static struct quirk_entry quirk_unknown = {
> +};
> +
> +static struct quirk_entry quirk_dell_vostro_v131 = {
> + .process_dell_instant_launch = true,
> +};
> +
> +static int __init dmi_matched(const struct dmi_system_id *dmi)
> +{
> + quirks = dmi->driver_data;
> + return 1;
> +}
> +
> +static const struct dmi_system_id dell_wmi_quirks[] __initconst = {
> + {
> + .callback = dmi_matched,
> + .ident = "Dell Vostro V131",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> + DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V131"),
> + },
> + .driver_data = &quirk_dell_vostro_v131,
> + },
> + { }
> +};
> +
It is not possible to simplify this part of code? Currently we only need
boolean variable: ignore 0xe025 event or not. I think that whole quirk
structure is not needed yet (and I would be happy if never in future).
> /*
> * Certain keys are flagged as KE_IGNORE. All of these are either
> * notifications (rather than requests for change) or are also sent
> @@ -87,7 +119,7 @@ static const struct key_entry dell_wmi_legacy_keymap[] __initconst = {
> { KE_IGNORE, 0xe020, { KEY_MUTE } },
>
> /* Shortcut and audio panel keys */
> - { KE_IGNORE, 0xe025, { KEY_RESERVED } },
> + { KE_KEY, 0xe025, { KEY_PROG4 } },
> { KE_IGNORE, 0xe026, { KEY_RESERVED } },
>
> { KE_IGNORE, 0xe02e, { KEY_VOLUMEDOWN } },
> @@ -183,6 +215,9 @@ static void dell_wmi_process_key(int reported_key)
> key->keycode == KEY_BRIGHTNESSDOWN) && acpi_video)
> return;
>
> + if (key->keycode == KEY_PROG4 && !quirks->process_dell_instant_launch)
> + return;
> +
> sparse_keymap_report_entry(dell_wmi_input_dev, key, 1, true);
> }
>
> @@ -432,6 +467,8 @@ static int __init dell_wmi_init(void)
> return -ENODEV;
> }
>
> + quirks = &quirk_unknown;
Unknown sounds like something is not know or we do not know what it is.
But here we know exactly what is needed (= ignore 0xe025 key).
> + dmi_check_system(dell_wmi_quirks);
> dmi_walk(find_hk_type, NULL);
> acpi_video = acpi_video_get_backlight_type() != acpi_backlight_vendor;
>
--
Pali Rohár
pali.rohar@gmail.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH] dell-wmi: add module param to control Dell Instant Launch hotkey processing Darren Hart <dvhart@infradead.org> - 2015-11-30 22:20 +0100
Re: [PATCH] dell-wmi: add module param to control Dell Instant Launch hotkey processing Michał Kępień <kernel@kempniu.pl> - 2015-12-01 09:50 +0100
[PATCH v2] dell-wmi: process Dell Instant Launch hotkey on Dell Vostro V131 Michał Kępień <kernel@kempniu.pl> - 2015-12-01 21:00 +0100
Re: [PATCH v2] dell-wmi: process Dell Instant Launch hotkey on Dell Vostro V131 Darren Hart <dvhart@infradead.org> - 2015-12-04 02:20 +0100
Re: [PATCH v2] dell-wmi: process Dell Instant Launch hotkey on Dell Vostro V131 Pali Rohár <pali.rohar@gmail.com> - 2015-12-04 10:00 +0100
Re: [PATCH v2] dell-wmi: process Dell Instant Launch hotkey on Dell Vostro V131 Michał Kępień <kernel@kempniu.pl> - 2015-12-04 14:30 +0100
Re: [PATCH v2] dell-wmi: process Dell Instant Launch hotkey on Dell Vostro V131 Michał Kępień <kernel@kempniu.pl> - 2015-12-04 14:00 +0100
Re: [PATCH v2] dell-wmi: process Dell Instant Launch hotkey on Dell Vostro V131 Andy Lutomirski <luto@amacapital.net> - 2015-12-04 17:10 +0100
Re: [PATCH v2] dell-wmi: process Dell Instant Launch hotkey on Dell Vostro V131 Pali Rohár <pali.rohar@gmail.com> - 2015-12-04 09:50 +0100
Re: [PATCH v2] dell-wmi: process Dell Instant Launch hotkey on Dell Vostro V131 Michał Kępień <kernel@kempniu.pl> - 2015-12-04 13:40 +0100
csiph-web