diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c index 6798b848831525..9fee3e1826a573 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include #include #include @@ -82,6 +84,109 @@ static struct platform_device nokia770_kp_device = { .resource = nokia770_kp_resources, }; +#if defined(CONFIG_CBUS) || defined(CONFIG_CBUS_MODULE) + +static struct cbus_host_platform_data nokia770_cbus_data = { + .clk_gpio = OMAP_MPUIO(11), + .dat_gpio = OMAP_MPUIO(10), + .sel_gpio = OMAP_MPUIO(9), +}; + +static struct platform_device nokia770_cbus_device = { + .name = "cbus", + .id = -1, + .dev = { + .platform_data = &nokia770_cbus_data, + }, +}; + +static struct resource retu_resource[] = { + { + .start = -EINVAL, /* set later */ + .flags = IORESOURCE_IRQ, + }, +}; + +static struct cbus_retu_platform_data nokia770_retu_data = { + .devid = CBUS_RETU_DEVICE_ID, +}; + +static struct platform_device retu_device = { + .name = "retu", + .id = -1, + .resource = retu_resource, + .num_resources = ARRAY_SIZE(retu_resource), + .dev = { + .platform_data = &nokia770_retu_data, + .parent = &nokia770_cbus_device.dev, + }, +}; + +static struct resource tahvo_resource[] = { + { + .start = -EINVAL, /* set later */ + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device tahvo_device = { + .name = "tahvo", + .id = -1, + .resource = tahvo_resource, + .num_resources = ARRAY_SIZE(tahvo_resource), + .dev = { + .parent = &nokia770_cbus_device.dev, + }, +}; + +static void __init nokia770_cbus_init(void) +{ + int ret; + + platform_device_register(&nokia770_cbus_device); + + ret = gpio_request(62, "RETU irq"); + if (ret < 0) { + pr_err("retu: Unable to reserve IRQ GPIO\n"); + return; + } + + ret = gpio_direction_input(62); + if (ret < 0) { + pr_err("retu: Unable to change gpio direction\n"); + gpio_free(62); + return; + } + + irq_set_irq_type(gpio_to_irq(62), IRQ_TYPE_EDGE_RISING); + retu_resource[0].start = gpio_to_irq(62); + platform_device_register(&retu_device); + + ret = gpio_request(40, "TAHVO irq"); + if (ret) { + pr_err("tahvo: Unable to reserve IRQ GPIO\n"); + gpio_free(62); + return; + } + + ret = gpio_direction_input(40); + if (ret) { + pr_err("tahvo: Unable to change direction\n"); + gpio_free(62); + gpio_free(40); + return; + } + + tahvo_resource[0].start = gpio_to_irq(40); + platform_device_register(&tahvo_device); +} + +#else +static inline void __init nokia770_cbus_init(void) +{ +} +#endif + static struct platform_device *nokia770_devices[] __initdata = { &nokia770_kp_device, }; @@ -239,6 +344,7 @@ static void __init omap_nokia770_init(void) /* Unmask SleepX signal */ omap_writew((omap_readw(0xfffb5004) & ~2), 0xfffb5004); + nokia770_cbus_init(); platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices)); spi_register_board_info(nokia770_spi_board_info, ARRAY_SIZE(nokia770_spi_board_info)); diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index 495b3987d461f8..89ea20ca0cccbc 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c @@ -116,7 +116,7 @@ void omap1_pm_idle(void) return; } -#ifdef CONFIG_OMAP_MPU_TIMER +#if defined(CONFIG_OMAP_MPU_TIMER) && !defined(CONFIG_OMAP_DM_TIMER) #warning Enable 32kHz OS timer in order to allow sleep states in idle use_idlect1 = use_idlect1 & ~(1 << 9); #else diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 497e9dc2795890..5128297751808d 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -80,6 +80,11 @@ config SOC_OMAPTI816X depends on ARCH_OMAP3 default y +config SOC_OMAPAM33XX + bool "AM33XX support" + depends on ARCH_OMAP3 + default y + config OMAP_PACKAGE_ZAF bool @@ -178,6 +183,12 @@ config MACH_OMAP3_TORPEDO for full description please see the products webpage at http://www.logicpd.com/products/development-kits/zoom-omap35x-torpedo-development-kit +config MACH_ENCORE + bool "Barnes & Noble Encore (Nook Color)" + depends on ARCH_OMAP3 + default y + select OMAP_PACKAGE_CBP + config MACH_OVERO bool "Gumstix Overo board" depends on ARCH_OMAP3 @@ -332,6 +343,12 @@ config MACH_OMAP4_PANDA select OMAP_PACKAGE_CBS select REGULATOR_FIXED_VOLTAGE +config MACH_PCM049 + bool "OMAP4 based phyCORE OMAP4" + depends on ARCH_OMAP4 + default y + select OMAP_PACKAGE_CBS + config OMAP3_EMU bool "OMAP3 debugging peripherals" depends on ARCH_OMAP3 diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index d314f033c9dfd7..f7df8d35ee90c7 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -40,6 +41,7 @@ #include "mux.h" #include "control.h" +#include "hsmmc.h" #define AM35XX_EVM_MDIO_FREQUENCY (1000000) @@ -455,6 +457,23 @@ static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata) static struct omap_board_config_kernel am3517_evm_config[] __initdata = { }; +static struct omap2_hsmmc_info mmc[] = { + { + .mmc = 1, + .caps = MMC_CAP_4_BIT_DATA, + .gpio_cd = 127, + .gpio_wp = 126, + }, + { + .mmc = 2, + .caps = MMC_CAP_4_BIT_DATA, + .gpio_cd = 128, + .gpio_wp = 129, + }, + {} /* Terminator */ +}; + + static void __init am3517_evm_init(void) { omap_board_config = am3517_evm_config; @@ -483,6 +502,9 @@ static void __init am3517_evm_init(void) /* MUSB */ am3517_evm_musb_init(); + + /* MMC init function */ + omap2_hsmmc_init(mmc); } MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM") diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index 42918940c530ac..90154e411da0f2 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c @@ -226,7 +226,6 @@ static int devkit8000_twl_gpio_setup(struct device *dev, { int ret; - omap_mux_init_gpio(29, OMAP_PIN_INPUT); /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap2_hsmmc_init(mmc); diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index c12666ee7017a8..8b351d92a1cce2 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -34,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -50,10 +50,8 @@ #define H4_ETHR_GPIO_IRQ 92 -static unsigned int row_gpios[6] = { 88, 89, 124, 11, 6, 96 }; -static unsigned int col_gpios[7] = { 90, 91, 100, 36, 12, 97, 98 }; - -static const unsigned int h4_keymap[] = { +#if defined(CONFIG_KEYBOARD_MATRIX) || defined(CONFIG_KEYBOARD_MATRIX_MODULE) +static const uint32_t board_matrix_keys[] = { KEY(0, 0, KEY_LEFT), KEY(1, 0, KEY_RIGHT), KEY(2, 0, KEY_A), @@ -86,6 +84,71 @@ static const unsigned int h4_keymap[] = { KEY(4, 5, KEY_ENTER), }; +static const struct matrix_keymap_data board_keymap_data = { + .keymap = board_matrix_keys, + .keymap_size = ARRAY_SIZE(board_matrix_keys), +}; + +static unsigned int board_keypad_row_gpios[] = { + 88, 89, 124, 11, 6, 96 +}; + +static unsigned int board_keypad_col_gpios[] = { + 90, 91, 100, 36, 12, 97, 98 +}; + +static struct matrix_keypad_platform_data board_keypad_platform_data = { + .keymap_data = &board_keymap_data, + .row_gpios = board_keypad_row_gpios, + .num_row_gpios = ARRAY_SIZE(board_keypad_row_gpios), + .col_gpios = board_keypad_col_gpios, + .num_col_gpios = ARRAY_SIZE(board_keypad_col_gpios), + .active_low = 1, + + .debounce_ms = 20, + .col_scan_delay_us = 5, +}; + +static struct platform_device board_keyboard = { + .name = "matrix-keypad", + .id = -1, + .dev = { + .platform_data = &board_keypad_platform_data, + }, +}; +static void __init board_mkp_init(void) +{ + omap_mux_init_gpio(88, OMAP_PULL_ENA | OMAP_PULL_UP); + omap_mux_init_gpio(89, OMAP_PULL_ENA | OMAP_PULL_UP); + omap_mux_init_gpio(124, OMAP_PULL_ENA | OMAP_PULL_UP); + omap_mux_init_signal("mcbsp2_dr.gpio_11", OMAP_PULL_ENA | OMAP_PULL_UP); + if (omap_has_menelaus()) { + omap_mux_init_signal("sdrc_a14.gpio0", + OMAP_PULL_ENA | OMAP_PULL_UP); + omap_mux_init_signal("vlynq_rx0.gpio_15", 0); + omap_mux_init_signal("gpio_98", 0); + board_keypad_row_gpios[5] = 0; + board_keypad_col_gpios[2] = 15; + board_keypad_col_gpios[6] = 18; + } else { + omap_mux_init_signal("gpio_96", OMAP_PULL_ENA | OMAP_PULL_UP); + omap_mux_init_signal("gpio_100", 0); + omap_mux_init_signal("gpio_98", 0); + } + omap_mux_init_signal("gpio_90", 0); + omap_mux_init_signal("gpio_91", 0); + omap_mux_init_signal("gpio_36", 0); + omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0); + omap_mux_init_signal("gpio_97", 0); + + platform_device_register(&board_keyboard); +} +#else +static inline void board_mkp_init(void) +{ +} +#endif + static struct mtd_partition h4_partitions[] = { /* bootloader (U-Boot, etc) in first sector */ { @@ -137,31 +200,8 @@ static struct platform_device h4_flash_device = { .resource = &h4_flash_resource, }; -static const struct matrix_keymap_data h4_keymap_data = { - .keymap = h4_keymap, - .keymap_size = ARRAY_SIZE(h4_keymap), -}; - -static struct omap_kp_platform_data h4_kp_data = { - .rows = 6, - .cols = 7, - .keymap_data = &h4_keymap_data, - .rep = true, - .row_gpios = row_gpios, - .col_gpios = col_gpios, -}; - -static struct platform_device h4_kp_device = { - .name = "omap-keypad", - .id = -1, - .dev = { - .platform_data = &h4_kp_data, - }, -}; - static struct platform_device *h4_devices[] __initdata = { &h4_flash_device, - &h4_kp_device, }; static struct panel_generic_dpi_data h4_panel_data = { @@ -336,31 +376,7 @@ static void __init omap_h4_init(void) * if not needed. */ -#if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE) - omap_mux_init_gpio(88, OMAP_PULL_ENA | OMAP_PULL_UP); - omap_mux_init_gpio(89, OMAP_PULL_ENA | OMAP_PULL_UP); - omap_mux_init_gpio(124, OMAP_PULL_ENA | OMAP_PULL_UP); - omap_mux_init_signal("mcbsp2_dr.gpio_11", OMAP_PULL_ENA | OMAP_PULL_UP); - if (omap_has_menelaus()) { - omap_mux_init_signal("sdrc_a14.gpio0", - OMAP_PULL_ENA | OMAP_PULL_UP); - omap_mux_init_signal("vlynq_rx0.gpio_15", 0); - omap_mux_init_signal("gpio_98", 0); - row_gpios[5] = 0; - col_gpios[2] = 15; - col_gpios[6] = 18; - } else { - omap_mux_init_signal("gpio_96", OMAP_PULL_ENA | OMAP_PULL_UP); - omap_mux_init_signal("gpio_100", 0); - omap_mux_init_signal("gpio_98", 0); - } - omap_mux_init_signal("gpio_90", 0); - omap_mux_init_signal("gpio_91", 0); - omap_mux_init_signal("gpio_36", 0); - omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0); - omap_mux_init_signal("gpio_97", 0); -#endif - + board_mkp_init(); i2c_register_board_info(1, h4_i2c_board_info, ARRAY_SIZE(h4_i2c_board_info)); diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index e9d5f4a3d0642d..482a8ab2439653 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c @@ -15,8 +15,11 @@ #include #include #include +#include #include #include +#include +#include #include #include #include @@ -193,6 +196,110 @@ static struct omap_onenand_platform_data board_onenand_data[] = { }; #endif +#if defined(CONFIG_CBUS) || defined(CONFIG_CBUS_MODULE) + +static struct cbus_host_platform_data n8x0_cbus_data = { + .clk_gpio = 66, + .dat_gpio = 65, + .sel_gpio = 64, +}; + +static struct platform_device n8x0_cbus_device = { + .name = "cbus", + .id = -1, + .dev = { + .platform_data = &n8x0_cbus_data, + }, +}; + +static struct resource retu_resource[] = { + { + .start = -EINVAL, /* set later */ + .flags = IORESOURCE_IRQ, + }, +}; + +static struct cbus_retu_platform_data n8x0_retu_data = { + .devid = CBUS_RETU_DEVICE_ID, +}; + +static struct platform_device retu_device = { + .name = "retu", + .id = -1, + .resource = retu_resource, + .num_resources = ARRAY_SIZE(retu_resource), + .dev = { + .platform_data = &n8x0_retu_data, + .parent = &n8x0_cbus_device.dev, + }, +}; + +static struct resource tahvo_resource[] = { + { + .start = -EINVAL, /* set later */ + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device tahvo_device = { + .name = "tahvo", + .id = -1, + .resource = tahvo_resource, + .num_resources = ARRAY_SIZE(tahvo_resource), + .dev = { + .parent = &n8x0_cbus_device.dev, + }, +}; + +static void __init n8x0_cbus_init(void) +{ + int ret; + + platform_device_register(&n8x0_cbus_device); + + ret = gpio_request(108, "RETU irq"); + if (ret < 0) { + pr_err("retu: Unable to reserve IRQ GPIO\n"); + return; + } + + ret = gpio_direction_input(108); + if (ret < 0) { + pr_err("retu: Unable to change gpio direction\n"); + gpio_free(108); + return; + } + + irq_set_irq_type(gpio_to_irq(108), IRQ_TYPE_EDGE_RISING); + retu_resource[0].start = gpio_to_irq(108); + platform_device_register(&retu_device); + + ret = gpio_request(111, "TAHVO irq"); + if (ret) { + pr_err("tahvo: Unable to reserve IRQ GPIO\n"); + gpio_free(108); + return; + } + + /* Set the pin as input */ + ret = gpio_direction_input(111); + if (ret) { + pr_err("tahvo: Unable to change direction\n"); + gpio_free(108); + gpio_free(111); + return; + } + + tahvo_resource[0].start = gpio_to_irq(111); + platform_device_register(&tahvo_device); +} + +#else +static inline void __init n8x0_cbus_init(void) +{ +} +#endif + #if defined(CONFIG_MENELAUS) && \ (defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)) @@ -667,6 +774,8 @@ static inline void board_serial_init(void) static void __init n8x0_init_machine(void) { omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); + n8x0_cbus_init(); + /* FIXME: add n810 spi devices */ spi_register_board_info(n800_spi_board_info, ARRAY_SIZE(n800_spi_board_info)); diff --git a/arch/arm/mach-omap2/board-omap3encore.c b/arch/arm/mach-omap2/board-omap3encore.c new file mode 100644 index 00000000000000..475a00f361cf76 --- /dev/null +++ b/arch/arm/mach-omap2/board-omap3encore.c @@ -0,0 +1,342 @@ +/* + * Support for Barns&Noble Nook Color + * + * Loosely based on mach-omap2/board-zoom.c + * Copyright (C) 2008-2010 Texas Instruments Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * June 2011 Oleg Drokin - Port to mainline + * + */ + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include "mux.h" +#include "hsmmc.h" +#include "sdram-hynix-h8mbx00u0mer-0em.h" + +/* Encore-specific device-info and i2c addresses. */ +/* Battery, bus 1 */ +#define MAX17042_I2C_SLAVE_ADDRESS 0x36 +#define MAX17042_GPIO_FOR_IRQ 100 + +/*addition of MAXIM8903/TI GPIO mapping WRT schematics */ +#define MAX8903_UOK_GPIO_FOR_IRQ 115 +#define MAX8903_DOK_GPIO_FOR_IRQ 114 +#define MAX8903_GPIO_CHG_EN 110 +#define MAX8903_GPIO_CHG_STATUS 111 +#define MAX8903_GPIO_CHG_FLT 101 +#define MAX8903_GPIO_CHG_IUSB 102 +#define MAX8903_GPIO_CHG_USUS 104 +#define MAX8903_GPIO_CHG_ILM 61 + +/* TI WLAN */ +#define ENCORE_WIFI_PMENA_GPIO 22 +#define ENCORE_WIFI_IRQ_GPIO 15 +#define ENCORE_WIFI_EN_POW 16 + +/* Accelerometer i2c bus 1*/ +#define KXTF9_I2C_SLAVE_ADDRESS 0x0F +#define KXTF9_GPIO_FOR_PWR 34 +#define KXTF9_GPIO_FOR_IRQ 113 + +/* Touch screen i2c bus 2*/ +#define CYTTSP_I2C_SLAVEADDRESS 34 +#define ENCORE_CYTTSP_GPIO 99 +#define ENCORE_CYTTSP_RESET_GPIO 46 + +/* Audio codec, i2c bus 2 */ +#define AUDIO_CODEC_POWER_ENABLE_GPIO 103 +#define AUDIO_CODEC_RESET_GPIO 37 +#define AUDIO_CODEC_IRQ_GPIO 59 +#define AIC3100_I2CSLAVEADDRESS 0x18 + + +/* Different HW revisions */ +#define BOARD_ENCORE_REV_EVT1A 0x1 +#define BOARD_ENCORE_REV_EVT1B 0x2 +#define BOARD_ENCORE_REV_EVT2 0x3 +#define BOARD_ENCORE_REV_DVT 0x4 +#define BOARD_ENCORE_REV_PVT 0x5 +#define BOARD_ENCORE_REV_UNKNOWN 0x6 + +static inline int is_encore_board_evt2(void) +{ + return system_rev >= BOARD_ENCORE_REV_EVT2; +} + +static inline int is_encore_board_evt1b(void) +{ + return system_rev == BOARD_ENCORE_REV_EVT1B; +} + +static int encore_twl4030_keymap[] = { + KEY(1, 0, KEY_VOLUMEUP), + KEY(2, 0, KEY_VOLUMEDOWN), +}; + +static struct matrix_keymap_data encore_twl4030_keymap_data = { + .keymap = encore_twl4030_keymap, + .keymap_size = ARRAY_SIZE(encore_twl4030_keymap), +}; + +static struct twl4030_keypad_data encore_kp_twl4030_data = { + .rows = 8, + .cols = 8, + .keymap_data = &encore_twl4030_keymap_data, + .rep = 1, +}; + +/* HOME key code for HW > EVT2A */ +static struct gpio_keys_button encore_gpio_buttons[] = { + { + .code = KEY_POWER, + .gpio = 14, + .desc = "POWER", + .active_low = 0, + .wakeup = 1, + }, + { + .code = KEY_HOME, + .gpio = 48, + .desc = "HOME", + .active_low = 1, + .wakeup = 1, + }, +}; + +static struct gpio_keys_platform_data encore_gpio_key_info = { + .buttons = encore_gpio_buttons, + .nbuttons = ARRAY_SIZE(encore_gpio_buttons), +}; + +static struct platform_device encore_keys_gpio = { + .name = "gpio-keys", + .id = -1, + .dev = { + .platform_data = &encore_gpio_key_info, + }, +}; + +static struct platform_device *encore_devices[] __initdata = { + &encore_keys_gpio, +}; + +static struct twl4030_usb_data encore_usb_data = { + .usb_mode = T2_USB_MODE_ULPI, +}; + +static struct regulator_consumer_supply encore_vmmc1_supply[] = { + REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), +}; + +static struct regulator_consumer_supply encore_vdda_dac_supply[] = { + REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), +}; + +/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ +static struct regulator_init_data encore_vmmc1 = { + .constraints = { + .min_uV = 1850000, + .max_uV = 3150000, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = ARRAY_SIZE(encore_vmmc1_supply), + .consumer_supplies = encore_vmmc1_supply, +}; + +static struct regulator_init_data encore_vdac = { + .constraints = { + .min_uV = 1800000, + .max_uV = 1800000, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = ARRAY_SIZE(encore_vdda_dac_supply), + .consumer_supplies = encore_vdda_dac_supply, +}; + +/* + * The order is reverted in this table so that internal eMMC is presented + * as first mmc card for compatibility with existing installations and + * for common sense reasons + */ +static struct omap2_hsmmc_info mmc[] __initdata = { + { + .name = "internal", + .mmc = 2, + .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, + .gpio_cd = -EINVAL, + .gpio_wp = -EINVAL, + .nonremovable = true, + .power_saving = true, + .ocr_mask = MMC_VDD_165_195, /* 1.85V */ + }, + { + .name = "external", + .mmc = 1, + .caps = MMC_CAP_4_BIT_DATA, + .gpio_cd = -EINVAL, + .gpio_wp = -EINVAL, + .power_saving = true, + }, + { + .name = "internal", + .mmc = 3, + .caps = MMC_CAP_4_BIT_DATA, + .gpio_cd = -EINVAL, + .gpio_wp = -EINVAL, + .nonremovable = true, + .power_saving = true, + }, + {} /* Terminator */ +}; + +static int encore_hsmmc_card_detect(struct device *dev, int slot) +{ + struct omap_mmc_platform_data *mmc = dev->platform_data; + + /* Encore board EVT2 and later has pin high when card is present */ + return gpio_get_value_cansleep(mmc->slots[0].switch_pin); +} + +static int encore_twl4030_hsmmc_late_init(struct device *dev) +{ + int ret = 0; + struct platform_device *pdev = container_of(dev, + struct platform_device, dev); + struct omap_mmc_platform_data *pdata = dev->platform_data; + + if (is_encore_board_evt2()) { + /* Setting MMC1 (external) Card detect */ + if (pdev->id == 0) + pdata->slots[0].card_detect = encore_hsmmc_card_detect; + } + + return ret; +} + +static __init void encore_hsmmc_set_late_init(struct device *dev) +{ + struct omap_mmc_platform_data *pdata; + + /* dev can be null if CONFIG_MMC_OMAP_HS is not set */ + if (!dev) + return; + + pdata = dev->platform_data; + pdata->init = encore_twl4030_hsmmc_late_init; +} + +static int __ref encore_twl_gpio_setup(struct device *dev, + unsigned gpio, unsigned ngpio) +{ + struct omap2_hsmmc_info *c; + /* + * gpio + 0 is "mmc0_cd" (input/IRQ), + * gpio + 1 is "mmc1_cd" (input/IRQ) + */ + mmc[1].gpio_cd = gpio + 0; + mmc[0].gpio_cd = gpio + 1; + omap2_hsmmc_init(mmc); + for (c = mmc; c->mmc; c++) + encore_hsmmc_set_late_init(c->dev); + + return 0; +} + +static struct twl4030_gpio_platform_data encore_gpio_data = { + .gpio_base = OMAP_MAX_GPIO_LINES, + .irq_base = TWL4030_GPIO_IRQ_BASE, + .irq_end = TWL4030_GPIO_IRQ_END, + .setup = encore_twl_gpio_setup, +}; + +static struct twl4030_madc_platform_data encore_madc_data = { + .irq_line = 1, +}; + +static struct twl4030_platform_data __refdata encore_twldata = { + .irq_base = TWL4030_IRQ_BASE, + .irq_end = TWL4030_IRQ_END, + + .madc = &encore_madc_data, + .usb = &encore_usb_data, + .gpio = &encore_gpio_data, + .keypad = &encore_kp_twl4030_data, + .vmmc1 = &encore_vmmc1, + .vdac = &encore_vdac, +}; + +static struct i2c_board_info __initdata encore_i2c_bus1_info[] = { + { + I2C_BOARD_INFO("tps65921", 0x48), + .flags = I2C_CLIENT_WAKE, + .irq = INT_34XX_SYS_NIRQ, + .platform_data = &encore_twldata, + }, +}; + +static struct i2c_board_info __initdata encore_i2c_bus2_info[] = { +}; + +#ifdef CONFIG_OMAP_MUX +static struct omap_board_mux board_mux[] __initdata = { + { .reg_offset = OMAP_MUX_TERMINATOR }, +}; +#endif + +static struct omap_board_config_kernel encore_config[] __initdata = { +}; + +static void __init omap_i2c_init(void) +{ + omap_register_i2c_bus(1, 100, encore_i2c_bus1_info, + ARRAY_SIZE(encore_i2c_bus1_info)); + omap_register_i2c_bus(2, 400, encore_i2c_bus2_info, + ARRAY_SIZE(encore_i2c_bus2_info)); +} + +static void __init omap_encore_init(void) +{ + omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); + omap_i2c_init(); + omap_serial_init(); + omap_sdrc_init(h8mbx00u0mer0em_sdrc_params, + h8mbx00u0mer0em_sdrc_params); + usb_musb_init(NULL); + + omap_board_config = encore_config; + omap_board_config_size = ARRAY_SIZE(encore_config); + + platform_add_devices(encore_devices, ARRAY_SIZE(encore_devices)); +} + +MACHINE_START(ENCORE, "encore") + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = omap3630_init_early, + .init_irq = omap3_init_irq, + .init_machine = omap_encore_init, + .timer = &omap3_timer, +MACHINE_END diff --git a/arch/arm/mach-omap2/board-omap4pcm049.c b/arch/arm/mach-omap2/board-omap4pcm049.c new file mode 100644 index 00000000000000..07ccbe7d0048bf --- /dev/null +++ b/arch/arm/mach-omap2/board-omap4pcm049.c @@ -0,0 +1,582 @@ +/* + * Board support file for Phytec phyCORE-OMAP4 Board. + * + * Copyright (C) 2011 Phytec Messtechnik GmbH + * + * Author: Jan Weitzel + * + * Based on mach-omap2/board-omap4panda.c + * + * Author: David Anders + * + * Author: Santosh Shilimkar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include