From: Mattia Dongili <malattia@linux.it>
To: Corentin Chary <corentin.chary@gmail.com>
Cc: Len Brown <lenb@kernel.org>,
Matthew Garrett <mjg59@srcf.ucam.org>,
linux-acpi@vger.kernel.org, platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/7] acpi: add a way to promote/demote vendor backlight drivers
Date: Wed, 27 Jun 2012 07:19:08 +0900 [thread overview]
Message-ID: <20120626221907.GC26614@kamineko.org> (raw)
In-Reply-To: <1339572727-24744-2-git-send-email-corentin.chary@gmail.com>
Hi Corentin,
On Wed, Jun 13, 2012 at 09:32:01AM +0200, Corentin Chary wrote:
...
> +/* Promote the vendor interface instead of the generic video module.
> + * This function allow DMI blacklists to be implemented by externals
> + * platform drivers instead of putting a big blacklist in video_detect.c
> + * After calling this function you will probably want to call
> + * acpi_video_unregister() to make sure the video module is not loaded
> + */
> +void acpi_video_dmi_promote_vendor(void)
> +{
> + acpi_video_caps_check();
> + acpi_video_support |= ACPI_VIDEO_BACKLIGHT_DMI_VENDOR;
> +}
> +EXPORT_SYMBOL(acpi_video_dmi_promote_vendor);
I think having the promote_vendor() function do the sanity check on the
acpi_backlight parameter and the unregistering of the acpi_video device
may make the code cleaner and more acpi_video-agnostic in the drivers.
I.e. (untested sample code):
bool acpi_video_promote_vendor(void)
{
if (acpi_video_backlight_support())
return false;
acpi_video_support |= ACPI_VIDEO_BACKLIGHT_DMI_VENDOR;
pr_info("Disabling ACPI video driver\n");
acpi_video_unregister();
return true;
}
EXPORT_SYMBOL(acpi_video_promote_vendor);
and in the drivers you do
if (my_drv->broken_acpi_video) {
if (acpi_video_promote_vendor())
do_backlight_init();
} else if (!acpi_video_backlight_support())
do_backlight_init();
or something along these lines.
If you give a boolean parameter to acpi_video_promote_vendor to force
vendor backlight we could make the drivers' code even simpler but that
would change the semantics of the "promotion" to something more of a
"take-over".
PS: I will need to promote backlight control in sony-laptop.ko
eventually as well but I don't have a DMI based list but rather I should
look at a specific handle (or say Method) presence in the SNC Device.
I guess I'm just bothered by the function naming here but not a big
deal. :)
--
mattia
:wq!
next prev parent reply other threads:[~2012-06-26 22:19 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-13 7:32 [PATCH 0/7] platform-drivers-x86: backlight, samsung and asus Corentin Chary
2012-06-13 7:32 ` [PATCH 1/7] acpi: add a way to promote/demote vendor backlight drivers Corentin Chary
2012-06-26 22:19 ` Mattia Dongili [this message]
2012-06-29 12:19 ` Corentin Chary
2012-06-13 7:32 ` [PATCH 2/7] drivers-platform-x86: use acpi_video_dmi_promote_vendor() Corentin Chary
2012-06-14 9:58 ` joeyli
2012-06-14 10:54 ` Corentin Chary
2012-06-14 11:04 ` Corentin Chary
2012-06-14 12:53 ` joeyli
2012-06-14 20:02 ` Seth Forshee
2012-06-13 7:32 ` [PATCH 3/7] samsung-laptop: X360 ACPI backlight device is broken Corentin Chary
2012-06-13 7:32 ` [PATCH 4/7] acpi/video_detect: blacklist samsung x360 Corentin Chary
2012-06-13 7:32 ` [PATCH 5/7] samsung-laptop: support R40/R41 Corentin Chary
2012-06-13 7:32 ` [PATCH 6/7] asus-wmi: control backlight power through WMI, not ACPI Corentin Chary
2012-06-14 11:05 ` Corentin Chary
2012-06-13 7:32 ` [PATCH 7/7] asus-wmi: enable resume on lid open Corentin Chary
2012-06-26 18:42 ` [PATCH 0/7] platform-drivers-x86: backlight, samsung and asus Matthew Garrett
2012-06-29 12:16 ` Corentin Chary
2012-07-16 5:45 ` Corentin Chary
2012-07-23 13:35 ` Matthew Garrett
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=20120626221907.GC26614@kamineko.org \
--to=malattia@linux.it \
--cc=corentin.chary@gmail.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg59@srcf.ucam.org \
--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