]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blame - drivers/video/fbdev/omap/lcd_osk.c
Merge branch 'drm-tda9950-fixes' of git://git.armlinux.org.uk/~rmk/linux-arm into...
[mirror_ubuntu-focal-kernel.git] / drivers / video / fbdev / omap / lcd_osk.c
CommitLineData
107cc64b
DB
1/*
2 * LCD panel support for the TI OMAP OSK board
3 *
4 * Copyright (C) 2004 Nokia Corporation
5 * Author: Imre Deak <imre.deak@nokia.com>
6 * Adapted for OSK by <dirk.behme@de.bosch.com>
7 *
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.
12 *
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.
17 *
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.
21 */
22
23#include <linux/module.h>
24#include <linux/platform_device.h>
288e6eaa 25#include <linux/gpio.h>
0adcbaf7
TL
26
27#include <mach/hardware.h>
70c494c3 28#include <mach/mux.h>
0adcbaf7 29
91773a00 30#include "omapfb.h"
107cc64b 31
107cc64b
DB
32static int osk_panel_enable(struct lcd_panel *panel)
33{
34 /* configure PWL pin */
35 omap_cfg_reg(PWL);
36
37 /* Enable PWL unit */
38 omap_writeb(0x01, OMAP_PWL_CLK_ENABLE);
39
40 /* Set PWL level */
41 omap_writeb(0xFF, OMAP_PWL_ENABLE);
42
93a22f8b
DB
43 /* set GPIO2 high (lcd power enabled) */
44 gpio_set_value(2, 1);
107cc64b
DB
45
46 return 0;
47}
48
49static void osk_panel_disable(struct lcd_panel *panel)
50{
51 /* Set PWL level to zero */
52 omap_writeb(0x00, OMAP_PWL_ENABLE);
53
54 /* Disable PWL unit */
55 omap_writeb(0x00, OMAP_PWL_CLK_ENABLE);
56
57 /* set GPIO2 low */
93a22f8b 58 gpio_set_value(2, 0);
107cc64b
DB
59}
60
b2c1e8a7 61static struct lcd_panel osk_panel = {
107cc64b
DB
62 .name = "osk",
63 .config = OMAP_LCDC_PANEL_TFT,
64
65 .bpp = 16,
66 .data_lines = 16,
67 .x_res = 240,
68 .y_res = 320,
69 .pixel_clock = 12500,
70 .hsw = 40,
71 .hfp = 40,
72 .hbp = 72,
73 .vsw = 1,
74 .vfp = 1,
75 .vbp = 0,
76 .pcd = 12,
77
107cc64b
DB
78 .enable = osk_panel_enable,
79 .disable = osk_panel_disable,
107cc64b
DB
80};
81
82static int osk_panel_probe(struct platform_device *pdev)
83{
84 omapfb_register_panel(&osk_panel);
85 return 0;
86}
87
f9905441 88static struct platform_driver osk_panel_driver = {
107cc64b 89 .probe = osk_panel_probe,
107cc64b
DB
90 .driver = {
91 .name = "lcd_osk",
107cc64b
DB
92 },
93};
94
f806f9b6 95module_platform_driver(osk_panel_driver);
1bde9f2c
AB
96
97MODULE_AUTHOR("Imre Deak");
98MODULE_DESCRIPTION("LCD panel support for the TI OMAP OSK board");
99MODULE_LICENSE("GPL");