2 * File: drivers/video/omap/lcd-osk.c
4 * LCD panel support for the TI OMAP OSK board
6 * Copyright (C) 2004 Nokia Corporation
7 * Author: Imre Deak <imre.deak@nokia.com>
8 * Adapted for OSK by <dirk.behme@de.bosch.com>
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #include <linux/module.h>
26 #include <linux/platform_device.h>
28 #include <asm/arch/gpio.h>
29 #include <asm/arch/mux.h>
30 #include <asm/arch/omapfb.h>
32 static int osk_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
37 static void osk_panel_cleanup(struct lcd_panel *panel)
41 static int osk_panel_enable(struct lcd_panel *panel)
43 /* configure PWL pin */
47 omap_writeb(0x01, OMAP_PWL_CLK_ENABLE);
50 omap_writeb(0xFF, OMAP_PWL_ENABLE);
52 /* configure GPIO2 as output */
53 omap_set_gpio_direction(2, 0);
56 omap_set_gpio_dataout(2, 1);
61 static void osk_panel_disable(struct lcd_panel *panel)
63 /* Set PWL level to zero */
64 omap_writeb(0x00, OMAP_PWL_ENABLE);
66 /* Disable PWL unit */
67 omap_writeb(0x00, OMAP_PWL_CLK_ENABLE);
70 omap_set_gpio_dataout(2, 0);
73 static unsigned long osk_panel_get_caps(struct lcd_panel *panel)
78 struct lcd_panel osk_panel = {
80 .config = OMAP_LCDC_PANEL_TFT,
95 .init = osk_panel_init,
96 .cleanup = osk_panel_cleanup,
97 .enable = osk_panel_enable,
98 .disable = osk_panel_disable,
99 .get_caps = osk_panel_get_caps,
102 static int osk_panel_probe(struct platform_device *pdev)
104 omapfb_register_panel(&osk_panel);
108 static int osk_panel_remove(struct platform_device *pdev)
113 static int osk_panel_suspend(struct platform_device *pdev, pm_message_t mesg)
118 static int osk_panel_resume(struct platform_device *pdev)
123 struct platform_driver osk_panel_driver = {
124 .probe = osk_panel_probe,
125 .remove = osk_panel_remove,
126 .suspend = osk_panel_suspend,
127 .resume = osk_panel_resume,
130 .owner = THIS_MODULE,
134 static int osk_panel_drv_init(void)
136 return platform_driver_register(&osk_panel_driver);
139 static void osk_panel_drv_cleanup(void)
141 platform_driver_unregister(&osk_panel_driver);
144 module_init(osk_panel_drv_init);
145 module_exit(osk_panel_drv_cleanup);