All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Subject: [PATCH 01/19] OMAP: DSS2: DSI: Add lane override functions
Date: Tue, 19 Apr 2011 09:22:04 +0000	[thread overview]
Message-ID: <1303204942-25450-2-git-send-email-tomi.valkeinen@ti.com> (raw)
In-Reply-To: <1303204942-25450-1-git-send-email-tomi.valkeinen@ti.com>

DSI_DSIPHY_CFG10 register can be used to override DSI lane state. Add
functions to configure and enable the override, and to disable the
override.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/omap2/dss/dsi.c |   58 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 2666b6b..d245c5c 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -90,6 +90,7 @@ struct dsi_reg { u16 idx; };
 #define DSI_DSIPHY_CFG1			DSI_REG(0x200 + 0x0004)
 #define DSI_DSIPHY_CFG2			DSI_REG(0x200 + 0x0008)
 #define DSI_DSIPHY_CFG5			DSI_REG(0x200 + 0x0014)
+#define DSI_DSIPHY_CFG10		DSI_REG(0x200 + 0x0028)
 
 /* DSI_PLL_CTRL_SCP */
 
@@ -208,6 +209,15 @@ enum dsi_vc_mode {
 	DSI_VC_MODE_VP,
 };
 
+enum dsi_lane {
+	DSI_CLK_P	= 1 << 0,
+	DSI_CLK_N	= 1 << 1,
+	DSI_DATA1_P	= 1 << 2,
+	DSI_DATA1_N	= 1 << 3,
+	DSI_DATA2_P	= 1 << 4,
+	DSI_DATA2_N	= 1 << 5,
+};
+
 struct dsi_update_region {
 	u16 x, y, w, h;
 	struct omap_dss_device *device;
@@ -1863,6 +1873,54 @@ static void dsi_complexio_timings(void)
 	dsi_write_reg(DSI_DSIPHY_CFG2, r);
 }
 
