Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Board support file for OMAP4430 SDP. |
| 3 | * |
| 4 | * Copyright (C) 2009 Texas Instruments |
| 5 | * |
| 6 | * Author: Santosh Shilimkar <santosh.shilimkar@ti.com> |
| 7 | * |
| 8 | * Based on mach-omap2/board-3430sdp.c |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License version 2 as |
| 12 | * published by the Free Software Foundation. |
| 13 | */ |
| 14 | |
| 15 | #include <linux/kernel.h> |
| 16 | #include <linux/init.h> |
| 17 | #include <linux/platform_device.h> |
| 18 | #include <linux/io.h> |
| 19 | #include <linux/gpio.h> |
Maulik Mankad | bce0668 | 2010-02-17 14:09:32 -0800 | [diff] [blame] | 20 | #include <linux/usb/otg.h> |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 21 | #include <linux/spi/spi.h> |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 22 | #include <linux/i2c/twl.h> |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 23 | #include <linux/gpio_keys.h> |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 24 | #include <linux/regulator/machine.h> |
Hemanth V | 509b6d9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 25 | #include <linux/leds.h> |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 26 | |
| 27 | #include <mach/hardware.h> |
Santosh Shilimkar | fbc9be1 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 28 | #include <mach/omap4-common.h> |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 29 | #include <asm/mach-types.h> |
| 30 | #include <asm/mach/arch.h> |
| 31 | #include <asm/mach/map.h> |
| 32 | |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 33 | #include <plat/board.h> |
| 34 | #include <plat/common.h> |
Maulik Mankad | bce0668 | 2010-02-17 14:09:32 -0800 | [diff] [blame] | 35 | #include <plat/usb.h> |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 36 | #include <plat/mmc.h> |
Manjunath Kondaiah G | 04aeae7 | 2010-10-08 09:58:35 -0700 | [diff] [blame] | 37 | |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 38 | #include "hsmmc.h" |
Manjunath Kondaiah G | 04aeae7 | 2010-10-08 09:58:35 -0700 | [diff] [blame] | 39 | #include "timer-gp.h" |
Paul Walmsley | 4814ced | 2010-10-08 11:40:20 -0600 | [diff] [blame] | 40 | #include "control.h" |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 41 | |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 42 | #define ETH_KS8851_IRQ 34 |
| 43 | #define ETH_KS8851_POWER_ON 48 |
| 44 | #define ETH_KS8851_QUART 138 |
Keshava Munegowda | 6aa85a5 | 2010-11-21 23:23:42 +0530 | [diff] [blame^] | 45 | #define OMAP4SDP_MDM_PWR_EN_GPIO 157 |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 46 | #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184 |
| 47 | #define OMAP4_SFH7741_ENABLE_GPIO 188 |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 48 | |
Hemanth V | 509b6d9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 49 | static struct gpio_led sdp4430_gpio_leds[] = { |
| 50 | { |
| 51 | .name = "omap4:green:debug0", |
| 52 | .gpio = 61, |
| 53 | }, |
| 54 | { |
| 55 | .name = "omap4:green:debug1", |
| 56 | .gpio = 30, |
| 57 | }, |
| 58 | { |
| 59 | .name = "omap4:green:debug2", |
| 60 | .gpio = 7, |
| 61 | }, |
| 62 | { |
| 63 | .name = "omap4:green:debug3", |
| 64 | .gpio = 8, |
| 65 | }, |
| 66 | { |
| 67 | .name = "omap4:green:debug4", |
| 68 | .gpio = 50, |
| 69 | }, |
| 70 | { |
| 71 | .name = "omap4:blue:user", |
| 72 | .gpio = 169, |
| 73 | }, |
| 74 | { |
| 75 | .name = "omap4:red:user", |
| 76 | .gpio = 170, |
| 77 | }, |
| 78 | { |
| 79 | .name = "omap4:green:user", |
| 80 | .gpio = 139, |
| 81 | }, |
| 82 | |
| 83 | }; |
| 84 | |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 85 | static struct gpio_keys_button sdp4430_gpio_keys[] = { |
| 86 | { |
| 87 | .desc = "Proximity Sensor", |
| 88 | .type = EV_SW, |
| 89 | .code = SW_FRONT_PROXIMITY, |
| 90 | .gpio = OMAP4_SFH7741_SENSOR_OUTPUT_GPIO, |
| 91 | .active_low = 0, |
| 92 | } |
| 93 | }; |
| 94 | |
Hemanth V | 509b6d9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 95 | static struct gpio_led_platform_data sdp4430_led_data = { |
| 96 | .leds = sdp4430_gpio_leds, |
| 97 | .num_leds = ARRAY_SIZE(sdp4430_gpio_leds), |
| 98 | }; |
| 99 | |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 100 | static int omap_prox_activate(struct device *dev) |
| 101 | { |
| 102 | gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1); |
| 103 | return 0; |
| 104 | } |
| 105 | |
| 106 | static void omap_prox_deactivate(struct device *dev) |
| 107 | { |
| 108 | gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 0); |
| 109 | } |
| 110 | |
| 111 | static struct gpio_keys_platform_data sdp4430_gpio_keys_data = { |
| 112 | .buttons = sdp4430_gpio_keys, |
| 113 | .nbuttons = ARRAY_SIZE(sdp4430_gpio_keys), |
| 114 | .enable = omap_prox_activate, |
| 115 | .disable = omap_prox_deactivate, |
| 116 | }; |
| 117 | |
| 118 | static struct platform_device sdp4430_gpio_keys_device = { |
| 119 | .name = "gpio-keys", |
| 120 | .id = -1, |
| 121 | .dev = { |
| 122 | .platform_data = &sdp4430_gpio_keys_data, |
| 123 | }, |
| 124 | }; |
| 125 | |
Hemanth V | 509b6d9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 126 | static struct platform_device sdp4430_leds_gpio = { |
| 127 | .name = "leds-gpio", |
| 128 | .id = -1, |
| 129 | .dev = { |
| 130 | .platform_data = &sdp4430_led_data, |
| 131 | }, |
| 132 | }; |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 133 | static struct spi_board_info sdp4430_spi_board_info[] __initdata = { |
| 134 | { |
| 135 | .modalias = "ks8851", |
| 136 | .bus_num = 1, |
| 137 | .chip_select = 0, |
| 138 | .max_speed_hz = 24000000, |
| 139 | .irq = ETH_KS8851_IRQ, |
| 140 | }, |
| 141 | }; |
| 142 | |
| 143 | static int omap_ethernet_init(void) |
| 144 | { |
| 145 | int status; |
| 146 | |
| 147 | /* Request of GPIO lines */ |
| 148 | |
| 149 | status = gpio_request(ETH_KS8851_POWER_ON, "eth_power"); |
| 150 | if (status) { |
| 151 | pr_err("Cannot request GPIO %d\n", ETH_KS8851_POWER_ON); |
| 152 | return status; |
| 153 | } |
| 154 | |
| 155 | status = gpio_request(ETH_KS8851_QUART, "quart"); |
| 156 | if (status) { |
| 157 | pr_err("Cannot request GPIO %d\n", ETH_KS8851_QUART); |
| 158 | goto error1; |
| 159 | } |
| 160 | |
| 161 | status = gpio_request(ETH_KS8851_IRQ, "eth_irq"); |
| 162 | if (status) { |
| 163 | pr_err("Cannot request GPIO %d\n", ETH_KS8851_IRQ); |
| 164 | goto error2; |
| 165 | } |
| 166 | |
| 167 | /* Configuration of requested GPIO lines */ |
| 168 | |
| 169 | status = gpio_direction_output(ETH_KS8851_POWER_ON, 1); |
| 170 | if (status) { |
| 171 | pr_err("Cannot set output GPIO %d\n", ETH_KS8851_IRQ); |
| 172 | goto error3; |
| 173 | } |
| 174 | |
| 175 | status = gpio_direction_output(ETH_KS8851_QUART, 1); |
| 176 | if (status) { |
| 177 | pr_err("Cannot set output GPIO %d\n", ETH_KS8851_QUART); |
| 178 | goto error3; |
| 179 | } |
| 180 | |
| 181 | status = gpio_direction_input(ETH_KS8851_IRQ); |
| 182 | if (status) { |
| 183 | pr_err("Cannot set input GPIO %d\n", ETH_KS8851_IRQ); |
| 184 | goto error3; |
| 185 | } |
| 186 | |
| 187 | return 0; |
| 188 | |
| 189 | error3: |
| 190 | gpio_free(ETH_KS8851_IRQ); |
| 191 | error2: |
| 192 | gpio_free(ETH_KS8851_QUART); |
| 193 | error1: |
| 194 | gpio_free(ETH_KS8851_POWER_ON); |
| 195 | return status; |
| 196 | } |
| 197 | |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 198 | static struct platform_device sdp4430_lcd_device = { |
| 199 | .name = "sdp4430_lcd", |
| 200 | .id = -1, |
| 201 | }; |
| 202 | |
| 203 | static struct platform_device *sdp4430_devices[] __initdata = { |
| 204 | &sdp4430_lcd_device, |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 205 | &sdp4430_gpio_keys_device, |
Hemanth V | 509b6d9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 206 | &sdp4430_leds_gpio, |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 207 | }; |
| 208 | |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 209 | static struct omap_lcd_config sdp4430_lcd_config __initdata = { |
| 210 | .ctrl_name = "internal", |
| 211 | }; |
| 212 | |
| 213 | static struct omap_board_config_kernel sdp4430_config[] __initdata = { |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 214 | { OMAP_TAG_LCD, &sdp4430_lcd_config }, |
| 215 | }; |
| 216 | |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 217 | static void __init omap_4430sdp_init_irq(void) |
| 218 | { |
Santosh Shilimkar | 5b7815b | 2009-10-22 14:48:14 -0700 | [diff] [blame] | 219 | omap_board_config = sdp4430_config; |
| 220 | omap_board_config_size = ARRAY_SIZE(sdp4430_config); |
Jean Pihet | 58cda88 | 2009-07-24 19:43:25 -0600 | [diff] [blame] | 221 | omap2_init_common_hw(NULL, NULL); |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 222 | #ifdef CONFIG_OMAP_32K_TIMER |
| 223 | omap2_gp_clockevent_set_gptimer(1); |
| 224 | #endif |
| 225 | gic_init_irq(); |
| 226 | omap_gpio_init(); |
| 227 | } |
| 228 | |
Keshava Munegowda | 6aa85a5 | 2010-11-21 23:23:42 +0530 | [diff] [blame^] | 229 | static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { |
| 230 | .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, |
| 231 | .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN, |
| 232 | .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, |
| 233 | .phy_reset = false, |
| 234 | .reset_gpio_port[0] = -EINVAL, |
| 235 | .reset_gpio_port[1] = -EINVAL, |
| 236 | .reset_gpio_port[2] = -EINVAL, |
| 237 | }; |
| 238 | |
Maulik Mankad | bce0668 | 2010-02-17 14:09:32 -0800 | [diff] [blame] | 239 | static struct omap_musb_board_data musb_board_data = { |
| 240 | .interface_type = MUSB_INTERFACE_UTMI, |
| 241 | .mode = MUSB_PERIPHERAL, |
| 242 | .power = 100, |
| 243 | }; |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 244 | |
| 245 | static struct omap2_hsmmc_info mmc[] = { |
| 246 | { |
| 247 | .mmc = 1, |
Sukumar Ghorai | 3a63833 | 2010-09-15 14:49:23 +0000 | [diff] [blame] | 248 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 249 | .gpio_wp = -EINVAL, |
| 250 | }, |
| 251 | { |
| 252 | .mmc = 2, |
Sukumar Ghorai | 3a63833 | 2010-09-15 14:49:23 +0000 | [diff] [blame] | 253 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 254 | .gpio_cd = -EINVAL, |
| 255 | .gpio_wp = -EINVAL, |
| 256 | .nonremovable = true, |
kishore kadiyala | 64be978 | 2010-10-01 16:35:28 -0700 | [diff] [blame] | 257 | .ocr_mask = MMC_VDD_29_30, |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 258 | }, |
| 259 | {} /* Terminator */ |
| 260 | }; |
| 261 | |
Santosh Shilimkar | 5026391 | 2010-08-02 13:18:03 +0300 | [diff] [blame] | 262 | static struct regulator_consumer_supply sdp4430_vaux_supply[] = { |
| 263 | { |
| 264 | .supply = "vmmc", |
| 265 | .dev_name = "mmci-omap-hs.1", |
| 266 | }, |
| 267 | }; |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 268 | static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { |
| 269 | { |
| 270 | .supply = "vmmc", |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 271 | .dev_name = "mmci-omap-hs.0", |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 272 | }, |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 273 | }; |
| 274 | |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 275 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) |
| 276 | { |
| 277 | int ret = 0; |
| 278 | struct platform_device *pdev = container_of(dev, |
| 279 | struct platform_device, dev); |
| 280 | struct omap_mmc_platform_data *pdata = dev->platform_data; |
| 281 | |
| 282 | /* Setting MMC1 Card detect Irq */ |
kishore kadiyala | 72f2e2c | 2010-09-24 17:13:20 +0000 | [diff] [blame] | 283 | if (pdev->id == 0) { |
| 284 | ret = twl6030_mmc_card_detect_config(); |
| 285 | if (ret) |
| 286 | pr_err("Failed configuring MMC1 card detect\n"); |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 287 | pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE + |
| 288 | MMCDETECT_INTR_OFFSET; |
kishore kadiyala | 72f2e2c | 2010-09-24 17:13:20 +0000 | [diff] [blame] | 289 | pdata->slots[0].card_detect = twl6030_mmc_card_detect; |
| 290 | } |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 291 | return ret; |
| 292 | } |
| 293 | |
| 294 | static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev) |
| 295 | { |
Benoit Cousson | 531c21b | 2010-10-01 16:35:26 -0700 | [diff] [blame] | 296 | struct omap_mmc_platform_data *pdata; |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 297 | |
Benoit Cousson | 531c21b | 2010-10-01 16:35:26 -0700 | [diff] [blame] | 298 | /* dev can be null if CONFIG_MMC_OMAP_HS is not set */ |
| 299 | if (!dev) { |
| 300 | pr_err("Failed %s\n", __func__); |
| 301 | return; |
| 302 | } |
| 303 | pdata = dev->platform_data; |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 304 | pdata->init = omap4_twl6030_hsmmc_late_init; |
| 305 | } |
| 306 | |
| 307 | static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers) |
| 308 | { |
| 309 | struct omap2_hsmmc_info *c; |
| 310 | |
| 311 | omap2_hsmmc_init(controllers); |
| 312 | for (c = controllers; c->mmc; c++) |
| 313 | omap4_twl6030_hsmmc_set_late_init(c->dev); |
| 314 | |
| 315 | return 0; |
| 316 | } |
| 317 | |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 318 | static struct regulator_init_data sdp4430_vaux1 = { |
| 319 | .constraints = { |
| 320 | .min_uV = 1000000, |
| 321 | .max_uV = 3000000, |
| 322 | .apply_uV = true, |
| 323 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 324 | | REGULATOR_MODE_STANDBY, |
| 325 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 326 | | REGULATOR_CHANGE_MODE |
| 327 | | REGULATOR_CHANGE_STATUS, |
| 328 | }, |
Santosh Shilimkar | 5026391 | 2010-08-02 13:18:03 +0300 | [diff] [blame] | 329 | .num_consumer_supplies = 1, |
| 330 | .consumer_supplies = sdp4430_vaux_supply, |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 331 | }; |
| 332 | |
| 333 | static struct regulator_init_data sdp4430_vaux2 = { |
| 334 | .constraints = { |
| 335 | .min_uV = 1200000, |
| 336 | .max_uV = 2800000, |
| 337 | .apply_uV = true, |
| 338 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 339 | | REGULATOR_MODE_STANDBY, |
| 340 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 341 | | REGULATOR_CHANGE_MODE |
| 342 | | REGULATOR_CHANGE_STATUS, |
| 343 | }, |
| 344 | }; |
| 345 | |
| 346 | static struct regulator_init_data sdp4430_vaux3 = { |
| 347 | .constraints = { |
| 348 | .min_uV = 1000000, |
| 349 | .max_uV = 3000000, |
| 350 | .apply_uV = true, |
| 351 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 352 | | REGULATOR_MODE_STANDBY, |
| 353 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 354 | | REGULATOR_CHANGE_MODE |
| 355 | | REGULATOR_CHANGE_STATUS, |
| 356 | }, |
| 357 | }; |
| 358 | |
| 359 | /* VMMC1 for MMC1 card */ |
| 360 | static struct regulator_init_data sdp4430_vmmc = { |
| 361 | .constraints = { |
| 362 | .min_uV = 1200000, |
| 363 | .max_uV = 3000000, |
| 364 | .apply_uV = true, |
| 365 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 366 | | REGULATOR_MODE_STANDBY, |
| 367 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 368 | | REGULATOR_CHANGE_MODE |
| 369 | | REGULATOR_CHANGE_STATUS, |
| 370 | }, |
Santosh Shilimkar | 5026391 | 2010-08-02 13:18:03 +0300 | [diff] [blame] | 371 | .num_consumer_supplies = 1, |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 372 | .consumer_supplies = sdp4430_vmmc_supply, |
| 373 | }; |
| 374 | |
| 375 | static struct regulator_init_data sdp4430_vpp = { |
| 376 | .constraints = { |
| 377 | .min_uV = 1800000, |
| 378 | .max_uV = 2500000, |
| 379 | .apply_uV = true, |
| 380 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 381 | | REGULATOR_MODE_STANDBY, |
| 382 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 383 | | REGULATOR_CHANGE_MODE |
| 384 | | REGULATOR_CHANGE_STATUS, |
| 385 | }, |
| 386 | }; |
| 387 | |
| 388 | static struct regulator_init_data sdp4430_vusim = { |
| 389 | .constraints = { |
| 390 | .min_uV = 1200000, |
| 391 | .max_uV = 2900000, |
| 392 | .apply_uV = true, |
| 393 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 394 | | REGULATOR_MODE_STANDBY, |
| 395 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 396 | | REGULATOR_CHANGE_MODE |
| 397 | | REGULATOR_CHANGE_STATUS, |
| 398 | }, |
| 399 | }; |
| 400 | |
| 401 | static struct regulator_init_data sdp4430_vana = { |
| 402 | .constraints = { |
| 403 | .min_uV = 2100000, |
| 404 | .max_uV = 2100000, |
| 405 | .apply_uV = true, |
| 406 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 407 | | REGULATOR_MODE_STANDBY, |
| 408 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| 409 | | REGULATOR_CHANGE_STATUS, |
| 410 | }, |
| 411 | }; |
| 412 | |
| 413 | static struct regulator_init_data sdp4430_vcxio = { |
| 414 | .constraints = { |
| 415 | .min_uV = 1800000, |
| 416 | .max_uV = 1800000, |
| 417 | .apply_uV = true, |
| 418 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 419 | | REGULATOR_MODE_STANDBY, |
| 420 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| 421 | | REGULATOR_CHANGE_STATUS, |
| 422 | }, |
| 423 | }; |
| 424 | |
| 425 | static struct regulator_init_data sdp4430_vdac = { |
| 426 | .constraints = { |
| 427 | .min_uV = 1800000, |
| 428 | .max_uV = 1800000, |
| 429 | .apply_uV = true, |
| 430 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 431 | | REGULATOR_MODE_STANDBY, |
| 432 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| 433 | | REGULATOR_CHANGE_STATUS, |
| 434 | }, |
| 435 | }; |
| 436 | |
| 437 | static struct regulator_init_data sdp4430_vusb = { |
| 438 | .constraints = { |
| 439 | .min_uV = 3300000, |
| 440 | .max_uV = 3300000, |
| 441 | .apply_uV = true, |
| 442 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 443 | | REGULATOR_MODE_STANDBY, |
| 444 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| 445 | | REGULATOR_CHANGE_STATUS, |
| 446 | }, |
| 447 | }; |
| 448 | |
| 449 | static struct twl4030_platform_data sdp4430_twldata = { |
| 450 | .irq_base = TWL6030_IRQ_BASE, |
| 451 | .irq_end = TWL6030_IRQ_END, |
| 452 | |
| 453 | /* Regulators */ |
| 454 | .vmmc = &sdp4430_vmmc, |
| 455 | .vpp = &sdp4430_vpp, |
| 456 | .vusim = &sdp4430_vusim, |
| 457 | .vana = &sdp4430_vana, |
| 458 | .vcxio = &sdp4430_vcxio, |
| 459 | .vdac = &sdp4430_vdac, |
| 460 | .vusb = &sdp4430_vusb, |
| 461 | .vaux1 = &sdp4430_vaux1, |
| 462 | .vaux2 = &sdp4430_vaux2, |
| 463 | .vaux3 = &sdp4430_vaux3, |
| 464 | }; |
| 465 | |
| 466 | static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = { |
| 467 | { |
| 468 | I2C_BOARD_INFO("twl6030", 0x48), |
| 469 | .flags = I2C_CLIENT_WAKE, |
| 470 | .irq = OMAP44XX_IRQ_SYS_1N, |
| 471 | .platform_data = &sdp4430_twldata, |
| 472 | }, |
| 473 | }; |
Shubhrajyoti Datta | 83078f9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 474 | static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = { |
| 475 | { |
| 476 | I2C_BOARD_INFO("tmp105", 0x48), |
| 477 | }, |
| 478 | }; |
Shubhrajyoti Datta | 0df891b | 2010-09-23 18:22:47 -0700 | [diff] [blame] | 479 | static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = { |
| 480 | { |
| 481 | I2C_BOARD_INFO("hmc5843", 0x1e), |
| 482 | }, |
| 483 | }; |
Santosh Shilimkar | baeb73e | 2010-05-12 08:27:29 +0000 | [diff] [blame] | 484 | static int __init omap4_i2c_init(void) |
| 485 | { |
| 486 | /* |
| 487 | * Phoenix Audio IC needs I2C1 to |
| 488 | * start with 400 KHz or less |
| 489 | */ |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 490 | omap_register_i2c_bus(1, 400, sdp4430_i2c_boardinfo, |
| 491 | ARRAY_SIZE(sdp4430_i2c_boardinfo)); |
Santosh Shilimkar | baeb73e | 2010-05-12 08:27:29 +0000 | [diff] [blame] | 492 | omap_register_i2c_bus(2, 400, NULL, 0); |
Shubhrajyoti Datta | 83078f9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 493 | omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo, |
| 494 | ARRAY_SIZE(sdp4430_i2c_3_boardinfo)); |
Shubhrajyoti Datta | 0df891b | 2010-09-23 18:22:47 -0700 | [diff] [blame] | 495 | omap_register_i2c_bus(4, 400, sdp4430_i2c_4_boardinfo, |
| 496 | ARRAY_SIZE(sdp4430_i2c_4_boardinfo)); |
Santosh Shilimkar | baeb73e | 2010-05-12 08:27:29 +0000 | [diff] [blame] | 497 | return 0; |
| 498 | } |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 499 | |
| 500 | static void __init omap_sfh7741prox_init(void) |
| 501 | { |
| 502 | int error; |
| 503 | |
| 504 | error = gpio_request(OMAP4_SFH7741_ENABLE_GPIO, "sfh7741"); |
| 505 | if (error < 0) { |
| 506 | pr_err("%s:failed to request GPIO %d, error %d\n", |
| 507 | __func__, OMAP4_SFH7741_ENABLE_GPIO, error); |
| 508 | return; |
| 509 | } |
| 510 | |
| 511 | error = gpio_direction_output(OMAP4_SFH7741_ENABLE_GPIO , 0); |
| 512 | if (error < 0) { |
| 513 | pr_err("%s: GPIO configuration failed: GPIO %d,error %d\n", |
| 514 | __func__, OMAP4_SFH7741_ENABLE_GPIO, error); |
| 515 | gpio_free(OMAP4_SFH7741_ENABLE_GPIO); |
| 516 | } |
| 517 | } |
| 518 | |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 519 | static void __init omap_4430sdp_init(void) |
| 520 | { |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 521 | int status; |
| 522 | |
Santosh Shilimkar | baeb73e | 2010-05-12 08:27:29 +0000 | [diff] [blame] | 523 | omap4_i2c_init(); |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 524 | omap_sfh7741prox_init(); |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 525 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 526 | omap_serial_init(); |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 527 | omap4_twl6030_hsmmc_init(mmc); |
Keshava Munegowda | 6aa85a5 | 2010-11-21 23:23:42 +0530 | [diff] [blame^] | 528 | |
| 529 | /* Power on the ULPI PHY */ |
| 530 | if (gpio_is_valid(OMAP4SDP_MDM_PWR_EN_GPIO)) { |
| 531 | /* FIXME: Assumes pad is already muxed for GPIO mode */ |
| 532 | gpio_request(OMAP4SDP_MDM_PWR_EN_GPIO, "USBB1 PHY VMDM_3V3"); |
| 533 | gpio_direction_output(OMAP4SDP_MDM_PWR_EN_GPIO, 1); |
| 534 | } |
| 535 | usb_ehci_init(&ehci_pdata); |
| 536 | |
Maulik Mankad | bce0668 | 2010-02-17 14:09:32 -0800 | [diff] [blame] | 537 | /* OMAP4 SDP uses internal transceiver so register nop transceiver */ |
| 538 | usb_nop_xceiv_register(); |
Santosh Shilimkar | ae46ec7 | 2010-02-16 19:29:20 +0530 | [diff] [blame] | 539 | /* FIXME: allow multi-omap to boot until musb is updated for omap4 */ |
| 540 | if (!cpu_is_omap44xx()) |
| 541 | usb_musb_init(&musb_board_data); |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 542 | |
| 543 | status = omap_ethernet_init(); |
| 544 | if (status) { |
| 545 | pr_err("Ethernet initialization failed: %d\n", status); |
| 546 | } else { |
| 547 | sdp4430_spi_board_info[0].irq = gpio_to_irq(ETH_KS8851_IRQ); |
| 548 | spi_register_board_info(sdp4430_spi_board_info, |
| 549 | ARRAY_SIZE(sdp4430_spi_board_info)); |
| 550 | } |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 551 | } |
| 552 | |
| 553 | static void __init omap_4430sdp_map_io(void) |
| 554 | { |
| 555 | omap2_set_globals_443x(); |
Tony Lindgren | 6fbd55d | 2010-02-12 12:26:47 -0800 | [diff] [blame] | 556 | omap44xx_map_common_io(); |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 557 | } |
| 558 | |
| 559 | MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") |
| 560 | /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */ |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 561 | .boot_params = 0x80000100, |
| 562 | .map_io = omap_4430sdp_map_io, |
Russell King | 71ee7da | 2010-05-23 10:18:16 +0100 | [diff] [blame] | 563 | .reserve = omap_reserve, |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 564 | .init_irq = omap_4430sdp_init_irq, |
| 565 | .init_machine = omap_4430sdp_init, |
| 566 | .timer = &omap_timer, |
| 567 | MACHINE_END |