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>
108 * ios->clock might be 0. For some controllers, setting 0Hz
110 * explicitly need to disable the clock. Otherwise e.g. voltage
118 * 1 for a read-only card
119 * -ENOSYS when not supported (equal to NULL callback)
128 * -ENOSYS when not supported (equal to NULL callback)
179 /* Allocate resources, and make the CQE operational */
181 /* Free resources, and make the CQE non-operational */
184 * Issue a read, write or DCMD request to the CQE. Also deal with the
185 * effect of ->cqe_off().
191 * Prepare the CQE and host controller to accept non-CQ commands. There
192 * is no corresponding ->cqe_on(), instead ->cqe_request() is required
197 * Wait for all CQE tasks to complete. Return an error if recovery
202 * Notify CQE that a request has timed out. Return false if the request
209 * Stop all CQE activity and prepare the CQE and host controller to
216 * (data->error or cmd->error for DCMD). Requests that did not error
233 * struct mmc_slot - MMC slot functions
235 * @cd_irq: MMC/SD-card slot hotplug detection IRQ or -EINVAL
236 * @handler_priv: MMC/SD-card slot context
238 * Some MMC/SD host controllers implement slot-functions like card and
239 * write-protect detection natively. However, a large number of controllers
241 * such slot-function drivers.
250 * mmc_context_info - synchronization details for mmc context
285 u32 ocr_avail_sdio; /* SDIO-specific OCR */
286 u32 ocr_avail_sd; /* SD-specific OCR */
287 u32 ocr_avail_mmc; /* MMC-specific OCR */
296 #define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */
317 #define MMC_CAP_MMC_HIGHSPEED (1 << 1) /* Can do MMC high-speed timing */
318 #define MMC_CAP_SD_HIGHSPEED (1 << 2) /* Can do SD high-speed timing */
321 #define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */
361 #define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */
362 #define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */
371 …_WRITE_PROTECT (1 << 18) /* No physical write protect pin, assume that card is always read-write */
377 #define MMC_CAP2_CQE_DCMD (1 << 24) /* CQE can issue a direct command */
381 int fixed_drv_type; /* fixed driver type for non-removable media */
404 unsigned int can_retune:1; /* re-tuning can be used */
405 unsigned int doing_retune:1; /* re-tuning in progress */
406 unsigned int retune_now:1; /* do re-tuning at next req */
407 unsigned int retune_paused:1; /* re-tuning is temporarily disabled */
408 unsigned int use_blk_mq:1; /* use blk-mq */
412 int rescan_disable; /* disable card detection */
415 int need_retune; /* re-tuning is needed */
416 int hold_retune; /* hold off re-tuning */
417 unsigned int retune_period; /* re-tuning period in secs */
418 struct timer_list retune_timer; /* for periodic re-tuning */
467 /* Command Queue Engine (CQE) support */
491 return (void *)host->private; in mmc_priv()
499 #define mmc_host_is_spi(host) ((host)->caps & MMC_CAP_SPI)
501 #define mmc_dev(x) ((x)->parent)
502 #define mmc_classdev(x) (&(x)->class_dev)
503 #define mmc_hostname(x) (dev_name(&(x)->class_dev))
517 return host->sdio_irqs > 0; in sdio_irq_claimed()
522 host->ops->enable_sdio_irq(host, 0); in mmc_signal_sdio_irq()
523 host->sdio_irq_pending = true; in mmc_signal_sdio_irq()
524 if (host->sdio_irq_thread) in mmc_signal_sdio_irq()
525 wake_up_process(host->sdio_irq_thread); in mmc_signal_sdio_irq()
546 return -EINVAL; in mmc_regulator_set_vqmmc()
554 return !(host->caps & MMC_CAP_NONREMOVABLE); in mmc_card_is_removable()
559 return host->pm_flags & MMC_PM_KEEP_POWER; in mmc_card_keep_power()
564 return host->pm_flags & MMC_PM_WAKE_SDIO_IRQ; in mmc_card_wake_sdio_irq()
570 return card->host->ios.timing == MMC_TIMING_SD_HS || in mmc_card_hs()
571 card->host->ios.timing == MMC_TIMING_MMC_HS; in mmc_card_hs()
577 return card->host->ios.timing >= MMC_TIMING_UHS_SDR12 && in mmc_card_uhs()
578 card->host->ios.timing <= MMC_TIMING_UHS_DDR50; in mmc_card_uhs()
585 if (host->can_retune) in mmc_retune_needed()
586 host->need_retune = 1; in mmc_retune_needed()
591 return host->can_retune == 1; in mmc_can_retune()
596 return host->doing_retune == 1; in mmc_doing_retune()
601 return host->doing_retune == 1 || host->doing_init_tune == 1; in mmc_doing_tune()
606 return data->flags & MMC_DATA_WRITE ? DMA_TO_DEVICE : DMA_FROM_DEVICE; in mmc_get_dma_dir()