hc
2024-09-20 a36159eec6ca17402b0e146b86efaf76568dc353
kernel/arch/arm/mach-pxa/littleton.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/arm/mach-pxa/littleton.c
34 *
....@@ -9,10 +10,6 @@
910 *
1011 * 2007-11-22 modified to align with latest kernel
1112 * eric miao <eric.miao@marvell.com>
12
- *
13
- * This program is free software; you can redistribute it and/or modify
14
- * it under the terms of the GNU General Public License version 2 as
15
- * publishhed by the Free Software Foundation.
1613 */
1714
1815 #include <linux/init.h>
....@@ -20,7 +17,7 @@
2017 #include <linux/delay.h>
2118 #include <linux/platform_device.h>
2219 #include <linux/clk.h>
23
-#include <linux/gpio.h>
20
+#include <linux/gpio/machine.h>
2421 #include <linux/spi/spi.h>
2522 #include <linux/spi/pxa2xx_spi.h>
2623 #include <linux/smc91x.h>
....@@ -50,8 +47,6 @@
5047 #include <linux/platform_data/mtd-nand-pxa3xx.h>
5148
5249 #include "generic.h"
53
-
54
-#define GPIO_MMC1_CARD_DETECT mfp_to_gpio(MFP_PIN_GPIO15)
5550
5651 /* Littleton MFP configurations */
5752 static mfp_cfg_t littleton_mfp_cfg[] __initdata = {
....@@ -193,7 +188,7 @@
193188 #endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */
194189
195190 #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
196
-static struct pxa2xx_spi_master littleton_spi_info = {
191
+static struct pxa2xx_spi_controller littleton_spi_info = {
197192 .num_chipselect = 1,
198193 };
199194
....@@ -278,13 +273,21 @@
278273 static struct pxamci_platform_data littleton_mci_platform_data = {
279274 .detect_delay_ms = 200,
280275 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
281
- .gpio_card_detect = GPIO_MMC1_CARD_DETECT,
282
- .gpio_card_ro = -1,
283
- .gpio_power = -1,
276
+};
277
+
278
+static struct gpiod_lookup_table littleton_mci_gpio_table = {
279
+ .dev_id = "pxa2xx-mci.0",
280
+ .table = {
281
+ /* Card detect on MFP (gpio-pxa) GPIO 15 */
282
+ GPIO_LOOKUP("gpio-pxa", MFP_PIN_GPIO15,
283
+ "cd", GPIO_ACTIVE_LOW),
284
+ { },
285
+ },
284286 };
285287
286288 static void __init littleton_init_mmc(void)
287289 {
290
+ gpiod_add_lookup_table(&littleton_mci_gpio_table);
288291 pxa_set_mci_info(&littleton_mci_platform_data);
289292 }
290293 #else