diff options
Diffstat (limited to 'drivers/misc/asus-laptop.c')
-rw-r--r-- | drivers/misc/asus-laptop.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c index e4e2b707a353..295e931c0dfb 100644 --- a/drivers/misc/asus-laptop.c +++ b/drivers/misc/asus-laptop.c | |||
@@ -195,11 +195,9 @@ static struct backlight_device *asus_backlight_device; | |||
195 | */ | 195 | */ |
196 | static int read_brightness(struct backlight_device *bd); | 196 | static int read_brightness(struct backlight_device *bd); |
197 | static int update_bl_status(struct backlight_device *bd); | 197 | static int update_bl_status(struct backlight_device *bd); |
198 | static struct backlight_properties asusbl_data = { | 198 | static struct backlight_ops asusbl_ops = { |
199 | .owner = THIS_MODULE, | ||
200 | .get_brightness = read_brightness, | 199 | .get_brightness = read_brightness, |
201 | .update_status = update_bl_status, | 200 | .update_status = update_bl_status, |
202 | .max_brightness = 15, | ||
203 | }; | 201 | }; |
204 | 202 | ||
205 | /* These functions actually update the LED's, and are called from a | 203 | /* These functions actually update the LED's, and are called from a |
@@ -349,13 +347,8 @@ static void lcd_blank(int blank) | |||
349 | struct backlight_device *bd = asus_backlight_device; | 347 | struct backlight_device *bd = asus_backlight_device; |
350 | 348 | ||
351 | if (bd) { | 349 | if (bd) { |
352 | down(&bd->sem); | 350 | bd->props.power = blank; |
353 | if (likely(bd->props)) { | 351 | backlight_update_status(bd); |
354 | bd->props->power = blank; | ||
355 | if (likely(bd->props->update_status)) | ||
356 | bd->props->update_status(bd); | ||
357 | } | ||
358 | up(&bd->sem); | ||
359 | } | 352 | } |
360 | } | 353 | } |
361 | 354 | ||
@@ -387,13 +380,13 @@ static int set_brightness(struct backlight_device *bd, int value) | |||
387 | static int update_bl_status(struct backlight_device *bd) | 380 | static int update_bl_status(struct backlight_device *bd) |
388 | { | 381 | { |
389 | int rv; | 382 | int rv; |
390 | int value = bd->props->brightness; | 383 | int value = bd->props.brightness; |
391 | 384 | ||
392 | rv = set_brightness(bd, value); | 385 | rv = set_brightness(bd, value); |
393 | if (rv) | 386 | if (rv) |
394 | return rv; | 387 | return rv; |
395 | 388 | ||
396 | value = (bd->props->power == FB_BLANK_UNBLANK) ? 1 : 0; | 389 | value = (bd->props.power == FB_BLANK_UNBLANK) ? 1 : 0; |
397 | return set_lcd_state(value); | 390 | return set_lcd_state(value); |
398 | } | 391 | } |
399 | 392 | ||
@@ -1019,7 +1012,7 @@ static int asus_backlight_init(struct device *dev) | |||
1019 | 1012 | ||
1020 | if (brightness_set_handle && lcd_switch_handle) { | 1013 | if (brightness_set_handle && lcd_switch_handle) { |
1021 | bd = backlight_device_register(ASUS_HOTK_FILE, dev, | 1014 | bd = backlight_device_register(ASUS_HOTK_FILE, dev, |
1022 | NULL, &asusbl_data); | 1015 | NULL, &asusbl_ops); |
1023 | if (IS_ERR(bd)) { | 1016 | if (IS_ERR(bd)) { |
1024 | printk(ASUS_ERR | 1017 | printk(ASUS_ERR |
1025 | "Could not register asus backlight device\n"); | 1018 | "Could not register asus backlight device\n"); |
@@ -1029,14 +1022,10 @@ static int asus_backlight_init(struct device *dev) | |||
1029 | 1022 | ||
1030 | asus_backlight_device = bd; | 1023 | asus_backlight_device = bd; |
1031 | 1024 | ||
1032 | down(&bd->sem); | 1025 | bd->props.max_brightness = 15; |
1033 | if (likely(bd->props)) { | 1026 | bd->props.brightness = read_brightness(NULL); |
1034 | bd->props->brightness = read_brightness(NULL); | 1027 | bd->props.power = FB_BLANK_UNBLANK; |
1035 | bd->props->power = FB_BLANK_UNBLANK; | 1028 | backlight_update_status(bd); |
1036 | if (likely(bd->props->update_status)) | ||
1037 | bd->props->update_status(bd); | ||
1038 | } | ||
1039 | up(&bd->sem); | ||
1040 | } | 1029 | } |
1041 | return 0; | 1030 | return 0; |
1042 | } | 1031 | } |