2 * LCD panel support for the TI OMAP3 Beagle board
4 * Author: Koen Kooi <koen@openembedded.org>
6 * Derived from drivers/video/omap/lcd-omap3evm.c
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #include <linux/module.h>
24 #include <linux/platform_device.h>
25 #include <linux/gpio.h>
26 #include <linux/i2c/twl.h>
28 #include <asm/mach-types.h>
32 #define LCD_PANEL_ENABLE_GPIO 170
34 static int omap3beagle_panel_init(struct lcd_panel
*panel
,
35 struct omapfb_device
*fbdev
)
37 gpio_request(LCD_PANEL_ENABLE_GPIO
, "LCD enable");
41 static void omap3beagle_panel_cleanup(struct lcd_panel
*panel
)
43 gpio_free(LCD_PANEL_ENABLE_GPIO
);
46 static int omap3beagle_panel_enable(struct lcd_panel
*panel
)
48 gpio_set_value(LCD_PANEL_ENABLE_GPIO
, 1);
52 static void omap3beagle_panel_disable(struct lcd_panel
*panel
)
54 gpio_set_value(LCD_PANEL_ENABLE_GPIO
, 0);
57 static unsigned long omap3beagle_panel_get_caps(struct lcd_panel
*panel
)
62 struct lcd_panel omap3beagle_panel
= {
63 .name
= "omap3beagle",
64 .config
= OMAP_LCDC_PANEL_TFT
,
70 .hsw
= 3, /* hsync_len (4) - 1 */
71 .hfp
= 3, /* right_margin (4) - 1 */
72 .hbp
= 39, /* left_margin (40) - 1 */
73 .vsw
= 1, /* vsync_len (2) - 1 */
74 .vfp
= 2, /* lower_margin */
75 .vbp
= 7, /* upper_margin (8) - 1 */
79 .init
= omap3beagle_panel_init
,
80 .cleanup
= omap3beagle_panel_cleanup
,
81 .enable
= omap3beagle_panel_enable
,
82 .disable
= omap3beagle_panel_disable
,
83 .get_caps
= omap3beagle_panel_get_caps
,
86 static int omap3beagle_panel_probe(struct platform_device
*pdev
)
88 omapfb_register_panel(&omap3beagle_panel
);
92 static int omap3beagle_panel_remove(struct platform_device
*pdev
)
97 static int omap3beagle_panel_suspend(struct platform_device
*pdev
,
103 static int omap3beagle_panel_resume(struct platform_device
*pdev
)
108 struct platform_driver omap3beagle_panel_driver
= {
109 .probe
= omap3beagle_panel_probe
,
110 .remove
= omap3beagle_panel_remove
,
111 .suspend
= omap3beagle_panel_suspend
,
112 .resume
= omap3beagle_panel_resume
,
114 .name
= "omap3beagle_lcd",
115 .owner
= THIS_MODULE
,
119 static int __init
omap3beagle_panel_drv_init(void)
121 return platform_driver_register(&omap3beagle_panel_driver
);
124 static void __exit
omap3beagle_panel_drv_exit(void)
126 platform_driver_unregister(&omap3beagle_panel_driver
);
129 module_init(omap3beagle_panel_drv_init
);
130 module_exit(omap3beagle_panel_drv_exit
);