diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2007-02-10 10:04:08 -0500 |
---|---|---|
committer | Richard Purdie <rpurdie@rpsys.net> | 2007-02-20 04:26:40 -0500 |
commit | 321709c5994f952b78d567fd7083dbebbdc381b7 (patch) | |
tree | df237c216e8bab6ce5c14d5797a796d4bf889a92 /drivers/misc | |
parent | e0e34ef7f02915cfe50e501e9f32c24217177a96 (diff) |
backlight: Clean up pmac_backlight handling
Move the setting/unsetting of pmac_backlight into the
backlight core instead of doing it in each driver.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/sony-laptop.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index 03d02bd9f122..2ebe240dd537 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c | |||
@@ -384,7 +384,7 @@ static void sony_snc_pf_remove(void) | |||
384 | static int sony_backlight_update_status(struct backlight_device *bd) | 384 | static int sony_backlight_update_status(struct backlight_device *bd) |
385 | { | 385 | { |
386 | return acpi_callsetfunc(sony_acpi_handle, "SBRT", | 386 | return acpi_callsetfunc(sony_acpi_handle, "SBRT", |
387 | bd->props->brightness + 1, NULL); | 387 | bd->props.brightness + 1, NULL); |
388 | } | 388 | } |
389 | 389 | ||
390 | static int sony_backlight_get_brightness(struct backlight_device *bd) | 390 | static int sony_backlight_get_brightness(struct backlight_device *bd) |
@@ -398,10 +398,9 @@ static int sony_backlight_get_brightness(struct backlight_device *bd) | |||
398 | } | 398 | } |
399 | 399 | ||
400 | static struct backlight_device *sony_backlight_device; | 400 | static struct backlight_device *sony_backlight_device; |
401 | static struct backlight_properties sony_backlight_properties = { | 401 | static struct backlight_ops sony_backlight_ops = { |
402 | .update_status = sony_backlight_update_status, | 402 | .update_status = sony_backlight_update_status, |
403 | .get_brightness = sony_backlight_get_brightness, | 403 | .get_brightness = sony_backlight_get_brightness, |
404 | .max_brightness = SONY_MAX_BRIGHTNESS - 1, | ||
405 | }; | 404 | }; |
406 | 405 | ||
407 | /* | 406 | /* |
@@ -483,15 +482,19 @@ static int sony_acpi_add(struct acpi_device *device) | |||
483 | if (ACPI_SUCCESS(acpi_get_handle(sony_acpi_handle, "GBRT", &handle))) { | 482 | if (ACPI_SUCCESS(acpi_get_handle(sony_acpi_handle, "GBRT", &handle))) { |
484 | sony_backlight_device = backlight_device_register("sony", NULL, | 483 | sony_backlight_device = backlight_device_register("sony", NULL, |
485 | NULL, | 484 | NULL, |
486 | &sony_backlight_properties); | 485 | &sony_backlight_ops); |
487 | 486 | ||
488 | if (IS_ERR(sony_backlight_device)) { | 487 | if (IS_ERR(sony_backlight_device)) { |
489 | printk(LOG_PFX "unable to register backlight device\n"); | 488 | printk(LOG_PFX "unable to register backlight device\n"); |
490 | sony_backlight_device = NULL; | 489 | sony_backlight_device = NULL; |
491 | } else | 490 | } else { |
492 | sony_backlight_properties.brightness = | 491 | sony_backlight_device->props.brightness = |
493 | sony_backlight_get_brightness | 492 | sony_backlight_get_brightness |
494 | (sony_backlight_device); | 493 | (sony_backlight_device); |
494 | sony_backlight_device->props.max_brightness = | ||
495 | SONY_MAX_BRIGHTNESS - 1; | ||
496 | } | ||
497 | |||
495 | } | 498 | } |
496 | 499 | ||
497 | if (sony_snc_pf_add()) | 500 | if (sony_snc_pf_add()) |