Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'omap-for-v4.2/clean' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/cleanup

Merge "Clean-up for omaps for v4.2 merge window" from Tony Lindgren:

Drop more omap3 legacy board-*.c files for v4.2. This time we're
dropping the board files for beagle, overo and cm-t35.

The reason for dropping these now rather than later is that now
we can simply revert the patches in case of unexpected issues as
we are not dropping any platform data at this point.

This leaves us with only the following board-*.c files:

BOARD REASON NEEDED
board-ldp.c Still used in RMKs boot test system
board-omap3logic.c Getting a .dts file for v4.2
board-omap3pandora.c Got a .dts file for v4.1
board-rx51-*.c Needs /proc/atags support for user space

I'm hoping we can drop the remaining board-*.c for v4.3 merge
window, then keep the platform data around for one more merge
window in case of reverting needed, then drop the platform data
too for v4.4 if no issues needing reverting are found.

Also, few patches to clean-up the usage of Linux generic
macros:

- Use define for console loglevel

- Use const for struct irq_domain_ops

- Use PTR_ERR_OR_ZERO instead of PTR_RET

* tag 'omap-for-v4.2/clean' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
mach-omap2: Remove use of deprecated marco, PTR_RET in devices.c
ARM: OMAP2+: Remove calls to deprecacted marco,PTR_RET in the files,fb.c and pmu.c
ARM: OMAP2+: Constify irq_domain_ops
ARM: OMAP2+: use symbolic defines for console loglevels instead of numbers
ARM: OMAP2+: Remove legacy booting support for Beagleboards
ARM: OMAP2+: Remove legacy booting support for Overo
ARM: OMAP2+: Remove legacy booting support for cm-t35

