1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2012 Freescale Semiconductor, Inc.
8 #include <linux/list.h>
10 #include <asm/arch/iomux-mx51.h>
12 #include <ipu_pixfmt.h>
14 #define MX51EVK_LCD_3V3 IMX_GPIO_NR(4, 9)
15 #define MX51EVK_LCD_5V IMX_GPIO_NR(4, 10)
16 #define MX51EVK_LCD_BACKLIGHT IMX_GPIO_NR(3, 4)
18 static struct fb_videomode const claa_wvga = {
19 .name = "CLAA07LC0ACW",
31 .vmode = FB_VMODE_NONINTERLACED
34 static struct fb_videomode const dvi = {
47 .vmode = FB_VMODE_NONINTERLACED
50 void setup_iomux_lcd(void)
53 imx_iomux_v3_setup_pad(MX51_PAD_DI_GP4__DI2_PIN15);
55 /* Pad settings for DI2_DISP_CLK */
56 imx_iomux_v3_setup_pad(NEW_PAD_CTRL(MX51_PAD_DI2_DISP_CLK__DI2_DISP_CLK,
57 PAD_CTL_PKE | PAD_CTL_DSE_MAX | PAD_CTL_SRE_SLOW));
59 /* Turn on 3.3V voltage for LCD */
60 imx_iomux_v3_setup_pad(NEW_PAD_CTRL(MX51_PAD_CSI2_D12__GPIO4_9,
62 gpio_direction_output(MX51EVK_LCD_3V3, 1);
64 /* Turn on 5V voltage for LCD */
65 imx_iomux_v3_setup_pad(NEW_PAD_CTRL(MX51_PAD_CSI2_D13__GPIO4_10,
67 gpio_direction_output(MX51EVK_LCD_5V, 1);
69 /* Turn on GPIO backlight */
70 imx_iomux_v3_setup_pad(NEW_PAD_CTRL(MX51_PAD_DI1_D1_CS__GPIO3_4,
72 gpio_direction_output(MX51EVK_LCD_BACKLIGHT, 1);
75 int board_video_skip(void)
78 char const *e = env_get("panel");
81 if (strcmp(e, "claa") == 0) {
82 ret = ipuv3_fb_init(&claa_wvga, 1, IPU_PIX_FMT_RGB565);
84 printf("claa cannot be configured: %d\n", ret);
90 * 'panel' env variable not found or has different value than 'claa'
91 * Defaulting to dvi output.
93 ret = ipuv3_fb_init(&dvi, 0, IPU_PIX_FMT_RGB24);
95 printf("dvi cannot be configured: %d\n", ret);