hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/arm/mach-pxa/palmtreo.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Hardware definitions for Palm Treo smartphones
34 *
....@@ -7,12 +8,7 @@
78 *
89 * Author: Tomas Cech <sleep_walker@suse.cz>
910 *
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
- *
1411 * (find more info at www.hackndev.com)
15
- *
1612 */
1713
1814 #include <linux/platform_device.h>
....@@ -404,36 +400,6 @@
404400 }
405401
406402 /******************************************************************************
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
-/******************************************************************************
437403 * Machine init
438404 ******************************************************************************/
439405 static void __init treo_reserve(void)
....@@ -510,24 +476,46 @@
510476 gpio_free(GPIO_NR_TREO680_LCD_EN_N);
511477 }
512478
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
+
513492 static void __init treo680_init(void)
514493 {
515494 pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config));
516495 palmphone_common_init();
517496 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);
521498 }
522499 #endif
523500
524501 #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
+
525514 static void __init centro_init(void)
526515 {
527516 pxa2xx_mfp_config(ARRAY_AND_SIZE(centro685_pin_config));
528517 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(&centro685_mci_gpio_table);
531519 }
532520 #endif
533521