aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-4430sdp.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-11-05 08:14:18 -0500
committerTony Lindgren <tony@atomide.com>2012-11-07 16:26:51 -0500
commit86cf29dc5a595957ab02068fcd39c57009763a8b (patch)
treef7e1e76176a08c4516cfdfbe57c55ad48a431c19 /arch/arm/mach-omap2/board-4430sdp.c
parent0191bf368fd95ecd4f83e62b0ad6de12048b14bf (diff)
OMAP: omap4sdp: 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-4430sdp.c to dss-common.c. dss-common.c will be called by the board-4430sdp.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>
Diffstat (limited to 'arch/arm/mach-omap2/board-4430sdp.c')
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c157
1 files changed, 1 insertions, 156 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 3669c120c7e8..8ce98ae765ab 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -37,9 +37,6 @@
37#include <plat/usb.h> 37#include <plat/usb.h>
38#include <plat/mmc.h> 38#include <plat/mmc.h>
39#include "omap4-keypad.h" 39#include "omap4-keypad.h"
40#include <video/omapdss.h>
41#include <video/omap-panel-nokia-dsi.h>
42#include <video/omap-panel-picodlp.h>
43#include <linux/wl12xx.h> 40#include <linux/wl12xx.h>
44#include <linux/platform_data/omap-abe-twl6040.h> 41#include <linux/platform_data/omap-abe-twl6040.h>
45 42
@@ -48,17 +45,13 @@
48#include "hsmmc.h" 45#include "hsmmc.h"
49#include "control.h" 46#include "control.h"
50#include "common-board-devices.h" 47#include "common-board-devices.h"
48#include "dss-common.h"
51 49
52#define ETH_KS8851_IRQ 34 50#define ETH_KS8851_IRQ 34
53#define ETH_KS8851_POWER_ON 48 51#define ETH_KS8851_POWER_ON 48
54#define ETH_KS8851_QUART 138 52#define ETH_KS8851_QUART 138
55#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184 53#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184
56#define OMAP4_SFH7741_ENABLE_GPIO 188 54#define OMAP4_SFH7741_ENABLE_GPIO 188
57#define HDMI_GPIO_CT_CP_HPD 60 /* HPD mode enable/disable */
58#define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
59#define HDMI_GPIO_HPD 63 /* Hotplug detect */
60#define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */
61#define DLP_POWER_ON_GPIO 40
62 55
63#define GPIO_WIFI_PMENA 54 56#define GPIO_WIFI_PMENA 54
64#define GPIO_WIFI_IRQ 53 57#define GPIO_WIFI_IRQ 53
@@ -607,154 +600,6 @@ static void __init omap_sfh7741prox_init(void)
607 __func__, OMAP4_SFH7741_ENABLE_GPIO, error); 600 __func__, OMAP4_SFH7741_ENABLE_GPIO, error);
608} 601}
609 602
610static struct nokia_dsi_panel_data dsi1_panel = {
611 .name = "taal",
612 .reset_gpio = 102,
613 .use_ext_te = false,
614 .ext_te_gpio = 101,
615 .esd_interval = 0,
616 .pin_config = {
617 .num_pins = 6,
618 .pins = { 0, 1, 2, 3, 4, 5 },
619 },
620};
621
622static struct omap_dss_device sdp4430_lcd_device = {
623 .name = "lcd",
624 .driver_name = "taal",
625 .type = OMAP_DISPLAY_TYPE_DSI,
626 .data = &dsi1_panel,
627 .phy.dsi = {
628 .module = 0,
629 },
630 .channel = OMAP_DSS_CHANNEL_LCD,
631};
632
633static struct nokia_dsi_panel_data dsi2_panel = {
634 .name = "taal",
635 .reset_gpio = 104,
636 .use_ext_te = false,
637 .ext_te_gpio = 103,
638 .esd_interval = 0,
639 .pin_config = {
640 .num_pins = 6,
641 .pins = { 0, 1, 2, 3, 4, 5 },
642 },
643};
644
645static struct omap_dss_device sdp4430_lcd2_device = {
646 .name = "lcd2",
647 .driver_name = "taal",
648 .type = OMAP_DISPLAY_TYPE_DSI,
649 .data = &dsi2_panel,
650 .phy.dsi = {
651
652 .module = 1,
653 },
654 .channel = OMAP_DSS_CHANNEL_LCD2,
655};
656
657static struct omap_dss_hdmi_data sdp4430_hdmi_data = {
658 .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
659 .ls_oe_gpio = HDMI_GPIO_LS_OE,
660 .hpd_gpio = HDMI_GPIO_HPD,
661};
662
663static struct omap_dss_device sdp4430_hdmi_device = {
664 .name = "hdmi",
665 .driver_name = "hdmi_panel",
666 .type = OMAP_DISPLAY_TYPE_HDMI,
667 .channel = OMAP_DSS_CHANNEL_DIGIT,
668 .data = &sdp4430_hdmi_data,
669};
670
671static struct picodlp_panel_data sdp4430_picodlp_pdata = {
672 .picodlp_adapter_id = 2,
673 .emu_done_gpio = 44,
674 .pwrgood_gpio = 45,
675};
676
677static void sdp4430_picodlp_init(void)
678{
679 int r;
680 const struct gpio picodlp_gpios[] = {
681 {DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
682 "DLP POWER ON"},
683 {sdp4430_picodlp_pdata.emu_done_gpio, GPIOF_IN,
684 "DLP EMU DONE"},
685 {sdp4430_picodlp_pdata.pwrgood_gpio, GPIOF_OUT_INIT_LOW,
686 "DLP PWRGOOD"},
687 };
688
689 r = gpio_request_array(picodlp_gpios, ARRAY_SIZE(picodlp_gpios));
690 if (r)
691 pr_err("Cannot request PicoDLP GPIOs, error %d\n", r);
692}
693
694static int sdp4430_panel_enable_picodlp(struct omap_dss_device *dssdev)
695{
696 gpio_set_value(DISPLAY_SEL_GPIO, 0);
697 gpio_set_value(DLP_POWER_ON_GPIO, 1);
698
699 return 0;
700}
701
702static void sdp4430_panel_disable_picodlp(struct omap_dss_device *dssdev)
703{
704 gpio_set_value(DLP_POWER_ON_GPIO, 0);
705 gpio_set_value(DISPLAY_SEL_GPIO, 1);
706}
707
708static struct omap_dss_device sdp4430_picodlp_device = {
709 .name = "picodlp",
710 .driver_name = "picodlp_panel",
711 .type = OMAP_DISPLAY_TYPE_DPI,
712 .phy.dpi.data_lines = 24,
713 .channel = OMAP_DSS_CHANNEL_LCD2,
714 .platform_enable = sdp4430_panel_enable_picodlp,
715 .platform_disable = sdp4430_panel_disable_picodlp,
716 .data = &sdp4430_picodlp_pdata,
717};
718
719static struct omap_dss_device *sdp4430_dss_devices[] = {
720 &sdp4430_lcd_device,
721 &sdp4430_lcd2_device,
722 &sdp4430_hdmi_device,
723 &sdp4430_picodlp_device,
724};
725
726static struct omap_dss_board_info sdp4430_dss_data = {
727 .num_devices = ARRAY_SIZE(sdp4430_dss_devices),
728 .devices = sdp4430_dss_devices,
729 .default_device = &sdp4430_lcd_device,
730};
731
732static void __init omap_4430sdp_display_init(void)
733{
734 int r;
735
736 /* Enable LCD2 by default (instead of Pico DLP) */
737 r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH,
738 "display_sel");
739 if (r)
740 pr_err("%s: Could not get display_sel GPIO\n", __func__);
741
742 sdp4430_picodlp_init();
743 omap_display_init(&sdp4430_dss_data);
744 /*
745 * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and
746 * later have external pull up on the HDMI I2C lines
747 */
748 if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2)
749 omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP);
750 else
751 omap_hdmi_init(0);
752
753 omap_mux_init_gpio(HDMI_GPIO_LS_OE, OMAP_PIN_OUTPUT);
754 omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD, OMAP_PIN_OUTPUT);
755 omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN);
756}
757
758#ifdef CONFIG_OMAP_MUX 603#ifdef CONFIG_OMAP_MUX
759static struct omap_board_mux board_mux[] __initdata = { 604static struct omap_board_mux board_mux[] __initdata = {
760 OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), 605 OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),