[PATCH 05/19] drm/gma500: Unify *_lvds_encoder_dpms()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



These functions are identical so unify them into one.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@xxxxxxxxx>
---
 drivers/gpu/drm/gma500/cdv_intel_lvds.c | 12 +-----------
 drivers/gpu/drm/gma500/gma_lvds.c       | 11 +++++++++++
 drivers/gpu/drm/gma500/gma_lvds.h       |  1 +
 drivers/gpu/drm/gma500/oaktrail_lvds.c  | 14 +-------------
 drivers/gpu/drm/gma500/psb_intel_lvds.c | 14 +-------------
 5 files changed, 15 insertions(+), 37 deletions(-)

diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
index 968d627e23d1..59d30fa0eb53 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
@@ -53,16 +53,6 @@ struct cdv_intel_lvds_priv {
 	uint32_t saveBLC_PWM_CTL;
 };
 
-static void cdv_intel_lvds_encoder_dpms(struct drm_encoder *encoder, int mode)
-{
-	struct drm_device *dev = encoder->dev;
-	if (mode == DRM_MODE_DPMS_ON)
-		gma_lvds_set_power(dev, true);
-	else
-		gma_lvds_set_power(dev, false);
-	/* XXX: We never power down the LVDS pairs. */
-}
-
 static void cdv_intel_lvds_save(struct drm_connector *connector)
 {
 }
@@ -286,7 +276,7 @@ static int cdv_intel_lvds_set_property(struct drm_connector *connector,
 
 static const struct drm_encoder_helper_funcs
 					cdv_intel_lvds_helper_funcs = {
-	.dpms = cdv_intel_lvds_encoder_dpms,
+	.dpms = gma_lvds_encoder_dpms,
 	.mode_fixup = cdv_intel_lvds_mode_fixup,
 	.prepare = cdv_intel_lvds_prepare,
 	.mode_set = cdv_intel_lvds_mode_set,
diff --git a/drivers/gpu/drm/gma500/gma_lvds.c b/drivers/gpu/drm/gma500/gma_lvds.c
index c36815493366..fb8f8bb599eb 100644
--- a/drivers/gpu/drm/gma500/gma_lvds.c
+++ b/drivers/gpu/drm/gma500/gma_lvds.c
@@ -118,3 +118,14 @@ enum drm_mode_status gma_lvds_mode_valid(struct drm_connector *connector,
 	return MODE_OK;
 }
 
+void gma_lvds_encoder_dpms(struct drm_encoder *encoder, int mode)
+{
+	struct drm_device *dev = encoder->dev;
+
+	if (mode == DRM_MODE_DPMS_ON)
+		gma_lvds_set_power(dev, true);
+	else
+		gma_lvds_set_power(dev, false);
+	/* XXX: We never power down the LVDS pairs. */
+}
+
diff --git a/drivers/gpu/drm/gma500/gma_lvds.h b/drivers/gpu/drm/gma500/gma_lvds.h
index 6b4d8a024da1..3babb522ee84 100644
--- a/drivers/gpu/drm/gma500/gma_lvds.h
+++ b/drivers/gpu/drm/gma500/gma_lvds.h
@@ -11,5 +11,6 @@ u32 gma_lvds_get_max_backlight(struct drm_device *dev);
 void gma_lvds_set_power(struct drm_device *dev, bool on);
 enum drm_mode_status gma_lvds_mode_valid(struct drm_connector *connector,
 					 struct drm_display_mode *mode);
+void gma_lvds_encoder_dpms(struct drm_encoder *encoder, int mode);
 
 #endif
diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds.c b/drivers/gpu/drm/gma500/oaktrail_lvds.c
index 9634807e4d8c..00ec4fea4c12 100644
--- a/drivers/gpu/drm/gma500/oaktrail_lvds.c
+++ b/drivers/gpu/drm/gma500/oaktrail_lvds.c
@@ -30,18 +30,6 @@
 #define MRST_BLC_MAX_PWM_REG_FREQ	    0xFFFF
 #define BRIGHTNESS_MAX_LEVEL 100
 
-static void oaktrail_lvds_dpms(struct drm_encoder *encoder, int mode)
-{
-	struct drm_device *dev = encoder->dev;
-
-	if (mode == DRM_MODE_DPMS_ON)
-		gma_lvds_set_power(dev, true);
-	else
-		gma_lvds_set_power(dev, false);
-
-	/* XXX: We never power down the LVDS pairs. */
-}
-
 static void oaktrail_lvds_mode_set(struct drm_encoder *encoder,
 			       struct drm_display_mode *mode,
 			       struct drm_display_mode *adjusted_mode)
@@ -145,7 +133,7 @@ static void oaktrail_lvds_commit(struct drm_encoder *encoder)
 }
 
 static const struct drm_encoder_helper_funcs oaktrail_lvds_helper_funcs = {
-	.dpms = oaktrail_lvds_dpms,
+	.dpms = gma_lvds_encoder_dpms,
 	.mode_fixup = psb_intel_lvds_mode_fixup,
 	.prepare = oaktrail_lvds_prepare,
 	.mode_set = oaktrail_lvds_mode_set,
diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c
index c88697a805e0..2470ab0e1e0e 100644
--- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
@@ -148,18 +148,6 @@ void psb_intel_lvds_set_brightness(struct drm_device *dev, int level)
 		psb_lvds_pwm_set_brightness(dev, level);
 }
 
-static void psb_intel_lvds_encoder_dpms(struct drm_encoder *encoder, int mode)
-{
-	struct drm_device *dev = encoder->dev;
-
-	if (mode == DRM_MODE_DPMS_ON)
-		gma_lvds_set_power(dev, true);
-	else
-		gma_lvds_set_power(dev, false);
-
-	/* XXX: We never power down the LVDS pairs. */
-}
-
 static void psb_intel_lvds_save(struct drm_connector *connector)
 {
 	struct drm_device *dev = connector->dev;
@@ -471,7 +459,7 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,
 }
 
 static const struct drm_encoder_helper_funcs psb_intel_lvds_helper_funcs = {
-	.dpms = psb_intel_lvds_encoder_dpms,
+	.dpms = gma_lvds_encoder_dpms,
 	.mode_fixup = psb_intel_lvds_mode_fixup,
 	.prepare = psb_intel_lvds_prepare,
 	.mode_set = psb_intel_lvds_mode_set,
-- 
2.36.1




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux