Skip to content

Commit 3a5b27b

Browse files
committed
Merge branch 'for-linus' of git://gitorious.org/linux-omap-dss2/linux
* 'for-linus' of git://gitorious.org/linux-omap-dss2/linux: (49 commits) OMAP: DSS2: Taal: Fix TE when resuming OMAP: DSS2: Taal: Fix ESD check OMAP: DSS2: OMAPFB: Constify some function parameters OMAP: DSS2: OMAPFB: install omapfb.h OMAP: DSS2: DSI: add error prints OMAP: DSS2: TPO-TD03MTEA1: fix function names OMAP: DSS2: DSI: add dsi_vc_dcs_read_2() helper OMAP: DSS2: OMAPFB: Remove FB_OMAP2_FORCE_AUTO_UPDATE OMAP: DSS2: DSI: remove external TE support OMAP: DSS2: move timing functions OMAP: DSS2: move set/get_wss() OMAP: DSS2: move enable/disable/suspend/resume OMAP: DSS2: move update() and sync() OMAP: DSS2: move set/get_update_mode() OMAP: DSS2: move enable/get_te() OMAP: DSS2: move get_recommended_bpp() OMAP: DSS2: move get_resolution() OMAP: DSS2: move enable/disable_channel to overlay manager OMAP: DSS2: move wait_vsync() OMAP: DSS2: move get/set_rotate() ...
2 parents 5057bfa + 21df20f commit 3a5b27b

31 files changed

+2186
-1840
lines changed

