.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Support for Cogent CSB726 |
---|
3 | 4 | * |
---|
4 | 5 | * 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 | | - * |
---|
10 | 6 | */ |
---|
11 | 7 | #include <linux/kernel.h> |
---|
12 | 8 | #include <linux/init.h> |
---|
13 | 9 | #include <linux/io.h> |
---|
14 | | -#include <linux/gpio.h> |
---|
| 10 | +#include <linux/gpio/machine.h> |
---|
15 | 11 | #include <linux/platform_device.h> |
---|
16 | 12 | #include <linux/mtd/physmap.h> |
---|
17 | 13 | #include <linux/mtd/partitions.h> |
---|
.. | .. |
---|
129 | 125 | .detect_delay_ms = 500, |
---|
130 | 126 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
---|
131 | 127 | /* 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 | + }, |
---|
135 | 141 | }; |
---|
136 | 142 | |
---|
137 | 143 | static struct pxaohci_platform_data csb726_ohci_platform_data = { |
---|
.. | .. |
---|
264 | 270 | pxa_set_stuart_info(NULL); |
---|
265 | 271 | pxa_set_i2c_info(NULL); |
---|
266 | 272 | pxa27x_set_i2c_power_info(NULL); |
---|
| 273 | + gpiod_add_lookup_table(&csb726_mci_gpio_table); |
---|
267 | 274 | pxa_set_mci_info(&csb726_mci); |
---|
268 | 275 | pxa_set_ohci_info(&csb726_ohci_platform_data); |
---|
269 | 276 | pxa_set_ac97_info(NULL); |
---|