diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-11-05 08:14:17 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-11-07 16:26:27 -0500 |
commit | 0191bf368fd95ecd4f83e62b0ad6de12048b14bf (patch) | |
tree | abd962268d5e58ef6c016474cb80c3f58fe4ea9e | |
parent | cc0677979e3ef1ae25ea9db4edc63786a3731526 (diff) |
OMAP: panda: move display init from board file to dss-common.c
Device tree support for omapdss is still some way in the future. In an
effort to get a minimal DSS support for DT enabled kernel on selected
OMAP4 boards, we'll go for a temporary solution: We will call the same
non-DT omapdss setup code for OMAP4 SDP and Pandaboards from
board-generic.c, thus enabling DSS for those boards.
This patch moves the display setup code from board-omap4panda.c to
dss-common.c. dss-common.c will be called by the board-omap4panda.c when
running on non-DT kernel, and by board-generic.c when running on DT
enabled kernel.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | arch/arm/mach-omap2/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-omap4panda.c | 68 | ||||
-rw-r--r-- | arch/arm/mach-omap2/dss-common.c | 104 | ||||
-rw-r--r-- | arch/arm/mach-omap2/dss-common.h | 12 |
4 files changed, 118 insertions, 68 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index fe40d9e488c9..fb38a9b24b0c 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -279,4 +279,4 @@ endif | |||
279 | emac-$(CONFIG_TI_DAVINCI_EMAC) := am35xx-emac.o | 279 | emac-$(CONFIG_TI_DAVINCI_EMAC) := am35xx-emac.o |
280 | obj-y += $(emac-m) $(emac-y) | 280 | obj-y += $(emac-m) $(emac-y) |
281 | 281 | ||
282 | obj-y += common-board-devices.o twl-common.o | 282 | obj-y += common-board-devices.o twl-common.o dss-common.o |
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index bfcd397e233c..ab505a21f703 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
@@ -36,26 +36,22 @@ | |||
36 | #include <asm/mach-types.h> | 36 | #include <asm/mach-types.h> |
37 | #include <asm/mach/arch.h> | 37 | #include <asm/mach/arch.h> |
38 | #include <asm/mach/map.h> | 38 | #include <asm/mach/map.h> |
39 | #include <video/omapdss.h> | ||
40 | 39 | ||
41 | #include "common.h" | 40 | #include "common.h" |
42 | #include <plat/usb.h> | 41 | #include <plat/usb.h> |
43 | #include <plat/mmc.h> | 42 | #include <plat/mmc.h> |
44 | #include <video/omap-panel-tfp410.h> | ||
45 | 43 | ||
46 | #include "soc.h" | 44 | #include "soc.h" |
47 | #include "hsmmc.h" | 45 | #include "hsmmc.h" |
48 | #include "control.h" | 46 | #include "control.h" |
49 | #include "mux.h" | 47 | #include "mux.h" |
50 | #include "common-board-devices.h" | 48 | #include "common-board-devices.h" |
49 | #include "dss-common.h" | ||
51 | 50 | ||
52 | #define GPIO_HUB_POWER 1 | 51 | #define GPIO_HUB_POWER 1 |
53 | #define GPIO_HUB_NRESET 62 | 52 | #define GPIO_HUB_NRESET 62 |
54 | #define GPIO_WIFI_PMENA 43 | 53 | #define GPIO_WIFI_PMENA 43 |
55 | #define GPIO_WIFI_IRQ 53 | 54 | #define GPIO_WIFI_IRQ 53 |
56 | #define HDMI_GPIO_CT_CP_HPD 60 /* HPD mode enable/disable */ | ||
57 | #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */ | ||
58 | #define HDMI_GPIO_HPD 63 /* Hotplug detect */ | ||
59 | 55 | ||
60 | /* wl127x BT, FM, GPS connectivity chip */ | 56 | /* wl127x BT, FM, GPS connectivity chip */ |
61 | static struct ti_st_plat_data wilink_platform_data = { | 57 | static struct ti_st_plat_data wilink_platform_data = { |
@@ -409,68 +405,6 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
409 | #define board_mux NULL | 405 | #define board_mux NULL |
410 | #endif | 406 | #endif |
411 | 407 | ||
412 | /* Display DVI */ | ||
413 | #define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0 | ||
414 | |||
415 | /* Using generic display panel */ | ||
416 | static struct tfp410_platform_data omap4_dvi_panel = { | ||
417 | .i2c_bus_num = 3, | ||
418 | .power_down_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO, | ||
419 | }; | ||
420 | |||
421 | static struct omap_dss_device omap4_panda_dvi_device = { | ||
422 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
423 | .name = "dvi", | ||
424 | .driver_name = "tfp410", | ||
425 | .data = &omap4_dvi_panel, | ||
426 | .phy.dpi.data_lines = 24, | ||
427 | .reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO, | ||
428 | .channel = OMAP_DSS_CHANNEL_LCD2, | ||
429 | }; | ||
430 | |||
431 | static struct omap_dss_hdmi_data omap4_panda_hdmi_data = { | ||
432 | .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD, | ||
433 | .ls_oe_gpio = HDMI_GPIO_LS_OE, | ||
434 | .hpd_gpio = HDMI_GPIO_HPD, | ||
435 | }; | ||
436 | |||
437 | static struct omap_dss_device omap4_panda_hdmi_device = { | ||
438 | .name = "hdmi", | ||
439 | .driver_name = "hdmi_panel", | ||
440 | .type = OMAP_DISPLAY_TYPE_HDMI, | ||
441 | .channel = OMAP_DSS_CHANNEL_DIGIT, | ||
442 | .data = &omap4_panda_hdmi_data, | ||
443 | }; | ||
444 | |||
445 | static struct omap_dss_device *omap4_panda_dss_devices[] = { | ||
446 | &omap4_panda_dvi_device, | ||
447 | &omap4_panda_hdmi_device, | ||
448 | }; | ||
449 | |||
450 | static struct omap_dss_board_info omap4_panda_dss_data = { | ||
451 | .num_devices = ARRAY_SIZE(omap4_panda_dss_devices), | ||
452 | .devices = omap4_panda_dss_devices, | ||
453 | .default_device = &omap4_panda_dvi_device, | ||
454 | }; | ||
455 | |||
456 | static void __init omap4_panda_display_init(void) | ||
457 | { | ||
458 | |||
459 | omap_display_init(&omap4_panda_dss_data); | ||
460 | |||
461 | /* | ||
462 | * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and | ||
463 | * later have external pull up on the HDMI I2C lines | ||
464 | */ | ||
465 | if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2) | ||
466 | omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP); | ||
467 | else | ||
468 | omap_hdmi_init(0); | ||
469 | |||
470 | omap_mux_init_gpio(HDMI_GPIO_LS_OE, OMAP_PIN_OUTPUT); | ||
471 | omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD, OMAP_PIN_OUTPUT); | ||
472 | omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN); | ||
473 | } | ||
474 | 408 | ||
475 | static void omap4_panda_init_rev(void) | 409 | static void omap4_panda_init_rev(void) |
476 | { | 410 | { |
diff --git a/arch/arm/mach-omap2/dss-common.c b/arch/arm/mach-omap2/dss-common.c new file mode 100644 index 000000000000..62d7b15d1d2f --- /dev/null +++ b/arch/arm/mach-omap2/dss-common.c | |||
@@ -0,0 +1,104 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 Texas Instruments, Inc.. | ||
3 | * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License | ||
7 | * version 2 as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, but | ||
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | * General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
17 | * 02110-1301 USA | ||
18 | * | ||
19 | */ | ||
20 | |||
21 | /* | ||
22 | * NOTE: this is a transitional file to help with DT adaptation. | ||
23 | * This file will be removed when DSS supports DT. | ||
24 | */ | ||
25 | |||
26 | #include <linux/kernel.h> | ||
27 | #include <video/omapdss.h> | ||
28 | #include <video/omap-panel-tfp410.h> | ||
29 | |||
30 | #include <plat/cpu.h> | ||
31 | |||
32 | #include "dss-common.h" | ||
33 | #include "mux.h" | ||
34 | |||
35 | #define HDMI_GPIO_CT_CP_HPD 60 /* HPD mode enable/disable */ | ||
36 | #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */ | ||
37 | #define HDMI_GPIO_HPD 63 /* Hotplug detect */ | ||
38 | |||
39 | /* Display DVI */ | ||
40 | #define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0 | ||
41 | |||
42 | /* Using generic display panel */ | ||
43 | static struct tfp410_platform_data omap4_dvi_panel = { | ||
44 | .i2c_bus_num = 3, | ||
45 | .power_down_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO, | ||
46 | }; | ||
47 | |||
48 | static struct omap_dss_device omap4_panda_dvi_device = { | ||
49 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
50 | .name = "dvi", | ||
51 | .driver_name = "tfp410", | ||
52 | .data = &omap4_dvi_panel, | ||
53 | .phy.dpi.data_lines = 24, | ||
54 | .reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO, | ||
55 | .channel = OMAP_DSS_CHANNEL_LCD2, | ||
56 | }; | ||
57 | |||
58 | static struct omap_dss_hdmi_data omap4_panda_hdmi_data = { | ||
59 | .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD, | ||
60 | .ls_oe_gpio = HDMI_GPIO_LS_OE, | ||
61 | .hpd_gpio = HDMI_GPIO_HPD, | ||
62 | }; | ||
63 | |||
64 | static struct omap_dss_device omap4_panda_hdmi_device = { | ||
65 | .name = "hdmi", | ||
66 | .driver_name = "hdmi_panel", | ||
67 | .type = OMAP_DISPLAY_TYPE_HDMI, | ||
68 | .channel = OMAP_DSS_CHANNEL_DIGIT, | ||
69 | .data = &omap4_panda_hdmi_data, | ||
70 | }; | ||
71 | |||
72 | static struct omap_dss_device *omap4_panda_dss_devices[] = { | ||
73 | &omap4_panda_dvi_device, | ||
74 | &omap4_panda_hdmi_device, | ||
75 | }; | ||
76 | |||
77 | static struct omap_dss_board_info omap4_panda_dss_data = { | ||
78 | .num_devices = ARRAY_SIZE(omap4_panda_dss_devices), | ||
79 | .devices = omap4_panda_dss_devices, | ||
80 | .default_device = &omap4_panda_dvi_device, | ||
81 | }; | ||
82 | |||
83 | void __init omap4_panda_display_init(void) | ||
84 | { | ||
85 | omap_display_init(&omap4_panda_dss_data); | ||
86 | |||
87 | /* | ||
88 | * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and | ||
89 | * later have external pull up on the HDMI I2C lines | ||
90 | */ | ||
91 | if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2) | ||
92 | omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP); | ||
93 | else | ||
94 | omap_hdmi_init(0); | ||
95 | |||
96 | omap_mux_init_gpio(HDMI_GPIO_LS_OE, OMAP_PIN_OUTPUT); | ||
97 | omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD, OMAP_PIN_OUTPUT); | ||
98 | omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN); | ||
99 | } | ||
100 | |||
101 | void __init omap4_panda_display_init_of(void) | ||
102 | { | ||
103 | omap_display_init(&omap4_panda_dss_data); | ||
104 | } | ||
diff --git a/arch/arm/mach-omap2/dss-common.h b/arch/arm/mach-omap2/dss-common.h new file mode 100644 index 000000000000..6fac6a8315cb --- /dev/null +++ b/arch/arm/mach-omap2/dss-common.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #ifndef __OMAP_DSS_COMMON__ | ||
2 | #define __OMAP_DSS_COMMON__ | ||
3 | |||
4 | /* | ||
5 | * NOTE: this is a transitional file to help with DT adaptation. | ||
6 | * This file will be removed when DSS supports DT. | ||
7 | */ | ||
8 | |||
9 | void __init omap4_panda_display_init(void); | ||
10 | void __init omap4_panda_display_init_of(void); | ||
11 | |||
12 | #endif | ||