Adam Lee | 522624f | 2013-12-18 22:23:38 +0800 | [diff] [blame] | 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 |
Derek Browne | 43e968c | 2014-06-24 06:56:36 -0700 | [diff] [blame] | 20 | #define PCI_DEVICE_ID_INTEL_QRK_SD 0x08A7 |
Adam Lee | 522624f | 2013-12-18 22:23:38 +0800 | [diff] [blame] | 21 | |
| 22 | /* |
| 23 | * PCI registers |
| 24 | */ |
| 25 | |
| 26 | #define PCI_SDHCI_IFPIO 0x00 |
| 27 | #define PCI_SDHCI_IFDMA 0x01 |
| 28 | #define PCI_SDHCI_IFVENDOR 0x02 |
| 29 | |
| 30 | #define PCI_SLOT_INFO 0x40 /* 8 bits */ |
| 31 | #define PCI_SLOT_INFO_SLOTS(x) ((x >> 4) & 7) |
| 32 | #define PCI_SLOT_INFO_FIRST_BAR_MASK 0x07 |
| 33 | |
| 34 | #define MAX_SLOTS 8 |
| 35 | |
| 36 | struct sdhci_pci_chip; |
| 37 | struct sdhci_pci_slot; |
| 38 | |
| 39 | struct sdhci_pci_fixes { |
| 40 | unsigned int quirks; |
| 41 | unsigned int quirks2; |
| 42 | bool allow_runtime_pm; |
Adrian Hunter | 77a0122 | 2014-01-13 09:49:16 +0200 | [diff] [blame] | 43 | bool own_cd_for_runtime_pm; |
Adam Lee | 522624f | 2013-12-18 22:23:38 +0800 | [diff] [blame] | 44 | |
| 45 | int (*probe) (struct sdhci_pci_chip *); |
| 46 | |
| 47 | int (*probe_slot) (struct sdhci_pci_slot *); |
| 48 | void (*remove_slot) (struct sdhci_pci_slot *, int); |
| 49 | |
| 50 | int (*suspend) (struct sdhci_pci_chip *); |
| 51 | int (*resume) (struct sdhci_pci_chip *); |
| 52 | }; |
| 53 | |
| 54 | struct sdhci_pci_slot { |
| 55 | struct sdhci_pci_chip *chip; |
| 56 | struct sdhci_host *host; |
| 57 | struct sdhci_pci_data *data; |
| 58 | |
| 59 | int pci_bar; |
| 60 | int rst_n_gpio; |
| 61 | int cd_gpio; |
| 62 | int cd_irq; |
| 63 | |
| 64 | void (*hw_reset)(struct sdhci_host *host); |
| 65 | }; |
| 66 | |
| 67 | struct sdhci_pci_chip { |
| 68 | struct pci_dev *pdev; |
| 69 | |
| 70 | unsigned int quirks; |
| 71 | unsigned int quirks2; |
| 72 | bool allow_runtime_pm; |
| 73 | const struct sdhci_pci_fixes *fixes; |
| 74 | |
| 75 | int num_slots; /* Slots on controller */ |
| 76 | struct sdhci_pci_slot *slots[MAX_SLOTS]; /* Pointers to host slots */ |
| 77 | }; |
| 78 | |
| 79 | #endif /* __SDHCI_PCI_H */ |