Blob Blame History Raw
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: Sat, 5 Aug 2017 01:44:13 +0300
Subject: drm: omapdrm: Move FEAT_LCD_CLK_SRC feature to dss_features structure
Git-commit: 4569ab757f09b9b6a3dd4eda2b0b37c7f5535e6d
Patch-mainline: v4.14-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166

The FEAT_LCD_CLK_SRC feature is specific to the DSS, move it from the
omap_dss_features structure to the dss_features structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
 drivers/gpu/drm/omapdrm/dss/dss.c          |   15 +++++++++++----
 drivers/gpu/drm/omapdrm/dss/dss_features.c |    4 ----
 drivers/gpu/drm/omapdrm/dss/dss_features.h |    1 -
 3 files changed, 11 insertions(+), 9 deletions(-)

--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -87,6 +87,7 @@ struct dss_features {
 	int num_ports;
 	const struct dss_ops *ops;
 	struct dss_reg_field dispc_clk_switch;
+	bool has_lcd_clk_src;
 };
 
 static struct {
@@ -433,8 +434,7 @@ static void dss_select_dispc_clk_source(
 	 * We always use PRCM clock as the DISPC func clock, except on DSS3,
 	 * where we don't have separate DISPC and LCD clock sources.
 	 */
-	if (WARN_ON(dss_has_feature(FEAT_LCD_CLK_SRC) &&
-		clk_src != DSS_CLK_SRC_FCK))
+	if (WARN_ON(dss.feat->has_lcd_clk_src && clk_src != DSS_CLK_SRC_FCK))
 		return;
 
 	switch (clk_src) {
@@ -578,7 +578,7 @@ void dss_select_lcd_clk_source(enum omap
 	int idx = dss_get_channel_index(channel);
 	int r;
 
-	if (!dss_has_feature(FEAT_LCD_CLK_SRC)) {
+	if (!dss.feat->has_lcd_clk_src) {
 		dss_select_dispc_clk_source(clk_src);
 		dss.lcd_clk_source[idx] = clk_src;
 		return;
@@ -603,7 +603,7 @@ enum dss_clk_source dss_get_dsi_clk_sour
 
 enum dss_clk_source dss_get_lcd_clk_source(enum omap_channel channel)
 {
-	if (dss_has_feature(FEAT_LCD_CLK_SRC)) {
+	if (dss.feat->has_lcd_clk_src) {
 		int idx = dss_get_channel_index(channel);
 		return dss.lcd_clk_source[idx];
 	} else {
@@ -1011,6 +1011,7 @@ static const struct dss_features omap24x
 	.num_ports		=	ARRAY_SIZE(omap2plus_ports),
 	.ops			=	&dss_ops_omap2_omap3,
 	.dispc_clk_switch	=	{ 0, 0 },
+	.has_lcd_clk_src	=	false,
 };
 
 static const struct dss_features omap34xx_dss_feats = {
@@ -1022,6 +1023,7 @@ static const struct dss_features omap34x
 	.num_ports		=	ARRAY_SIZE(omap34xx_ports),
 	.ops			=	&dss_ops_omap2_omap3,
 	.dispc_clk_switch	=	{ 0, 0 },
+	.has_lcd_clk_src	=	false,
 };
 
 static const struct dss_features omap3630_dss_feats = {
@@ -1033,6 +1035,7 @@ static const struct dss_features omap363
 	.num_ports		=	ARRAY_SIZE(omap2plus_ports),
 	.ops			=	&dss_ops_omap2_omap3,
 	.dispc_clk_switch	=	{ 0, 0 },
+	.has_lcd_clk_src	=	false,
 };
 
 static const struct dss_features omap44xx_dss_feats = {
@@ -1044,6 +1047,7 @@ static const struct dss_features omap44x
 	.num_ports		=	ARRAY_SIZE(omap2plus_ports),
 	.ops			=	&dss_ops_omap4,
 	.dispc_clk_switch	=	{ 9, 8 },
+	.has_lcd_clk_src	=	true,
 };
 
 static const struct dss_features omap54xx_dss_feats = {
@@ -1055,6 +1059,7 @@ static const struct dss_features omap54x
 	.num_ports		=	ARRAY_SIZE(omap2plus_ports),
 	.ops			=	&dss_ops_omap5,
 	.dispc_clk_switch	=	{ 9, 7 },
+	.has_lcd_clk_src	=	true,
 };
 
 static const struct dss_features am43xx_dss_feats = {
@@ -1066,6 +1071,7 @@ static const struct dss_features am43xx_
 	.num_ports		=	ARRAY_SIZE(omap2plus_ports),
 	.ops			=	&dss_ops_omap2_omap3,
 	.dispc_clk_switch	=	{ 0, 0 },
+	.has_lcd_clk_src	=	true,
 };
 
 static const struct dss_features dra7xx_dss_feats = {
@@ -1077,6 +1083,7 @@ static const struct dss_features dra7xx_
 	.num_ports		=	ARRAY_SIZE(dra7xx_ports),
 	.ops			=	&dss_ops_dra7,
 	.dispc_clk_switch	=	{ 9, 7 },
+	.has_lcd_clk_src	=	true,
 };
 
 static int dss_init_ports(struct platform_device *pdev)
--- a/drivers/gpu/drm/omapdrm/dss/dss_features.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss_features.c
@@ -223,7 +223,6 @@ static const enum dss_feat_id omap3630_d
 static const enum dss_feat_id omap4430_es1_0_dss_feat_list[] = {
 	FEAT_MGR_LCD2,
 	FEAT_CORE_CLK_DIV,
-	FEAT_LCD_CLK_SRC,
 	FEAT_HANDLE_UV_SEPARATE,
 	FEAT_ATTR2,
 	FEAT_CPR,
@@ -237,7 +236,6 @@ static const enum dss_feat_id omap4430_e
 static const enum dss_feat_id omap4430_es2_0_1_2_dss_feat_list[] = {
 	FEAT_MGR_LCD2,
 	FEAT_CORE_CLK_DIV,
-	FEAT_LCD_CLK_SRC,
 	FEAT_HANDLE_UV_SEPARATE,
 	FEAT_ATTR2,
 	FEAT_CPR,
@@ -251,7 +249,6 @@ static const enum dss_feat_id omap4430_e
 static const enum dss_feat_id omap4_dss_feat_list[] = {
 	FEAT_MGR_LCD2,
 	FEAT_CORE_CLK_DIV,
-	FEAT_LCD_CLK_SRC,
 	FEAT_HANDLE_UV_SEPARATE,
 	FEAT_ATTR2,
 	FEAT_CPR,
@@ -266,7 +263,6 @@ static const enum dss_feat_id omap5_dss_
 	FEAT_MGR_LCD2,
 	FEAT_MGR_LCD3,
 	FEAT_CORE_CLK_DIV,
-	FEAT_LCD_CLK_SRC,
 	FEAT_HANDLE_UV_SEPARATE,
 	FEAT_ATTR2,
 	FEAT_CPR,
--- a/drivers/gpu/drm/omapdrm/dss/dss_features.h
+++ b/drivers/gpu/drm/omapdrm/dss/dss_features.h
@@ -38,7 +38,6 @@ enum dss_feat_id {
 	FEAT_RESIZECONF,
 	/* Independent core clk divider */
 	FEAT_CORE_CLK_DIV,
-	FEAT_LCD_CLK_SRC,
 	FEAT_HANDLE_UV_SEPARATE,
 	FEAT_ATTR2,
 	FEAT_CPR,