aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm-psb/intel_lvds.c51
1 files changed, 28 insertions, 23 deletions
diff --git a/drivers/gpu/drm-psb/intel_lvds.c b/drivers/gpu/drm-psb/intel_lvds.c
index 218e8957a6d9..6a55c9bb5f1a 100644
--- a/drivers/gpu/drm-psb/intel_lvds.c
+++ b/drivers/gpu/drm-psb/intel_lvds.c
@@ -611,6 +611,33 @@ int intel_get_acpi_dod(char *method)
kfree(buffer.pointer);
return found;
}
+
+static void intel_lvds_backlight_init(struct drm_device *dev)
+{
+ if ((blc_type == BLC_I2C_TYPE) || (blc_type == BLC_PWM_TYPE)){
+ struct backlight_properties props;
+ memset(&props, 0, sizeof(struct backlight_properties));
+ props.type = BACKLIGHT_RAW;
+ /* add /sys/class/backlight interface as standard */
+ psbbl_device = backlight_device_register("psblvds", &dev->pdev->dev, dev, &psbbl_ops, &props);
+ if (psbbl_device){
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20)
+ down(&psbbl_device->sem);
+ psbbl_device->props->max_brightness = BRIGHTNESS_MAX_LEVEL;
+ psbbl_device->props->brightness = lvds_backlight;
+ psbbl_device->props->power = FB_BLANK_UNBLANK;
+ psbbl_device->props->update_status(psbbl_device);
+ up(&psbbl_device->sem);
+#else
+ psbbl_device->props.max_brightness = BRIGHTNESS_MAX_LEVEL;
+ psbbl_device->props.brightness = lvds_backlight;
+ psbbl_device->props.power = FB_BLANK_UNBLANK;
+ backlight_update_status(psbbl_device);
+#endif
+ }
+ }
+}
+
/**
* intel_lvds_init - setup LVDS outputs on this device
* @dev: drm device
@@ -802,29 +829,6 @@ void intel_lvds_init(struct drm_device *dev)
}
}
- if ((blc_type == BLC_I2C_TYPE) || (blc_type == BLC_PWM_TYPE)){
- struct backlight_properties props;
- memset(&props, 0, sizeof(struct backlight_properties));
- props.type = BACKLIGHT_RAW;
- /* add /sys/class/backlight interface as standard */
- psbbl_device = backlight_device_register("psblvds", &dev->pdev->dev, dev, &psbbl_ops, &props);
- if (psbbl_device){
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20)
- down(&psbbl_device->sem);
- psbbl_device->props->max_brightness = BRIGHTNESS_MAX_LEVEL;
- psbbl_device->props->brightness = lvds_backlight;
- psbbl_device->props->power = FB_BLANK_UNBLANK;
- psbbl_device->props->update_status(psbbl_device);
- up(&psbbl_device->sem);
-#else
- psbbl_device->props.max_brightness = BRIGHTNESS_MAX_LEVEL;
- psbbl_device->props.brightness = lvds_backlight;
- psbbl_device->props.power = FB_BLANK_UNBLANK;
- backlight_update_status(psbbl_device);
-#endif
- }
- }
-
blc_out:
/* Set up the DDC bus. */
@@ -939,6 +943,7 @@ blc_out:
#endif
out:
+ intel_lvds_backlight_init(dev);
return;
failed: