diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-10-31 18:17:39 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-10-31 18:17:39 -0400 |
commit | 034ee299122c6b145d6d3cafb9ef5c329a4ab990 (patch) | |
tree | 0fb4dba7b72d28e1dc4d3bab1317a9a98302a7a5 /arch/arm/mach-omap2/display.c | |
parent | d6bb0f27709b91e674ce1441e2dd5e68620edf14 (diff) | |
parent | 3e28189038bb831512cf4f8313e1aead97c3e63f (diff) |
Merge branch 'depends/omap2_dss' into next/cleanup
Omap cleanups conflicted with omap2_dss work in a nontrivial
way, this is the most logical fixup.
Conflicts:
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-4430sdp.c
arch/arm/mach-omap2/board-apollon.c
arch/arm/mach-omap2/board-h4.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-rx51.c
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-omap2/display.c')
-rw-r--r-- | arch/arm/mach-omap2/display.c | 60 |
1 files changed, 57 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 18693f6de041..836f0f7d8c00 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 | |||
30 | static struct platform_device omap_display_device = { | 32 | static 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 | ||
67 | static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = { | 69 | static 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 | ||
79 | static 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 | |||
112 | static 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 | |||
120 | static 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 | |||
77 | int __init omap_display_init(struct omap_dss_board_info *board_data) | 126 | int __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; |