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>
25 #include <linux/platform_device.h>
27 #include <asm/arch/gpio.h>
28 #include <asm/arch/omapfb.h>
30 #define MODULE_NAME "omapfb-lcd_h3"
32 #define pr_err(fmt, args...) printk(KERN_ERR MODULE_NAME ": " fmt, ## args)
34 static int innovator1610_panel_init(struct lcd_panel *panel,
35 struct omapfb_device *fbdev)
39 if (omap_request_gpio(14)) {
40 pr_err("can't request GPIO 14\n");
44 if (omap_request_gpio(15)) {
45 pr_err("can't request GPIO 15\n");
50 /* configure GPIO(14, 15) as outputs */
51 omap_set_gpio_direction(14, 0);
52 omap_set_gpio_direction(15, 0);
57 static void innovator1610_panel_cleanup(struct lcd_panel *panel)
63 static int innovator1610_panel_enable(struct lcd_panel *panel)
65 /* set GPIO14 and GPIO15 high */
66 omap_set_gpio_dataout(14, 1);
67 omap_set_gpio_dataout(15, 1);
71 static void innovator1610_panel_disable(struct lcd_panel *panel)
73 /* set GPIO13, GPIO14 and GPIO15 low */
74 omap_set_gpio_dataout(14, 0);
75 omap_set_gpio_dataout(15, 0);
78 static unsigned long innovator1610_panel_get_caps(struct lcd_panel *panel)
83 struct lcd_panel innovator1610_panel = {
85 .config = OMAP_LCDC_PANEL_TFT,
100 .init = innovator1610_panel_init,
101 .cleanup = innovator1610_panel_cleanup,
102 .enable = innovator1610_panel_enable,
103 .disable = innovator1610_panel_disable,
104 .get_caps = innovator1610_panel_get_caps,
107 static int innovator1610_panel_probe(struct platform_device *pdev)
109 omapfb_register_panel(&innovator1610_panel);
113 static int innovator1610_panel_remove(struct platform_device *pdev)
118 static int innovator1610_panel_suspend(struct platform_device *pdev, pm_message_t mesg)
123 static int innovator1610_panel_resume(struct platform_device *pdev)
128 struct platform_driver innovator1610_panel_driver = {
129 .probe = innovator1610_panel_probe,
130 .remove = innovator1610_panel_remove,
131 .suspend = innovator1610_panel_suspend,
132 .resume = innovator1610_panel_resume,
134 .name = "lcd_inn1610",
135 .owner = THIS_MODULE,
139 static int innovator1610_panel_drv_init(void)
141 return platform_driver_register(&innovator1610_panel_driver);
144 static void innovator1610_panel_drv_cleanup(void)
146 platform_driver_unregister(&innovator1610_panel_driver);
149 module_init(innovator1610_panel_drv_init);
150 module_exit(innovator1610_panel_drv_cleanup);