[PATCH 5/6] i915: Use drm backlight

Marta Lofstedt marta.lofstedt at intel.com
Mon Oct 24 13:08:52 UTC 2016


Use the drm backlight class.

Signed-off-by: Marta Lofstedt <marta.lofstedt at intel.com>
---
 drivers/gpu/drm/i915/intel_panel.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index be4b4d5..0765b4c 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -34,6 +34,7 @@
 #include <linux/moduleparam.h>
 #include <linux/pwm.h>
 #include "intel_drv.h"
+#include <drm/drm_backlight.h>
 
 #define CRC_PMIC_PWM_PERIOD_NS	21333
 
@@ -1720,6 +1721,10 @@ int intel_panel_setup_backlight(struct drm_connector *connector, enum pipe pipe)
 
 	panel->backlight.present = true;
 
+	/* This connector has backlight attached */
+	if (!drm_backlight_alloc(connector))
+	        drm_backlight_set_name(connector->backlight, "intel_backlight");
+
 	DRM_DEBUG_KMS("Connector %s backlight initialized, %s, brightness %u/%u\n",
 		      connector->name,
 		      panel->backlight.enabled ? "enabled" : "disabled",
-- 
2.9.3



More information about the dri-devel mailing list