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