1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2016 Freescale Semiconductor, Inc.
5 * FSL DCU Framebuffer driver
9 #include <fsl_dcu_fb.h>
11 #include "../common/dcu_sii9022a.h"
13 DECLARE_GLOBAL_DATA_PTR;
15 unsigned int dcu_set_pixel_clock(unsigned int pixclock)
17 unsigned long long div;
19 div = (unsigned long long)(gd->bus_clk / 1000);
20 div *= (unsigned long long)pixclock;
21 do_div(div, 1000000000);
26 int platform_dcu_init(struct fb_info *fbinfo,
27 unsigned int xres, unsigned int yres,
29 struct fb_videomode *dcu_fb_videomode)
32 unsigned int pixel_format;
34 if (strncmp(port, "twr_lcd", 4) == 0) {
35 name = "TWR_LCD_RGB card";
38 dcu_set_dvi_encoder(dcu_fb_videomode);
41 printf("DCU: Switching to %s monitor @ %ux%u\n", name, xres, yres);
44 fsl_dcu_init(fbinfo, xres, yres, pixel_format);