aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-06-15 08:22:47 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-09-30 09:16:17 -0400
commitdc35835c6f4bf3f15b68c723c9b7540cf11b9ad6 (patch)
treeaee0d3d230183ddc91f47cd366483281a91010d4 /arch/arm/mach-omap2
parent5bc416cba15f43c799fc02727c6d6887f3e35a4e (diff)
OMAP: DSS2: Implement dsi_mux_pads for OMAP4
Implement dsi_mux_pads for OMAP4. On enable the function enables the DSI pins and disables pull down. On disable the function disables the pins and enables pull down. It is unclear from the TRM whether the pull down is active if the pins are disabled, so this implementation may leave the pins floating when the DSI device is disabled. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/display.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 7c6011df80a8..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,
@@ -74,13 +76,51 @@ static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = {
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
77static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask) 112static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask)
78{ 113{
114 if (cpu_is_omap44xx())
115 return omap4_dsi_mux_pads(dsi_id, lane_mask);
116
79 return 0; 117 return 0;
80} 118}
81 119
82static void omap_dsi_disable_pads(int dsi_id, unsigned lane_mask) 120static void omap_dsi_disable_pads(int dsi_id, unsigned lane_mask)
83{ 121{
122 if (cpu_is_omap44xx())
123 omap4_dsi_mux_pads(dsi_id, 0);
84} 124}
85 125
86int __init omap_display_init(struct omap_dss_board_info *board_data) 126int __init omap_display_init(struct omap_dss_board_info *board_data)