| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Hardware definitions for Palm Treo smartphones |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 7 | 8 | * |
|---|
| 8 | 9 | * Author: Tomas Cech <sleep_walker@suse.cz> |
|---|
| 9 | 10 | * |
|---|
| 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 | 11 | * (find more info at www.hackndev.com) |
|---|
| 15 | | - * |
|---|
| 16 | 12 | */ |
|---|
| 17 | 13 | |
|---|
| 18 | 14 | #include <linux/platform_device.h> |
|---|
| .. | .. |
|---|
| 404 | 400 | } |
|---|
| 405 | 401 | |
|---|
| 406 | 402 | /****************************************************************************** |
|---|
| 407 | | - * diskonchip docg4 flash |
|---|
| 408 | | - ******************************************************************************/ |
|---|
| 409 | | -#if defined(CONFIG_MACH_TREO680) |
|---|
| 410 | | -/* REVISIT: does the centro have this device also? */ |
|---|
| 411 | | -#if IS_ENABLED(CONFIG_MTD_NAND_DOCG4) |
|---|
| 412 | | -static struct resource docg4_resources[] = { |
|---|
| 413 | | - { |
|---|
| 414 | | - .start = 0x00000000, |
|---|
| 415 | | - .end = 0x00001FFF, |
|---|
| 416 | | - .flags = IORESOURCE_MEM, |
|---|
| 417 | | - }, |
|---|
| 418 | | -}; |
|---|
| 419 | | - |
|---|
| 420 | | -static struct platform_device treo680_docg4_flash = { |
|---|
| 421 | | - .name = "docg4", |
|---|
| 422 | | - .id = -1, |
|---|
| 423 | | - .resource = docg4_resources, |
|---|
| 424 | | - .num_resources = ARRAY_SIZE(docg4_resources), |
|---|
| 425 | | -}; |
|---|
| 426 | | - |
|---|
| 427 | | -static void __init treo680_docg4_flash_init(void) |
|---|
| 428 | | -{ |
|---|
| 429 | | - platform_device_register(&treo680_docg4_flash); |
|---|
| 430 | | -} |
|---|
| 431 | | -#else |
|---|
| 432 | | -static inline void treo680_docg4_flash_init(void) {} |
|---|
| 433 | | -#endif |
|---|
| 434 | | -#endif |
|---|
| 435 | | - |
|---|
| 436 | | -/****************************************************************************** |
|---|
| 437 | 403 | * Machine init |
|---|
| 438 | 404 | ******************************************************************************/ |
|---|
| 439 | 405 | static void __init treo_reserve(void) |
|---|
| .. | .. |
|---|
| 510 | 476 | gpio_free(GPIO_NR_TREO680_LCD_EN_N); |
|---|
| 511 | 477 | } |
|---|
| 512 | 478 | |
|---|
| 479 | +static struct gpiod_lookup_table treo680_mci_gpio_table = { |
|---|
| 480 | + .dev_id = "pxa2xx-mci.0", |
|---|
| 481 | + .table = { |
|---|
| 482 | + GPIO_LOOKUP("gpio-pxa", GPIO_NR_TREO_SD_DETECT_N, |
|---|
| 483 | + "cd", GPIO_ACTIVE_LOW), |
|---|
| 484 | + GPIO_LOOKUP("gpio-pxa", GPIO_NR_TREO680_SD_READONLY, |
|---|
| 485 | + "wp", GPIO_ACTIVE_LOW), |
|---|
| 486 | + GPIO_LOOKUP("gpio-pxa", GPIO_NR_TREO680_SD_POWER, |
|---|
| 487 | + "power", GPIO_ACTIVE_HIGH), |
|---|
| 488 | + { }, |
|---|
| 489 | + }, |
|---|
| 490 | +}; |
|---|
| 491 | + |
|---|
| 513 | 492 | static void __init treo680_init(void) |
|---|
| 514 | 493 | { |
|---|
| 515 | 494 | pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config)); |
|---|
| 516 | 495 | palmphone_common_init(); |
|---|
| 517 | 496 | treo680_gpio_init(); |
|---|
| 518 | | - palm27x_mmc_init(GPIO_NR_TREO_SD_DETECT_N, GPIO_NR_TREO680_SD_READONLY, |
|---|
| 519 | | - GPIO_NR_TREO680_SD_POWER, 0); |
|---|
| 520 | | - treo680_docg4_flash_init(); |
|---|
| 497 | + palm27x_mmc_init(&treo680_mci_gpio_table); |
|---|
| 521 | 498 | } |
|---|
| 522 | 499 | #endif |
|---|
| 523 | 500 | |
|---|
| 524 | 501 | #ifdef CONFIG_MACH_CENTRO |
|---|
| 502 | + |
|---|
| 503 | +static struct gpiod_lookup_table centro685_mci_gpio_table = { |
|---|
| 504 | + .dev_id = "pxa2xx-mci.0", |
|---|
| 505 | + .table = { |
|---|
| 506 | + GPIO_LOOKUP("gpio-pxa", GPIO_NR_TREO_SD_DETECT_N, |
|---|
| 507 | + "cd", GPIO_ACTIVE_LOW), |
|---|
| 508 | + GPIO_LOOKUP("gpio-pxa", GPIO_NR_CENTRO_SD_POWER, |
|---|
| 509 | + "power", GPIO_ACTIVE_LOW), |
|---|
| 510 | + { }, |
|---|
| 511 | + }, |
|---|
| 512 | +}; |
|---|
| 513 | + |
|---|
| 525 | 514 | static void __init centro_init(void) |
|---|
| 526 | 515 | { |
|---|
| 527 | 516 | pxa2xx_mfp_config(ARRAY_AND_SIZE(centro685_pin_config)); |
|---|
| 528 | 517 | palmphone_common_init(); |
|---|
| 529 | | - palm27x_mmc_init(GPIO_NR_TREO_SD_DETECT_N, -1, |
|---|
| 530 | | - GPIO_NR_CENTRO_SD_POWER, 1); |
|---|
| 518 | + palm27x_mmc_init(¢ro685_mci_gpio_table); |
|---|
| 531 | 519 | } |
|---|
| 532 | 520 | #endif |
|---|
| 533 | 521 | |
|---|