From 5048454e9af8262f70b161bbf3bb6092b90d22f2 Mon Sep 17 00:00:00 2001 From: Taras Kondratiuk Date: Wed, 8 Aug 2012 00:21:27 -0500 Subject: OMAPDSS: DSS: Scale DSS OPP according to pixel clock rate Before enabling pixel clock DSS should set its OPP for OPP framework to set correct VDD_CORE voltage level. When pixel clock is disabled DSS can set the lowest OPP. Change-Id: Ia1459614ae306dba9b048b149e474442e2880bba Signed-off-by: Taras Kondratiuk --- arch/arm/mach-omap2/display.c | 4 +++- drivers/video/omap2/dss/dsi.c | 13 +++++++++++++ include/video/omapdss.h | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index dd91c20..417bd66 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -27,6 +27,8 @@ #include #include +#include "dvfs.h" + static struct platform_device omap_display_device = { .name = "omapdss", .id = -1, @@ -97,7 +99,7 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) } pdata.board_data = board_data; - + pdata.device_scale = omap_device_scale; for (i = 0; i < oh_count; i++) { oh = omap_hwmod_lookup(curr_dss_hwmod[i].oh_name); if (!oh) { diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index ebbeb2d..fc0b00f 100755 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -4722,6 +4722,7 @@ int omapdss_dsi_display_enable(struct omap_dss_device *dssdev) { struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); + struct omap_display_platform_data *dss_plat_data; int r = 0; DSSDBG("dsi_display_enable\n"); @@ -4740,6 +4741,11 @@ int omapdss_dsi_display_enable(struct omap_dss_device *dssdev) if (r) goto err_get_dsi; + dss_plat_data = dsidev->dev.platform_data; + dss_plat_data->device_scale(&dssdev->dev, + omap_hwmod_name_get_dev("dss_dispc"), + dssdev->panel.timings.pixel_clock * 1000); + if(!dssdev->skip_init) dsi_enable_pll_clock(dsidev, 1); @@ -4771,6 +4777,8 @@ err_init_dsi: dsi_display_uninit_dispc(dssdev); err_init_dispc: dsi_enable_pll_clock(dsidev, 0); + dss_plat_data->device_scale(&dssdev->dev, + omap_hwmod_name_get_dev("dss_dispc"), 0); dsi_runtime_put(dsidev); err_get_dsi: omap_dss_stop_device(dssdev); @@ -4786,6 +4794,7 @@ void omapdss_dsi_display_disable(struct omap_dss_device *dssdev, { struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); + struct omap_display_platform_data *dss_plat_data; DSSDBG("dsi_display_disable\n"); @@ -4797,6 +4806,10 @@ void omapdss_dsi_display_disable(struct omap_dss_device *dssdev, dsi_display_uninit_dsi(dssdev, disconnect_lanes, enter_ulps); + dss_plat_data = dsidev->dev.platform_data; + dss_plat_data->device_scale(&dssdev->dev, + omap_hwmod_name_get_dev("dss_dispc"), 0); + dsi_runtime_put(dsidev); dsi_enable_pll_clock(dsidev, 0); diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 352640d..b6928f6 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -303,6 +303,8 @@ static inline int omap_display_init(struct omap_dss_board_info *board_data) struct omap_display_platform_data { struct omap_dss_board_info *board_data; /* TODO: Additional members to be added when PM is considered */ + int (*device_scale) (struct device *req_dev, struct device *target_dev, + unsigned long rate); }; struct omap_video_timings { -- cgit v1.1