From: Thomas Renninger <trenn@suse.de>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Len Brown <lenb@kernel.org>,
ibm-acpi-devel@lists.sourceforge.net, linux-acpi@vger.kernel.org,
Matthew Garrett <mjg59@srcf.ucam.org>
Subject: Re: [PATCH 3/4] ACPI: thinkpad-acpi: disable backlight handler if ACPI generic could do it
Date: Tue, 09 Oct 2007 08:21:14 +0200 [thread overview]
Message-ID: <1191910875.9847.79.camel@queen.suse.de> (raw)
In-Reply-To: <1191849179-24087-4-git-send-email-hmh@hmh.eng.br>
On Mon, 2007-10-08 at 10:12 -0300, Henrique de Moraes Holschuh wrote:
> If we detect the presence of _BCL on a Lenovo ThinkPad, it means there is
> support for ACPI standard backlight brightness control. In that case, it
> is probably best to not make the ThinkPad-specific backlight interface
> available.
>
> Provide a Kconfig option (default disabled) to make the ThinkPad-specific
> backlight always available, even if there is generic ACPI backlight
> support in the DSDT.
IMO a config variable that compiles out brightness control totally makes
more sense (and video, is there any functionality in ThinkPad acpi
driver that does not get supported by the video driver?).
Thomas
>
> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> Cc: Matthew Garrett <mjg59@srcf.ucam.org>
> ---
> Documentation/thinkpad-acpi.txt | 5 ++++-
> drivers/misc/Kconfig | 17 +++++++++++++++++
> drivers/misc/thinkpad_acpi.c | 20 ++++++++++++++++++++
> 3 files changed, 41 insertions(+), 1 deletions(-)
>
> diff --git a/Documentation/thinkpad-acpi.txt b/Documentation/thinkpad-acpi.txt
> index 4db98b3..7ff0183 100644
> --- a/Documentation/thinkpad-acpi.txt
> +++ b/Documentation/thinkpad-acpi.txt
> @@ -942,7 +942,10 @@ and CMOS. The driver tries to autodetect which interface to use.
>
> When display backlight brightness controls are available through the
> standard ACPI interface, it is best to use it instead of this direct
> -ThinkPad-specific interface.
> +ThinkPad-specific interface. In that case, the driver will not export
> +the ThinkPad-specific interface by default, although this can be changed
> +at compile time, using the CONFIG_THINKPAD_ACPI_BACKLIGHT_DESIRED
> +Kconfig option.
>
> Procfs notes:
>
> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> index 73e248f..bd8504a 100644
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -177,6 +177,23 @@ config THINKPAD_ACPI_DEBUG
>
> If you are not sure, say N here.
>
> +config THINKPAD_ACPI_BACKLIGHT_DESIRED
> + bool "Always load backlight support"
> + depends on THINKPAD_ACPI
> + default n
> + ---help---
> + By default, if the ThinkPad supports the standard ACPI display
> + brightness control, the thinkpad-specific backlight support will
> + not be loaded. This avoids duplicate backlight interfaces
> + controlling the same LCD, as the ACPI video driver will also publish
> + a backlight interface to control the display brightness.
> +
> + However, if you prefer to always have the thinkpad-specific backlight
> + device available, even when it will just be a duplicate of the
> + standard ACPI backlight device, say Y here.
> +
> + If you are not sure, say N here.
> +
> config THINKPAD_ACPI_DOCK
> bool "Legacy Docking Station Support"
> depends on THINKPAD_ACPI
> diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
> index 2a573db..29f521b 100644
> --- a/drivers/misc/thinkpad_acpi.c
> +++ b/drivers/misc/thinkpad_acpi.c
> @@ -3114,6 +3114,10 @@ static struct backlight_ops ibm_backlight_data = {
>
> static struct mutex brightness_mutex;
>
> +#ifndef CONFIG_THINKPAD_ACPI_BACKLIGHT_DESIRED
> +static int brightness_acpi_detected __initdata;
> +#endif
> +
> static int __init tpacpi_query_bcl_levels(acpi_handle handle)
> {
> struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
> @@ -3147,6 +3151,9 @@ static acpi_status __init brightness_find_bcl(acpi_handle handle, u32 lvl,
>
> if (ACPI_SUCCESS(acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer)) &&
> !strncmp("_BCL", name, sizeof(name) - 1)) {
> +#ifndef CONFIG_THINKPAD_ACPI_BACKLIGHT_DESIRED
> + brightness_acpi_detected = 1;
> +#endif
> if (tpacpi_query_bcl_levels(handle) == 16) {
> *rv = handle;
> return AE_CTRL_TERMINATE;
> @@ -3197,10 +3204,23 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
> if (brightness_mode > 3)
> return -EINVAL;
>
> +#ifndef CONFIG_THINKPAD_ACPI_BACKLIGHT_DESIRED
> + brightness_acpi_detected = 0;
> +#endif
> +
> tp_features.bright_16levels =
> thinkpad_id.vendor == PCI_VENDOR_ID_LENOVO &&
> brightness_check_levels();
>
> +#ifndef CONFIG_THINKPAD_ACPI_BACKLIGHT_DESIRED
> + if (brightness_acpi_detected) {
> + dbg_printk(TPACPI_DBG_INIT,
> + "ACPI standard backlight brightness control "
> + "available, aborting...\n");
> + return 1;
> + }
> +#endif
> +
> b = brightness_get(NULL);
> if (b < 0)
> return 1;
> --
> 1.5.3.2
next prev parent reply other threads:[~2007-10-09 6:21 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-08 13:12 [GIT PATCH v2] thinkpad-acpi changes for the merge window (part 2) Henrique de Moraes Holschuh
2007-10-08 13:12 ` [PATCH 2/4] ACPI: thinkpad-acpi: support 16 levels of brightness (v2) Henrique de Moraes Holschuh
2007-10-09 5:16 ` [ibm-acpi-devel] " Thomas Renninger
[not found] ` <1191907013.9847.69.camel-X8wR35IVlAxolqkO4TVVkw@public.gmane.org>
2007-10-09 11:45 ` Henrique de Moraes Holschuh
[not found] ` <1191849179-24087-1-git-send-email-hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
2007-10-08 13:12 ` [PATCH 1/4] ACPI: thinkpad-acpi: skip blanks before the data when parsing sysfs Henrique de Moraes Holschuh
2007-10-08 13:12 ` [PATCH 3/4] ACPI: thinkpad-acpi: disable backlight handler if ACPI generic could do it Henrique de Moraes Holschuh
2007-10-09 6:21 ` Thomas Renninger [this message]
[not found] ` <1191910875.9847.79.camel-X8wR35IVlAxolqkO4TVVkw@public.gmane.org>
2007-10-09 7:59 ` Matthew Garrett
2007-10-09 8:25 ` Thomas Renninger
2007-10-09 8:33 ` Matthew Garrett
2007-10-09 9:46 ` Thomas Renninger
2007-10-09 10:04 ` Matthew Garrett
2007-10-09 11:14 ` Henrique de Moraes Holschuh
2007-10-09 13:29 ` Thomas Renninger
2007-10-09 13:34 ` Matthew Garrett
2007-10-09 13:47 ` Thomas Renninger
2007-10-09 13:49 ` Matthew Garrett
2007-10-09 13:47 ` Henrique de Moraes Holschuh
2007-10-09 14:11 ` Thomas Renninger
2007-10-09 14:29 ` Henrique de Moraes Holschuh
2007-10-09 20:53 ` How to distinguish between general ACPI video driver module and brightness/display providing vendor specific ACPI modules Thomas Renninger
2007-10-10 11:44 ` [ibm-acpi-devel] " Thomas Renninger
2007-10-10 20:46 ` Henrique de Moraes Holschuh
2007-10-10 21:23 ` Henrique de Moraes Holschuh
2007-10-08 13:12 ` [PATCH 4/4] ACPI: thinkpad-acpi: bump up version to 0.17 Henrique de Moraes Holschuh
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=1191910875.9847.79.camel@queen.suse.de \
--to=trenn@suse.de \
--cc=hmh@hmh.eng.br \
--cc=ibm-acpi-devel@lists.sourceforge.net \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=mjg59@srcf.ucam.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.