diff options
author | Mythri P K <mythripk@ti.com> | 2012-01-02 03:32:37 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-01-05 03:34:49 -0500 |
commit | ee9dfd82ff1317ac5c0147fe21508ad6d7df4cff (patch) | |
tree | 2a8daed44cc7dc80ade67a75fe587537cb763938 | |
parent | 6acea9c2dab2b440a06510b1e33e7db07289a22e (diff) |
OMAPDSS: HDMI: Move duplicate code from boardfile
Move duplicate HDMI mux_init code from omap4 and panda board file
to display file.
Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/board-4430sdp.c | 16 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-omap4panda.c | 17 | ||||
-rw-r--r-- | arch/arm/mach-omap2/display.c | 23 | ||||
-rw-r--r-- | include/video/omapdss.h | 2 |
4 files changed, 27 insertions, 31 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 515646886b59..312b158240ed 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -595,20 +595,6 @@ static void __init omap_sfh7741prox_init(void) | |||
595 | __func__, OMAP4_SFH7741_ENABLE_GPIO, error); | 595 | __func__, OMAP4_SFH7741_ENABLE_GPIO, error); |
596 | } | 596 | } |
597 | 597 | ||
598 | static void sdp4430_hdmi_mux_init(void) | ||
599 | { | ||
600 | /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */ | ||
601 | omap_mux_init_signal("hdmi_hpd", | ||
602 | OMAP_PIN_INPUT_PULLUP); | ||
603 | omap_mux_init_signal("hdmi_cec", | ||
604 | OMAP_PIN_INPUT_PULLUP); | ||
605 | /* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */ | ||
606 | omap_mux_init_signal("hdmi_ddc_scl", | ||
607 | OMAP_PIN_INPUT_PULLUP); | ||
608 | omap_mux_init_signal("hdmi_ddc_sda", | ||
609 | OMAP_PIN_INPUT_PULLUP); | ||
610 | } | ||
611 | |||
612 | static struct gpio sdp4430_hdmi_gpios[] = { | 598 | static struct gpio sdp4430_hdmi_gpios[] = { |
613 | { HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_hpd" }, | 599 | { HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_hpd" }, |
614 | { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" }, | 600 | { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" }, |
@@ -826,9 +812,9 @@ static void omap_4430sdp_display_init(void) | |||
826 | pr_err("%s: Could not get display_sel GPIO\n", __func__); | 812 | pr_err("%s: Could not get display_sel GPIO\n", __func__); |
827 | 813 | ||
828 | sdp4430_lcd_init(); | 814 | sdp4430_lcd_init(); |
829 | sdp4430_hdmi_mux_init(); | ||
830 | sdp4430_picodlp_init(); | 815 | sdp4430_picodlp_init(); |
831 | omap_display_init(&sdp4430_dss_data); | 816 | omap_display_init(&sdp4430_dss_data); |
817 | omap_hdmi_init(); | ||
832 | } | 818 | } |
833 | 819 | ||
834 | #ifdef CONFIG_OMAP_MUX | 820 | #ifdef CONFIG_OMAP_MUX |
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index a8c2c4263e38..9cc41ce29dab 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
@@ -478,21 +478,6 @@ int __init omap4_panda_dvi_init(void) | |||
478 | return r; | 478 | return r; |
479 | } | 479 | } |
480 | 480 | ||
481 | |||
482 | static void omap4_panda_hdmi_mux_init(void) | ||
483 | { | ||
484 | /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */ | ||
485 | omap_mux_init_signal("hdmi_hpd", | ||
486 | OMAP_PIN_INPUT_PULLUP); | ||
487 | omap_mux_init_signal("hdmi_cec", | ||
488 | OMAP_PIN_INPUT_PULLUP); | ||
489 | /* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */ | ||
490 | omap_mux_init_signal("hdmi_ddc_scl", | ||
491 | OMAP_PIN_INPUT_PULLUP); | ||
492 | omap_mux_init_signal("hdmi_ddc_sda", | ||
493 | OMAP_PIN_INPUT_PULLUP); | ||
494 | } | ||
495 | |||
496 | static struct gpio panda_hdmi_gpios[] = { | 481 | static struct gpio panda_hdmi_gpios[] = { |
497 | { HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_hpd" }, | 482 | { HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_hpd" }, |
498 | { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" }, | 483 | { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" }, |
@@ -544,8 +529,8 @@ void omap4_panda_display_init(void) | |||
544 | if (r) | 529 | if (r) |
545 | pr_err("error initializing panda DVI\n"); | 530 | pr_err("error initializing panda DVI\n"); |
546 | 531 | ||
547 | omap4_panda_hdmi_mux_init(); | ||
548 | omap_display_init(&omap4_panda_dss_data); | 532 | omap_display_init(&omap4_panda_dss_data); |
533 | omap_hdmi_init(); | ||
549 | } | 534 | } |
550 | 535 | ||
551 | static void __init omap4_panda_init(void) | 536 | static void __init omap4_panda_init(void) |
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index dce9905d64bb..8436088ffe13 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <plat/omap-pm.h> | 29 | #include <plat/omap-pm.h> |
30 | #include <plat/common.h> | 30 | #include <plat/common.h> |
31 | 31 | ||
32 | #include "mux.h" | ||
32 | #include "control.h" | 33 | #include "control.h" |
33 | #include "display.h" | 34 | #include "display.h" |
34 | 35 | ||
@@ -96,6 +97,20 @@ static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = { | |||
96 | { "dss_hdmi", "omapdss_hdmi", -1 }, | 97 | { "dss_hdmi", "omapdss_hdmi", -1 }, |
97 | }; | 98 | }; |
98 | 99 | ||
100 | static void omap4_hdmi_mux_pads() | ||
101 | { | ||
102 | /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */ | ||
103 | omap_mux_init_signal("hdmi_hpd", | ||
104 | OMAP_PIN_INPUT_PULLUP); | ||
105 | omap_mux_init_signal("hdmi_cec", | ||
106 | OMAP_PIN_INPUT_PULLUP); | ||
107 | /* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */ | ||
108 | omap_mux_init_signal("hdmi_ddc_scl", | ||
109 | OMAP_PIN_INPUT_PULLUP); | ||
110 | omap_mux_init_signal("hdmi_ddc_sda", | ||
111 | OMAP_PIN_INPUT_PULLUP); | ||
112 | } | ||
113 | |||
99 | static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes) | 114 | static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes) |
100 | { | 115 | { |
101 | u32 enable_mask, enable_shift; | 116 | u32 enable_mask, enable_shift; |
@@ -129,6 +144,14 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes) | |||
129 | return 0; | 144 | return 0; |
130 | } | 145 | } |
131 | 146 | ||
147 | int omap_hdmi_init(void) | ||
148 | { | ||
149 | if (cpu_is_omap44xx()) | ||
150 | omap4_hdmi_mux_pads(); | ||
151 | |||
152 | return 0; | ||
153 | } | ||
154 | |||
132 | static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask) | 155 | static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask) |
133 | { | 156 | { |
134 | if (cpu_is_omap44xx()) | 157 | if (cpu_is_omap44xx()) |
diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 39862b8c9805..c1e3cb0d2c5e 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h | |||
@@ -309,6 +309,8 @@ struct omap_dss_board_info { | |||
309 | 309 | ||
310 | /* Init with the board info */ | 310 | /* Init with the board info */ |
311 | extern int omap_display_init(struct omap_dss_board_info *board_data); | 311 | extern int omap_display_init(struct omap_dss_board_info *board_data); |
312 | /* HDMI mux init*/ | ||
313 | extern int omap_hdmi_init(void); | ||
312 | 314 | ||
313 | struct omap_display_platform_data { | 315 | struct omap_display_platform_data { |
314 | struct omap_dss_board_info *board_data; | 316 | struct omap_dss_board_info *board_data; |