aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/asus-laptop.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform/x86/asus-laptop.c')
-rw-r--r--drivers/platform/x86/asus-laptop.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index 791fcf321506..db5f7db2ba33 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -639,12 +639,16 @@ static int asus_backlight_init(struct asus_laptop *asus)
639{ 639{
640 struct backlight_device *bd; 640 struct backlight_device *bd;
641 struct device *dev = &asus->platform_device->dev; 641 struct device *dev = &asus->platform_device->dev;
642 struct backlight_properties props;
642 643
643 if (!acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_GET, NULL) && 644 if (!acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_GET, NULL) &&
644 !acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_SET, NULL) && 645 !acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_SET, NULL) &&
645 lcd_switch_handle) { 646 lcd_switch_handle) {
647 memset(&props, 0, sizeof(struct backlight_properties));
648 props.max_brightness = 15;
649
646 bd = backlight_device_register(ASUS_LAPTOP_FILE, dev, 650 bd = backlight_device_register(ASUS_LAPTOP_FILE, dev,
647 asus, &asusbl_ops); 651 asus, &asusbl_ops, &props);
648 if (IS_ERR(bd)) { 652 if (IS_ERR(bd)) {
649 pr_err("Could not register asus backlight device\n"); 653 pr_err("Could not register asus backlight device\n");
650 asus->backlight_device = NULL; 654 asus->backlight_device = NULL;
@@ -653,7 +657,6 @@ static int asus_backlight_init(struct asus_laptop *asus)
653 657
654 asus->backlight_device = bd; 658 asus->backlight_device = bd;
655 659
656 bd->props.max_brightness = 15;
657 bd->props.power = FB_BLANK_UNBLANK; 660 bd->props.power = FB_BLANK_UNBLANK;
658 bd->props.brightness = asus_read_brightness(bd); 661 bd->props.brightness = asus_read_brightness(bd);
659 backlight_update_status(bd); 662 backlight_update_status(bd);