aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2010-07-27 04:11:48 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-05-11 07:20:12 -0400
commit0a0ee46b1ae05862cb05ec43caffc01c5259c4cc (patch)
treefc27096c33fc5ad189031700e34f02d5c297a303 /drivers/video/omap2
parent179e045369a36c67d590463548749cacc53c9d85 (diff)
OMAP: DSS2: DSI: Add lane override functions
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>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/dss/dsi.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 47b2f4339cae..d05f8997e02b 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -90,6 +90,7 @@ struct dsi_reg { u16 idx; };
90#define DSI_DSIPHY_CFG1 DSI_REG(0x200 + 0x0004) 90#define DSI_DSIPHY_CFG1 DSI_REG(0x200 + 0x0004)
91#define DSI_DSIPHY_CFG2 DSI_REG(0x200 + 0x0008) 91#define DSI_DSIPHY_CFG2 DSI_REG(0x200 + 0x0008)
92#define DSI_DSIPHY_CFG5 DSI_REG(0x200 + 0x0014) 92#define DSI_DSIPHY_CFG5 DSI_REG(0x200 + 0x0014)
93#define DSI_DSIPHY_CFG10 DSI_REG(0x200 + 0x0028)
93 94
94/* DSI_PLL_CTRL_SCP */ 95/* DSI_PLL_CTRL_SCP */
95 96
@@ -208,6 +209,15 @@ enum dsi_vc_mode {
208 DSI_VC_MODE_VP, 209 DSI_VC_MODE_VP,
209}; 210};
210 211
212enum dsi_lane {
213 DSI_CLK_P = 1 << 0,
214 DSI_CLK_N = 1 << 1,
215 DSI_DATA1_P = 1 << 2,
216 DSI_DATA1_N = 1 << 3,
217 DSI_DATA2_P = 1 << 4,
218 DSI_DATA2_N = 1 << 5,
219};
220
211struct dsi_update_region { 221struct dsi_update_region {
212 u16 x, y, w, h; 222 u16 x, y, w, h;
213 struct omap_dss_device *device; 223 struct omap_dss_device *device;
@@ -1863,6 +1873,54 @@ static void dsi_complexio_timings(void)
1863 dsi_write_reg(DSI_DSIPHY_CFG2, r); 1873 dsi_write_reg(DSI_DSIPHY_CFG2, r);
1864} 1874}
1865 1875
1876static void dsi_enable_lane_override(struct omap_dss_device *dssdev,
1877 enum dsi_lane lanes)
1878{
1879 int clk_lane = dssdev->phy.dsi.clk_lane;
1880 int data1_lane = dssdev->phy.dsi.data1_lane;
1881 int data2_lane = dssdev->phy.dsi.data2_lane;
1882 int clk_pol = dssdev->phy.dsi.clk_pol;
1883 int data1_pol = dssdev->phy.dsi.data1_pol;
1884 int data2_pol = dssdev->phy.dsi.data2_pol;
1885
1886 u32 l = 0;
1887
1888 if (lanes & DSI_CLK_P)
1889 l |= 1 << ((clk_lane - 1) * 2 + (clk_pol ? 0 : 1));
1890 if (lanes & DSI_CLK_N)
1891 l |= 1 << ((clk_lane - 1) * 2 + (clk_pol ? 1 : 0));
1892
1893 if (lanes & DSI_DATA1_P)
1894 l |= 1 << ((data1_lane - 1) * 2 + (data1_pol ? 0 : 1));
1895 if (lanes & DSI_DATA1_N)
1896 l |= 1 << ((data1_lane - 1) * 2 + (data1_pol ? 1 : 0));
1897
1898 if (lanes & DSI_DATA2_P)
1899 l |= 1 << ((data2_lane - 1) * 2 + (data2_pol ? 0 : 1));
1900 if (lanes & DSI_DATA2_N)
1901 l |= 1 << ((data2_lane - 1) * 2 + (data2_pol ? 1 : 0));
1902
1903 /*
1904 * Bits in REGLPTXSCPDAT4TO0DXDY:
1905 * 17: DY0 18: DX0
1906 * 19: DY1 20: DX1
1907 * 21: DY2 22: DX2
1908 */
1909
1910 /* Set the lane override configuration */
1911 REG_FLD_MOD(DSI_DSIPHY_CFG10, l, 22, 17); /* REGLPTXSCPDAT4TO0DXDY */
1912
1913 /* Enable lane override */
1914 REG_FLD_MOD(DSI_DSIPHY_CFG10, 1, 27, 27); /* ENLPTXSCPDAT */
1915}
1916
1917static void dsi_disable_lane_override(void)
1918{
1919 /* Disable lane override */
1920 REG_FLD_MOD(DSI_DSIPHY_CFG10, 0, 27, 27); /* ENLPTXSCPDAT */
1921 /* Reset the lane override configuration */
1922 REG_FLD_MOD(DSI_DSIPHY_CFG10, 0, 22, 17); /* REGLPTXSCPDAT4TO0DXDY */
1923}
1866 1924
1867static int dsi_complexio_init(struct omap_dss_device *dssdev) 1925static int dsi_complexio_init(struct omap_dss_device *dssdev)
1868{ 1926{