2 * Copyright (C) 2012 Freescale Semiconductor, Inc.
3 * Fabio Estevam <fabio.estevam@freescale.com>
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 #include <linux/list.h>
27 #include <asm/arch/iomux.h>
29 #include <ipu_pixfmt.h>
31 #define MX51EVK_LCD_3V3 IMX_GPIO_NR(4, 9)
32 #define MX51EVK_LCD_5V IMX_GPIO_NR(4, 10)
33 #define MX51EVK_LCD_BACKLIGHT IMX_GPIO_NR(3, 4)
35 static struct fb_videomode const claa_wvga = {
36 .name = "CLAA07LC0ACW",
48 .vmode = FB_VMODE_NONINTERLACED
51 static struct fb_videomode const dvi = {
64 .vmode = FB_VMODE_NONINTERLACED
67 void setup_iomux_lcd(void)
70 mxc_request_iomux(MX51_PIN_DI_GP4, IOMUX_CONFIG_ALT4);
72 /* Pad settings for MX51_PIN_DI2_DISP_CLK */
73 mxc_iomux_set_pad(MX51_PIN_DI2_DISP_CLK, PAD_CTL_HYS_NONE |
74 PAD_CTL_PKE_ENABLE | PAD_CTL_PUE_KEEPER |
75 PAD_CTL_DRV_MAX | PAD_CTL_SRE_SLOW);
77 /* Turn on 3.3V voltage for LCD */
78 mxc_request_iomux(MX51_PIN_CSI2_D12, IOMUX_CONFIG_ALT3);
79 gpio_direction_output(MX51EVK_LCD_3V3, 1);
81 /* Turn on 5V voltage for LCD */
82 mxc_request_iomux(MX51_PIN_CSI2_D13, IOMUX_CONFIG_ALT3);
83 gpio_direction_output(MX51EVK_LCD_5V, 1);
85 /* Turn on GPIO backlight */
86 mxc_request_iomux(MX51_PIN_DI1_D1_CS, IOMUX_CONFIG_ALT4);
87 mxc_iomux_set_input(MX51_GPIO3_IPP_IND_G_IN_4_SELECT_INPUT,
89 gpio_direction_output(MX51EVK_LCD_BACKLIGHT, 1);
92 int board_video_skip(void)
95 char const *e = getenv("panel");
98 if (strcmp(e, "claa") == 0) {
99 ret = ipuv3_fb_init(&claa_wvga, 1, IPU_PIX_FMT_RGB565);
101 printf("claa cannot be configured: %d\n", ret);
107 * 'panel' env variable not found or has different value than 'claa'
108 * Defaulting to dvi output.
110 ret = ipuv3_fb_init(&dvi, 0, IPU_PIX_FMT_RGB24);
112 printf("dvi cannot be configured: %d\n", ret);