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
26#include <asm/gpio.h>
27
28#include <mach/hardware.h>
29#include <mach/mux.h>
30
31#include "omapfb.h"
32
33static int osk_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
34{
35
36 return 0;
37}
38
39static void osk_panel_cleanup(struct lcd_panel *panel)
40{
41}
42
43static int osk_panel_enable(struct lcd_panel *panel)
44{
45
46 omap_cfg_reg(PWL);
47
48
49 omap_writeb(0x01, OMAP_PWL_CLK_ENABLE);
50
51
52 omap_writeb(0xFF, OMAP_PWL_ENABLE);
53
54
55 gpio_set_value(2, 1);
56
57 return 0;
58}
59
60static void osk_panel_disable(struct lcd_panel *panel)
61{
62
63 omap_writeb(0x00, OMAP_PWL_ENABLE);
64
65
66 omap_writeb(0x00, OMAP_PWL_CLK_ENABLE);
67
68
69 gpio_set_value(2, 0);
70}
71
72static unsigned long osk_panel_get_caps(struct lcd_panel *panel)
73{
74 return 0;
75}
76
77struct lcd_panel osk_panel = {
78 .name = "osk",
79 .config = OMAP_LCDC_PANEL_TFT,
80
81 .bpp = 16,
82 .data_lines = 16,
83 .x_res = 240,
84 .y_res = 320,
85 .pixel_clock = 12500,
86 .hsw = 40,
87 .hfp = 40,
88 .hbp = 72,
89 .vsw = 1,
90 .vfp = 1,
91 .vbp = 0,
92 .pcd = 12,
93
94 .init = osk_panel_init,
95 .cleanup = osk_panel_cleanup,
96 .enable = osk_panel_enable,
97 .disable = osk_panel_disable,
98 .get_caps = osk_panel_get_caps,
99};
100
101static int osk_panel_probe(struct platform_device *pdev)
102{
103 omapfb_register_panel(&osk_panel);
104 return 0;
105}
106
107static int osk_panel_remove(struct platform_device *pdev)
108{
109 return 0;
110}
111
112static int osk_panel_suspend(struct platform_device *pdev, pm_message_t mesg)
113{
114 return 0;
115}
116
117static int osk_panel_resume(struct platform_device *pdev)
118{
119 return 0;
120}
121
122static struct platform_driver osk_panel_driver = {
123 .probe = osk_panel_probe,
124 .remove = osk_panel_remove,
125 .suspend = osk_panel_suspend,
126 .resume = osk_panel_resume,
127 .driver = {
128 .name = "lcd_osk",
129 .owner = THIS_MODULE,
130 },
131};
132
133module_platform_driver(osk_panel_driver);
134