2 * LCD panel support for the TI OMAP H3 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/tps65010.h>
27 #include <asm/arch/omapfb.h>
29 #define MODULE_NAME "omapfb-lcd_h3"
31 #define pr_err(fmt, args...) printk(KERN_ERR MODULE_NAME ": " fmt, ## args)
33 static int h3_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
38 static void h3_panel_cleanup(struct lcd_panel *panel)
42 static int h3_panel_enable(struct lcd_panel *panel)
46 /* GPIO1 and GPIO2 of TPS65010 send LCD_ENBKL and LCD_ENVDD signals */
47 r = tps65010_set_gpio_out_value(GPIO1, HIGH);
49 r = tps65010_set_gpio_out_value(GPIO2, HIGH);
51 pr_err("Unable to turn on LCD panel\n");
56 static void h3_panel_disable(struct lcd_panel *panel)
60 /* GPIO1 and GPIO2 of TPS65010 send LCD_ENBKL and LCD_ENVDD signals */
61 r = tps65010_set_gpio_out_value(GPIO1, LOW);
63 tps65010_set_gpio_out_value(GPIO2, LOW);
65 pr_err("Unable to turn off LCD panel\n");
68 static unsigned long h3_panel_get_caps(struct lcd_panel *panel)
73 struct lcd_panel h3_panel = {
75 .config = OMAP_LCDC_PANEL_TFT,
90 .init = h3_panel_init,
91 .cleanup = h3_panel_cleanup,
92 .enable = h3_panel_enable,
93 .disable = h3_panel_disable,
94 .get_caps = h3_panel_get_caps,
97 static int h3_panel_probe(struct platform_device *pdev)
99 omapfb_register_panel(&h3_panel);
103 static int h3_panel_remove(struct platform_device *pdev)
108 static int h3_panel_suspend(struct platform_device *pdev, pm_message_t mesg)
113 static int h3_panel_resume(struct platform_device *pdev)
118 struct platform_driver h3_panel_driver = {
119 .probe = h3_panel_probe,
120 .remove = h3_panel_remove,
121 .suspend = h3_panel_suspend,
122 .resume = h3_panel_resume,
125 .owner = THIS_MODULE,
129 static int h3_panel_drv_init(void)
131 return platform_driver_register(&h3_panel_driver);
134 static void h3_panel_drv_cleanup(void)
136 platform_driver_unregister(&h3_panel_driver);
139 module_init(h3_panel_drv_init);
140 module_exit(h3_panel_drv_cleanup);