From f80fb7dfd1c0e294f24ae5cd413571fbaeae6ff0 Mon Sep 17 00:00:00 2001 From: Andrii Tseglytskyi Date: Mon, 28 May 2012 14:46:00 +0300 Subject: OMAP4: DPLL cascading: introduce devise scale function for GPU GPU driver should be able to manage DPLL cascading constraint. Right now sources of GPU driver are not in the kernel mainline. So, patch introduces simple wrapper function for omap_device_scale(), which holds DPLL cascading blocker when GPU scales to OPP higher, than OPP50 Change-Id: I3f83b8b1c49118625f550aea031e86546ceb97fc Signed-off-by: Andrii Tseglytskyi --- arch/arm/mach-omap2/devices.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-omap2/devices.c') diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index b987208..7eb9306 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -24,6 +24,10 @@ #include #include +#ifdef CONFIG_OMAP4_DPLL_CASCADING +#include +#endif + #include #include #include @@ -904,6 +908,24 @@ static struct omap_device_pm_latency omap_gpu_latency[] = { }, }; +#ifdef CONFIG_OMAP4_DPLL_CASCADING +int omap_device_scale_gpu(struct device *req_dev, struct device *target_dev, + unsigned long rate) +{ + unsigned long freq = 0; + + /* find lowest frequency */ + opp_find_freq_ceil(target_dev, &freq); + + if (rate > freq) + omap4_dpll_cascading_blocker_hold(target_dev); + else + omap4_dpll_cascading_blocker_release(target_dev); + + return omap_device_scale(req_dev, target_dev, rate); +} +#endif + static void omap_init_gpu(void) { struct omap_hwmod *oh; @@ -932,8 +954,11 @@ static void omap_init_gpu(void) pr_err("omap_init_gpu: Platform data memory allocation failed\n"); return; } - +#ifdef CONFIG_OMAP4_DPLL_CASCADING + pdata->device_scale = omap_device_scale_gpu; +#else pdata->device_scale = omap_device_scale; +#endif pdata->device_enable = omap_device_enable; pdata->device_idle = omap_device_idle; pdata->device_shutdown = omap_device_shutdown; -- cgit v1.1