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

Merge tag 'imx-features-board-20120411-2' of git://git.pengutronix.de/git/imx/linux-2.6 into next/boards

* tag 'imx-features-board-20120411-2' of git://git.pengutronix.de/git/imx/linux-2.6:
ARM i.MX: Visstrim_M10: Add board version detection.
ARM: imx_v4_v5_defconfig: enable adc and touch driver of mc13783
ARM: i.MX: i.MX35-PDK: Add regulator support

+251 -1
+3 -1
arch/arm/configs/imx_v4_v5_defconfig
··· 92 92 # CONFIG_INPUT_MOUSE is not set 93 93 CONFIG_INPUT_TOUCHSCREEN=y 94 94 CONFIG_TOUCHSCREEN_ADS7846=m 95 + CONFIG_TOUCHSCREEN_MC13783=m 95 96 # CONFIG_SERIO is not set 96 97 # CONFIG_LEGACY_PTYS is not set 97 98 CONFIG_SERIAL_8250=m ··· 108 107 CONFIG_W1=y 109 108 CONFIG_W1_MASTER_MXC=y 110 109 CONFIG_W1_SLAVE_THERM=y 111 - # CONFIG_HWMON is not set 110 + CONFIG_HWMON=m 111 + CONFIG_SENSORS_MC13783_ADC=m 112 112 CONFIG_WATCHDOG=y 113 113 CONFIG_IMX2_WDT=y 114 114 CONFIG_MFD_MC13XXX=y
+55
arch/arm/mach-imx/mach-imx27_visstrim_m10.c
··· 38 38 #include <asm/mach-types.h> 39 39 #include <asm/mach/arch.h> 40 40 #include <asm/mach/time.h> 41 + #include <asm/system.h> 41 42 #include <mach/common.h> 42 43 #include <mach/iomux-mx27.h> 43 44 ··· 48 47 #define TVP5150_PWDN (GPIO_PORTC + 19) 49 48 #define OTG_PHY_CS_GPIO (GPIO_PORTF + 17) 50 49 #define SDHC1_IRQ IRQ_GPIOB(25) 50 + 51 + #define MOTHERBOARD_BIT2 (GPIO_PORTD + 31) 52 + #define MOTHERBOARD_BIT1 (GPIO_PORTD + 30) 53 + #define MOTHERBOARD_BIT0 (GPIO_PORTD + 29) 54 + 55 + #define EXPBOARD_BIT2 (GPIO_PORTD + 25) 56 + #define EXPBOARD_BIT1 (GPIO_PORTD + 27) 57 + #define EXPBOARD_BIT0 (GPIO_PORTD + 28) 51 58 52 59 static const int visstrim_m10_pins[] __initconst = { 53 60 /* UART1 (console) */ ··· 128 119 PB19_PF_CSI_D7, 129 120 PB20_PF_CSI_VSYNC, 130 121 PB21_PF_CSI_HSYNC, 122 + /* mother board version */ 123 + MOTHERBOARD_BIT2 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, 124 + MOTHERBOARD_BIT1 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, 125 + MOTHERBOARD_BIT0 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, 126 + /* expansion board version */ 127 + EXPBOARD_BIT2 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, 128 + EXPBOARD_BIT1 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, 129 + EXPBOARD_BIT0 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, 130 + }; 131 + 132 + static struct gpio visstrim_m10_version_gpios[] = { 133 + { EXPBOARD_BIT0, GPIOF_IN, "exp-version-0" }, 134 + { EXPBOARD_BIT1, GPIOF_IN, "exp-version-1" }, 135 + { EXPBOARD_BIT2, GPIOF_IN, "exp-version-2" }, 136 + { MOTHERBOARD_BIT0, GPIOF_IN, "mother-version-0" }, 137 + { MOTHERBOARD_BIT1, GPIOF_IN, "mother-version-1" }, 138 + { MOTHERBOARD_BIT2, GPIOF_IN, "mother-version-2" }, 131 139 }; 132 140 133 141 /* Camera */ ··· 395 369 .flags = IMX_SSI_DMA | IMX_SSI_SYN, 396 370 }; 397 371 372 + static void __init visstrim_m10_revision(void) 373 + { 374 + int exp_version = 0; 375 + int mo_version = 0; 376 + int ret; 377 + 378 + ret = gpio_request_array(visstrim_m10_version_gpios, 379 + ARRAY_SIZE(visstrim_m10_version_gpios)); 380 + if (ret) { 381 + pr_err("Failed to request version gpios"); 382 + return; 383 + } 384 + 385 + /* Get expansion board version (negative logic) */ 386 + exp_version |= !gpio_get_value(EXPBOARD_BIT2) << 2; 387 + exp_version |= !gpio_get_value(EXPBOARD_BIT1) << 1; 388 + exp_version |= !gpio_get_value(EXPBOARD_BIT0); 389 + 390 + /* Get mother board version (negative logic) */ 391 + mo_version |= !gpio_get_value(MOTHERBOARD_BIT2) << 2; 392 + mo_version |= !gpio_get_value(MOTHERBOARD_BIT1) << 1; 393 + mo_version |= !gpio_get_value(MOTHERBOARD_BIT0); 394 + 395 + system_rev = 0x27000; 396 + system_rev |= (mo_version << 4); 397 + system_rev |= exp_version; 398 + } 399 + 398 400 static void __init visstrim_m10_board_init(void) 399 401 { 400 402 int ret; 401 403 402 404 imx27_soc_init(); 405 + visstrim_m10_revision(); 403 406 404 407 ret = mxc_gpio_setup_multiple_pins(visstrim_m10_pins, 405 408 ARRAY_SIZE(visstrim_m10_pins), "VISSTRIM_M10");
+193
arch/arm/mach-imx/mach-mx35_3ds.c
··· 34 34 #include <linux/usb/otg.h> 35 35 36 36 #include <linux/mtd/physmap.h> 37 + #include <linux/mfd/mc13892.h> 38 + #include <linux/regulator/machine.h> 37 39 38 40 #include <asm/mach-types.h> 39 41 #include <asm/mach/arch.h> ··· 255 253 MX35_PAD_CSI_MCLK__IPU_CSI_MCLK, 256 254 MX35_PAD_CSI_PIXCLK__IPU_CSI_PIXCLK, 257 255 MX35_PAD_CSI_VSYNC__IPU_CSI_VSYNC, 256 + /*PMIC IRQ*/ 257 + MX35_PAD_GPIO2_0__GPIO2_0, 258 258 }; 259 259 260 260 /* ··· 320 316 .platform_data = &iclink_ov2640, 321 317 }, 322 318 }; 319 + 320 + static struct regulator_consumer_supply sw1_consumers[] = { 321 + { 322 + .supply = "cpu_vcc", 323 + } 324 + }; 325 + 326 + static struct regulator_consumer_supply vcam_consumers[] = { 327 + /* sgtl5000 */ 328 + REGULATOR_SUPPLY("VDDA", "0-000a"), 329 + }; 330 + 331 + static struct regulator_consumer_supply vaudio_consumers[] = { 332 + REGULATOR_SUPPLY("cmos_vio", "soc-camera-pdrv.0"), 333 + }; 334 + 335 + static struct regulator_init_data sw1_init = { 336 + .constraints = { 337 + .name = "SW1", 338 + .min_uV = 600000, 339 + .max_uV = 1375000, 340 + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, 341 + .valid_modes_mask = 0, 342 + .always_on = 1, 343 + .boot_on = 1, 344 + }, 345 + .num_consumer_supplies = ARRAY_SIZE(sw1_consumers), 346 + .consumer_supplies = sw1_consumers, 347 + }; 348 + 349 + static struct regulator_init_data sw2_init = { 350 + .constraints = { 351 + .name = "SW2", 352 + .always_on = 1, 353 + .boot_on = 1, 354 + } 355 + }; 356 + 357 + static struct regulator_init_data sw3_init = { 358 + .constraints = { 359 + .name = "SW3", 360 + .always_on = 1, 361 + .boot_on = 1, 362 + } 363 + }; 364 + 365 + static struct regulator_init_data sw4_init = { 366 + .constraints = { 367 + .name = "SW4", 368 + .always_on = 1, 369 + .boot_on = 1, 370 + } 371 + }; 372 + 373 + static struct regulator_init_data viohi_init = { 374 + .constraints = { 375 + .name = "VIOHI", 376 + .boot_on = 1, 377 + } 378 + }; 379 + 380 + static struct regulator_init_data vusb_init = { 381 + .constraints = { 382 + .name = "VUSB", 383 + .boot_on = 1, 384 + } 385 + }; 386 + 387 + static struct regulator_init_data vdig_init = { 388 + .constraints = { 389 + .name = "VDIG", 390 + .boot_on = 1, 391 + } 392 + }; 393 + 394 + static struct regulator_init_data vpll_init = { 395 + .constraints = { 396 + .name = "VPLL", 397 + .boot_on = 1, 398 + } 399 + }; 400 + 401 + static struct regulator_init_data vusb2_init = { 402 + .constraints = { 403 + .name = "VUSB2", 404 + .boot_on = 1, 405 + } 406 + }; 407 + 408 + static struct regulator_init_data vvideo_init = { 409 + .constraints = { 410 + .name = "VVIDEO", 411 + .boot_on = 1 412 + } 413 + }; 414 + 415 + static struct regulator_init_data vaudio_init = { 416 + .constraints = { 417 + .name = "VAUDIO", 418 + .min_uV = 2300000, 419 + .max_uV = 3000000, 420 + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, 421 + .boot_on = 1 422 + }, 423 + .num_consumer_supplies = ARRAY_SIZE(vaudio_consumers), 424 + .consumer_supplies = vaudio_consumers, 425 + }; 426 + 427 + static struct regulator_init_data vcam_init = { 428 + .constraints = { 429 + .name = "VCAM", 430 + .min_uV = 2500000, 431 + .max_uV = 3000000, 432 + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 433 + REGULATOR_CHANGE_MODE, 434 + .valid_modes_mask = REGULATOR_MODE_FAST | REGULATOR_MODE_NORMAL, 435 + .boot_on = 1 436 + }, 437 + .num_consumer_supplies = ARRAY_SIZE(vcam_consumers), 438 + .consumer_supplies = vcam_consumers, 439 + }; 440 + 441 + static struct regulator_init_data vgen1_init = { 442 + .constraints = { 443 + .name = "VGEN1", 444 + } 445 + }; 446 + 447 + static struct regulator_init_data vgen2_init = { 448 + .constraints = { 449 + .name = "VGEN2", 450 + .boot_on = 1, 451 + } 452 + }; 453 + 454 + static struct regulator_init_data vgen3_init = { 455 + .constraints = { 456 + .name = "VGEN3", 457 + } 458 + }; 459 + 460 + static struct mc13xxx_regulator_init_data mx35_3ds_regulators[] = { 461 + { .id = MC13892_SW1, .init_data = &sw1_init }, 462 + { .id = MC13892_SW2, .init_data = &sw2_init }, 463 + { .id = MC13892_SW3, .init_data = &sw3_init }, 464 + { .id = MC13892_SW4, .init_data = &sw4_init }, 465 + { .id = MC13892_VIOHI, .init_data = &viohi_init }, 466 + { .id = MC13892_VPLL, .init_data = &vpll_init }, 467 + { .id = MC13892_VDIG, .init_data = &vdig_init }, 468 + { .id = MC13892_VUSB2, .init_data = &vusb2_init }, 469 + { .id = MC13892_VVIDEO, .init_data = &vvideo_init }, 470 + { .id = MC13892_VAUDIO, .init_data = &vaudio_init }, 471 + { .id = MC13892_VCAM, .init_data = &vcam_init }, 472 + { .id = MC13892_VGEN1, .init_data = &vgen1_init }, 473 + { .id = MC13892_VGEN2, .init_data = &vgen2_init }, 474 + { .id = MC13892_VGEN3, .init_data = &vgen3_init }, 475 + { .id = MC13892_VUSB, .init_data = &vusb_init }, 476 + }; 477 + 478 + static struct mc13xxx_platform_data mx35_3ds_mc13892_data = { 479 + .flags = MC13XXX_USE_RTC | MC13XXX_USE_TOUCHSCREEN, 480 + .regulators = { 481 + .num_regulators = ARRAY_SIZE(mx35_3ds_regulators), 482 + .regulators = mx35_3ds_regulators, 483 + }, 484 + }; 485 + 486 + #define GPIO_PMIC_INT IMX_GPIO_NR(2, 0) 487 + 488 + static struct i2c_board_info mx35_3ds_i2c_mc13892 = { 489 + 490 + I2C_BOARD_INFO("mc13892", 0x08), 491 + .platform_data = &mx35_3ds_mc13892_data, 492 + .irq = IMX_GPIO_TO_IRQ(GPIO_PMIC_INT), 493 + }; 494 + 495 + static void __init imx35_3ds_init_mc13892(void) 496 + { 497 + int ret = gpio_request_one(GPIO_PMIC_INT, GPIOF_DIR_IN, "pmic irq"); 498 + 499 + if (ret) { 500 + pr_err("failed to get pmic irq: %d\n", ret); 501 + return; 502 + } 503 + 504 + i2c_register_board_info(0, &mx35_3ds_i2c_mc13892, 1); 505 + } 323 506 324 507 static int mx35_3ds_otg_init(struct platform_device *pdev) 325 508 { ··· 603 412 imx35_fb_pdev = imx35_add_mx3_sdc_fb(&mx3fb_pdata); 604 413 mx35_3ds_lcd.dev.parent = &imx35_fb_pdev->dev; 605 414 platform_device_register(&mx35_3ds_lcd); 415 + 416 + imx35_3ds_init_mc13892(); 606 417 } 607 418 608 419 static void __init mx35pdk_timer_init(void)