Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d3de467 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: core: Add card detection IRQ restore"

parents 5a9ea48e 40bce510
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -132,6 +132,27 @@ int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio)
}
EXPORT_SYMBOL(mmc_gpio_request_ro);

void mmc_gpiod_free_cd_irq(struct mmc_host *host)
{
	devm_free_irq(host->parent, host->slot.cd_irq, host);
}
EXPORT_SYMBOL(mmc_gpiod_free_cd_irq);

void mmc_gpiod_restore_cd_irq(struct mmc_host *host)
{
	struct mmc_gpio *ctx = host->slot.handler_priv;
	int irq = host->slot.cd_irq;

	if (irq >= 0) {
		devm_request_threaded_irq(host->parent, irq,
			NULL, ctx->cd_gpio_isr,
			IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
			IRQF_ONESHOT,
			ctx->cd_label, host);
	}
}
EXPORT_SYMBOL(mmc_gpiod_restore_cd_irq);

void mmc_gpiod_request_cd_irq(struct mmc_host *host)
{
	struct mmc_gpio *ctx = host->slot.handler_priv;
+2 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id,
			 unsigned int debounce, bool *gpio_invert);
void mmc_gpio_set_cd_isr(struct mmc_host *host,
			 irqreturn_t (*isr)(int irq, void *dev_id));
void mmc_gpiod_free_cd_irq(struct mmc_host *host);
void mmc_gpiod_restore_cd_irq(struct mmc_host *host);
void mmc_gpiod_request_cd_irq(struct mmc_host *host);
bool mmc_can_gpio_cd(struct mmc_host *host);
void mmc_register_extcon(struct mmc_host *host);