arch/arm/mach-omap2/board-3430sdp.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,6 @@ static struct regulator_init_data sdp3430_vdac = {
541541

542542
/* VPLL2 for digital video outputs */
543543
static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
544-
{
545-
.supply = "vdvi",
546-
.dev = &sdp3430_lcd_device.dev,
547-
},
548544
{
549545
.supply = "vdds_dsi",
550546
.dev = &sdp3430_dss_device.dev,

arch/arm/plat-omap/include/plat/display.h

Lines changed: 66 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,12 @@ int omap_rfbi_setup_te(enum omap_rfbi_te_mode mode,
233233
void dsi_bus_lock(void);
234234
void dsi_bus_unlock(void);
235235
int dsi_vc_dcs_write(int channel, u8 *data, int len);
236+
int dsi_vc_dcs_write_0(int channel, u8 dcs_cmd);
237+
int dsi_vc_dcs_write_1(int channel, u8 dcs_cmd, u8 param);
236238
int dsi_vc_dcs_write_nosync(int channel, u8 *data, int len);
237239
int dsi_vc_dcs_read(int channel, u8 dcs_cmd, u8 *buf, int buflen);
240+
int dsi_vc_dcs_read_1(int channel, u8 dcs_cmd, u8 *data);
241+
int dsi_vc_dcs_read_2(int channel, u8 dcs_cmd, u16 *data);
238242
int dsi_vc_set_max_rx_packet_size(int channel, u16 len);
239243
int dsi_vc_send_null(int channel);
240244
int dsi_vc_send_bta_sync(int channel);
@@ -367,6 +371,10 @@ struct omap_overlay_manager {
367371

368372
int (*apply)(struct omap_overlay_manager *mgr);
369373
int (*wait_for_go)(struct omap_overlay_manager *mgr);
374+
int (*wait_for_vsync)(struct omap_overlay_manager *mgr);
375+
376+
int (*enable)(struct omap_overlay_manager *mgr);
377+
int (*disable)(struct omap_overlay_manager *mgr);
370378
};
371379

372380
struct omap_dss_device {
@@ -426,16 +434,11 @@ struct omap_dss_device {
426434
int acb; /* ac-bias pin frequency */
427435

428436
enum omap_panel_config config;
429-
430-
u8 recommended_bpp;
431-
432-
struct omap_dss_device *ctrl;
433437
} panel;
434438

435439
struct {
436440
u8 pixel_size;
437441
struct rfbi_timings rfbi_timings;
438-
struct omap_dss_device *panel;
439442
} ctrl;
440443

441444
int reset_gpio;
@@ -460,49 +463,6 @@ struct omap_dss_device {
460463

461464
enum omap_dss_display_state state;
462465

463-
int (*enable)(struct omap_dss_device *dssdev);
464-
void (*disable)(struct omap_dss_device *dssdev);
465-
466-
int (*suspend)(struct omap_dss_device *dssdev);
467-
int (*resume)(struct omap_dss_device *dssdev);
468-
469-
void (*get_resolution)(struct omap_dss_device *dssdev,
470-
u16 *xres, u16 *yres);
471-
int (*get_recommended_bpp)(struct omap_dss_device *dssdev);
472-
473-
int (*check_timings)(struct omap_dss_device *dssdev,
474-
struct omap_video_timings *timings);
475-
void (*set_timings)(struct omap_dss_device *dssdev,
476-
struct omap_video_timings *timings);
477-
void (*get_timings)(struct omap_dss_device *dssdev,
478-
struct omap_video_timings *timings);
479-
int (*update)(struct omap_dss_device *dssdev,
480-
u16 x, u16 y, u16 w, u16 h);
481-
int (*sync)(struct omap_dss_device *dssdev);
482-
int (*wait_vsync)(struct omap_dss_device *dssdev);
483-
484-
int (*set_update_mode)(struct omap_dss_device *dssdev,
485-
enum omap_dss_update_mode);
486-
enum omap_dss_update_mode (*get_update_mode)
487-
(struct omap_dss_device *dssdev);
488-
489-
int (*enable_te)(struct omap_dss_device *dssdev, bool enable);
490-
int (*get_te)(struct omap_dss_device *dssdev);
491-
492-
u8 (*get_rotate)(struct omap_dss_device *dssdev);
493-
int (*set_rotate)(struct omap_dss_device *dssdev, u8 rotate);
494-
495-
bool (*get_mirror)(struct omap_dss_device *dssdev);
496-
int (*set_mirror)(struct omap_dss_device *dssdev, bool enable);
497-
498-
int (*run_test)(struct omap_dss_device *dssdev, int test);
499-
int (*memory_read)(struct omap_dss_device *dssdev,
500-
void *buf, size_t size,
501-
u16 x, u16 y, u16 w, u16 h);
502-
503-
int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
504-
u32 (*get_wss)(struct omap_dss_device *dssdev);
505-
506466
/* platform specific */
507467
int (*platform_enable)(struct omap_dss_device *dssdev);
508468
void (*platform_disable)(struct omap_dss_device *dssdev);
@@ -522,11 +482,17 @@ struct omap_dss_driver {
522482
int (*resume)(struct omap_dss_device *display);
523483
int (*run_test)(struct omap_dss_device *display, int test);
524484

525-
void (*setup_update)(struct omap_dss_device *dssdev,
526-
u16 x, u16 y, u16 w, u16 h);
485+
int (*set_update_mode)(struct omap_dss_device *dssdev,
486+
enum omap_dss_update_mode);
487+
enum omap_dss_update_mode (*get_update_mode)(
488+
struct omap_dss_device *dssdev);
489+
490+
int (*update)(struct omap_dss_device *dssdev,
491+
u16 x, u16 y, u16 w, u16 h);
492+
int (*sync)(struct omap_dss_device *dssdev);
527493

528494
int (*enable_te)(struct omap_dss_device *dssdev, bool enable);
529-
int (*wait_for_te)(struct omap_dss_device *dssdev);
495+
int (*get_te)(struct omap_dss_device *dssdev);
530496

531497
u8 (*get_rotate)(struct omap_dss_device *dssdev);
532498
int (*set_rotate)(struct omap_dss_device *dssdev, u8 rotate);
@@ -537,6 +503,20 @@ struct omap_dss_driver {
537503
int (*memory_read)(struct omap_dss_device *dssdev,
538504
void *buf, size_t size,
539505
u16 x, u16 y, u16 w, u16 h);
506+
507+
void (*get_resolution)(struct omap_dss_device *dssdev,
508+
u16 *xres, u16 *yres);
509+
int (*get_recommended_bpp)(struct omap_dss_device *dssdev);
510+
511+
int (*check_timings)(struct omap_dss_device *dssdev,
512+
struct omap_video_timings *timings);
513+
void (*set_timings)(struct omap_dss_device *dssdev,
514+
struct omap_video_timings *timings);
515+
void (*get_timings)(struct omap_dss_device *dssdev,
516+
struct omap_video_timings *timings);
517+
518+
int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
519+
u32 (*get_wss)(struct omap_dss_device *dssdev);
540520
};
541521

542522
int omap_dss_register_driver(struct omap_dss_driver *);
@@ -561,6 +541,10 @@ struct omap_overlay_manager *omap_dss_get_overlay_manager(int num);
561541
int omap_dss_get_num_overlays(void);
562542
struct omap_overlay *omap_dss_get_overlay(int num);
563543

544+
void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
545+
u16 *xres, u16 *yres);
546+
int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev);
547+
564548
typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
565549
int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
566550
int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
@@ -572,4 +556,35 @@ int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
572556
#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
573557
#define to_dss_device(x) container_of((x), struct omap_dss_device, dev)
574558

559+
void omapdss_dsi_vc_enable_hs(int channel, bool enable);
560+
int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable);
561+
562+
int omap_dsi_prepare_update(struct omap_dss_device *dssdev,
563+
u16 *x, u16 *y, u16 *w, u16 *h);
564+
int omap_dsi_update(struct omap_dss_device *dssdev,
565+
int channel,
566+
u16 x, u16 y, u16 w, u16 h,
567+
void (*callback)(int, void *), void *data);
568+
569+
int omapdss_dsi_display_enable(struct omap_dss_device *dssdev);
570+
void omapdss_dsi_display_disable(struct omap_dss_device *dssdev);
571+
572+
int omapdss_dpi_display_enable(struct omap_dss_device *dssdev);
573+
void omapdss_dpi_display_disable(struct omap_dss_device *dssdev);
574+
void dpi_set_timings(struct omap_dss_device *dssdev,
575+
struct omap_video_timings *timings);
576+
int dpi_check_timings(struct omap_dss_device *dssdev,
577+
struct omap_video_timings *timings);
578+
579+
int omapdss_sdi_display_enable(struct omap_dss_device *dssdev);
580+
void omapdss_sdi_display_disable(struct omap_dss_device *dssdev);
581+
582+
int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev);
583+
void omapdss_rfbi_display_disable(struct omap_dss_device *dssdev);
584+
int omap_rfbi_prepare_update(struct omap_dss_device *dssdev,
585+
u16 *x, u16 *y, u16 *w, u16 *h);
586+
int omap_rfbi_update(struct omap_dss_device *dssdev,
587+
u16 x, u16 y, u16 w, u16 h,
588+
void (*callback)(void *), void *data);
589+
575590
#endif

drivers/video/omap/lcd_ams_delta.c

Lines changed: 89 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <linux/platform_device.h>
2525
#include <linux/io.h>
2626
#include <linux/delay.h>
27+
#include <linux/lcd.h>
2728

2829
#include <plat/board-ams-delta.h>
2930
#include <mach/hardware.h>
@@ -32,6 +33,71 @@
3233

3334
#define AMS_DELTA_DEFAULT_CONTRAST 112
3435

36+
#define AMS_DELTA_MAX_CONTRAST 0x00FF
37+
#define AMS_DELTA_LCD_POWER 0x0100
38+
39+
40+
/* LCD class device section */
41+
42+
static int ams_delta_lcd;
43+
44+
static int ams_delta_lcd_set_power(struct lcd_device *dev, int power)
45+
{
46+
if (power == FB_BLANK_UNBLANK) {
47+
if (!(ams_delta_lcd & AMS_DELTA_LCD_POWER)) {
48+
omap_writeb(ams_delta_lcd & AMS_DELTA_MAX_CONTRAST,
49+
OMAP_PWL_ENABLE);
50+
omap_writeb(1, OMAP_PWL_CLK_ENABLE);
51+
ams_delta_lcd |= AMS_DELTA_LCD_POWER;
52+
}
53+
} else {
54+
if (ams_delta_lcd & AMS_DELTA_LCD_POWER) {
55+
omap_writeb(0, OMAP_PWL_ENABLE);
56+
omap_writeb(0, OMAP_PWL_CLK_ENABLE);
57+
ams_delta_lcd &= ~AMS_DELTA_LCD_POWER;
58+
}
59+
}
60+
return 0;
61+
}
62+
63+
static int ams_delta_lcd_set_contrast(struct lcd_device *dev, int value)
64+
{
65+
if ((value >= 0) && (value <= AMS_DELTA_MAX_CONTRAST)) {
66+
omap_writeb(value, OMAP_PWL_ENABLE);
67+
ams_delta_lcd &= ~AMS_DELTA_MAX_CONTRAST;
68+
ams_delta_lcd |= value;
69+
}
70+
return 0;
71+
}
72+
73+
#ifdef CONFIG_LCD_CLASS_DEVICE
74+
static int ams_delta_lcd_get_power(struct lcd_device *dev)
75+
{
76+
if (ams_delta_lcd & AMS_DELTA_LCD_POWER)
77+
return FB_BLANK_UNBLANK;
78+
else
79+
return FB_BLANK_POWERDOWN;
80+
}
81+
82+
static int ams_delta_lcd_get_contrast(struct lcd_device *dev)
83+
{
84+
if (!(ams_delta_lcd & AMS_DELTA_LCD_POWER))
85+
return 0;
86+
87+
return ams_delta_lcd & AMS_DELTA_MAX_CONTRAST;
88+
}
89+
90+
static struct lcd_ops ams_delta_lcd_ops = {
91+
.get_power = ams_delta_lcd_get_power,
92+
.set_power = ams_delta_lcd_set_power,
93+
.get_contrast = ams_delta_lcd_get_contrast,
94+
.set_contrast = ams_delta_lcd_set_contrast,
95+
};
96+
#endif
97+
98+
99+
/* omapfb panel section */
100+
35101
static int ams_delta_panel_init(struct lcd_panel *panel,
36102
struct omapfb_device *fbdev)
37103
{
@@ -48,10 +114,6 @@ static int ams_delta_panel_enable(struct lcd_panel *panel)
48114
AMS_DELTA_LATCH2_LCD_NDISP);
49115
ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN,
50116
AMS_DELTA_LATCH2_LCD_VBLEN);
51-
52-
omap_writeb(1, OMAP_PWL_CLK_ENABLE);
53-
omap_writeb(AMS_DELTA_DEFAULT_CONTRAST, OMAP_PWL_ENABLE);
54-
55117
return 0;
56118
}
57119

