Lines Matching +full:hs400 +full:- +full:cmd +full:- +full:int +full:- +full:delay

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>
21 unsigned int clock; /* clock rate */
23 unsigned int power_delay_ms; /* waiting for stable power */
106 int err);
110 int (*request_atomic)(struct mmc_host *host,
122 * ios->clock might be 0. For some controllers, setting 0Hz
132 * 1 for a read-only card
133 * -ENOSYS when not supported (equal to NULL callback)
136 int (*get_ro)(struct mmc_host *host);
142 * -ENOSYS when not supported (equal to NULL callback)
145 int (*get_cd)(struct mmc_host *host);
147 void (*enable_sdio_irq)(struct mmc_host *host, int enable);
154 int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios);
157 int (*card_busy)(struct mmc_host *host);
160 int (*execute_tuning)(struct mmc_host *host, u32 opcode);
162 /* Prepare HS400 target operating frequency depending host driver */
163 int (*prepare_hs400_tuning)(struct mmc_host *host, struct mmc_ios *ios);
165 /* Prepare switch to DDR during the HS400 init sequence */
166 int (*hs400_prepare_ddr)(struct mmc_host *host);
168 /* Prepare for switching from HS400 to HS200 */
171 /* Complete selection of HS400 */
177 int (*select_drive_strength)(struct mmc_card *card,
178 unsigned int max_dtr, int host_drv,
179 int card_drv, int *drv_type);
188 int (*multi_io_quirk)(struct mmc_card *card,
189 unsigned int direction, int blk_size);
192 int (*init_sd_express)(struct mmc_host *host, struct mmc_ios *ios);
197 int (*cqe_enable)(struct mmc_host *host, struct mmc_card *card);
198 /* Free resources, and make the CQE non-operational */
202 * effect of ->cqe_off().
204 int (*cqe_request)(struct mmc_host *host, struct mmc_request *mrq);
208 * Prepare the CQE and host controller to accept non-CQ commands. There
209 * is no corresponding ->cqe_on(), instead ->cqe_request() is required
217 int (*cqe_wait_for_idle)(struct mmc_host *host);
233 * (data->error or cmd->error for DCMD). Requests that did not error
250 * struct mmc_slot - MMC slot functions
252 * @cd_irq: MMC/SD-card slot hotplug detection IRQ or -EINVAL
253 * @handler_priv: MMC/SD-card slot context
255 * Some MMC/SD host controllers implement slot-functions like card and
256 * write-protect detection natively. However, a large number of controllers
258 * such slot-function drivers.
261 int cd_irq;
267 * mmc_context_info - synchronization details for mmc context
295 int index;
298 unsigned int f_min;
299 unsigned int f_max;
300 unsigned int f_init;
302 u32 ocr_avail_sdio; /* SDIO-specific OCR */
303 u32 ocr_avail_sd; /* SD-specific OCR */
304 u32 ocr_avail_mmc; /* MMC-specific OCR */
310 #define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */
331 #define MMC_CAP_MMC_HIGHSPEED (1 << 1) /* Can do MMC high-speed timing */
332 #define MMC_CAP_SD_HIGHSPEED (1 << 2) /* Can do SD high-speed timing */
335 #define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */
377 #define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */
378 #define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */
380 #define MMC_CAP2_HS400_1_8V (1 << 15) /* Can support HS400 1.8V */
381 #define MMC_CAP2_HS400_1_2V (1 << 16) /* Can support HS400 1.2V */
387 …_WRITE_PROTECT (1 << 18) /* No physical write protect pin, assume that card is always read-write */
401 #define MMC_CAP2_ALT_GPT_TEGRA (1 << 28) /* Host with eMMC that has GPT entry at a non-standard loc…
403 int fixed_drv_type; /* fixed driver type for non-removable media */
408 unsigned int max_seg_size; /* see blk_queue_max_segment_size */
411 unsigned int max_req_size; /* maximum number of bytes in one req */
412 unsigned int max_blk_size; /* maximum size of one mmc block */
413 unsigned int max_blk_count; /* maximum number of blocks in one req */
414 unsigned int max_busy_timeout; /* max busy timeout in ms */
422 unsigned int use_spi_crc:1;
423 unsigned int claimed:1; /* host exclusively claimed */
424 unsigned int doing_init_tune:1; /* initial tuning in progress */
425 unsigned int can_retune:1; /* re-tuning can be used */
426 unsigned int doing_retune:1; /* re-tuning in progress */
427 unsigned int retune_now:1; /* do re-tuning at next req */
428 unsigned int retune_paused:1; /* re-tuning is temporarily disabled */
429 unsigned int retune_crc_disable:1; /* don't trigger retune upon crc */
430 unsigned int can_dma_map_merge:1; /* merging can be used */
432 int rescan_disable; /* disable card detection */
433 int rescan_entered; /* used with nonremovable devices */
435 int need_retune; /* re-tuning is needed */
436 int hold_retune; /* hold off re-tuning */
437 unsigned int retune_period; /* re-tuning period in secs */
438 struct timer_list retune_timer; /* for periodic re-tuning */
446 int claim_cnt; /* "claim" nesting count */
450 int detect_change; /* card detect flag */
455 unsigned int sdio_irqs;
479 unsigned int actual_clock; /* Actual HC clock rate */
481 unsigned int slotno; /* used for sdio acpi binding */
483 int dsr_req; /* DSR value is valid */
489 int cqe_qdepth;
506 struct mmc_host *mmc_alloc_host(int extra, struct device *);
507 int mmc_add_host(struct mmc_host *);
512 int mmc_of_parse(struct mmc_host *host);
513 int mmc_of_parse_voltage(struct mmc_host *host, u32 *mask);
517 return (void *)host->private; in mmc_priv()
525 #define mmc_host_is_spi(host) ((host)->caps & MMC_CAP_SPI)
527 #define mmc_dev(x) ((x)->parent)
528 #define mmc_classdev(x) (&(x)->class_dev)
529 #define mmc_hostname(x) (dev_name(&(x)->class_dev))
531 void mmc_detect_change(struct mmc_host *, unsigned long delay);
543 return host->sdio_irqs > 0; in sdio_irq_claimed()
548 host->ops->enable_sdio_irq(host, 0); in mmc_signal_sdio_irq()
549 host->sdio_irq_pending = true; in mmc_signal_sdio_irq()
550 if (host->sdio_irq_thread) in mmc_signal_sdio_irq()
551 wake_up_process(host->sdio_irq_thread); in mmc_signal_sdio_irq()
557 int mmc_regulator_set_ocr(struct mmc_host *mmc,
560 int mmc_regulator_set_vqmmc(struct mmc_host *mmc, struct mmc_ios *ios);
562 static inline int mmc_regulator_set_ocr(struct mmc_host *mmc, in mmc_regulator_set_ocr()
569 static inline int mmc_regulator_set_vqmmc(struct mmc_host *mmc, in mmc_regulator_set_vqmmc()
572 return -EINVAL; in mmc_regulator_set_vqmmc()
576 int mmc_regulator_get_supply(struct mmc_host *mmc);
578 static inline int mmc_card_is_removable(struct mmc_host *host) in mmc_card_is_removable()
580 return !(host->caps & MMC_CAP_NONREMOVABLE); in mmc_card_is_removable()
583 static inline int mmc_card_keep_power(struct mmc_host *host) in mmc_card_keep_power()
585 return host->pm_flags & MMC_PM_KEEP_POWER; in mmc_card_keep_power()
588 static inline int mmc_card_wake_sdio_irq(struct mmc_host *host) in mmc_card_wake_sdio_irq()
590 return host->pm_flags & MMC_PM_WAKE_SDIO_IRQ; in mmc_card_wake_sdio_irq()
594 static inline int mmc_card_hs(struct mmc_card *card) in mmc_card_hs()
596 return card->host->ios.timing == MMC_TIMING_SD_HS || in mmc_card_hs()
597 card->host->ios.timing == MMC_TIMING_MMC_HS; in mmc_card_hs()
601 static inline int mmc_card_uhs(struct mmc_card *card) in mmc_card_uhs()
603 return card->host->ios.timing >= MMC_TIMING_UHS_SDR12 && in mmc_card_uhs()
604 card->host->ios.timing <= MMC_TIMING_UHS_DDR50; in mmc_card_uhs()
611 if (host->can_retune) in mmc_retune_needed()
612 host->need_retune = 1; in mmc_retune_needed()
617 return host->can_retune == 1; in mmc_can_retune()
622 return host->doing_retune == 1; in mmc_doing_retune()
627 return host->doing_retune == 1 || host->doing_init_tune == 1; in mmc_doing_tune()
632 return data->flags & MMC_DATA_WRITE ? DMA_TO_DEVICE : DMA_FROM_DEVICE; in mmc_get_dma_dir()
635 int mmc_send_tuning(struct mmc_host *host, u32 opcode, int *cmd_error);
636 int mmc_send_abort_tuning(struct mmc_host *host, u32 opcode);