Merge tag 'for-5.1-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave...
[sfrench/cifs-2.6.git] / include / linux / mmc / slot-gpio.h
1 /*
2  * Generic GPIO card-detect helper header
3  *
4  * Copyright (C) 2011, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
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
11 #ifndef MMC_SLOT_GPIO_H
12 #define MMC_SLOT_GPIO_H
13
14 #include <linux/types.h>
15 #include <linux/irqreturn.h>
16
17 struct mmc_host;
18
19 int mmc_gpio_get_ro(struct mmc_host *host);
20 int mmc_gpio_get_cd(struct mmc_host *host);
21 int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id,
22                          unsigned int idx, bool override_active_level,
23                          unsigned int debounce, bool *gpio_invert);
24 int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id,
25                          unsigned int idx,
26                          unsigned int debounce, bool *gpio_invert);
27 void mmc_gpio_set_cd_isr(struct mmc_host *host,
28                          irqreturn_t (*isr)(int irq, void *dev_id));
29 int mmc_gpio_set_cd_wake(struct mmc_host *host, bool on);
30 void mmc_gpiod_request_cd_irq(struct mmc_host *host);
31 bool mmc_can_gpio_cd(struct mmc_host *host);
32 bool mmc_can_gpio_ro(struct mmc_host *host);
33
34 #endif