Skip to content

Commit 3976b03

Browse files
andy-shevIngo Molnar
authored andcommitted
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 <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent dd8d6ec commit 3976b03

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

arch/x86/platform/intel-mid/device_libs/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Family-Level Interface Shim (FLIS)
22
obj-$(subst m,y,$(CONFIG_PINCTRL_MERRIFIELD)) += platform_mrfld_pinctrl.o
3+
# SDHCI Devices
4+
obj-$(subst m,y,$(CONFIG_MMC_SDHCI_PCI)) += platform_mrfld_sd.o
35
# WiFi
46
obj-$(subst m,y,$(CONFIG_BRCMFMAC_SDIO)) += platform_bcm43xx.o
57
# IPC Devices
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* SDHCI platform data initilisation file
3+
*
4+
* (C) Copyright 2016 Intel Corporation
5+
* Author: Andy Shevchenko <[email protected]>
6+
*
7+
* This program is free software; you can redistribute it and/or
8+
* modify it under the terms of the GNU General Public License
9+
* as published by the Free Software Foundation; version 2
10+
* of the License.
11+
*/
12+
13+
#include <linux/init.h>
14+
#include <linux/pci.h>
15+
16+
#include <linux/mmc/sdhci-pci-data.h>
17+
18+
#include <asm/intel-mid.h>
19+
20+
#define INTEL_MRFLD_SD 2
21+
#define INTEL_MRFLD_SD_CD_GPIO 77
22+
23+
static struct sdhci_pci_data mrfld_sdhci_pci_data = {
24+
.rst_n_gpio = -EINVAL,
25+
.cd_gpio = INTEL_MRFLD_SD_CD_GPIO,
26+
};
27+
28+
static struct sdhci_pci_data *
29+
mrfld_sdhci_pci_get_data(struct pci_dev *pdev, int slotno)
30+
{
31+
unsigned int func = PCI_FUNC(pdev->devfn);
32+
33+
if (func == INTEL_MRFLD_SD)
34+
return &mrfld_sdhci_pci_data;
35+
36+
return NULL;
37+
}
38+
39+
static int __init mrfld_sd_init(void)
40+
{
41+
if (intel_mid_identify_cpu() != INTEL_MID_CPU_CHIP_TANGIER)
42+
return -ENODEV;
43+
44+
sdhci_pci_get_data = mrfld_sdhci_pci_get_data;
45+
return 0;
46+
}
47+
arch_initcall(mrfld_sd_init);

0 commit comments

Comments
 (0)