sdhci-pci.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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_BSW_EMMC 0x2294
  13. #define PCI_DEVICE_ID_INTEL_BSW_SDIO 0x2295
  14. #define PCI_DEVICE_ID_INTEL_BSW_SD 0x2296
  15. #define PCI_DEVICE_ID_INTEL_MRFL_MMC 0x1190
  16. #define PCI_DEVICE_ID_INTEL_CLV_SDIO0 0x08f9
  17. #define PCI_DEVICE_ID_INTEL_CLV_SDIO1 0x08fa
  18. #define PCI_DEVICE_ID_INTEL_CLV_SDIO2 0x08fb
  19. #define PCI_DEVICE_ID_INTEL_CLV_EMMC0 0x08e5
  20. #define PCI_DEVICE_ID_INTEL_CLV_EMMC1 0x08e6
  21. #define PCI_DEVICE_ID_INTEL_QRK_SD 0x08A7
  22. /*
  23. * PCI registers
  24. */
  25. #define PCI_SDHCI_IFPIO 0x00
  26. #define PCI_SDHCI_IFDMA 0x01
  27. #define PCI_SDHCI_IFVENDOR 0x02
  28. #define PCI_SLOT_INFO 0x40 /* 8 bits */
  29. #define PCI_SLOT_INFO_SLOTS(x) ((x >> 4) & 7)
  30. #define PCI_SLOT_INFO_FIRST_BAR_MASK 0x07
  31. #define MAX_SLOTS 8
  32. struct sdhci_pci_chip;
  33. struct sdhci_pci_slot;
  34. struct sdhci_pci_fixes {
  35. unsigned int quirks;
  36. unsigned int quirks2;
  37. bool allow_runtime_pm;
  38. bool own_cd_for_runtime_pm;
  39. int (*probe) (struct sdhci_pci_chip *);
  40. int (*probe_slot) (struct sdhci_pci_slot *);
  41. void (*remove_slot) (struct sdhci_pci_slot *, int);
  42. int (*suspend) (struct sdhci_pci_chip *);
  43. int (*resume) (struct sdhci_pci_chip *);
  44. };
  45. struct sdhci_pci_slot {
  46. struct sdhci_pci_chip *chip;
  47. struct sdhci_host *host;
  48. struct sdhci_pci_data *data;
  49. int pci_bar;
  50. int rst_n_gpio;
  51. int cd_gpio;
  52. int cd_irq;
  53. char *cd_con_id;
  54. int cd_idx;
  55. bool cd_override_level;
  56. void (*hw_reset)(struct sdhci_host *host);
  57. };
  58. struct sdhci_pci_chip {
  59. struct pci_dev *pdev;
  60. unsigned int quirks;
  61. unsigned int quirks2;
  62. bool allow_runtime_pm;
  63. const struct sdhci_pci_fixes *fixes;
  64. int num_slots; /* Slots on controller */
  65. struct sdhci_pci_slot *slots[MAX_SLOTS]; /* Pointers to host slots */
  66. };
  67. #endif /* __SDHCI_PCI_H */