All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: dri-devel@lists.freedesktop.org
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Subject: [PATCH v3 23/35] drm: omapdrm: Move DISPC_CLK_SWITCH reg feature to struct dss_features
Date: Sat,  5 Aug 2017 01:44:07 +0300	[thread overview]
Message-ID: <20170804224419.30758-24-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20170804224419.30758-1-laurent.pinchart@ideasonboard.com>

The register belongs to the DSS, move the feature to the dss_features
structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/omapdrm/dss/dss.c          | 15 +++++++++++----
 drivers/gpu/drm/omapdrm/dss/dss.h          |  5 +++++
 drivers/gpu/drm/omapdrm/dss/dss_features.c | 10 ----------
 drivers/gpu/drm/omapdrm/dss/dss_features.h |  1 -
 4 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
index 3d6b1e8ec0c0..d145d9eedfa7 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -86,6 +86,7 @@ struct dss_features {
 	const enum omap_display_type *ports;
 	int num_ports;
 	const struct dss_ops *ops;
+	struct dss_reg_field dispc_clk_switch;
 };
 
 static struct {
@@ -427,7 +428,6 @@ static int dss_get_channel_index(enum omap_channel channel)
 static void dss_select_dispc_clk_source(enum dss_clk_source clk_src)
 {
 	int b;
-	u8 start, end;
 
 	/*
 	 * We always use PRCM clock as the DISPC func clock, except on DSS3,
@@ -452,9 +452,9 @@ static void dss_select_dispc_clk_source(enum dss_clk_source clk_src)
 		return;
 	}
 
-	dss_feat_get_reg_field(FEAT_REG_DISPC_CLK_SWITCH, &start, &end);
-
-	REG_FLD_MOD(DSS_CONTROL, b, start, end);	/* DISPC_CLK_SWITCH */
+	REG_FLD_MOD(DSS_CONTROL, b,			/* DISPC_CLK_SWITCH */
+		    dss.feat->dispc_clk_switch.start,
+		    dss.feat->dispc_clk_switch.end);
 
 	dss.dispc_clk_source = clk_src;
 }
@@ -1010,6 +1010,7 @@ static const struct dss_features omap24xx_dss_feats = {
 	.ports			=	omap2plus_ports,
 	.num_ports		=	ARRAY_SIZE(omap2plus_ports),
 	.ops			=	&dss_ops_omap2_omap3,
+	.dispc_clk_switch	=	{ 0, 0 },
 };
 
 static const struct dss_features omap34xx_dss_feats = {
@@ -1020,6 +1021,7 @@ static const struct dss_features omap34xx_dss_feats = {
 	.ports			=	omap34xx_ports,
 	.num_ports		=	ARRAY_SIZE(omap34xx_ports),
 	.ops			=	&dss_ops_omap2_omap3,
+	.dispc_clk_switch	=	{ 0, 0 },
 };
 
 static const struct dss_features omap3630_dss_feats = {
@@ -1030,6 +1032,7 @@ static const struct dss_features omap3630_dss_feats = {
 	.ports			=	omap2plus_ports,
 	.num_ports		=	ARRAY_SIZE(omap2plus_ports),
 	.ops			=	&dss_ops_omap2_omap3,
+	.dispc_clk_switch	=	{ 0, 0 },
 };
 
 static const struct dss_features omap44xx_dss_feats = {
@@ -1040,6 +1043,7 @@ static const struct dss_features omap44xx_dss_feats = {
 	.ports			=	omap2plus_ports,
 	.num_ports		=	ARRAY_SIZE(omap2plus_ports),
 	.ops			=	&dss_ops_omap4,
+	.dispc_clk_switch	=	{ 9, 8 },
 };
 
 static const struct dss_features omap54xx_dss_feats = {
@@ -1050,6 +1054,7 @@ static const struct dss_features omap54xx_dss_feats = {
 	.ports			=	omap2plus_ports,
 	.num_ports		=	ARRAY_SIZE(omap2plus_ports),
 	.ops			=	&dss_ops_omap5,
+	.dispc_clk_switch	=	{ 9, 7 },
 };
 
 static const struct dss_features am43xx_dss_feats = {
@@ -1060,6 +1065,7 @@ static const struct dss_features am43xx_dss_feats = {
 	.ports			=	omap2plus_ports,
 	.num_ports		=	ARRAY_SIZE(omap2plus_ports),
 	.ops			=	&dss_ops_omap2_omap3,
+	.dispc_clk_switch	=	{ 0, 0 },
 };
 
 static const struct dss_features dra7xx_dss_feats = {
@@ -1070,6 +1076,7 @@ static const struct dss_features dra7xx_dss_feats = {
 	.ports			=	dra7xx_ports,
 	.num_ports		=	ARRAY_SIZE(dra7xx_ports),
 	.ops			=	&dss_ops_dra7,
+	.dispc_clk_switch	=	{ 9, 7 },
 };
 
 static int dss_init_ports(struct platform_device *pdev)
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.h b/drivers/gpu/drm/omapdrm/dss/dss.h
index b7ce0eacdd0e..ac642607321e 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.h
+++ b/drivers/gpu/drm/omapdrm/dss/dss.h
@@ -200,6 +200,11 @@ struct dss_pll {
 	struct dss_pll_clock_info cinfo;
 };
 
+/* Defines a generic omap register field */
+struct dss_reg_field {
+	u8 start, end;
+};
+
 struct dispc_clock_info {
 	/* rates that we get with dividers below */
 	unsigned long lck;
diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.c b/drivers/gpu/drm/omapdrm/dss/dss_features.c
index faa9bc3c03b2..04848196780e 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss_features.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss_features.c
@@ -28,11 +28,6 @@
 #include "dss.h"
 #include "dss_features.h"
 
-/* Defines a generic omap register field */
-struct dss_reg_field {
-	u8 start, end;
-};
-
 struct dss_param_range {
 	int min, max;
 };
@@ -59,7 +54,6 @@ static const struct dss_reg_field omap2_dss_reg_fields[] = {
 	[FEAT_REG_FIFOSIZE]			= { 8, 0 },
 	[FEAT_REG_HORIZONTALACCU]		= { 9, 0 },
 	[FEAT_REG_VERTICALACCU]			= { 25, 16 },
-	[FEAT_REG_DISPC_CLK_SWITCH]		= { 0, 0 },
 };
 
 static const struct dss_reg_field omap3_dss_reg_fields[] = {
@@ -70,7 +64,6 @@ static const struct dss_reg_field omap3_dss_reg_fields[] = {
 	[FEAT_REG_FIFOSIZE]			= { 10, 0 },
 	[FEAT_REG_HORIZONTALACCU]		= { 9, 0 },
 	[FEAT_REG_VERTICALACCU]			= { 25, 16 },
-	[FEAT_REG_DISPC_CLK_SWITCH]		= { 0, 0 },
 };
 
 static const struct dss_reg_field am43xx_dss_reg_fields[] = {
@@ -81,7 +74,6 @@ static const struct dss_reg_field am43xx_dss_reg_fields[] = {
 	[FEAT_REG_FIFOSIZE]		= { 10, 0 },
 	[FEAT_REG_HORIZONTALACCU]		= { 9, 0 },
 	[FEAT_REG_VERTICALACCU]			= { 25, 16 },
-	[FEAT_REG_DISPC_CLK_SWITCH]		= { 0, 0 },
 };
 
 static const struct dss_reg_field omap4_dss_reg_fields[] = {
@@ -92,7 +84,6 @@ static const struct dss_reg_field omap4_dss_reg_fields[] = {
 	[FEAT_REG_FIFOSIZE]			= { 15, 0 },
 	[FEAT_REG_HORIZONTALACCU]		= { 10, 0 },
 	[FEAT_REG_VERTICALACCU]			= { 26, 16 },
-	[FEAT_REG_DISPC_CLK_SWITCH]		= { 9, 8 },
 };
 
 static const struct dss_reg_field omap5_dss_reg_fields[] = {
@@ -103,7 +94,6 @@ static const struct dss_reg_field omap5_dss_reg_fields[] = {
 	[FEAT_REG_FIFOSIZE]			= { 15, 0 },
 	[FEAT_REG_HORIZONTALACCU]		= { 10, 0 },
 	[FEAT_REG_VERTICALACCU]			= { 26, 16 },
-	[FEAT_REG_DISPC_CLK_SWITCH]		= { 9, 7 },
 };
 
 static const enum omap_dss_output_id omap2_dss_supported_outputs[] = {
diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.h b/drivers/gpu/drm/omapdrm/dss/dss_features.h
index 89a36d2b57a7..e0e825db4b0a 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss_features.h
+++ b/drivers/gpu/drm/omapdrm/dss/dss_features.h
@@ -73,7 +73,6 @@ enum dss_feat_reg_field {
 	FEAT_REG_FIFOSIZE,
 	FEAT_REG_HORIZONTALACCU,
 	FEAT_REG_VERTICALACCU,
-	FEAT_REG_DISPC_CLK_SWITCH,
 };
 
 enum dss_range_param {
-- 
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-08-04 22:44 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-04 22:43 [PATCH v3 00/35] omapdrm: Deconstruct DSS features Laurent Pinchart
2017-08-04 22:43 ` [PATCH v3 01/35] ARM: OMAP2+: Register SoC device attributes from machine .init() Laurent Pinchart
2017-08-09 12:56   ` Tomi Valkeinen
2017-08-09 21:49     ` Tony Lindgren
2017-08-04 22:43 ` [PATCH v3 02/35] drm: omapdrm: acx565akm: Remove unneeded check for OF node Laurent Pinchart
2017-08-04 22:43 ` [PATCH v3 03/35] drm: omapdrm: connector-analog-tv: " Laurent Pinchart
2017-08-04 22:43 ` [PATCH v3 04/35] drm: omapdrm: panel-dpi: " Laurent Pinchart
2017-08-04 22:43 ` [PATCH v3 05/35] drm: omapdrm: dpi: Remove unneeded regulator check Laurent Pinchart
2017-08-04 22:43 ` [PATCH v3 06/35] drm: omapdrm: venc: Don't export omap_dss_pal_vm and omap_dss_ntsc_vm Laurent Pinchart
2017-08-04 22:43 ` [PATCH v3 07/35] drm: omapdrm: hdmi: Store PHY features in PHY data structure Laurent Pinchart
2017-08-04 22:43 ` [PATCH v3 08/35] drm: omapdrm: dss: Split operations out of dss_features structure Laurent Pinchart
2017-08-04 22:43 ` [PATCH v3 09/35] drm: omapdrm: dsi: Handle pin muxing internally Laurent Pinchart
2017-08-04 22:43 ` [PATCH v3 10/35] drm: omapdrm: Don't forward set_min_bus_tput() to no-op platform code Laurent Pinchart
2017-08-04 22:43 ` [PATCH v3 11/35] drm: omapdrm: dispc: Select features based on compatible string Laurent Pinchart
2017-08-04 22:43 ` [PATCH v3 12/35] drm: omapdrm: dpi: Replace OMAP SoC model checks with DSS model Laurent Pinchart
2017-08-04 22:43 ` [PATCH v3 13/35] drm: omapdrm: dsi: Store DSI model and PLL hardware data in OF data Laurent Pinchart
2017-08-04 22:43 ` [PATCH v3 14/35] drm: omapdrm: dss: Select features based on compatible string Laurent Pinchart
2017-08-04 22:43 ` [PATCH v3 15/35] drm: omapdrm: dss: Use supported outputs instead of display types Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 16/35] drm: omapdrm: dss: Initialize DSS internal features at probe time Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 17/35] drm: omapdrm: Move all debugfs code from core to dss Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 18/35] drm: omapdrm: Move shutdown() handler " Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 19/35] drm: omapdrm: Move size unit features to dispc_features structure Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 20/35] drm: omapdrm: Move color modes feature " Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 21/35] drm: omapdrm: Move overlay caps features " Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 22/35] drm: omapdrm: Move num_ovls and num_mgrs " Laurent Pinchart
2017-08-04 22:44 ` Laurent Pinchart [this message]
2017-08-04 22:44 ` [PATCH v3 24/35] drm: omapdrm: Move reg_fields " Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 25/35] drm: omapdrm: Move FEAT_VENC_REQUIRES_TV_DAC_CLK to venc driver Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 26/35] drm: omapdrm: Move FEAT_DSI_* features to dsi driver Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 27/35] drm: omapdrm: Move FEAT_HDMI_* features to hdmi4 driver Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 28/35] drm: omapdrm: Move FEAT_DPI_USES_VDDS_DSI feature to dpi code Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 29/35] drm: omapdrm: Move FEAT_LCD_CLK_SRC feature to dss_features structure Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 30/35] drm: omapdrm: Move FEAT_* features to dispc driver Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 31/35] drm: omapdrm: Move FEAT_PARAM_DSI* features to dsi driver Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 32/35] drm: omapdrm: Move PCD, LINEWIDTH and DOWNSCALE features to dispc driver Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 33/35] drm: omapdrm: Move DSS_FCK feature to dss driver Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 34/35] drm: omapdrm: Move supported outputs " Laurent Pinchart
2017-08-04 22:44 ` [PATCH v3 35/35] drm: omapdrm: Remove dss_features.h Laurent Pinchart
2017-08-04 22:49 ` [PATCH v3 00/35] omapdrm: Deconstruct DSS features Laurent Pinchart
2017-08-08 12:56 ` Tomi Valkeinen
2017-08-08 13:02   ` Laurent Pinchart
2017-08-08 13:04     ` Tomi Valkeinen
2017-08-08 13:15       ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170804224419.30758-24-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.