* [PATCH RFT] fujitsu-laptop: Simplify SBLL/SBL2 backlight handling
@ 2009-01-05 21:11 Tony Vroon
2009-01-05 22:10 ` Jonathan Woithe
2009-01-07 7:31 ` nokos
0 siblings, 2 replies; 5+ messages in thread
From: Tony Vroon @ 2009-01-05 21:11 UTC (permalink / raw)
To: Peter Gruber; +Cc: Jonathan Woithe, Stephen Gildea, Julian Brown, linux-acpi
GBLS and GBLL only differ in the clearing of the GHKS flag, so there is no need
to have two backlight level readouts. Also, per Peter Gruber, the need for the
BLNF check has disappeared.
As a result, cleanups can be made in the code. This is tested on the S6420
platform and causes no functionality regressions, on the console without X or
within X. One module parameter to disable the hotkeys is dropped, I would like
to instead depend on ACPI_VIDEO.
(Awaiting Tested-by from Peter for the S6410)
Signed-off-by: Tony Vroon <tony@linx.net>
--- linux-2.6/drivers/misc/fujitsu-laptop.c.upstream 2009-01-05 20:34:42.000000000 +0000
+++ linux-2.6/drivers/misc/fujitsu-laptop.c 2009-01-05 20:59:36.000000000 +0000
@@ -155,7 +155,6 @@
static struct fujitsu_t *fujitsu;
static int use_alt_lcd_levels = -1;
-static int disable_brightness_keys = -1;
static int disable_brightness_adjust = -1;
/* Device used to access other hotkeys on the laptop */
@@ -413,36 +412,11 @@
return fujitsu->max_brightness;
}
-static int get_lcd_level_alt(void)
-{
- unsigned long long state = 0;
- acpi_status status = AE_OK;
-
- vdbg_printk(FUJLAPTOP_DBG_TRACE, "get lcd level via GBLS\n");
-
- status =
- acpi_evaluate_integer(fujitsu->acpi_handle, "GBLS", NULL, &state);
- if (status < 0)
- return status;
-
- fujitsu->brightness_level = state & 0x0fffffff;
-
- if (state & 0x80000000)
- fujitsu->brightness_changed = 1;
- else
- fujitsu->brightness_changed = 0;
-
- return fujitsu->brightness_level;
-}
-
/* Backlight device stuff */
static int bl_get_brightness(struct backlight_device *b)
{
- if (use_alt_lcd_levels)
- return get_lcd_level_alt();
- else
- return get_lcd_level();
+ return get_lcd_level();
}
static int bl_update_status(struct backlight_device *b)
@@ -509,10 +483,7 @@
int ret;
- if (use_alt_lcd_levels)
- ret = get_lcd_level_alt();
- else
- ret = get_lcd_level();
+ ret = get_lcd_level();
if (ret < 0)
return ret;
@@ -537,10 +508,7 @@
if (ret < 0)
return ret;
- if (use_alt_lcd_levels)
- ret = get_lcd_level_alt();
- else
- ret = get_lcd_level();
+ ret = get_lcd_level();
if (ret < 0)
return ret;
@@ -622,24 +590,16 @@
static void dmi_check_cb_common(const struct dmi_system_id *id)
{
acpi_handle handle;
- int have_blnf;
printk(KERN_INFO "fujitsu-laptop: Identified laptop model '%s'.\n",
id->ident);
- have_blnf = ACPI_SUCCESS
- (acpi_get_handle(NULL, "\\_SB.PCI0.GFX0.LCD.BLNF", &handle));
if (use_alt_lcd_levels == -1) {
- vdbg_printk(FUJLAPTOP_DBG_TRACE, "auto-detecting usealt\n");
- use_alt_lcd_levels = 1;
- }
- if (disable_brightness_keys == -1) {
- vdbg_printk(FUJLAPTOP_DBG_TRACE,
- "auto-detecting disable_keys\n");
- disable_brightness_keys = have_blnf ? 1 : 0;
- }
- if (disable_brightness_adjust == -1) {
- vdbg_printk(FUJLAPTOP_DBG_TRACE,
- "auto-detecting disable_adjust\n");
- disable_brightness_adjust = have_blnf ? 0 : 1;
+ if (ACPI_SUCCESS(acpi_get_handle(NULL,
+ "\\_SB.PCI0.LPCB.FJEX.SBL2", &handle)))
+ use_alt_lcd_levels = 1;
+ else
+ use_alt_lcd_levels = 0;
+ vdbg_printk(FUJLAPTOP_DBG_TRACE, "auto-detected usealt as "
+ "%i\n", use_alt_lcd_levels);
}
}
@@ -768,19 +728,14 @@
/* do config (detect defaults) */
use_alt_lcd_levels = use_alt_lcd_levels == 1 ? 1 : 0;
- disable_brightness_keys = disable_brightness_keys == 1 ? 1 : 0;
disable_brightness_adjust = disable_brightness_adjust == 1 ? 1 : 0;
vdbg_printk(FUJLAPTOP_DBG_INFO,
- "config: [alt interface: %d], [key disable: %d], [adjust disable: %d]\n",
- use_alt_lcd_levels, disable_brightness_keys,
- disable_brightness_adjust);
+ "config: [alt interface: %d], [adjust disable: %d]\n",
+ use_alt_lcd_levels, disable_brightness_adjust);
if (get_max_brightness() <= 0)
fujitsu->max_brightness = FUJITSU_LCD_N_LEVELS;
- if (use_alt_lcd_levels)
- get_lcd_level_alt();
- else
- get_lcd_level();
+ get_lcd_level();
return result;
@@ -831,43 +786,23 @@
case ACPI_FUJITSU_NOTIFY_CODE1:
keycode = 0;
oldb = fujitsu->brightness_level;
- get_lcd_level(); /* the alt version always yields changed */
+ get_lcd_level();
newb = fujitsu->brightness_level;
vdbg_printk(FUJLAPTOP_DBG_TRACE,
"brightness button event [%i -> %i (%i)]\n",
oldb, newb, fujitsu->brightness_changed);
- if (oldb == newb && fujitsu->brightness_changed) {
- keycode = 0;
- if (disable_brightness_keys != 1) {
- if (oldb == 0) {
- acpi_bus_generate_proc_event
- (fujitsu->dev,
- ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS,
- 0);
- keycode = KEY_BRIGHTNESSDOWN;
- } else if (oldb ==
- (fujitsu->max_brightness) - 1) {
- acpi_bus_generate_proc_event
- (fujitsu->dev,
- ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS,
- 0);
- keycode = KEY_BRIGHTNESSUP;
- }
- }
- } else if (oldb < newb) {
+ if (oldb < newb) {
if (disable_brightness_adjust != 1) {
if (use_alt_lcd_levels)
set_lcd_level_alt(newb);
else
set_lcd_level(newb);
}
- if (disable_brightness_keys != 1) {
- acpi_bus_generate_proc_event(fujitsu->dev,
- ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS, 0);
- keycode = KEY_BRIGHTNESSUP;
- }
+ acpi_bus_generate_proc_event(fujitsu->dev,
+ ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS, 0);
+ keycode = KEY_BRIGHTNESSUP;
} else if (oldb > newb) {
if (disable_brightness_adjust != 1) {
if (use_alt_lcd_levels)
@@ -875,13 +810,9 @@
else
set_lcd_level(newb);
}
- if (disable_brightness_keys != 1) {
- acpi_bus_generate_proc_event(fujitsu->dev,
- ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS, 0);
- keycode = KEY_BRIGHTNESSDOWN;
- }
- } else {
- keycode = KEY_UNKNOWN;
+ acpi_bus_generate_proc_event(fujitsu->dev,
+ ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS, 0);
+ keycode = KEY_BRIGHTNESSDOWN;
}
break;
default:
@@ -1336,9 +1267,6 @@
module_param(use_alt_lcd_levels, uint, 0644);
MODULE_PARM_DESC(use_alt_lcd_levels,
"Use alternative interface for lcd_levels (needed for Lifebook s6410).");
-module_param(disable_brightness_keys, uint, 0644);
-MODULE_PARM_DESC(disable_brightness_keys,
- "Disable brightness keys (eg. if they are already handled by the generic ACPI_VIDEO device).");
module_param(disable_brightness_adjust, uint, 0644);
MODULE_PARM_DESC(disable_brightness_adjust, "Disable brightness adjustment .");
#ifdef CONFIG_FUJITSU_LAPTOP_DEBUG
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RFT] fujitsu-laptop: Simplify SBLL/SBL2 backlight handling
2009-01-05 21:11 [PATCH RFT] fujitsu-laptop: Simplify SBLL/SBL2 backlight handling Tony Vroon
@ 2009-01-05 22:10 ` Jonathan Woithe
2009-01-06 21:03 ` Tony Vroon
2009-01-07 7:31 ` nokos
1 sibling, 1 reply; 5+ messages in thread
From: Jonathan Woithe @ 2009-01-05 22:10 UTC (permalink / raw)
To: Tony Vroon
Cc: Peter Gruber, Jonathan Woithe, Stephen Gildea, Julian Brown,
linux-acpi
Hi
On the face of it, this looks OK to me and shouldn't cause any regression on
the S7020 since the modified path doesn't get used by the S7020.
If this tests out OK for Peter (and any others who try it), then:
Acked-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
Regards
jonathan
> GBLS and GBLL only differ in the clearing of the GHKS flag, so there is no need
> to have two backlight level readouts. Also, per Peter Gruber, the need for the
> BLNF check has disappeared.
> As a result, cleanups can be made in the code. This is tested on the S6420
> platform and causes no functionality regressions, on the console without X or
> within X. One module parameter to disable the hotkeys is dropped, I would like
> to instead depend on ACPI_VIDEO.
>
> (Awaiting Tested-by from Peter for the S6410)
>
> Signed-off-by: Tony Vroon <tony@linx.net>
>
> --- linux-2.6/drivers/misc/fujitsu-laptop.c.upstream 2009-01-05 20:34:42.000000000 +0000
> +++ linux-2.6/drivers/misc/fujitsu-laptop.c 2009-01-05 20:59:36.000000000 +0000
> @@ -155,7 +155,6 @@
>
> static struct fujitsu_t *fujitsu;
> static int use_alt_lcd_levels = -1;
> -static int disable_brightness_keys = -1;
> static int disable_brightness_adjust = -1;
>
> /* Device used to access other hotkeys on the laptop */
> @@ -413,36 +412,11 @@
> return fujitsu->max_brightness;
> }
>
> -static int get_lcd_level_alt(void)
> -{
> - unsigned long long state = 0;
> - acpi_status status = AE_OK;
> -
> - vdbg_printk(FUJLAPTOP_DBG_TRACE, "get lcd level via GBLS\n");
> -
> - status =
> - acpi_evaluate_integer(fujitsu->acpi_handle, "GBLS", NULL, &state);
> - if (status < 0)
> - return status;
> -
> - fujitsu->brightness_level = state & 0x0fffffff;
> -
> - if (state & 0x80000000)
> - fujitsu->brightness_changed = 1;
> - else
> - fujitsu->brightness_changed = 0;
> -
> - return fujitsu->brightness_level;
> -}
> -
> /* Backlight device stuff */
>
> static int bl_get_brightness(struct backlight_device *b)
> {
> - if (use_alt_lcd_levels)
> - return get_lcd_level_alt();
> - else
> - return get_lcd_level();
> + return get_lcd_level();
> }
>
> static int bl_update_status(struct backlight_device *b)
> @@ -509,10 +483,7 @@
>
> int ret;
>
> - if (use_alt_lcd_levels)
> - ret = get_lcd_level_alt();
> - else
> - ret = get_lcd_level();
> + ret = get_lcd_level();
> if (ret < 0)
> return ret;
>
> @@ -537,10 +508,7 @@
> if (ret < 0)
> return ret;
>
> - if (use_alt_lcd_levels)
> - ret = get_lcd_level_alt();
> - else
> - ret = get_lcd_level();
> + ret = get_lcd_level();
> if (ret < 0)
> return ret;
>
> @@ -622,24 +590,16 @@
> static void dmi_check_cb_common(const struct dmi_system_id *id)
> {
> acpi_handle handle;
> - int have_blnf;
> printk(KERN_INFO "fujitsu-laptop: Identified laptop model '%s'.\n",
> id->ident);
> - have_blnf = ACPI_SUCCESS
> - (acpi_get_handle(NULL, "\\_SB.PCI0.GFX0.LCD.BLNF", &handle));
> if (use_alt_lcd_levels == -1) {
> - vdbg_printk(FUJLAPTOP_DBG_TRACE, "auto-detecting usealt\n");
> - use_alt_lcd_levels = 1;
> - }
> - if (disable_brightness_keys == -1) {
> - vdbg_printk(FUJLAPTOP_DBG_TRACE,
> - "auto-detecting disable_keys\n");
> - disable_brightness_keys = have_blnf ? 1 : 0;
> - }
> - if (disable_brightness_adjust == -1) {
> - vdbg_printk(FUJLAPTOP_DBG_TRACE,
> - "auto-detecting disable_adjust\n");
> - disable_brightness_adjust = have_blnf ? 0 : 1;
> + if (ACPI_SUCCESS(acpi_get_handle(NULL,
> + "\\_SB.PCI0.LPCB.FJEX.SBL2", &handle)))
> + use_alt_lcd_levels = 1;
> + else
> + use_alt_lcd_levels = 0;
> + vdbg_printk(FUJLAPTOP_DBG_TRACE, "auto-detected usealt as "
> + "%i\n", use_alt_lcd_levels);
> }
> }
>
> @@ -768,19 +728,14 @@
>
> /* do config (detect defaults) */
> use_alt_lcd_levels = use_alt_lcd_levels == 1 ? 1 : 0;
> - disable_brightness_keys = disable_brightness_keys == 1 ? 1 : 0;
> disable_brightness_adjust = disable_brightness_adjust == 1 ? 1 : 0;
> vdbg_printk(FUJLAPTOP_DBG_INFO,
> - "config: [alt interface: %d], [key disable: %d], [adjust disable: %d]\n",
> - use_alt_lcd_levels, disable_brightness_keys,
> - disable_brightness_adjust);
> + "config: [alt interface: %d], [adjust disable: %d]\n",
> + use_alt_lcd_levels, disable_brightness_adjust);
>
> if (get_max_brightness() <= 0)
> fujitsu->max_brightness = FUJITSU_LCD_N_LEVELS;
> - if (use_alt_lcd_levels)
> - get_lcd_level_alt();
> - else
> - get_lcd_level();
> + get_lcd_level();
>
> return result;
>
> @@ -831,43 +786,23 @@
> case ACPI_FUJITSU_NOTIFY_CODE1:
> keycode = 0;
> oldb = fujitsu->brightness_level;
> - get_lcd_level(); /* the alt version always yields changed */
> + get_lcd_level();
> newb = fujitsu->brightness_level;
>
> vdbg_printk(FUJLAPTOP_DBG_TRACE,
> "brightness button event [%i -> %i (%i)]\n",
> oldb, newb, fujitsu->brightness_changed);
>
> - if (oldb == newb && fujitsu->brightness_changed) {
> - keycode = 0;
> - if (disable_brightness_keys != 1) {
> - if (oldb == 0) {
> - acpi_bus_generate_proc_event
> - (fujitsu->dev,
> - ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS,
> - 0);
> - keycode = KEY_BRIGHTNESSDOWN;
> - } else if (oldb ==
> - (fujitsu->max_brightness) - 1) {
> - acpi_bus_generate_proc_event
> - (fujitsu->dev,
> - ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS,
> - 0);
> - keycode = KEY_BRIGHTNESSUP;
> - }
> - }
> - } else if (oldb < newb) {
> + if (oldb < newb) {
> if (disable_brightness_adjust != 1) {
> if (use_alt_lcd_levels)
> set_lcd_level_alt(newb);
> else
> set_lcd_level(newb);
> }
> - if (disable_brightness_keys != 1) {
> - acpi_bus_generate_proc_event(fujitsu->dev,
> - ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS, 0);
> - keycode = KEY_BRIGHTNESSUP;
> - }
> + acpi_bus_generate_proc_event(fujitsu->dev,
> + ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS, 0);
> + keycode = KEY_BRIGHTNESSUP;
> } else if (oldb > newb) {
> if (disable_brightness_adjust != 1) {
> if (use_alt_lcd_levels)
> @@ -875,13 +810,9 @@
> else
> set_lcd_level(newb);
> }
> - if (disable_brightness_keys != 1) {
> - acpi_bus_generate_proc_event(fujitsu->dev,
> - ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS, 0);
> - keycode = KEY_BRIGHTNESSDOWN;
> - }
> - } else {
> - keycode = KEY_UNKNOWN;
> + acpi_bus_generate_proc_event(fujitsu->dev,
> + ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS, 0);
> + keycode = KEY_BRIGHTNESSDOWN;
> }
> break;
> default:
> @@ -1336,9 +1267,6 @@
> module_param(use_alt_lcd_levels, uint, 0644);
> MODULE_PARM_DESC(use_alt_lcd_levels,
> "Use alternative interface for lcd_levels (needed for Lifebook s6410).");
> -module_param(disable_brightness_keys, uint, 0644);
> -MODULE_PARM_DESC(disable_brightness_keys,
> - "Disable brightness keys (eg. if they are already handled by the generic ACPI_VIDEO device).");
> module_param(disable_brightness_adjust, uint, 0644);
> MODULE_PARM_DESC(disable_brightness_adjust, "Disable brightness adjustment .");
> #ifdef CONFIG_FUJITSU_LAPTOP_DEBUG
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RFT] fujitsu-laptop: Simplify SBLL/SBL2 backlight handling
2009-01-05 22:10 ` Jonathan Woithe
@ 2009-01-06 21:03 ` Tony Vroon
2009-01-08 2:26 ` Stephen Gildea
0 siblings, 1 reply; 5+ messages in thread
From: Tony Vroon @ 2009-01-06 21:03 UTC (permalink / raw)
To: Jonathan Woithe; +Cc: Peter Gruber, Stephen Gildea, Julian Brown, linux-acpi
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jonathan Woithe wrote:
> If this tests out OK for Peter (and any others who try it), then:
>
> Acked-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
Thanks Jonathan.
Stephen, Julian, although this should not affect your platform at all...
If either of you could test it and confirm that with a Tested-By tag for
U810 or P8010, that'd be brilliant.
> Regards
> jonathan
Regards,
Tony V.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkljxxsACgkQp5vW4rUFj5p5WgCePKfrvTfxeDAQcKTLW+/RB/b3
BDoAn1MScvEG+vp7akzZ88Zw87dsRJ6B
=c5Gv
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RFT] fujitsu-laptop: Simplify SBLL/SBL2 backlight handling
2009-01-05 21:11 [PATCH RFT] fujitsu-laptop: Simplify SBLL/SBL2 backlight handling Tony Vroon
2009-01-05 22:10 ` Jonathan Woithe
@ 2009-01-07 7:31 ` nokos
1 sibling, 0 replies; 5+ messages in thread
From: nokos @ 2009-01-07 7:31 UTC (permalink / raw)
To: Tony Vroon; +Cc: Jonathan Woithe, Stephen Gildea, Julian Brown, linux-acpi
Hi
it works as expected
Tested-by: Peter Gruber <nokos@gmx.net>
Am Montag, den 05.01.2009, 21:11 +0000 schrieb Tony Vroon:
> GBLS and GBLL only differ in the clearing of the GHKS flag, so there is no need
> to have two backlight level readouts. Also, per Peter Gruber, the need for the
> BLNF check has disappeared.
> As a result, cleanups can be made in the code. This is tested on the S6420
> platform and causes no functionality regressions, on the console without X or
> within X. One module parameter to disable the hotkeys is dropped, I would like
> to instead depend on ACPI_VIDEO.
>
> (Awaiting Tested-by from Peter for the S6410)
>
> Signed-off-by: Tony Vroon <tony@linx.net>
>
> --- linux-2.6/drivers/misc/fujitsu-laptop.c.upstream 2009-01-05 20:34:42.000000000 +0000
> +++ linux-2.6/drivers/misc/fujitsu-laptop.c 2009-01-05 20:59:36.000000000 +0000
> @@ -155,7 +155,6 @@
>
> static struct fujitsu_t *fujitsu;
> static int use_alt_lcd_levels = -1;
> -static int disable_brightness_keys = -1;
> static int disable_brightness_adjust = -1;
>
> /* Device used to access other hotkeys on the laptop */
> @@ -413,36 +412,11 @@
> return fujitsu->max_brightness;
> }
>
> -static int get_lcd_level_alt(void)
> -{
> - unsigned long long state = 0;
> - acpi_status status = AE_OK;
> -
> - vdbg_printk(FUJLAPTOP_DBG_TRACE, "get lcd level via GBLS\n");
> -
> - status =
> - acpi_evaluate_integer(fujitsu->acpi_handle, "GBLS", NULL, &state);
> - if (status < 0)
> - return status;
> -
> - fujitsu->brightness_level = state & 0x0fffffff;
> -
> - if (state & 0x80000000)
> - fujitsu->brightness_changed = 1;
> - else
> - fujitsu->brightness_changed = 0;
> -
> - return fujitsu->brightness_level;
> -}
> -
> /* Backlight device stuff */
>
> static int bl_get_brightness(struct backlight_device *b)
> {
> - if (use_alt_lcd_levels)
> - return get_lcd_level_alt();
> - else
> - return get_lcd_level();
> + return get_lcd_level();
> }
>
> static int bl_update_status(struct backlight_device *b)
> @@ -509,10 +483,7 @@
>
> int ret;
>
> - if (use_alt_lcd_levels)
> - ret = get_lcd_level_alt();
> - else
> - ret = get_lcd_level();
> + ret = get_lcd_level();
> if (ret < 0)
> return ret;
>
> @@ -537,10 +508,7 @@
> if (ret < 0)
> return ret;
>
> - if (use_alt_lcd_levels)
> - ret = get_lcd_level_alt();
> - else
> - ret = get_lcd_level();
> + ret = get_lcd_level();
> if (ret < 0)
> return ret;
>
> @@ -622,24 +590,16 @@
> static void dmi_check_cb_common(const struct dmi_system_id *id)
> {
> acpi_handle handle;
> - int have_blnf;
> printk(KERN_INFO "fujitsu-laptop: Identified laptop model '%s'.\n",
> id->ident);
> - have_blnf = ACPI_SUCCESS
> - (acpi_get_handle(NULL, "\\_SB.PCI0.GFX0.LCD.BLNF", &handle));
> if (use_alt_lcd_levels == -1) {
> - vdbg_printk(FUJLAPTOP_DBG_TRACE, "auto-detecting usealt\n");
> - use_alt_lcd_levels = 1;
> - }
> - if (disable_brightness_keys == -1) {
> - vdbg_printk(FUJLAPTOP_DBG_TRACE,
> - "auto-detecting disable_keys\n");
> - disable_brightness_keys = have_blnf ? 1 : 0;
> - }
> - if (disable_brightness_adjust == -1) {
> - vdbg_printk(FUJLAPTOP_DBG_TRACE,
> - "auto-detecting disable_adjust\n");
> - disable_brightness_adjust = have_blnf ? 0 : 1;
> + if (ACPI_SUCCESS(acpi_get_handle(NULL,
> + "\\_SB.PCI0.LPCB.FJEX.SBL2", &handle)))
> + use_alt_lcd_levels = 1;
> + else
> + use_alt_lcd_levels = 0;
> + vdbg_printk(FUJLAPTOP_DBG_TRACE, "auto-detected usealt as "
> + "%i\n", use_alt_lcd_levels);
> }
> }
>
> @@ -768,19 +728,14 @@
>
> /* do config (detect defaults) */
> use_alt_lcd_levels = use_alt_lcd_levels == 1 ? 1 : 0;
> - disable_brightness_keys = disable_brightness_keys == 1 ? 1 : 0;
> disable_brightness_adjust = disable_brightness_adjust == 1 ? 1 : 0;
> vdbg_printk(FUJLAPTOP_DBG_INFO,
> - "config: [alt interface: %d], [key disable: %d], [adjust disable: %d]\n",
> - use_alt_lcd_levels, disable_brightness_keys,
> - disable_brightness_adjust);
> + "config: [alt interface: %d], [adjust disable: %d]\n",
> + use_alt_lcd_levels, disable_brightness_adjust);
>
> if (get_max_brightness() <= 0)
> fujitsu->max_brightness = FUJITSU_LCD_N_LEVELS;
> - if (use_alt_lcd_levels)
> - get_lcd_level_alt();
> - else
> - get_lcd_level();
> + get_lcd_level();
>
> return result;
>
> @@ -831,43 +786,23 @@
> case ACPI_FUJITSU_NOTIFY_CODE1:
> keycode = 0;
> oldb = fujitsu->brightness_level;
> - get_lcd_level(); /* the alt version always yields changed */
> + get_lcd_level();
> newb = fujitsu->brightness_level;
>
> vdbg_printk(FUJLAPTOP_DBG_TRACE,
> "brightness button event [%i -> %i (%i)]\n",
> oldb, newb, fujitsu->brightness_changed);
>
> - if (oldb == newb && fujitsu->brightness_changed) {
> - keycode = 0;
> - if (disable_brightness_keys != 1) {
> - if (oldb == 0) {
> - acpi_bus_generate_proc_event
> - (fujitsu->dev,
> - ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS,
> - 0);
> - keycode = KEY_BRIGHTNESSDOWN;
> - } else if (oldb ==
> - (fujitsu->max_brightness) - 1) {
> - acpi_bus_generate_proc_event
> - (fujitsu->dev,
> - ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS,
> - 0);
> - keycode = KEY_BRIGHTNESSUP;
> - }
> - }
> - } else if (oldb < newb) {
> + if (oldb < newb) {
> if (disable_brightness_adjust != 1) {
> if (use_alt_lcd_levels)
> set_lcd_level_alt(newb);
> else
> set_lcd_level(newb);
> }
> - if (disable_brightness_keys != 1) {
> - acpi_bus_generate_proc_event(fujitsu->dev,
> - ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS, 0);
> - keycode = KEY_BRIGHTNESSUP;
> - }
> + acpi_bus_generate_proc_event(fujitsu->dev,
> + ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS, 0);
> + keycode = KEY_BRIGHTNESSUP;
> } else if (oldb > newb) {
> if (disable_brightness_adjust != 1) {
> if (use_alt_lcd_levels)
> @@ -875,13 +810,9 @@
> else
> set_lcd_level(newb);
> }
> - if (disable_brightness_keys != 1) {
> - acpi_bus_generate_proc_event(fujitsu->dev,
> - ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS, 0);
> - keycode = KEY_BRIGHTNESSDOWN;
> - }
> - } else {
> - keycode = KEY_UNKNOWN;
> + acpi_bus_generate_proc_event(fujitsu->dev,
> + ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS, 0);
> + keycode = KEY_BRIGHTNESSDOWN;
> }
> break;
> default:
> @@ -1336,9 +1267,6 @@
> module_param(use_alt_lcd_levels, uint, 0644);
> MODULE_PARM_DESC(use_alt_lcd_levels,
> "Use alternative interface for lcd_levels (needed for Lifebook s6410).");
> -module_param(disable_brightness_keys, uint, 0644);
> -MODULE_PARM_DESC(disable_brightness_keys,
> - "Disable brightness keys (eg. if they are already handled by the generic ACPI_VIDEO device).");
> module_param(disable_brightness_adjust, uint, 0644);
> MODULE_PARM_DESC(disable_brightness_adjust, "Disable brightness adjustment .");
> #ifdef CONFIG_FUJITSU_LAPTOP_DEBUG
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RFT] fujitsu-laptop: Simplify SBLL/SBL2 backlight handling
2009-01-06 21:03 ` Tony Vroon
@ 2009-01-08 2:26 ` Stephen Gildea
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Gildea @ 2009-01-08 2:26 UTC (permalink / raw)
To: tony; +Cc: Jonathan Woithe, Peter Gruber, Julian Brown, linux-acpi
> Stephen, Julian, although this should not affect your platform at all...
> If either of you could test it and confirm that with a Tested-By tag for
> U810 or P8010, that'd be brilliant.
Still works for me on the P8010.
Tested-By: Stephen Gildea <stepheng+linux@gildea.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-01-08 2:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-05 21:11 [PATCH RFT] fujitsu-laptop: Simplify SBLL/SBL2 backlight handling Tony Vroon
2009-01-05 22:10 ` Jonathan Woithe
2009-01-06 21:03 ` Tony Vroon
2009-01-08 2:26 ` Stephen Gildea
2009-01-07 7:31 ` nokos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox