hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/arm/mach-pxa/csb726.c
....@@ -1,17 +1,13 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Support for Cogent CSB726
34 *
45 * Copyright (c) 2008 Dmitry Eremin-Solenikov
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
9
- *
106 */
117 #include <linux/kernel.h>
128 #include <linux/init.h>
139 #include <linux/io.h>
14
-#include <linux/gpio.h>
10
+#include <linux/gpio/machine.h>
1511 #include <linux/platform_device.h>
1612 #include <linux/mtd/physmap.h>
1713 #include <linux/mtd/partitions.h>
....@@ -129,9 +125,19 @@
129125 .detect_delay_ms = 500,
130126 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
131127 /* FIXME setpower */
132
- .gpio_card_detect = CSB726_GPIO_MMC_DETECT,
133
- .gpio_card_ro = CSB726_GPIO_MMC_RO,
134
- .gpio_power = -1,
128
+};
129
+
130
+static struct gpiod_lookup_table csb726_mci_gpio_table = {
131
+ .dev_id = "pxa2xx-mci.0",
132
+ .table = {
133
+ /* Card detect on GPIO 100 */
134
+ GPIO_LOOKUP("gpio-pxa", CSB726_GPIO_MMC_DETECT,
135
+ "cd", GPIO_ACTIVE_LOW),
136
+ /* Write protect on GPIO 101 */
137
+ GPIO_LOOKUP("gpio-pxa", CSB726_GPIO_MMC_RO,
138
+ "wp", GPIO_ACTIVE_LOW),
139
+ { },
140
+ },
135141 };
136142
137143 static struct pxaohci_platform_data csb726_ohci_platform_data = {
....@@ -264,6 +270,7 @@
264270 pxa_set_stuart_info(NULL);
265271 pxa_set_i2c_info(NULL);
266272 pxa27x_set_i2c_power_info(NULL);
273
+ gpiod_add_lookup_table(&csb726_mci_gpio_table);
267274 pxa_set_mci_info(&csb726_mci);
268275 pxa_set_ohci_info(&csb726_ohci_platform_data);
269276 pxa_set_ac97_info(NULL);