11 #include <linux/export.h>
15 #include <linux/slab.h>
16 #include <linux/stat.h>
25 #ifdef CONFIG_FAIL_MMC_REQUEST
27 static DECLARE_FAULT_ATTR(fail_default_attr);
28 static char *fail_request;
36 static const char *vdd_str[] = {
66 && vdd_str[ios->
vdd] && vdd_str[ios->
vdd + 1])
68 vdd_str[ios->
vdd + 1]);
124 str =
"mmc high-speed";
127 str =
"sd high-speed";
130 str =
"sd uhs SDR50";
133 str =
"sd uhs SDR104";
136 str =
"sd uhs DDR50";
139 str =
"mmc high-speed SDR200";
156 .open = mmc_ios_open,
162 static int mmc_clock_opt_get(
void *data,
u64 *
val)
166 *val = host->
ios.clock;
171 static int mmc_clock_opt_set(
void *data,
u64 val)
176 if (val > host->
f_max)
179 mmc_claim_host(host);
211 #ifdef CONFIG_MMC_CLKGATE
213 root, &host->clk_delay))
216 #ifdef CONFIG_FAIL_MMC_REQUEST
219 host->fail_mmc_request = fail_default_attr;
220 if (IS_ERR(fault_create_debugfs_attr(
"fail_mmc_request",
222 &host->fail_mmc_request)))
239 static int mmc_dbg_card_status_get(
void *data,
u64 *val)
245 mmc_claim_host(card->
host);
258 #define EXT_CSD_STR_LEN 1025
260 static int mmc_ext_csd_open(
struct inode *
inode,
struct file *filp)
278 mmc_claim_host(card->
host);
284 for (i = 0; i < 512; i++)
285 n +=
sprintf(buf + n,
"%02x", ext_csd[i]);
299 static ssize_t mmc_ext_csd_read(
struct file *filp,
char __user *ubuf,
300 size_t cnt, loff_t *ppos)
315 .open = mmc_ext_csd_open,
316 .read = mmc_ext_csd_read,
317 .release = mmc_ext_csd_release,
345 &mmc_dbg_card_status_fops))
350 &mmc_dbg_ext_csd_fops))
358 dev_err(&card->
dev,
"failed to initialize debugfs\n");