1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#include <linux/module.h>
24#include <linux/platform_device.h>
25#include <linux/gpio.h>
26
27#include <mach/hardware.h>
28#include <mach/mux.h>
29
30#include "omapfb.h"
31
32static int osk_panel_enable(struct lcd_panel *panel)
33{
34
35 omap_cfg_reg(PWL);
36
37
38 omap_writeb(0x01, OMAP_PWL_CLK_ENABLE);
39
40
41 omap_writeb(0xFF, OMAP_PWL_ENABLE);
42
43
44 gpio_set_value(2, 1);
45
46 return 0;
47}
48
49static void osk_panel_disable(struct lcd_panel *panel)
50{
51
52 omap_writeb(0x00, OMAP_PWL_ENABLE);
53
54
55 omap_writeb(0x00, OMAP_PWL_CLK_ENABLE);
56
57
58 gpio_set_value(2, 0);
59}
60
61static struct lcd_panel osk_panel = {
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
78 .enable = osk_panel_enable,
79 .disable = osk_panel_disable,
80};
81
82static int osk_panel_probe(struct platform_device *pdev)
83{
84 omapfb_register_panel(&osk_panel);
85 return 0;
86}
87
88static struct platform_driver osk_panel_driver = {
89 .probe = osk_panel_probe,
90 .driver = {
91 .name = "lcd_osk",
92 },
93};
94
95module_platform_driver(osk_panel_driver);
96
97MODULE_AUTHOR("Imre Deak");
98MODULE_DESCRIPTION("LCD panel support for the TI OMAP OSK board");
99MODULE_LICENSE("GPL");
100