2 * LCD panel support for the TI OMAP1610 Innovator board
4 * Copyright (C) 2004 Nokia Corporation
5 * Author: Imre Deak <imre.deak@nokia.com>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #include <linux/module.h>
23 #include <linux/platform_device.h>
25 #include <asm/arch/gpio.h>
26 #include <asm/arch/omapfb.h>
28 #define MODULE_NAME "omapfb-lcd_h3"
30 #define pr_err(fmt, args...) printk(KERN_ERR MODULE_NAME ": " fmt, ## args)
32 static int innovator1610_panel_init(struct lcd_panel *panel,
33 struct omapfb_device *fbdev)
37 if (omap_request_gpio(14)) {
38 pr_err("can't request GPIO 14\n");
42 if (omap_request_gpio(15)) {
43 pr_err("can't request GPIO 15\n");
48 /* configure GPIO(14, 15) as outputs */
49 omap_set_gpio_direction(14, 0);
50 omap_set_gpio_direction(15, 0);
55 static void innovator1610_panel_cleanup(struct lcd_panel *panel)
61 static int innovator1610_panel_enable(struct lcd_panel *panel)
63 /* set GPIO14 and GPIO15 high */
64 omap_set_gpio_dataout(14, 1);
65 omap_set_gpio_dataout(15, 1);
69 static void innovator1610_panel_disable(struct lcd_panel *panel)
71 /* set GPIO13, GPIO14 and GPIO15 low */
72 omap_set_gpio_dataout(14, 0);
73 omap_set_gpio_dataout(15, 0);
76 static unsigned long innovator1610_panel_get_caps(struct lcd_panel *panel)
81 struct lcd_panel innovator1610_panel = {
83 .config = OMAP_LCDC_PANEL_TFT,
98 .init = innovator1610_panel_init,
99 .cleanup = innovator1610_panel_cleanup,
100 .enable = innovator1610_panel_enable,
101 .disable = innovator1610_panel_disable,
102 .get_caps = innovator1610_panel_get_caps,
105 static int innovator1610_panel_probe(struct platform_device *pdev)
107 omapfb_register_panel(&innovator1610_panel);
111 static int innovator1610_panel_remove(struct platform_device *pdev)
116 static int innovator1610_panel_suspend(struct platform_device *pdev,
122 static int innovator1610_panel_resume(struct platform_device *pdev)
127 struct platform_driver innovator1610_panel_driver = {
128 .probe = innovator1610_panel_probe,
129 .remove = innovator1610_panel_remove,
130 .suspend = innovator1610_panel_suspend,
131 .resume = innovator1610_panel_resume,
133 .name = "lcd_inn1610",
134 .owner = THIS_MODULE,
138 static int innovator1610_panel_drv_init(void)
140 return platform_driver_register(&innovator1610_panel_driver);
143 static void innovator1610_panel_drv_cleanup(void)
145 platform_driver_unregister(&innovator1610_panel_driver);
148 module_init(innovator1610_panel_drv_init);
149 module_exit(innovator1610_panel_drv_cleanup);