summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-06-15 15:22:47 +0300
committerSebastien Jan <s-jan@ti.com>2011-10-10 15:07:51 +0200
commit1624d1e91fbf3a7a590cf91a16f50974f5b7217c (patch)
tree1e0d7b9a9564216915ee8324d8b2e3427957329f
parentd82941f771a10fc6eeab785684aac7bffa347aa4 (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. Also remove the DSI pin muxing code from board-4430sdp.c, as the common code now handles it. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c10
-rw-r--r--arch/arm/mach-omap2/display.c40
2 files changed, 40 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 2d4bfd7838b0..c31cff2da0e2 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -42,7 +42,6 @@
#include "mux.h"
#include "hsmmc.h"
#include "timer-gp.h"
-#include "control.h"
#include "common-board-devices.h"
#define ETH_KS8851_IRQ 34
@@ -505,17 +504,8 @@ static struct nokia_dsi_panel_data dsi1_panel;
static void sdp4430_lcd_init(void)
{
- u32 reg;
int status;
- /* Enable 3 lanes in DSI1 module, disable pull down */
- reg = omap4_ctrl_pad_readl(OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY);
- reg &= ~OMAP4_DSI1_LANEENABLE_MASK;
- reg |= 0x7 << OMAP4_DSI1_LANEENABLE_SHIFT;
- reg &= ~OMAP4_DSI1_PIPD_MASK;
- reg |= 0x7 << OMAP4_DSI1_PIPD_SHIFT;
- omap4_ctrl_pad_writel(reg, OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY);
-
/* Panel Taal reset and backlight GPIO init */
status = gpio_request_one(dsi1_panel.reset_gpio, GPIOF_DIR_OUT,
"lcd_reset_gpio");
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 @@
#include <plat/omap_device.h>
#include <plat/omap-pm.h>
+#include "control.h"
+
static struct platform_device omap_display_device = {
.name = "omapdss",
.id = -1,
@@ -74,13 +76,51 @@ static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = {
{ "dss_hdmi", "omapdss_hdmi", -1 },
};
+static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
+{
+ u32 enable_mask, enable_shift;
+ u32 pipd_mask, pipd_shift;
+ u32 reg;
+
+ if (dsi_id == 0) {
+ enable_mask = OMAP4_DSI1_LANEENABLE_MASK;
+ enable_shift = OMAP4_DSI1_LANEENABLE_SHIFT;
+ pipd_mask = OMAP4_DSI1_PIPD_MASK;
+ pipd_shift = OMAP4_DSI1_PIPD_SHIFT;
+ } else if (dsi_id == 1) {
+ enable_mask = OMAP4_DSI2_LANEENABLE_MASK;
+ enable_shift = OMAP4_DSI2_LANEENABLE_SHIFT;
+ pipd_mask = OMAP4_DSI2_PIPD_MASK;
+ pipd_shift = OMAP4_DSI2_PIPD_SHIFT;
+ } else {
+ return -ENODEV;
+ }
+
+ reg = omap4_ctrl_pad_readl(OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY);
+
+ reg &= ~enable_mask;
+ reg &= ~pipd_mask;
+
+ reg |= (lanes << enable_shift) & enable_mask;
+ reg |= (lanes << pipd_shift) & pipd_mask;
+
+ omap4_ctrl_pad_writel(reg, OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY);
+
+ return 0;
+}
+
static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask)
{
+ if (cpu_is_omap44xx())
+ return omap4_dsi_mux_pads(dsi_id, lane_mask);
+
return 0;
}
static void omap_dsi_disable_pads(int dsi_id, unsigned lane_mask)
{
+ if (cpu_is_omap44xx())
+ omap4_dsi_mux_pads(dsi_id, 0);
}
int __init omap_display_init(struct omap_dss_board_info *board_data)