1 From 75b8dbeed8f53ffb7edc58b2393084fe2346477e Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@openembedded.org>
3 Date: Fri, 9 May 2008 20:54:00 +0200
4 Subject: [PATCH] omap3beagle: add driver to turn on the TFP410 framer to get DVI output
6 Signed-off-by: Koen Kooi <koen@openembedded.org>
8 arch/arm/mach-omap2/board-omap3beagle.c | 11 +++
9 drivers/video/omap/Makefile | 1 +
10 drivers/video/omap/lcd_omap3beagle.c | 135 +++++++++++++++++++++++++++++++
11 3 files changed, 147 insertions(+), 0 deletions(-)
12 create mode 100644 drivers/video/omap/lcd_omap3beagle.c
14 diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
15 index 0c0cbfc..c992cc7 100644
16 --- a/arch/arm/mach-omap2/board-omap3beagle.c
17 +++ b/arch/arm/mach-omap2/board-omap3beagle.c
18 @@ -63,12 +63,23 @@ static struct platform_device omap3_beagle_twl4030rtc_device = {
22 +static struct platform_device omap3_beagle_lcd_device = {
23 + .name = "omap3beagle_lcd",
27 +static struct omap_lcd_config omap3_beagle_lcd_config __initdata = {
28 + .ctrl_name = "internal",
31 static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
32 { OMAP_TAG_UART, &omap3_beagle_uart_config },
33 { OMAP_TAG_MMC, &omap3beagle_mmc_config },
34 + { OMAP_TAG_LCD, &omap3_beagle_lcd_config },
37 static struct platform_device *omap3_beagle_devices[] __initdata = {
38 + &omap3_beagle_lcd_device,
39 #ifdef CONFIG_RTC_DRV_TWL4030
40 &omap3_beagle_twl4030rtc_device,
42 diff --git a/drivers/video/omap/Makefile b/drivers/video/omap/Makefile
43 index cad6a68..fe7ee5d 100644
44 --- a/drivers/video/omap/Makefile
45 +++ b/drivers/video/omap/Makefile
46 @@ -32,6 +32,7 @@ objs-y$(CONFIG_MACH_OMAP_APOLLON) += lcd_apollon.o
47 objs-y$(CONFIG_MACH_OMAP_2430SDP) += lcd_2430sdp.o
48 objs-y$(CONFIG_MACH_OMAP_3430SDP) += lcd_2430sdp.o
49 objs-y$(CONFIG_MACH_OMAP3EVM) += lcd_omap3evm.o
50 +objs-y$(CONFIG_MACH_OMAP3_BEAGLE) += lcd_omap3beagle.o
51 objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o
53 omapfb-objs := $(objs-yy)
54 diff --git a/drivers/video/omap/lcd_omap3beagle.c b/drivers/video/omap/lcd_omap3beagle.c
56 index 0000000..f5b7466
58 +++ b/drivers/video/omap/lcd_omap3beagle.c
61 + * LCD panel support for the TI OMAP3 Beagle board
63 + * Author: Koen Kooi <koen@openembedded.org>
65 + * Derived from drivers/video/omap/lcd-omap3evm.c
67 + * This program is free software; you can redistribute it and/or modify it
68 + * under the terms of the GNU General Public License as published by the
69 + * Free Software Foundation; either version 2 of the License, or (at your
70 + * option) any later version.
72 + * This program is distributed in the hope that it will be useful, but
73 + * WITHOUT ANY WARRANTY; without even the implied warranty of
74 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
75 + * General Public License for more details.
77 + * You should have received a copy of the GNU General Public License along
78 + * with this program; if not, write to the Free Software Foundation, Inc.,
79 + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
82 +#include <linux/module.h>
83 +#include <linux/platform_device.h>
84 +#include <linux/i2c/twl4030.h>
86 +#include <asm/arch/gpio.h>
87 +#include <asm/arch/mux.h>
88 +#include <asm/arch/omapfb.h>
89 +#include <asm/mach-types.h>
91 +#define LCD_PANEL_ENABLE_GPIO 170
93 +#define LCD_XRES 1024
95 +#define LCD_PIXCLOCK_MAX 64000 /* in kHz */
96 +#define LCD_PIXCLOCK_MIN 64000 /* in kHz */
98 +static int omap3beagle_panel_init(struct lcd_panel *panel,
99 + struct omapfb_device *fbdev)
101 + omap_request_gpio(LCD_PANEL_ENABLE_GPIO);
106 +static void omap3beagle_panel_cleanup(struct lcd_panel *panel)
110 +static int omap3beagle_panel_enable(struct lcd_panel *panel)
112 + omap_set_gpio_dataout(LCD_PANEL_ENABLE_GPIO, 1);
116 +static void omap3beagle_panel_disable(struct lcd_panel *panel)
118 + omap_set_gpio_dataout(LCD_PANEL_ENABLE_GPIO, 0);
121 +static unsigned long omap3beagle_panel_get_caps(struct lcd_panel *panel)
126 +struct lcd_panel omap3beagle_panel = {
127 + .name = "omap3beagle",
128 + .config = OMAP_LCDC_PANEL_TFT,
134 + .hsw = 3, /* hsync_len (4) - 1 */
135 + .hfp = 3, /* right_margin (4) - 1 */
136 + .hbp = 39, /* left_margin (40) - 1 */
137 + .vsw = 1, /* vsync_len (2) - 1 */
138 + .vfp = 2, /* lower_margin */
139 + .vbp = 7, /* upper_margin (8) - 1 */
141 + .pixel_clock = LCD_PIXCLOCK_MAX,
143 + .init = omap3beagle_panel_init,
144 + .cleanup = omap3beagle_panel_cleanup,
145 + .enable = omap3beagle_panel_enable,
146 + .disable = omap3beagle_panel_disable,
147 + .get_caps = omap3beagle_panel_get_caps,
150 +static int omap3beagle_panel_probe(struct platform_device *pdev)
152 + omapfb_register_panel(&omap3beagle_panel);
156 +static int omap3beagle_panel_remove(struct platform_device *pdev)
161 +static int omap3beagle_panel_suspend(struct platform_device *pdev,
167 +static int omap3beagle_panel_resume(struct platform_device *pdev)
172 +struct platform_driver omap3beagle_panel_driver = {
173 + .probe = omap3beagle_panel_probe,
174 + .remove = omap3beagle_panel_remove,
175 + .suspend = omap3beagle_panel_suspend,
176 + .resume = omap3beagle_panel_resume,
178 + .name = "omap3beagle_lcd",
179 + .owner = THIS_MODULE,
183 +static int __init omap3beagle_panel_drv_init(void)
185 + return platform_driver_register(&omap3beagle_panel_driver);
188 +static void __exit omap3beagle_panel_drv_exit(void)
190 + platform_driver_unregister(&omap3beagle_panel_driver);
193 +module_init(omap3beagle_panel_drv_init);
194 +module_exit(omap3beagle_panel_drv_exit);