Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Patrick Bruenn | ba81b04 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2015 Beckhoff Automation GmbH & Co. KG |
| 4 | * Patrick Bruenn <p.bruenn@beckhoff.com> |
| 5 | * |
| 6 | * Based on <u-boot>/board/freescale/mx53loco/mx53loco_video.c |
| 7 | * Copyright (C) 2012 Freescale Semiconductor, Inc. |
Patrick Bruenn | ba81b04 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 8 | */ |
| 9 | |
Patrick Bruenn | ba81b04 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 10 | #include <asm/arch/iomux-mx53.h> |
Steffen Dirkwinkel | 3173618 | 2019-04-17 13:57:17 +0200 | [diff] [blame] | 11 | #include <asm/gpio.h> |
| 12 | #include <asm/mach-imx/video.h> |
Patrick Bruenn | ba81b04 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 13 | |
| 14 | #define CX9020_DVI_PWD IMX_GPIO_NR(6, 1) |
| 15 | |
Steffen Dirkwinkel | 3173618 | 2019-04-17 13:57:17 +0200 | [diff] [blame] | 16 | struct display_info_t const displays[] = {{ |
| 17 | .bus = -1, |
| 18 | .addr = 0, |
| 19 | .pixfmt = IPU_PIX_FMT_RGB24, |
| 20 | .detect = NULL, |
| 21 | .enable = NULL, |
| 22 | .mode = { |
| 23 | .name = "DVI", |
| 24 | .refresh = 60, |
| 25 | .xres = 640, |
| 26 | .yres = 480, |
| 27 | .pixclock = 39721, /* picosecond (25.175 MHz) */ |
| 28 | .left_margin = 40, |
| 29 | .right_margin = 60, |
| 30 | .upper_margin = 10, |
| 31 | .lower_margin = 10, |
| 32 | .hsync_len = 20, |
| 33 | .vsync_len = 10, |
| 34 | .sync = 0, |
| 35 | .vmode = FB_VMODE_NONINTERLACED |
| 36 | } } }; |
| 37 | size_t display_count = ARRAY_SIZE(displays); |
Patrick Bruenn | ba81b04 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 38 | |
| 39 | void setup_iomux_lcd(void) |
| 40 | { |
| 41 | /* Turn on DVI_PWD */ |
| 42 | imx_iomux_v3_setup_pad(MX53_PAD_CSI0_DAT15__GPIO6_1); |
Steffen Dirkwinkel | 098e9ef | 2019-04-17 13:57:14 +0200 | [diff] [blame] | 43 | gpio_request(CX9020_DVI_PWD, "CX9020_DVI_PWD"); |
Patrick Bruenn | ba81b04 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 44 | gpio_direction_output(CX9020_DVI_PWD, 1); |
| 45 | } |