2 * File: drivers/video/omap/lcd-inn1610.c
4 * LCD panel support for the TI OMAP1610 Innovator board
6 * Copyright (C) 2004 Nokia Corporation
7 * Author: Imre Deak <imre.deak@nokia.com>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #include <linux/module.h>
26 #include <asm/arch/gpio.h>
27 #include <asm/arch/omapfb.h>
29 /* #define OMAPFB_DBG 1 */
33 #define MODULE_NAME "omapfb-lcd_h3"
35 #define pr_err(fmt, args...) printk(KERN_ERR MODULE_NAME ": " fmt, ## args)
37 static int innovator1610_panel_init(struct omapfb_device *fbdev)
43 if (omap_request_gpio(14)) {
44 pr_err("can't request GPIO 14\n");
48 if (omap_request_gpio(15)) {
49 pr_err("can't request GPIO 15\n");
54 /* configure GPIO(14, 15) as outputs */
55 omap_set_gpio_direction(14, 0);
56 omap_set_gpio_direction(15, 0);
62 static void innovator1610_panel_cleanup(void)
72 static int innovator1610_panel_enable(void)
76 /* set GPIO14 and GPIO15 high */
77 omap_set_gpio_dataout(14, 1);
78 omap_set_gpio_dataout(15, 1);
84 static void innovator1610_panel_disable(void)
88 /* set GPIO13, GPIO14 and GPIO15 low */
89 omap_set_gpio_dataout(14, 0);
90 omap_set_gpio_dataout(15, 0);
95 static unsigned long innovator1610_panel_get_caps(void)
100 struct lcd_panel innovator1610_panel = {
102 .config = OMAP_LCDC_PANEL_TFT,
108 .pixel_clock = 12500,
117 .init = innovator1610_panel_init,
118 .cleanup = innovator1610_panel_cleanup,
119 .enable = innovator1610_panel_enable,
120 .disable = innovator1610_panel_disable,
121 .get_caps = innovator1610_panel_get_caps,
124 static int innovator1610_panel_probe(struct platform_device *pdev)
127 omapfb_register_panel(&innovator1610_panel);
131 static int innovator1610_panel_remove(struct platform_device *pdev)
137 static int innovator1610_panel_suspend(struct platform_device *pdev, pm_message_t mesg)
143 static int innovator1610_panel_resume(struct platform_device *pdev)
149 struct platform_driver innovator1610_panel_driver = {
150 .probe = innovator1610_panel_probe,
151 .remove = innovator1610_panel_remove,
152 .suspend = innovator1610_panel_suspend,
153 .resume = innovator1610_panel_resume,
155 .name = "lcd_inn1610",
156 .owner = THIS_MODULE,
160 static int innovator1610_panel_drv_init(void)
162 return platform_driver_register(&innovator1610_panel_driver);
165 static void innovator1610_panel_drv_cleanup(void)
167 platform_driver_unregister(&innovator1610_panel_driver);
170 module_init(innovator1610_panel_drv_init);
171 module_exit(innovator1610_panel_drv_cleanup);