From a19a6ee6cad2b20292a774c2f56ba8039b0fac9c Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Wed, 17 Feb 2010 16:39:44 -0500 Subject: backlight: Allow properties to be passed at registration Values such as max_brightness should be set before backlights are registered, but the current API doesn't allow that. Add a parameter to backlight_device_register and update drivers to ensure that they set this correctly. Signed-off-by: Matthew Garrett Signed-off-by: Richard Purdie --- drivers/platform/x86/toshiba_acpi.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/platform/x86/toshiba_acpi.c') diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 789240d..def4841 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c @@ -924,6 +924,7 @@ static int __init toshiba_acpi_init(void) u32 hci_result; bool bt_present; int ret = 0; + struct backlight_properties props; if (acpi_disabled) return -ENODEV; @@ -974,10 +975,12 @@ static int __init toshiba_acpi_init(void) } } + props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1; toshiba_backlight_device = backlight_device_register("toshiba", - &toshiba_acpi.p_dev->dev, - NULL, - &toshiba_backlight_data); + &toshiba_acpi.p_dev->dev, + NULL, + &toshiba_backlight_data, + &props); if (IS_ERR(toshiba_backlight_device)) { ret = PTR_ERR(toshiba_backlight_device); @@ -986,7 +989,6 @@ static int __init toshiba_acpi_init(void) toshiba_acpi_exit(); return ret; } - 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) { -- cgit v1.1