Lines Matching +full:disable +full:- +full:cqe +full:- +full:dcmd
1 /* SPDX-License-Identifier: GPL-2.0-only */
12 #include <linux/fault-inject.h>
17 #include <linux/dma-direction.h>
18 #include <linux/keyslot-manager.h>
112 * ios->clock might be 0. For some controllers, setting 0Hz
114 * explicitly need to disable the clock. Otherwise e.g. voltage
122 * 1 for a read-only card
123 * -ENOSYS when not supported (equal to NULL callback)
132 * -ENOSYS when not supported (equal to NULL callback)
186 /* Allocate resources, and make the CQE operational */
188 /* Free resources, and make the CQE non-operational */
191 * Issue a read, write or DCMD request to the CQE. Also deal with the
192 * effect of ->cqe_off().
198 * Prepare the CQE and host controller to accept non-CQ commands. There
199 * is no corresponding ->cqe_on(), instead ->cqe_request() is required
204 * Wait for all CQE tasks to complete. Return an error if recovery
209 * Notify CQE that a request has timed out. Return false if the request
216 * Stop all CQE activity and prepare the CQE and host controller to
223 * (data->error or cmd->error for DCMD). Requests that did not error
243 * struct mmc_slot - MMC slot functions
245 * @cd_irq: MMC/SD-card slot hotplug detection IRQ or -EINVAL
246 * @handler_priv: MMC/SD-card slot context
248 * Some MMC/SD host controllers implement slot-functions like card and
249 * write-protect detection natively. However, a large number of controllers
251 * such slot-function drivers.
261 * mmc_context_info - synchronization details for mmc context
296 u32 ocr_avail_sdio; /* SDIO-specific OCR */
297 u32 ocr_avail_sd; /* SD-specific OCR */
298 u32 ocr_avail_mmc; /* MMC-specific OCR */
304 #define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */
325 #define MMC_CAP_MMC_HIGHSPEED (1 << 1) /* Can do MMC high-speed timing */
326 #define MMC_CAP_SD_HIGHSPEED (1 << 2) /* Can do SD high-speed timing */
329 #define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */
369 #define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */
370 #define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */
379 …_WRITE_PROTECT (1 << 18) /* No physical write protect pin, assume that card is always read-write */
385 #define MMC_CAP2_CQE_DCMD (1 << 24) /* CQE can issue a direct command */
394 int fixed_drv_type; /* fixed driver type for non-removable media */
417 unsigned int can_retune:1; /* re-tuning can be used */
418 unsigned int doing_retune:1; /* re-tuning in progress */
419 unsigned int retune_now:1; /* do re-tuning at next req */
420 unsigned int retune_paused:1; /* re-tuning is temporarily disabled */
421 unsigned int use_blk_mq:1; /* use blk-mq */
425 int rescan_disable; /* disable card detection */
428 int need_retune; /* re-tuning is needed */
429 int hold_retune; /* hold off re-tuning */
430 unsigned int retune_period; /* re-tuning period in secs */
431 struct timer_list retune_timer; /* for periodic re-tuning */
480 /* Command Queue Engine (CQE) support */
514 return (void *)host->private; in mmc_priv()
522 #define mmc_host_is_spi(host) ((host)->caps & MMC_CAP_SPI)
524 #define mmc_dev(x) ((x)->parent)
525 #define mmc_classdev(x) (&(x)->class_dev)
526 #define mmc_hostname(x) (dev_name(&(x)->class_dev))
540 return host->sdio_irqs > 0; in sdio_irq_claimed()
545 host->ops->enable_sdio_irq(host, 0); in mmc_signal_sdio_irq()
546 host->sdio_irq_pending = true; in mmc_signal_sdio_irq()
547 if (host->sdio_irq_thread) in mmc_signal_sdio_irq()
548 wake_up_process(host->sdio_irq_thread); in mmc_signal_sdio_irq()
569 return -EINVAL; in mmc_regulator_set_vqmmc()
577 return !(host->caps & MMC_CAP_NONREMOVABLE); in mmc_card_is_removable()
582 return host->pm_flags & MMC_PM_KEEP_POWER; in mmc_card_keep_power()
587 return host->pm_flags & MMC_PM_WAKE_SDIO_IRQ; in mmc_card_wake_sdio_irq()
593 return card->host->ios.timing == MMC_TIMING_SD_HS || in mmc_card_hs()
594 card->host->ios.timing == MMC_TIMING_MMC_HS; in mmc_card_hs()
600 return card->host->ios.timing >= MMC_TIMING_UHS_SDR12 && in mmc_card_uhs()
601 card->host->ios.timing <= MMC_TIMING_UHS_DDR50; in mmc_card_uhs()
608 if (host->can_retune) in mmc_retune_needed()
609 host->need_retune = 1; in mmc_retune_needed()
614 return host->can_retune == 1; in mmc_can_retune()
619 return host->doing_retune == 1; in mmc_doing_retune()
624 return host->doing_retune == 1 || host->doing_init_tune == 1; in mmc_doing_tune()
629 return data->flags & MMC_DATA_WRITE ? DMA_TO_DEVICE : DMA_FROM_DEVICE; in mmc_get_dma_dir()