Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 1 | /* |
| 2 | * board-overo.c (Gumstix Overo) |
| 3 | * |
| 4 | * Initial code: Steve Sakoman <steve@sakoman.com> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * version 2 as published by the Free Software Foundation. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
| 18 | * 02110-1301 USA |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | #include <linux/clk.h> |
| 23 | #include <linux/delay.h> |
| 24 | #include <linux/err.h> |
| 25 | #include <linux/init.h> |
| 26 | #include <linux/io.h> |
| 27 | #include <linux/kernel.h> |
| 28 | #include <linux/platform_device.h> |
Santosh Shilimkar | b07682b | 2009-12-13 20:05:51 +0100 | [diff] [blame] | 29 | #include <linux/i2c/twl.h> |
David Brownell | bb3b9d8 | 2009-05-28 14:04:03 -0700 | [diff] [blame] | 30 | #include <linux/regulator/machine.h> |
Steve Sakoman | ca0a6a6 | 2011-03-05 10:12:26 -0600 | [diff] [blame] | 31 | #include <linux/regulator/fixed.h> |
Steve Sakoman | 7b12d7b | 2011-03-05 07:58:39 -0600 | [diff] [blame] | 32 | #include <linux/spi/spi.h> |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 33 | |
| 34 | #include <linux/mtd/mtd.h> |
| 35 | #include <linux/mtd/nand.h> |
| 36 | #include <linux/mtd/partitions.h> |
Sukumar Ghorai | 3a63833 | 2010-09-15 14:49:23 +0000 | [diff] [blame] | 37 | #include <linux/mmc/host.h> |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 38 | |
| 39 | #include <asm/mach-types.h> |
| 40 | #include <asm/mach/arch.h> |
| 41 | #include <asm/mach/flash.h> |
| 42 | #include <asm/mach/map.h> |
| 43 | |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 44 | #include <plat/board.h> |
| 45 | #include <plat/common.h> |
Steve Sakoman | 7b12d7b | 2011-03-05 07:58:39 -0600 | [diff] [blame] | 46 | #include <plat/display.h> |
| 47 | #include <plat/panel-generic-dpi.h> |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 48 | #include <mach/gpio.h> |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 49 | #include <plat/gpmc.h> |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 50 | #include <mach/hardware.h> |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 51 | #include <plat/nand.h> |
Steve Sakoman | 7b12d7b | 2011-03-05 07:58:39 -0600 | [diff] [blame] | 52 | #include <plat/mcspi.h> |
| 53 | #include <plat/mux.h> |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 54 | #include <plat/usb.h> |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 55 | |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 56 | #include "mux.h" |
Paul Walmsley | 2e12bd7 | 2009-05-28 14:03:59 -0700 | [diff] [blame] | 57 | #include "sdram-micron-mt46h32m32lf-6.h" |
Adrian Hunter | d02a900 | 2010-02-15 10:03:34 -0800 | [diff] [blame] | 58 | #include "hsmmc.h" |
Tony Lindgren | 90c62bf | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 59 | |
Tony Lindgren | 0d4d9ab | 2009-03-23 18:07:38 -0700 | [diff] [blame] | 60 | #define OVERO_GPIO_BT_XGATE 15 |
| 61 | #define OVERO_GPIO_W2W_NRESET 16 |
Kevin Hilman | 6fd210a | 2009-07-20 09:09:23 -0700 | [diff] [blame] | 62 | #define OVERO_GPIO_PENDOWN 114 |
Tony Lindgren | 0d4d9ab | 2009-03-23 18:07:38 -0700 | [diff] [blame] | 63 | #define OVERO_GPIO_BT_NRESET 164 |
| 64 | #define OVERO_GPIO_USBH_CPEN 168 |
| 65 | #define OVERO_GPIO_USBH_NRESET 183 |
| 66 | |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 67 | #define NAND_BLOCK_SIZE SZ_128K |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 68 | |
Steve Sakoman | 172ef27 | 2009-02-02 06:27:49 +0000 | [diff] [blame] | 69 | #define OVERO_SMSC911X_CS 5 |
| 70 | #define OVERO_SMSC911X_GPIO 176 |
Steve Sakoman | 5c9a29e | 2010-05-10 14:29:18 -0700 | [diff] [blame] | 71 | #define OVERO_SMSC911X2_CS 4 |
| 72 | #define OVERO_SMSC911X2_GPIO 65 |
Steve Sakoman | 172ef27 | 2009-02-02 06:27:49 +0000 | [diff] [blame] | 73 | |
Steve Sakoman | c6a8131 | 2009-03-23 18:38:16 -0700 | [diff] [blame] | 74 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ |
| 75 | defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) |
| 76 | |
Steve Sakoman | c6a8131 | 2009-03-23 18:38:16 -0700 | [diff] [blame] | 77 | #include <linux/spi/ads7846.h> |
| 78 | |
| 79 | static struct omap2_mcspi_device_config ads7846_mcspi_config = { |
| 80 | .turbo_mode = 0, |
| 81 | .single_channel = 1, /* 0: slave, 1: master */ |
| 82 | }; |
| 83 | |
| 84 | static int ads7846_get_pendown_state(void) |
| 85 | { |
| 86 | return !gpio_get_value(OVERO_GPIO_PENDOWN); |
| 87 | } |
| 88 | |
| 89 | static struct ads7846_platform_data ads7846_config = { |
| 90 | .x_max = 0x0fff, |
| 91 | .y_max = 0x0fff, |
| 92 | .x_plate_ohms = 180, |
| 93 | .pressure_max = 255, |
| 94 | .debounce_max = 10, |
| 95 | .debounce_tol = 3, |
| 96 | .debounce_rep = 1, |
| 97 | .get_pendown_state = ads7846_get_pendown_state, |
| 98 | .keep_vref_on = 1, |
| 99 | }; |
| 100 | |
Steve Sakoman | ca0a6a6 | 2011-03-05 10:12:26 -0600 | [diff] [blame] | 101 | /* fixed regulator for ads7846 */ |
| 102 | static struct regulator_consumer_supply ads7846_supply = |
| 103 | REGULATOR_SUPPLY("vcc", "spi1.0"); |
| 104 | |
| 105 | static struct regulator_init_data vads7846_regulator = { |
| 106 | .constraints = { |
| 107 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 108 | }, |
| 109 | .num_consumer_supplies = 1, |
| 110 | .consumer_supplies = &ads7846_supply, |
| 111 | }; |
| 112 | |
| 113 | static struct fixed_voltage_config vads7846 = { |
| 114 | .supply_name = "vads7846", |
| 115 | .microvolts = 3300000, /* 3.3V */ |
| 116 | .gpio = -EINVAL, |
| 117 | .startup_delay = 0, |
| 118 | .init_data = &vads7846_regulator, |
| 119 | }; |
| 120 | |
| 121 | static struct platform_device vads7846_device = { |
| 122 | .name = "reg-fixed-voltage", |
| 123 | .id = 1, |
| 124 | .dev = { |
| 125 | .platform_data = &vads7846, |
| 126 | }, |
Steve Sakoman | c6a8131 | 2009-03-23 18:38:16 -0700 | [diff] [blame] | 127 | }; |
| 128 | |
| 129 | static void __init overo_ads7846_init(void) |
| 130 | { |
| 131 | if ((gpio_request(OVERO_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) && |
| 132 | (gpio_direction_input(OVERO_GPIO_PENDOWN) == 0)) { |
| 133 | gpio_export(OVERO_GPIO_PENDOWN, 0); |
| 134 | } else { |
| 135 | printk(KERN_ERR "could not obtain gpio for ADS7846_PENDOWN\n"); |
| 136 | return; |
| 137 | } |
| 138 | |
Steve Sakoman | ca0a6a6 | 2011-03-05 10:12:26 -0600 | [diff] [blame] | 139 | platform_device_register(&vads7846_device); |
Steve Sakoman | c6a8131 | 2009-03-23 18:38:16 -0700 | [diff] [blame] | 140 | } |
| 141 | |
| 142 | #else |
| 143 | static inline void __init overo_ads7846_init(void) { return; } |
| 144 | #endif |
| 145 | |
Steve Sakoman | 172ef27 | 2009-02-02 06:27:49 +0000 | [diff] [blame] | 146 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
| 147 | |
| 148 | #include <linux/smsc911x.h> |
| 149 | |
| 150 | static struct resource overo_smsc911x_resources[] = { |
| 151 | { |
| 152 | .name = "smsc911x-memory", |
| 153 | .flags = IORESOURCE_MEM, |
| 154 | }, |
| 155 | { |
| 156 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
| 157 | }, |
| 158 | }; |
| 159 | |
Steve Sakoman | 5c9a29e | 2010-05-10 14:29:18 -0700 | [diff] [blame] | 160 | static struct resource overo_smsc911x2_resources[] = { |
| 161 | { |
| 162 | .name = "smsc911x2-memory", |
| 163 | .flags = IORESOURCE_MEM, |
| 164 | }, |
| 165 | { |
| 166 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
| 167 | }, |
| 168 | }; |
| 169 | |
Steve Sakoman | 172ef27 | 2009-02-02 06:27:49 +0000 | [diff] [blame] | 170 | static struct smsc911x_platform_config overo_smsc911x_config = { |
| 171 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, |
| 172 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, |
| 173 | .flags = SMSC911X_USE_32BIT , |
| 174 | .phy_interface = PHY_INTERFACE_MODE_MII, |
| 175 | }; |
| 176 | |
| 177 | static struct platform_device overo_smsc911x_device = { |
| 178 | .name = "smsc911x", |
Steve Sakoman | 5c9a29e | 2010-05-10 14:29:18 -0700 | [diff] [blame] | 179 | .id = 0, |
Steve Sakoman | 172ef27 | 2009-02-02 06:27:49 +0000 | [diff] [blame] | 180 | .num_resources = ARRAY_SIZE(overo_smsc911x_resources), |
Sergio Aguirre | 5032902 | 2009-08-10 14:49:50 +0300 | [diff] [blame] | 181 | .resource = overo_smsc911x_resources, |
Steve Sakoman | 172ef27 | 2009-02-02 06:27:49 +0000 | [diff] [blame] | 182 | .dev = { |
| 183 | .platform_data = &overo_smsc911x_config, |
| 184 | }, |
| 185 | }; |
| 186 | |
Steve Sakoman | a5ba7ae | 2010-08-02 14:21:39 +0300 | [diff] [blame] | 187 | static struct platform_device overo_smsc911x2_device = { |
| 188 | .name = "smsc911x", |
| 189 | .id = 1, |
| 190 | .num_resources = ARRAY_SIZE(overo_smsc911x2_resources), |
| 191 | .resource = overo_smsc911x2_resources, |
| 192 | .dev = { |
| 193 | .platform_data = &overo_smsc911x_config, |
| 194 | }, |
| 195 | }; |
| 196 | |
| 197 | static struct platform_device *smsc911x_devices[] = { |
| 198 | &overo_smsc911x_device, |
| 199 | &overo_smsc911x2_device, |
| 200 | }; |
| 201 | |
Steve Sakoman | 172ef27 | 2009-02-02 06:27:49 +0000 | [diff] [blame] | 202 | static inline void __init overo_init_smsc911x(void) |
| 203 | { |
Steve Sakoman | a5ba7ae | 2010-08-02 14:21:39 +0300 | [diff] [blame] | 204 | unsigned long cs_mem_base, cs_mem_base2; |
| 205 | |
| 206 | /* set up first smsc911x chip */ |
Steve Sakoman | 172ef27 | 2009-02-02 06:27:49 +0000 | [diff] [blame] | 207 | |
| 208 | if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) { |
| 209 | printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n"); |
| 210 | return; |
| 211 | } |
| 212 | |
| 213 | overo_smsc911x_resources[0].start = cs_mem_base + 0x0; |
| 214 | overo_smsc911x_resources[0].end = cs_mem_base + 0xff; |
| 215 | |
| 216 | if ((gpio_request(OVERO_SMSC911X_GPIO, "SMSC911X IRQ") == 0) && |
| 217 | (gpio_direction_input(OVERO_SMSC911X_GPIO) == 0)) { |
| 218 | gpio_export(OVERO_SMSC911X_GPIO, 0); |
| 219 | } else { |
| 220 | printk(KERN_ERR "could not obtain gpio for SMSC911X IRQ\n"); |
| 221 | return; |
| 222 | } |
| 223 | |
| 224 | overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO); |
| 225 | overo_smsc911x_resources[1].end = 0; |
| 226 | |
Steve Sakoman | a5ba7ae | 2010-08-02 14:21:39 +0300 | [diff] [blame] | 227 | /* set up second smsc911x chip */ |
| 228 | |
| 229 | if (gpmc_cs_request(OVERO_SMSC911X2_CS, SZ_16M, &cs_mem_base2) < 0) { |
| 230 | printk(KERN_ERR "Failed request for GPMC mem for smsc911x2\n"); |
| 231 | return; |
| 232 | } |
| 233 | |
| 234 | overo_smsc911x2_resources[0].start = cs_mem_base2 + 0x0; |
| 235 | overo_smsc911x2_resources[0].end = cs_mem_base2 + 0xff; |
| 236 | |
| 237 | if ((gpio_request(OVERO_SMSC911X2_GPIO, "SMSC911X2 IRQ") == 0) && |
| 238 | (gpio_direction_input(OVERO_SMSC911X2_GPIO) == 0)) { |
| 239 | gpio_export(OVERO_SMSC911X2_GPIO, 0); |
| 240 | } else { |
| 241 | printk(KERN_ERR "could not obtain gpio for SMSC911X2 IRQ\n"); |
| 242 | return; |
| 243 | } |
| 244 | |
| 245 | overo_smsc911x2_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X2_GPIO); |
| 246 | overo_smsc911x2_resources[1].end = 0; |
| 247 | |
| 248 | platform_add_devices(smsc911x_devices, ARRAY_SIZE(smsc911x_devices)); |
Steve Sakoman | 172ef27 | 2009-02-02 06:27:49 +0000 | [diff] [blame] | 249 | } |
| 250 | |
| 251 | #else |
| 252 | static inline void __init overo_init_smsc911x(void) { return; } |
| 253 | #endif |
| 254 | |
Steve Sakoman | 7b12d7b | 2011-03-05 07:58:39 -0600 | [diff] [blame] | 255 | /* DSS */ |
| 256 | static int lcd_enabled; |
| 257 | static int dvi_enabled; |
| 258 | |
| 259 | #define OVERO_GPIO_LCD_EN 144 |
| 260 | #define OVERO_GPIO_LCD_BL 145 |
| 261 | |
| 262 | static void __init overo_display_init(void) |
| 263 | { |
| 264 | if ((gpio_request(OVERO_GPIO_LCD_EN, "OVERO_GPIO_LCD_EN") == 0) && |
| 265 | (gpio_direction_output(OVERO_GPIO_LCD_EN, 1) == 0)) |
| 266 | gpio_export(OVERO_GPIO_LCD_EN, 0); |
| 267 | else |
| 268 | printk(KERN_ERR "could not obtain gpio for " |
| 269 | "OVERO_GPIO_LCD_EN\n"); |
| 270 | |
| 271 | if ((gpio_request(OVERO_GPIO_LCD_BL, "OVERO_GPIO_LCD_BL") == 0) && |
| 272 | (gpio_direction_output(OVERO_GPIO_LCD_BL, 1) == 0)) |
| 273 | gpio_export(OVERO_GPIO_LCD_BL, 0); |
| 274 | else |
| 275 | printk(KERN_ERR "could not obtain gpio for " |
| 276 | "OVERO_GPIO_LCD_BL\n"); |
| 277 | } |
| 278 | |
| 279 | static int overo_panel_enable_dvi(struct omap_dss_device *dssdev) |
| 280 | { |
| 281 | if (lcd_enabled) { |
| 282 | printk(KERN_ERR "cannot enable DVI, LCD is enabled\n"); |
| 283 | return -EINVAL; |
| 284 | } |
| 285 | dvi_enabled = 1; |
| 286 | |
| 287 | return 0; |
| 288 | } |
| 289 | |
| 290 | static void overo_panel_disable_dvi(struct omap_dss_device *dssdev) |
| 291 | { |
| 292 | dvi_enabled = 0; |
| 293 | } |
| 294 | |
| 295 | static struct panel_generic_dpi_data dvi_panel = { |
| 296 | .name = "generic", |
| 297 | .platform_enable = overo_panel_enable_dvi, |
| 298 | .platform_disable = overo_panel_disable_dvi, |
| 299 | }; |
| 300 | |
| 301 | static struct omap_dss_device overo_dvi_device = { |
| 302 | .name = "dvi", |
| 303 | .type = OMAP_DISPLAY_TYPE_DPI, |
| 304 | .driver_name = "generic_dpi_panel", |
| 305 | .data = &dvi_panel, |
| 306 | .phy.dpi.data_lines = 24, |
| 307 | }; |
| 308 | |
| 309 | static struct omap_dss_device overo_tv_device = { |
| 310 | .name = "tv", |
| 311 | .driver_name = "venc", |
| 312 | .type = OMAP_DISPLAY_TYPE_VENC, |
| 313 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, |
| 314 | }; |
| 315 | |
| 316 | static int overo_panel_enable_lcd(struct omap_dss_device *dssdev) |
| 317 | { |
| 318 | if (dvi_enabled) { |
| 319 | printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); |
| 320 | return -EINVAL; |
| 321 | } |
| 322 | |
| 323 | gpio_set_value(OVERO_GPIO_LCD_EN, 1); |
| 324 | gpio_set_value(OVERO_GPIO_LCD_BL, 1); |
| 325 | lcd_enabled = 1; |
| 326 | return 0; |
| 327 | } |
| 328 | |
| 329 | static void overo_panel_disable_lcd(struct omap_dss_device *dssdev) |
| 330 | { |
| 331 | gpio_set_value(OVERO_GPIO_LCD_EN, 0); |
| 332 | gpio_set_value(OVERO_GPIO_LCD_BL, 0); |
| 333 | lcd_enabled = 0; |
| 334 | } |
| 335 | |
| 336 | static struct panel_generic_dpi_data lcd43_panel = { |
| 337 | .name = "samsung_lte430wq_f0c", |
| 338 | .platform_enable = overo_panel_enable_lcd, |
| 339 | .platform_disable = overo_panel_disable_lcd, |
| 340 | }; |
| 341 | |
| 342 | static struct omap_dss_device overo_lcd43_device = { |
| 343 | .name = "lcd43", |
| 344 | .type = OMAP_DISPLAY_TYPE_DPI, |
| 345 | .driver_name = "generic_dpi_panel", |
| 346 | .data = &lcd43_panel, |
| 347 | .phy.dpi.data_lines = 24, |
| 348 | }; |
| 349 | |
| 350 | #if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \ |
| 351 | defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE) |
| 352 | static struct omap_dss_device overo_lcd35_device = { |
| 353 | .type = OMAP_DISPLAY_TYPE_DPI, |
| 354 | .name = "lcd35", |
| 355 | .driver_name = "lgphilips_lb035q02_panel", |
| 356 | .phy.dpi.data_lines = 24, |
| 357 | .platform_enable = overo_panel_enable_lcd, |
| 358 | .platform_disable = overo_panel_disable_lcd, |
| 359 | }; |
| 360 | #endif |
| 361 | |
| 362 | static struct omap_dss_device *overo_dss_devices[] = { |
| 363 | &overo_dvi_device, |
| 364 | &overo_tv_device, |
| 365 | #if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \ |
| 366 | defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE) |
| 367 | &overo_lcd35_device, |
| 368 | #endif |
| 369 | &overo_lcd43_device, |
| 370 | }; |
| 371 | |
| 372 | static struct omap_dss_board_info overo_dss_data = { |
| 373 | .num_devices = ARRAY_SIZE(overo_dss_devices), |
| 374 | .devices = overo_dss_devices, |
| 375 | .default_device = &overo_dvi_device, |
| 376 | }; |
| 377 | |
| 378 | static struct regulator_consumer_supply overo_vdda_dac_supply = |
| 379 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); |
| 380 | |
| 381 | static struct regulator_consumer_supply overo_vdds_dsi_supply[] = { |
| 382 | REGULATOR_SUPPLY("vdds_dsi", "omapdss"), |
| 383 | REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), |
| 384 | }; |
| 385 | |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 386 | static struct mtd_partition overo_nand_partitions[] = { |
| 387 | { |
| 388 | .name = "xloader", |
| 389 | .offset = 0, /* Offset = 0x00000 */ |
| 390 | .size = 4 * NAND_BLOCK_SIZE, |
| 391 | .mask_flags = MTD_WRITEABLE |
| 392 | }, |
| 393 | { |
| 394 | .name = "uboot", |
| 395 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ |
| 396 | .size = 14 * NAND_BLOCK_SIZE, |
| 397 | }, |
| 398 | { |
| 399 | .name = "uboot environment", |
| 400 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x240000 */ |
| 401 | .size = 2 * NAND_BLOCK_SIZE, |
| 402 | }, |
| 403 | { |
| 404 | .name = "linux", |
| 405 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */ |
| 406 | .size = 32 * NAND_BLOCK_SIZE, |
| 407 | }, |
| 408 | { |
| 409 | .name = "rootfs", |
| 410 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */ |
| 411 | .size = MTDPART_SIZ_FULL, |
| 412 | }, |
| 413 | }; |
| 414 | |
| 415 | static struct omap_nand_platform_data overo_nand_data = { |
| 416 | .parts = overo_nand_partitions, |
| 417 | .nr_parts = ARRAY_SIZE(overo_nand_partitions), |
| 418 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ |
| 419 | }; |
| 420 | |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 421 | static void __init overo_flash_init(void) |
| 422 | { |
| 423 | u8 cs = 0; |
| 424 | u8 nandcs = GPMC_CS_NUM + 1; |
| 425 | |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 426 | /* find out the chip-select on which NAND exists */ |
| 427 | while (cs < GPMC_CS_NUM) { |
| 428 | u32 ret = 0; |
| 429 | ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); |
| 430 | |
| 431 | if ((ret & 0xC00) == 0x800) { |
| 432 | printk(KERN_INFO "Found NAND on CS%d\n", cs); |
| 433 | if (nandcs > GPMC_CS_NUM) |
| 434 | nandcs = cs; |
| 435 | } |
| 436 | cs++; |
| 437 | } |
| 438 | |
| 439 | if (nandcs > GPMC_CS_NUM) { |
| 440 | printk(KERN_INFO "NAND: Unable to find configuration " |
| 441 | "in GPMC\n "); |
| 442 | return; |
| 443 | } |
| 444 | |
| 445 | if (nandcs < GPMC_CS_NUM) { |
| 446 | overo_nand_data.cs = nandcs; |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 447 | |
| 448 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); |
Sukumar Ghorai | f450d86 | 2010-07-09 09:14:46 +0000 | [diff] [blame] | 449 | if (gpmc_nand_init(&overo_nand_data) < 0) |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 450 | printk(KERN_ERR "Unable to register NAND device\n"); |
| 451 | } |
| 452 | } |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 453 | |
Adrian Hunter | 68ff042 | 2010-02-15 10:03:34 -0800 | [diff] [blame] | 454 | static struct omap2_hsmmc_info mmc[] = { |
David Brownell | bb3b9d8 | 2009-05-28 14:04:03 -0700 | [diff] [blame] | 455 | { |
| 456 | .mmc = 1, |
Sukumar Ghorai | 3a63833 | 2010-09-15 14:49:23 +0000 | [diff] [blame] | 457 | .caps = MMC_CAP_4_BIT_DATA, |
David Brownell | bb3b9d8 | 2009-05-28 14:04:03 -0700 | [diff] [blame] | 458 | .gpio_cd = -EINVAL, |
| 459 | .gpio_wp = -EINVAL, |
| 460 | }, |
| 461 | { |
| 462 | .mmc = 2, |
Sukumar Ghorai | 3a63833 | 2010-09-15 14:49:23 +0000 | [diff] [blame] | 463 | .caps = MMC_CAP_4_BIT_DATA, |
David Brownell | bb3b9d8 | 2009-05-28 14:04:03 -0700 | [diff] [blame] | 464 | .gpio_cd = -EINVAL, |
| 465 | .gpio_wp = -EINVAL, |
| 466 | .transceiver = true, |
| 467 | .ocr_mask = 0x00100000, /* 3.3V */ |
| 468 | }, |
| 469 | {} /* Terminator */ |
| 470 | }; |
| 471 | |
| 472 | static struct regulator_consumer_supply overo_vmmc1_supply = { |
| 473 | .supply = "vmmc", |
| 474 | }; |
| 475 | |
Steve Sakoman | 7c94f68 | 2011-03-09 18:08:05 -0600 | [diff] [blame] | 476 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) |
| 477 | #include <linux/leds.h> |
| 478 | |
| 479 | static struct gpio_led gpio_leds[] = { |
| 480 | { |
| 481 | .name = "overo:red:gpio21", |
| 482 | .default_trigger = "heartbeat", |
| 483 | .gpio = 21, |
| 484 | .active_low = true, |
| 485 | }, |
| 486 | { |
| 487 | .name = "overo:blue:gpio22", |
| 488 | .default_trigger = "none", |
| 489 | .gpio = 22, |
| 490 | .active_low = true, |
| 491 | }, |
| 492 | { |
| 493 | .name = "overo:blue:COM", |
| 494 | .default_trigger = "mmc0", |
| 495 | .gpio = -EINVAL, /* gets replaced */ |
| 496 | .active_low = true, |
| 497 | }, |
| 498 | }; |
| 499 | |
| 500 | static struct gpio_led_platform_data gpio_leds_pdata = { |
| 501 | .leds = gpio_leds, |
| 502 | .num_leds = ARRAY_SIZE(gpio_leds), |
| 503 | }; |
| 504 | |
| 505 | static struct platform_device gpio_leds_device = { |
| 506 | .name = "leds-gpio", |
| 507 | .id = -1, |
| 508 | .dev = { |
| 509 | .platform_data = &gpio_leds_pdata, |
| 510 | }, |
| 511 | }; |
| 512 | |
| 513 | static void __init overo_init_led(void) |
| 514 | { |
| 515 | platform_device_register(&gpio_leds_device); |
| 516 | } |
| 517 | |
| 518 | #else |
| 519 | static inline void __init overo_init_led(void) { return; } |
| 520 | #endif |
| 521 | |
Steve Sakoman | cce18a9 | 2011-03-09 18:08:06 -0600 | [diff] [blame] | 522 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 523 | #include <linux/input.h> |
| 524 | #include <linux/gpio_keys.h> |
| 525 | |
| 526 | static struct gpio_keys_button gpio_buttons[] = { |
| 527 | { |
| 528 | .code = BTN_0, |
| 529 | .gpio = 23, |
| 530 | .desc = "button0", |
| 531 | .wakeup = 1, |
| 532 | }, |
| 533 | { |
| 534 | .code = BTN_1, |
| 535 | .gpio = 14, |
| 536 | .desc = "button1", |
| 537 | .wakeup = 1, |
| 538 | }, |
| 539 | }; |
| 540 | |
| 541 | static struct gpio_keys_platform_data gpio_keys_pdata = { |
| 542 | .buttons = gpio_buttons, |
| 543 | .nbuttons = ARRAY_SIZE(gpio_buttons), |
| 544 | }; |
| 545 | |
| 546 | static struct platform_device gpio_keys_device = { |
| 547 | .name = "gpio-keys", |
| 548 | .id = -1, |
| 549 | .dev = { |
| 550 | .platform_data = &gpio_keys_pdata, |
| 551 | }, |
| 552 | }; |
| 553 | |
| 554 | static void __init overo_init_keys(void) |
| 555 | { |
| 556 | platform_device_register(&gpio_keys_device); |
| 557 | } |
| 558 | |
| 559 | #else |
| 560 | static inline void __init overo_init_keys(void) { return; } |
| 561 | #endif |
| 562 | |
David Brownell | bb3b9d8 | 2009-05-28 14:04:03 -0700 | [diff] [blame] | 563 | static int overo_twl_gpio_setup(struct device *dev, |
| 564 | unsigned gpio, unsigned ngpio) |
| 565 | { |
Adrian Hunter | 68ff042 | 2010-02-15 10:03:34 -0800 | [diff] [blame] | 566 | omap2_hsmmc_init(mmc); |
David Brownell | bb3b9d8 | 2009-05-28 14:04:03 -0700 | [diff] [blame] | 567 | |
| 568 | overo_vmmc1_supply.dev = mmc[0].dev; |
| 569 | |
Steve Sakoman | 7c94f68 | 2011-03-09 18:08:05 -0600 | [diff] [blame] | 570 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) |
| 571 | /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ |
| 572 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; |
| 573 | #endif |
| 574 | |
David Brownell | bb3b9d8 | 2009-05-28 14:04:03 -0700 | [diff] [blame] | 575 | return 0; |
| 576 | } |
| 577 | |
Tony Lindgren | 90c62bf | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 578 | static struct twl4030_gpio_platform_data overo_gpio_data = { |
| 579 | .gpio_base = OMAP_MAX_GPIO_LINES, |
| 580 | .irq_base = TWL4030_GPIO_IRQ_BASE, |
| 581 | .irq_end = TWL4030_GPIO_IRQ_END, |
Steve Sakoman | 7c94f68 | 2011-03-09 18:08:05 -0600 | [diff] [blame] | 582 | .use_leds = true, |
David Brownell | bb3b9d8 | 2009-05-28 14:04:03 -0700 | [diff] [blame] | 583 | .setup = overo_twl_gpio_setup, |
Tony Lindgren | 90c62bf | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 584 | }; |
| 585 | |
David Brownell | bb3b9d8 | 2009-05-28 14:04:03 -0700 | [diff] [blame] | 586 | static struct twl4030_usb_data overo_usb_data = { |
| 587 | .usb_mode = T2_USB_MODE_ULPI, |
| 588 | }; |
| 589 | |
| 590 | static struct regulator_init_data overo_vmmc1 = { |
| 591 | .constraints = { |
| 592 | .min_uV = 1850000, |
| 593 | .max_uV = 3150000, |
| 594 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 595 | | REGULATOR_MODE_STANDBY, |
| 596 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 597 | | REGULATOR_CHANGE_MODE |
| 598 | | REGULATOR_CHANGE_STATUS, |
| 599 | }, |
| 600 | .num_consumer_supplies = 1, |
| 601 | .consumer_supplies = &overo_vmmc1_supply, |
| 602 | }; |
| 603 | |
Steve Sakoman | 7b12d7b | 2011-03-05 07:58:39 -0600 | [diff] [blame] | 604 | /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ |
| 605 | static struct regulator_init_data overo_vdac = { |
| 606 | .constraints = { |
| 607 | .min_uV = 1800000, |
| 608 | .max_uV = 1800000, |
| 609 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 610 | | REGULATOR_MODE_STANDBY, |
| 611 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| 612 | | REGULATOR_CHANGE_STATUS, |
| 613 | }, |
| 614 | .num_consumer_supplies = 1, |
| 615 | .consumer_supplies = &overo_vdda_dac_supply, |
| 616 | }; |
| 617 | |
| 618 | /* VPLL2 for digital video outputs */ |
| 619 | static struct regulator_init_data overo_vpll2 = { |
| 620 | .constraints = { |
| 621 | .name = "VDVI", |
| 622 | .min_uV = 1800000, |
| 623 | .max_uV = 1800000, |
| 624 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 625 | | REGULATOR_MODE_STANDBY, |
| 626 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| 627 | | REGULATOR_CHANGE_STATUS, |
| 628 | }, |
| 629 | .num_consumer_supplies = ARRAY_SIZE(overo_vdds_dsi_supply), |
| 630 | .consumer_supplies = overo_vdds_dsi_supply, |
| 631 | }; |
| 632 | |
Ilkka Koskinen | 6a58baf | 2011-03-02 13:24:05 +0000 | [diff] [blame] | 633 | static struct twl4030_codec_audio_data overo_audio_data; |
Peter Ujfalusi | e86fa0b | 2009-10-22 13:26:46 +0300 | [diff] [blame] | 634 | |
| 635 | static struct twl4030_codec_data overo_codec_data = { |
Peter Ujfalusi | 6df74ef | 2009-11-04 09:58:18 +0200 | [diff] [blame] | 636 | .audio_mclk = 26000000, |
Peter Ujfalusi | e86fa0b | 2009-10-22 13:26:46 +0300 | [diff] [blame] | 637 | .audio = &overo_audio_data, |
| 638 | }; |
| 639 | |
Tony Lindgren | 90c62bf | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 640 | static struct twl4030_platform_data overo_twldata = { |
| 641 | .irq_base = TWL4030_IRQ_BASE, |
| 642 | .irq_end = TWL4030_IRQ_END, |
| 643 | .gpio = &overo_gpio_data, |
David Brownell | bb3b9d8 | 2009-05-28 14:04:03 -0700 | [diff] [blame] | 644 | .usb = &overo_usb_data, |
Peter Ujfalusi | e86fa0b | 2009-10-22 13:26:46 +0300 | [diff] [blame] | 645 | .codec = &overo_codec_data, |
David Brownell | bb3b9d8 | 2009-05-28 14:04:03 -0700 | [diff] [blame] | 646 | .vmmc1 = &overo_vmmc1, |
Steve Sakoman | 7b12d7b | 2011-03-05 07:58:39 -0600 | [diff] [blame] | 647 | .vdac = &overo_vdac, |
| 648 | .vpll2 = &overo_vpll2, |
Tony Lindgren | 90c62bf | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 649 | }; |
| 650 | |
| 651 | static struct i2c_board_info __initdata overo_i2c_boardinfo[] = { |
| 652 | { |
David Brownell | bb3b9d8 | 2009-05-28 14:04:03 -0700 | [diff] [blame] | 653 | I2C_BOARD_INFO("tps65950", 0x48), |
Tony Lindgren | 90c62bf | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 654 | .flags = I2C_CLIENT_WAKE, |
| 655 | .irq = INT_34XX_SYS_NIRQ, |
| 656 | .platform_data = &overo_twldata, |
| 657 | }, |
| 658 | }; |
| 659 | |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 660 | static int __init overo_i2c_init(void) |
| 661 | { |
Tony Lindgren | 90c62bf | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 662 | omap_register_i2c_bus(1, 2600, overo_i2c_boardinfo, |
| 663 | ARRAY_SIZE(overo_i2c_boardinfo)); |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 664 | /* i2c2 pins are used for gpio */ |
| 665 | omap_register_i2c_bus(3, 400, NULL, 0); |
| 666 | return 0; |
| 667 | } |
| 668 | |
Steve Sakoman | 7b12d7b | 2011-03-05 07:58:39 -0600 | [diff] [blame] | 669 | static struct spi_board_info overo_spi_board_info[] __initdata = { |
| 670 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ |
| 671 | defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) |
| 672 | { |
| 673 | .modalias = "ads7846", |
| 674 | .bus_num = 1, |
| 675 | .chip_select = 0, |
| 676 | .max_speed_hz = 1500000, |
| 677 | .controller_data = &ads7846_mcspi_config, |
| 678 | .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN), |
| 679 | .platform_data = &ads7846_config, |
| 680 | }, |
| 681 | #endif |
| 682 | #if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \ |
| 683 | defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE) |
| 684 | { |
| 685 | .modalias = "lgphilips_lb035q02_panel-spi", |
| 686 | .bus_num = 1, |
| 687 | .chip_select = 1, |
| 688 | .max_speed_hz = 500000, |
| 689 | .mode = SPI_MODE_3, |
| 690 | }, |
| 691 | #endif |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 692 | }; |
| 693 | |
Steve Sakoman | 7b12d7b | 2011-03-05 07:58:39 -0600 | [diff] [blame] | 694 | static int __init overo_spi_init(void) |
| 695 | { |
| 696 | overo_ads7846_init(); |
| 697 | spi_register_board_info(overo_spi_board_info, |
| 698 | ARRAY_SIZE(overo_spi_board_info)); |
| 699 | return 0; |
| 700 | } |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 701 | |
Russell King - ARM Linux | 3dc3bad | 2011-02-14 15:40:20 -0800 | [diff] [blame] | 702 | static void __init overo_init_early(void) |
Paul Walmsley | b3c6df3 | 2009-09-03 20:14:02 +0300 | [diff] [blame] | 703 | { |
Paul Walmsley | 4805734 | 2010-12-21 15:25:10 -0700 | [diff] [blame] | 704 | omap2_init_common_infrastructure(); |
| 705 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, |
| 706 | mt46h32m32lf6_sdrc_params); |
Paul Walmsley | b3c6df3 | 2009-09-03 20:14:02 +0300 | [diff] [blame] | 707 | } |
| 708 | |
Keshava Munegowda | 181b250 | 2011-03-01 20:08:16 +0530 | [diff] [blame] | 709 | static const struct usbhs_omap_board_data usbhs_bdata __initconst = { |
| 710 | .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, |
| 711 | .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, |
| 712 | .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, |
Felipe Balbi | 58a5491 | 2009-11-22 10:11:01 -0800 | [diff] [blame] | 713 | .phy_reset = true, |
| 714 | .reset_gpio_port[0] = -EINVAL, |
| 715 | .reset_gpio_port[1] = OVERO_GPIO_USBH_NRESET, |
| 716 | .reset_gpio_port[2] = -EINVAL |
| 717 | }; |
| 718 | |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 719 | #ifdef CONFIG_OMAP_MUX |
| 720 | static struct omap_board_mux board_mux[] __initdata = { |
| 721 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
| 722 | }; |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 723 | #endif |
Felipe Balbi | 58a5491 | 2009-11-22 10:11:01 -0800 | [diff] [blame] | 724 | |
Maulik Mankad | 884b836 | 2010-02-17 14:09:30 -0800 | [diff] [blame] | 725 | static struct omap_musb_board_data musb_board_data = { |
| 726 | .interface_type = MUSB_INTERFACE_ULPI, |
| 727 | .mode = MUSB_OTG, |
| 728 | .power = 100, |
| 729 | }; |
| 730 | |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 731 | static void __init overo_init(void) |
| 732 | { |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 733 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 734 | overo_i2c_init(); |
Steve Sakoman | 7b12d7b | 2011-03-05 07:58:39 -0600 | [diff] [blame] | 735 | omap_display_init(&overo_dss_data); |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 736 | omap_serial_init(); |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 737 | overo_flash_init(); |
Maulik Mankad | 884b836 | 2010-02-17 14:09:30 -0800 | [diff] [blame] | 738 | usb_musb_init(&musb_board_data); |
Keshava Munegowda | 9e64bb1 | 2011-03-01 20:08:19 +0530 | [diff] [blame] | 739 | usbhs_init(&usbhs_bdata); |
Steve Sakoman | 7b12d7b | 2011-03-05 07:58:39 -0600 | [diff] [blame] | 740 | overo_spi_init(); |
Steve Sakoman | c6a8131 | 2009-03-23 18:38:16 -0700 | [diff] [blame] | 741 | overo_ads7846_init(); |
Steve Sakoman | 172ef27 | 2009-02-02 06:27:49 +0000 | [diff] [blame] | 742 | overo_init_smsc911x(); |
Steve Sakoman | 7b12d7b | 2011-03-05 07:58:39 -0600 | [diff] [blame] | 743 | overo_display_init(); |
Steve Sakoman | 7c94f68 | 2011-03-09 18:08:05 -0600 | [diff] [blame] | 744 | overo_init_led(); |
Steve Sakoman | cce18a9 | 2011-03-09 18:08:06 -0600 | [diff] [blame] | 745 | overo_init_keys(); |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 746 | |
Jean Pihet | 9fb9741 | 2009-07-24 19:43:25 -0600 | [diff] [blame] | 747 | /* Ensure SDRC pins are mux'd for self-refresh */ |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 748 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
| 749 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); |
Jean Pihet | 9fb9741 | 2009-07-24 19:43:25 -0600 | [diff] [blame] | 750 | |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 751 | if ((gpio_request(OVERO_GPIO_W2W_NRESET, |
| 752 | "OVERO_GPIO_W2W_NRESET") == 0) && |
| 753 | (gpio_direction_output(OVERO_GPIO_W2W_NRESET, 1) == 0)) { |
| 754 | gpio_export(OVERO_GPIO_W2W_NRESET, 0); |
| 755 | gpio_set_value(OVERO_GPIO_W2W_NRESET, 0); |
| 756 | udelay(10); |
| 757 | gpio_set_value(OVERO_GPIO_W2W_NRESET, 1); |
| 758 | } else { |
| 759 | printk(KERN_ERR "could not obtain gpio for " |
| 760 | "OVERO_GPIO_W2W_NRESET\n"); |
| 761 | } |
| 762 | |
| 763 | if ((gpio_request(OVERO_GPIO_BT_XGATE, "OVERO_GPIO_BT_XGATE") == 0) && |
| 764 | (gpio_direction_output(OVERO_GPIO_BT_XGATE, 0) == 0)) |
| 765 | gpio_export(OVERO_GPIO_BT_XGATE, 0); |
| 766 | else |
| 767 | printk(KERN_ERR "could not obtain gpio for OVERO_GPIO_BT_XGATE\n"); |
| 768 | |
| 769 | if ((gpio_request(OVERO_GPIO_BT_NRESET, "OVERO_GPIO_BT_NRESET") == 0) && |
| 770 | (gpio_direction_output(OVERO_GPIO_BT_NRESET, 1) == 0)) { |
| 771 | gpio_export(OVERO_GPIO_BT_NRESET, 0); |
| 772 | gpio_set_value(OVERO_GPIO_BT_NRESET, 0); |
| 773 | mdelay(6); |
| 774 | gpio_set_value(OVERO_GPIO_BT_NRESET, 1); |
| 775 | } else { |
| 776 | printk(KERN_ERR "could not obtain gpio for " |
| 777 | "OVERO_GPIO_BT_NRESET\n"); |
| 778 | } |
| 779 | |
| 780 | if ((gpio_request(OVERO_GPIO_USBH_CPEN, "OVERO_GPIO_USBH_CPEN") == 0) && |
| 781 | (gpio_direction_output(OVERO_GPIO_USBH_CPEN, 1) == 0)) |
| 782 | gpio_export(OVERO_GPIO_USBH_CPEN, 0); |
| 783 | else |
| 784 | printk(KERN_ERR "could not obtain gpio for " |
| 785 | "OVERO_GPIO_USBH_CPEN\n"); |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 786 | } |
| 787 | |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 788 | MACHINE_START(OVERO, "Gumstix Overo") |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 789 | .boot_params = 0x80000100, |
Russell King | 71ee7da | 2010-05-23 10:18:16 +0100 | [diff] [blame] | 790 | .reserve = omap_reserve, |
Russell King - ARM Linux | 3dc3bad | 2011-02-14 15:40:20 -0800 | [diff] [blame] | 791 | .map_io = omap3_map_io, |
| 792 | .init_early = overo_init_early, |
| 793 | .init_irq = omap_init_irq, |
Steve Sakoman | eba2645 | 2008-10-09 17:51:43 +0300 | [diff] [blame] | 794 | .init_machine = overo_init, |
| 795 | .timer = &omap_timer, |
| 796 | MACHINE_END |