From 7c68dd96d5a5eefe3ff6d9b94fc98fd9378aff1f Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 3 Aug 2011 14:00:57 +0300 Subject: OMAP: DSS2: Change DSI device naming Currently, there are 2 differently named platform devices generated for the 2 DSS DSI modules. In order to use the same driver, the dsi devices should be 2 instances of the same platform device. Change the platform device names from "omapdss_dsi1" and "omapdss_dsi2" to omapdss_dsi", and set the device indices to 0 and 1. Signed-off-by: Archit Taneja Acked-by: Tony Lindgren Signed-off-by: Tomi Valkeinen --- arch/arm/mach-omap2/display.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-omap2/display.c') diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index a5b7a236..c42df11 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -61,7 +61,7 @@ static const struct omap_dss_hwmod_data omap3_dss_hwmod_data[] __initdata = { { "dss_dispc", "omapdss_dispc", -1 }, { "dss_rfbi", "omapdss_rfbi", -1 }, { "dss_venc", "omapdss_venc", -1 }, - { "dss_dsi1", "omapdss_dsi1", -1 }, + { "dss_dsi1", "omapdss_dsi", 0 }, }; static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = { @@ -69,8 +69,8 @@ static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = { { "dss_dispc", "omapdss_dispc", -1 }, { "dss_rfbi", "omapdss_rfbi", -1 }, { "dss_venc", "omapdss_venc", -1 }, - { "dss_dsi1", "omapdss_dsi1", -1 }, - { "dss_dsi2", "omapdss_dsi2", -1 }, + { "dss_dsi1", "omapdss_dsi", 0 }, + { "dss_dsi2", "omapdss_dsi", 1 }, { "dss_hdmi", "omapdss_hdmi", -1 }, }; -- cgit v1.1 From 5bc416cba15f43c799fc02727c6d6887f3e35a4e Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 15 Jun 2011 15:21:12 +0300 Subject: OMAP: DSS2: DSI: Improve dsi_mux_pads parameters dsi_mux_pads() needs to know about the DSI HW module and the DSI lanes used. Split the function into two, enable and disable, which take necessary arguments, and add empty implementations for both. Signed-off-by: Tomi Valkeinen --- arch/arm/mach-omap2/display.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'arch/arm/mach-omap2/display.c') diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index c42df11..7c6011d 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -74,6 +74,15 @@ static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = { { "dss_hdmi", "omapdss_hdmi", -1 }, }; +static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask) +{ + return 0; +} + +static void omap_dsi_disable_pads(int dsi_id, unsigned lane_mask) +{ +} + int __init omap_display_init(struct omap_dss_board_info *board_data) { int r = 0; @@ -96,6 +105,11 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) oh_count = ARRAY_SIZE(omap4_dss_hwmod_data); } + if (board_data->dsi_enable_pads == NULL) + board_data->dsi_enable_pads = omap_dsi_enable_pads; + if (board_data->dsi_disable_pads == NULL) + board_data->dsi_disable_pads = omap_dsi_disable_pads; + pdata.board_data = board_data; pdata.board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count; -- cgit v1.1 From dc35835c6f4bf3f15b68c723c9b7540cf11b9ad6 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 15 Jun 2011 15:22:47 +0300 Subject: 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 --- arch/arm/mach-omap2/display.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'arch/arm/mach-omap2/display.c') diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 7c6011d..62510ec 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -27,6 +27,8 @@ #include #include +#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) -- cgit v1.1