summaryrefslogtreecommitdiffstats
path: root/arch/x86/platform/intel-mid/device_libs/platform_mrfld_sd.c
diff options
context:
space:
mode:
authorAndy Shevchenko2016-08-31 15:57:13 +0200
committerIngo Molnar2016-09-01 08:22:42 +0200
commit3976b0380b315651137ce4321b1171ac0a1d26ed (patch)
treed5147b615d93eecb234e23bc6f16815a628b63a2 /arch/x86/platform/intel-mid/device_libs/platform_mrfld_sd.c
parentx86/platform/intel-mid: Enable WiFi on Intel Edison (diff)
downloadkernel-qcow2-linux-3976b0380b315651137ce4321b1171ac0a1d26ed.tar.gz
kernel-qcow2-linux-3976b0380b315651137ce4321b1171ac0a1d26ed.tar.xz
kernel-qcow2-linux-3976b0380b315651137ce4321b1171ac0a1d26ed.zip
x86/platform/intel-mid: Enable SD card detection on Merrifield
Intel Merrifield platform provides SD card interface. The interface allows user to plug SD card to extend storage capacity. Append the essential data to enable SD card detection on it. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/20160831135713.79066-2-andriy.shevchenko@linux.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/platform/intel-mid/device_libs/platform_mrfld_sd.c')
-rw-r--r--arch/x86/platform/intel-mid/device_libs/platform_mrfld_sd.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/arch/x86/platform/intel-mid/device_libs/platform_mrfld_sd.c b/arch/x86/platform/intel-mid/device_libs/platform_mrfld_sd.c
new file mode 100644
index 000000000000..00c4a034ad93
--- /dev/null
+++ b/arch/x86/platform/intel-mid/device_libs/platform_mrfld_sd.c
@@ -0,0 +1,47 @@
+/*
+ * SDHCI platform data initilisation file
+ *
+ * (C) Copyright 2016 Intel Corporation
+ * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; version 2
+ * of the License.
+ */
+
+#include <linux/init.h>
+#include <linux/pci.h>
+
+#include <linux/mmc/sdhci-pci-data.h>
+
+#include <asm/intel-mid.h>
+
+#define INTEL_MRFLD_SD 2
+#define INTEL_MRFLD_SD_CD_GPIO 77
+
+static struct sdhci_pci_data mrfld_sdhci_pci_data = {
+ .rst_n_gpio = -EINVAL,
+ .cd_gpio = INTEL_MRFLD_SD_CD_GPIO,
+};
+
+static struct sdhci_pci_data *
+mrfld_sdhci_pci_get_data(struct pci_dev *pdev, int slotno)
+{
+ unsigned int func = PCI_FUNC(pdev->devfn);
+
+ if (func == INTEL_MRFLD_SD)
+ return &mrfld_sdhci_pci_data;
+
+ return NULL;
+}
+
+static int __init mrfld_sd_init(void)
+{
+ if (intel_mid_identify_cpu() != INTEL_MID_CPU_CHIP_TANGIER)
+ return -ENODEV;
+
+ sdhci_pci_get_data = mrfld_sdhci_pci_get_data;
+ return 0;
+}
+arch_initcall(mrfld_sd_init);