aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2017-08-04 18:44:13 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-08-15 08:18:25 -0400
commit4569ab757f09b9b6a3dd4eda2b0b37c7f5535e6d (patch)
tree089da5b60db9f3e61d8ca6c92680ad0a82537950 /drivers/gpu/drm
parentd178e034d5653edfbd16d0c71eeeed467e33c96f (diff)
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 <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dss.c15
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dss_features.c4
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dss_features.h1
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 d145d9eedfa7..8bb9f8de46f0 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -87,6 +87,7 @@ struct dss_features {
87 int num_ports; 87 int num_ports;
88 const struct dss_ops *ops; 88 const struct dss_ops *ops;
89 struct dss_reg_field dispc_clk_switch; 89 struct dss_reg_field dispc_clk_switch;
90 bool has_lcd_clk_src;
90}; 91};
91 92
92static struct { 93static struct {
@@ -433,8 +434,7 @@ static void dss_select_dispc_clk_source(enum dss_clk_source clk_src)
433 * We always use PRCM clock as the DISPC func clock, except on DSS3, 434 * We always use PRCM clock as the DISPC func clock, except on DSS3,
434 * where we don't have separate DISPC and LCD clock sources. 435 * where we don't have separate DISPC and LCD clock sources.
435 */ 436 */
436 if (WARN_ON(dss_has_feature(FEAT_LCD_CLK_SRC) && 437 if (WARN_ON(dss.feat->has_lcd_clk_src && clk_src != DSS_CLK_SRC_FCK))
437 clk_src != DSS_CLK_SRC_FCK))
438 return; 438 return;
439 439
440 switch (clk_src) { 440 switch (clk_src) {
@@ -578,7 +578,7 @@ void dss_select_lcd_clk_source(enum omap_channel channel,
578 int idx = dss_get_channel_index(channel); 578 int idx = dss_get_channel_index(channel);
579 int r; 579 int r;
580 580
581 if (!dss_has_feature(FEAT_LCD_CLK_SRC)) { 581 if (!dss.feat->has_lcd_clk_src) {
582 dss_select_dispc_clk_source(clk_src); 582 dss_select_dispc_clk_source(clk_src);
583 dss.lcd_clk_source[idx] = clk_src; 583 dss.lcd_clk_source[idx] = clk_src;
584 return; 584 return;
@@ -603,7 +603,7 @@ enum dss_clk_source dss_get_dsi_clk_source(int dsi_module)
603 603
604enum dss_clk_source dss_get_lcd_clk_source(enum omap_channel channel) 604enum dss_clk_source dss_get_lcd_clk_source(enum omap_channel channel)
605{ 605{
606 if (dss_has_feature(FEAT_LCD_CLK_SRC)) { 606 if (dss.feat->has_lcd_clk_src) {
607 int idx = dss_get_channel_index(channel); 607 int idx = dss_get_channel_index(channel);
608 return dss.lcd_clk_source[idx]; 608 return dss.lcd_clk_source[idx];
609 } else { 609 } else {
@@ -1011,6 +1011,7 @@ static const struct dss_features omap24xx_dss_feats = {
1011 .num_ports = ARRAY_SIZE(omap2plus_ports), 1011 .num_ports = ARRAY_SIZE(omap2plus_ports),
1012 .ops = &dss_ops_omap2_omap3, 1012 .ops = &dss_ops_omap2_omap3,
1013 .dispc_clk_switch = { 0, 0 }, 1013 .dispc_clk_switch = { 0, 0 },
1014 .has_lcd_clk_src = false,
1014}; 1015};
1015 1016
1016static const struct dss_features omap34xx_dss_feats = { 1017static const struct dss_features omap34xx_dss_feats = {
@@ -1022,6 +1023,7 @@ static const struct dss_features omap34xx_dss_feats = {
1022 .num_ports = ARRAY_SIZE(omap34xx_ports), 1023 .num_ports = ARRAY_SIZE(omap34xx_ports),
1023 .ops = &dss_ops_omap2_omap3, 1024 .ops = &dss_ops_omap2_omap3,
1024 .dispc_clk_switch = { 0, 0 }, 1025 .dispc_clk_switch = { 0, 0 },
1026 .has_lcd_clk_src = false,
1025}; 1027};
1026 1028
1027static const struct dss_features omap3630_dss_feats = { 1029static const struct dss_features omap3630_dss_feats = {
@@ -1033,6 +1035,7 @@ static const struct dss_features omap3630_dss_feats = {
1033 .num_ports = ARRAY_SIZE(omap2plus_ports), 1035 .num_ports = ARRAY_SIZE(omap2plus_ports),
1034 .ops = &dss_ops_omap2_omap3, 1036 .ops = &dss_ops_omap2_omap3,
1035 .dispc_clk_switch = { 0, 0 }, 1037 .dispc_clk_switch = { 0, 0 },
1038 .has_lcd_clk_src = false,
1036}; 1039};
1037 1040
1038static const struct dss_features omap44xx_dss_feats = { 1041static const struct dss_features omap44xx_dss_feats = {
@@ -1044,6 +1047,7 @@ static const struct dss_features omap44xx_dss_feats = {
1044 .num_ports = ARRAY_SIZE(omap2plus_ports), 1047 .num_ports = ARRAY_SIZE(omap2plus_ports),
1045 .ops = &dss_ops_omap4, 1048 .ops = &dss_ops_omap4,
1046 .dispc_clk_switch = { 9, 8 }, 1049 .dispc_clk_switch = { 9, 8 },
1050 .has_lcd_clk_src = true,
1047}; 1051};
1048 1052
1049static const struct dss_features omap54xx_dss_feats = { 1053static const struct dss_features omap54xx_dss_feats = {
@@ -1055,6 +1059,7 @@ static const struct dss_features omap54xx_dss_feats = {
1055 .num_ports = ARRAY_SIZE(omap2plus_ports), 1059 .num_ports = ARRAY_SIZE(omap2plus_ports),
1056 .ops = &dss_ops_omap5, 1060 .ops = &dss_ops_omap5,
1057 .dispc_clk_switch = { 9, 7 }, 1061 .dispc_clk_switch = { 9, 7 },
1062 .has_lcd_clk_src = true,
1058}; 1063};
1059 1064
1060static const struct dss_features am43xx_dss_feats = { 1065static const struct dss_features am43xx_dss_feats = {
@@ -1066,6 +1071,7 @@ static const struct dss_features am43xx_dss_feats = {
1066 .num_ports = ARRAY_SIZE(omap2plus_ports), 1071 .num_ports = ARRAY_SIZE(omap2plus_ports),
1067 .ops = &dss_ops_omap2_omap3, 1072 .ops = &dss_ops_omap2_omap3,
1068 .dispc_clk_switch = { 0, 0 }, 1073 .dispc_clk_switch = { 0, 0 },
1074 .has_lcd_clk_src = true,
1069}; 1075};
1070 1076
1071static const struct dss_features dra7xx_dss_feats = { 1077static const struct dss_features dra7xx_dss_feats = {
@@ -1077,6 +1083,7 @@ static const struct dss_features dra7xx_dss_feats = {
1077 .num_ports = ARRAY_SIZE(dra7xx_ports), 1083 .num_ports = ARRAY_SIZE(dra7xx_ports),
1078 .ops = &dss_ops_dra7, 1084 .ops = &dss_ops_dra7,
1079 .dispc_clk_switch = { 9, 7 }, 1085 .dispc_clk_switch = { 9, 7 },
1086 .has_lcd_clk_src = true,
1080}; 1087};
1081 1088
1082static int dss_init_ports(struct platform_device *pdev) 1089static 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 69da2f3e46f6..24870c1137fe 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[] = {
223static const enum dss_feat_id omap4430_es1_0_dss_feat_list[] = { 223static const enum dss_feat_id omap4430_es1_0_dss_feat_list[] = {
224 FEAT_MGR_LCD2, 224 FEAT_MGR_LCD2,
225 FEAT_CORE_CLK_DIV, 225 FEAT_CORE_CLK_DIV,
226 FEAT_LCD_CLK_SRC,
227 FEAT_HANDLE_UV_SEPARATE, 226 FEAT_HANDLE_UV_SEPARATE,
228 FEAT_ATTR2, 227 FEAT_ATTR2,
229 FEAT_CPR, 228 FEAT_CPR,
@@ -237,7 +236,6 @@ static const enum dss_feat_id omap4430_es1_0_dss_feat_list[] = {
237static const enum dss_feat_id omap4430_es2_0_1_2_dss_feat_list[] = { 236static const enum dss_feat_id omap4430_es2_0_1_2_dss_feat_list[] = {
238 FEAT_MGR_LCD2, 237 FEAT_MGR_LCD2,
239 FEAT_CORE_CLK_DIV, 238 FEAT_CORE_CLK_DIV,
240 FEAT_LCD_CLK_SRC,
241 FEAT_HANDLE_UV_SEPARATE, 239 FEAT_HANDLE_UV_SEPARATE,
242 FEAT_ATTR2, 240 FEAT_ATTR2,
243 FEAT_CPR, 241 FEAT_CPR,
@@ -251,7 +249,6 @@ static const enum dss_feat_id omap4430_es2_0_1_2_dss_feat_list[] = {
251static const enum dss_feat_id omap4_dss_feat_list[] = { 249static const enum dss_feat_id omap4_dss_feat_list[] = {
252 FEAT_MGR_LCD2, 250 FEAT_MGR_LCD2,
253 FEAT_CORE_CLK_DIV, 251 FEAT_CORE_CLK_DIV,
254 FEAT_LCD_CLK_SRC,
255 FEAT_HANDLE_UV_SEPARATE, 252 FEAT_HANDLE_UV_SEPARATE,
256 FEAT_ATTR2, 253 FEAT_ATTR2,
257 FEAT_CPR, 254 FEAT_CPR,
@@ -266,7 +263,6 @@ static const enum dss_feat_id omap5_dss_feat_list[] = {
266 FEAT_MGR_LCD2, 263 FEAT_MGR_LCD2,
267 FEAT_MGR_LCD3, 264 FEAT_MGR_LCD3,
268 FEAT_CORE_CLK_DIV, 265 FEAT_CORE_CLK_DIV,
269 FEAT_LCD_CLK_SRC,
270 FEAT_HANDLE_UV_SEPARATE, 266 FEAT_HANDLE_UV_SEPARATE,
271 FEAT_ATTR2, 267 FEAT_ATTR2,
272 FEAT_CPR, 268 FEAT_CPR,
diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.h b/drivers/gpu/drm/omapdrm/dss/dss_features.h
index 5c6658782dda..0f0bd092e80a 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 {
38 FEAT_RESIZECONF, 38 FEAT_RESIZECONF,
39 /* Independent core clk divider */ 39 /* Independent core clk divider */
40 FEAT_CORE_CLK_DIV, 40 FEAT_CORE_CLK_DIV,
41 FEAT_LCD_CLK_SRC,
42 FEAT_HANDLE_UV_SEPARATE, 41 FEAT_HANDLE_UV_SEPARATE,
43 FEAT_ATTR2, 42 FEAT_ATTR2,
44 FEAT_CPR, 43 FEAT_CPR,