aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-08-16 08:32:00 -0400
committerArchit Taneja <archit@ti.com>2012-08-16 08:32:00 -0400
commitdca2b1522ccab28d03fb79f6e70e70ea78033d52 (patch)
tree848d7f7596c06264567167980149ee3571a00e1a /drivers/video/omap2
parent889b4fd7eed2d7c155dc642e15a714f87ab2842c (diff)
OMAPDSS: DSI: Maintain copy of operation mode in driver data
The DSI driver currently relies on the omap_dss_device struct to know the mode of operation of the DSI protocol(command or video mode). This makes the DSI interface driver dependent on the omap_dss_device struct. Make the DSI driver data maintain it's own operation mode field. The panel driver is expected to call omapdss_dsi_set_operation_mode() before the interface is enabled. Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/displays/panel-taal.c1
-rw-r--r--drivers/video/omap2/dss/dsi.c42
2 files changed, 32 insertions, 11 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index de1dd20644f2..77aed0e51f9b 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -1063,6 +1063,7 @@ static int taal_power_on(struct omap_dss_device *dssdev)
1063 omapdss_dsi_set_size(dssdev, dssdev->panel.timings.x_res, 1063 omapdss_dsi_set_size(dssdev, dssdev->panel.timings.x_res,
1064 dssdev->panel.timings.y_res); 1064 dssdev->panel.timings.y_res);
1065 omapdss_dsi_set_pixel_format(dssdev, OMAP_DSS_DSI_FMT_RGB888); 1065 omapdss_dsi_set_pixel_format(dssdev, OMAP_DSS_DSI_FMT_RGB888);
1066 omapdss_dsi_set_operation_mode(dssdev, OMAP_DSS_DSI_CMD_MODE);
1066 1067
1067 r = omapdss_dsi_display_enable(dssdev); 1068 r = omapdss_dsi_display_enable(dssdev);
1068 if (r) { 1069 if (r) {
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 8f94cb806145..c10c8cb373a2 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -335,6 +335,7 @@ struct dsi_data {
335 struct dss_lcd_mgr_config mgr_config; 335 struct dss_lcd_mgr_config mgr_config;
336 struct omap_video_timings timings; 336 struct omap_video_timings timings;
337 enum omap_dss_dsi_pixel_format pix_fmt; 337 enum omap_dss_dsi_pixel_format pix_fmt;
338 enum omap_dss_dsi_mode mode;
338}; 339};
339 340
340struct dsi_packet_sent_handler_data { 341struct dsi_packet_sent_handler_data {
@@ -2362,7 +2363,7 @@ static int dsi_cio_init(struct omap_dss_device *dssdev)
2362 2363
2363 dsi_cio_timings(dsidev); 2364 dsi_cio_timings(dsidev);
2364 2365
2365 if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_VIDEO_MODE) { 2366 if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) {
2366 /* DDR_CLK_ALWAYS_ON */ 2367 /* DDR_CLK_ALWAYS_ON */
2367 REG_FLD_MOD(dsidev, DSI_CLK_CTRL, 2368 REG_FLD_MOD(dsidev, DSI_CLK_CTRL,
2368 dssdev->panel.dsi_vm_data.ddr_clk_always_on, 13, 13); 2369 dssdev->panel.dsi_vm_data.ddr_clk_always_on, 13, 13);
@@ -3609,9 +3610,10 @@ static void dsi_set_hs_tx_timeout(struct platform_device *dsidev,
3609static void dsi_config_vp_num_line_buffers(struct omap_dss_device *dssdev) 3610static void dsi_config_vp_num_line_buffers(struct omap_dss_device *dssdev)
3610{ 3611{
3611 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 3612 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
3613 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
3612 int num_line_buffers; 3614 int num_line_buffers;
3613 3615
3614 if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_VIDEO_MODE) { 3616 if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) {
3615 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 3617 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
3616 int bpp = dsi_get_pixel_size(dsi->pix_fmt); 3618 int bpp = dsi_get_pixel_size(dsi->pix_fmt);
3617 unsigned line_buf_size = dsi_get_line_buf_size(dsidev); 3619 unsigned line_buf_size = dsi_get_line_buf_size(dsidev);
@@ -3909,7 +3911,7 @@ static int dsi_proto_config(struct omap_dss_device *dssdev)
3909 3911
3910 dsi_config_vp_num_line_buffers(dssdev); 3912 dsi_config_vp_num_line_buffers(dssdev);
3911 3913
3912 if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_VIDEO_MODE) { 3914 if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) {
3913 dsi_config_vp_sync_events(dssdev); 3915 dsi_config_vp_sync_events(dssdev);
3914 dsi_config_blanking_modes(dssdev); 3916 dsi_config_blanking_modes(dssdev);
3915 dsi_config_cmd_mode_interleaving(dssdev); 3917 dsi_config_cmd_mode_interleaving(dssdev);
@@ -3988,7 +3990,7 @@ static void dsi_proto_timings(struct omap_dss_device *dssdev)
3988 DSSDBG("enter_hs_mode_lat %u, exit_hs_mode_lat %u\n", 3990 DSSDBG("enter_hs_mode_lat %u, exit_hs_mode_lat %u\n",
3989 enter_hs_mode_lat, exit_hs_mode_lat); 3991 enter_hs_mode_lat, exit_hs_mode_lat);
3990 3992
3991 if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_VIDEO_MODE) { 3993 if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) {
3992 /* TODO: Implement a video mode check_timings function */ 3994 /* TODO: Implement a video mode check_timings function */
3993 int hsa = dssdev->panel.dsi_vm_data.hsa; 3995 int hsa = dssdev->panel.dsi_vm_data.hsa;
3994 int hfp = dssdev->panel.dsi_vm_data.hfp; 3996 int hfp = dssdev->panel.dsi_vm_data.hfp;
@@ -4113,7 +4115,7 @@ int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel)
4113 u16 word_count; 4115 u16 word_count;
4114 int r; 4116 int r;
4115 4117
4116 if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_VIDEO_MODE) { 4118 if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) {
4117 switch (dsi->pix_fmt) { 4119 switch (dsi->pix_fmt) {
4118 case OMAP_DSS_DSI_FMT_RGB888: 4120 case OMAP_DSS_DSI_FMT_RGB888:
4119 data_type = MIPI_DSI_PACKED_PIXEL_STREAM_24; 4121 data_type = MIPI_DSI_PACKED_PIXEL_STREAM_24;
@@ -4149,7 +4151,7 @@ int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel)
4149 4151
4150 r = dss_mgr_enable(dssdev->manager); 4152 r = dss_mgr_enable(dssdev->manager);
4151 if (r) { 4153 if (r) {
4152 if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_VIDEO_MODE) { 4154 if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) {
4153 dsi_if_enable(dsidev, false); 4155 dsi_if_enable(dsidev, false);
4154 dsi_vc_enable(dsidev, channel, false); 4156 dsi_vc_enable(dsidev, channel, false);
4155 } 4157 }
@@ -4164,8 +4166,9 @@ EXPORT_SYMBOL(dsi_enable_video_output);
4164void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel) 4166void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel)
4165{ 4167{
4166 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 4168 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
4169 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
4167 4170
4168 if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_VIDEO_MODE) { 4171 if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) {
4169 dsi_if_enable(dsidev, false); 4172 dsi_if_enable(dsidev, false);
4170 dsi_vc_enable(dsidev, channel, false); 4173 dsi_vc_enable(dsidev, channel, false);
4171 4174
@@ -4379,7 +4382,7 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev)
4379 int r; 4382 int r;
4380 u32 irq = 0; 4383 u32 irq = 0;
4381 4384
4382 if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_CMD_MODE) { 4385 if (dsi->mode == OMAP_DSS_DSI_CMD_MODE) {
4383 dsi->timings.hsw = 1; 4386 dsi->timings.hsw = 1;
4384 dsi->timings.hfp = 1; 4387 dsi->timings.hfp = 1;
4385 dsi->timings.hbp = 1; 4388 dsi->timings.hbp = 1;
@@ -4429,7 +4432,7 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev)
4429 4432
4430 return 0; 4433 return 0;
4431err1: 4434err1:
4432 if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_CMD_MODE) 4435 if (dsi->mode == OMAP_DSS_DSI_CMD_MODE)
4433 omap_dispc_unregister_isr(dsi_framedone_irq_callback, 4436 omap_dispc_unregister_isr(dsi_framedone_irq_callback,
4434 (void *) dssdev, irq); 4437 (void *) dssdev, irq);
4435err: 4438err:
@@ -4438,7 +4441,10 @@ err:
4438 4441
4439static void dsi_display_uninit_dispc(struct omap_dss_device *dssdev) 4442static void dsi_display_uninit_dispc(struct omap_dss_device *dssdev)
4440{ 4443{
4441 if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_CMD_MODE) { 4444 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
4445 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
4446
4447 if (dsi->mode == OMAP_DSS_DSI_CMD_MODE) {
4442 u32 irq; 4448 u32 irq;
4443 4449
4444 irq = dispc_mgr_get_framedone_irq(dssdev->manager->id); 4450 irq = dispc_mgr_get_framedone_irq(dssdev->manager->id);
@@ -4695,6 +4701,20 @@ void omapdss_dsi_set_pixel_format(struct omap_dss_device *dssdev,
4695} 4701}
4696EXPORT_SYMBOL(omapdss_dsi_set_pixel_format); 4702EXPORT_SYMBOL(omapdss_dsi_set_pixel_format);
4697 4703
4704void omapdss_dsi_set_operation_mode(struct omap_dss_device *dssdev,
4705 enum omap_dss_dsi_mode mode)
4706{
4707 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
4708 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
4709
4710 mutex_lock(&dsi->lock);
4711
4712 dsi->mode = mode;
4713
4714 mutex_unlock(&dsi->lock);
4715}
4716EXPORT_SYMBOL(omapdss_dsi_set_operation_mode);
4717
4698static int __init dsi_init_display(struct omap_dss_device *dssdev) 4718static int __init dsi_init_display(struct omap_dss_device *dssdev)
4699{ 4719{
4700 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 4720 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
@@ -4702,7 +4722,7 @@ static int __init dsi_init_display(struct omap_dss_device *dssdev)
4702 4722
4703 DSSDBG("DSI init\n"); 4723 DSSDBG("DSI init\n");
4704 4724
4705 if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_CMD_MODE) { 4725 if (dsi->mode == OMAP_DSS_DSI_CMD_MODE) {
4706 dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | 4726 dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE |
4707 OMAP_DSS_DISPLAY_CAP_TEAR_ELIM; 4727 OMAP_DSS_DISPLAY_CAP_TEAR_ELIM;
4708 } 4728 }