+6 -1966
-22
arch/arm/mach-omap2/Kconfig
··· 171 171 depends on ARCH_OMAP2 && SOC_OMAP2420 172 172 default y if MACH_NOKIA_N8X0 173 173 174 - config MACH_OMAP3_BEAGLE 175 - bool "OMAP3 BEAGLE board" 176 - depends on ARCH_OMAP3 177 - default y 178 - select OMAP_PACKAGE_CBB 179 - 180 174 config MACH_OMAP_LDP 181 175 bool "OMAP3 LDP board" 182 176 depends on ARCH_OMAP3 ··· 196 202 Support for the LogicPD OMAP35x Torpedo Development kit 197 203 for full description please see the products webpage at 198 204 http://www.logicpd.com/products/development-kits/zoom-omap35x-torpedo-development-kit 199 - 200 - config MACH_OVERO 201 - bool "Gumstix Overo board" 202 - depends on ARCH_OMAP3 203 - default y 204 - select OMAP_PACKAGE_CBB 205 205 206 206 config MACH_OMAP3517EVM 207 207 bool "OMAP3517/ AM3517 EVM board" ··· 227 239 depends on ARCH_OMAP3 228 240 default y 229 241 select OMAP_PACKAGE_CBB 230 - 231 - config MACH_CM_T35 232 - bool "CompuLab CM-T35/CM-T3730 modules" 233 - depends on ARCH_OMAP3 234 - default y 235 - select MACH_CM_T3730 236 - select OMAP_PACKAGE_CUS 237 - 238 - config MACH_CM_T3730 239 - bool 240 242 241 243 config OMAP3_SDRC_AC_TIMING 242 244 bool "Enable SDRC AC timing register changes"
-3
arch/arm/mach-omap2/Makefile
··· 242 242 243 243 # Specific board support 244 244 obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o pdata-quirks.o 245 - obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o 246 245 obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o 247 246 obj-$(CONFIG_MACH_OMAP3530_LV_SOM) += board-omap3logic.o 248 247 obj-$(CONFIG_MACH_OMAP3_TORPEDO) += board-omap3logic.o 249 - obj-$(CONFIG_MACH_OVERO) += board-overo.o 250 248 obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o 251 249 obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o 252 250 obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o sdram-nokia.o 253 251 obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51-peripherals.o 254 252 obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51-video.o 255 - obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o 256 253 257 254 # Platform specific device init code 258 255
-769
arch/arm/mach-omap2/board-cm-t35.c
··· 1 - /* 2 - * CompuLab CM-T35/CM-T3730 modules support 3 - * 4 - * Copyright (C) 2009-2011 CompuLab, Ltd. 5 - * Authors: Mike Rapoport <mike@compulab.co.il> 6 - * Igor Grinberg <grinberg@compulab.co.il> 7 - * 8 - * This program is free software; you can redistribute it and/or 9 - * modify it under the terms of the GNU General Public License 10 - * version 2 as published by the Free Software Foundation. 11 - * 12 - * This program is distributed in the hope that it will be useful, but 13 - * WITHOUT ANY WARRANTY; without even the implied warranty of 14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 - * General Public License for more details. 16 - * 17 - */ 18 - 19 - #include <linux/clk-provider.h> 20 - #include <linux/clkdev.h> 21 - #include <linux/kernel.h> 22 - #include <linux/init.h> 23 - #include <linux/platform_device.h> 24 - #include <linux/input.h> 25 - #include <linux/input/matrix_keypad.h> 26 - #include <linux/delay.h> 27 - #include <linux/gpio.h> 28 - #include <linux/omap-gpmc.h> 29 - #include <linux/platform_data/gpio-omap.h> 30 - 31 - #include <linux/platform_data/at24.h> 32 - #include <linux/i2c/twl.h> 33 - #include <linux/regulator/fixed.h> 34 - #include <linux/regulator/machine.h> 35 - #include <linux/mmc/host.h> 36 - #include <linux/usb/phy.h> 37 - 38 - #include <linux/spi/spi.h> 39 - #include <linux/spi/tdo24m.h> 40 - 41 - #include <asm/mach-types.h> 42 - #include <asm/mach/arch.h> 43 - #include <asm/mach/map.h> 44 - 45 - #include <linux/platform_data/mtd-nand-omap2.h> 46 - #include <video/omapdss.h> 47 - #include <video/omap-panel-data.h> 48 - #include <linux/platform_data/spi-omap2-mcspi.h> 49 - 50 - #include "common.h" 51 - #include "mux.h" 52 - #include "sdram-micron-mt46h32m32lf-6.h" 53 - #include "hsmmc.h" 54 - #include "common-board-devices.h" 55 - 56 - #define CM_T35_GPIO_PENDOWN 57 57 - #define SB_T35_USB_HUB_RESET_GPIO 167 58 - 59 - #define CM_T35_SMSC911X_CS 5 60 - #define CM_T35_SMSC911X_GPIO 163 61 - #define SB_T35_SMSC911X_CS 4 62 - #define SB_T35_SMSC911X_GPIO 65 63 - 64 - #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 65 - #include <linux/smsc911x.h> 66 - #include "gpmc-smsc911x.h" 67 - 68 - static struct omap_smsc911x_platform_data cm_t35_smsc911x_cfg = { 69 - .id = 0, 70 - .cs = CM_T35_SMSC911X_CS, 71 - .gpio_irq = CM_T35_SMSC911X_GPIO, 72 - .gpio_reset = -EINVAL, 73 - .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS, 74 - }; 75 - 76 - static struct omap_smsc911x_platform_data sb_t35_smsc911x_cfg = { 77 - .id = 1, 78 - .cs = SB_T35_SMSC911X_CS, 79 - .gpio_irq = SB_T35_SMSC911X_GPIO, 80 - .gpio_reset = -EINVAL, 81 - .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS, 82 - }; 83 - 84 - static struct regulator_consumer_supply cm_t35_smsc911x_supplies[] = { 85 - REGULATOR_SUPPLY("vddvario", "smsc911x.0"), 86 - REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), 87 - }; 88 - 89 - static struct regulator_consumer_supply sb_t35_smsc911x_supplies[] = { 90 - REGULATOR_SUPPLY("vddvario", "smsc911x.1"), 91 - REGULATOR_SUPPLY("vdd33a", "smsc911x.1"), 92 - }; 93 - 94 - static void __init cm_t35_init_ethernet(void) 95 - { 96 - regulator_register_fixed(0, cm_t35_smsc911x_supplies, 97 - ARRAY_SIZE(cm_t35_smsc911x_supplies)); 98 - regulator_register_fixed(1, sb_t35_smsc911x_supplies, 99 - ARRAY_SIZE(sb_t35_smsc911x_supplies)); 100 - 101 - gpmc_smsc911x_init(&cm_t35_smsc911x_cfg); 102 - gpmc_smsc911x_init(&sb_t35_smsc911x_cfg); 103 - } 104 - #else 105 - static inline void __init cm_t35_init_ethernet(void) { return; } 106 - #endif 107 - 108 - #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) 109 - #include <linux/leds.h> 110 - 111 - static struct gpio_led cm_t35_leds[] = { 112 - [0] = { 113 - .gpio = 186, 114 - .name = "cm-t35:green", 115 - .default_trigger = "heartbeat", 116 - .active_low = 0, 117 - }, 118 - }; 119 - 120 - static struct gpio_led_platform_data cm_t35_led_pdata = { 121 - .num_leds = ARRAY_SIZE(cm_t35_leds), 122 - .leds = cm_t35_leds, 123 - }; 124 - 125 - static struct platform_device cm_t35_led_device = { 126 - .name = "leds-gpio", 127 - .id = -1, 128 - .dev = { 129 - .platform_data = &cm_t35_led_pdata, 130 - }, 131 - }; 132 - 133 - static void __init cm_t35_init_led(void) 134 - { 135 - platform_device_register(&cm_t35_led_device); 136 - } 137 - #else 138 - static inline void cm_t35_init_led(void) {} 139 - #endif 140 - 141 - #if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE) 142 - #include <linux/mtd/mtd.h> 143 - #include <linux/mtd/nand.h> 144 - #include <linux/mtd/partitions.h> 145 - 146 - static struct mtd_partition cm_t35_nand_partitions[] = { 147 - { 148 - .name = "xloader", 149 - .offset = 0, /* Offset = 0x00000 */ 150 - .size = 4 * NAND_BLOCK_SIZE, 151 - .mask_flags = MTD_WRITEABLE 152 - }, 153 - { 154 - .name = "uboot", 155 - .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ 156 - .size = 15 * NAND_BLOCK_SIZE, 157 - }, 158 - { 159 - .name = "uboot environment", 160 - .offset = MTDPART_OFS_APPEND, /* Offset = 0x260000 */ 161 - .size = 2 * NAND_BLOCK_SIZE, 162 - }, 163 - { 164 - .name = "linux", 165 - .offset = MTDPART_OFS_APPEND, /* Offset = 0x2A0000 */ 166 - .size = 32 * NAND_BLOCK_SIZE, 167 - }, 168 - { 169 - .name = "rootfs", 170 - .offset = MTDPART_OFS_APPEND, /* Offset = 0x6A0000 */ 171 - .size = MTDPART_SIZ_FULL, 172 - }, 173 - }; 174 - 175 - static struct omap_nand_platform_data cm_t35_nand_data = { 176 - .parts = cm_t35_nand_partitions, 177 - .nr_parts = ARRAY_SIZE(cm_t35_nand_partitions), 178 - .cs = 0, 179 - }; 180 - 181 - static void __init cm_t35_init_nand(void) 182 - { 183 - if (gpmc_nand_init(&cm_t35_nand_data, NULL) < 0) 184 - pr_err("CM-T35: Unable to register NAND device\n"); 185 - } 186 - #else 187 - static inline void cm_t35_init_nand(void) {} 188 - #endif 189 - 190 - #define CM_T35_LCD_EN_GPIO 157 191 - #define CM_T35_LCD_BL_GPIO 58 192 - #define CM_T35_DVI_EN_GPIO 54 193 - 194 - static const struct display_timing cm_t35_lcd_videomode = { 195 - .pixelclock = { 0, 26000000, 0 }, 196 - 197 - .hactive = { 0, 480, 0 }, 198 - .hfront_porch = { 0, 104, 0 }, 199 - .hback_porch = { 0, 8, 0 }, 200 - .hsync_len = { 0, 8, 0 }, 201 - 202 - .vactive = { 0, 640, 0 }, 203 - .vfront_porch = { 0, 4, 0 }, 204 - .vback_porch = { 0, 2, 0 }, 205 - .vsync_len = { 0, 2, 0 }, 206 - 207 - .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW | 208 - DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE, 209 - }; 210 - 211 - static struct panel_dpi_platform_data cm_t35_lcd_pdata = { 212 - .name = "lcd", 213 - .source = "dpi.0", 214 - 215 - .data_lines = 18, 216 - 217 - .display_timing = &cm_t35_lcd_videomode, 218 - 219 - .enable_gpio = -1, 220 - .backlight_gpio = CM_T35_LCD_BL_GPIO, 221 - }; 222 - 223 - static struct platform_device cm_t35_lcd_device = { 224 - .name = "panel-dpi", 225 - .id = 0, 226 - .dev.platform_data = &cm_t35_lcd_pdata, 227 - }; 228 - 229 - static struct connector_dvi_platform_data cm_t35_dvi_connector_pdata = { 230 - .name = "dvi", 231 - .source = "tfp410.0", 232 - .i2c_bus_num = -1, 233 - }; 234 - 235 - static struct platform_device cm_t35_dvi_connector_device = { 236 - .name = "connector-dvi", 237 - .id = 0, 238 - .dev.platform_data = &cm_t35_dvi_connector_pdata, 239 - }; 240 - 241 - static struct encoder_tfp410_platform_data cm_t35_tfp410_pdata = { 242 - .name = "tfp410.0", 243 - .source = "dpi.0", 244 - .data_lines = 24, 245 - .power_down_gpio = CM_T35_DVI_EN_GPIO, 246 - }; 247 - 248 - static struct platform_device cm_t35_tfp410_device = { 249 - .name = "tfp410", 250 - .id = 0, 251 - .dev.platform_data = &cm_t35_tfp410_pdata, 252 - }; 253 - 254 - static struct connector_atv_platform_data cm_t35_tv_pdata = { 255 - .name = "tv", 256 - .source = "venc.0", 257 - .connector_type = OMAP_DSS_VENC_TYPE_SVIDEO, 258 - .invert_polarity = false, 259 - }; 260 - 261 - static struct platform_device cm_t35_tv_connector_device = { 262 - .name = "connector-analog-tv", 263 - .id = 0, 264 - .dev.platform_data = &cm_t35_tv_pdata, 265 - }; 266 - 267 - static struct omap_dss_board_info cm_t35_dss_data = { 268 - .default_display_name = "dvi", 269 - }; 270 - 271 - static struct omap2_mcspi_device_config tdo24m_mcspi_config = { 272 - .turbo_mode = 0, 273 - }; 274 - 275 - static struct tdo24m_platform_data tdo24m_config = { 276 - .model = TDO35S, 277 - }; 278 - 279 - static struct spi_board_info cm_t35_lcd_spi_board_info[] __initdata = { 280 - { 281 - .modalias = "tdo24m", 282 - .bus_num = 4, 283 - .chip_select = 0, 284 - .max_speed_hz = 1000000, 285 - .controller_data = &tdo24m_mcspi_config, 286 - .platform_data = &tdo24m_config, 287 - }, 288 - }; 289 - 290 - static void __init cm_t35_init_display(void) 291 - { 292 - int err; 293 - 294 - spi_register_board_info(cm_t35_lcd_spi_board_info, 295 - ARRAY_SIZE(cm_t35_lcd_spi_board_info)); 296 - 297 - 298 - err = gpio_request_one(CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW, 299 - "lcd bl enable"); 300 - if (err) { 301 - pr_err("CM-T35: failed to request LCD EN GPIO\n"); 302 - return; 303 - } 304 - 305 - msleep(50); 306 - gpio_set_value(CM_T35_LCD_EN_GPIO, 1); 307 - 308 - err = omap_display_init(&cm_t35_dss_data); 309 - if (err) { 310 - pr_err("CM-T35: failed to register DSS device\n"); 311 - gpio_free(CM_T35_LCD_EN_GPIO); 312 - } 313 - 314 - platform_device_register(&cm_t35_tfp410_device); 315 - platform_device_register(&cm_t35_dvi_connector_device); 316 - platform_device_register(&cm_t35_lcd_device); 317 - platform_device_register(&cm_t35_tv_connector_device); 318 - } 319 - 320 - static struct regulator_consumer_supply cm_t35_vmmc1_supply[] = { 321 - REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), 322 - }; 323 - 324 - static struct regulator_consumer_supply cm_t35_vsim_supply[] = { 325 - REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), 326 - }; 327 - 328 - static struct regulator_consumer_supply cm_t35_vio_supplies[] = { 329 - REGULATOR_SUPPLY("vcc", "spi1.0"), 330 - REGULATOR_SUPPLY("vdds_dsi", "omapdss"), 331 - REGULATOR_SUPPLY("vdds_dsi", "omapdss_dpi.0"), 332 - REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"), 333 - }; 334 - 335 - /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ 336 - static struct regulator_init_data cm_t35_vmmc1 = { 337 - .constraints = { 338 - .min_uV = 1850000, 339 - .max_uV = 3150000, 340 - .valid_modes_mask = REGULATOR_MODE_NORMAL 341 - | REGULATOR_MODE_STANDBY, 342 - .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE 343 - | REGULATOR_CHANGE_MODE 344 - | REGULATOR_CHANGE_STATUS, 345 - }, 346 - .num_consumer_supplies = ARRAY_SIZE(cm_t35_vmmc1_supply), 347 - .consumer_supplies = cm_t35_vmmc1_supply, 348 - }; 349 - 350 - /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ 351 - static struct regulator_init_data cm_t35_vsim = { 352 - .constraints = { 353 - .min_uV = 1800000, 354 - .max_uV = 3000000, 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 - }, 361 - .num_consumer_supplies = ARRAY_SIZE(cm_t35_vsim_supply), 362 - .consumer_supplies = cm_t35_vsim_supply, 363 - }; 364 - 365 - static struct regulator_init_data cm_t35_vio = { 366 - .constraints = { 367 - .min_uV = 1800000, 368 - .max_uV = 1800000, 369 - .apply_uV = true, 370 - .valid_modes_mask = REGULATOR_MODE_NORMAL 371 - | REGULATOR_MODE_STANDBY, 372 - .valid_ops_mask = REGULATOR_CHANGE_MODE, 373 - }, 374 - .num_consumer_supplies = ARRAY_SIZE(cm_t35_vio_supplies), 375 - .consumer_supplies = cm_t35_vio_supplies, 376 - }; 377 - 378 - static uint32_t cm_t35_keymap[] = { 379 - KEY(0, 0, KEY_A), KEY(0, 1, KEY_B), KEY(0, 2, KEY_LEFT), 380 - KEY(1, 0, KEY_UP), KEY(1, 1, KEY_ENTER), KEY(1, 2, KEY_DOWN), 381 - KEY(2, 0, KEY_RIGHT), KEY(2, 1, KEY_C), KEY(2, 2, KEY_D), 382 - }; 383 - 384 - static struct matrix_keymap_data cm_t35_keymap_data = { 385 - .keymap = cm_t35_keymap, 386 - .keymap_size = ARRAY_SIZE(cm_t35_keymap), 387 - }; 388 - 389 - static struct twl4030_keypad_data cm_t35_kp_data = { 390 - .keymap_data = &cm_t35_keymap_data, 391 - .rows = 3, 392 - .cols = 3, 393 - .rep = 1, 394 - }; 395 - 396 - static struct omap2_hsmmc_info mmc[] = { 397 - { 398 - .mmc = 1, 399 - .caps = MMC_CAP_4_BIT_DATA, 400 - .gpio_cd = -EINVAL, 401 - .gpio_wp = -EINVAL, 402 - .deferred = true, 403 - }, 404 - { 405 - .mmc = 2, 406 - .caps = MMC_CAP_4_BIT_DATA, 407 - .transceiver = 1, 408 - .gpio_cd = -EINVAL, 409 - .gpio_wp = -EINVAL, 410 - .ocr_mask = 0x00100000, /* 3.3V */ 411 - }, 412 - {} /* Terminator */ 413 - }; 414 - 415 - static struct usbhs_phy_data phy_data[] __initdata = { 416 - { 417 - .port = 1, 418 - .reset_gpio = OMAP_MAX_GPIO_LINES + 6, 419 - .vcc_gpio = -EINVAL, 420 - }, 421 - { 422 - .port = 2, 423 - .reset_gpio = OMAP_MAX_GPIO_LINES + 7, 424 - .vcc_gpio = -EINVAL, 425 - }, 426 - }; 427 - 428 - static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 429 - .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 430 - .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 431 - }; 432 - 433 - static void __init cm_t35_init_usbh(void) 434 - { 435 - int err; 436 - 437 - err = gpio_request_one(SB_T35_USB_HUB_RESET_GPIO, 438 - GPIOF_OUT_INIT_LOW, "usb hub rst"); 439 - if (err) { 440 - pr_err("SB-T35: usb hub rst gpio request failed: %d\n", err); 441 - } else { 442 - udelay(10); 443 - gpio_set_value(SB_T35_USB_HUB_RESET_GPIO, 1); 444 - msleep(1); 445 - } 446 - 447 - usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data)); 448 - usbhs_init(&usbhs_bdata); 449 - } 450 - 451 - static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio, 452 - unsigned ngpio) 453 - { 454 - int wlan_rst = gpio + 2; 455 - 456 - if (gpio_request_one(wlan_rst, GPIOF_OUT_INIT_HIGH, "WLAN RST") == 0) { 457 - gpio_export(wlan_rst, 0); 458 - udelay(10); 459 - gpio_set_value_cansleep(wlan_rst, 0); 460 - udelay(10); 461 - gpio_set_value_cansleep(wlan_rst, 1); 462 - } else { 463 - pr_err("CM-T35: could not obtain gpio for WiFi reset\n"); 464 - } 465 - 466 - /* gpio + 0 is "mmc0_cd" (input/IRQ) */ 467 - mmc[0].gpio_cd = gpio + 0; 468 - omap_hsmmc_late_init(mmc); 469 - 470 - return 0; 471 - } 472 - 473 - static struct twl4030_gpio_platform_data cm_t35_gpio_data = { 474 - .setup = cm_t35_twl_gpio_setup, 475 - }; 476 - 477 - static struct twl4030_power_data cm_t35_power_data = { 478 - .use_poweroff = true, 479 - }; 480 - 481 - static struct twl4030_platform_data cm_t35_twldata = { 482 - /* platform_data for children goes here */ 483 - .keypad = &cm_t35_kp_data, 484 - .gpio = &cm_t35_gpio_data, 485 - .vmmc1 = &cm_t35_vmmc1, 486 - .vsim = &cm_t35_vsim, 487 - .vio = &cm_t35_vio, 488 - .power = &cm_t35_power_data, 489 - }; 490 - 491 - #if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) 492 - #include <media/omap3isp.h> 493 - #include "devices.h" 494 - 495 - static struct isp_platform_subdev cm_t35_isp_subdevs[] = { 496 - { 497 - .board_info = &(struct i2c_board_info){ 498 - I2C_BOARD_INFO("mt9t001", 0x5d) 499 - }, 500 - .i2c_adapter_id = 3, 501 - .bus = &(struct isp_bus_cfg){ 502 - .interface = ISP_INTERFACE_PARALLEL, 503 - .bus = { 504 - .parallel = { 505 - .clk_pol = 1, 506 - }, 507 - }, 508 - }, 509 - }, 510 - { 511 - .board_info = &(struct i2c_board_info){ 512 - I2C_BOARD_INFO("tvp5150", 0x5c), 513 - }, 514 - .i2c_adapter_id = 3, 515 - .bus = &(struct isp_bus_cfg){ 516 - .interface = ISP_INTERFACE_PARALLEL, 517 - .bus = { 518 - .parallel = { 519 - .clk_pol = 0, 520 - }, 521 - }, 522 - }, 523 - }, 524 - { 0 }, 525 - }; 526 - 527 - static struct isp_platform_data cm_t35_isp_pdata = { 528 - .subdevs = cm_t35_isp_subdevs, 529 - }; 530 - 531 - static struct regulator_consumer_supply cm_t35_camera_supplies[] = { 532 - REGULATOR_SUPPLY("vaa", "3-005d"), 533 - REGULATOR_SUPPLY("vdd", "3-005d"), 534 - }; 535 - 536 - static void __init cm_t35_init_camera(void) 537 - { 538 - struct clk *clk; 539 - 540 - clk = clk_register_fixed_rate(NULL, "mt9t001-clkin", NULL, CLK_IS_ROOT, 541 - 48000000); 542 - clk_register_clkdev(clk, NULL, "3-005d"); 543 - 544 - regulator_register_fixed(2, cm_t35_camera_supplies, 545 - ARRAY_SIZE(cm_t35_camera_supplies)); 546 - 547 - if (omap3_init_camera(&cm_t35_isp_pdata) < 0) 548 - pr_warn("CM-T3x: Failed registering camera device!\n"); 549 - } 550 - 551 - #else 552 - static inline void cm_t35_init_camera(void) {} 553 - #endif /* CONFIG_VIDEO_OMAP3 */ 554 - 555 - static void __init cm_t35_init_i2c(void) 556 - { 557 - omap3_pmic_get_config(&cm_t35_twldata, TWL_COMMON_PDATA_USB, 558 - TWL_COMMON_REGULATOR_VDAC | 559 - TWL_COMMON_PDATA_AUDIO); 560 - 561 - omap3_pmic_init("tps65930", &cm_t35_twldata); 562 - 563 - omap_register_i2c_bus(3, 400, NULL, 0); 564 - } 565 - 566 - #ifdef CONFIG_OMAP_MUX 567 - static struct omap_board_mux board_mux[] __initdata = { 568 - /* nCS and IRQ for CM-T35 ethernet */ 569 - OMAP3_MUX(GPMC_NCS5, OMAP_MUX_MODE0), 570 - OMAP3_MUX(UART3_CTS_RCTX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP), 571 - 572 - /* nCS and IRQ for SB-T35 ethernet */ 573 - OMAP3_MUX(GPMC_NCS4, OMAP_MUX_MODE0), 574 - OMAP3_MUX(GPMC_WAIT3, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP), 575 - 576 - /* PENDOWN GPIO */ 577 - OMAP3_MUX(GPMC_NCS6, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), 578 - 579 - /* mUSB */ 580 - OMAP3_MUX(HSUSB0_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 581 - OMAP3_MUX(HSUSB0_STP, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 582 - OMAP3_MUX(HSUSB0_DIR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 583 - OMAP3_MUX(HSUSB0_NXT, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 584 - OMAP3_MUX(HSUSB0_DATA0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 585 - OMAP3_MUX(HSUSB0_DATA1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 586 - OMAP3_MUX(HSUSB0_DATA2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 587 - OMAP3_MUX(HSUSB0_DATA3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 588 - OMAP3_MUX(HSUSB0_DATA4, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 589 - OMAP3_MUX(HSUSB0_DATA5, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 590 - OMAP3_MUX(HSUSB0_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 591 - OMAP3_MUX(HSUSB0_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 592 - 593 - /* MMC 2 */ 594 - OMAP3_MUX(SDMMC2_DAT4, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT), 595 - OMAP3_MUX(SDMMC2_DAT5, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT), 596 - OMAP3_MUX(SDMMC2_DAT6, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT), 597 - OMAP3_MUX(SDMMC2_DAT7, OMAP_MUX_MODE1 | OMAP_PIN_INPUT), 598 - 599 - /* McSPI 1 */ 600 - OMAP3_MUX(MCSPI1_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 601 - OMAP3_MUX(MCSPI1_SIMO, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 602 - OMAP3_MUX(MCSPI1_SOMI, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 603 - OMAP3_MUX(MCSPI1_CS0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN), 604 - 605 - /* McSPI 4 */ 606 - OMAP3_MUX(MCBSP1_CLKR, OMAP_MUX_MODE1 | OMAP_PIN_INPUT), 607 - OMAP3_MUX(MCBSP1_DX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT), 608 - OMAP3_MUX(MCBSP1_DR, OMAP_MUX_MODE1 | OMAP_PIN_INPUT), 609 - OMAP3_MUX(MCBSP1_FSX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT_PULLUP), 610 - 611 - /* McBSP 2 */ 612 - OMAP3_MUX(MCBSP2_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 613 - OMAP3_MUX(MCBSP2_CLKX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 614 - OMAP3_MUX(MCBSP2_DR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 615 - OMAP3_MUX(MCBSP2_DX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 616 - 617 - /* serial ports */ 618 - OMAP3_MUX(MCBSP3_CLKX, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT), 619 - OMAP3_MUX(MCBSP3_FSX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT), 620 - OMAP3_MUX(UART1_TX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 621 - OMAP3_MUX(UART1_RX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 622 - 623 - /* common DSS */ 624 - OMAP3_MUX(DSS_PCLK, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 625 - OMAP3_MUX(DSS_HSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 626 - OMAP3_MUX(DSS_VSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 627 - OMAP3_MUX(DSS_ACBIAS, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 628 - OMAP3_MUX(DSS_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 629 - OMAP3_MUX(DSS_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 630 - OMAP3_MUX(DSS_DATA8, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 631 - OMAP3_MUX(DSS_DATA9, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 632 - OMAP3_MUX(DSS_DATA10, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 633 - OMAP3_MUX(DSS_DATA11, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 634 - OMAP3_MUX(DSS_DATA12, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 635 - OMAP3_MUX(DSS_DATA13, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 636 - OMAP3_MUX(DSS_DATA14, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 637 - OMAP3_MUX(DSS_DATA15, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 638 - OMAP3_MUX(DSS_DATA16, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 639 - OMAP3_MUX(DSS_DATA17, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 640 - 641 - /* Camera */ 642 - OMAP3_MUX(CAM_HS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 643 - OMAP3_MUX(CAM_VS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 644 - OMAP3_MUX(CAM_XCLKA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 645 - OMAP3_MUX(CAM_PCLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 646 - OMAP3_MUX(CAM_FLD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 647 - OMAP3_MUX(CAM_D0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 648 - OMAP3_MUX(CAM_D1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 649 - OMAP3_MUX(CAM_D2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 650 - OMAP3_MUX(CAM_D3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 651 - OMAP3_MUX(CAM_D4, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 652 - OMAP3_MUX(CAM_D5, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 653 - OMAP3_MUX(CAM_D6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 654 - OMAP3_MUX(CAM_D7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 655 - OMAP3_MUX(CAM_D8, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN), 656 - OMAP3_MUX(CAM_D9, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN), 657 - OMAP3_MUX(CAM_STROBE, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 658 - 659 - OMAP3_MUX(CAM_D10, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLDOWN), 660 - OMAP3_MUX(CAM_D11, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLDOWN), 661 - 662 - /* display controls */ 663 - OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), 664 - OMAP3_MUX(GPMC_NCS7, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), 665 - OMAP3_MUX(GPMC_NCS3, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), 666 - 667 - /* TPS IRQ */ 668 - OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_WAKEUP_EN | \ 669 - OMAP_PIN_INPUT_PULLUP), 670 - 671 - { .reg_offset = OMAP_MUX_TERMINATOR }, 672 - }; 673 - 674 - static void __init cm_t3x_common_dss_mux_init(int mux_mode) 675 - { 676 - omap_mux_init_signal("dss_data18", mux_mode); 677 - omap_mux_init_signal("dss_data19", mux_mode); 678 - omap_mux_init_signal("dss_data20", mux_mode); 679 - omap_mux_init_signal("dss_data21", mux_mode); 680 - omap_mux_init_signal("dss_data22", mux_mode); 681 - omap_mux_init_signal("dss_data23", mux_mode); 682 - } 683 - 684 - static void __init cm_t35_init_mux(void) 685 - { 686 - int mux_mode = OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT; 687 - 688 - omap_mux_init_signal("dss_data0.dss_data0", mux_mode); 689 - omap_mux_init_signal("dss_data1.dss_data1", mux_mode); 690 - omap_mux_init_signal("dss_data2.dss_data2", mux_mode); 691 - omap_mux_init_signal("dss_data3.dss_data3", mux_mode); 692 - omap_mux_init_signal("dss_data4.dss_data4", mux_mode); 693 - omap_mux_init_signal("dss_data5.dss_data5", mux_mode); 694 - cm_t3x_common_dss_mux_init(mux_mode); 695 - } 696 - 697 - static void __init cm_t3730_init_mux(void) 698 - { 699 - int mux_mode = OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT; 700 - 701 - omap_mux_init_signal("sys_boot0", mux_mode); 702 - omap_mux_init_signal("sys_boot1", mux_mode); 703 - omap_mux_init_signal("sys_boot3", mux_mode); 704 - omap_mux_init_signal("sys_boot4", mux_mode); 705 - omap_mux_init_signal("sys_boot5", mux_mode); 706 - omap_mux_init_signal("sys_boot6", mux_mode); 707 - cm_t3x_common_dss_mux_init(mux_mode); 708 - } 709 - #else 710 - static inline void cm_t35_init_mux(void) {} 711 - static inline void cm_t3730_init_mux(void) {} 712 - #endif 713 - 714 - static void __init cm_t3x_common_init(void) 715 - { 716 - omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); 717 - omap_serial_init(); 718 - omap_sdrc_init(mt46h32m32lf6_sdrc_params, 719 - mt46h32m32lf6_sdrc_params); 720 - omap_hsmmc_init(mmc); 721 - cm_t35_init_i2c(); 722 - omap_ads7846_init(1, CM_T35_GPIO_PENDOWN, 0, NULL); 723 - cm_t35_init_ethernet(); 724 - cm_t35_init_led(); 725 - cm_t35_init_display(); 726 - omap_twl4030_audio_init("cm-t3x", NULL); 727 - 728 - usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); 729 - usb_musb_init(NULL); 730 - cm_t35_init_usbh(); 731 - cm_t35_init_camera(); 732 - } 733 - 734 - static void __init cm_t35_init(void) 735 - { 736 - cm_t3x_common_init(); 737 - cm_t35_init_mux(); 738 - cm_t35_init_nand(); 739 - } 740 - 741 - static void __init cm_t3730_init(void) 742 - { 743 - cm_t3x_common_init(); 744 - cm_t3730_init_mux(); 745 - } 746 - 747 - MACHINE_START(CM_T35, "Compulab CM-T35") 748 - .atag_offset = 0x100, 749 - .reserve = omap_reserve, 750 - .map_io = omap3_map_io, 751 - .init_early = omap35xx_init_early, 752 - .init_irq = omap3_init_irq, 753 - .init_machine = cm_t35_init, 754 - .init_late = omap35xx_init_late, 755 - .init_time = omap3_sync32k_timer_init, 756 - .restart = omap3xxx_restart, 757 - MACHINE_END 758 - 759 - MACHINE_START(CM_T3730, "Compulab CM-T3730") 760 - .atag_offset = 0x100, 761 - .reserve = omap_reserve, 762 - .map_io = omap3_map_io, 763 - .init_early = omap3630_init_early, 764 - .init_irq = omap3_init_irq, 765 - .init_machine = cm_t3730_init, 766 - .init_late = omap3630_init_late, 767 - .init_time = omap3_sync32k_timer_init, 768 - .restart = omap3xxx_restart, 769 - MACHINE_END
-595
arch/arm/mach-omap2/board-omap3beagle.c
··· 1 - /* 2 - * linux/arch/arm/mach-omap2/board-omap3beagle.c 3 - * 4 - * Copyright (C) 2008 Texas Instruments 5 - * 6 - * Modified from mach-omap2/board-3430sdp.c 7 - * 8 - * Initial code: Syed Mohammed Khasim 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/delay.h> 19 - #include <linux/err.h> 20 - #include <linux/clk.h> 21 - #include <linux/io.h> 22 - #include <linux/leds.h> 23 - #include <linux/pwm.h> 24 - #include <linux/leds_pwm.h> 25 - #include <linux/gpio.h> 26 - #include <linux/input.h> 27 - #include <linux/gpio_keys.h> 28 - #include <linux/pm_opp.h> 29 - #include <linux/cpu.h> 30 - 31 - #include <linux/mtd/mtd.h> 32 - #include <linux/mtd/partitions.h> 33 - #include <linux/mtd/nand.h> 34 - #include <linux/mmc/host.h> 35 - #include <linux/usb/phy.h> 36 - 37 - #include <linux/regulator/machine.h> 38 - #include <linux/i2c/twl.h> 39 - 40 - #include <asm/mach-types.h> 41 - #include <asm/mach/arch.h> 42 - #include <asm/mach/map.h> 43 - #include <asm/mach/flash.h> 44 - 45 - #include <video/omapdss.h> 46 - #include <video/omap-panel-data.h> 47 - #include <linux/platform_data/mtd-nand-omap2.h> 48 - 49 - #include "common.h" 50 - #include "omap_device.h" 51 - #include "gpmc.h" 52 - #include "soc.h" 53 - #include "mux.h" 54 - #include "hsmmc.h" 55 - #include "pm.h" 56 - #include "board-flash.h" 57 - #include "common-board-devices.h" 58 - 59 - #define NAND_CS 0 60 - 61 - static struct pwm_lookup pwm_lookup[] = { 62 - /* LEDB -> PMU_STAT */ 63 - PWM_LOOKUP("twl-pwmled", 1, "leds_pwm", "beagleboard::pmu_stat", 64 - 7812500, PWM_POLARITY_NORMAL), 65 - }; 66 - 67 - static struct led_pwm pwm_leds[] = { 68 - { 69 - .name = "beagleboard::pmu_stat", 70 - .max_brightness = 127, 71 - .pwm_period_ns = 7812500, 72 - }, 73 - }; 74 - 75 - static struct led_pwm_platform_data pwm_data = { 76 - .num_leds = ARRAY_SIZE(pwm_leds), 77 - .leds = pwm_leds, 78 - }; 79 - 80 - static struct platform_device leds_pwm = { 81 - .name = "leds_pwm", 82 - .id = -1, 83 - .dev = { 84 - .platform_data = &pwm_data, 85 - }, 86 - }; 87 - 88 - /* 89 - * OMAP3 Beagle revision 90 - * Run time detection of Beagle revision is done by reading GPIO. 91 - * GPIO ID - 92 - * AXBX = GPIO173, GPIO172, GPIO171: 1 1 1 93 - * C1_3 = GPIO173, GPIO172, GPIO171: 1 1 0 94 - * C4 = GPIO173, GPIO172, GPIO171: 1 0 1 95 - * XMA/XMB = GPIO173, GPIO172, GPIO171: 0 0 0 96 - * XMC = GPIO173, GPIO172, GPIO171: 0 1 0 97 - */ 98 - enum { 99 - OMAP3BEAGLE_BOARD_UNKN = 0, 100 - OMAP3BEAGLE_BOARD_AXBX, 101 - OMAP3BEAGLE_BOARD_C1_3, 102 - OMAP3BEAGLE_BOARD_C4, 103 - OMAP3BEAGLE_BOARD_XM, 104 - OMAP3BEAGLE_BOARD_XMC, 105 - }; 106 - 107 - static u8 omap3_beagle_version; 108 - 109 - /* 110 - * Board-specific configuration 111 - * Defaults to BeagleBoard-xMC 112 - */ 113 - static struct { 114 - int mmc1_gpio_wp; 115 - bool usb_pwr_level; /* 0 - Active Low, 1 - Active High */ 116 - int dvi_pd_gpio; 117 - int usr_button_gpio; 118 - int mmc_caps; 119 - } beagle_config = { 120 - .mmc1_gpio_wp = -EINVAL, 121 - .usb_pwr_level = 0, 122 - .dvi_pd_gpio = -EINVAL, 123 - .usr_button_gpio = 4, 124 - .mmc_caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, 125 - }; 126 - 127 - static struct gpio omap3_beagle_rev_gpios[] __initdata = { 128 - { 171, GPIOF_IN, "rev_id_0" }, 129 - { 172, GPIOF_IN, "rev_id_1" }, 130 - { 173, GPIOF_IN, "rev_id_2" }, 131 - }; 132 - 133 - static void __init omap3_beagle_init_rev(void) 134 - { 135 - int ret; 136 - u16 beagle_rev = 0; 137 - 138 - omap_mux_init_gpio(171, OMAP_PIN_INPUT_PULLUP); 139 - omap_mux_init_gpio(172, OMAP_PIN_INPUT_PULLUP); 140 - omap_mux_init_gpio(173, OMAP_PIN_INPUT_PULLUP); 141 - 142 - ret = gpio_request_array(omap3_beagle_rev_gpios, 143 - ARRAY_SIZE(omap3_beagle_rev_gpios)); 144 - if (ret < 0) { 145 - printk(KERN_ERR "Unable to get revision detection GPIO pins\n"); 146 - omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN; 147 - return; 148 - } 149 - 150 - beagle_rev = gpio_get_value(171) | (gpio_get_value(172) << 1) 151 - | (gpio_get_value(173) << 2); 152 - 153 - gpio_free_array(omap3_beagle_rev_gpios, 154 - ARRAY_SIZE(omap3_beagle_rev_gpios)); 155 - 156 - switch (beagle_rev) { 157 - case 7: 158 - printk(KERN_INFO "OMAP3 Beagle Rev: Ax/Bx\n"); 159 - omap3_beagle_version = OMAP3BEAGLE_BOARD_AXBX; 160 - beagle_config.mmc1_gpio_wp = 29; 161 - beagle_config.dvi_pd_gpio = 170; 162 - beagle_config.usr_button_gpio = 7; 163 - break; 164 - case 6: 165 - printk(KERN_INFO "OMAP3 Beagle Rev: C1/C2/C3\n"); 166 - omap3_beagle_version = OMAP3BEAGLE_BOARD_C1_3; 167 - beagle_config.mmc1_gpio_wp = 23; 168 - beagle_config.dvi_pd_gpio = 170; 169 - beagle_config.usr_button_gpio = 7; 170 - break; 171 - case 5: 172 - printk(KERN_INFO "OMAP3 Beagle Rev: C4\n"); 173 - omap3_beagle_version = OMAP3BEAGLE_BOARD_C4; 174 - beagle_config.mmc1_gpio_wp = 23; 175 - beagle_config.dvi_pd_gpio = 170; 176 - beagle_config.usr_button_gpio = 7; 177 - break; 178 - case 0: 179 - printk(KERN_INFO "OMAP3 Beagle Rev: xM Ax/Bx\n"); 180 - omap3_beagle_version = OMAP3BEAGLE_BOARD_XM; 181 - beagle_config.usb_pwr_level = 1; 182 - beagle_config.mmc_caps &= ~MMC_CAP_8_BIT_DATA; 183 - break; 184 - case 2: 185 - printk(KERN_INFO "OMAP3 Beagle Rev: xM C\n"); 186 - omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC; 187 - beagle_config.mmc_caps &= ~MMC_CAP_8_BIT_DATA; 188 - break; 189 - default: 190 - printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev); 191 - omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN; 192 - } 193 - } 194 - 195 - static struct mtd_partition omap3beagle_nand_partitions[] = { 196 - /* All the partition sizes are listed in terms of NAND block size */ 197 - { 198 - .name = "X-Loader", 199 - .offset = 0, 200 - .size = 4 * NAND_BLOCK_SIZE, 201 - .mask_flags = MTD_WRITEABLE, /* force read-only */ 202 - }, 203 - { 204 - .name = "U-Boot", 205 - .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ 206 - .size = 15 * NAND_BLOCK_SIZE, 207 - .mask_flags = MTD_WRITEABLE, /* force read-only */ 208 - }, 209 - { 210 - .name = "U-Boot Env", 211 - .offset = MTDPART_OFS_APPEND, /* Offset = 0x260000 */ 212 - .size = 1 * NAND_BLOCK_SIZE, 213 - }, 214 - { 215 - .name = "Kernel", 216 - .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */ 217 - .size = 32 * NAND_BLOCK_SIZE, 218 - }, 219 - { 220 - .name = "File System", 221 - .offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */ 222 - .size = MTDPART_SIZ_FULL, 223 - }, 224 - }; 225 - 226 - /* DSS */ 227 - 228 - static struct connector_dvi_platform_data beagle_dvi_connector_pdata = { 229 - .name = "dvi", 230 - .source = "tfp410.0", 231 - .i2c_bus_num = 3, 232 - }; 233 - 234 - static struct platform_device beagle_dvi_connector_device = { 235 - .name = "connector-dvi", 236 - .id = 0, 237 - .dev.platform_data = &beagle_dvi_connector_pdata, 238 - }; 239 - 240 - static struct encoder_tfp410_platform_data beagle_tfp410_pdata = { 241 - .name = "tfp410.0", 242 - .source = "dpi.0", 243 - .data_lines = 24, 244 - .power_down_gpio = -1, 245 - }; 246 - 247 - static struct platform_device beagle_tfp410_device = { 248 - .name = "tfp410", 249 - .id = 0, 250 - .dev.platform_data = &beagle_tfp410_pdata, 251 - }; 252 - 253 - static struct connector_atv_platform_data beagle_tv_pdata = { 254 - .name = "tv", 255 - .source = "venc.0", 256 - .connector_type = OMAP_DSS_VENC_TYPE_SVIDEO, 257 - .invert_polarity = false, 258 - }; 259 - 260 - static struct platform_device beagle_tv_connector_device = { 261 - .name = "connector-analog-tv", 262 - .id = 0, 263 - .dev.platform_data = &beagle_tv_pdata, 264 - }; 265 - 266 - static struct omap_dss_board_info beagle_dss_data = { 267 - .default_display_name = "dvi", 268 - }; 269 - 270 - #include "sdram-micron-mt46h32m32lf-6.h" 271 - 272 - static struct omap2_hsmmc_info mmc[] = { 273 - { 274 - .mmc = 1, 275 - .caps = MMC_CAP_4_BIT_DATA, 276 - .gpio_wp = -EINVAL, 277 - .deferred = true, 278 - }, 279 - {} /* Terminator */ 280 - }; 281 - 282 - static struct regulator_consumer_supply beagle_vmmc1_supply[] = { 283 - REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), 284 - }; 285 - 286 - static struct regulator_consumer_supply beagle_vsim_supply[] = { 287 - REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), 288 - }; 289 - 290 - static struct gpio_led gpio_leds[]; 291 - 292 - static struct usbhs_phy_data phy_data[] = { 293 - { 294 - .port = 2, 295 - .reset_gpio = 147, 296 - .vcc_gpio = -1, /* updated in beagle_twl_gpio_setup */ 297 - .vcc_polarity = 1, /* updated in beagle_twl_gpio_setup */ 298 - }, 299 - }; 300 - 301 - static int beagle_twl_gpio_setup(struct device *dev, 302 - unsigned gpio, unsigned ngpio) 303 - { 304 - int r; 305 - 306 - mmc[0].gpio_wp = beagle_config.mmc1_gpio_wp; 307 - /* gpio + 0 is "mmc0_cd" (input/IRQ) */ 308 - mmc[0].gpio_cd = gpio + 0; 309 - omap_hsmmc_late_init(mmc); 310 - 311 - /* 312 - * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active 313 - * high / others active low) 314 - * DVI reset GPIO is different between beagle revisions 315 - */ 316 - /* Valid for all -xM revisions */ 317 - if (cpu_is_omap3630()) { 318 - /* 319 - * gpio + 1 on Xm controls the TFP410's enable line (active low) 320 - * gpio + 2 control varies depending on the board rev as below: 321 - * P7/P8 revisions(prototype): Camera EN 322 - * A2+ revisions (production): LDO (DVI, serial, led blocks) 323 - */ 324 - r = gpio_request_one(gpio + 1, GPIOF_OUT_INIT_LOW, 325 - "nDVI_PWR_EN"); 326 - if (r) 327 - pr_err("%s: unable to configure nDVI_PWR_EN\n", 328 - __func__); 329 - 330 - beagle_config.dvi_pd_gpio = gpio + 2; 331 - 332 - } else { 333 - /* 334 - * REVISIT: need ehci-omap hooks for external VBUS 335 - * power switch and overcurrent detect 336 - */ 337 - if (gpio_request_one(gpio + 1, GPIOF_IN, "EHCI_nOC")) 338 - pr_err("%s: unable to configure EHCI_nOC\n", __func__); 339 - } 340 - beagle_tfp410_pdata.power_down_gpio = beagle_config.dvi_pd_gpio; 341 - 342 - platform_device_register(&beagle_tfp410_device); 343 - platform_device_register(&beagle_dvi_connector_device); 344 - platform_device_register(&beagle_tv_connector_device); 345 - 346 - /* TWL4030_GPIO_MAX i.e. LED_GPO controls HS USB Port 2 power */ 347 - phy_data[0].vcc_gpio = gpio + TWL4030_GPIO_MAX; 348 - phy_data[0].vcc_polarity = beagle_config.usb_pwr_level; 349 - 350 - usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data)); 351 - return 0; 352 - } 353 - 354 - static struct twl4030_gpio_platform_data beagle_gpio_data = { 355 - .use_leds = true, 356 - .pullups = BIT(1), 357 - .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13) 358 - | BIT(15) | BIT(16) | BIT(17), 359 - .setup = beagle_twl_gpio_setup, 360 - }; 361 - 362 - /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ 363 - static struct regulator_init_data beagle_vmmc1 = { 364 - .constraints = { 365 - .min_uV = 1850000, 366 - .max_uV = 3150000, 367 - .valid_modes_mask = REGULATOR_MODE_NORMAL 368 - | REGULATOR_MODE_STANDBY, 369 - .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE 370 - | REGULATOR_CHANGE_MODE 371 - | REGULATOR_CHANGE_STATUS, 372 - }, 373 - .num_consumer_supplies = ARRAY_SIZE(beagle_vmmc1_supply), 374 - .consumer_supplies = beagle_vmmc1_supply, 375 - }; 376 - 377 - /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ 378 - static struct regulator_init_data beagle_vsim = { 379 - .constraints = { 380 - .min_uV = 1800000, 381 - .max_uV = 3000000, 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 - .num_consumer_supplies = ARRAY_SIZE(beagle_vsim_supply), 389 - .consumer_supplies = beagle_vsim_supply, 390 - }; 391 - 392 - static struct twl4030_platform_data beagle_twldata = { 393 - /* platform_data for children goes here */ 394 - .gpio = &beagle_gpio_data, 395 - .vmmc1 = &beagle_vmmc1, 396 - .vsim = &beagle_vsim, 397 - }; 398 - 399 - static struct i2c_board_info __initdata beagle_i2c_eeprom[] = { 400 - { 401 - I2C_BOARD_INFO("eeprom", 0x50), 402 - }, 403 - }; 404 - 405 - static int __init omap3_beagle_i2c_init(void) 406 - { 407 - omap3_pmic_get_config(&beagle_twldata, 408 - TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC | 409 - TWL_COMMON_PDATA_AUDIO, 410 - TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2); 411 - 412 - beagle_twldata.vpll2->constraints.name = "VDVI"; 413 - 414 - omap3_pmic_init("twl4030", &beagle_twldata); 415 - /* Bus 3 is attached to the DVI port where devices like the pico DLP 416 - * projector don't work reliably with 400kHz */ 417 - omap_register_i2c_bus(3, 100, beagle_i2c_eeprom, ARRAY_SIZE(beagle_i2c_eeprom)); 418 - return 0; 419 - } 420 - 421 - static struct gpio_led gpio_leds[] = { 422 - { 423 - .name = "beagleboard::usr0", 424 - .default_trigger = "heartbeat", 425 - .gpio = 150, 426 - }, 427 - { 428 - .name = "beagleboard::usr1", 429 - .default_trigger = "mmc0", 430 - .gpio = 149, 431 - }, 432 - }; 433 - 434 - static struct gpio_led_platform_data gpio_led_info = { 435 - .leds = gpio_leds, 436 - .num_leds = ARRAY_SIZE(gpio_leds), 437 - }; 438 - 439 - static struct platform_device leds_gpio = { 440 - .name = "leds-gpio", 441 - .id = -1, 442 - .dev = { 443 - .platform_data = &gpio_led_info, 444 - }, 445 - }; 446 - 447 - static struct gpio_keys_button gpio_buttons[] = { 448 - { 449 - .code = BTN_EXTRA, 450 - /* Dynamically assigned depending on board */ 451 - .gpio = -EINVAL, 452 - .desc = "user", 453 - .wakeup = 1, 454 - }, 455 - }; 456 - 457 - static struct gpio_keys_platform_data gpio_key_info = { 458 - .buttons = gpio_buttons, 459 - .nbuttons = ARRAY_SIZE(gpio_buttons), 460 - }; 461 - 462 - static struct platform_device keys_gpio = { 463 - .name = "gpio-keys", 464 - .id = -1, 465 - .dev = { 466 - .platform_data = &gpio_key_info, 467 - }, 468 - }; 469 - 470 - static struct platform_device madc_hwmon = { 471 - .name = "twl4030_madc_hwmon", 472 - .id = -1, 473 - }; 474 - 475 - static struct platform_device *omap3_beagle_devices[] __initdata = { 476 - &leds_gpio, 477 - &keys_gpio, 478 - &madc_hwmon, 479 - &leds_pwm, 480 - }; 481 - 482 - static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 483 - .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 484 - }; 485 - 486 - #ifdef CONFIG_OMAP_MUX 487 - static struct omap_board_mux board_mux[] __initdata = { 488 - { .reg_offset = OMAP_MUX_TERMINATOR }, 489 - }; 490 - #endif 491 - 492 - static int __init beagle_opp_init(void) 493 - { 494 - int r = 0; 495 - 496 - if (!machine_is_omap3_beagle()) 497 - return 0; 498 - 499 - /* Initialize the omap3 opp table if not already created. */ 500 - r = omap3_opp_init(); 501 - if (r < 0 && (r != -EEXIST)) { 502 - pr_err("%s: opp default init failed\n", __func__); 503 - return r; 504 - } 505 - 506 - /* Custom OPP enabled for all xM versions */ 507 - if (cpu_is_omap3630()) { 508 - struct device *mpu_dev, *iva_dev; 509 - 510 - mpu_dev = get_cpu_device(0); 511 - iva_dev = omap_device_get_by_hwmod_name("iva"); 512 - 513 - if (!mpu_dev || IS_ERR(iva_dev)) { 514 - pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", 515 - __func__, mpu_dev, iva_dev); 516 - return -ENODEV; 517 - } 518 - /* Enable MPU 1GHz and lower opps */ 519 - r = dev_pm_opp_enable(mpu_dev, 800000000); 520 - /* TODO: MPU 1GHz needs SR and ABB */ 521 - 522 - /* Enable IVA 800MHz and lower opps */ 523 - r |= dev_pm_opp_enable(iva_dev, 660000000); 524 - /* TODO: DSP 800MHz needs SR and ABB */ 525 - if (r) { 526 - pr_err("%s: failed to enable higher opp %d\n", 527 - __func__, r); 528 - /* 529 - * Cleanup - disable the higher freqs - we dont care 530 - * about the results 531 - */ 532 - dev_pm_opp_disable(mpu_dev, 800000000); 533 - dev_pm_opp_disable(iva_dev, 660000000); 534 - } 535 - } 536 - return 0; 537 - } 538 - omap_device_initcall(beagle_opp_init); 539 - 540 - static void __init omap3_beagle_init(void) 541 - { 542 - omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 543 - omap3_beagle_init_rev(); 544 - 545 - if (gpio_is_valid(beagle_config.mmc1_gpio_wp)) 546 - omap_mux_init_gpio(beagle_config.mmc1_gpio_wp, OMAP_PIN_INPUT); 547 - mmc[0].caps = beagle_config.mmc_caps; 548 - omap_hsmmc_init(mmc); 549 - 550 - omap3_beagle_i2c_init(); 551 - 552 - gpio_buttons[0].gpio = beagle_config.usr_button_gpio; 553 - 554 - platform_add_devices(omap3_beagle_devices, 555 - ARRAY_SIZE(omap3_beagle_devices)); 556 - if (gpio_is_valid(beagle_config.dvi_pd_gpio)) 557 - omap_mux_init_gpio(beagle_config.dvi_pd_gpio, OMAP_PIN_OUTPUT); 558 - omap_display_init(&beagle_dss_data); 559 - 560 - omap_serial_init(); 561 - omap_sdrc_init(mt46h32m32lf6_sdrc_params, 562 - mt46h32m32lf6_sdrc_params); 563 - 564 - usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); 565 - usb_musb_init(NULL); 566 - 567 - usbhs_init(&usbhs_bdata); 568 - 569 - board_nand_init(omap3beagle_nand_partitions, 570 - ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS, 571 - NAND_BUSWIDTH_16, NULL); 572 - omap_twl4030_audio_init("omap3beagle", NULL); 573 - 574 - /* Ensure msecure is mux'd to be able to set the RTC. */ 575 - omap_mux_init_signal("sys_drm_msecure", OMAP_PIN_OFF_OUTPUT_HIGH); 576 - 577 - /* Ensure SDRC pins are mux'd for self-refresh */ 578 - omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 579 - omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); 580 - 581 - pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup)); 582 - } 583 - 584 - MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") 585 - /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ 586 - .atag_offset = 0x100, 587 - .reserve = omap_reserve, 588 - .map_io = omap3_map_io, 589 - .init_early = omap3_init_early, 590 - .init_irq = omap3_init_irq, 591 - .init_machine = omap3_beagle_init, 592 - .init_late = omap3_init_late, 593 - .init_time = omap3_secure_sync32k_timer_init, 594 - .restart = omap3xxx_restart, 595 - MACHINE_END
-571
arch/arm/mach-omap2/board-overo.c
··· 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/gpio.h> 28 - #include <linux/kernel.h> 29 - #include <linux/platform_device.h> 30 - #include <linux/i2c/twl.h> 31 - #include <linux/regulator/machine.h> 32 - #include <linux/regulator/fixed.h> 33 - #include <linux/spi/spi.h> 34 - 35 - #include <linux/mtd/mtd.h> 36 - #include <linux/mtd/nand.h> 37 - #include <linux/mtd/partitions.h> 38 - #include <linux/mmc/host.h> 39 - #include <linux/usb/phy.h> 40 - 41 - #include <linux/platform_data/mtd-nand-omap2.h> 42 - #include <linux/platform_data/spi-omap2-mcspi.h> 43 - 44 - #include <asm/mach-types.h> 45 - #include <asm/mach/arch.h> 46 - #include <asm/mach/flash.h> 47 - #include <asm/mach/map.h> 48 - 49 - #include <video/omapdss.h> 50 - #include <video/omap-panel-data.h> 51 - 52 - #include "common.h" 53 - #include "mux.h" 54 - #include "sdram-micron-mt46h32m32lf-6.h" 55 - #include "gpmc.h" 56 - #include "hsmmc.h" 57 - #include "board-flash.h" 58 - #include "common-board-devices.h" 59 - 60 - #define NAND_CS 0 61 - 62 - #define OVERO_GPIO_BT_XGATE 15 63 - #define OVERO_GPIO_W2W_NRESET 16 64 - #define OVERO_GPIO_PENDOWN 114 65 - #define OVERO_GPIO_BT_NRESET 164 66 - #define OVERO_GPIO_USBH_CPEN 168 67 - #define OVERO_GPIO_USBH_NRESET 183 68 - 69 - #define OVERO_SMSC911X_CS 5 70 - #define OVERO_SMSC911X_GPIO 176 71 - #define OVERO_SMSC911X_NRESET 64 72 - #define OVERO_SMSC911X2_CS 4 73 - #define OVERO_SMSC911X2_GPIO 65 74 - 75 - /* whether to register LCD35 instead of LCD43 */ 76 - static bool overo_use_lcd35; 77 - 78 - #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ 79 - defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) 80 - 81 - /* fixed regulator for ads7846 */ 82 - static struct regulator_consumer_supply ads7846_supply[] = { 83 - REGULATOR_SUPPLY("vcc", "spi1.0"), 84 - }; 85 - 86 - static struct regulator_init_data vads7846_regulator = { 87 - .constraints = { 88 - .valid_ops_mask = REGULATOR_CHANGE_STATUS, 89 - }, 90 - .num_consumer_supplies = ARRAY_SIZE(ads7846_supply), 91 - .consumer_supplies = ads7846_supply, 92 - }; 93 - 94 - static struct fixed_voltage_config vads7846 = { 95 - .supply_name = "vads7846", 96 - .microvolts = 3300000, /* 3.3V */ 97 - .gpio = -EINVAL, 98 - .startup_delay = 0, 99 - .init_data = &vads7846_regulator, 100 - }; 101 - 102 - static struct platform_device vads7846_device = { 103 - .name = "reg-fixed-voltage", 104 - .id = 1, 105 - .dev = { 106 - .platform_data = &vads7846, 107 - }, 108 - }; 109 - 110 - static void __init overo_ads7846_init(void) 111 - { 112 - omap_ads7846_init(1, OVERO_GPIO_PENDOWN, 0, NULL); 113 - platform_device_register(&vads7846_device); 114 - } 115 - 116 - #else 117 - static inline void __init overo_ads7846_init(void) { return; } 118 - #endif 119 - 120 - #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 121 - 122 - #include <linux/smsc911x.h> 123 - #include "gpmc-smsc911x.h" 124 - 125 - static struct omap_smsc911x_platform_data smsc911x_cfg = { 126 - .id = 0, 127 - .cs = OVERO_SMSC911X_CS, 128 - .gpio_irq = OVERO_SMSC911X_GPIO, 129 - .gpio_reset = OVERO_SMSC911X_NRESET, 130 - .flags = SMSC911X_USE_32BIT, 131 - }; 132 - 133 - static struct omap_smsc911x_platform_data smsc911x2_cfg = { 134 - .id = 1, 135 - .cs = OVERO_SMSC911X2_CS, 136 - .gpio_irq = OVERO_SMSC911X2_GPIO, 137 - .gpio_reset = -EINVAL, 138 - .flags = SMSC911X_USE_32BIT, 139 - }; 140 - 141 - static void __init overo_init_smsc911x(void) 142 - { 143 - gpmc_smsc911x_init(&smsc911x_cfg); 144 - gpmc_smsc911x_init(&smsc911x2_cfg); 145 - } 146 - 147 - #else 148 - static inline void __init overo_init_smsc911x(void) { return; } 149 - #endif 150 - 151 - /* DSS */ 152 - #define OVERO_GPIO_LCD_EN 144 153 - #define OVERO_GPIO_LCD_BL 145 154 - 155 - static struct connector_atv_platform_data overo_tv_pdata = { 156 - .name = "tv", 157 - .source = "venc.0", 158 - .connector_type = OMAP_DSS_VENC_TYPE_SVIDEO, 159 - .invert_polarity = false, 160 - }; 161 - 162 - static struct platform_device overo_tv_connector_device = { 163 - .name = "connector-analog-tv", 164 - .id = 0, 165 - .dev.platform_data = &overo_tv_pdata, 166 - }; 167 - 168 - static const struct display_timing overo_lcd43_videomode = { 169 - .pixelclock = { 0, 9200000, 0 }, 170 - 171 - .hactive = { 0, 480, 0 }, 172 - .hfront_porch = { 0, 8, 0 }, 173 - .hback_porch = { 0, 4, 0 }, 174 - .hsync_len = { 0, 41, 0 }, 175 - 176 - .vactive = { 0, 272, 0 }, 177 - .vfront_porch = { 0, 4, 0 }, 178 - .vback_porch = { 0, 2, 0 }, 179 - .vsync_len = { 0, 10, 0 }, 180 - 181 - .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW | 182 - DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE, 183 - }; 184 - 185 - static struct panel_dpi_platform_data overo_lcd43_pdata = { 186 - .name = "lcd43", 187 - .source = "dpi.0", 188 - 189 - .data_lines = 24, 190 - 191 - .display_timing = &overo_lcd43_videomode, 192 - 193 - .enable_gpio = OVERO_GPIO_LCD_EN, 194 - .backlight_gpio = OVERO_GPIO_LCD_BL, 195 - }; 196 - 197 - static struct platform_device overo_lcd43_device = { 198 - .name = "panel-dpi", 199 - .id = 0, 200 - .dev.platform_data = &overo_lcd43_pdata, 201 - }; 202 - 203 - static struct connector_dvi_platform_data overo_dvi_connector_pdata = { 204 - .name = "dvi", 205 - .source = "tfp410.0", 206 - .i2c_bus_num = 3, 207 - }; 208 - 209 - static struct platform_device overo_dvi_connector_device = { 210 - .name = "connector-dvi", 211 - .id = 0, 212 - .dev.platform_data = &overo_dvi_connector_pdata, 213 - }; 214 - 215 - static struct encoder_tfp410_platform_data overo_tfp410_pdata = { 216 - .name = "tfp410.0", 217 - .source = "dpi.0", 218 - .data_lines = 24, 219 - .power_down_gpio = -1, 220 - }; 221 - 222 - static struct platform_device overo_tfp410_device = { 223 - .name = "tfp410", 224 - .id = 0, 225 - .dev.platform_data = &overo_tfp410_pdata, 226 - }; 227 - 228 - static struct omap_dss_board_info overo_dss_data = { 229 - .default_display_name = "lcd43", 230 - }; 231 - 232 - static void __init overo_display_init(void) 233 - { 234 - omap_display_init(&overo_dss_data); 235 - 236 - if (!overo_use_lcd35) 237 - platform_device_register(&overo_lcd43_device); 238 - platform_device_register(&overo_tfp410_device); 239 - platform_device_register(&overo_dvi_connector_device); 240 - platform_device_register(&overo_tv_connector_device); 241 - } 242 - 243 - static struct mtd_partition overo_nand_partitions[] = { 244 - { 245 - .name = "xloader", 246 - .offset = 0, /* Offset = 0x00000 */ 247 - .size = 4 * NAND_BLOCK_SIZE, 248 - .mask_flags = MTD_WRITEABLE 249 - }, 250 - { 251 - .name = "uboot", 252 - .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ 253 - .size = 14 * NAND_BLOCK_SIZE, 254 - }, 255 - { 256 - .name = "uboot environment", 257 - .offset = MTDPART_OFS_APPEND, /* Offset = 0x240000 */ 258 - .size = 2 * NAND_BLOCK_SIZE, 259 - }, 260 - { 261 - .name = "linux", 262 - .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */ 263 - .size = 32 * NAND_BLOCK_SIZE, 264 - }, 265 - { 266 - .name = "rootfs", 267 - .offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */ 268 - .size = MTDPART_SIZ_FULL, 269 - }, 270 - }; 271 - 272 - static struct omap2_hsmmc_info mmc[] = { 273 - { 274 - .mmc = 1, 275 - .caps = MMC_CAP_4_BIT_DATA, 276 - .gpio_cd = -EINVAL, 277 - .gpio_wp = -EINVAL, 278 - }, 279 - { 280 - .mmc = 2, 281 - .caps = MMC_CAP_4_BIT_DATA, 282 - .gpio_cd = -EINVAL, 283 - .gpio_wp = -EINVAL, 284 - .transceiver = true, 285 - .ocr_mask = 0x00100000, /* 3.3V */ 286 - }, 287 - {} /* Terminator */ 288 - }; 289 - 290 - static struct regulator_consumer_supply overo_vmmc1_supply[] = { 291 - REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), 292 - }; 293 - 294 - #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) 295 - #include <linux/leds.h> 296 - 297 - static struct gpio_led gpio_leds[] = { 298 - { 299 - .name = "overo:red:gpio21", 300 - .default_trigger = "heartbeat", 301 - .gpio = 21, 302 - .active_low = true, 303 - }, 304 - { 305 - .name = "overo:blue:gpio22", 306 - .default_trigger = "none", 307 - .gpio = 22, 308 - .active_low = true, 309 - }, 310 - { 311 - .name = "overo:blue:COM", 312 - .default_trigger = "mmc0", 313 - .gpio = -EINVAL, /* gets replaced */ 314 - .active_low = true, 315 - }, 316 - }; 317 - 318 - static struct gpio_led_platform_data gpio_leds_pdata = { 319 - .leds = gpio_leds, 320 - .num_leds = ARRAY_SIZE(gpio_leds), 321 - }; 322 - 323 - static struct platform_device gpio_leds_device = { 324 - .name = "leds-gpio", 325 - .id = -1, 326 - .dev = { 327 - .platform_data = &gpio_leds_pdata, 328 - }, 329 - }; 330 - 331 - static void __init overo_init_led(void) 332 - { 333 - platform_device_register(&gpio_leds_device); 334 - } 335 - 336 - #else 337 - static inline void __init overo_init_led(void) { return; } 338 - #endif 339 - 340 - #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 341 - #include <linux/input.h> 342 - #include <linux/gpio_keys.h> 343 - 344 - static struct gpio_keys_button gpio_buttons[] = { 345 - { 346 - .code = BTN_0, 347 - .gpio = 23, 348 - .desc = "button0", 349 - .wakeup = 1, 350 - }, 351 - { 352 - .code = BTN_1, 353 - .gpio = 14, 354 - .desc = "button1", 355 - .wakeup = 1, 356 - }, 357 - }; 358 - 359 - static struct gpio_keys_platform_data gpio_keys_pdata = { 360 - .buttons = gpio_buttons, 361 - .nbuttons = ARRAY_SIZE(gpio_buttons), 362 - }; 363 - 364 - static struct platform_device gpio_keys_device = { 365 - .name = "gpio-keys", 366 - .id = -1, 367 - .dev = { 368 - .platform_data = &gpio_keys_pdata, 369 - }, 370 - }; 371 - 372 - static void __init overo_init_keys(void) 373 - { 374 - platform_device_register(&gpio_keys_device); 375 - } 376 - 377 - #else 378 - static inline void __init overo_init_keys(void) { return; } 379 - #endif 380 - 381 - static int overo_twl_gpio_setup(struct device *dev, 382 - unsigned gpio, unsigned ngpio) 383 - { 384 - #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) 385 - /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ 386 - gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; 387 - #endif 388 - 389 - return 0; 390 - } 391 - 392 - static struct twl4030_gpio_platform_data overo_gpio_data = { 393 - .use_leds = true, 394 - .setup = overo_twl_gpio_setup, 395 - }; 396 - 397 - static struct regulator_init_data overo_vmmc1 = { 398 - .constraints = { 399 - .min_uV = 1850000, 400 - .max_uV = 3150000, 401 - .valid_modes_mask = REGULATOR_MODE_NORMAL 402 - | REGULATOR_MODE_STANDBY, 403 - .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE 404 - | REGULATOR_CHANGE_MODE 405 - | REGULATOR_CHANGE_STATUS, 406 - }, 407 - .num_consumer_supplies = ARRAY_SIZE(overo_vmmc1_supply), 408 - .consumer_supplies = overo_vmmc1_supply, 409 - }; 410 - 411 - static struct twl4030_platform_data overo_twldata = { 412 - .gpio = &overo_gpio_data, 413 - .vmmc1 = &overo_vmmc1, 414 - }; 415 - 416 - static int __init overo_i2c_init(void) 417 - { 418 - omap3_pmic_get_config(&overo_twldata, 419 - TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO, 420 - TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2); 421 - 422 - overo_twldata.vpll2->constraints.name = "VDVI"; 423 - 424 - omap3_pmic_init("tps65950", &overo_twldata); 425 - /* i2c2 pins are used for gpio */ 426 - omap_register_i2c_bus(3, 400, NULL, 0); 427 - return 0; 428 - } 429 - 430 - static struct panel_lb035q02_platform_data overo_lcd35_pdata = { 431 - .name = "lcd35", 432 - .source = "dpi.0", 433 - 434 - .data_lines = 24, 435 - 436 - .enable_gpio = OVERO_GPIO_LCD_EN, 437 - .backlight_gpio = OVERO_GPIO_LCD_BL, 438 - }; 439 - 440 - /* 441 - * NOTE: We need to add either the lgphilips panel, or the lcd43 panel. The 442 - * selection is done based on the overo_use_lcd35 field. If new SPI 443 - * devices are added here, extra work is needed to make only the lgphilips panel 444 - * affected by the overo_use_lcd35 field. 445 - */ 446 - static struct spi_board_info overo_spi_board_info[] __initdata = { 447 - { 448 - .modalias = "panel_lgphilips_lb035q02", 449 - .bus_num = 1, 450 - .chip_select = 1, 451 - .max_speed_hz = 500000, 452 - .mode = SPI_MODE_3, 453 - .platform_data = &overo_lcd35_pdata, 454 - }, 455 - }; 456 - 457 - static int __init overo_spi_init(void) 458 - { 459 - overo_ads7846_init(); 460 - 461 - if (overo_use_lcd35) { 462 - spi_register_board_info(overo_spi_board_info, 463 - ARRAY_SIZE(overo_spi_board_info)); 464 - } 465 - return 0; 466 - } 467 - 468 - static struct usbhs_phy_data phy_data[] __initdata = { 469 - { 470 - .port = 2, 471 - .reset_gpio = OVERO_GPIO_USBH_NRESET, 472 - .vcc_gpio = -EINVAL, 473 - }, 474 - }; 475 - 476 - static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 477 - .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 478 - }; 479 - 480 - #ifdef CONFIG_OMAP_MUX 481 - static struct omap_board_mux board_mux[] __initdata = { 482 - { .reg_offset = OMAP_MUX_TERMINATOR }, 483 - }; 484 - #endif 485 - 486 - static struct gpio overo_bt_gpios[] __initdata = { 487 - { OVERO_GPIO_BT_XGATE, GPIOF_OUT_INIT_LOW, "lcd enable" }, 488 - { OVERO_GPIO_BT_NRESET, GPIOF_OUT_INIT_HIGH, "lcd bl enable" }, 489 - }; 490 - 491 - static struct regulator_consumer_supply dummy_supplies[] = { 492 - REGULATOR_SUPPLY("vddvario", "smsc911x.0"), 493 - REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), 494 - REGULATOR_SUPPLY("vddvario", "smsc911x.1"), 495 - REGULATOR_SUPPLY("vdd33a", "smsc911x.1"), 496 - }; 497 - 498 - static void __init overo_init(void) 499 - { 500 - int ret; 501 - 502 - if (strstr(boot_command_line, "omapdss.def_disp=lcd35")) 503 - overo_use_lcd35 = true; 504 - 505 - regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 506 - omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 507 - overo_i2c_init(); 508 - omap_hsmmc_init(mmc); 509 - omap_serial_init(); 510 - omap_sdrc_init(mt46h32m32lf6_sdrc_params, 511 - mt46h32m32lf6_sdrc_params); 512 - board_nand_init(overo_nand_partitions, 513 - ARRAY_SIZE(overo_nand_partitions), NAND_CS, 0, NULL); 514 - usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); 515 - usb_musb_init(NULL); 516 - 517 - usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data)); 518 - usbhs_init(&usbhs_bdata); 519 - overo_spi_init(); 520 - overo_init_smsc911x(); 521 - overo_init_led(); 522 - overo_init_keys(); 523 - omap_twl4030_audio_init("overo", NULL); 524 - 525 - overo_display_init(); 526 - 527 - /* Ensure SDRC pins are mux'd for self-refresh */ 528 - omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 529 - omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); 530 - 531 - ret = gpio_request_one(OVERO_GPIO_W2W_NRESET, GPIOF_OUT_INIT_HIGH, 532 - "OVERO_GPIO_W2W_NRESET"); 533 - if (ret == 0) { 534 - gpio_export(OVERO_GPIO_W2W_NRESET, 0); 535 - gpio_set_value(OVERO_GPIO_W2W_NRESET, 0); 536 - udelay(10); 537 - gpio_set_value(OVERO_GPIO_W2W_NRESET, 1); 538 - } else { 539 - pr_err("could not obtain gpio for OVERO_GPIO_W2W_NRESET\n"); 540 - } 541 - 542 - ret = gpio_request_array(overo_bt_gpios, ARRAY_SIZE(overo_bt_gpios)); 543 - if (ret) { 544 - pr_err("%s: could not obtain BT gpios\n", __func__); 545 - } else { 546 - gpio_export(OVERO_GPIO_BT_XGATE, 0); 547 - gpio_export(OVERO_GPIO_BT_NRESET, 0); 548 - gpio_set_value(OVERO_GPIO_BT_NRESET, 0); 549 - mdelay(6); 550 - gpio_set_value(OVERO_GPIO_BT_NRESET, 1); 551 - } 552 - 553 - ret = gpio_request_one(OVERO_GPIO_USBH_CPEN, GPIOF_OUT_INIT_HIGH, 554 - "OVERO_GPIO_USBH_CPEN"); 555 - if (ret == 0) 556 - gpio_export(OVERO_GPIO_USBH_CPEN, 0); 557 - else 558 - pr_err("could not obtain gpio for OVERO_GPIO_USBH_CPEN\n"); 559 - } 560 - 561 - MACHINE_START(OVERO, "Gumstix Overo") 562 - .atag_offset = 0x100, 563 - .reserve = omap_reserve, 564 - .map_io = omap3_map_io, 565 - .init_early = omap35xx_init_early, 566 - .init_irq = omap3_init_irq, 567 - .init_machine = overo_init, 568 - .init_late = omap35xx_init_late, 569 - .init_time = omap3_sync32k_timer_init, 570 - .restart = omap3xxx_restart, 571 - MACHINE_END
+2 -2
arch/arm/mach-omap2/devices.c
··· 63 63 64 64 WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name); 65 65 66 - return PTR_RET(pdev); 66 + return PTR_ERR_OR_ZERO(pdev); 67 67 } 68 68 omap_postcore_initcall(omap3_l3_init); 69 69 ··· 333 333 pdev = omap_device_build("omap-gpmc", -1, oh, NULL, 0); 334 334 WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name); 335 335 336 - return PTR_RET(pdev); 336 + return PTR_ERR_OR_ZERO(pdev); 337 337 } 338 338 omap_postcore_initcall(omap_gpmc_init);
+1 -1
arch/arm/mach-omap2/fb.c
··· 84 84 pdev = platform_device_register_resndata(NULL, "omapvrfb", -1, 85 85 res, num_res, NULL, 0); 86 86 87 - return PTR_RET(pdev); 87 + return PTR_ERR_OR_ZERO(pdev); 88 88 } 89 89 #else 90 90 int __init omap_init_vrfb(void) { return 0; }
+1 -1
arch/arm/mach-omap2/omap-wakeupgen.c
··· 444 444 return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, &parent_args); 445 445 } 446 446 447 - static struct irq_domain_ops wakeupgen_domain_ops = { 447 + static const struct irq_domain_ops wakeupgen_domain_ops = { 448 448 .xlate = wakeupgen_domain_xlate, 449 449 .alloc = wakeupgen_domain_alloc, 450 450 .free = irq_domain_free_irqs_common,
+1 -1
arch/arm/mach-omap2/pmu.c
··· 55 55 WARN(IS_ERR(omap_pmu_dev), "Can't build omap_device for %s.\n", 56 56 dev_name); 57 57 58 - return PTR_RET(omap_pmu_dev); 58 + return PTR_ERR_OR_ZERO(omap_pmu_dev); 59 59 } 60 60 61 61 static int __init omap_init_pmu(void)
+1 -1
arch/arm/mach-omap2/serial.c
··· 203 203 if (cmdline_find_option(uart_name)) { 204 204 console_uart_id = uart->num; 205 205 206 - if (console_loglevel >= 10) { 206 + if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) { 207 207 uart_debug = true; 208 208 pr_info("%s used as console in debug mode: uart%d clocks will not be gated", 209 209 uart_name, uart->num);