History

mmc: core: Add helper function to indicate if SDIO IRQs is enabled

To avoid each host driver supporting SDIO IRQs, from keeping track internally about if SDIO IRQs has been claimed, let's introduce a common helper function, sdio_irq_claimed(). The function returns true if SDIO IRQs are claimed, via using the information about the number of claimed irqs. This is safe, even without any locks, as long as the helper function is called only from runtime/system suspend callbacks of the host driver.

Ulf Hansson committed 7 years ago

Commit bd880b01 parent 20964a11 file · +9 −0Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/mmc/host.h+9−0
@@ -493,6 +493,15 @@ void mmc_command_done(struct mmc_host *host, struct mmc_request *mrq); · 492 unmodified lines
493 493
494void mmc_cqe_request_done(struct mmc_host *host, struct mmc_request *mrq);494void mmc_cqe_request_done(struct mmc_host *host, struct mmc_request *mrq);
495 495
496/*
497 * May be called from host driver's system/runtime suspend/resume callbacks,
498 * to know if SDIO IRQs has been claimed.
499 */
500static inline bool sdio_irq_claimed(struct mmc_host *host)
501{
502 return host->sdio_irqs > 0;
503}
504
496static inline void mmc_signal_sdio_irq(struct mmc_host *host)505static inline void mmc_signal_sdio_irq(struct mmc_host *host)
497{506{
498 host->ops->enable_sdio_irq(host, 0);507 host->ops->enable_sdio_irq(host, 0);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t