GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / drivers / video / omap / lcd_inn1610.c
blob2e50467a114ae41cefb25e89eef94cb469bc1925
1 /*
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 "omapfb.h"
28 #define MODULE_NAME "omapfb-lcd_h3"
30 static int innovator1610_panel_init(struct lcd_panel *panel,
31 struct omapfb_device *fbdev)
33 int r = 0;
35 if (gpio_request(14, "lcd_en0")) {
36 pr_err(MODULE_NAME ": can't request GPIO 14\n");
37 r = -1;
38 goto exit;
40 if (gpio_request(15, "lcd_en1")) {
41 pr_err(MODULE_NAME ": can't request GPIO 15\n");
42 gpio_free(14);
43 r = -1;
44 goto exit;
46 /* configure GPIO(14, 15) as outputs */
47 gpio_direction_output(14, 0);
48 gpio_direction_output(15, 0);
49 exit:
50 return r;
53 static void innovator1610_panel_cleanup(struct lcd_panel *panel)
55 gpio_free(15);
56 gpio_free(14);
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);
64 return 0;
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)
76 return 0;
79 struct lcd_panel innovator1610_panel = {
80 .name = "inn1610",
81 .config = OMAP_LCDC_PANEL_TFT,
83 .bpp = 16,
84 .data_lines = 16,
85 .x_res = 320,
86 .y_res = 240,
87 .pixel_clock = 12500,
88 .hsw = 40,
89 .hfp = 40,
90 .hbp = 72,
91 .vsw = 1,
92 .vfp = 1,
93 .vbp = 0,
94 .pcd = 12,
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);
106 return 0;
109 static int innovator1610_panel_remove(struct platform_device *pdev)
111 return 0;
114 static int innovator1610_panel_suspend(struct platform_device *pdev,
115 pm_message_t mesg)
117 return 0;
120 static int innovator1610_panel_resume(struct platform_device *pdev)
122 return 0;
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,
130 .driver = {
131 .name = "lcd_inn1610",
132 .owner = THIS_MODULE,
136 static int __init innovator1610_panel_drv_init(void)
138 return platform_driver_register(&innovator1610_panel_driver);
141 static void __exit 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);