hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/arm/mach-pxa/vpac270.c
....@@ -1,13 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Hardware definitions for Voipac PXA270
34 *
45 * Copyright (C) 2010
56 * Marek Vasut <marek.vasut@gmail.com>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
10
- *
117 */
128
139 #include <linux/platform_device.h>
....@@ -17,7 +13,7 @@
1713 #include <linux/input.h>
1814 #include <linux/leds.h>
1915 #include <linux/gpio.h>
20
-#include <linux/usb/gpio_vbus.h>
16
+#include <linux/gpio/machine.h>
2117 #include <linux/mtd/mtd.h>
2218 #include <linux/mtd/partitions.h>
2319 #include <linux/mtd/physmap.h>
....@@ -240,14 +236,23 @@
240236 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
241237 static struct pxamci_platform_data vpac270_mci_platform_data = {
242238 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
243
- .gpio_power = -1,
244
- .gpio_card_detect = GPIO53_VPAC270_SD_DETECT_N,
245
- .gpio_card_ro = GPIO52_VPAC270_SD_READONLY,
246239 .detect_delay_ms = 200,
240
+};
241
+
242
+static struct gpiod_lookup_table vpac270_mci_gpio_table = {
243
+ .dev_id = "pxa2xx-mci.0",
244
+ .table = {
245
+ GPIO_LOOKUP("gpio-pxa", GPIO53_VPAC270_SD_DETECT_N,
246
+ "cd", GPIO_ACTIVE_LOW),
247
+ GPIO_LOOKUP("gpio-pxa", GPIO52_VPAC270_SD_READONLY,
248
+ "wp", GPIO_ACTIVE_LOW),
249
+ { },
250
+ },
247251 };
248252
249253 static void __init vpac270_mmc_init(void)
250254 {
255
+ gpiod_add_lookup_table(&vpac270_mci_gpio_table);
251256 pxa_set_mci_info(&vpac270_mci_platform_data);
252257 }
253258 #else
....@@ -346,17 +351,18 @@
346351 * USB Gadget
347352 ******************************************************************************/
348353 #if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE)
349
-static struct gpio_vbus_mach_info vpac270_gpio_vbus_info = {
350
- .gpio_vbus = GPIO41_VPAC270_UDC_DETECT,
351
- .gpio_pullup = -1,
354
+static struct gpiod_lookup_table vpac270_gpio_vbus_gpiod_table = {
355
+ .dev_id = "gpio-vbus",
356
+ .table = {
357
+ GPIO_LOOKUP("gpio-pxa", GPIO41_VPAC270_UDC_DETECT,
358
+ "vbus", GPIO_ACTIVE_HIGH),
359
+ { },
360
+ },
352361 };
353362
354363 static struct platform_device vpac270_gpio_vbus = {
355364 .name = "gpio-vbus",
356365 .id = -1,
357
- .dev = {
358
- .platform_data = &vpac270_gpio_vbus_info,
359
- },
360366 };
361367
362368 static void vpac270_udc_command(int cmd)
....@@ -375,6 +381,7 @@
375381 static void __init vpac270_udc_init(void)
376382 {
377383 pxa_set_udc_info(&vpac270_udc_info);
384
+ gpiod_add_lookup_table(&vpac270_gpio_vbus_gpiod_table);
378385 platform_device_register(&vpac270_gpio_vbus);
379386 }
380387 #else