[glsdk/meta-ti-glsdk.git] / recipes-bsp / linux / linux-omap / base / 0021-OMAP-DSS2-Add-support-for-Samsung-LTE430WQ-F0C-panel.patch
1 From f8049ce6302904c1d08d8813f8a60b10b8a476e7 Mon Sep 17 00:00:00 2001
2 From: Steve Sakoman <steve@sakoman.com>
3 Date: Tue, 23 Feb 2010 14:40:27 -0800
4 Subject: [PATCH 21/28] OMAP: DSS2: Add support for Samsung LTE430WQ-F0C panel
6 ---
7 .../omap2/displays/panel-samsung-lte430wq-f0c.c | 154 ++++++++++++++++++++
8 1 files changed, 154 insertions(+), 0 deletions(-)
9 create mode 100644 drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
11 diff --git a/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c b/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
12 new file mode 100644
13 index 0000000..6a29f9c
14 --- /dev/null
15 +++ b/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
16 @@ -0,0 +1,154 @@
17 +/*
18 + * LCD panel driver for Samsung LTE430WQ-F0C
19 + *
20 + * Author: Steve Sakoman <steve@sakoman.com>
21 + *
22 + * This program is free software; you can redistribute it and/or modify it
23 + * under the terms of the GNU General Public License version 2 as published by
24 + * the Free Software Foundation.
25 + *
26 + * This program is distributed in the hope that it will be useful, but WITHOUT
27 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
28 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
29 + * more details.
30 + *
31 + * You should have received a copy of the GNU General Public License along with
32 + * this program. If not, see <http://www.gnu.org/licenses/>.
33 + */
34 +
35 +#include <linux/module.h>
36 +#include <linux/delay.h>
37 +
38 +#include <plat/display.h>
39 +
40 +static struct omap_video_timings samsung_lte_timings = {
41 + .x_res = 480,
42 + .y_res = 272,
43 +
44 + .pixel_clock = 9200,
45 +
46 + .hsw = 41,
47 + .hfp = 8,
48 + .hbp = 45-41,
49 +
50 + .vsw = 10,
51 + .vfp = 4,
52 + .vbp = 12-10,
53 +};
54 +
55 +static int samsung_lte_panel_power_on(struct omap_dss_device *dssdev)
56 +{
57 + int r;
58 +
59 + if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
60 + return 0;
61 +
62 + r = omapdss_dpi_display_enable(dssdev);
63 + if (r)
64 + goto err0;
65 +
66 + if (dssdev->platform_enable) {
67 + r = dssdev->platform_enable(dssdev);
68 + if (r)
69 + goto err1;
70 + }
71 +
72 + return 0;
73 +err1:
74 + omapdss_dpi_display_disable(dssdev);
75 +err0:
76 + return r;
77 +}
78 +
79 +static void samsung_lte_panel_power_off(struct omap_dss_device *dssdev)
80 +{
81 + if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
82 + return;
83 +
84 + if (dssdev->platform_disable)
85 + dssdev->platform_disable(dssdev);
86 +
87 + omapdss_dpi_display_disable(dssdev);
88 +}
89 +
90 +static int samsung_lte_panel_probe(struct omap_dss_device *dssdev)
91 +{
92 + dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
93 + OMAP_DSS_LCD_IHS;
94 + dssdev->panel.timings = samsung_lte_timings;
95 +
96 + return 0;
97 +}
98 +
99 +static void samsung_lte_panel_remove(struct omap_dss_device *dssdev)
100 +{
101 +}
102 +
103 +static int samsung_lte_panel_enable(struct omap_dss_device *dssdev)
104 +{
105 + int r = 0;
106 +
107 + r = samsung_lte_panel_power_on(dssdev);
108 + if (r)
109 + return r;
110 +
111 + dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
112 +
113 + return 0;
114 +}
115 +
116 +static void samsung_lte_panel_disable(struct omap_dss_device *dssdev)
117 +{
118 + samsung_lte_panel_power_off(dssdev);
119 +
120 + dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
121 +}
122 +
123 +static int samsung_lte_panel_suspend(struct omap_dss_device *dssdev)
124 +{
125 + samsung_lte_panel_disable(dssdev);
126 + dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
127 + return 0;
128 +}
129 +
130 +static int samsung_lte_panel_resume(struct omap_dss_device *dssdev)
131 +{
132 + int r;
133 +
134 + r = samsung_lte_panel_enable(dssdev);
135 + if (r)
136 + return r;
137 +
138 + dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
139 +
140 + return 0;
141 +}
142 +
143 +static struct omap_dss_driver samsung_lte_driver = {
144 + .probe = samsung_lte_panel_probe,
145 + .remove = samsung_lte_panel_remove,
146 +
147 + .enable = samsung_lte_panel_enable,
148 + .disable = samsung_lte_panel_disable,
149 + .suspend = samsung_lte_panel_suspend,
150 + .resume = samsung_lte_panel_resume,
151 +
152 + .driver = {
153 + .name = "samsung_lte_panel",
154 + .owner = THIS_MODULE,
155 + },
156 +};
157 +
158 +static int __init samsung_lte_panel_drv_init(void)
159 +{
160 + return omap_dss_register_driver(&samsung_lte_driver);
161 +}
162 +
163 +static void __exit samsung_lte_panel_drv_exit(void)
164 +{
165 + omap_dss_unregister_driver(&samsung_lte_driver);
166 +}
167 +
168 +module_init(samsung_lte_panel_drv_init);
169 +module_exit(samsung_lte_panel_drv_exit);
170 +MODULE_LICENSE("GPL");
171 --
172 1.6.6.1