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