From: Len Brown <lenb@kernel.org>
To: Zhang Rui <rui.zhang@intel.com>
Cc: linux-acpi <linux-acpi@vger.kernel.org>, linux-gfx@linux.intel.com
Subject: Re: [PATCH 1/4] ACPI: video: introduce new flag for enabling/disabling ACPI video actions upon brightness switch notifications
Date: Fri, 1 Feb 2008 22:55:00 -0500 [thread overview]
Message-ID: <200802012255.00391.lenb@kernel.org> (raw)
In-Reply-To: <1201243669.4663.17.camel@acpi-sony.sh.intel.com>
Applied.
thanks,
-Len
On Friday 25 January 2008 01:47, Zhang Rui wrote:
> From: Zhang Rui <rui.zhang@intel.com>
>
> Introduce new module parameter for brightness control.
> "brightness_switch_enabled" is set by default which means
> nothing changes upon brightness switch events.
> When "brightness_switch_enabled" is cleared via
> "echo 0 > /sys/module/video/parameters/brightness_switch_enabled",
> ACPI will not try to change the brightness level any more.
> Either X will take charge of this or users can change the brightness level
> by poking /sys/class/backlight/acpi_videoX/...
>
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
> drivers/acpi/video.c | 18 +++++++++++++-----
> 1 file changed, 13 insertions(+), 5 deletions(-)
>
> Index: linux-2.6/drivers/acpi/video.c
> ===================================================================
> --- linux-2.6.orig/drivers/acpi/video.c
> +++ linux-2.6/drivers/acpi/video.c
> @@ -72,6 +72,9 @@ MODULE_AUTHOR("Bruno Ducrot");
> MODULE_DESCRIPTION("ACPI Video Driver");
> MODULE_LICENSE("GPL");
>
> +static int brightness_switch_enabled = 1;
> +module_param(brightness_switch_enabled, bool, 0644);
> +
> static int acpi_video_bus_add(struct acpi_device *device);
> static int acpi_video_bus_remove(struct acpi_device *device, int type);
>
> @@ -1850,27 +1853,32 @@ static void acpi_video_device_notify(acp
>
> switch (event) {
> case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS: /* Cycle brightness */
> - acpi_video_switch_brightness(video_device, event);
> + if (brightness_switch_enabled)
> + acpi_video_switch_brightness(video_device, event);
> acpi_bus_generate_proc_event(device, event, 0);
> keycode = KEY_BRIGHTNESS_CYCLE;
> break;
> case ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS: /* Increase brightness */
> - acpi_video_switch_brightness(video_device, event);
> + if (brightness_switch_enabled)
> + acpi_video_switch_brightness(video_device, event);
> acpi_bus_generate_proc_event(device, event, 0);
> keycode = KEY_BRIGHTNESSUP;
> break;
> case ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS: /* Decrease brightness */
> - acpi_video_switch_brightness(video_device, event);
> + if (brightness_switch_enabled)
> + acpi_video_switch_brightness(video_device, event);
> acpi_bus_generate_proc_event(device, event, 0);
> keycode = KEY_BRIGHTNESSDOWN;
> break;
> case ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS: /* zero brightnesss */
> - acpi_video_switch_brightness(video_device, event);
> + if (brightness_switch_enabled)
> + acpi_video_switch_brightness(video_device, event);
> acpi_bus_generate_proc_event(device, event, 0);
> keycode = KEY_BRIGHTNESS_ZERO;
> break;
> case ACPI_VIDEO_NOTIFY_DISPLAY_OFF: /* display device off */
> - acpi_video_switch_brightness(video_device, event);
> + if (brightness_switch_enabled)
> + acpi_video_switch_brightness(video_device, event);
> acpi_bus_generate_proc_event(device, event, 0);
> keycode = KEY_DISPLAY_OFF;
> break;
>
>
prev parent reply other threads:[~2008-02-02 3:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-25 6:47 [PATCH 1/4] ACPI: video: introduce new flag for enabling/disabling ACPI video actions upon brightness switch notifications Zhang Rui
2008-02-02 3:55 ` Len Brown [this message]
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=200802012255.00391.lenb@kernel.org \
--to=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-gfx@linux.intel.com \
--cc=rui.zhang@intel.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 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.