Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
[pandora-kernel.git] / drivers / mmc / core / debugfs.c
index 998797e..6045ea4 100644 (file)
@@ -7,11 +7,13 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#include <linux/moduleparam.h>
 #include <linux/debugfs.h>
 #include <linux/fs.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
 #include <linux/stat.h>
+#include <linux/fault-inject.h>
 
 #include <linux/mmc/card.h>
 #include <linux/mmc/host.h>
 #include "core.h"
 #include "mmc_ops.h"
 
+#ifdef CONFIG_FAIL_MMC_REQUEST
+
+static DECLARE_FAULT_ATTR(fail_default_attr);
+static char *fail_request;
+module_param(fail_request, charp, 0);
+
+#endif /* CONFIG_FAIL_MMC_REQUEST */
+
 /* The debugfs functions are optimized away when CONFIG_DEBUG_FS isn't set. */
 static int mmc_ios_show(struct seq_file *s, void *data)
 {
@@ -113,6 +123,15 @@ static int mmc_ios_show(struct seq_file *s, void *data)
        case MMC_TIMING_SD_HS:
                str = "sd high-speed";
                break;
+       case MMC_TIMING_UHS_SDR50:
+               str = "sd uhs SDR50";
+               break;
+       case MMC_TIMING_UHS_SDR104:
+               str = "sd uhs SDR104";
+               break;
+       case MMC_TIMING_UHS_DDR50:
+               str = "sd uhs DDR50";
+               break;
        default:
                str = "invalid";
                break;
@@ -187,6 +206,15 @@ void mmc_add_host_debugfs(struct mmc_host *host)
        if (!debugfs_create_u32("clk_delay", (S_IRUSR | S_IWUSR),
                                root, &host->clk_delay))
                goto err_node;
+#endif
+#ifdef CONFIG_FAIL_MMC_REQUEST
+       if (fail_request)
+               setup_fault_attr(&fail_default_attr, fail_request);
+       host->fail_mmc_request = fail_default_attr;
+       if (IS_ERR(fault_create_debugfs_attr("fail_mmc_request",
+                                            root,
+                                            &host->fail_mmc_request)))
+               goto err_node;
 #endif
        return;