From: Lothar Waßmann Date: Thu, 9 May 2019 13:39:46 +0000 (+0200) Subject: karo: tx6: make pixelclock overridable via DT or 'video_mode' X-Git-Tag: KARO-TX6-2019-07-31~12 X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=commitdiff_plain;h=3282f92901200a6499ae7b4991887a62cbae3698 karo: tx6: make pixelclock overridable via DT or 'video_mode' --- diff --git a/board/karo/tx6/tx6qdl.c b/board/karo/tx6/tx6qdl.c index b4a6fa9390..b1b9f54ccf 100644 --- a/board/karo/tx6/tx6qdl.c +++ b/board/karo/tx6/tx6qdl.c @@ -1296,10 +1296,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); diff --git a/board/karo/tx6/tx6ul.c b/board/karo/tx6/tx6ul.c index 6d3022ab83..bdb1980018 100644 --- a/board/karo/tx6/tx6ul.c +++ b/board/karo/tx6/tx6ul.c @@ -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);