aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/display.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-10-30 18:30:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-30 18:30:01 -0400
commitacff987d94cbdb4049f3706bed1f1792f8ef6837 (patch)
tree36bded977aab5d80cf9aeb5467f83dd554a25d01 /arch/arm/mach-omap2/display.c
parentce949717b559709423c1ef716a9db16d1dcadaed (diff)
parentb57287ba497b63a0d87a058631bbddfed9392e9f (diff)
Merge branch 'fbdev-next' of git://github.com/schandinat/linux-2.6
* 'fbdev-next' of git://github.com/schandinat/linux-2.6: (270 commits) video: platinumfb: Add __devexit_p at necessary place drivers/video: fsl-diu-fb: merge diu_pool into fsl_diu_data drivers/video: fsl-diu-fb: merge diu_hw into fsl_diu_data drivers/video: fsl-diu-fb: only DIU modes 0 and 1 are supported drivers/video: fsl-diu-fb: remove unused panel operating mode support drivers/video: fsl-diu-fb: use an enum for the AOI index drivers/video: fsl-diu-fb: add several new video modes drivers/video: fsl-diu-fb: remove broken screen blanking support drivers/video: fsl-diu-fb: move some definitions out of the header file drivers/video: fsl-diu-fb: fix some ioctls video: da8xx-fb: Increased resolution configuration of revised LCDC IP OMAPDSS: picodlp: add missing #include <linux/module.h> fb: fix au1100fb bitrot. mx3fb: fix NULL pointer dereference in screen blanking. video: irq: Remove IRQF_DISABLED smscufx: change edid data to u8 instead of char OMAPDSS: DISPC: zorder support for DSS overlays OMAPDSS: DISPC: VIDEO3 pipeline support OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting video/omap: fix build dependencies ... Fix up conflicts in: - drivers/staging/xgifb/XGI_main_26.c Changes to XGIfb_pan_var() - drivers/video/omap/{lcd_apollon.c,lcd_ldp.c,lcd_overo.c} Removed (or in the case of apollon.c, merged into the generic DSS panel in drivers/video/omap2/displays/panel-generic-dpi.c)
Diffstat (limited to 'arch/arm/mach-omap2/display.c')
-rw-r--r--arch/arm/mach-omap2/display.c60
1 files changed, 57 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index a5b7a236aa5b..62510ec863c6 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -27,6 +27,8 @@
27#include <plat/omap_device.h> 27#include <plat/omap_device.h>
28#include <plat/omap-pm.h> 28#include <plat/omap-pm.h>
29 29
30#include "control.h"
31
30static struct platform_device omap_display_device = { 32static struct platform_device omap_display_device = {
31 .name = "omapdss", 33 .name = "omapdss",
32 .id = -1, 34 .id = -1,
@@ -61,7 +63,7 @@ static const struct omap_dss_hwmod_data omap3_dss_hwmod_data[] __initdata = {
61 { "dss_dispc", "omapdss_dispc", -1 }, 63 { "dss_dispc", "omapdss_dispc", -1 },
62 { "dss_rfbi", "omapdss_rfbi", -1 }, 64 { "dss_rfbi", "omapdss_rfbi", -1 },
63 { "dss_venc", "omapdss_venc", -1 }, 65 { "dss_venc", "omapdss_venc", -1 },
64 { "dss_dsi1", "omapdss_dsi1", -1 }, 66 { "dss_dsi1", "omapdss_dsi", 0 },
65}; 67};
66 68
67static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = { 69static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = {
@@ -69,11 +71,58 @@ static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = {
69 { "dss_dispc", "omapdss_dispc", -1 }, 71 { "dss_dispc", "omapdss_dispc", -1 },
70 { "dss_rfbi", "omapdss_rfbi", -1 }, 72 { "dss_rfbi", "omapdss_rfbi", -1 },
71 { "dss_venc", "omapdss_venc", -1 }, 73 { "dss_venc", "omapdss_venc", -1 },
72 { "dss_dsi1", "omapdss_dsi1", -1 }, 74 { "dss_dsi1", "omapdss_dsi", 0 },
73 { "dss_dsi2", "omapdss_dsi2", -1 }, 75 { "dss_dsi2", "omapdss_dsi", 1 },
74 { "dss_hdmi", "omapdss_hdmi", -1 }, 76 { "dss_hdmi", "omapdss_hdmi", -1 },
75}; 77};
76 78
79static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
80{
81 u32 enable_mask, enable_shift;
82 u32 pipd_mask, pipd_shift;
83 u32 reg;
84
85 if (dsi_id == 0) {
86 enable_mask = OMAP4_DSI1_LANEENABLE_MASK;
87 enable_shift = OMAP4_DSI1_LANEENABLE_SHIFT;
88 pipd_mask = OMAP4_DSI1_PIPD_MASK;
89 pipd_shift = OMAP4_DSI1_PIPD_SHIFT;
90 } else if (dsi_id == 1) {
91 enable_mask = OMAP4_DSI2_LANEENABLE_MASK;
92 enable_shift = OMAP4_DSI2_LANEENABLE_SHIFT;
93 pipd_mask = OMAP4_DSI2_PIPD_MASK;
94 pipd_shift = OMAP4_DSI2_PIPD_SHIFT;
95 } else {
96 return -ENODEV;
97 }
98
99 reg = omap4_ctrl_pad_readl(OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY);
100
101 reg &= ~enable_mask;
102 reg &= ~pipd_mask;
103
104 reg |= (lanes << enable_shift) & enable_mask;
105 reg |= (lanes << pipd_shift) & pipd_mask;
106
107 omap4_ctrl_pad_writel(reg, OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY);
108
109 return 0;
110}
111
112static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask)
113{
114 if (cpu_is_omap44xx())
115 return omap4_dsi_mux_pads(dsi_id, lane_mask);
116
117 return 0;
118}
119
120static void omap_dsi_disable_pads(int dsi_id, unsigned lane_mask)
121{
122 if (cpu_is_omap44xx())
123 omap4_dsi_mux_pads(dsi_id, 0);
124}
125
77int __init omap_display_init(struct omap_dss_board_info *board_data) 126int __init omap_display_init(struct omap_dss_board_info *board_data)
78{ 127{
79 int r = 0; 128 int r = 0;
@@ -96,6 +145,11 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
96 oh_count = ARRAY_SIZE(omap4_dss_hwmod_data); 145 oh_count = ARRAY_SIZE(omap4_dss_hwmod_data);
97 } 146 }
98 147
148 if (board_data->dsi_enable_pads == NULL)
149 board_data->dsi_enable_pads = omap_dsi_enable_pads;
150 if (board_data->dsi_disable_pads == NULL)
151 board_data->dsi_disable_pads = omap_dsi_disable_pads;
152
99 pdata.board_data = board_data; 153 pdata.board_data = board_data;
100 pdata.board_data->get_context_loss_count = 154 pdata.board_data->get_context_loss_count =
101 omap_pm_get_dev_context_loss_count; 155 omap_pm_get_dev_context_loss_count;