summaryrefslogtreecommitdiffstats
path: root/sys/dev/sdhci/sdhci.h
diff options
context:
space:
mode:
authorgonzo <gonzo@FreeBSD.org>2013-02-28 19:43:14 +0000
committergonzo <gonzo@FreeBSD.org>2013-02-28 19:43:14 +0000
commit9b1d7b3ae47bf2aa81c07ad2179ef27132327f2a (patch)
treeb98301b12ea265208895740e1307ae28cc25913d /sys/dev/sdhci/sdhci.h
parent9ccbe7b6a4a12fa62e63d80ada8c85930e0c3cba (diff)
downloadFreeBSD-src-9b1d7b3ae47bf2aa81c07ad2179ef27132327f2a.zip
FreeBSD-src-9b1d7b3ae47bf2aa81c07ad2179ef27132327f2a.tar.gz
Add hooks for plugging platform-provided transfer backend.
In order to use platorm backend hardware driver should impement three methods: - platform_start_transfer and platform_finish_transfer to start and finish transfer - platform_will_handle - check whether transaction is suitable for backend. If not - driver will fall back to PIO mode. Submitted by: Daisuke Aoyama <aoyama at peach.ne.jp> Approved by: ian@
Diffstat (limited to 'sys/dev/sdhci/sdhci.h')
-rw-r--r--sys/dev/sdhci/sdhci.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/sdhci/sdhci.h b/sys/dev/sdhci/sdhci.h
index 31fbe68..5c46778 100644
--- a/sys/dev/sdhci/sdhci.h
+++ b/sys/dev/sdhci/sdhci.h
@@ -224,8 +224,9 @@ struct sdhci_slot {
device_t dev; /* Slot device */
u_char num; /* Slot number */
u_char opt; /* Slot options */
+#define SDHCI_HAVE_DMA 1
+#define SDHCI_PLATFORM_TRANSFER 2
u_char version;
-#define SDHCI_HAVE_DMA 1
uint32_t max_clk; /* Max possible freq */
uint32_t timeout_clk; /* Timeout freq */
bus_dma_tag_t dmatag;
@@ -250,6 +251,7 @@ struct sdhci_slot {
#define CMD_STARTED 1
#define STOP_STARTED 2
#define SDHCI_USE_DMA 4 /* Use DMA for this req. */
+#define PLATFORM_DATA_STARTED 8 /* Data transfer is handled by platform */
struct mtx mtx; /* Slot mutex */
};
@@ -257,6 +259,8 @@ int sdhci_generic_read_ivar(device_t bus, device_t child, int which, uintptr_t *
int sdhci_generic_write_ivar(device_t bus, device_t child, int which, uintptr_t value);
int sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num);
void sdhci_start_slot(struct sdhci_slot *slot);
+/* performs generic clean-up for platform transfers */
+void sdhci_finish_data(struct sdhci_slot *slot);
int sdhci_cleanup_slot(struct sdhci_slot *slot);
int sdhci_generic_suspend(struct sdhci_slot *slot);
int sdhci_generic_resume(struct sdhci_slot *slot);
OpenPOWER on IntegriCloud