fsl-diu-fb: remove check for pixel clock ranges
authorTimur Tabi <timur@freescale.com>
Thu, 23 Jun 2011 20:20:26 +0000 (20:20 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Fri, 24 Jun 2011 08:08:49 +0000 (17:08 +0900)
The Freescale DIU framebuffer driver defines two constants, MIN_PIX_CLK and
MAX_PIX_CLK, that are supposed to represent the lower and upper limits of
the pixel clock.  These values, however, are true only for one platform
clock rate (533MHz) and only for the MPC8610.  So the actual range for
the pixel clock is chip-specific, which means the current values are almost
always wrong.  The chance of an out-of-range pixel clock being used are also
remote.

Rather than try to detect an out-of-range clock in the DIU driver, we depend
on the board-specific pixel clock function (e.g. p1022ds_set_pixel_clock)
to clamp the pixel clock to a supported value.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
drivers/video/fsl-diu-fb.c
include/linux/fsl-diu-fb.h

index bedf5be27f05352bf01f35f945e0d07ebd5e3fcf..0acc7d65aeaade67e5ce3d1188d030d5d842d159 100644 (file)
@@ -555,8 +555,6 @@ static void adjust_aoi_size_position(struct fb_var_screeninfo *var,
 static int fsl_diu_check_var(struct fb_var_screeninfo *var,
                                struct fb_info *info)
 {
-       unsigned long htotal, vtotal;
-
        pr_debug("check_var xres: %d\n", var->xres);
        pr_debug("check_var yres: %d\n", var->yres);
 
@@ -635,20 +633,6 @@ static int fsl_diu_check_var(struct fb_var_screeninfo *var,
 
                break;
        }
-       /* If the pixclock is below the minimum spec'd value then set to
-        * refresh rate for 60Hz since this is supported by most monitors.
-        * Refer to Documentation/fb/ for calculations.
-        */
-       if ((var->pixclock < MIN_PIX_CLK) || (var->pixclock > MAX_PIX_CLK)) {
-               htotal = var->xres + var->right_margin + var->hsync_len +
-                   var->left_margin;
-               vtotal = var->yres + var->lower_margin + var->vsync_len +
-                   var->upper_margin;
-               var->pixclock = (vtotal * htotal * 6UL) / 100UL;
-               var->pixclock = KHZ2PICOS(var->pixclock);
-               pr_debug("pixclock set for 60Hz refresh = %u ps\n",
-                       var->pixclock);
-       }
 
        var->height = -1;
        var->width = -1;
index 781d4671415f9c5f25aaa50250a06190ea91f0bb..daa9952d2174ad811cab346e9842d932079dd87c 100644 (file)
  * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory()
  */
 #define MEM_ALLOC_THRESHOLD (1024*768*4+32)
-/* Minimum value that the pixel clock can be set to in pico seconds
- * This is determined by platform clock/3 where the minimum platform
- * clock is 533MHz. This gives 5629 pico seconds.
- */
-#define MIN_PIX_CLK 5629
-#define MAX_PIX_CLK 96096
 
 #include <linux/types.h>
 
This page took 0.028632 seconds and 5 git commands to generate.