@@ -91,8 +153,31 @@ static struct lcd_panel ams_delta_panel = {
91153
.get_caps = ams_delta_panel_get_caps,
92154
};
93155

156+
157+
/* platform driver section */
158+
94159
static int ams_delta_panel_probe(struct platform_device *pdev)
95160
{
161+
struct lcd_device *lcd_device = NULL;
162+
#ifdef CONFIG_LCD_CLASS_DEVICE
163+
int ret;
164+
165+
lcd_device = lcd_device_register("omapfb", &pdev->dev, NULL,
166+
&ams_delta_lcd_ops);
167+
168+
if (IS_ERR(lcd_device)) {
169+
ret = PTR_ERR(lcd_device);
170+
dev_err(&pdev->dev, "failed to register device\n");
171+
return ret;
172+
}
173+
174+
platform_set_drvdata(pdev, lcd_device);
175+
lcd_device->props.max_contrast = AMS_DELTA_MAX_CONTRAST;
176+
#endif
177+
178+
ams_delta_lcd_set_contrast(lcd_device, AMS_DELTA_DEFAULT_CONTRAST);
179+
ams_delta_lcd_set_power(lcd_device, FB_BLANK_UNBLANK);
180+
96181
omapfb_register_panel(&ams_delta_panel);
97182
return 0;
98183
}

