* [PATCH v3] video: da8xx-fb: reset LCDC only if functional clock changes with DVFS
@ 2012-01-03 12:52 Manjunathappa, Prakash
2012-01-30 5:12 ` Florian Tobias Schandinat
0 siblings, 1 reply; 2+ messages in thread
From: Manjunathappa, Prakash @ 2012-01-03 12:52 UTC (permalink / raw)
To: linux-fbdev
LCDC functional clock may or may not be derived from CPU/MPU DPLL,
For example,
AM335x => Separate independent DPLL for LCDC
Davinci => Same DPLL as MPU
So, on platforms where LCDC functional clock is not derived from CPU/MPU
PLL it is not required to reset LCDC module as its functional clock does
not change with DVFS.
This patch adds check to do reset only if functional clock changes
between pre and post notifier callbacks with DVFS.
Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
---
Since v2:
Fix, update lcd_fck_rate with current LCD functional clock rate.
Since v1:
Fixed the commit message.
drivers/video/da8xx-fb.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 6b27751..dee1918 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -163,6 +163,7 @@ struct da8xx_fb_par {
int vsync_timeout;
#ifdef CONFIG_CPU_FREQ
struct notifier_block freq_transition;
+ unsigned int lcd_fck_rate;
#endif
void (*panel_power_ctrl)(int);
};
@@ -895,11 +896,13 @@ static int lcd_da8xx_cpufreq_transition(struct notifier_block *nb,
struct da8xx_fb_par *par;
par = container_of(nb, struct da8xx_fb_par, freq_transition);
- if (val = CPUFREQ_PRECHANGE) {
- lcd_disable_raster();
- } else if (val = CPUFREQ_POSTCHANGE) {
- lcd_calc_clk_divider(par);
- lcd_enable_raster();
+ if (val = CPUFREQ_POSTCHANGE) {
+ if (par->lcd_fck_rate != clk_get_rate(par->lcdc_clk)) {
+ par->lcd_fck_rate = clk_get_rate(par->lcdc_clk);
+ lcd_disable_raster();
+ lcd_calc_clk_divider(par);
+ lcd_enable_raster();
+ }
}
return 0;
@@ -1192,6 +1195,9 @@ static int __devinit fb_probe(struct platform_device *device)
par = da8xx_fb_info->par;
par->lcdc_clk = fb_clk;
+#ifdef CONFIG_CPU_FREQ
+ par->lcd_fck_rate = clk_get_rate(fb_clk);
+#endif
par->pxl_clk = lcdc_info->pxl_clk;
if (fb_pdata->panel_power_ctrl) {
par->panel_power_ctrl = fb_pdata->panel_power_ctrl;
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3] video: da8xx-fb: reset LCDC only if functional clock changes with DVFS
2012-01-03 12:52 [PATCH v3] video: da8xx-fb: reset LCDC only if functional clock changes with DVFS Manjunathappa, Prakash
@ 2012-01-30 5:12 ` Florian Tobias Schandinat
0 siblings, 0 replies; 2+ messages in thread
From: Florian Tobias Schandinat @ 2012-01-30 5:12 UTC (permalink / raw)
To: linux-fbdev
On 01/03/2012 12:40 PM, Manjunathappa, Prakash wrote:
> LCDC functional clock may or may not be derived from CPU/MPU DPLL,
> For example,
> AM335x => Separate independent DPLL for LCDC
> Davinci => Same DPLL as MPU
>
> So, on platforms where LCDC functional clock is not derived from CPU/MPU
> PLL it is not required to reset LCDC module as its functional clock does
> not change with DVFS.
>
> This patch adds check to do reset only if functional clock changes
> between pre and post notifier callbacks with DVFS.
>
> Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
Applied.
Thanks,
Florian Tobias Schandinat
> ---
> Since v2:
> Fix, update lcd_fck_rate with current LCD functional clock rate.
> Since v1:
> Fixed the commit message.
>
> drivers/video/da8xx-fb.c | 16 +++++++++++-----
> 1 files changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
> index 6b27751..dee1918 100644
> --- a/drivers/video/da8xx-fb.c
> +++ b/drivers/video/da8xx-fb.c
> @@ -163,6 +163,7 @@ struct da8xx_fb_par {
> int vsync_timeout;
> #ifdef CONFIG_CPU_FREQ
> struct notifier_block freq_transition;
> + unsigned int lcd_fck_rate;
> #endif
> void (*panel_power_ctrl)(int);
> };
> @@ -895,11 +896,13 @@ static int lcd_da8xx_cpufreq_transition(struct notifier_block *nb,
> struct da8xx_fb_par *par;
>
> par = container_of(nb, struct da8xx_fb_par, freq_transition);
> - if (val = CPUFREQ_PRECHANGE) {
> - lcd_disable_raster();
> - } else if (val = CPUFREQ_POSTCHANGE) {
> - lcd_calc_clk_divider(par);
> - lcd_enable_raster();
> + if (val = CPUFREQ_POSTCHANGE) {
> + if (par->lcd_fck_rate != clk_get_rate(par->lcdc_clk)) {
> + par->lcd_fck_rate = clk_get_rate(par->lcdc_clk);
> + lcd_disable_raster();
> + lcd_calc_clk_divider(par);
> + lcd_enable_raster();
> + }
> }
>
> return 0;
> @@ -1192,6 +1195,9 @@ static int __devinit fb_probe(struct platform_device *device)
>
> par = da8xx_fb_info->par;
> par->lcdc_clk = fb_clk;
> +#ifdef CONFIG_CPU_FREQ
> + par->lcd_fck_rate = clk_get_rate(fb_clk);
> +#endif
> par->pxl_clk = lcdc_info->pxl_clk;
> if (fb_pdata->panel_power_ctrl) {
> par->panel_power_ctrl = fb_pdata->panel_power_ctrl;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-01-30 5:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-03 12:52 [PATCH v3] video: da8xx-fb: reset LCDC only if functional clock changes with DVFS Manjunathappa, Prakash
2012-01-30 5:12 ` Florian Tobias Schandinat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).