#include <linux/module.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/completion.h>
#include <linux/device.h>
#include <linux/delay.h>
#include <linux/pagemap.h>
#include <linux/err.h>
#include <linux/leds.h>
#include <linux/scatterlist.h>
#include <linux/log2.h>
#include <linux/pm_runtime.h>
#include <linux/pm_wakeup.h>
#include <linux/suspend.h>
#include <linux/fault-inject.h>
#include <linux/random.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/mmc/card.h>
#include <linux/mmc/host.h>
#include <linux/mmc/mmc.h>
#include <linux/mmc/sd.h>
#include <linux/mmc/slot-gpio.h>
#define CREATE_TRACE_POINTS
#include <trace/events/mmc.h>
#include "core.h"
#include "card.h"
#include "crypto.h"
#include "bus.h"
#include "host.h"
#include "sdio_bus.h"
#include "pwrseq.h"
#include "mmc_ops.h"
#include "sd_ops.h"
#include "sdio_ops.h"
#define MMC_ERASE_TIMEOUT_MS …
#define SD_DISCARD_TIMEOUT_MS …
static const unsigned freqs[] = …;
bool use_spi_crc = …;
module_param(use_spi_crc, bool, 0);
static int mmc_schedule_delayed_work(struct delayed_work *work,
unsigned long delay)
{ … }
#ifdef CONFIG_FAIL_MMC_REQUEST
static void mmc_should_fail_request(struct mmc_host *host,
struct mmc_request *mrq)
{ … }
#else
static inline void mmc_should_fail_request(struct mmc_host *host,
struct mmc_request *mrq)
{
}
#endif
static inline void mmc_complete_cmd(struct mmc_request *mrq)
{ … }
void mmc_command_done(struct mmc_host *host, struct mmc_request *mrq)
{ … }
EXPORT_SYMBOL(…);
void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq)
{ … }
EXPORT_SYMBOL(…);
static void __mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
{ … }
static void mmc_mrq_pr_debug(struct mmc_host *host, struct mmc_request *mrq,
bool cqe)
{ … }
static int mmc_mrq_prep(struct mmc_host *host, struct mmc_request *mrq)
{ … }
int mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
{ … }
EXPORT_SYMBOL(…);
static void mmc_wait_done(struct mmc_request *mrq)
{ … }
static inline void mmc_wait_ongoing_tfr_cmd(struct mmc_host *host)
{ … }
static int __mmc_start_req(struct mmc_host *host, struct mmc_request *mrq)
{ … }
void mmc_wait_for_req_done(struct mmc_host *host, struct mmc_request *mrq)
{ … }
EXPORT_SYMBOL(…);
int mmc_cqe_start_req(struct mmc_host *host, struct mmc_request *mrq)
{ … }
EXPORT_SYMBOL(…);
void mmc_cqe_request_done(struct mmc_host *host, struct mmc_request *mrq)
{ … }
EXPORT_SYMBOL(…);
void mmc_cqe_post_req(struct mmc_host *host, struct mmc_request *mrq)
{ … }
EXPORT_SYMBOL(…);
#define MMC_CQE_RECOVERY_TIMEOUT …
int mmc_cqe_recovery(struct mmc_host *host)
{ … }
EXPORT_SYMBOL(…);
bool mmc_is_req_done(struct mmc_host *host, struct mmc_request *mrq)
{ … }
EXPORT_SYMBOL(…);
void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq)
{ … }
EXPORT_SYMBOL(…);
int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd, int retries)
{ … }
EXPORT_SYMBOL(…);
void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card)
{ … }
EXPORT_SYMBOL(…);
static inline bool mmc_ctx_matches(struct mmc_host *host, struct mmc_ctx *ctx,
struct task_struct *task)
{ … }
static inline void mmc_ctx_set_claimer(struct mmc_host *host,
struct mmc_ctx *ctx,
struct task_struct *task)
{ … }
int __mmc_claim_host(struct mmc_host *host, struct mmc_ctx *ctx,
atomic_t *abort)
{ … }
EXPORT_SYMBOL(…);
void mmc_release_host(struct mmc_host *host)
{ … }
EXPORT_SYMBOL(…);
void mmc_get_card(struct mmc_card *card, struct mmc_ctx *ctx)
{ … }
EXPORT_SYMBOL(…);
void mmc_put_card(struct mmc_card *card, struct mmc_ctx *ctx)
{ … }
EXPORT_SYMBOL(…);
static inline void mmc_set_ios(struct mmc_host *host)
{ … }
void mmc_set_chip_select(struct mmc_host *host, int mode)
{ … }
void mmc_set_clock(struct mmc_host *host, unsigned int hz)
{ … }
int mmc_execute_tuning(struct mmc_card *card)
{ … }
void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode)
{ … }
void mmc_set_bus_width(struct mmc_host *host, unsigned int width)
{ … }
void mmc_set_initial_state(struct mmc_host *host)
{ … }
static int mmc_vdd_to_ocrbitnum(int vdd, bool low_bits)
{ … }
u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max)
{ … }
static int mmc_of_get_func_num(struct device_node *node)
{ … }
struct device_node *mmc_of_find_child_device(struct mmc_host *host,
unsigned func_num)
{ … }
u32 mmc_select_voltage(struct mmc_host *host, u32 ocr)
{ … }
int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage)
{ … }
void mmc_set_initial_signal_voltage(struct mmc_host *host)
{ … }
int mmc_host_set_uhs_voltage(struct mmc_host *host)
{ … }
int mmc_set_uhs_voltage(struct mmc_host *host, u32 ocr)
{ … }
void mmc_set_timing(struct mmc_host *host, unsigned int timing)
{ … }
void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type)
{ … }
int mmc_select_drive_strength(struct mmc_card *card, unsigned int max_dtr,
int card_drv_type, int *drv_type)
{ … }
void mmc_power_up(struct mmc_host *host, u32 ocr)
{ … }
void mmc_power_off(struct mmc_host *host)
{ … }
void mmc_power_cycle(struct mmc_host *host, u32 ocr)
{ … }
void mmc_attach_bus(struct mmc_host *host, const struct mmc_bus_ops *ops)
{ … }
void mmc_detach_bus(struct mmc_host *host)
{ … }
void _mmc_detect_change(struct mmc_host *host, unsigned long delay, bool cd_irq)
{ … }
void mmc_detect_change(struct mmc_host *host, unsigned long delay)
{ … }
EXPORT_SYMBOL(…);
void mmc_init_erase(struct mmc_card *card)
{ … }
static bool is_trim_arg(unsigned int arg)
{ … }
static unsigned int mmc_mmc_erase_timeout(struct mmc_card *card,
unsigned int arg, unsigned int qty)
{ … }
static unsigned int mmc_sd_erase_timeout(struct mmc_card *card,
unsigned int arg,
unsigned int qty)
{ … }
static unsigned int mmc_erase_timeout(struct mmc_card *card,
unsigned int arg,
unsigned int qty)
{ … }
static int mmc_do_erase(struct mmc_card *card, unsigned int from,
unsigned int to, unsigned int arg)
{ … }
static unsigned int mmc_align_erase_size(struct mmc_card *card,
unsigned int *from,
unsigned int *to,
unsigned int nr)
{ … }
int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr,
unsigned int arg)
{ … }
EXPORT_SYMBOL(…);
int mmc_can_erase(struct mmc_card *card)
{ … }
EXPORT_SYMBOL(…);
int mmc_can_trim(struct mmc_card *card)
{ … }
EXPORT_SYMBOL(…);
int mmc_can_discard(struct mmc_card *card)
{ … }
EXPORT_SYMBOL(…);
int mmc_can_sanitize(struct mmc_card *card)
{ … }
int mmc_can_secure_erase_trim(struct mmc_card *card)
{ … }
EXPORT_SYMBOL(…);
int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
unsigned int nr)
{ … }
EXPORT_SYMBOL(…);
static unsigned int mmc_do_calc_max_discard(struct mmc_card *card,
unsigned int arg)
{ … }
unsigned int mmc_calc_max_discard(struct mmc_card *card)
{ … }
EXPORT_SYMBOL(…);
bool mmc_card_is_blockaddr(struct mmc_card *card)
{ … }
EXPORT_SYMBOL(…);
int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen)
{ … }
EXPORT_SYMBOL(…);
static void mmc_hw_reset_for_init(struct mmc_host *host)
{ … }
int mmc_hw_reset(struct mmc_card *card)
{ … }
EXPORT_SYMBOL(…);
int mmc_sw_reset(struct mmc_card *card)
{ … }
EXPORT_SYMBOL(…);
static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
{ … }
int _mmc_detect_card_removed(struct mmc_host *host)
{ … }
int mmc_detect_card_removed(struct mmc_host *host)
{ … }
EXPORT_SYMBOL(…);
int mmc_card_alternative_gpt_sector(struct mmc_card *card, sector_t *gpt_sector)
{ … }
EXPORT_SYMBOL(…);
void mmc_rescan(struct work_struct *work)
{ … }
void mmc_start_host(struct mmc_host *host)
{ … }
void __mmc_stop_host(struct mmc_host *host)
{ … }
void mmc_stop_host(struct mmc_host *host)
{ … }
static int __init mmc_init(void)
{ … }
static void __exit mmc_exit(void)
{ … }
subsys_initcall(mmc_init);
module_exit(mmc_exit);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;