drivers/video/omap/omapfb_main.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,11 @@ static int set_color_mode(struct omapfb_plane_struct *plane,
486486
return 0;
487487
case 12:
488488
var->bits_per_pixel = 16;
489-
plane->color_mode = OMAPFB_COLOR_RGB444;
490-
return 0;
491489
case 16:
492-
plane->color_mode = OMAPFB_COLOR_RGB565;
490+
if (plane->fbdev->panel->bpp == 12)
491+
plane->color_mode = OMAPFB_COLOR_RGB444;
492+
else
493+
plane->color_mode = OMAPFB_COLOR_RGB565;
493494
return 0;
494495
default:
495496
return -EINVAL;

drivers/video/omap2/displays/Kconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,28 @@ config PANEL_SHARP_LS037V7DW01
1313
help
1414
LCD Panel used in TI's SDP3430 and EVM boards
1515

16+
config PANEL_SHARP_LQ043T1DG01
17+
tristate "Sharp LQ043T1DG01 LCD Panel"
18+
depends on OMAP2_DSS
19+
help
20+
LCD Panel used in TI's OMAP3517 EVM boards
21+
1622
config PANEL_TAAL
1723
tristate "Taal DSI Panel"
1824
depends on OMAP2_DSS_DSI
1925
help
2026
Taal DSI command mode panel from TPO.
2127

28+
config PANEL_TOPPOLY_TDO35S
29+
tristate "Toppoly TDO35S LCD Panel support"
30+
depends on OMAP2_DSS
31+
help
32+
LCD Panel used in CM-T35
33+
34+
config PANEL_TPO_TD043MTEA1
35+
tristate "TPO TD043MTEA1 LCD Panel"
36+
depends on OMAP2_DSS && I2C
37+
help
38+
LCD Panel used in OMAP3 Pandora
39+
2240
endmenu

drivers/video/omap2/displays/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
22
obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
3+
obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
34

45
obj-$(CONFIG_PANEL_TAAL) += panel-taal.o
6+
obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o
7+
obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o

0 commit comments

Comments
 (0)