sh_eth: fix EESIPR values for SH77{34|63}
[linux/fpc-iii.git] / drivers / video / fbdev / omap / lcd_osk.c
blobb56886c7055e6d56dde4d14e127ac3d0306f12c8
1 /*
2 * LCD panel support for the TI OMAP OSK board
4 * Copyright (C) 2004 Nokia Corporation
5 * Author: Imre Deak <imre.deak@nokia.com>
6 * Adapted for OSK by <dirk.behme@de.bosch.com>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #include <linux/module.h>
24 #include <linux/platform_device.h>
25 #include <linux/gpio.h>
27 #include <mach/hardware.h>
28 #include <mach/mux.h>
30 #include "omapfb.h"
32 static int osk_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
34 /* gpio2 was allocated in board init */
35 return 0;
38 static void osk_panel_cleanup(struct lcd_panel *panel)
42 static int osk_panel_enable(struct lcd_panel *panel)
44 /* configure PWL pin */
45 omap_cfg_reg(PWL);
47 /* Enable PWL unit */
48 omap_writeb(0x01, OMAP_PWL_CLK_ENABLE);
50 /* Set PWL level */
51 omap_writeb(0xFF, OMAP_PWL_ENABLE);
53 /* set GPIO2 high (lcd power enabled) */
54 gpio_set_value(2, 1);
56 return 0;
59 static void osk_panel_disable(struct lcd_panel *panel)
61 /* Set PWL level to zero */
62 omap_writeb(0x00, OMAP_PWL_ENABLE);
64 /* Disable PWL unit */
65 omap_writeb(0x00, OMAP_PWL_CLK_ENABLE);
67 /* set GPIO2 low */
68 gpio_set_value(2, 0);
71 static unsigned long osk_panel_get_caps(struct lcd_panel *panel)
73 return 0;
76 struct lcd_panel osk_panel = {
77 .name = "osk",
78 .config = OMAP_LCDC_PANEL_TFT,
80 .bpp = 16,
81 .data_lines = 16,
82 .x_res = 240,
83 .y_res = 320,
84 .pixel_clock = 12500,
85 .hsw = 40,
86 .hfp = 40,
87 .hbp = 72,
88 .vsw = 1,
89 .vfp = 1,
90 .vbp = 0,
91 .pcd = 12,
93 .init = osk_panel_init,
94 .cleanup = osk_panel_cleanup,
95 .enable = osk_panel_enable,
96 .disable = osk_panel_disable,
97 .get_caps = osk_panel_get_caps,
100 static int osk_panel_probe(struct platform_device *pdev)
102 omapfb_register_panel(&osk_panel);
103 return 0;
106 static int osk_panel_remove(struct platform_device *pdev)
108 return 0;
111 static int osk_panel_suspend(struct platform_device *pdev, pm_message_t mesg)
113 return 0;
116 static int osk_panel_resume(struct platform_device *pdev)
118 return 0;
121 static struct platform_driver osk_panel_driver = {
122 .probe = osk_panel_probe,
123 .remove = osk_panel_remove,
124 .suspend = osk_panel_suspend,
125 .resume = osk_panel_resume,
126 .driver = {
127 .name = "lcd_osk",
131 module_platform_driver(osk_panel_driver);