diff options
author | Adam Lee <adam.lee@canonical.com> | 2013-12-18 09:23:38 -0500 |
---|---|---|
committer | Chris Ball <chris@printf.net> | 2014-01-13 12:48:31 -0500 |
commit | 522624f97ee22684cf1b169b5a490cc3ad87b22c (patch) | |
tree | beff460732475a9367bddd47a497868085cb1db8 | |
parent | 1e0bf16cae6d50f9a10738c89957468c977c6f89 (diff) |
mmc: sdhci-pci: break out definitions to header file
Break out definitions in sdhci-pci.c to sdhci-pci.h, for introducing
module files like sdhci-pci-xxx.c
Signed-off-by: Adam Lee <adam.lee@canonical.com>
Signed-off-by: Chris Ball <chris@printf.net>
-rw-r--r-- | drivers/mmc/host/sdhci-pci.c | 74 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-pci.h | 77 |
2 files changed, 78 insertions, 73 deletions
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c index 8f753811fc7a..af446592d974 100644 --- a/drivers/mmc/host/sdhci-pci.c +++ b/drivers/mmc/host/sdhci-pci.c | |||
@@ -27,79 +27,7 @@ | |||
27 | #include <linux/mmc/sdhci-pci-data.h> | 27 | #include <linux/mmc/sdhci-pci-data.h> |
28 | 28 | ||
29 | #include "sdhci.h" | 29 | #include "sdhci.h" |
30 | 30 | #include "sdhci-pci.h" | |
31 | /* | ||
32 | * PCI device IDs | ||
33 | */ | ||
34 | #define PCI_DEVICE_ID_INTEL_PCH_SDIO0 0x8809 | ||
35 | #define PCI_DEVICE_ID_INTEL_PCH_SDIO1 0x880a | ||
36 | #define PCI_DEVICE_ID_INTEL_BYT_EMMC 0x0f14 | ||
37 | #define PCI_DEVICE_ID_INTEL_BYT_SDIO 0x0f15 | ||
38 | #define PCI_DEVICE_ID_INTEL_BYT_SD 0x0f16 | ||
39 | #define PCI_DEVICE_ID_INTEL_BYT_EMMC2 0x0f50 | ||
40 | #define PCI_DEVICE_ID_INTEL_MRFL_MMC 0x1190 | ||
41 | #define PCI_DEVICE_ID_INTEL_CLV_SDIO0 0x08f9 | ||
42 | #define PCI_DEVICE_ID_INTEL_CLV_SDIO1 0x08fa | ||
43 | #define PCI_DEVICE_ID_INTEL_CLV_SDIO2 0x08fb | ||
44 | #define PCI_DEVICE_ID_INTEL_CLV_EMMC0 0x08e5 | ||
45 | #define PCI_DEVICE_ID_INTEL_CLV_EMMC1 0x08e6 | ||
46 | |||
47 | /* | ||
48 | * PCI registers | ||
49 | */ | ||
50 | |||
51 | #define PCI_SDHCI_IFPIO 0x00 | ||
52 | #define PCI_SDHCI_IFDMA 0x01 | ||
53 | #define PCI_SDHCI_IFVENDOR 0x02 | ||
54 | |||
55 | #define PCI_SLOT_INFO 0x40 /* 8 bits */ | ||
56 | #define PCI_SLOT_INFO_SLOTS(x) ((x >> 4) & 7) | ||
57 | #define PCI_SLOT_INFO_FIRST_BAR_MASK 0x07 | ||
58 | |||
59 | #define MAX_SLOTS 8 | ||
60 | |||
61 | struct sdhci_pci_chip; | ||
62 | struct sdhci_pci_slot; | ||
63 | |||
64 | struct sdhci_pci_fixes { | ||
65 | unsigned int quirks; | ||
66 | unsigned int quirks2; | ||
67 | bool allow_runtime_pm; | ||
68 | |||
69 | int (*probe) (struct sdhci_pci_chip *); | ||
70 | |||
71 | int (*probe_slot) (struct sdhci_pci_slot *); | ||
72 | void (*remove_slot) (struct sdhci_pci_slot *, int); | ||
73 | |||
74 | int (*suspend) (struct sdhci_pci_chip *); | ||
75 | int (*resume) (struct sdhci_pci_chip *); | ||
76 | }; | ||
77 | |||
78 | struct sdhci_pci_slot { | ||
79 | struct sdhci_pci_chip *chip; | ||
80 | struct sdhci_host *host; | ||
81 | struct sdhci_pci_data *data; | ||
82 | |||
83 | int pci_bar; | ||
84 | int rst_n_gpio; | ||
85 | int cd_gpio; | ||
86 | int cd_irq; | ||
87 | |||
88 | void (*hw_reset)(struct sdhci_host *host); | ||
89 | }; | ||
90 | |||
91 | struct sdhci_pci_chip { | ||
92 | struct pci_dev *pdev; | ||
93 | |||
94 | unsigned int quirks; | ||
95 | unsigned int quirks2; | ||
96 | bool allow_runtime_pm; | ||
97 | const struct sdhci_pci_fixes *fixes; | ||
98 | |||
99 | int num_slots; /* Slots on controller */ | ||
100 | struct sdhci_pci_slot *slots[MAX_SLOTS]; /* Pointers to host slots */ | ||
101 | }; | ||
102 | |||
103 | 31 | ||
104 | /*****************************************************************************\ | 32 | /*****************************************************************************\ |
105 | * * | 33 | * * |
diff --git a/drivers/mmc/host/sdhci-pci.h b/drivers/mmc/host/sdhci-pci.h new file mode 100644 index 000000000000..0347804eda80 --- /dev/null +++ b/drivers/mmc/host/sdhci-pci.h | |||
@@ -0,0 +1,77 @@ | |||
1 | #ifndef __SDHCI_PCI_H | ||
2 | #define __SDHCI_PCI_H | ||
3 | |||
4 | /* | ||
5 | * PCI device IDs | ||
6 | */ | ||
7 | |||
8 | #define PCI_DEVICE_ID_INTEL_PCH_SDIO0 0x8809 | ||
9 | #define PCI_DEVICE_ID_INTEL_PCH_SDIO1 0x880a | ||
10 | #define PCI_DEVICE_ID_INTEL_BYT_EMMC 0x0f14 | ||
11 | #define PCI_DEVICE_ID_INTEL_BYT_SDIO 0x0f15 | ||
12 | #define PCI_DEVICE_ID_INTEL_BYT_SD 0x0f16 | ||
13 | #define PCI_DEVICE_ID_INTEL_BYT_EMMC2 0x0f50 | ||
14 | #define PCI_DEVICE_ID_INTEL_MRFL_MMC 0x1190 | ||
15 | #define PCI_DEVICE_ID_INTEL_CLV_SDIO0 0x08f9 | ||
16 | #define PCI_DEVICE_ID_INTEL_CLV_SDIO1 0x08fa | ||
17 | #define PCI_DEVICE_ID_INTEL_CLV_SDIO2 0x08fb | ||
18 | #define PCI_DEVICE_ID_INTEL_CLV_EMMC0 0x08e5 | ||
19 | #define PCI_DEVICE_ID_INTEL_CLV_EMMC1 0x08e6 | ||
20 | |||
21 | /* | ||
22 | * PCI registers | ||
23 | */ | ||
24 | |||
25 | #define PCI_SDHCI_IFPIO 0x00 | ||
26 | #define PCI_SDHCI_IFDMA 0x01 | ||
27 | #define PCI_SDHCI_IFVENDOR 0x02 | ||
28 | |||
29 | #define PCI_SLOT_INFO 0x40 /* 8 bits */ | ||
30 | #define PCI_SLOT_INFO_SLOTS(x) ((x >> 4) & 7) | ||
31 | #define PCI_SLOT_INFO_FIRST_BAR_MASK 0x07 | ||
32 | |||
33 | #define MAX_SLOTS 8 | ||
34 | |||
35 | struct sdhci_pci_chip; | ||
36 | struct sdhci_pci_slot; | ||
37 | |||
38 | struct sdhci_pci_fixes { | ||
39 | unsigned int quirks; | ||
40 | unsigned int quirks2; | ||
41 | bool allow_runtime_pm; | ||
42 | |||
43 | int (*probe) (struct sdhci_pci_chip *); | ||
44 | |||
45 | int (*probe_slot) (struct sdhci_pci_slot *); | ||
46 | void (*remove_slot) (struct sdhci_pci_slot *, int); | ||
47 | |||
48 | int (*suspend) (struct sdhci_pci_chip *); | ||
49 | int (*resume) (struct sdhci_pci_chip *); | ||
50 | }; | ||
51 | |||
52 | struct sdhci_pci_slot { | ||
53 | struct sdhci_pci_chip *chip; | ||
54 | struct sdhci_host *host; | ||
55 | struct sdhci_pci_data *data; | ||
56 | |||
57 | int pci_bar; | ||
58 | int rst_n_gpio; | ||
59 | int cd_gpio; | ||
60 | int cd_irq; | ||
61 | |||
62 | void (*hw_reset)(struct sdhci_host *host); | ||
63 | }; | ||
64 | |||
65 | struct sdhci_pci_chip { | ||
66 | struct pci_dev *pdev; | ||
67 | |||
68 | unsigned int quirks; | ||
69 | unsigned int quirks2; | ||
70 | bool allow_runtime_pm; | ||
71 | const struct sdhci_pci_fixes *fixes; | ||
72 | |||
73 | int num_slots; /* Slots on controller */ | ||
74 | struct sdhci_pci_slot *slots[MAX_SLOTS]; /* Pointers to host slots */ | ||
75 | }; | ||
76 | |||
77 | #endif /* __SDHCI_PCI_H */ | ||