aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMayuresh Janorkar <mayur@ti.com>2011-05-17 08:19:40 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-09-14 11:08:23 -0400
commit24305db864cd62bf4279f745528c3238cbaf1c12 (patch)
tree04749e55b46f59efc1d56567735f856feb3d5d10
parentb6fd41e29dea9c6753b1843a77e50433e6123bcb (diff)
OMAP: DSS2: Add picodlp panel driver
PicoDLP is a micro projector from TI. DLP used in OMAP4 is dpp2600 (DLP Pico Projector) The DLP requires commands to be sent over i2c for configurations. To know more about dpp2600 commands please visit: https://focus.ti.com/myti/docs/extranet.tsp?sectionId=403 The picodlp module consists of a dss driver and an i2c_client. To know more please visit: http://www.omappedia.org/wiki/PicoDLP_projector_guide Based on original design from Mythri P K <mythripk@ti.com> Signed-off-by: Mayuresh Janorkar <mayur@ti.com> Signed-off-by: Mythri P K <mythripk@ti.com> [tomi.valkeinen@ti.com: squashed commits] Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/omap2/displays/Kconfig7
-rw-r--r--drivers/video/omap2/displays/Makefile1
-rw-r--r--drivers/video/omap2/displays/panel-picodlp.c591
-rw-r--r--drivers/video/omap2/displays/panel-picodlp.h288
-rw-r--r--include/video/omap-panel-picodlp.h23
5 files changed, 910 insertions, 0 deletions
diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
index 609a28073178..6ddb401552cd 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -30,6 +30,13 @@ config PANEL_NEC_NL8048HL11_01B
30 This NEC NL8048HL11-01B panel is TFT LCD 30 This NEC NL8048HL11-01B panel is TFT LCD
31 used in the Zoom2/3/3630 sdp boards. 31 used in the Zoom2/3/3630 sdp boards.
32 32
33config PANEL_PICODLP
34 tristate "TI PICO DLP mini-projector"
35 depends on OMAP2_DSS && I2C
36 help
37 A mini-projector used in TI's SDP4430 and EVM boards
38 For more info please visit http://www.dlp.com/projector/
39
33config PANEL_TAAL 40config PANEL_TAAL
34 tristate "Taal DSI Panel" 41 tristate "Taal DSI Panel"
35 depends on OMAP2_DSS_DSI 42 depends on OMAP2_DSS_DSI
diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
index 0f601ab3abf4..d90f73c8716a 100644
--- a/drivers/video/omap2/displays/Makefile
+++ b/drivers/video/omap2/displays/Makefile
@@ -4,5 +4,6 @@ obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
4obj-$(CONFIG_PANEL_NEC_NL8048HL11_01B) += panel-nec-nl8048hl11-01b.o 4obj-$(CONFIG_PANEL_NEC_NL8048HL11_01B) += panel-nec-nl8048hl11-01b.o
5 5
6obj-$(CONFIG_PANEL_TAAL) += panel-taal.o 6obj-$(CONFIG_PANEL_TAAL) += panel-taal.o
7obj-$(CONFIG_PANEL_PICODLP) += panel-picodlp.o
7obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o 8obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
8obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o 9obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o
diff --git a/drivers/video/omap2/displays/panel-picodlp.c b/drivers/video/omap2/displays/panel-picodlp.c
new file mode 100644
index 000000000000..b663e60e1a11
--- /dev/null
+++ b/drivers/video/omap2/displays/panel-picodlp.c
@@ -0,0 +1,591 @@
1/*
2 * picodlp panel driver
3 * picodlp_i2c_driver: i2c_client driver
4 *
5 * Copyright (C) 2009-2011 Texas Instruments
6 * Author: Mythri P K <mythripk@ti.com>
7 * Mayuresh Janorkar <mayur@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published by
11 * the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
17 *
18 * You should have received a copy of the GNU General Public License along with
19 * this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#include <linux/input.h>
23#include <linux/platform_device.h>
24#include <linux/interrupt.h>
25#include <linux/firmware.h>
26#include <linux/slab.h>
27#include <linux/mutex.h>
28#include <linux/i2c.h>
29#include <linux/delay.h>
30#include <linux/gpio.h>
31
32#include <video/omapdss.h>
33#include <video/omap-panel-picodlp.h>
34
35#include "panel-picodlp.h"
36
37struct picodlp_data {
38 struct mutex lock;
39 struct i2c_client *picodlp_i2c_client;
40};
41
42static struct i2c_board_info picodlp_i2c_board_info = {
43 I2C_BOARD_INFO("picodlp_i2c_driver", 0x1b),
44};
45
46struct picodlp_i2c_data {
47 struct mutex xfer_lock;
48};
49
50static struct i2c_device_id picodlp_i2c_id[] = {
51 { "picodlp_i2c_driver", 0 },
52};
53
54struct picodlp_i2c_command {
55 u8 reg;
56 u32 value;
57};
58
59static struct omap_video_timings pico_ls_timings = {
60 .x_res = 864,
61 .y_res = 480,
62 .hsw = 7,
63 .hfp = 11,
64 .hbp = 7,
65
66 .pixel_clock = 19200,
67
68 .vsw = 2,
69 .vfp = 3,
70 .vbp = 14,
71};
72
73static inline struct picodlp_panel_data
74 *get_panel_data(const struct omap_dss_device *dssdev)
75{
76 return (struct picodlp_panel_data *) dssdev->data;
77}
78
79static u32 picodlp_i2c_read(struct i2c_client *client, u8 reg)
80{
81 u8 read_cmd[] = {READ_REG_SELECT, reg}, data[4];
82 struct picodlp_i2c_data *picodlp_i2c_data = i2c_get_clientdata(client);
83 struct i2c_msg msg[2];
84
85 mutex_lock(&picodlp_i2c_data->xfer_lock);
86
87 msg[0].addr = client->addr;
88 msg[0].flags = 0;
89 msg[0].len = 2;
90 msg[0].buf = read_cmd;
91
92 msg[1].addr = client->addr;
93 msg[1].flags = I2C_M_RD;
94 msg[1].len = 4;
95 msg[1].buf = data;
96
97 i2c_transfer(client->adapter, msg, 2);
98 mutex_unlock(&picodlp_i2c_data->xfer_lock);
99 return (data[3] | (data[2] << 8) | (data[1] << 16) | (data[0] << 24));
100}
101
102static int picodlp_i2c_write_block(struct i2c_client *client,
103 u8 *data, int len)
104{
105 struct i2c_msg msg;
106 int i, r, msg_count = 1;
107
108 struct picodlp_i2c_data *picodlp_i2c_data = i2c_get_clientdata(client);
109
110 if (len < 1 || len > 32) {
111 dev_err(&client->dev,
112 "too long syn_write_block len %d\n", len);
113 return -EIO;
114 }
115 mutex_lock(&picodlp_i2c_data->xfer_lock);
116
117 msg.addr = client->addr;
118 msg.flags = 0;
119 msg.len = len;
120 msg.buf = data;
121 r = i2c_transfer(client->adapter, &msg, msg_count);
122 mutex_unlock(&picodlp_i2c_data->xfer_lock);
123
124 /*
125 * i2c_transfer returns:
126 * number of messages sent in case of success
127 * a negative error number in case of failure
128 */
129 if (r != msg_count)
130 goto err;
131
132 /* In case of success */
133 for (i = 0; i < len; i++)
134 dev_dbg(&client->dev,
135 "addr %x bw 0x%02x[%d]: 0x%02x\n",
136 client->addr, data[0] + i, i, data[i]);
137
138 return 0;
139err:
140 dev_err(&client->dev, "picodlp_i2c_write error\n");
141 return r;
142}
143
144static int picodlp_i2c_write(struct i2c_client *client, u8 reg, u32 value)
145{
146 u8 data[5];
147 int i;
148
149 data[0] = reg;
150 for (i = 1; i < 5; i++)
151 data[i] = (value >> (32 - (i) * 8)) & 0xFF;
152
153 return picodlp_i2c_write_block(client, data, 5);
154}
155
156static int picodlp_i2c_write_array(struct i2c_client *client,
157 const struct picodlp_i2c_command commands[],
158 int count)
159{
160 int i, r = 0;
161 for (i = 0; i < count; i++) {
162 r = picodlp_i2c_write(client, commands[i].reg,
163 commands[i].value);
164 if (r)
165 return r;
166 }
167 return r;
168}
169
170static int picodlp_wait_for_dma_done(struct i2c_client *client)
171{
172 u8 trial = 100;
173
174 do {
175 msleep(1);
176 if (!trial--)
177 return -ETIMEDOUT;
178 } while (picodlp_i2c_read(client, MAIN_STATUS) & DMA_STATUS);
179
180 return 0;
181}
182
183/**
184 * picodlp_i2c_init: i2c_initialization routine
185 * client: i2c_client for communication
186 *
187 * return
188 * 0 : Success, no error
189 * error code : Failure
190 */
191static int picodlp_i2c_init(struct i2c_client *client)
192{
193 int r;
194 static const struct picodlp_i2c_command init_cmd_set1[] = {
195 {SOFT_RESET, 1},
196 {DMD_PARK_TRIGGER, 1},
197 {MISC_REG, 5},
198 {SEQ_CONTROL, 0},
199 {SEQ_VECTOR, 0x100},
200 {DMD_BLOCK_COUNT, 7},
201 {DMD_VCC_CONTROL, 0x109},
202 {DMD_PARK_PULSE_COUNT, 0xA},
203 {DMD_PARK_PULSE_WIDTH, 0xB},
204 {DMD_PARK_DELAY, 0x2ED},
205 {DMD_SHADOW_ENABLE, 0},
206 {FLASH_OPCODE, 0xB},
207 {FLASH_DUMMY_BYTES, 1},
208 {FLASH_ADDR_BYTES, 3},
209 {PBC_CONTROL, 0},
210 {FLASH_START_ADDR, CMT_LUT_0_START_ADDR},
211 {FLASH_READ_BYTES, CMT_LUT_0_SIZE},
212 {CMT_SPLASH_LUT_START_ADDR, 0},
213 {CMT_SPLASH_LUT_DEST_SELECT, CMT_LUT_ALL},
214 {PBC_CONTROL, 1},
215 };
216
217 static const struct picodlp_i2c_command init_cmd_set2[] = {
218 {PBC_CONTROL, 0},
219 {CMT_SPLASH_LUT_DEST_SELECT, 0},
220 {PBC_CONTROL, 0},
221 {FLASH_START_ADDR, SEQUENCE_0_START_ADDR},
222 {FLASH_READ_BYTES, SEQUENCE_0_SIZE},
223 {SEQ_RESET_LUT_START_ADDR, 0},
224 {SEQ_RESET_LUT_DEST_SELECT, SEQ_SEQ_LUT},
225 {PBC_CONTROL, 1},
226 };
227
228 static const struct picodlp_i2c_command init_cmd_set3[] = {
229 {PBC_CONTROL, 0},
230 {SEQ_RESET_LUT_DEST_SELECT, 0},
231 {PBC_CONTROL, 0},
232 {FLASH_START_ADDR, DRC_TABLE_0_START_ADDR},
233 {FLASH_READ_BYTES, DRC_TABLE_0_SIZE},
234 {SEQ_RESET_LUT_START_ADDR, 0},
235 {SEQ_RESET_LUT_DEST_SELECT, SEQ_DRC_LUT_ALL},
236 {PBC_CONTROL, 1},
237 };
238
239 static const struct picodlp_i2c_command init_cmd_set4[] = {
240 {PBC_CONTROL, 0},
241 {SEQ_RESET_LUT_DEST_SELECT, 0},
242 {SDC_ENABLE, 1},
243 {AGC_CTRL, 7},
244 {CCA_C1A, 0x100},
245 {CCA_C1B, 0x0},
246 {CCA_C1C, 0x0},
247 {CCA_C2A, 0x0},
248 {CCA_C2B, 0x100},
249 {CCA_C2C, 0x0},
250 {CCA_C3A, 0x0},
251 {CCA_C3B, 0x0},
252 {CCA_C3C, 0x100},
253 {CCA_C7A, 0x100},
254 {CCA_C7B, 0x100},
255 {CCA_C7C, 0x100},
256 {CCA_ENABLE, 1},
257 {CPU_IF_MODE, 1},
258 {SHORT_FLIP, 1},
259 {CURTAIN_CONTROL, 0},
260 {DMD_PARK_TRIGGER, 0},
261 {R_DRIVE_CURRENT, 0x298},
262 {G_DRIVE_CURRENT, 0x298},
263 {B_DRIVE_CURRENT, 0x298},
264 {RGB_DRIVER_ENABLE, 7},
265 {SEQ_CONTROL, 0},
266 {ACTGEN_CONTROL, 0x10},
267 {SEQUENCE_MODE, SEQ_LOCK},
268 {DATA_FORMAT, RGB888},
269 {INPUT_RESOLUTION, WVGA_864_LANDSCAPE},
270 {INPUT_SOURCE, PARALLEL_RGB},
271 {CPU_IF_SYNC_METHOD, 1},
272 {SEQ_CONTROL, 1}
273 };
274
275 r = picodlp_i2c_write_array(client, init_cmd_set1,
276 ARRAY_SIZE(init_cmd_set1));
277 if (r)
278 return r;
279
280 r = picodlp_wait_for_dma_done(client);
281 if (r)
282 return r;
283
284 r = picodlp_i2c_write_array(client, init_cmd_set2,
285 ARRAY_SIZE(init_cmd_set2));
286 if (r)
287 return r;
288
289 r = picodlp_wait_for_dma_done(client);
290 if (r)
291 return r;
292
293 r = picodlp_i2c_write_array(client, init_cmd_set3,
294 ARRAY_SIZE(init_cmd_set3));
295 if (r)
296 return r;
297
298 r = picodlp_wait_for_dma_done(client);
299 if (r)
300 return r;
301
302 r = picodlp_i2c_write_array(client, init_cmd_set4,
303 ARRAY_SIZE(init_cmd_set4));
304 if (r)
305 return r;
306
307 return 0;
308}
309
310static int picodlp_i2c_probe(struct i2c_client *client,
311 const struct i2c_device_id *id)
312{
313 struct picodlp_i2c_data *picodlp_i2c_data;
314
315 picodlp_i2c_data = kzalloc(sizeof(struct picodlp_i2c_data), GFP_KERNEL);
316
317 if (!picodlp_i2c_data)
318 return -ENOMEM;
319
320 mutex_init(&picodlp_i2c_data->xfer_lock);
321 i2c_set_clientdata(client, picodlp_i2c_data);
322
323 return 0;
324}
325
326static int picodlp_i2c_remove(struct i2c_client *client)
327{
328 struct picodlp_i2c_data *picodlp_i2c_data =
329 i2c_get_clientdata(client);
330 kfree(picodlp_i2c_data);
331 return 0;
332}
333
334static struct i2c_driver picodlp_i2c_driver = {
335 .driver = {
336 .name = "picodlp_i2c_driver",
337 },
338 .probe = picodlp_i2c_probe,
339 .remove = picodlp_i2c_remove,
340 .id_table = picodlp_i2c_id,
341};
342
343static int picodlp_panel_power_on(struct omap_dss_device *dssdev)
344{
345 int r, trial = 100;
346 struct picodlp_data *picod = dev_get_drvdata(&dssdev->dev);
347 struct picodlp_panel_data *picodlp_pdata = get_panel_data(dssdev);
348
349 if (dssdev->platform_enable) {
350 r = dssdev->platform_enable(dssdev);
351 if (r)
352 return r;
353 }
354
355 gpio_set_value(picodlp_pdata->pwrgood_gpio, 0);
356 msleep(1);
357 gpio_set_value(picodlp_pdata->pwrgood_gpio, 1);
358
359 while (!gpio_get_value(picodlp_pdata->emu_done_gpio)) {
360 if (!trial--) {
361 dev_err(&dssdev->dev, "emu_done signal not"
362 " going high\n");
363 return -ETIMEDOUT;
364 }
365 msleep(5);
366 }
367 /*
368 * As per dpp2600 programming guide,
369 * it is required to sleep for 1000ms after emu_done signal goes high
370 * then only i2c commands can be successfully sent to dpp2600
371 */
372 msleep(1000);
373 if (omapdss_dpi_display_enable(dssdev)) {
374 dev_err(&dssdev->dev, "failed to enable DPI\n");
375 goto err1;
376 }
377 dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
378
379 r = picodlp_i2c_init(picod->picodlp_i2c_client);
380 if (r)
381 goto err;
382
383 return r;
384err:
385 omapdss_dpi_display_disable(dssdev);
386err1:
387 if (dssdev->platform_disable)
388 dssdev->platform_disable(dssdev);
389
390 return r;
391}
392
393static void picodlp_panel_power_off(struct omap_dss_device *dssdev)
394{
395 struct picodlp_panel_data *picodlp_pdata = get_panel_data(dssdev);
396
397 omapdss_dpi_display_disable(dssdev);
398
399 gpio_set_value(picodlp_pdata->emu_done_gpio, 0);
400 gpio_set_value(picodlp_pdata->pwrgood_gpio, 0);
401
402 if (dssdev->platform_disable)
403 dssdev->platform_disable(dssdev);
404}
405
406static int picodlp_panel_probe(struct omap_dss_device *dssdev)
407{
408 struct picodlp_data *picod;
409 struct picodlp_panel_data *picodlp_pdata = get_panel_data(dssdev);
410 struct i2c_adapter *adapter;
411 struct i2c_client *picodlp_i2c_client;
412 int r = 0, picodlp_adapter_id;
413
414 dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_ONOFF |
415 OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IVS;
416 dssdev->panel.acb = 0x0;
417 dssdev->panel.timings = pico_ls_timings;
418
419 picod = kzalloc(sizeof(struct picodlp_data), GFP_KERNEL);
420 if (!picod)
421 return -ENOMEM;
422
423 mutex_init(&picod->lock);
424
425 picodlp_adapter_id = picodlp_pdata->picodlp_adapter_id;
426
427 adapter = i2c_get_adapter(picodlp_adapter_id);
428 if (!adapter) {
429 dev_err(&dssdev->dev, "can't get i2c adapter\n");
430 r = -ENODEV;
431 goto err;
432 }
433
434 picodlp_i2c_client = i2c_new_device(adapter, &picodlp_i2c_board_info);
435 if (!picodlp_i2c_client) {
436 dev_err(&dssdev->dev, "can't add i2c device::"
437 " picodlp_i2c_client is NULL\n");
438 r = -ENODEV;
439 goto err;
440 }
441
442 picod->picodlp_i2c_client = picodlp_i2c_client;
443
444 dev_set_drvdata(&dssdev->dev, picod);
445 return r;
446err:
447 kfree(picod);
448 return r;
449}
450
451static void picodlp_panel_remove(struct omap_dss_device *dssdev)
452{
453 struct picodlp_data *picod = dev_get_drvdata(&dssdev->dev);
454
455 i2c_unregister_device(picod->picodlp_i2c_client);
456 dev_set_drvdata(&dssdev->dev, NULL);
457 dev_dbg(&dssdev->dev, "removing picodlp panel\n");
458
459 kfree(picod);
460}
461
462static int picodlp_panel_enable(struct omap_dss_device *dssdev)
463{
464 struct picodlp_data *picod = dev_get_drvdata(&dssdev->dev);
465 int r;
466
467 dev_dbg(&dssdev->dev, "enabling picodlp panel\n");
468
469 mutex_lock(&picod->lock);
470 if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) {
471 mutex_unlock(&picod->lock);
472 return -EINVAL;
473 }
474
475 r = picodlp_panel_power_on(dssdev);
476 mutex_unlock(&picod->lock);
477
478 return r;
479}
480
481static void picodlp_panel_disable(struct omap_dss_device *dssdev)
482{
483 struct picodlp_data *picod = dev_get_drvdata(&dssdev->dev);
484
485 mutex_lock(&picod->lock);
486 /* Turn off DLP Power */
487 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
488 picodlp_panel_power_off(dssdev);
489
490 dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
491 mutex_unlock(&picod->lock);
492
493 dev_dbg(&dssdev->dev, "disabling picodlp panel\n");
494}
495
496static int picodlp_panel_suspend(struct omap_dss_device *dssdev)
497{
498 struct picodlp_data *picod = dev_get_drvdata(&dssdev->dev);
499
500 mutex_lock(&picod->lock);
501 /* Turn off DLP Power */
502 if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) {
503 mutex_unlock(&picod->lock);
504 dev_err(&dssdev->dev, "unable to suspend picodlp panel,"
505 " panel is not ACTIVE\n");
506 return -EINVAL;
507 }
508
509 picodlp_panel_power_off(dssdev);
510
511 dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
512 mutex_unlock(&picod->lock);
513
514 dev_dbg(&dssdev->dev, "suspending picodlp panel\n");
515 return 0;
516}
517
518static int picodlp_panel_resume(struct omap_dss_device *dssdev)
519{
520 struct picodlp_data *picod = dev_get_drvdata(&dssdev->dev);
521 int r;
522
523 mutex_lock(&picod->lock);
524 if (dssdev->state != OMAP_DSS_DISPLAY_SUSPENDED) {
525 mutex_unlock(&picod->lock);
526 dev_err(&dssdev->dev, "unable to resume picodlp panel,"
527 " panel is not ACTIVE\n");
528 return -EINVAL;
529 }
530
531 r = picodlp_panel_power_on(dssdev);
532 mutex_unlock(&picod->lock);
533 dev_dbg(&dssdev->dev, "resuming picodlp panel\n");
534 return r;
535}
536
537static void picodlp_get_resolution(struct omap_dss_device *dssdev,
538 u16 *xres, u16 *yres)
539{
540 *xres = dssdev->panel.timings.x_res;
541 *yres = dssdev->panel.timings.y_res;
542}
543
544static struct omap_dss_driver picodlp_driver = {
545 .probe = picodlp_panel_probe,
546 .remove = picodlp_panel_remove,
547
548 .enable = picodlp_panel_enable,
549 .disable = picodlp_panel_disable,
550
551 .get_resolution = picodlp_get_resolution,
552
553 .suspend = picodlp_panel_suspend,
554 .resume = picodlp_panel_resume,
555
556 .driver = {
557 .name = "picodlp_panel",
558 .owner = THIS_MODULE,
559 },
560};
561
562static int __init picodlp_init(void)
563{
564 int r = 0;
565
566 r = i2c_add_driver(&picodlp_i2c_driver);
567 if (r) {
568 printk(KERN_WARNING "picodlp_i2c_driver" \
569 " registration failed\n");
570 return r;
571 }
572
573 r = omap_dss_register_driver(&picodlp_driver);
574 if (r)
575 i2c_del_driver(&picodlp_i2c_driver);
576
577 return r;
578}
579
580static void __exit picodlp_exit(void)
581{
582 i2c_del_driver(&picodlp_i2c_driver);
583 omap_dss_unregister_driver(&picodlp_driver);
584}
585
586module_init(picodlp_init);
587module_exit(picodlp_exit);
588
589MODULE_AUTHOR("Mythri P K <mythripk@ti.com>");
590MODULE_DESCRIPTION("picodlp driver");
591MODULE_LICENSE("GPL");
diff --git a/drivers/video/omap2/displays/panel-picodlp.h b/drivers/video/omap2/displays/panel-picodlp.h
new file mode 100644
index 000000000000..a34b431a7267
--- /dev/null
+++ b/drivers/video/omap2/displays/panel-picodlp.h
@@ -0,0 +1,288 @@
1/*
2 * Header file required by picodlp panel driver
3 *
4 * Copyright (C) 2009-2011 Texas Instruments
5 * Author: Mythri P K <mythripk@ti.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef __OMAP2_DISPLAY_PANEL_PICODLP_H
21#define __OMAP2_DISPLAY_PANEL_PICODLP_H
22
23/* Commands used for configuring picodlp panel */
24
25#define MAIN_STATUS 0x03
26#define PBC_CONTROL 0x08
27#define INPUT_SOURCE 0x0B
28#define INPUT_RESOLUTION 0x0C
29#define DATA_FORMAT 0x0D
30#define IMG_ROTATION 0x0E
31#define LONG_FLIP 0x0F
32#define SHORT_FLIP 0x10
33#define TEST_PAT_SELECT 0x11
34#define R_DRIVE_CURRENT 0x12
35#define G_DRIVE_CURRENT 0x13
36#define B_DRIVE_CURRENT 0x14
37#define READ_REG_SELECT 0x15
38#define RGB_DRIVER_ENABLE 0x16
39
40#define CPU_IF_MODE 0x18
41#define FRAME_RATE 0x19
42#define CPU_IF_SYNC_METHOD 0x1A
43#define CPU_IF_SOF 0x1B
44#define CPU_IF_EOF 0x1C
45#define CPU_IF_SLEEP 0x1D
46
47#define SEQUENCE_MODE 0x1E
48#define SOFT_RESET 0x1F
49#define FRONT_END_RESET 0x21
50#define AUTO_PWR_ENABLE 0x22
51
52#define VSYNC_LINE_DELAY 0x23
53#define CPU_PI_HORIZ_START 0x24
54#define CPU_PI_VERT_START 0x25
55#define CPU_PI_HORIZ_WIDTH 0x26
56#define CPU_PI_VERT_HEIGHT 0x27
57
58#define PIXEL_MASK_CROP 0x28
59#define CROP_FIRST_LINE 0x29
60#define CROP_LAST_LINE 0x2A
61#define CROP_FIRST_PIXEL 0x2B
62#define CROP_LAST_PIXEL 0x2C
63#define DMD_PARK_TRIGGER 0x2D
64
65#define MISC_REG 0x30
66
67/* AGC registers */
68#define AGC_CTRL 0x50
69#define AGC_CLIPPED_PIXS 0x55
70#define AGC_BRIGHT_PIXS 0x56
71#define AGC_BG_PIXS 0x57
72#define AGC_SAFETY_MARGIN 0x17
73
74/* Color Coordinate Adjustment registers */
75#define CCA_ENABLE 0x5E
76#define CCA_C1A 0x5F
77#define CCA_C1B 0x60
78#define CCA_C1C 0x61
79#define CCA_C2A 0x62
80#define CCA_C2B 0x63
81#define CCA_C2C 0x64
82#define CCA_C3A 0x65
83#define CCA_C3B 0x66
84#define CCA_C3C 0x67
85#define CCA_C7A 0x71
86#define CCA_C7B 0x72
87#define CCA_C7C 0x73
88
89/**
90 * DLP Pico Processor 2600 comes with flash
91 * We can do DMA operations from flash for accessing Look Up Tables
92 */
93#define DMA_STATUS 0x100
94#define FLASH_ADDR_BYTES 0x74
95#define FLASH_DUMMY_BYTES 0x75
96#define FLASH_WRITE_BYTES 0x76
97#define FLASH_READ_BYTES 0x77
98#define FLASH_OPCODE 0x78
99#define FLASH_START_ADDR 0x79
100#define FLASH_DUMMY2 0x7A
101#define FLASH_WRITE_DATA 0x7B
102
103#define TEMPORAL_DITH_DISABLE 0x7E
104#define SEQ_CONTROL 0x82
105#define SEQ_VECTOR 0x83
106
107/* DMD is Digital Micromirror Device */
108#define DMD_BLOCK_COUNT 0x84
109#define DMD_VCC_CONTROL 0x86
110#define DMD_PARK_PULSE_COUNT 0x87
111#define DMD_PARK_PULSE_WIDTH 0x88
112#define DMD_PARK_DELAY 0x89
113#define DMD_SHADOW_ENABLE 0x8E
114#define SEQ_STATUS 0x8F
115#define FLASH_CLOCK_CONTROL 0x98
116#define DMD_PARK 0x2D
117
118#define SDRAM_BIST_ENABLE 0x46
119#define DDR_DRIVER_STRENGTH 0x9A
120#define SDC_ENABLE 0x9D
121#define SDC_BUFF_SWAP_DISABLE 0xA3
122#define CURTAIN_CONTROL 0xA6
123#define DDR_BUS_SWAP_ENABLE 0xA7
124#define DMD_TRC_ENABLE 0xA8
125#define DMD_BUS_SWAP_ENABLE 0xA9
126
127#define ACTGEN_ENABLE 0xAE
128#define ACTGEN_CONTROL 0xAF
129#define ACTGEN_HORIZ_BP 0xB0
130#define ACTGEN_VERT_BP 0xB1
131
132/* Look Up Table access */
133#define CMT_SPLASH_LUT_START_ADDR 0xFA
134#define CMT_SPLASH_LUT_DEST_SELECT 0xFB
135#define CMT_SPLASH_LUT_DATA 0xFC
136#define SEQ_RESET_LUT_START_ADDR 0xFD
137#define SEQ_RESET_LUT_DEST_SELECT 0xFE
138#define SEQ_RESET_LUT_DATA 0xFF
139
140/* Input source definitions */
141#define PARALLEL_RGB 0
142#define INT_TEST_PATTERN 1
143#define SPLASH_SCREEN 2
144#define CPU_INTF 3
145#define BT656 4
146
147/* Standard input resolution definitions */
148#define QWVGA_LANDSCAPE 3 /* (427h*240v) */
149#define WVGA_864_LANDSCAPE 21 /* (864h*480v) */
150#define WVGA_DMD_OPTICAL_TEST 35 /* (608h*684v) */
151
152/* Standard data format definitions */
153#define RGB565 0
154#define RGB666 1
155#define RGB888 2
156
157/* Test Pattern definitions */
158#define TPG_CHECKERBOARD 0
159#define TPG_BLACK 1
160#define TPG_WHITE 2
161#define TPG_RED 3
162#define TPG_BLUE 4
163#define TPG_GREEN 5
164#define TPG_VLINES_BLACK 6
165#define TPG_HLINES_BLACK 7
166#define TPG_VLINES_ALT 8
167#define TPG_HLINES_ALT 9
168#define TPG_DIAG_LINES 10
169#define TPG_GREYRAMP_VERT 11
170#define TPG_GREYRAMP_HORIZ 12
171#define TPG_ANSI_CHECKERBOARD 13
172
173/* sequence mode definitions */
174#define SEQ_FREE_RUN 0
175#define SEQ_LOCK 1
176
177/* curtain color definitions */
178#define CURTAIN_BLACK 0
179#define CURTAIN_RED 1
180#define CURTAIN_GREEN 2
181#define CURTAIN_BLUE 3
182#define CURTAIN_YELLOW 4
183#define CURTAIN_MAGENTA 5
184#define CURTAIN_CYAN 6
185#define CURTAIN_WHITE 7
186
187/* LUT definitions */
188#define CMT_LUT_NONE 0
189#define CMT_LUT_GREEN 1
190#define CMT_LUT_RED 2
191#define CMT_LUT_BLUE 3
192#define CMT_LUT_ALL 4
193#define SPLASH_LUT 5
194
195#define SEQ_LUT_NONE 0
196#define SEQ_DRC_LUT_0 1
197#define SEQ_DRC_LUT_1 2
198#define SEQ_DRC_LUT_2 3
199#define SEQ_DRC_LUT_3 4
200#define SEQ_SEQ_LUT 5
201#define SEQ_DRC_LUT_ALL 6
202#define WPC_PROGRAM_LUT 7
203
204#define BITSTREAM_START_ADDR 0x00000000
205#define BITSTREAM_SIZE 0x00040000
206
207#define WPC_FW_0_START_ADDR 0x00040000
208#define WPC_FW_0_SIZE 0x00000ce8
209
210#define SEQUENCE_0_START_ADDR 0x00044000
211#define SEQUENCE_0_SIZE 0x00001000
212
213#define SEQUENCE_1_START_ADDR 0x00045000
214#define SEQUENCE_1_SIZE 0x00000d10
215
216#define SEQUENCE_2_START_ADDR 0x00046000
217#define SEQUENCE_2_SIZE 0x00000d10
218
219#define SEQUENCE_3_START_ADDR 0x00047000
220#define SEQUENCE_3_SIZE 0x00000d10
221
222#define SEQUENCE_4_START_ADDR 0x00048000
223#define SEQUENCE_4_SIZE 0x00000d10
224
225#define SEQUENCE_5_START_ADDR 0x00049000
226#define SEQUENCE_5_SIZE 0x00000d10
227
228#define SEQUENCE_6_START_ADDR 0x0004a000
229#define SEQUENCE_6_SIZE 0x00000d10
230
231#define CMT_LUT_0_START_ADDR 0x0004b200
232#define CMT_LUT_0_SIZE 0x00000600
233
234#define CMT_LUT_1_START_ADDR 0x0004b800
235#define CMT_LUT_1_SIZE 0x00000600
236
237#define CMT_LUT_2_START_ADDR 0x0004be00
238#define CMT_LUT_2_SIZE 0x00000600
239
240#define CMT_LUT_3_START_ADDR 0x0004c400
241#define CMT_LUT_3_SIZE 0x00000600
242
243#define CMT_LUT_4_START_ADDR 0x0004ca00
244#define CMT_LUT_4_SIZE 0x00000600
245
246#define CMT_LUT_5_START_ADDR 0x0004d000
247#define CMT_LUT_5_SIZE 0x00000600
248
249#define CMT_LUT_6_START_ADDR 0x0004d600
250#define CMT_LUT_6_SIZE 0x00000600
251
252#define DRC_TABLE_0_START_ADDR 0x0004dc00
253#define DRC_TABLE_0_SIZE 0x00000100
254
255#define SPLASH_0_START_ADDR 0x0004dd00
256#define SPLASH_0_SIZE 0x00032280
257
258#define SEQUENCE_7_START_ADDR 0x00080000
259#define SEQUENCE_7_SIZE 0x00000d10
260
261#define SEQUENCE_8_START_ADDR 0x00081800
262#define SEQUENCE_8_SIZE 0x00000d10
263
264#define SEQUENCE_9_START_ADDR 0x00083000
265#define SEQUENCE_9_SIZE 0x00000d10
266
267#define CMT_LUT_7_START_ADDR 0x0008e000
268#define CMT_LUT_7_SIZE 0x00000600
269
270#define CMT_LUT_8_START_ADDR 0x0008e800
271#define CMT_LUT_8_SIZE 0x00000600
272
273#define CMT_LUT_9_START_ADDR 0x0008f000
274#define CMT_LUT_9_SIZE 0x00000600
275
276#define SPLASH_1_START_ADDR 0x0009a000
277#define SPLASH_1_SIZE 0x00032280
278
279#define SPLASH_2_START_ADDR 0x000cd000
280#define SPLASH_2_SIZE 0x00032280
281
282#define SPLASH_3_START_ADDR 0x00100000
283#define SPLASH_3_SIZE 0x00032280
284
285#define OPT_SPLASH_0_START_ADDR 0x00134000
286#define OPT_SPLASH_0_SIZE 0x000cb100
287
288#endif
diff --git a/include/video/omap-panel-picodlp.h b/include/video/omap-panel-picodlp.h
new file mode 100644
index 000000000000..1c342ef6f3a1
--- /dev/null
+++ b/include/video/omap-panel-picodlp.h
@@ -0,0 +1,23 @@
1/*
2 * panel data for picodlp panel
3 *
4 * Copyright (C) 2011 Texas Instruments
5 *
6 * Author: Mayuresh Janorkar <mayur@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#ifndef __PANEL_PICODLP_H
13#define __PANEL_PICODLP_H
14/**
15 * struct : picodlp panel data
16 * picodlp_adapter_id: i2c_adapter number for picodlp
17 */
18struct picodlp_panel_data {
19 int picodlp_adapter_id;
20 int emu_done_gpio;
21 int pwrgood_gpio;
22};
23#endif /* __PANEL_PICODLP_H */