From 4569ab757f09b9b6a3dd4eda2b0b37c7f5535e6d Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 5 Aug 2017 01:44:13 +0300 Subject: [PATCH] drm: omapdrm: Move FEAT_LCD_CLK_SRC feature to dss_features structure 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 Signed-off-by: Tomi Valkeinen --- 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(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c index d145d9e..8bb9f8d 100644 --- 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(enum dss_clk_source clk_src) * 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_channel channel, 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_source(int dsi_module) 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 omap24xx_dss_feats = { .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 omap34xx_dss_feats = { .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 omap3630_dss_feats = { .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 omap44xx_dss_feats = { .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 omap54xx_dss_feats = { .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_dss_feats = { .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_dss_feats = { .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) diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.c b/drivers/gpu/drm/omapdrm/dss/dss_features.c index 69da2f3..24870c1 100644 --- 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_dss_feat_list[] = { 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_es1_0_dss_feat_list[] = { 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_es2_0_1_2_dss_feat_list[] = { 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_list[] = { FEAT_MGR_LCD2, FEAT_MGR_LCD3, FEAT_CORE_CLK_DIV, - FEAT_LCD_CLK_SRC, FEAT_HANDLE_UV_SEPARATE, FEAT_ATTR2, FEAT_CPR, diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.h b/drivers/gpu/drm/omapdrm/dss/dss_features.h index 5c66587..0f0bd09 100644 --- 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, -- 2.7.4