Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: core: expose the capability of gpio card detect

Add new helper API mmc_can_gpio_cd for slot-gpio to make
host drivers know whether it supports gpio card detect.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Shawn Lin and committed by
Ulf Hansson
50fcbbbb f9014268

+9
+8
drivers/mmc/core/slot-gpio.c
··· 258 258 } 259 259 EXPORT_SYMBOL(mmc_gpiod_request_cd); 260 260 261 + bool mmc_can_gpio_cd(struct mmc_host *host) 262 + { 263 + struct mmc_gpio *ctx = host->slot.handler_priv; 264 + 265 + return ctx->cd_gpio ? true : false; 266 + } 267 + EXPORT_SYMBOL(mmc_can_gpio_cd); 268 + 261 269 /** 262 270 * mmc_gpiod_request_ro - request a gpio descriptor for write protection 263 271 * @host: mmc host
+1
include/linux/mmc/slot-gpio.h
··· 29 29 void mmc_gpio_set_cd_isr(struct mmc_host *host, 30 30 irqreturn_t (*isr)(int irq, void *dev_id)); 31 31 void mmc_gpiod_request_cd_irq(struct mmc_host *host); 32 + bool mmc_can_gpio_cd(struct mmc_host *host); 32 33 33 34 #endif