diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-4430sdp.c')
-rw-r--r-- | arch/arm/mach-omap2/board-4430sdp.c | 208 |
1 files changed, 180 insertions, 28 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index c7cef44c75d4..d3874a68b059 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -38,6 +38,8 @@ | |||
38 | #include <plat/mmc.h> | 38 | #include <plat/mmc.h> |
39 | #include <plat/omap4-keypad.h> | 39 | #include <plat/omap4-keypad.h> |
40 | #include <video/omapdss.h> | 40 | #include <video/omapdss.h> |
41 | #include <video/omap-panel-nokia-dsi.h> | ||
42 | #include <video/omap-panel-picodlp.h> | ||
41 | #include <linux/wl12xx.h> | 43 | #include <linux/wl12xx.h> |
42 | 44 | ||
43 | #include "mux.h" | 45 | #include "mux.h" |
@@ -52,6 +54,8 @@ | |||
52 | #define OMAP4_SFH7741_ENABLE_GPIO 188 | 54 | #define OMAP4_SFH7741_ENABLE_GPIO 188 |
53 | #define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */ | 55 | #define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */ |
54 | #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */ | 56 | #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */ |
57 | #define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */ | ||
58 | #define DLP_POWER_ON_GPIO 40 | ||
55 | 59 | ||
56 | #define GPIO_WIFI_PMENA 54 | 60 | #define GPIO_WIFI_PMENA 54 |
57 | #define GPIO_WIFI_IRQ 53 | 61 | #define GPIO_WIFI_IRQ 53 |
@@ -340,11 +344,6 @@ static int __init omap_ethernet_init(void) | |||
340 | return status; | 344 | return status; |
341 | } | 345 | } |
342 | 346 | ||
343 | static struct platform_device sdp4430_lcd_device = { | ||
344 | .name = "sdp4430_lcd", | ||
345 | .id = -1, | ||
346 | }; | ||
347 | |||
348 | static struct regulator_consumer_supply sdp4430_vbat_supply[] = { | 347 | static struct regulator_consumer_supply sdp4430_vbat_supply[] = { |
349 | REGULATOR_SUPPLY("vddvibl", "twl6040-vibra"), | 348 | REGULATOR_SUPPLY("vddvibl", "twl6040-vibra"), |
350 | REGULATOR_SUPPLY("vddvibr", "twl6040-vibra"), | 349 | REGULATOR_SUPPLY("vddvibr", "twl6040-vibra"), |
@@ -374,21 +373,12 @@ static struct platform_device sdp4430_vbat = { | |||
374 | }; | 373 | }; |
375 | 374 | ||
376 | static struct platform_device *sdp4430_devices[] __initdata = { | 375 | static struct platform_device *sdp4430_devices[] __initdata = { |
377 | &sdp4430_lcd_device, | ||
378 | &sdp4430_gpio_keys_device, | 376 | &sdp4430_gpio_keys_device, |
379 | &sdp4430_leds_gpio, | 377 | &sdp4430_leds_gpio, |
380 | &sdp4430_leds_pwm, | 378 | &sdp4430_leds_pwm, |
381 | &sdp4430_vbat, | 379 | &sdp4430_vbat, |
382 | }; | 380 | }; |
383 | 381 | ||
384 | static struct omap_lcd_config sdp4430_lcd_config __initdata = { | ||
385 | .ctrl_name = "internal", | ||
386 | }; | ||
387 | |||
388 | static struct omap_board_config_kernel sdp4430_config[] __initdata = { | ||
389 | { OMAP_TAG_LCD, &sdp4430_lcd_config }, | ||
390 | }; | ||
391 | |||
392 | static void __init omap_4430sdp_init_early(void) | 382 | static void __init omap_4430sdp_init_early(void) |
393 | { | 383 | { |
394 | omap2_init_common_infrastructure(); | 384 | omap2_init_common_infrastructure(); |
@@ -648,37 +638,202 @@ static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev) | |||
648 | gpio_free(HDMI_GPIO_HPD); | 638 | gpio_free(HDMI_GPIO_HPD); |
649 | } | 639 | } |
650 | 640 | ||
651 | static struct omap_dss_device sdp4430_hdmi_device = { | 641 | static struct nokia_dsi_panel_data dsi1_panel = { |
652 | .name = "hdmi", | 642 | .name = "taal", |
653 | .driver_name = "hdmi_panel", | 643 | .reset_gpio = 102, |
654 | .type = OMAP_DISPLAY_TYPE_HDMI, | 644 | .use_ext_te = false, |
655 | .clocks = { | 645 | .ext_te_gpio = 101, |
656 | .dispc = { | 646 | .esd_interval = 0, |
647 | }; | ||
648 | |||
649 | static struct omap_dss_device sdp4430_lcd_device = { | ||
650 | .name = "lcd", | ||
651 | .driver_name = "taal", | ||
652 | .type = OMAP_DISPLAY_TYPE_DSI, | ||
653 | .data = &dsi1_panel, | ||
654 | .phy.dsi = { | ||
655 | .clk_lane = 1, | ||
656 | .clk_pol = 0, | ||
657 | .data1_lane = 2, | ||
658 | .data1_pol = 0, | ||
659 | .data2_lane = 3, | ||
660 | .data2_pol = 0, | ||
661 | |||
662 | .module = 0, | ||
663 | }, | ||
664 | |||
665 | .clocks = { | ||
666 | .dispc = { | ||
667 | .channel = { | ||
668 | /* Logic Clock = 172.8 MHz */ | ||
669 | .lck_div = 1, | ||
670 | /* Pixel Clock = 34.56 MHz */ | ||
671 | .pck_div = 5, | ||
672 | .lcd_clk_src = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC, | ||
673 | }, | ||
657 | .dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK, | 674 | .dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK, |
658 | }, | 675 | }, |
659 | .hdmi = { | 676 | |
660 | .regn = 15, | 677 | .dsi = { |
661 | .regm2 = 1, | 678 | .regn = 16, /* Fint = 2.4 MHz */ |
679 | .regm = 180, /* DDR Clock = 216 MHz */ | ||
680 | .regm_dispc = 5, /* PLL1_CLK1 = 172.8 MHz */ | ||
681 | .regm_dsi = 5, /* PLL1_CLK2 = 172.8 MHz */ | ||
682 | |||
683 | .lp_clk_div = 10, /* LP Clock = 8.64 MHz */ | ||
684 | .dsi_fclk_src = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI, | ||
685 | }, | ||
686 | }, | ||
687 | .channel = OMAP_DSS_CHANNEL_LCD, | ||
688 | }; | ||
689 | |||
690 | static struct nokia_dsi_panel_data dsi2_panel = { | ||
691 | .name = "taal", | ||
692 | .reset_gpio = 104, | ||
693 | .use_ext_te = false, | ||
694 | .ext_te_gpio = 103, | ||
695 | .esd_interval = 0, | ||
696 | }; | ||
697 | |||
698 | static struct omap_dss_device sdp4430_lcd2_device = { | ||
699 | .name = "lcd2", | ||
700 | .driver_name = "taal", | ||
701 | .type = OMAP_DISPLAY_TYPE_DSI, | ||
702 | .data = &dsi2_panel, | ||
703 | .phy.dsi = { | ||
704 | .clk_lane = 1, | ||
705 | .clk_pol = 0, | ||
706 | .data1_lane = 2, | ||
707 | .data1_pol = 0, | ||
708 | .data2_lane = 3, | ||
709 | .data2_pol = 0, | ||
710 | |||
711 | .module = 1, | ||
712 | }, | ||
713 | |||
714 | .clocks = { | ||
715 | .dispc = { | ||
716 | .channel = { | ||
717 | /* Logic Clock = 172.8 MHz */ | ||
718 | .lck_div = 1, | ||
719 | /* Pixel Clock = 34.56 MHz */ | ||
720 | .pck_div = 5, | ||
721 | .lcd_clk_src = OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC, | ||
722 | }, | ||
723 | .dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK, | ||
724 | }, | ||
725 | |||
726 | .dsi = { | ||
727 | .regn = 16, /* Fint = 2.4 MHz */ | ||
728 | .regm = 180, /* DDR Clock = 216 MHz */ | ||
729 | .regm_dispc = 5, /* PLL1_CLK1 = 172.8 MHz */ | ||
730 | .regm_dsi = 5, /* PLL1_CLK2 = 172.8 MHz */ | ||
731 | |||
732 | .lp_clk_div = 10, /* LP Clock = 8.64 MHz */ | ||
733 | .dsi_fclk_src = OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI, | ||
662 | }, | 734 | }, |
663 | }, | 735 | }, |
736 | .channel = OMAP_DSS_CHANNEL_LCD2, | ||
737 | }; | ||
738 | |||
739 | static void sdp4430_lcd_init(void) | ||
740 | { | ||
741 | int r; | ||
742 | |||
743 | r = gpio_request_one(dsi1_panel.reset_gpio, GPIOF_DIR_OUT, | ||
744 | "lcd1_reset_gpio"); | ||
745 | if (r) | ||
746 | pr_err("%s: Could not get lcd1_reset_gpio\n", __func__); | ||
747 | |||
748 | r = gpio_request_one(dsi2_panel.reset_gpio, GPIOF_DIR_OUT, | ||
749 | "lcd2_reset_gpio"); | ||
750 | if (r) | ||
751 | pr_err("%s: Could not get lcd2_reset_gpio\n", __func__); | ||
752 | } | ||
753 | |||
754 | static struct omap_dss_device sdp4430_hdmi_device = { | ||
755 | .name = "hdmi", | ||
756 | .driver_name = "hdmi_panel", | ||
757 | .type = OMAP_DISPLAY_TYPE_HDMI, | ||
664 | .platform_enable = sdp4430_panel_enable_hdmi, | 758 | .platform_enable = sdp4430_panel_enable_hdmi, |
665 | .platform_disable = sdp4430_panel_disable_hdmi, | 759 | .platform_disable = sdp4430_panel_disable_hdmi, |
666 | .channel = OMAP_DSS_CHANNEL_DIGIT, | 760 | .channel = OMAP_DSS_CHANNEL_DIGIT, |
667 | }; | 761 | }; |
668 | 762 | ||
763 | static struct picodlp_panel_data sdp4430_picodlp_pdata = { | ||
764 | .picodlp_adapter_id = 2, | ||
765 | .emu_done_gpio = 44, | ||
766 | .pwrgood_gpio = 45, | ||
767 | }; | ||
768 | |||
769 | static void sdp4430_picodlp_init(void) | ||
770 | { | ||
771 | int r; | ||
772 | const struct gpio picodlp_gpios[] = { | ||
773 | {DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW, | ||
774 | "DLP POWER ON"}, | ||
775 | {sdp4430_picodlp_pdata.emu_done_gpio, GPIOF_IN, | ||
776 | "DLP EMU DONE"}, | ||
777 | {sdp4430_picodlp_pdata.pwrgood_gpio, GPIOF_OUT_INIT_LOW, | ||
778 | "DLP PWRGOOD"}, | ||
779 | }; | ||
780 | |||
781 | r = gpio_request_array(picodlp_gpios, ARRAY_SIZE(picodlp_gpios)); | ||
782 | if (r) | ||
783 | pr_err("Cannot request PicoDLP GPIOs, error %d\n", r); | ||
784 | } | ||
785 | |||
786 | static int sdp4430_panel_enable_picodlp(struct omap_dss_device *dssdev) | ||
787 | { | ||
788 | gpio_set_value(DISPLAY_SEL_GPIO, 0); | ||
789 | gpio_set_value(DLP_POWER_ON_GPIO, 1); | ||
790 | |||
791 | return 0; | ||
792 | } | ||
793 | |||
794 | static void sdp4430_panel_disable_picodlp(struct omap_dss_device *dssdev) | ||
795 | { | ||
796 | gpio_set_value(DLP_POWER_ON_GPIO, 0); | ||
797 | gpio_set_value(DISPLAY_SEL_GPIO, 1); | ||
798 | } | ||
799 | |||
800 | static struct omap_dss_device sdp4430_picodlp_device = { | ||
801 | .name = "picodlp", | ||
802 | .driver_name = "picodlp_panel", | ||
803 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
804 | .phy.dpi.data_lines = 24, | ||
805 | .channel = OMAP_DSS_CHANNEL_LCD2, | ||
806 | .platform_enable = sdp4430_panel_enable_picodlp, | ||
807 | .platform_disable = sdp4430_panel_disable_picodlp, | ||
808 | .data = &sdp4430_picodlp_pdata, | ||
809 | }; | ||
810 | |||
669 | static struct omap_dss_device *sdp4430_dss_devices[] = { | 811 | static struct omap_dss_device *sdp4430_dss_devices[] = { |
812 | &sdp4430_lcd_device, | ||
813 | &sdp4430_lcd2_device, | ||
670 | &sdp4430_hdmi_device, | 814 | &sdp4430_hdmi_device, |
815 | &sdp4430_picodlp_device, | ||
671 | }; | 816 | }; |
672 | 817 | ||
673 | static struct omap_dss_board_info sdp4430_dss_data = { | 818 | static struct omap_dss_board_info sdp4430_dss_data = { |
674 | .num_devices = ARRAY_SIZE(sdp4430_dss_devices), | 819 | .num_devices = ARRAY_SIZE(sdp4430_dss_devices), |
675 | .devices = sdp4430_dss_devices, | 820 | .devices = sdp4430_dss_devices, |
676 | .default_device = &sdp4430_hdmi_device, | 821 | .default_device = &sdp4430_lcd_device, |
677 | }; | 822 | }; |
678 | 823 | ||
679 | void omap_4430sdp_display_init(void) | 824 | static void omap_4430sdp_display_init(void) |
680 | { | 825 | { |
826 | int r; | ||
827 | |||
828 | /* Enable LCD2 by default (instead of Pico DLP) */ | ||
829 | r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH, | ||
830 | "display_sel"); | ||
831 | if (r) | ||
832 | pr_err("%s: Could not get display_sel GPIO\n", __func__); | ||
833 | |||
834 | sdp4430_lcd_init(); | ||
681 | sdp4430_hdmi_mux_init(); | 835 | sdp4430_hdmi_mux_init(); |
836 | sdp4430_picodlp_init(); | ||
682 | omap_display_init(&sdp4430_dss_data); | 837 | omap_display_init(&sdp4430_dss_data); |
683 | } | 838 | } |
684 | 839 | ||
@@ -802,9 +957,6 @@ static void __init omap_4430sdp_init(void) | |||
802 | package = OMAP_PACKAGE_CBL; | 957 | package = OMAP_PACKAGE_CBL; |
803 | omap4_mux_init(board_mux, NULL, package); | 958 | omap4_mux_init(board_mux, NULL, package); |
804 | 959 | ||
805 | omap_board_config = sdp4430_config; | ||
806 | omap_board_config_size = ARRAY_SIZE(sdp4430_config); | ||
807 | |||
808 | omap4_i2c_init(); | 960 | omap4_i2c_init(); |
809 | omap_sfh7741prox_init(); | 961 | omap_sfh7741prox_init(); |
810 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); | 962 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); |