1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2012 Freescale Semiconductor, Inc.
9 #include <linux/list.h>
11 #include <asm/arch/iomux-mx51.h>
13 #include <ipu_pixfmt.h>
15 #define MX51EVK_LCD_3V3 IMX_GPIO_NR(4, 9)
16 #define MX51EVK_LCD_5V IMX_GPIO_NR(4, 10)
17 #define MX51EVK_LCD_BACKLIGHT IMX_GPIO_NR(3, 4)
19 static struct fb_videomode const claa_wvga = {
20 .name = "CLAA07LC0ACW",
32 .vmode = FB_VMODE_NONINTERLACED
35 static struct fb_videomode const dvi = {
48 .vmode = FB_VMODE_NONINTERLACED
51 void setup_iomux_lcd(void)
54 imx_iomux_v3_setup_pad(MX51_PAD_DI_GP4__DI2_PIN15);
56 /* Pad settings for DI2_DISP_CLK */
57 imx_iomux_v3_setup_pad(NEW_PAD_CTRL(MX51_PAD_DI2_DISP_CLK__DI2_DISP_CLK,
58 PAD_CTL_PKE | PAD_CTL_DSE_MAX | PAD_CTL_SRE_SLOW));
60 /* Turn on 3.3V voltage for LCD */
61 imx_iomux_v3_setup_pad(NEW_PAD_CTRL(MX51_PAD_CSI2_D12__GPIO4_9,
63 gpio_direction_output(MX51EVK_LCD_3V3, 1);
65 /* Turn on 5V voltage for LCD */
66 imx_iomux_v3_setup_pad(NEW_PAD_CTRL(MX51_PAD_CSI2_D13__GPIO4_10,
68 gpio_direction_output(MX51EVK_LCD_5V, 1);
70 /* Turn on GPIO backlight */
71 imx_iomux_v3_setup_pad(NEW_PAD_CTRL(MX51_PAD_DI1_D1_CS__GPIO3_4,
73 gpio_direction_output(MX51EVK_LCD_BACKLIGHT, 1);
76 int board_video_skip(void)
79 char const *e = env_get("panel");
82 if (strcmp(e, "claa") == 0) {
83 ret = ipuv3_fb_init(&claa_wvga, 1, IPU_PIX_FMT_RGB565);
85 printf("claa cannot be configured: %d\n", ret);
91 * 'panel' env variable not found or has different value than 'claa'
92 * Defaulting to dvi output.
94 ret = ipuv3_fb_init(&dvi, 0, IPU_PIX_FMT_RGB24);
96 printf("dvi cannot be configured: %d\n", ret);