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