]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/karo/tx6/tx6ul.c
karo: tx6: make pixelclock overridable via DT or 'video_mode'
[karo-tx-uboot.git] / board / karo / tx6 / tx6ul.c
index 6d3022ab83337878a5101d47e81ea3272ce31bae..bdb198001860684501fc33ce6a446d9321a8c7a8 100644 (file)
@@ -1240,10 +1240,13 @@ void lcd_ctrl_init(void *lcdbase)
                panel_info.vl_bpix = LCD_COLOR32;
        }
 
-       p->pixclock = KHZ2PICOS(refresh *
-               (p->xres + p->left_margin + p->right_margin + p->hsync_len) *
-               (p->yres + p->upper_margin + p->lower_margin + p->vsync_len) /
-                               1000);
+       if (refresh_set || p->pixclock == 0)
+               p->pixclock = KHZ2PICOS(refresh *
+                                       (p->xres + p->left_margin +
+                                        p->right_margin + p->hsync_len) *
+                                       (p->yres + p->upper_margin +
+                                        p->lower_margin + p->vsync_len) /
+                                       1000);
        debug("Pixel clock set to %lu.%03lu MHz\n",
              PICOS2KHZ(p->pixclock) / 1000, PICOS2KHZ(p->pixclock) % 1000);