Skip to content

Commit

Permalink
mmc: slot-gpio: add a helper to check capability of GPIO WP detection
Browse files Browse the repository at this point in the history
Like mmc_can_gpio_cd(), mmc_can_gpio_ro() will also be useful for host
drivers to know whether GPIO write-protect detection is supported.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Masahiro Yamada authored and Ulf Hansson committed Jan 18, 2018
1 parent bc45719 commit 85f9ef8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/mmc/core/slot-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,11 @@ int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id,
return 0;
}
EXPORT_SYMBOL(mmc_gpiod_request_ro);

bool mmc_can_gpio_ro(struct mmc_host *host)
{
struct mmc_gpio *ctx = host->slot.handler_priv;

return ctx->ro_gpio ? true : false;
}
EXPORT_SYMBOL(mmc_can_gpio_ro);
1 change: 1 addition & 0 deletions include/linux/mmc/slot-gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ void mmc_gpio_set_cd_isr(struct mmc_host *host,
irqreturn_t (*isr)(int irq, void *dev_id));
void mmc_gpiod_request_cd_irq(struct mmc_host *host);
bool mmc_can_gpio_cd(struct mmc_host *host);
bool mmc_can_gpio_ro(struct mmc_host *host);

#endif

0 comments on commit 85f9ef8

Please sign in to comment.