.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * linux/arch/arm/mach-pxa/colibri-evalboard.c |
---|
3 | 4 | * |
---|
4 | 5 | * Support for Toradex Colibri Evaluation Carrier Board |
---|
5 | 6 | * Daniel Mack <daniel@caiaq.de> |
---|
6 | 7 | * 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. |
---|
11 | 8 | */ |
---|
12 | 9 | |
---|
13 | 10 | #include <linux/init.h> |
---|
14 | 11 | #include <linux/kernel.h> |
---|
15 | 12 | #include <linux/platform_device.h> |
---|
16 | 13 | #include <linux/interrupt.h> |
---|
17 | | -#include <linux/gpio.h> |
---|
| 14 | +#include <linux/gpio/machine.h> |
---|
18 | 15 | #include <asm/mach-types.h> |
---|
19 | 16 | #include <mach/hardware.h> |
---|
20 | 17 | #include <asm/mach/arch.h> |
---|
.. | .. |
---|
37 | 34 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) |
---|
38 | 35 | static struct pxamci_platform_data colibri_mci_platform_data = { |
---|
39 | 36 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
---|
40 | | - .gpio_power = -1, |
---|
41 | | - .gpio_card_ro = -1, |
---|
42 | 37 | .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 | + }, |
---|
43 | 65 | }; |
---|
44 | 66 | |
---|
45 | 67 | static void __init colibri_mmc_init(void) |
---|
46 | 68 | { |
---|
47 | 69 | 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); |
---|
50 | 71 | 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); |
---|
53 | 73 | 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); |
---|
56 | 75 | |
---|
57 | 76 | pxa_set_mci_info(&colibri_mci_platform_data); |
---|
58 | 77 | } |
---|