aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-4430sdp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/board-4430sdp.c')
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c87
1 files changed, 68 insertions, 19 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 39fba9df17fb..37dcb1bc025e 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -25,6 +25,7 @@
25#include <linux/regulator/fixed.h> 25#include <linux/regulator/fixed.h>
26#include <linux/leds.h> 26#include <linux/leds.h>
27#include <linux/leds_pwm.h> 27#include <linux/leds_pwm.h>
28#include <linux/platform_data/omap4-keypad.h>
28 29
29#include <mach/hardware.h> 30#include <mach/hardware.h>
30#include <asm/hardware/gic.h> 31#include <asm/hardware/gic.h>
@@ -41,6 +42,7 @@
41#include <video/omap-panel-nokia-dsi.h> 42#include <video/omap-panel-nokia-dsi.h>
42#include <video/omap-panel-picodlp.h> 43#include <video/omap-panel-picodlp.h>
43#include <linux/wl12xx.h> 44#include <linux/wl12xx.h>
45#include <linux/platform_data/omap-abe-twl6040.h>
44 46
45#include "mux.h" 47#include "mux.h"
46#include "hsmmc.h" 48#include "hsmmc.h"
@@ -52,8 +54,9 @@
52#define ETH_KS8851_QUART 138 54#define ETH_KS8851_QUART 138
53#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184 55#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184
54#define OMAP4_SFH7741_ENABLE_GPIO 188 56#define OMAP4_SFH7741_ENABLE_GPIO 188
55#define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */ 57#define HDMI_GPIO_CT_CP_HPD 60 /* HPD mode enable/disable */
56#define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */ 58#define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
59#define HDMI_GPIO_HPD 63 /* Hotplug detect */
57#define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */ 60#define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */
58#define DLP_POWER_ON_GPIO 40 61#define DLP_POWER_ON_GPIO 40
59 62
@@ -321,7 +324,10 @@ static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
321 .bus_num = 1, 324 .bus_num = 1,
322 .chip_select = 0, 325 .chip_select = 0,
323 .max_speed_hz = 24000000, 326 .max_speed_hz = 24000000,
324 .irq = ETH_KS8851_IRQ, 327 /*
328 * .irq is set to gpio_to_irq(ETH_KS8851_IRQ)
329 * in omap_4430sdp_init
330 */
325 }, 331 },
326}; 332};
327 333
@@ -377,12 +383,40 @@ static struct platform_device sdp4430_dmic_codec = {
377 .id = -1, 383 .id = -1,
378}; 384};
379 385
386static struct omap_abe_twl6040_data sdp4430_abe_audio_data = {
387 .card_name = "SDP4430",
388 .has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
389 .has_hf = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
390 .has_ep = 1,
391 .has_aux = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
392 .has_vibra = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
393
394 .has_dmic = 1,
395 .has_hsmic = 1,
396 .has_mainmic = 1,
397 .has_submic = 1,
398 .has_afm = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
399
400 .jack_detection = 1,
401 /* MCLK input is 38.4MHz */
402 .mclk_freq = 38400000,
403};
404
405static struct platform_device sdp4430_abe_audio = {
406 .name = "omap-abe-twl6040",
407 .id = -1,
408 .dev = {
409 .platform_data = &sdp4430_abe_audio_data,
410 },
411};
412
380static struct platform_device *sdp4430_devices[] __initdata = { 413static struct platform_device *sdp4430_devices[] __initdata = {
381 &sdp4430_gpio_keys_device, 414 &sdp4430_gpio_keys_device,
382 &sdp4430_leds_gpio, 415 &sdp4430_leds_gpio,
383 &sdp4430_leds_pwm, 416 &sdp4430_leds_pwm,
384 &sdp4430_vbat, 417 &sdp4430_vbat,
385 &sdp4430_dmic_codec, 418 &sdp4430_dmic_codec,
419 &sdp4430_abe_audio,
386}; 420};
387 421
388static struct omap_musb_board_data musb_board_data = { 422static struct omap_musb_board_data musb_board_data = {
@@ -456,21 +490,22 @@ static struct platform_device omap_vwlan_device = {
456 490
457static int omap4_twl6030_hsmmc_late_init(struct device *dev) 491static int omap4_twl6030_hsmmc_late_init(struct device *dev)
458{ 492{
459 int ret = 0; 493 int irq = 0;
460 struct platform_device *pdev = container_of(dev, 494 struct platform_device *pdev = container_of(dev,
461 struct platform_device, dev); 495 struct platform_device, dev);
462 struct omap_mmc_platform_data *pdata = dev->platform_data; 496 struct omap_mmc_platform_data *pdata = dev->platform_data;
463 497
464 /* Setting MMC1 Card detect Irq */ 498 /* Setting MMC1 Card detect Irq */
465 if (pdev->id == 0) { 499 if (pdev->id == 0) {
466 ret = twl6030_mmc_card_detect_config(); 500 irq = twl6030_mmc_card_detect_config();
467 if (ret) 501 if (irq < 0) {
468 pr_err("Failed configuring MMC1 card detect\n"); 502 pr_err("Failed configuring MMC1 card detect\n");
469 pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE + 503 return irq;
470 MMCDETECT_INTR_OFFSET; 504 }
505 pdata->slots[0].card_detect_irq = irq;
471 pdata->slots[0].card_detect = twl6030_mmc_card_detect; 506 pdata->slots[0].card_detect = twl6030_mmc_card_detect;
472 } 507 }
473 return ret; 508 return 0;
474} 509}
475 510
476static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev) 511static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
@@ -490,9 +525,9 @@ static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
490{ 525{
491 struct omap2_hsmmc_info *c; 526 struct omap2_hsmmc_info *c;
492 527
493 omap2_hsmmc_init(controllers); 528 omap_hsmmc_init(controllers);
494 for (c = controllers; c->mmc; c++) 529 for (c = controllers; c->mmc; c++)
495 omap4_twl6030_hsmmc_set_late_init(c->dev); 530 omap4_twl6030_hsmmc_set_late_init(&c->pdev->dev);
496 531
497 return 0; 532 return 0;
498} 533}
@@ -603,8 +638,9 @@ static void __init omap_sfh7741prox_init(void)
603} 638}
604 639
605static struct gpio sdp4430_hdmi_gpios[] = { 640static struct gpio sdp4430_hdmi_gpios[] = {
606 { HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_hpd" }, 641 { HDMI_GPIO_CT_CP_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ct_cp_hpd" },
607 { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" }, 642 { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" },
643 { HDMI_GPIO_HPD, GPIOF_DIR_IN, "hdmi_gpio_hpd" },
608}; 644};
609 645
610static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev) 646static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev)
@@ -621,8 +657,7 @@ static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev)
621 657
622static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev) 658static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev)
623{ 659{
624 gpio_free(HDMI_GPIO_LS_OE); 660 gpio_free_array(sdp4430_hdmi_gpios, ARRAY_SIZE(sdp4430_hdmi_gpios));
625 gpio_free(HDMI_GPIO_HPD);
626} 661}
627 662
628static struct nokia_dsi_panel_data dsi1_panel = { 663static struct nokia_dsi_panel_data dsi1_panel = {
@@ -738,6 +773,10 @@ static void sdp4430_lcd_init(void)
738 pr_err("%s: Could not get lcd2_reset_gpio\n", __func__); 773 pr_err("%s: Could not get lcd2_reset_gpio\n", __func__);
739} 774}
740 775
776static struct omap_dss_hdmi_data sdp4430_hdmi_data = {
777 .hpd_gpio = HDMI_GPIO_HPD,
778};
779
741static struct omap_dss_device sdp4430_hdmi_device = { 780static struct omap_dss_device sdp4430_hdmi_device = {
742 .name = "hdmi", 781 .name = "hdmi",
743 .driver_name = "hdmi_panel", 782 .driver_name = "hdmi_panel",
@@ -745,6 +784,7 @@ static struct omap_dss_device sdp4430_hdmi_device = {
745 .platform_enable = sdp4430_panel_enable_hdmi, 784 .platform_enable = sdp4430_panel_enable_hdmi,
746 .platform_disable = sdp4430_panel_disable_hdmi, 785 .platform_disable = sdp4430_panel_disable_hdmi,
747 .channel = OMAP_DSS_CHANNEL_DIGIT, 786 .channel = OMAP_DSS_CHANNEL_DIGIT,
787 .data = &sdp4430_hdmi_data,
748}; 788};
749 789
750static struct picodlp_panel_data sdp4430_picodlp_pdata = { 790static struct picodlp_panel_data sdp4430_picodlp_pdata = {
@@ -808,7 +848,7 @@ static struct omap_dss_board_info sdp4430_dss_data = {
808 .default_device = &sdp4430_lcd_device, 848 .default_device = &sdp4430_lcd_device,
809}; 849};
810 850
811static void omap_4430sdp_display_init(void) 851static void __init omap_4430sdp_display_init(void)
812{ 852{
813 int r; 853 int r;
814 854
@@ -829,6 +869,10 @@ static void omap_4430sdp_display_init(void)
829 omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP); 869 omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP);
830 else 870 else
831 omap_hdmi_init(0); 871 omap_hdmi_init(0);
872
873 omap_mux_init_gpio(HDMI_GPIO_LS_OE, OMAP_PIN_OUTPUT);
874 omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD, OMAP_PIN_OUTPUT);
875 omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN);
832} 876}
833 877
834#ifdef CONFIG_OMAP_MUX 878#ifdef CONFIG_OMAP_MUX
@@ -841,7 +885,7 @@ static struct omap_board_mux board_mux[] __initdata = {
841#define board_mux NULL 885#define board_mux NULL
842 #endif 886 #endif
843 887
844static void omap4_sdp4430_wifi_mux_init(void) 888static void __init omap4_sdp4430_wifi_mux_init(void)
845{ 889{
846 omap_mux_init_gpio(GPIO_WIFI_IRQ, OMAP_PIN_INPUT | 890 omap_mux_init_gpio(GPIO_WIFI_IRQ, OMAP_PIN_INPUT |
847 OMAP_PIN_OFF_WAKEUPENABLE); 891 OMAP_PIN_OFF_WAKEUPENABLE);
@@ -868,12 +912,17 @@ static struct wl12xx_platform_data omap4_sdp4430_wlan_data __initdata = {
868 .board_tcxo_clock = WL12XX_TCXOCLOCK_26, 912 .board_tcxo_clock = WL12XX_TCXOCLOCK_26,
869}; 913};
870 914
871static void omap4_sdp4430_wifi_init(void) 915static void __init omap4_sdp4430_wifi_init(void)
872{ 916{
917 int ret;
918
873 omap4_sdp4430_wifi_mux_init(); 919 omap4_sdp4430_wifi_mux_init();
874 if (wl12xx_set_platform_data(&omap4_sdp4430_wlan_data)) 920 ret = wl12xx_set_platform_data(&omap4_sdp4430_wlan_data);
875 pr_err("Error setting wl12xx data\n"); 921 if (ret)
876 platform_device_register(&omap_vwlan_device); 922 pr_err("Error setting wl12xx data: %d\n", ret);
923 ret = platform_device_register(&omap_vwlan_device);
924 if (ret)
925 pr_err("Error registering wl12xx device: %d\n", ret);
877} 926}
878 927
879static void __init omap_4430sdp_init(void) 928static void __init omap_4430sdp_init(void)