aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2011-08-22 02:28:08 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-09-30 09:16:26 -0400
commitd604914484ccaaf33361558c9eb2abb441cf9d25 (patch)
treee98edb81093cc8d1c8e873555ceaee724c17e55c /drivers/video
parent7a7c48f9ab374f5fb279f31634d857adc3f0c78c (diff)
OMAP: DSS2: DSI: Represent L4 and VP as sources of VC instead of modes
The enum type dsi_vc_mode is a bit misleading as L4 slave port and video port are sources to VC rather than the mode of operation. Rename then enum type and its members. Merge dsi_vc_config_vp() and dsi_vc_config_l4() into a single function called dsi_vc_config_source() which takes dsi_vc_source enum as an extra argument. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/dsi.c72
1 files changed, 21 insertions, 51 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 6735e0c8bdf7..bdc2c9d25784 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -217,9 +217,9 @@ enum fifo_size {
217 DSI_FIFO_SIZE_128 = 4, 217 DSI_FIFO_SIZE_128 = 4,
218}; 218};
219 219
220enum dsi_vc_mode { 220enum dsi_vc_source {
221 DSI_VC_MODE_L4 = 0, 221 DSI_VC_SOURCE_L4 = 0,
222 DSI_VC_MODE_VP, 222 DSI_VC_SOURCE_VP,
223}; 223};
224 224
225enum dsi_lane { 225enum dsi_lane {
@@ -272,7 +272,7 @@ struct dsi_data {
272 struct regulator *vdds_dsi_reg; 272 struct regulator *vdds_dsi_reg;
273 273
274 struct { 274 struct {
275 enum dsi_vc_mode mode; 275 enum dsi_vc_source source;
276 struct omap_dss_device *dssdev; 276 struct omap_dss_device *dssdev;
277 enum fifo_size fifo_size; 277 enum fifo_size fifo_size;
278 int vc_id; 278 int vc_id;
@@ -2672,10 +2672,10 @@ static int dsi_sync_vc(struct platform_device *dsidev, int channel)
2672 if (!dsi_vc_is_enabled(dsidev, channel)) 2672 if (!dsi_vc_is_enabled(dsidev, channel))
2673 return 0; 2673 return 0;
2674 2674
2675 switch (dsi->vc[channel].mode) { 2675 switch (dsi->vc[channel].source) {
2676 case DSI_VC_MODE_VP: 2676 case DSI_VC_SOURCE_VP:
2677 return dsi_sync_vc_vp(dsidev, channel); 2677 return dsi_sync_vc_vp(dsidev, channel);
2678 case DSI_VC_MODE_L4: 2678 case DSI_VC_SOURCE_L4:
2679 return dsi_sync_vc_l4(dsidev, channel); 2679 return dsi_sync_vc_l4(dsidev, channel);
2680 default: 2680 default:
2681 BUG(); 2681 BUG();
@@ -2729,43 +2729,12 @@ static void dsi_vc_initial_config(struct platform_device *dsidev, int channel)
2729 dsi_write_reg(dsidev, DSI_VC_CTRL(channel), r); 2729 dsi_write_reg(dsidev, DSI_VC_CTRL(channel), r);
2730} 2730}
2731 2731
2732static int dsi_vc_config_l4(struct platform_device *dsidev, int channel) 2732static int dsi_vc_config_source(struct platform_device *dsidev, int channel,
2733 enum dsi_vc_source source)
2733{ 2734{
2734 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 2735 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
2735 2736
2736 if (dsi->vc[channel].mode == DSI_VC_MODE_L4) 2737 if (dsi->vc[channel].source == source)
2737 return 0;
2738
2739 DSSDBGF("%d", channel);
2740
2741 dsi_sync_vc(dsidev, channel);
2742
2743 dsi_vc_enable(dsidev, channel, 0);
2744
2745 /* VC_BUSY */
2746 if (wait_for_bit_change(dsidev, DSI_VC_CTRL(channel), 15, 0) != 0) {
2747 DSSERR("vc(%d) busy when trying to config for L4\n", channel);
2748 return -EIO;
2749 }
2750
2751 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), 0, 1, 1); /* SOURCE, 0 = L4 */
2752
2753 /* DCS_CMD_ENABLE */
2754 if (dss_has_feature(FEAT_DSI_DCS_CMD_CONFIG_VC))
2755 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), 0, 30, 30);
2756
2757 dsi_vc_enable(dsidev, channel, 1);
2758
2759 dsi->vc[channel].mode = DSI_VC_MODE_L4;
2760
2761 return 0;
2762}
2763
2764static int dsi_vc_config_vp(struct platform_device *dsidev, int channel)
2765{
2766 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
2767
2768 if (dsi->vc[channel].mode == DSI_VC_MODE_VP)
2769 return 0; 2738 return 0;
2770 2739
2771 DSSDBGF("%d", channel); 2740 DSSDBGF("%d", channel);
@@ -2780,21 +2749,22 @@ static int dsi_vc_config_vp(struct platform_device *dsidev, int channel)
2780 return -EIO; 2749 return -EIO;
2781 } 2750 }
2782 2751
2783 /* SOURCE, 1 = video port */ 2752 /* SOURCE, 0 = L4, 1 = video port */
2784 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), 1, 1, 1); 2753 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), source, 1, 1);
2785 2754
2786 /* DCS_CMD_ENABLE */ 2755 /* DCS_CMD_ENABLE */
2787 if (dss_has_feature(FEAT_DSI_DCS_CMD_CONFIG_VC)) 2756 if (dss_has_feature(FEAT_DSI_DCS_CMD_CONFIG_VC)) {
2788 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), 1, 30, 30); 2757 bool enable = source == DSI_VC_SOURCE_VP;
2758 REG_FLD_MOD(dsidev, DSI_VC_CTRL(channel), enable, 30, 30);
2759 }
2789 2760
2790 dsi_vc_enable(dsidev, channel, 1); 2761 dsi_vc_enable(dsidev, channel, 1);
2791 2762
2792 dsi->vc[channel].mode = DSI_VC_MODE_VP; 2763 dsi->vc[channel].source = source;
2793 2764
2794 return 0; 2765 return 0;
2795} 2766}
2796 2767
2797
2798void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel, 2768void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
2799 bool enable) 2769 bool enable)
2800{ 2770{
@@ -3010,7 +2980,7 @@ static int dsi_vc_send_long(struct platform_device *dsidev, int channel,
3010 return -EINVAL; 2980 return -EINVAL;
3011 } 2981 }
3012 2982
3013 dsi_vc_config_l4(dsidev, channel); 2983 dsi_vc_config_source(dsidev, channel, DSI_VC_SOURCE_L4);
3014 2984
3015 dsi_vc_write_long_header(dsidev, channel, data_type, len, ecc); 2985 dsi_vc_write_long_header(dsidev, channel, data_type, len, ecc);
3016 2986
@@ -3069,7 +3039,7 @@ static int dsi_vc_send_short(struct platform_device *dsidev, int channel,
3069 channel, 3039 channel,
3070 data_type, data & 0xff, (data >> 8) & 0xff); 3040 data_type, data & 0xff, (data >> 8) & 0xff);
3071 3041
3072 dsi_vc_config_l4(dsidev, channel); 3042 dsi_vc_config_source(dsidev, channel, DSI_VC_SOURCE_L4);
3073 3043
3074 if (FLD_GET(dsi_read_reg(dsidev, DSI_VC_CTRL(channel)), 16, 16)) { 3044 if (FLD_GET(dsi_read_reg(dsidev, DSI_VC_CTRL(channel)), 16, 16)) {
3075 DSSERR("ERROR FIFO FULL, aborting transfer\n"); 3045 DSSERR("ERROR FIFO FULL, aborting transfer\n");
@@ -3657,7 +3627,7 @@ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev,
3657 DSSDBG("dsi_update_screen_dispc(%d,%d %dx%d)\n", 3627 DSSDBG("dsi_update_screen_dispc(%d,%d %dx%d)\n",
3658 x, y, w, h); 3628 x, y, w, h);
3659 3629
3660 dsi_vc_config_vp(dsidev, channel); 3630 dsi_vc_config_source(dsidev, channel, DSI_VC_SOURCE_VP);
3661 3631
3662 bytespp = dssdev->ctrl.pixel_size / 8; 3632 bytespp = dssdev->ctrl.pixel_size / 8;
3663 bytespl = w * bytespp; 3633 bytespl = w * bytespp;
@@ -4383,7 +4353,7 @@ static int omap_dsihw_probe(struct platform_device *dsidev)
4383 4353
4384 /* DSI VCs initialization */ 4354 /* DSI VCs initialization */
4385 for (i = 0; i < ARRAY_SIZE(dsi->vc); i++) { 4355 for (i = 0; i < ARRAY_SIZE(dsi->vc); i++) {
4386 dsi->vc[i].mode = DSI_VC_MODE_L4; 4356 dsi->vc[i].source = DSI_VC_SOURCE_L4;
4387 dsi->vc[i].dssdev = NULL; 4357 dsi->vc[i].dssdev = NULL;
4388 dsi->vc[i].vc_id = 0; 4358 dsi->vc[i].vc_id = 0;
4389 } 4359 }