2 * File: drivers/video/omap/lcd-h3.c
4 * LCD panel support for the TI OMAP H3 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/tps65010.h>
29 #include <asm/arch/omapfb.h>
31 #define MODULE_NAME "omapfb-lcd_h3"
33 #define pr_err(fmt, args...) printk(KERN_ERR MODULE_NAME ": " fmt, ## args)
35 static int h3_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
40 static void h3_panel_cleanup(struct lcd_panel *panel)
44 static int h3_panel_enable(struct lcd_panel *panel)
48 /* GPIO1 and GPIO2 of TPS65010 send LCD_ENBKL and LCD_ENVDD signals */
49 r = tps65010_set_gpio_out_value(GPIO1, HIGH);
51 r = tps65010_set_gpio_out_value(GPIO2, HIGH);
53 pr_err("Unable to turn on LCD panel\n");
58 static void h3_panel_disable(struct lcd_panel *panel)
62 /* GPIO1 and GPIO2 of TPS65010 send LCD_ENBKL and LCD_ENVDD signals */
63 r = tps65010_set_gpio_out_value(GPIO1, LOW);
65 tps65010_set_gpio_out_value(GPIO2, LOW);
67 pr_err("Unable to turn off LCD panel\n");
70 static unsigned long h3_panel_get_caps(struct lcd_panel *panel)
75 struct lcd_panel h3_panel = {
77 .config = OMAP_LCDC_PANEL_TFT,
92 .init = h3_panel_init,
93 .cleanup = h3_panel_cleanup,
94 .enable = h3_panel_enable,
95 .disable = h3_panel_disable,
96 .get_caps = h3_panel_get_caps,
99 static int h3_panel_probe(struct platform_device *pdev)
101 omapfb_register_panel(&h3_panel);
105 static int h3_panel_remove(struct platform_device *pdev)
110 static int h3_panel_suspend(struct platform_device *pdev, pm_message_t mesg)
115 static int h3_panel_resume(struct platform_device *pdev)
120 struct platform_driver h3_panel_driver = {
121 .probe = h3_panel_probe,
122 .remove = h3_panel_remove,
123 .suspend = h3_panel_suspend,
124 .resume = h3_panel_resume,
127 .owner = THIS_MODULE,
131 static int h3_panel_drv_init(void)
133 return platform_driver_register(&h3_panel_driver);
136 static void h3_panel_drv_cleanup(void)
138 platform_driver_unregister(&h3_panel_driver);
141 module_init(h3_panel_drv_init);
142 module_exit(h3_panel_drv_cleanup);