summaryrefslogtreecommitdiffstats
path: root/include/linux/mmc/host.h
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-08-08 09:09:01 -0700
committerPierre Ossman <drzeus@drzeus.cx>2007-09-23 21:37:51 +0200
commit97018580c40c8a31dd7ae744da3378c787a2066d (patch)
treef5d4b4ddc8be32f9763a9c14c405cbb8b0466866 /include/linux/mmc/host.h
parent759bdc7af450404382e937c76722ae8736daef92 (diff)
MMC headers learn about SPI
Teach the MMC/SD/SDIO system headers that some hosts use SPI mode - New host capabilities and status bits * MMC_CAP_SPI, with mmc_host_is_spi() test * mmc_host.use_spi_crc flag - SPI-specific declarations: * Response types, MMC_RSP_SPI_R* * Two SPI-only commands * Status bits used native to SPI: R1_SPI_*, R2_SPI_* - Fix a few (unrelated) whitespace bugs in the headers. - Reorder a few mmc_host fields, removing several bytes of padding None of these changes affect current code. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'include/linux/mmc/host.h')
-rw-r--r--include/linux/mmc/host.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 3fd197962f7..76eef94782f 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -91,6 +91,7 @@ struct mmc_host {
#define MMC_CAP_MMC_HIGHSPEED (1 << 2) /* Can do MMC high-speed timing */
#define MMC_CAP_SD_HIGHSPEED (1 << 3) /* Can do SD high-speed timing */
#define MMC_CAP_SDIO_IRQ (1 << 4) /* Can signal pending SDIO IRQs */
+#define MMC_CAP_SPI (1 << 5) /* Talks only SPI protocols */
/* host specific block data */
unsigned int max_seg_size; /* see blk_queue_max_segment_size */
@@ -107,6 +108,14 @@ struct mmc_host {
struct mmc_ios ios; /* current io bus settings */
u32 ocr; /* the current OCR setting */
+ /* group bitfields together to minimize padding */
+ unsigned int use_spi_crc:1;
+ unsigned int claimed:1; /* host exclusively claimed */
+ unsigned int bus_dead:1; /* bus has been released */
+#ifdef CONFIG_MMC_DEBUG
+ unsigned int removed:1; /* host is being removed */
+#endif
+
unsigned int mode; /* current card mode of host */
#define MMC_MODE_MMC 0
#define MMC_MODE_SD 1
@@ -114,16 +123,11 @@ struct mmc_host {
struct mmc_card *card; /* device attached to this host */
wait_queue_head_t wq;
- unsigned int claimed:1; /* host exclusively claimed */
struct delayed_work detect;
-#ifdef CONFIG_MMC_DEBUG
- unsigned int removed:1; /* host is being removed */
-#endif
const struct mmc_bus_ops *bus_ops; /* current bus driver */
unsigned int bus_refs; /* reference counter */
- unsigned int bus_dead:1; /* bus has been released */
unsigned int sdio_irqs;
struct task_struct *sdio_irq_thread;
@@ -142,6 +146,8 @@ static inline void *mmc_priv(struct mmc_host *host)
return (void *)host->private;
}
+#define mmc_host_is_spi(host) ((host)->caps & MMC_CAP_SPI)
+
#define mmc_dev(x) ((x)->parent)
#define mmc_classdev(x) (&(x)->class_dev)
#define mmc_hostname(x) ((x)->class_dev.bus_id)