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 <mach/gpio.h>
26 #include <mach/omapfb.h>
28 #define MODULE_NAME "omapfb-lcd_h3"
30 static int innovator1610_panel_init(struct lcd_panel
*panel
,
31 struct omapfb_device
*fbdev
)
35 if (gpio_request(14, "lcd_en0")) {
36 pr_err(MODULE_NAME
": can't request GPIO 14\n");
40 if (gpio_request(15, "lcd_en1")) {
41 pr_err(MODULE_NAME
": can't request GPIO 15\n");
46 /* configure GPIO(14, 15) as outputs */
47 gpio_direction_output(14, 0);
48 gpio_direction_output(15, 0);
53 static void innovator1610_panel_cleanup(struct lcd_panel
*panel
)
59 static int innovator1610_panel_enable(struct lcd_panel
*panel
)
61 /* set GPIO14 and GPIO15 high */
62 gpio_set_value(14, 1);
63 gpio_set_value(15, 1);
67 static void innovator1610_panel_disable(struct lcd_panel
*panel
)
69 /* set GPIO13, GPIO14 and GPIO15 low */
70 gpio_set_value(14, 0);
71 gpio_set_value(15, 0);
74 static unsigned long innovator1610_panel_get_caps(struct lcd_panel
*panel
)
79 struct lcd_panel innovator1610_panel
= {
81 .config
= OMAP_LCDC_PANEL_TFT
,
96 .init
= innovator1610_panel_init
,
97 .cleanup
= innovator1610_panel_cleanup
,
98 .enable
= innovator1610_panel_enable
,
99 .disable
= innovator1610_panel_disable
,
100 .get_caps
= innovator1610_panel_get_caps
,
103 static int innovator1610_panel_probe(struct platform_device
*pdev
)
105 omapfb_register_panel(&innovator1610_panel
);
109 static int innovator1610_panel_remove(struct platform_device
*pdev
)
114 static int innovator1610_panel_suspend(struct platform_device
*pdev
,
120 static int innovator1610_panel_resume(struct platform_device
*pdev
)
125 struct platform_driver innovator1610_panel_driver
= {
126 .probe
= innovator1610_panel_probe
,
127 .remove
= innovator1610_panel_remove
,
128 .suspend
= innovator1610_panel_suspend
,
129 .resume
= innovator1610_panel_resume
,
131 .name
= "lcd_inn1610",
132 .owner
= THIS_MODULE
,
136 static int innovator1610_panel_drv_init(void)
138 return platform_driver_register(&innovator1610_panel_driver
);
141 static void innovator1610_panel_drv_cleanup(void)
143 platform_driver_unregister(&innovator1610_panel_driver
);
146 module_init(innovator1610_panel_drv_init
);
147 module_exit(innovator1610_panel_drv_cleanup
);