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 | |
Russell King - ARM Linux | 3dc3bad | 2011-02-14 15:40:20 -0800 | [diff] [blame^] | 242 | static void __init omap_4430sdp_init_early(void) |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 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 |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 251 | } |
| 252 | |
Keshava Munegowda | 6aa85a5 | 2010-11-21 23:23:42 +0530 | [diff] [blame] | 253 | static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { |
| 254 | .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, |
| 255 | .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN, |
| 256 | .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, |
| 257 | .phy_reset = false, |
| 258 | .reset_gpio_port[0] = -EINVAL, |
| 259 | .reset_gpio_port[1] = -EINVAL, |
| 260 | .reset_gpio_port[2] = -EINVAL, |
| 261 | }; |
| 262 | |
Maulik Mankad | bce0668 | 2010-02-17 14:09:32 -0800 | [diff] [blame] | 263 | static struct omap_musb_board_data musb_board_data = { |
| 264 | .interface_type = MUSB_INTERFACE_UTMI, |
Hema HK | 09e7200 | 2010-12-10 18:11:42 +0530 | [diff] [blame] | 265 | .mode = MUSB_OTG, |
Maulik Mankad | bce0668 | 2010-02-17 14:09:32 -0800 | [diff] [blame] | 266 | .power = 100, |
| 267 | }; |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 268 | |
Hema HK | e70357e3 | 2010-12-10 18:09:52 +0530 | [diff] [blame] | 269 | static struct twl4030_usb_data omap4_usbphy_data = { |
| 270 | .phy_init = omap4430_phy_init, |
| 271 | .phy_exit = omap4430_phy_exit, |
| 272 | .phy_power = omap4430_phy_power, |
| 273 | .phy_set_clock = omap4430_phy_set_clk, |
| 274 | }; |
| 275 | |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 276 | static struct omap2_hsmmc_info mmc[] = { |
| 277 | { |
| 278 | .mmc = 1, |
Sukumar Ghorai | 3a63833 | 2010-09-15 14:49:23 +0000 | [diff] [blame] | 279 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 280 | .gpio_wp = -EINVAL, |
| 281 | }, |
| 282 | { |
| 283 | .mmc = 2, |
Sukumar Ghorai | 3a63833 | 2010-09-15 14:49:23 +0000 | [diff] [blame] | 284 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 285 | .gpio_cd = -EINVAL, |
| 286 | .gpio_wp = -EINVAL, |
| 287 | .nonremovable = true, |
kishore kadiyala | 64be978 | 2010-10-01 16:35:28 -0700 | [diff] [blame] | 288 | .ocr_mask = MMC_VDD_29_30, |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 289 | }, |
| 290 | {} /* Terminator */ |
| 291 | }; |
| 292 | |
Santosh Shilimkar | 5026391 | 2010-08-02 13:18:03 +0300 | [diff] [blame] | 293 | static struct regulator_consumer_supply sdp4430_vaux_supply[] = { |
| 294 | { |
| 295 | .supply = "vmmc", |
| 296 | .dev_name = "mmci-omap-hs.1", |
| 297 | }, |
| 298 | }; |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 299 | static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { |
| 300 | { |
| 301 | .supply = "vmmc", |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 302 | .dev_name = "mmci-omap-hs.0", |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 303 | }, |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 304 | }; |
| 305 | |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 306 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) |
| 307 | { |
| 308 | int ret = 0; |
| 309 | struct platform_device *pdev = container_of(dev, |
| 310 | struct platform_device, dev); |
| 311 | struct omap_mmc_platform_data *pdata = dev->platform_data; |
| 312 | |
| 313 | /* Setting MMC1 Card detect Irq */ |
kishore kadiyala | 72f2e2c | 2010-09-24 17:13:20 +0000 | [diff] [blame] | 314 | if (pdev->id == 0) { |
| 315 | ret = twl6030_mmc_card_detect_config(); |
| 316 | if (ret) |
| 317 | pr_err("Failed configuring MMC1 card detect\n"); |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 318 | pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE + |
| 319 | MMCDETECT_INTR_OFFSET; |
kishore kadiyala | 72f2e2c | 2010-09-24 17:13:20 +0000 | [diff] [blame] | 320 | pdata->slots[0].card_detect = twl6030_mmc_card_detect; |
| 321 | } |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 322 | return ret; |
| 323 | } |
| 324 | |
| 325 | static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev) |
| 326 | { |
Benoit Cousson | 531c21b | 2010-10-01 16:35:26 -0700 | [diff] [blame] | 327 | struct omap_mmc_platform_data *pdata; |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 328 | |
Benoit Cousson | 531c21b | 2010-10-01 16:35:26 -0700 | [diff] [blame] | 329 | /* dev can be null if CONFIG_MMC_OMAP_HS is not set */ |
| 330 | if (!dev) { |
| 331 | pr_err("Failed %s\n", __func__); |
| 332 | return; |
| 333 | } |
| 334 | pdata = dev->platform_data; |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 335 | pdata->init = omap4_twl6030_hsmmc_late_init; |
| 336 | } |
| 337 | |
| 338 | static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers) |
| 339 | { |
| 340 | struct omap2_hsmmc_info *c; |
| 341 | |
| 342 | omap2_hsmmc_init(controllers); |
| 343 | for (c = controllers; c->mmc; c++) |
| 344 | omap4_twl6030_hsmmc_set_late_init(c->dev); |
| 345 | |
| 346 | return 0; |
| 347 | } |
| 348 | |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 349 | static struct regulator_init_data sdp4430_vaux1 = { |
| 350 | .constraints = { |
| 351 | .min_uV = 1000000, |
| 352 | .max_uV = 3000000, |
| 353 | .apply_uV = true, |
| 354 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 355 | | REGULATOR_MODE_STANDBY, |
| 356 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 357 | | REGULATOR_CHANGE_MODE |
| 358 | | REGULATOR_CHANGE_STATUS, |
| 359 | }, |
Santosh Shilimkar | 5026391 | 2010-08-02 13:18:03 +0300 | [diff] [blame] | 360 | .num_consumer_supplies = 1, |
| 361 | .consumer_supplies = sdp4430_vaux_supply, |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 362 | }; |
| 363 | |
| 364 | static struct regulator_init_data sdp4430_vaux2 = { |
| 365 | .constraints = { |
| 366 | .min_uV = 1200000, |
| 367 | .max_uV = 2800000, |
| 368 | .apply_uV = true, |
| 369 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 370 | | REGULATOR_MODE_STANDBY, |
| 371 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 372 | | REGULATOR_CHANGE_MODE |
| 373 | | REGULATOR_CHANGE_STATUS, |
| 374 | }, |
| 375 | }; |
| 376 | |
| 377 | static struct regulator_init_data sdp4430_vaux3 = { |
| 378 | .constraints = { |
| 379 | .min_uV = 1000000, |
| 380 | .max_uV = 3000000, |
| 381 | .apply_uV = true, |
| 382 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 383 | | REGULATOR_MODE_STANDBY, |
| 384 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 385 | | REGULATOR_CHANGE_MODE |
| 386 | | REGULATOR_CHANGE_STATUS, |
| 387 | }, |
| 388 | }; |
| 389 | |
| 390 | /* VMMC1 for MMC1 card */ |
| 391 | static struct regulator_init_data sdp4430_vmmc = { |
| 392 | .constraints = { |
| 393 | .min_uV = 1200000, |
| 394 | .max_uV = 3000000, |
| 395 | .apply_uV = true, |
| 396 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 397 | | REGULATOR_MODE_STANDBY, |
| 398 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 399 | | REGULATOR_CHANGE_MODE |
| 400 | | REGULATOR_CHANGE_STATUS, |
| 401 | }, |
Santosh Shilimkar | 5026391 | 2010-08-02 13:18:03 +0300 | [diff] [blame] | 402 | .num_consumer_supplies = 1, |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 403 | .consumer_supplies = sdp4430_vmmc_supply, |
| 404 | }; |
| 405 | |
| 406 | static struct regulator_init_data sdp4430_vpp = { |
| 407 | .constraints = { |
| 408 | .min_uV = 1800000, |
| 409 | .max_uV = 2500000, |
| 410 | .apply_uV = true, |
| 411 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 412 | | REGULATOR_MODE_STANDBY, |
| 413 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 414 | | REGULATOR_CHANGE_MODE |
| 415 | | REGULATOR_CHANGE_STATUS, |
| 416 | }, |
| 417 | }; |
| 418 | |
| 419 | static struct regulator_init_data sdp4430_vusim = { |
| 420 | .constraints = { |
| 421 | .min_uV = 1200000, |
| 422 | .max_uV = 2900000, |
| 423 | .apply_uV = true, |
| 424 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 425 | | REGULATOR_MODE_STANDBY, |
| 426 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 427 | | REGULATOR_CHANGE_MODE |
| 428 | | REGULATOR_CHANGE_STATUS, |
| 429 | }, |
| 430 | }; |
| 431 | |
| 432 | static struct regulator_init_data sdp4430_vana = { |
| 433 | .constraints = { |
| 434 | .min_uV = 2100000, |
| 435 | .max_uV = 2100000, |
| 436 | .apply_uV = true, |
| 437 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 438 | | REGULATOR_MODE_STANDBY, |
| 439 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| 440 | | REGULATOR_CHANGE_STATUS, |
| 441 | }, |
| 442 | }; |
| 443 | |
| 444 | static struct regulator_init_data sdp4430_vcxio = { |
| 445 | .constraints = { |
| 446 | .min_uV = 1800000, |
| 447 | .max_uV = 1800000, |
| 448 | .apply_uV = true, |
| 449 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 450 | | REGULATOR_MODE_STANDBY, |
| 451 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| 452 | | REGULATOR_CHANGE_STATUS, |
| 453 | }, |
| 454 | }; |
| 455 | |
| 456 | static struct regulator_init_data sdp4430_vdac = { |
| 457 | .constraints = { |
| 458 | .min_uV = 1800000, |
| 459 | .max_uV = 1800000, |
| 460 | .apply_uV = true, |
| 461 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 462 | | REGULATOR_MODE_STANDBY, |
| 463 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| 464 | | REGULATOR_CHANGE_STATUS, |
| 465 | }, |
| 466 | }; |
| 467 | |
| 468 | static struct regulator_init_data sdp4430_vusb = { |
| 469 | .constraints = { |
| 470 | .min_uV = 3300000, |
| 471 | .max_uV = 3300000, |
| 472 | .apply_uV = true, |
| 473 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 474 | | REGULATOR_MODE_STANDBY, |
| 475 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| 476 | | REGULATOR_CHANGE_STATUS, |
| 477 | }, |
| 478 | }; |
| 479 | |
| 480 | static struct twl4030_platform_data sdp4430_twldata = { |
| 481 | .irq_base = TWL6030_IRQ_BASE, |
| 482 | .irq_end = TWL6030_IRQ_END, |
| 483 | |
| 484 | /* Regulators */ |
| 485 | .vmmc = &sdp4430_vmmc, |
| 486 | .vpp = &sdp4430_vpp, |
| 487 | .vusim = &sdp4430_vusim, |
| 488 | .vana = &sdp4430_vana, |
| 489 | .vcxio = &sdp4430_vcxio, |
| 490 | .vdac = &sdp4430_vdac, |
| 491 | .vusb = &sdp4430_vusb, |
| 492 | .vaux1 = &sdp4430_vaux1, |
| 493 | .vaux2 = &sdp4430_vaux2, |
| 494 | .vaux3 = &sdp4430_vaux3, |
Hema HK | e70357e3 | 2010-12-10 18:09:52 +0530 | [diff] [blame] | 495 | .usb = &omap4_usbphy_data |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 496 | }; |
| 497 | |
| 498 | static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = { |
| 499 | { |
| 500 | I2C_BOARD_INFO("twl6030", 0x48), |
| 501 | .flags = I2C_CLIENT_WAKE, |
| 502 | .irq = OMAP44XX_IRQ_SYS_1N, |
| 503 | .platform_data = &sdp4430_twldata, |
| 504 | }, |
| 505 | }; |
Shubhrajyoti Datta | 83078f9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 506 | static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = { |
| 507 | { |
| 508 | I2C_BOARD_INFO("tmp105", 0x48), |
| 509 | }, |
Hemanth V | d048aca | 2010-12-17 18:15:08 -0800 | [diff] [blame] | 510 | { |
| 511 | I2C_BOARD_INFO("bh1780", 0x29), |
| 512 | }, |
Shubhrajyoti Datta | 83078f9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 513 | }; |
Shubhrajyoti Datta | 0df891b | 2010-09-23 18:22:47 -0700 | [diff] [blame] | 514 | static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = { |
| 515 | { |
| 516 | I2C_BOARD_INFO("hmc5843", 0x1e), |
| 517 | }, |
| 518 | }; |
Santosh Shilimkar | baeb73e | 2010-05-12 08:27:29 +0000 | [diff] [blame] | 519 | static int __init omap4_i2c_init(void) |
| 520 | { |
| 521 | /* |
| 522 | * Phoenix Audio IC needs I2C1 to |
| 523 | * start with 400 KHz or less |
| 524 | */ |
Balaji T K | 6e30a7d | 2010-05-12 08:27:30 +0000 | [diff] [blame] | 525 | omap_register_i2c_bus(1, 400, sdp4430_i2c_boardinfo, |
| 526 | ARRAY_SIZE(sdp4430_i2c_boardinfo)); |
Santosh Shilimkar | baeb73e | 2010-05-12 08:27:29 +0000 | [diff] [blame] | 527 | omap_register_i2c_bus(2, 400, NULL, 0); |
Shubhrajyoti Datta | 83078f9 | 2010-08-02 13:18:04 +0300 | [diff] [blame] | 528 | omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo, |
| 529 | ARRAY_SIZE(sdp4430_i2c_3_boardinfo)); |
Shubhrajyoti Datta | 0df891b | 2010-09-23 18:22:47 -0700 | [diff] [blame] | 530 | omap_register_i2c_bus(4, 400, sdp4430_i2c_4_boardinfo, |
| 531 | ARRAY_SIZE(sdp4430_i2c_4_boardinfo)); |
Santosh Shilimkar | baeb73e | 2010-05-12 08:27:29 +0000 | [diff] [blame] | 532 | return 0; |
| 533 | } |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 534 | |
| 535 | static void __init omap_sfh7741prox_init(void) |
| 536 | { |
| 537 | int error; |
| 538 | |
| 539 | error = gpio_request(OMAP4_SFH7741_ENABLE_GPIO, "sfh7741"); |
| 540 | if (error < 0) { |
| 541 | pr_err("%s:failed to request GPIO %d, error %d\n", |
| 542 | __func__, OMAP4_SFH7741_ENABLE_GPIO, error); |
| 543 | return; |
| 544 | } |
| 545 | |
| 546 | error = gpio_direction_output(OMAP4_SFH7741_ENABLE_GPIO , 0); |
| 547 | if (error < 0) { |
| 548 | pr_err("%s: GPIO configuration failed: GPIO %d,error %d\n", |
| 549 | __func__, OMAP4_SFH7741_ENABLE_GPIO, error); |
| 550 | gpio_free(OMAP4_SFH7741_ENABLE_GPIO); |
| 551 | } |
| 552 | } |
| 553 | |
Benoit Cousson | fb6bf63 | 2010-08-10 17:43:15 +0200 | [diff] [blame] | 554 | #ifdef CONFIG_OMAP_MUX |
| 555 | static struct omap_board_mux board_mux[] __initdata = { |
Tony Lindgren | 7d4ca85 | 2011-01-11 15:31:45 -0800 | [diff] [blame] | 556 | OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), |
Benoit Cousson | fb6bf63 | 2010-08-10 17:43:15 +0200 | [diff] [blame] | 557 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
| 558 | }; |
| 559 | #else |
| 560 | #define board_mux NULL |
| 561 | #endif |
| 562 | |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 563 | static void __init omap_4430sdp_init(void) |
| 564 | { |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 565 | int status; |
Benoit Cousson | 6fea7b0 | 2010-09-27 10:50:33 +0200 | [diff] [blame] | 566 | int package = OMAP_PACKAGE_CBS; |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 567 | |
Benoit Cousson | 6fea7b0 | 2010-09-27 10:50:33 +0200 | [diff] [blame] | 568 | if (omap_rev() == OMAP4430_REV_ES1_0) |
| 569 | package = OMAP_PACKAGE_CBL; |
| 570 | omap4_mux_init(board_mux, package); |
| 571 | |
Santosh Shilimkar | baeb73e | 2010-05-12 08:27:29 +0000 | [diff] [blame] | 572 | omap4_i2c_init(); |
Shubhrajyoti Datta | 94ce7a6 | 2010-09-23 18:22:49 -0700 | [diff] [blame] | 573 | omap_sfh7741prox_init(); |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 574 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 575 | omap_serial_init(); |
kishore kadiyala | 717c1fb | 2010-05-15 18:21:06 +0000 | [diff] [blame] | 576 | omap4_twl6030_hsmmc_init(mmc); |
Keshava Munegowda | 6aa85a5 | 2010-11-21 23:23:42 +0530 | [diff] [blame] | 577 | |
| 578 | /* Power on the ULPI PHY */ |
Tony Lindgren | 7d4ca85 | 2011-01-11 15:31:45 -0800 | [diff] [blame] | 579 | status = gpio_request(OMAP4SDP_MDM_PWR_EN_GPIO, "USBB1 PHY VMDM_3V3"); |
| 580 | if (status) |
| 581 | pr_err("%s: Could not get USBB1 PHY GPIO\n", __func__); |
| 582 | else |
Keshava Munegowda | 6aa85a5 | 2010-11-21 23:23:42 +0530 | [diff] [blame] | 583 | gpio_direction_output(OMAP4SDP_MDM_PWR_EN_GPIO, 1); |
Tony Lindgren | 7d4ca85 | 2011-01-11 15:31:45 -0800 | [diff] [blame] | 584 | |
Keshava Munegowda | 6aa85a5 | 2010-11-21 23:23:42 +0530 | [diff] [blame] | 585 | usb_ehci_init(&ehci_pdata); |
Felipe Balbi | 4696084 | 2010-12-07 09:57:59 +0200 | [diff] [blame] | 586 | usb_musb_init(&musb_board_data); |
Abraham Arce | b2aa5e5 | 2010-05-14 12:05:26 -0700 | [diff] [blame] | 587 | |
| 588 | status = omap_ethernet_init(); |
| 589 | if (status) { |
| 590 | pr_err("Ethernet initialization failed: %d\n", status); |
| 591 | } else { |
| 592 | sdp4430_spi_board_info[0].irq = gpio_to_irq(ETH_KS8851_IRQ); |
| 593 | spi_register_board_info(sdp4430_spi_board_info, |
| 594 | ARRAY_SIZE(sdp4430_spi_board_info)); |
| 595 | } |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 596 | } |
| 597 | |
| 598 | static void __init omap_4430sdp_map_io(void) |
| 599 | { |
| 600 | omap2_set_globals_443x(); |
Tony Lindgren | 6fbd55d | 2010-02-12 12:26:47 -0800 | [diff] [blame] | 601 | omap44xx_map_common_io(); |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 602 | } |
| 603 | |
| 604 | MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") |
| 605 | /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */ |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 606 | .boot_params = 0x80000100, |
Russell King | 71ee7da | 2010-05-23 10:18:16 +0100 | [diff] [blame] | 607 | .reserve = omap_reserve, |
Russell King - ARM Linux | 3dc3bad | 2011-02-14 15:40:20 -0800 | [diff] [blame^] | 608 | .map_io = omap_4430sdp_map_io, |
| 609 | .init_early = omap_4430sdp_init_early, |
| 610 | .init_irq = gic_init_irq, |
Santosh Shilimkar | 46ba0ab | 2009-05-28 14:16:05 -0700 | [diff] [blame] | 611 | .init_machine = omap_4430sdp_init, |
| 612 | .timer = &omap_timer, |
| 613 | MACHINE_END |