diff options
author | Archit Taneja <archit@ti.com> | 2012-09-04 02:12:36 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-09-26 07:58:34 -0400 |
commit | eea8340a1da581249a14bc03260af65edf4ededa (patch) | |
tree | ee385814cf458fabf0be94c974a790dc45217475 /drivers/video | |
parent | 400e65d1c9946c9bf4d87a94d71f7d7423d03b62 (diff) |
OMAPDSS: DSI: Replace dssdev->manager with dssdev->output->manager references
With addition of output entities, a device connects to an output, and an output
connects to overlay manager. Replace the dssdev->manager references with
dssdev->output->manager to access the manager correctly.
When enabling the DSI output, check whether the output entity connected to
display is not NULL.
In dsi_init_display(), the display won't be connected to the DSI output yet,
that happens later in dss_recheck_connections() in the panel driver's probe. Get
the dsidev platform device pointer using the DSI moudle number provided in the
omap_dss_device struct.
Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/omap2/dss/dsi.c | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index dbe7d3ec8436..e37e6d868acd 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -4333,6 +4333,7 @@ int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel) | |||
4333 | { | 4333 | { |
4334 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 4334 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
4335 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 4335 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
4336 | struct omap_overlay_manager *mgr = dssdev->output->manager; | ||
4336 | int bpp = dsi_get_pixel_size(dsi->pix_fmt); | 4337 | int bpp = dsi_get_pixel_size(dsi->pix_fmt); |
4337 | u8 data_type; | 4338 | u8 data_type; |
4338 | u16 word_count; | 4339 | u16 word_count; |
@@ -4372,7 +4373,7 @@ int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel) | |||
4372 | dsi_if_enable(dsidev, true); | 4373 | dsi_if_enable(dsidev, true); |
4373 | } | 4374 | } |
4374 | 4375 | ||
4375 | r = dss_mgr_enable(dssdev->manager); | 4376 | r = dss_mgr_enable(mgr); |
4376 | if (r) { | 4377 | if (r) { |
4377 | if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { | 4378 | if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { |
4378 | dsi_if_enable(dsidev, false); | 4379 | dsi_if_enable(dsidev, false); |
@@ -4390,6 +4391,7 @@ void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel) | |||
4390 | { | 4391 | { |
4391 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 4392 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
4392 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 4393 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
4394 | struct omap_overlay_manager *mgr = dssdev->output->manager; | ||
4393 | 4395 | ||
4394 | if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { | 4396 | if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { |
4395 | dsi_if_enable(dsidev, false); | 4397 | dsi_if_enable(dsidev, false); |
@@ -4402,7 +4404,7 @@ void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel) | |||
4402 | dsi_if_enable(dsidev, true); | 4404 | dsi_if_enable(dsidev, true); |
4403 | } | 4405 | } |
4404 | 4406 | ||
4405 | dss_mgr_disable(dssdev->manager); | 4407 | dss_mgr_disable(mgr); |
4406 | } | 4408 | } |
4407 | EXPORT_SYMBOL(dsi_disable_video_output); | 4409 | EXPORT_SYMBOL(dsi_disable_video_output); |
4408 | 4410 | ||
@@ -4410,6 +4412,7 @@ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev) | |||
4410 | { | 4412 | { |
4411 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 4413 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
4412 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 4414 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
4415 | struct omap_overlay_manager *mgr = dssdev->output->manager; | ||
4413 | unsigned bytespp; | 4416 | unsigned bytespp; |
4414 | unsigned bytespl; | 4417 | unsigned bytespl; |
4415 | unsigned bytespf; | 4418 | unsigned bytespf; |
@@ -4471,9 +4474,9 @@ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev) | |||
4471 | msecs_to_jiffies(250)); | 4474 | msecs_to_jiffies(250)); |
4472 | BUG_ON(r == 0); | 4475 | BUG_ON(r == 0); |
4473 | 4476 | ||
4474 | dss_mgr_set_timings(dssdev->manager, &dsi->timings); | 4477 | dss_mgr_set_timings(mgr, &dsi->timings); |
4475 | 4478 | ||
4476 | dss_mgr_start_update(dssdev->manager); | 4479 | dss_mgr_start_update(mgr); |
4477 | 4480 | ||
4478 | if (dsi->te_enabled) { | 4481 | if (dsi->te_enabled) { |
4479 | /* disable LP_RX_TO, so that we can receive TE. Time to wait | 4482 | /* disable LP_RX_TO, so that we can receive TE. Time to wait |
@@ -4601,6 +4604,7 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev) | |||
4601 | { | 4604 | { |
4602 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 4605 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
4603 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 4606 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
4607 | struct omap_overlay_manager *mgr = dssdev->output->manager; | ||
4604 | int r; | 4608 | int r; |
4605 | u32 irq = 0; | 4609 | u32 irq = 0; |
4606 | 4610 | ||
@@ -4612,7 +4616,7 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev) | |||
4612 | dsi->timings.vfp = 0; | 4616 | dsi->timings.vfp = 0; |
4613 | dsi->timings.vbp = 0; | 4617 | dsi->timings.vbp = 0; |
4614 | 4618 | ||
4615 | irq = dispc_mgr_get_framedone_irq(dssdev->manager->id); | 4619 | irq = dispc_mgr_get_framedone_irq(mgr->id); |
4616 | 4620 | ||
4617 | r = omap_dispc_register_isr(dsi_framedone_irq_callback, | 4621 | r = omap_dispc_register_isr(dsi_framedone_irq_callback, |
4618 | (void *) dsidev, irq); | 4622 | (void *) dsidev, irq); |
@@ -4639,7 +4643,7 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev) | |||
4639 | dsi->timings.de_level = OMAPDSS_SIG_ACTIVE_HIGH; | 4643 | dsi->timings.de_level = OMAPDSS_SIG_ACTIVE_HIGH; |
4640 | dsi->timings.sync_pclk_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES; | 4644 | dsi->timings.sync_pclk_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES; |
4641 | 4645 | ||
4642 | dss_mgr_set_timings(dssdev->manager, &dsi->timings); | 4646 | dss_mgr_set_timings(mgr, &dsi->timings); |
4643 | 4647 | ||
4644 | r = dsi_configure_dispc_clocks(dssdev); | 4648 | r = dsi_configure_dispc_clocks(dssdev); |
4645 | if (r) | 4649 | if (r) |
@@ -4650,7 +4654,7 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev) | |||
4650 | dsi_get_pixel_size(dsi->pix_fmt); | 4654 | dsi_get_pixel_size(dsi->pix_fmt); |
4651 | dsi->mgr_config.lcden_sig_polarity = 0; | 4655 | dsi->mgr_config.lcden_sig_polarity = 0; |
4652 | 4656 | ||
4653 | dss_mgr_set_lcd_config(dssdev->manager, &dsi->mgr_config); | 4657 | dss_mgr_set_lcd_config(mgr, &dsi->mgr_config); |
4654 | 4658 | ||
4655 | return 0; | 4659 | return 0; |
4656 | err1: | 4660 | err1: |
@@ -4665,11 +4669,12 @@ static void dsi_display_uninit_dispc(struct omap_dss_device *dssdev) | |||
4665 | { | 4669 | { |
4666 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 4670 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
4667 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 4671 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
4672 | struct omap_overlay_manager *mgr = dssdev->output->manager; | ||
4668 | 4673 | ||
4669 | if (dsi->mode == OMAP_DSS_DSI_CMD_MODE) { | 4674 | if (dsi->mode == OMAP_DSS_DSI_CMD_MODE) { |
4670 | u32 irq; | 4675 | u32 irq; |
4671 | 4676 | ||
4672 | irq = dispc_mgr_get_framedone_irq(dssdev->manager->id); | 4677 | irq = dispc_mgr_get_framedone_irq(mgr->id); |
4673 | 4678 | ||
4674 | omap_dispc_unregister_isr(dsi_framedone_irq_callback, | 4679 | omap_dispc_unregister_isr(dsi_framedone_irq_callback, |
4675 | (void *) dsidev, irq); | 4680 | (void *) dsidev, irq); |
@@ -4705,6 +4710,7 @@ static int dsi_display_init_dsi(struct omap_dss_device *dssdev) | |||
4705 | { | 4710 | { |
4706 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 4711 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
4707 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 4712 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
4713 | struct omap_overlay_manager *mgr = dssdev->output->manager; | ||
4708 | int r; | 4714 | int r; |
4709 | 4715 | ||
4710 | r = dsi_pll_init(dsidev, true, true); | 4716 | r = dsi_pll_init(dsidev, true, true); |
@@ -4717,7 +4723,7 @@ static int dsi_display_init_dsi(struct omap_dss_device *dssdev) | |||
4717 | 4723 | ||
4718 | dss_select_dispc_clk_source(dssdev->clocks.dispc.dispc_fclk_src); | 4724 | dss_select_dispc_clk_source(dssdev->clocks.dispc.dispc_fclk_src); |
4719 | dss_select_dsi_clk_source(dsi->module_id, dssdev->clocks.dsi.dsi_fclk_src); | 4725 | dss_select_dsi_clk_source(dsi->module_id, dssdev->clocks.dsi.dsi_fclk_src); |
4720 | dss_select_lcd_clk_source(dssdev->manager->id, | 4726 | dss_select_lcd_clk_source(mgr->id, |
4721 | dssdev->clocks.dispc.channel.lcd_clk_src); | 4727 | dssdev->clocks.dispc.channel.lcd_clk_src); |
4722 | 4728 | ||
4723 | DSSDBG("PLL OK\n"); | 4729 | DSSDBG("PLL OK\n"); |
@@ -4752,7 +4758,7 @@ err3: | |||
4752 | err2: | 4758 | err2: |
4753 | dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK); | 4759 | dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK); |
4754 | dss_select_dsi_clk_source(dsi->module_id, OMAP_DSS_CLK_SRC_FCK); | 4760 | dss_select_dsi_clk_source(dsi->module_id, OMAP_DSS_CLK_SRC_FCK); |
4755 | dss_select_lcd_clk_source(dssdev->manager->id, OMAP_DSS_CLK_SRC_FCK); | 4761 | dss_select_lcd_clk_source(mgr->id, OMAP_DSS_CLK_SRC_FCK); |
4756 | 4762 | ||
4757 | err1: | 4763 | err1: |
4758 | dsi_pll_uninit(dsidev, true); | 4764 | dsi_pll_uninit(dsidev, true); |
@@ -4765,6 +4771,7 @@ static void dsi_display_uninit_dsi(struct omap_dss_device *dssdev, | |||
4765 | { | 4771 | { |
4766 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 4772 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
4767 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 4773 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
4774 | struct omap_overlay_manager *mgr = dssdev->output->manager; | ||
4768 | 4775 | ||
4769 | if (enter_ulps && !dsi->ulps_enabled) | 4776 | if (enter_ulps && !dsi->ulps_enabled) |
4770 | dsi_enter_ulps(dsidev); | 4777 | dsi_enter_ulps(dsidev); |
@@ -4778,7 +4785,7 @@ static void dsi_display_uninit_dsi(struct omap_dss_device *dssdev, | |||
4778 | 4785 | ||
4779 | dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK); | 4786 | dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK); |
4780 | dss_select_dsi_clk_source(dsi->module_id, OMAP_DSS_CLK_SRC_FCK); | 4787 | dss_select_dsi_clk_source(dsi->module_id, OMAP_DSS_CLK_SRC_FCK); |
4781 | dss_select_lcd_clk_source(dssdev->manager->id, OMAP_DSS_CLK_SRC_FCK); | 4788 | dss_select_lcd_clk_source(mgr->id, OMAP_DSS_CLK_SRC_FCK); |
4782 | dsi_cio_uninit(dsidev); | 4789 | dsi_cio_uninit(dsidev); |
4783 | dsi_pll_uninit(dsidev, disconnect_lanes); | 4790 | dsi_pll_uninit(dsidev, disconnect_lanes); |
4784 | } | 4791 | } |
@@ -4787,6 +4794,7 @@ int omapdss_dsi_display_enable(struct omap_dss_device *dssdev) | |||
4787 | { | 4794 | { |
4788 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 4795 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
4789 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 4796 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
4797 | struct omap_dss_output *out = dssdev->output; | ||
4790 | int r = 0; | 4798 | int r = 0; |
4791 | 4799 | ||
4792 | DSSDBG("dsi_display_enable\n"); | 4800 | DSSDBG("dsi_display_enable\n"); |
@@ -4795,8 +4803,8 @@ int omapdss_dsi_display_enable(struct omap_dss_device *dssdev) | |||
4795 | 4803 | ||
4796 | mutex_lock(&dsi->lock); | 4804 | mutex_lock(&dsi->lock); |
4797 | 4805 | ||
4798 | if (dssdev->manager == NULL) { | 4806 | if (out == NULL || out->manager == NULL) { |
4799 | DSSERR("failed to enable display: no manager\n"); | 4807 | DSSERR("failed to enable display: no output/manager\n"); |
4800 | r = -ENODEV; | 4808 | r = -ENODEV; |
4801 | goto err_start_dev; | 4809 | goto err_start_dev; |
4802 | } | 4810 | } |
@@ -4953,7 +4961,8 @@ EXPORT_SYMBOL(omapdss_dsi_set_videomode_timings); | |||
4953 | 4961 | ||
4954 | static int __init dsi_init_display(struct omap_dss_device *dssdev) | 4962 | static int __init dsi_init_display(struct omap_dss_device *dssdev) |
4955 | { | 4963 | { |
4956 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 4964 | struct platform_device *dsidev = |
4965 | dsi_get_dsidev_from_id(dssdev->phy.dsi.module); | ||
4957 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 4966 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
4958 | 4967 | ||
4959 | DSSDBG("DSI init\n"); | 4968 | DSSDBG("DSI init\n"); |