From: joeyli <jlee@suse.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Aaron Lu <aaron.lu@intel.com>, Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org,
Matthew Garrett <matthew.garrett@nebula.com>,
platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v2 2/3] acer-wmi: Switch to acpi_video_unregister_backlight
Date: Tue, 20 May 2014 07:30:03 +0800 [thread overview]
Message-ID: <20140519233003.GA2038@linux-rxt1.site> (raw)
In-Reply-To: <1400316483-6356-3-git-send-email-hdegoede@redhat.com>
On Sat, May 17, 2014 at 10:48:02AM +0200, Hans de Goede wrote:
> Switch from acpi_video_unregister(), to acpi_video_unregister_backlight(),
> so that the hotkeys handler registered by acpi-video stays in place.
>
> Since there are no mappings for the atkbd raw codes for the brightness
> keys used by newer Acer models in /lib/udev/hwdb.d/60-keyboard.hwdb, and
> since we map the wmi events with a code of KE_IGNORE, we rely on acpi-video
> to do the hotkey handling for us.
>
> For laptops such as the Acer Aspire 5750 which uses intel gfx this works
> despite us calling acpi_video_unregister() because the following happens:
>
> 1) acpi-video module gets loaded (as it is a dependency of acer-wmi and i915)
> 2) acpi-video does NOT call acpi_video_register()
> 3) acer-wmi loads (assume it loads before i915), calls
> acpi_video_dmi_promote_vendor(); which sets ACPI_VIDEO_BACKLIGHT_DMI_VENDOR
> 4) calls acpi_video_unregister -> not registered, nop
> 5) i915 loads, calls acpi_video_register
> 6) acpi_video_register registers the acpi_notifier for the hotkeys,
> does NOT register a backlight device because of ACPI_VIDEO_BACKLIGHT_DMI_VENDOR
>
> But on the Acer Aspire 5750G, which uses nvidia graphics the following happens:
> 1) acpi-video module gets loaded (as it is a dependency of acer-wmi)
> 2) acpi-video calls acpi_video_register()
> 3) acpi_video_register registers the acpi_notifier for the hotkeys,
> and a backlight device
> 4) acer-wmi loads, calls acpi_video_dmi_promote_vendor()
> 5) calls acpi_video_unregister, this unregisters BOTH the acpi_notifier for
> the hotkeys AND the backlight device
>
> And we end up without any handler for the brightness hotkeys. This patch fixes
> this by switching over to acpi_video_unregister_backlight() which keeps the
> hotkey handler in place.
>
> https://bugzilla.kernel.org/show_bug.cgi?id=35622
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This patch is good to me.
Reviewd-by: Lee, Chun-Yi <jlee@suse.com>
Thanks for your patch.
> ---
> drivers/platform/x86/acer-wmi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
> index c91f69b3..3a74699 100644
> --- a/drivers/platform/x86/acer-wmi.c
> +++ b/drivers/platform/x86/acer-wmi.c
> @@ -2228,7 +2228,7 @@ static int __init acer_wmi_init(void)
> pr_info("Brightness must be controlled by acpi video driver\n");
> } else {
> pr_info("Disabling ACPI video driver\n");
> - acpi_video_unregister();
> + acpi_video_unregister_backlight();
> }
>
> if (wmi_has_guid(WMID_GUID3)) {
> --
> 1.9.0
>
Joey Lee
next prev parent reply other threads:[~2014-05-19 23:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-17 8:48 [PATCH v2 0/3] Add acpi_video_unregister_backlight(), use in acer-wmi Hans de Goede
2014-05-17 8:48 ` [PATCH v2 1/3] acpi-video: Add an acpi_video_unregister_backlight function Hans de Goede
2014-05-21 1:30 ` Aaron Lu
2014-05-17 8:48 ` [PATCH v2 2/3] acer-wmi: Switch to acpi_video_unregister_backlight Hans de Goede
2014-05-19 23:30 ` joeyli [this message]
2014-05-17 8:48 ` [PATCH v2 3/3] acer-wmi: Add Aspire 5741 to video_vendor_dmi_table Hans de Goede
2014-05-19 23:31 ` joeyli
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=20140519233003.GA2038@linux-rxt1.site \
--to=jlee@suse.com \
--cc=aaron.lu@intel.com \
--cc=hdegoede@redhat.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=matthew.garrett@nebula.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rjw@rjwysocki.net \
/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