summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/sdhci-pci.h
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2017-03-20 19:50:33 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2017-04-24 21:41:27 +0200
commitac9f67b5800b9a96987ec602a34dd256a92ac7ca (patch)
treecba571d3cbc3f8b4f10afdff36bc5a5ec4e0b988 /drivers/mmc/host/sdhci-pci.h
parentd38dcad4e7b48f3d68d5d058f8f4f52a99862e6e (diff)
mmc: sdhci-pci: Let devices define their own private data
Let devices define their own private data to facilitate device-specific operations. The size of the private structure is specified in the sdhci_pci_fixes structure, then sdhci_pci_probe_slot() will allocate extra space for it, and sdhci_pci_priv() can be used to get a reference to it. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Diffstat (limited to 'drivers/mmc/host/sdhci-pci.h')
-rw-r--r--drivers/mmc/host/sdhci-pci.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-pci.h b/drivers/mmc/host/sdhci-pci.h
index e6e916b3361e..cfe519c0c990 100644
--- a/drivers/mmc/host/sdhci-pci.h
+++ b/drivers/mmc/host/sdhci-pci.h
@@ -70,6 +70,7 @@ struct sdhci_pci_fixes {
int (*resume) (struct sdhci_pci_chip *);
const struct sdhci_ops *ops;
+ size_t priv_size;
};
struct sdhci_pci_slot {
@@ -89,6 +90,7 @@ struct sdhci_pci_slot {
struct mmc_card *card,
unsigned int max_dtr, int host_drv,
int card_drv, int *drv_type);
+ unsigned long private[0] ____cacheline_aligned;
};
struct sdhci_pci_chip {
@@ -105,4 +107,9 @@ struct sdhci_pci_chip {
struct sdhci_pci_slot *slots[MAX_SLOTS]; /* Pointers to host slots */
};
+static inline void *sdhci_pci_priv(struct sdhci_pci_slot *slot)
+{
+ return (void *)slot->private;
+}
+
#endif /* __SDHCI_PCI_H */