1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#include <linux/module.h>
23#include <linux/platform_device.h>
24#include <linux/mfd/tps65010.h>
25#include <linux/gpio.h>
26
27#include "omapfb.h"
28
29#define MODULE_NAME "omapfb-lcd_h3"
30
31static int h3_panel_enable(struct lcd_panel *panel)
32{
33 int r = 0;
34
35
36 r = tps65010_set_gpio_out_value(GPIO1, HIGH);
37 if (!r)
38 r = tps65010_set_gpio_out_value(GPIO2, HIGH);
39 if (r)
40 pr_err(MODULE_NAME ": Unable to turn on LCD panel\n");
41
42 return r;
43}
44
45static void h3_panel_disable(struct lcd_panel *panel)
46{
47 int r = 0;
48
49
50 r = tps65010_set_gpio_out_value(GPIO1, LOW);
51 if (!r)
52 tps65010_set_gpio_out_value(GPIO2, LOW);
53 if (r)
54 pr_err(MODULE_NAME ": Unable to turn off LCD panel\n");
55}
56
57static struct lcd_panel h3_panel = {
58 .name = "h3",
59 .config = OMAP_LCDC_PANEL_TFT,
60
61 .data_lines = 16,
62 .bpp = 16,
63 .x_res = 240,
64 .y_res = 320,
65 .pixel_clock = 12000,
66 .hsw = 12,
67 .hfp = 14,
68 .hbp = 72 - 12,
69 .vsw = 1,
70 .vfp = 1,
71 .vbp = 0,
72 .pcd = 0,
73
74 .enable = h3_panel_enable,
75 .disable = h3_panel_disable,
76};
77
78static int h3_panel_probe(struct platform_device *pdev)
79{
80 omapfb_register_panel(&h3_panel);
81 return 0;
82}
83
84static struct platform_driver h3_panel_driver = {
85 .probe = h3_panel_probe,
86 .driver = {
87 .name = "lcd_h3",
88 },
89};
90
91module_platform_driver(h3_panel_driver);
92
93MODULE_AUTHOR("Imre Deak");
94MODULE_DESCRIPTION("LCD panel support for the TI OMAP H3 board");
95MODULE_LICENSE("GPL");
96