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