#include <linux/err.h>
#include <linux/sizes.h>
#include <linux/slab.h>
#include <linux/stat.h>
#include <linux/pm_runtime.h>
#include <linux/random.h>
#include <linux/scatterlist.h>
#include <linux/sysfs.h>
#include <linux/mmc/host.h>
#include <linux/mmc/card.h>
#include <linux/mmc/mmc.h>
#include <linux/mmc/sd.h>
#include "core.h"
#include "card.h"
#include "host.h"
#include "bus.h"
#include "mmc_ops.h"
#include "quirks.h"
#include "sd.h"
#include "sd_ops.h"
static const unsigned int tran_exp[] = …;
static const unsigned char tran_mant[] = …;
static const unsigned int taac_exp[] = …;
static const unsigned int taac_mant[] = …;
static const unsigned int sd_au_size[] = …;
#define SD_POWEROFF_NOTIFY_TIMEOUT_MS …
#define SD_WRITE_EXTR_SINGLE_TIMEOUT_MS …
struct sd_busy_data { … };
void mmc_decode_cid(struct mmc_card *card)
{ … }
static int mmc_decode_csd(struct mmc_card *card)
{ … }
static int mmc_decode_scr(struct mmc_card *card)
{ … }
static int mmc_read_ssr(struct mmc_card *card)
{ … }
static int mmc_read_switch(struct mmc_card *card)
{ … }
int mmc_sd_switch_hs(struct mmc_card *card)
{ … }
static int sd_select_driver_type(struct mmc_card *card, u8 *status)
{ … }
static void sd_update_bus_speed_mode(struct mmc_card *card)
{ … }
static int sd_set_bus_speed_mode(struct mmc_card *card, u8 *status)
{ … }
static u32 sd_get_host_max_current(struct mmc_host *host)
{ … }
static int sd_set_current_limit(struct mmc_card *card, u8 *status)
{ … }
static int mmc_sd_init_uhs_card(struct mmc_card *card)
{ … }
MMC_DEV_ATTR(…);
MMC_DEV_ATTR(…);
MMC_DEV_ATTR(…);
MMC_DEV_ATTR(…);
MMC_DEV_ATTR(…);
MMC_DEV_ATTR(…);
MMC_DEV_ATTR(…);
MMC_DEV_ATTR(…);
MMC_DEV_ATTR(…);
MMC_DEV_ATTR(…);
MMC_DEV_ATTR(…);
MMC_DEV_ATTR(…);
MMC_DEV_ATTR(…);
MMC_DEV_ATTR(…);
MMC_DEV_ATTR(…);
static ssize_t mmc_dsr_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(dsr, S_IRUGO, mmc_dsr_show, NULL);
MMC_DEV_ATTR(…);
MMC_DEV_ATTR(…);
MMC_DEV_ATTR(…);
#define sdio_info_attr(num) …
sdio_info_attr(…);
sdio_info_attr(…);
sdio_info_attr(…);
sdio_info_attr(…);
static struct attribute *sd_std_attrs[] = …;
static umode_t sd_std_is_visible(struct kobject *kobj, struct attribute *attr,
int index)
{ … }
static const struct attribute_group sd_std_group = …;
__ATTRIBUTE_GROUPS(…);
const struct device_type sd_type = …;
int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr)
{ … }
int mmc_sd_get_csd(struct mmc_card *card)
{ … }
static int mmc_sd_get_ro(struct mmc_host *host)
{ … }
int mmc_sd_setup_card(struct mmc_host *host, struct mmc_card *card,
bool reinit)
{ … }
unsigned mmc_sd_get_max_clock(struct mmc_card *card)
{ … }
static bool mmc_sd_card_using_v18(struct mmc_card *card)
{ … }
static int sd_write_ext_reg(struct mmc_card *card, u8 fno, u8 page, u16 offset,
u8 reg_data)
{ … }
static int sd_read_ext_reg(struct mmc_card *card, u8 fno, u8 page,
u16 offset, u16 len, u8 *reg_buf)
{ … }
static int sd_parse_ext_reg_power(struct mmc_card *card, u8 fno, u8 page,
u16 offset)
{ … }
static int sd_parse_ext_reg_perf(struct mmc_card *card, u8 fno, u8 page,
u16 offset)
{ … }
static int sd_parse_ext_reg(struct mmc_card *card, u8 *gen_info_buf,
u16 *next_ext_addr)
{ … }
static int sd_read_ext_regs(struct mmc_card *card)
{ … }
static bool sd_cache_enabled(struct mmc_host *host)
{ … }
static int sd_flush_cache(struct mmc_host *host)
{ … }
static int sd_enable_cache(struct mmc_card *card)
{ … }
static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
struct mmc_card *oldcard)
{ … }
static void mmc_sd_remove(struct mmc_host *host)
{ … }
static int mmc_sd_alive(struct mmc_host *host)
{ … }
static void mmc_sd_detect(struct mmc_host *host)
{ … }
static int sd_can_poweroff_notify(struct mmc_card *card)
{ … }
static int sd_busy_poweroff_notify_cb(void *cb_data, bool *busy)
{ … }
static int sd_poweroff_notify(struct mmc_card *card)
{ … }
static int _mmc_sd_suspend(struct mmc_host *host)
{ … }
static int mmc_sd_suspend(struct mmc_host *host)
{ … }
static int _mmc_sd_resume(struct mmc_host *host)
{ … }
static int mmc_sd_resume(struct mmc_host *host)
{ … }
static int mmc_sd_runtime_suspend(struct mmc_host *host)
{ … }
static int mmc_sd_runtime_resume(struct mmc_host *host)
{ … }
static int mmc_sd_hw_reset(struct mmc_host *host)
{ … }
static const struct mmc_bus_ops mmc_sd_ops = …;
int mmc_attach_sd(struct mmc_host *host)
{ … }