summaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap/base/0022-OMAP-DSS2-Add-support-for-LG-Philips-LB035Q02-panel.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap/base/0022-OMAP-DSS2-Add-support-for-LG-Philips-LB035Q02-panel.patch')
-rw-r--r--extras/recipes-kernel/linux/linux-omap/base/0022-OMAP-DSS2-Add-support-for-LG-Philips-LB035Q02-panel.patch299
1 files changed, 299 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0022-OMAP-DSS2-Add-support-for-LG-Philips-LB035Q02-panel.patch b/extras/recipes-kernel/linux/linux-omap/base/0022-OMAP-DSS2-Add-support-for-LG-Philips-LB035Q02-panel.patch
new file mode 100644
index 00000000..c3029423
--- /dev/null
+++ b/extras/recipes-kernel/linux/linux-omap/base/0022-OMAP-DSS2-Add-support-for-LG-Philips-LB035Q02-panel.patch
@@ -0,0 +1,299 @@
1From 93032782a4803072d7ab1e22da029325f8f3cf44 Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <steve@sakoman.com>
3Date: Thu, 17 Dec 2009 15:05:30 -0800
4Subject: [PATCH 22/28] OMAP: DSS2: Add support for LG Philips LB035Q02 panel
5
6---
7 drivers/video/omap2/displays/Kconfig | 12 +
8 drivers/video/omap2/displays/Makefile | 2 +
9 .../omap2/displays/panel-lgphilips-lb035q02.c | 244 ++++++++++++++++++++
10 3 files changed, 258 insertions(+), 0 deletions(-)
11 create mode 100644 drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
12
13diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
14index 12327bb..48e872f 100644
15--- a/drivers/video/omap2/displays/Kconfig
16+++ b/drivers/video/omap2/displays/Kconfig
17@@ -7,6 +7,18 @@ config PANEL_GENERIC
18 Generic panel driver.
19 Used for DVI output for Beagle and OMAP3 SDP.
20
21+config PANEL_LGPHILIPS_LB035Q02
22+ tristate "LG.Philips LB035Q02 LCD Panel"
23+ depends on OMAP2_DSS
24+ help
25+ LCD Panel used on Overo Palo35
26+
27+config PANEL_SAMSUNG_LTE430WQ_F0C
28+ tristate "Samsung LTE430WQ-F0C LCD Panel"
29+ depends on OMAP2_DSS
30+ help
31+ LCD Panel used on Overo Palo43
32+
33 config PANEL_SHARP_LS037V7DW01
34 tristate "Sharp LS037V7DW01 LCD Panel"
35 depends on OMAP2_DSS
36diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
37index aa38609..2fb1a57 100644
38--- a/drivers/video/omap2/displays/Makefile
39+++ b/drivers/video/omap2/displays/Makefile
40@@ -1,4 +1,6 @@
41 obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
42+obj-$(CONFIG_PANEL_LGPHILIPS_LB035Q02) += panel-lgphilips-lb035q02.o
43+obj-$(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C) += panel-samsung-lte430wq-f0c.o
44 obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
45 obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
46
47diff --git a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
48new file mode 100644
49index 0000000..4ad709d
50--- /dev/null
51+++ b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
52@@ -0,0 +1,244 @@
53+/*
54+ * LCD panel driver for LG.Philips LB035Q02
55+ *
56+ * Author: Steve Sakoman <steve@sakoman.com>
57+ *
58+ * This program is free software; you can redistribute it and/or modify it
59+ * under the terms of the GNU General Public License version 2 as published by
60+ * the Free Software Foundation.
61+ *
62+ * This program is distributed in the hope that it will be useful, but WITHOUT
63+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
64+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
65+ * more details.
66+ *
67+ * You should have received a copy of the GNU General Public License along with
68+ * this program. If not, see <http://www.gnu.org/licenses/>.
69+ */
70+
71+#include <linux/module.h>
72+#include <linux/delay.h>
73+#include <linux/spi/spi.h>
74+
75+#include <plat/display.h>
76+
77+static struct spi_device *spidev;
78+
79+static struct omap_video_timings lb035q02_timings = {
80+ .x_res = 320,
81+ .y_res = 240,
82+
83+ .pixel_clock = 6500,
84+
85+ .hsw = 2,
86+ .hfp = 20,
87+ .hbp = 68,
88+
89+ .vsw = 2,
90+ .vfp = 4,
91+ .vbp = 18,
92+};
93+
94+static int lb035q02_write_reg(u8 reg, u16 val)
95+{
96+ struct spi_message msg;
97+ struct spi_transfer index_xfer = {
98+ .len = 3,
99+ .cs_change = 1,
100+ };
101+ struct spi_transfer value_xfer = {
102+ .len = 3,
103+ };
104+ u8 buffer[16];
105+
106+ spi_message_init(&msg);
107+
108+ /* register index */
109+ buffer[0] = 0x70;
110+ buffer[1] = 0x00;
111+ buffer[2] = reg & 0x7f;
112+ index_xfer.tx_buf = buffer;
113+ spi_message_add_tail(&index_xfer, &msg);
114+
115+ /* register value */
116+ buffer[4] = 0x72;
117+ buffer[5] = val >> 8;
118+ buffer[6] = val;
119+ value_xfer.tx_buf = buffer + 4;
120+ spi_message_add_tail(&value_xfer, &msg);
121+
122+ return spi_sync(spidev, &msg);
123+}
124+
125+static int lb035q02_panel_power_on(struct omap_dss_device *dssdev)
126+{
127+ int r;
128+
129+ if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
130+ return 0;
131+
132+ r = omapdss_dpi_display_enable(dssdev);
133+ if (r)
134+ goto err0;
135+
136+ if (dssdev->platform_enable) {
137+ r = dssdev->platform_enable(dssdev);
138+ if (r)
139+ goto err1;
140+ }
141+
142+ /* Panel init sequence from page 28 of the spec */
143+ lb035q02_write_reg(0x01, 0x6300);
144+ lb035q02_write_reg(0x02, 0x0200);
145+ lb035q02_write_reg(0x03, 0x0177);
146+ lb035q02_write_reg(0x04, 0x04c7);
147+ lb035q02_write_reg(0x05, 0xffc0);
148+ lb035q02_write_reg(0x06, 0xe806);
149+ lb035q02_write_reg(0x0a, 0x4008);
150+ lb035q02_write_reg(0x0b, 0x0000);
151+ lb035q02_write_reg(0x0d, 0x0030);
152+ lb035q02_write_reg(0x0e, 0x2800);
153+ lb035q02_write_reg(0x0f, 0x0000);
154+ lb035q02_write_reg(0x16, 0x9f80);
155+ lb035q02_write_reg(0x17, 0x0a0f);
156+ lb035q02_write_reg(0x1e, 0x00c1);
157+ lb035q02_write_reg(0x30, 0x0300);
158+ lb035q02_write_reg(0x31, 0x0007);
159+ lb035q02_write_reg(0x32, 0x0000);
160+ lb035q02_write_reg(0x33, 0x0000);
161+ lb035q02_write_reg(0x34, 0x0707);
162+ lb035q02_write_reg(0x35, 0x0004);
163+ lb035q02_write_reg(0x36, 0x0302);
164+ lb035q02_write_reg(0x37, 0x0202);
165+ lb035q02_write_reg(0x3a, 0x0a0d);
166+ lb035q02_write_reg(0x3b, 0x0806);
167+
168+ return 0;
169+err1:
170+ omapdss_dpi_display_disable(dssdev);
171+err0:
172+ return r;
173+}
174+
175+static void lb035q02_panel_power_off(struct omap_dss_device *dssdev)
176+{
177+ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
178+ return;
179+
180+ if (dssdev->platform_disable)
181+ dssdev->platform_disable(dssdev);
182+
183+ omapdss_dpi_display_disable(dssdev);
184+}
185+
186+static int lb035q02_panel_probe(struct omap_dss_device *dssdev)
187+{
188+ dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
189+ OMAP_DSS_LCD_IHS;
190+ dssdev->panel.timings = lb035q02_timings;
191+
192+ return 0;
193+}
194+
195+static void lb035q02_panel_remove(struct omap_dss_device *dssdev)
196+{
197+}
198+
199+static int lb035q02_panel_enable(struct omap_dss_device *dssdev)
200+{
201+ int r = 0;
202+
203+ r = lb035q02_panel_power_on(dssdev);
204+ if (r)
205+ return r;
206+
207+ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
208+
209+ return 0;
210+}
211+
212+static void lb035q02_panel_disable(struct omap_dss_device *dssdev)
213+{
214+ lb035q02_panel_power_off(dssdev);
215+
216+ dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
217+}
218+
219+static int lb035q02_panel_suspend(struct omap_dss_device *dssdev)
220+{
221+ lb035q02_panel_disable(dssdev);
222+ dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
223+ return 0;
224+}
225+
226+static int lb035q02_panel_resume(struct omap_dss_device *dssdev)
227+{
228+ int r;
229+
230+ r = lb035q02_panel_power_on(dssdev);
231+ if (r)
232+ return r;
233+
234+ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
235+
236+ return 0;
237+}
238+
239+static struct omap_dss_driver lb035q02_driver = {
240+ .probe = lb035q02_panel_probe,
241+ .remove = lb035q02_panel_remove,
242+
243+ .enable = lb035q02_panel_enable,
244+ .disable = lb035q02_panel_disable,
245+ .suspend = lb035q02_panel_suspend,
246+ .resume = lb035q02_panel_resume,
247+
248+ .driver = {
249+ .name = "lgphilips_lb035q02_panel",
250+ .owner = THIS_MODULE,
251+ },
252+};
253+
254+static int __devinit lb035q02_panel_spi_probe(struct spi_device *spi)
255+{
256+ spidev = spi;
257+ return 0;
258+}
259+
260+static int __devexit lb035q02_panel_spi_remove(struct spi_device *spi)
261+{
262+ return 0;
263+}
264+
265+static struct spi_driver lb035q02_spi_driver = {
266+ .driver = {
267+ .name = "lgphilips_lb035q02_panel-spi",
268+ .owner = THIS_MODULE,
269+ },
270+ .probe = lb035q02_panel_spi_probe,
271+ .remove = __devexit_p (lb035q02_panel_spi_remove),
272+};
273+
274+static int __init lb035q02_panel_drv_init(void)
275+{
276+ int r;
277+ r = spi_register_driver(&lb035q02_spi_driver);
278+ if (r != 0)
279+ pr_err("lgphilips_lb035q02: Unable to register SPI driver: %d\n", r);
280+
281+ r = omap_dss_register_driver(&lb035q02_driver);
282+ if (r != 0)
283+ pr_err("lgphilips_lb035q02: Unable to register panel driver: %d\n", r);
284+
285+ return r;
286+}
287+
288+static void __exit lb035q02_panel_drv_exit(void)
289+{
290+ spi_unregister_driver(&lb035q02_spi_driver);
291+ omap_dss_unregister_driver(&lb035q02_driver);
292+}
293+
294+module_init(lb035q02_panel_drv_init);
295+module_exit(lb035q02_panel_drv_exit);
296+MODULE_LICENSE("GPL");
297--
2981.6.6.1
299