1 diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
2 index 0c0cbfc..c992cc7 100644
3 --- a/arch/arm/mach-omap2/board-omap3beagle.c
4 +++ b/arch/arm/mach-omap2/board-omap3beagle.c
5 @@ -63,12 +63,23 @@ static struct platform_device omap3_beagle_twl4030rtc_device = {
9 +static struct platform_device omap3_beagle_lcd_device = {
10 + .name = "omap3beagle_lcd",
14 +static struct omap_lcd_config omap3_beagle_lcd_config __initdata = {
15 + .ctrl_name = "internal",
18 static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
19 { OMAP_TAG_UART, &omap3_beagle_uart_config },
20 { OMAP_TAG_MMC, &omap3beagle_mmc_config },
21 + { OMAP_TAG_LCD, &omap3_beagle_lcd_config },
24 static struct platform_device *omap3_beagle_devices[] __initdata = {
25 + &omap3_beagle_lcd_device,
26 #ifdef CONFIG_RTC_DRV_TWL4030
27 &omap3_beagle_twl4030rtc_device,
29 diff --git a/drivers/video/omap/Makefile b/drivers/video/omap/Makefile
30 index cad6a68..fe7ee5d 100644
31 --- a/drivers/video/omap/Makefile
32 +++ b/drivers/video/omap/Makefile
33 @@ -32,6 +32,7 @@ objs-y$(CONFIG_MACH_OMAP_APOLLON) += lcd_apollon.o
34 objs-y$(CONFIG_MACH_OMAP_2430SDP) += lcd_2430sdp.o
35 objs-y$(CONFIG_MACH_OMAP_3430SDP) += lcd_2430sdp.o
36 objs-y$(CONFIG_MACH_OMAP3EVM) += lcd_omap3evm.o
37 +objs-y$(CONFIG_MACH_OMAP3_BEAGLE) += lcd_omap3beagle.o
38 objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o
40 omapfb-objs := $(objs-yy)
41 diff --git a/drivers/video/omap/lcd_omap3beagle.c b/drivers/video/omap/lcd_omap3beagle.c
43 index 0000000..d49101a
45 +++ b/drivers/video/omap/lcd_omap3beagle.c
48 + * LCD panel support for the TI OMAP3 Beagle board
50 + * Author: Koen Kooi <koen@openembedded.org>
52 + * Derived from drivers/video/omap/lcd-omap3evm.c
54 + * This program is free software; you can redistribute it and/or modify it
55 + * under the terms of the GNU General Public License as published by the
56 + * Free Software Foundation; either version 2 of the License, or (at your
57 + * option) any later version.
59 + * This program is distributed in the hope that it will be useful, but
60 + * WITHOUT ANY WARRANTY; without even the implied warranty of
61 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
62 + * General Public License for more details.
64 + * You should have received a copy of the GNU General Public License along
65 + * with this program; if not, write to the Free Software Foundation, Inc.,
66 + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
69 +#include <linux/module.h>
70 +#include <linux/platform_device.h>
71 +#include <linux/i2c/twl4030.h>
73 +#include <asm/arch/gpio.h>
74 +#include <asm/arch/mux.h>
75 +#include <asm/arch/omapfb.h>
76 +#include <asm/mach-types.h>
78 +#define LCD_PANEL_ENABLE_GPIO 170
80 +#define LCD_XRES 1024
82 +#define LCD_PIXCLOCK_MAX 64000 /* in pico seconds */
83 +#define LCD_PIXCLOCK_MIN 64000 /* in pico seconds */
85 +#define ENABLE_VDAC_DEDICATED 0x03
86 +#define ENABLE_VDAC_DEV_GRP 0x20
87 +#define ENABLE_VPLL2_DEDICATED 0x05
88 +#define ENABLE_VPLL2_DEV_GRP 0xE0
90 +static int omap3beagle_panel_init(struct lcd_panel *panel,
91 + struct omapfb_device *fbdev)
93 + omap_request_gpio(LCD_PANEL_ENABLE_GPIO);
98 +static void omap3beagle_panel_cleanup(struct lcd_panel *panel)
102 +static int omap3beagle_panel_enable(struct lcd_panel *panel)
104 + omap_set_gpio_dataout(LCD_PANEL_ENABLE_GPIO, 1);
108 +static void omap3beagle_panel_disable(struct lcd_panel *panel)
110 + omap_set_gpio_dataout(LCD_PANEL_ENABLE_GPIO, 0);
113 +static unsigned long omap3beagle_panel_get_caps(struct lcd_panel *panel)
118 +struct lcd_panel omap3beagle_panel = {
119 + .name = "omap3beagle",
120 + .config = OMAP_LCDC_PANEL_TFT,
126 + .hsw = 3, /* hsync_len (4) - 1 */
127 + .hfp = 3, /* right_margin (4) - 1 */
128 + .hbp = 39, /* left_margin (40) - 1 */
129 + .vsw = 1, /* vsync_len (2) - 1 */
130 + .vfp = 2, /* lower_margin */
131 + .vbp = 7, /* upper_margin (8) - 1 */
133 + .pixel_clock = LCD_PIXCLOCK_MAX,
135 + .init = omap3beagle_panel_init,
136 + .cleanup = omap3beagle_panel_cleanup,
137 + .enable = omap3beagle_panel_enable,
138 + .disable = omap3beagle_panel_disable,
139 + .get_caps = omap3beagle_panel_get_caps,
142 +static int omap3beagle_panel_probe(struct platform_device *pdev)
144 + omapfb_register_panel(&omap3beagle_panel);
148 +static int omap3beagle_panel_remove(struct platform_device *pdev)
153 +static int omap3beagle_panel_suspend(struct platform_device *pdev,
159 +static int omap3beagle_panel_resume(struct platform_device *pdev)
164 +struct platform_driver omap3beagle_panel_driver = {
165 + .probe = omap3beagle_panel_probe,
166 + .remove = omap3beagle_panel_remove,
167 + .suspend = omap3beagle_panel_suspend,
168 + .resume = omap3beagle_panel_resume,
170 + .name = "omap3beagle_lcd",
171 + .owner = THIS_MODULE,
175 +static int __init omap3beagle_panel_drv_init(void)
177 + return platform_driver_register(&omap3beagle_panel_driver);
180 +static void __exit omap3beagle_panel_drv_exit(void)
182 + platform_driver_unregister(&omap3beagle_panel_driver);
185 +module_init(omap3beagle_panel_drv_init);
186 +module_exit(omap3beagle_panel_drv_exit);