+static void dsi_enable_lane_override(struct omap_dss_device *dssdev,
+		enum dsi_lane lanes)
+{
+	int clk_lane   = dssdev->phy.dsi.clk_lane;
+	int data1_lane = dssdev->phy.dsi.data1_lane;
+	int data2_lane = dssdev->phy.dsi.data2_lane;
+	int clk_pol    = dssdev->phy.dsi.clk_pol;
+	int data1_pol  = dssdev->phy.dsi.data1_pol;
+	int data2_pol  = dssdev->phy.dsi.data2_pol;
+
+	u32 l = 0;
+
+	if (lanes & DSI_CLK_P)
+		l |= 1 << ((clk_lane - 1) * 2 + (clk_pol ? 0 : 1));
+	if (lanes & DSI_CLK_N)
+		l |= 1 << ((clk_lane - 1) * 2 + (clk_pol ? 1 : 0));
+
+	if (lanes & DSI_DATA1_P)
+		l |= 1 << ((data1_lane - 1) * 2 + (data1_pol ? 0 : 1));
+	if (lanes & DSI_DATA1_N)
+		l |= 1 << ((data1_lane - 1) * 2 + (data1_pol ? 1 : 0));
+
+	if (lanes & DSI_DATA2_P)
+		l |= 1 << ((data2_lane - 1) * 2 + (data2_pol ? 0 : 1));
+	if (lanes & DSI_DATA2_N)
+		l |= 1 << ((data2_lane - 1) * 2 + (data2_pol ? 1 : 0));
+
+	/*
+	 * Bits in REGLPTXSCPDAT4TO0DXDY:
+	 * 17: DY0 18: DX0
+	 * 19: DY1 20: DX1
+	 * 21: DY2 22: DX2
+	 */
+
+	/* Set the lane override configuration */
+	REG_FLD_MOD(DSI_DSIPHY_CFG10, l, 22, 17); /* REGLPTXSCPDAT4TO0DXDY */
+
+	/* Enable lane override */
+	REG_FLD_MOD(DSI_DSIPHY_CFG10, 1, 27, 27); /* ENLPTXSCPDAT */
+}
+
+static void dsi_disable_lane_override(void)
+{
+	/* Disable lane override */
+	REG_FLD_MOD(DSI_DSIPHY_CFG10, 0, 27, 27); /* ENLPTXSCPDAT */
+	/* Reset the lane override configuration */
+	REG_FLD_MOD(DSI_DSIPHY_CFG10, 0, 22, 17); /* REGLPTXSCPDAT4TO0DXDY */
+}
 
 static int dsi_complexio_init(struct omap_dss_device *dssdev)
 {
-- 
1.7.1


WARNING: multiple messages have this Message-ID (diff)
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Subject: [PATCH 01/19] OMAP: DSS2: DSI: Add lane override functions
Date: Tue, 19 Apr 2011 12:22:04 +0300	[thread overview]
Message-ID: <1303204942-25450-2-git-send-email-tomi.valkeinen@ti.com> (raw)
In-Reply-To: <1303204942-25450-1-git-send-email-tomi.valkeinen@ti.com>

DSI_DSIPHY_CFG10 register can be used to override DSI lane state. Add
functions to configure and enable the override, and to disable the
override.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/omap2/dss/dsi.c |   58 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 2666b6b..d245c5c 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -90,6 +90,7 @@ struct dsi_reg { u16 idx; };
 #define DSI_DSIPHY_CFG1			DSI_REG(0x200 + 0x0004)
 #define DSI_DSIPHY_CFG2			DSI_REG(0x200 + 0x0008)
 #define DSI_DSIPHY_CFG5			DSI_REG(0x200 + 0x0014)
+#define DSI_DSIPHY_CFG10		DSI_REG(0x200 + 0x0028)
 
 /* DSI_PLL_CTRL_SCP */
 
@@ -208,6 +209,15 @@ enum dsi_vc_mode {
 	DSI_VC_MODE_VP,
 };
 
+enum dsi_lane {
+	DSI_CLK_P	= 1 << 0,
+	DSI_CLK_N	= 1 << 1,
+	DSI_DATA1_P	= 1 << 2,
+	DSI_DATA1_N	= 1 << 3,
+	DSI_DATA2_P	= 1 << 4,
+	DSI_DATA2_N	= 1 << 5,
+};
+
 struct dsi_update_region {
 	u16 x, y, w, h;
 	struct omap_dss_device *device;
@@ -1863,6 +1873,54 @@ static void dsi_complexio_timings(void)
 	dsi_write_reg(DSI_DSIPHY_CFG2, r);
 }
 
+static void dsi_enable_lane_override(struct omap_dss_device *dssdev,
+		enum dsi_lane lanes)
+{
+	int clk_lane   = dssdev->phy.dsi.clk_lane;
+	int data1_lane = dssdev->phy.dsi.data1_lane;
+	int data2_lane = dssdev->phy.dsi.data2_lane;
+	int clk_pol    = dssdev->phy.dsi.clk_pol;
+	int data1_pol  = dssdev->phy.dsi.data1_pol;
+	int data2_pol  = dssdev->phy.dsi.data2_pol;
+
+	u32 l = 0;
+
+	if (lanes & DSI_CLK_P)
+		l |= 1 << ((clk_lane - 1) * 2 + (clk_pol ? 0 : 1));
+	if (lanes & DSI_CLK_N)
+		l |= 1 << ((clk_lane - 1) * 2 + (clk_pol ? 1 : 0));
+
+	if (lanes & DSI_DATA1_P)
+		l |= 1 << ((data1_lane - 1) * 2 + (data1_pol ? 0 : 1));
+	if (lanes & DSI_DATA1_N)
+		l |= 1 << ((data1_lane - 1) * 2 + (data1_pol ? 1 : 0));
+
+	if (lanes & DSI_DATA2_P)
+		l |= 1 << ((data2_lane - 1) * 2 + (data2_pol ? 0 : 1));
+	if (lanes & DSI_DATA2_N)
+		l |= 1 << ((data2_lane - 1) * 2 + (data2_pol ? 1 : 0));
+
+	/*
+	 * Bits in REGLPTXSCPDAT4TO0DXDY:
+	 * 17: DY0 18: DX0
+	 * 19: DY1 20: DX1
+	 * 21: DY2 22: DX2
+	 */
+
+	/* Set the lane override configuration */
+	REG_FLD_MOD(DSI_DSIPHY_CFG10, l, 22, 17); /* REGLPTXSCPDAT4TO0DXDY */
+
+	/* Enable lane override */
+	REG_FLD_MOD(DSI_DSIPHY_CFG10, 1, 27, 27); /* ENLPTXSCPDAT */
+}
+
+static void dsi_disable_lane_override(void)
+{
+	/* Disable lane override */
+	REG_FLD_MOD(DSI_DSIPHY_CFG10, 0, 27, 27); /* ENLPTXSCPDAT */
+	/* Reset the lane override configuration */
+	REG_FLD_MOD(DSI_DSIPHY_CFG10, 0, 22, 17); /* REGLPTXSCPDAT4TO0DXDY */
+}
 
 static int dsi_complexio_init(struct omap_dss_device *dssdev)
 {
-- 
1.7.1


  reply	other threads:[~2011-04-19  9:22 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-19  9:22 [PATCH 00/19] OMAP: DSS2: ULPS support Tomi Valkeinen
2011-04-19  9:22 ` Tomi Valkeinen
2011-04-19  9:22 ` Tomi Valkeinen [this message]
2011-04-19  9:22   ` [PATCH 01/19] OMAP: DSS2: DSI: Add lane override functions Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 02/19] OMAP: DSS2: DSI: Remove CIO LDO status check Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 03/19] OMAP: DSS2: DSI: implement ULPS enter and exit Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 04/19] OMAP: DSS2: DSI: add option to leave DSI lanes powered on Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 05/19] OMAP: DSS2: DSI: rename complexio related functions Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 06/19] OMAP: DSS2: Add FEAT_DSI_REVERSE_TXCLKESC Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 07/19] OMAP: DSS2: DSI: fix _dsi_print_reset_status Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 08/19] OMAP: DSS2: DSI: implement enable/disable SCP clk Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 09/19] OMAP: DSS2: DSI: fix CIO init and uninit Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 10/19] OMAP: DSS2: DSI: wait for TXCLKESC domain to come out of reset Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 11/19] OMAP: DSS2: DSI: add parameter to enter ulps on disable Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 12/19] OMAP: DSS2: DSI: Add DSI pad muxing support Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 13/19] OMAP: DSS2: DSI: ensure VDDS_DSI is disabled on exit Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 14/19] OMAP: DSS2: Taal: Implement configurable ESD interval Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 15/19] OMAP: DSS2: Taal: Clean up ESD queueing Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 16/19] OMAP: DSS2: Taal: Add sysfs file for ESD interval Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 17/19] OMAP: DSS2: Taal: Separate panel reset Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 18/19] OMAP: DSS2: Taal: Rename esd_wq to workqueue Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-19  9:22 ` [PATCH 19/19] OMAP: DSS2: Taal: Implement ULPS functionality Tomi Valkeinen
2011-04-19  9:22   ` Tomi Valkeinen
2011-04-20  5:43 ` [PATCH 00/19] OMAP: DSS2: ULPS support Archit Taneja
2011-04-20  5:55   ` Archit Taneja
2011-04-20  6:08   ` Tomi Valkeinen
2011-04-20  6:08     ` Tomi Valkeinen

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=1303204942-25450-2-git-send-email-tomi.valkeinen@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    /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.