forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/arch/arm/mach-pxa/colibri-evalboard.c
....@@ -1,20 +1,17 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/arm/mach-pxa/colibri-evalboard.c
34 *
45 * Support for Toradex Colibri Evaluation Carrier Board
56 * Daniel Mack <daniel@caiaq.de>
67 * Marek Vasut <marek.vasut@gmail.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
118 */
129
1310 #include <linux/init.h>
1411 #include <linux/kernel.h>
1512 #include <linux/platform_device.h>
1613 #include <linux/interrupt.h>
17
-#include <linux/gpio.h>
14
+#include <linux/gpio/machine.h>
1815 #include <asm/mach-types.h>
1916 #include <mach/hardware.h>
2017 #include <asm/mach/arch.h>
....@@ -37,22 +34,44 @@
3734 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
3835 static struct pxamci_platform_data colibri_mci_platform_data = {
3936 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
40
- .gpio_power = -1,
41
- .gpio_card_ro = -1,
4237 .detect_delay_ms = 200,
38
+};
39
+
40
+static struct gpiod_lookup_table colibri_pxa270_mci_gpio_table = {
41
+ .dev_id = "pxa2xx-mci.0",
42
+ .table = {
43
+ GPIO_LOOKUP("gpio-pxa", GPIO0_COLIBRI_PXA270_SD_DETECT,
44
+ "cd", GPIO_ACTIVE_LOW),
45
+ { },
46
+ },
47
+};
48
+
49
+static struct gpiod_lookup_table colibri_pxa300_mci_gpio_table = {
50
+ .dev_id = "pxa2xx-mci.0",
51
+ .table = {
52
+ GPIO_LOOKUP("gpio-pxa", GPIO13_COLIBRI_PXA300_SD_DETECT,
53
+ "cd", GPIO_ACTIVE_LOW),
54
+ { },
55
+ },
56
+};
57
+
58
+static struct gpiod_lookup_table colibri_pxa320_mci_gpio_table = {
59
+ .dev_id = "pxa2xx-mci.0",
60
+ .table = {
61
+ GPIO_LOOKUP("gpio-pxa", GPIO28_COLIBRI_PXA320_SD_DETECT,
62
+ "cd", GPIO_ACTIVE_LOW),
63
+ { },
64
+ },
4365 };
4466
4567 static void __init colibri_mmc_init(void)
4668 {
4769 if (machine_is_colibri()) /* PXA270 Colibri */
48
- colibri_mci_platform_data.gpio_card_detect =
49
- GPIO0_COLIBRI_PXA270_SD_DETECT;
70
+ gpiod_add_lookup_table(&colibri_pxa270_mci_gpio_table);
5071 if (machine_is_colibri300()) /* PXA300 Colibri */
51
- colibri_mci_platform_data.gpio_card_detect =
52
- GPIO13_COLIBRI_PXA300_SD_DETECT;
72
+ gpiod_add_lookup_table(&colibri_pxa300_mci_gpio_table);
5373 else /* PXA320 Colibri */
54
- colibri_mci_platform_data.gpio_card_detect =
55
- GPIO28_COLIBRI_PXA320_SD_DETECT;
74
+ gpiod_add_lookup_table(&colibri_pxa320_mci_gpio_table);
5675
5776 pxa_set_mci_info(&colibri_mci_platform_data);
5877 }