[PATCH] toshiba_acpi: fingers off backlight if video.ko is serving this functionality

Andrey Borzenkov
2008-11-08T13:37:50Z

[-- Attachment #1: Type: text/plain, Size: 1683 bytes --]

Subject: [PATCH] toshiba_acpi: fingers off backlight if video.ko is serving this functionality
From: Andrey Borzenkov <arvidjaar@mail.ru>

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>

---

This completes backlight series; toshiba_acpi was missing.

drivers/acpi/toshiba_acpi.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
index a7db0c2..c140709 100644
--- a/drivers/acpi/toshiba_acpi.c
+++ b/drivers/acpi/toshiba_acpi.c
@@ -780,19 +780,20 @@ static int __init toshiba_acpi_init(void)
}
}

- toshiba_backlight_device = backlight_device_register("toshiba",
+ if (!acpi_video_backlight_support()) {
+ toshiba_backlight_device = backlight_device_register("toshiba",
&toshiba_acpi.p_dev->dev,
NULL,
&toshiba_backlight_data);
- if (IS_ERR(toshiba_backlight_device)) {
- ret = PTR_ERR(toshiba_backlight_device);
-
- printk(KERN_ERR "Could not register toshiba backlight device\n");
- toshiba_backlight_device = NULL;
- toshiba_acpi_exit();
- return ret;
+ if (IS_ERR(toshiba_backlight_device)) {
+ ret = PTR_ERR(toshiba_backlight_device);
+ printk(KERN_ERR "Could not register toshiba backlight device\n");
+ toshiba_backlight_device = NULL;
+ toshiba_acpi_exit();
+ return ret;
+ }
+ toshiba_backlight_device->props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1;
}
- toshiba_backlight_device->props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1;

/* Register rfkill switch for Bluetooth */
if (hci_get_bt_present(&bt_present) == HCI_SUCCESS && bt_present) {

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]