linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] video: da8xx-fb: Fix build warning on unused label
@ 2012-02-09  5:16 Manjunathappa, Prakash
  2012-02-09  5:16 ` [PATCH] video:da8xx-fb: calculate pixel clock period for the panel Manjunathappa, Prakash
  2012-02-13 21:27 ` [PATCH] video: da8xx-fb: Fix build warning on unused label Florian Tobias Schandinat
  0 siblings, 2 replies; 3+ messages in thread
From: Manjunathappa, Prakash @ 2012-02-09  5:16 UTC (permalink / raw)
  To: linux-fbdev
  Cc: Florian Tobias Schandinat, davinci-linux-open-source,
	linux-kernel, Manjunathappa, Prakash

Patch fixes build warning on label "err_cpu_freq" when CONFIG_CPU_FREQ
is not defined.

Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
---
 drivers/video/da8xx-fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 29577bf..f360d62 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -1264,8 +1264,8 @@ static int __devinit fb_probe(struct platform_device *device)
 irq_freq:
 #ifdef CONFIG_CPU_FREQ
 	lcd_da8xx_cpufreq_deregister(par);
-#endif
 err_cpu_freq:
+#endif
 	unregister_framebuffer(da8xx_fb_info);
 
 err_dealloc_cmap:
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] video:da8xx-fb: calculate pixel clock period for the panel
  2012-02-09  5:16 [PATCH] video: da8xx-fb: Fix build warning on unused label Manjunathappa, Prakash
@ 2012-02-09  5:16 ` Manjunathappa, Prakash
  2012-02-13 21:27 ` [PATCH] video: da8xx-fb: Fix build warning on unused label Florian Tobias Schandinat
  1 sibling, 0 replies; 3+ messages in thread
From: Manjunathappa, Prakash @ 2012-02-09  5:16 UTC (permalink / raw)
  To: linux-fbdev
  Cc: Florian Tobias Schandinat, davinci-linux-open-source,
	linux-kernel, Manjunathappa, Prakash

Patch calculates pixel clock period in pico seconds and updates
the same in variable screen information structure. fbset utility
uses this information.

Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
---
 drivers/video/da8xx-fb.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index f360d62..8b0a174 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -32,6 +32,7 @@
 #include <linux/console.h>
 #include <linux/slab.h>
 #include <video/da8xx-fb.h>
+#include <asm/div64.h>
 
 #define DRIVER_NAME "da8xx_lcdc"
 
@@ -174,7 +175,6 @@ static struct fb_var_screeninfo da8xx_fb_var __devinitdata = {
 	.activate = 0,
 	.height = -1,
 	.width = -1,
-	.pixclock = 46666,	/* 46us - AUO display */
 	.accel_flags = 0,
 	.left_margin = LEFT_MARGIN,
 	.right_margin = RIGHT_MARGIN,
@@ -1048,6 +1048,24 @@ static struct fb_ops da8xx_fb_ops = {
 	.fb_blank = cfb_blank,
 };
 
+/*
+ * Calculate and return pixel clock period in pico secods
+ */
+static unsigned int da8xxfb_pixel_clk_period(struct da8xx_fb_par *par)
+{
+	unsigned int lcd_clk, div;
+	unsigned int configured_pix_clk;
+	unsigned long long pix_clk_period_picosec = 1000000000000ULL;
+
+	lcd_clk = clk_get_rate(par->lcdc_clk);
+	div = lcd_clk / par->pxl_clk;
+	configured_pix_clk = (lcd_clk / div);
+
+	do_div(pix_clk_period_picosec, configured_pix_clk);
+
+	return pix_clk_period_picosec;
+}
+
 static int __devinit fb_probe(struct platform_device *device)
 {
 	struct da8xx_lcdc_platform_data *fb_pdata @@ -1209,6 +1227,7 @@ static int __devinit fb_probe(struct platform_device *device)
 
 	da8xx_fb_var.hsync_len = lcdc_info->hsw;
 	da8xx_fb_var.vsync_len = lcdc_info->vsw;
+	da8xx_fb_var.pixclock = da8xxfb_pixel_clk_period(par);
 
 	/* Initialize fbinfo */
 	da8xx_fb_info->flags = FBINFO_FLAG_DEFAULT;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] video: da8xx-fb: Fix build warning on unused label
  2012-02-09  5:16 [PATCH] video: da8xx-fb: Fix build warning on unused label Manjunathappa, Prakash
  2012-02-09  5:16 ` [PATCH] video:da8xx-fb: calculate pixel clock period for the panel Manjunathappa, Prakash
@ 2012-02-13 21:27 ` Florian Tobias Schandinat
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Tobias Schandinat @ 2012-02-13 21:27 UTC (permalink / raw)
  To: Manjunathappa, Prakash
  Cc: linux-fbdev, davinci-linux-open-source, linux-kernel

On 02/09/2012 05:04 AM, Manjunathappa, Prakash wrote:
> Patch fixes build warning on label "err_cpu_freq" when CONFIG_CPU_FREQ
> is not defined.
> 
> Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>

Applied.


Thanks,

Florian Tobias Schandinat

> ---
>  drivers/video/da8xx-fb.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
> index 29577bf..f360d62 100644
> --- a/drivers/video/da8xx-fb.c
> +++ b/drivers/video/da8xx-fb.c
> @@ -1264,8 +1264,8 @@ static int __devinit fb_probe(struct platform_device *device)
>  irq_freq:
>  #ifdef CONFIG_CPU_FREQ
>  	lcd_da8xx_cpufreq_deregister(par);
> -#endif
>  err_cpu_freq:
> +#endif
>  	unregister_framebuffer(da8xx_fb_info);
>  
>  err_dealloc_cmap:


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-13 21:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-09  5:16 [PATCH] video: da8xx-fb: Fix build warning on unused label Manjunathappa, Prakash
2012-02-09  5:16 ` [PATCH] video:da8xx-fb: calculate pixel clock period for the panel Manjunathappa, Prakash
2012-02-13 21:27 ` [PATCH] video: da8xx-fb: Fix build warning on unused label 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).