ARM: pxa: Add gpio descriptor lookup tables for MMC CD/WP

This adds GPIO descriptor look-up tables for a whole bunch
of PXA boards with MMC card detect (CD) and write protect (WP)
GPIO lines, so we can move away from the hard-coded GPIO
numberspace.

In some cases the platforms were compulsively including the
<linux/gpio.h> header even if they weren't actually using
it, and in these cases I simply replaced that inclusion with
the more appropriate <linux/gpio/machine.h> which is what
board files should be including most of the time.

Cc: Daniel Mack <daniel@zonque.org>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
这个提交包含在:
Linus Walleij
2018-12-02 09:43:22 +01:00
提交者 Ulf Hansson
父节点 5128f8d445
当前提交 32d1544880
修改 21 个文件,包含 322 行新增11 行删除

查看文件

@@ -20,6 +20,7 @@
#include <linux/input.h>
#include <linux/gpio_keys.h>
#include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <linux/mfd/da903x.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/fixed.h>
@@ -546,6 +547,15 @@ static inline void em_x270_init_ohci(void) {}
#if defined(CONFIG_MMC) || defined(CONFIG_MMC_MODULE)
static struct regulator *em_x270_sdio_ldo;
static struct gpiod_lookup_table em_x270_mci_wp_gpio_table = {
.dev_id = "pxa2xx-mci.0",
.table = {
/* Write protect on GPIO 95 */
GPIO_LOOKUP("gpio-pxa", GPIO95_MMC_WP, "wp", GPIO_ACTIVE_LOW),
{ },
},
};
static int em_x270_mci_init(struct device *dev,
irq_handler_t em_x270_detect_int,
void *data)
@@ -642,8 +652,10 @@ static struct pxamci_platform_data em_x270_mci_platform_data = {
static void __init em_x270_init_mmc(void)
{
if (machine_is_em_x270())
if (machine_is_em_x270()) {
em_x270_mci_platform_data.get_ro = em_x270_mci_get_ro;
gpiod_add_lookup_table(&em_x270_mci_wp_gpio_table);
}
pxa_set_mci_info(&em_x270_mci_platform_data);
}