.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Hardware definitions for Voipac PXA270 |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2010 |
---|
5 | 6 | * 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 | | - * |
---|
11 | 7 | */ |
---|
12 | 8 | |
---|
13 | 9 | #include <linux/platform_device.h> |
---|
.. | .. |
---|
17 | 13 | #include <linux/input.h> |
---|
18 | 14 | #include <linux/leds.h> |
---|
19 | 15 | #include <linux/gpio.h> |
---|
20 | | -#include <linux/usb/gpio_vbus.h> |
---|
| 16 | +#include <linux/gpio/machine.h> |
---|
21 | 17 | #include <linux/mtd/mtd.h> |
---|
22 | 18 | #include <linux/mtd/partitions.h> |
---|
23 | 19 | #include <linux/mtd/physmap.h> |
---|
.. | .. |
---|
240 | 236 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) |
---|
241 | 237 | static struct pxamci_platform_data vpac270_mci_platform_data = { |
---|
242 | 238 | .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, |
---|
246 | 239 | .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 | + }, |
---|
247 | 251 | }; |
---|
248 | 252 | |
---|
249 | 253 | static void __init vpac270_mmc_init(void) |
---|
250 | 254 | { |
---|
| 255 | + gpiod_add_lookup_table(&vpac270_mci_gpio_table); |
---|
251 | 256 | pxa_set_mci_info(&vpac270_mci_platform_data); |
---|
252 | 257 | } |
---|
253 | 258 | #else |
---|
.. | .. |
---|
346 | 351 | * USB Gadget |
---|
347 | 352 | ******************************************************************************/ |
---|
348 | 353 | #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 | + }, |
---|
352 | 361 | }; |
---|
353 | 362 | |
---|
354 | 363 | static struct platform_device vpac270_gpio_vbus = { |
---|
355 | 364 | .name = "gpio-vbus", |
---|
356 | 365 | .id = -1, |
---|
357 | | - .dev = { |
---|
358 | | - .platform_data = &vpac270_gpio_vbus_info, |
---|
359 | | - }, |
---|
360 | 366 | }; |
---|
361 | 367 | |
---|
362 | 368 | static void vpac270_udc_command(int cmd) |
---|
.. | .. |
---|
375 | 381 | static void __init vpac270_udc_init(void) |
---|
376 | 382 | { |
---|
377 | 383 | pxa_set_udc_info(&vpac270_udc_info); |
---|
| 384 | + gpiod_add_lookup_table(&vpac270_gpio_vbus_gpiod_table); |
---|
378 | 385 | platform_device_register(&vpac270_gpio_vbus); |
---|
379 | 386 | } |
---|
380 | 387 | #else |
---|