sdhci-pci.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef __SDHCI_PCI_H
  2. #define __SDHCI_PCI_H
  3. /*
  4. * PCI device IDs
  5. */
  6. #define PCI_DEVICE_ID_INTEL_PCH_SDIO0 0x8809
  7. #define PCI_DEVICE_ID_INTEL_PCH_SDIO1 0x880a
  8. #define PCI_DEVICE_ID_INTEL_BYT_EMMC 0x0f14
  9. #define PCI_DEVICE_ID_INTEL_BYT_SDIO 0x0f15
  10. #define PCI_DEVICE_ID_INTEL_BYT_SD 0x0f16
  11. #define PCI_DEVICE_ID_INTEL_BYT_EMMC2 0x0f50
  12. #define PCI_DEVICE_ID_INTEL_MRFL_MMC 0x1190
  13. #define PCI_DEVICE_ID_INTEL_CLV_SDIO0 0x08f9
  14. #define PCI_DEVICE_ID_INTEL_CLV_SDIO1 0x08fa
  15. #define PCI_DEVICE_ID_INTEL_CLV_SDIO2 0x08fb
  16. #define PCI_DEVICE_ID_INTEL_CLV_EMMC0 0x08e5
  17. #define PCI_DEVICE_ID_INTEL_CLV_EMMC1 0x08e6
  18. /*
  19. * PCI registers
  20. */
  21. #define PCI_SDHCI_IFPIO 0x00
  22. #define PCI_SDHCI_IFDMA 0x01
  23. #define PCI_SDHCI_IFVENDOR 0x02
  24. #define PCI_SLOT_INFO 0x40 /* 8 bits */
  25. #define PCI_SLOT_INFO_SLOTS(x) ((x >> 4) & 7)
  26. #define PCI_SLOT_INFO_FIRST_BAR_MASK 0x07
  27. #define MAX_SLOTS 8
  28. struct sdhci_pci_chip;
  29. struct sdhci_pci_slot;
  30. struct sdhci_pci_fixes {
  31. unsigned int quirks;
  32. unsigned int quirks2;
  33. bool allow_runtime_pm;
  34. bool own_cd_for_runtime_pm;
  35. int (*probe) (struct sdhci_pci_chip *);
  36. int (*probe_slot) (struct sdhci_pci_slot *);
  37. void (*remove_slot) (struct sdhci_pci_slot *, int);
  38. int (*suspend) (struct sdhci_pci_chip *);
  39. int (*resume) (struct sdhci_pci_chip *);
  40. };
  41. struct sdhci_pci_slot {
  42. struct sdhci_pci_chip *chip;
  43. struct sdhci_host *host;
  44. struct sdhci_pci_data *data;
  45. int pci_bar;
  46. int rst_n_gpio;
  47. int cd_gpio;
  48. int cd_irq;
  49. void (*hw_reset)(struct sdhci_host *host);
  50. };
  51. struct sdhci_pci_chip {
  52. struct pci_dev *pdev;
  53. unsigned int quirks;
  54. unsigned int quirks2;
  55. bool allow_runtime_pm;
  56. const struct sdhci_pci_fixes *fixes;
  57. int num_slots; /* Slots on controller */
  58. struct sdhci_pci_slot *slots[MAX_SLOTS]; /* Pointers to host slots */
  59. };
  60. #endif /* __SDHCI_PCI_H */