#include <linux/err.h>
#include <linux/of.h>
#include <linux/slab.h>
#include <linux/stat.h>
#include <linux/pm_runtime.h>
#include <linux/random.h>
#include <linux/sysfs.h>
#include <linux/mmc/host.h>
#include <linux/mmc/card.h>
#include <linux/mmc/mmc.h>
#include "core.h"
#include "card.h"
#include "host.h"
#include "bus.h"
#include "mmc_ops.h"
#include "quirks.h"
#include "sd_ops.h"
#include "pwrseq.h"
#define DEFAULT_CMD6_TIMEOUT_MS …
#define MIN_CACHE_EN_TIMEOUT_MS …
#define CACHE_FLUSH_TIMEOUT_MS …
static const unsigned int tran_exp[] = …;
static const unsigned char tran_mant[] = …;
static const unsigned int taac_exp[] = …;
static const unsigned int taac_mant[] = …;
#define UNSTUFF_BITS(resp,start,size) …
static int mmc_decode_cid(struct mmc_card *card)
{ … }
static void mmc_set_erase_size(struct mmc_card *card)
{ … }
static void mmc_set_wp_grp_size(struct mmc_card *card)
{ … }
static int mmc_decode_csd(struct mmc_card *card)
{ … }
static void mmc_select_card_type(struct mmc_card *card)
{ … }
static void mmc_manage_enhanced_area(struct mmc_card *card, u8 *ext_csd)
{ … }
static void mmc_part_add(struct mmc_card *card, u64 size,
unsigned int part_cfg, char *name, int idx, bool ro,
int area_type)
{ … }
static void mmc_manage_gp_partitions(struct mmc_card *card, u8 *ext_csd)
{ … }
#define MMC_MIN_PART_SWITCH_TIME …
static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd)
{ … }
static int mmc_read_ext_csd(struct mmc_card *card)
{ … }
static int mmc_compare_ext_csds(struct mmc_card *card, unsigned bus_width)
{ … }
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(…);
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_fwrev_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(fwrev, S_IRUGO, mmc_fwrev_show, NULL);
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);
static struct attribute *mmc_std_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static const struct device_type mmc_type = …;
static int __mmc_select_powerclass(struct mmc_card *card,
unsigned int bus_width)
{ … }
static int mmc_select_powerclass(struct mmc_card *card)
{ … }
static void mmc_set_bus_speed(struct mmc_card *card)
{ … }
static int mmc_select_bus_width(struct mmc_card *card)
{ … }
static int mmc_select_hs(struct mmc_card *card)
{ … }
static int mmc_select_hs_ddr(struct mmc_card *card)
{ … }
static int mmc_select_hs400(struct mmc_card *card)
{ … }
int mmc_hs200_to_hs400(struct mmc_card *card)
{ … }
int mmc_hs400_to_hs200(struct mmc_card *card)
{ … }
static void mmc_select_driver_type(struct mmc_card *card)
{ … }
static int mmc_select_hs400es(struct mmc_card *card)
{ … }
static int mmc_select_hs200(struct mmc_card *card)
{ … }
static int mmc_select_timing(struct mmc_card *card)
{ … }
static int mmc_hs200_tuning(struct mmc_card *card)
{ … }
static int mmc_init_card(struct mmc_host *host, u32 ocr,
struct mmc_card *oldcard)
{ … }
static int mmc_can_sleep(struct mmc_card *card)
{ … }
static int mmc_sleep_busy_cb(void *cb_data, bool *busy)
{ … }
static int mmc_sleep(struct mmc_host *host)
{ … }
static int mmc_can_poweroff_notify(const struct mmc_card *card)
{ … }
static int mmc_poweroff_notify(struct mmc_card *card, unsigned int notify_type)
{ … }
static void mmc_remove(struct mmc_host *host)
{ … }
static int mmc_alive(struct mmc_host *host)
{ … }
static void mmc_detect(struct mmc_host *host)
{ … }
static bool _mmc_cache_enabled(struct mmc_host *host)
{ … }
static int _mmc_flush_cache(struct mmc_host *host)
{ … }
static int _mmc_suspend(struct mmc_host *host, bool is_suspend)
{ … }
static int mmc_suspend(struct mmc_host *host)
{ … }
static int _mmc_resume(struct mmc_host *host)
{ … }
static int mmc_shutdown(struct mmc_host *host)
{ … }
static int mmc_resume(struct mmc_host *host)
{ … }
static int mmc_runtime_suspend(struct mmc_host *host)
{ … }
static int mmc_runtime_resume(struct mmc_host *host)
{ … }
static int mmc_can_reset(struct mmc_card *card)
{ … }
static int _mmc_hw_reset(struct mmc_host *host)
{ … }
static const struct mmc_bus_ops mmc_ops = …;
int mmc_attach_mmc(struct mmc_host *host)
{ … }