diff options
author | David Brownell <david-b@pacbell.net> | 2007-08-08 12:09:01 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2007-09-23 15:37:51 -0400 |
commit | 97018580c40c8a31dd7ae744da3378c787a2066d (patch) | |
tree | f5d4b4ddc8be32f9763a9c14c405cbb8b0466866 /include/linux/mmc/host.h | |
parent | 759bdc7af450404382e937c76722ae8736daef92 (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.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 3fd197962f73..76eef94782f8 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -91,6 +91,7 @@ struct mmc_host { | |||
91 | #define MMC_CAP_MMC_HIGHSPEED (1 << 2) /* Can do MMC high-speed timing */ | 91 | #define MMC_CAP_MMC_HIGHSPEED (1 << 2) /* Can do MMC high-speed timing */ |
92 | #define MMC_CAP_SD_HIGHSPEED (1 << 3) /* Can do SD high-speed timing */ | 92 | #define MMC_CAP_SD_HIGHSPEED (1 << 3) /* Can do SD high-speed timing */ |
93 | #define MMC_CAP_SDIO_IRQ (1 << 4) /* Can signal pending SDIO IRQs */ | 93 | #define MMC_CAP_SDIO_IRQ (1 << 4) /* Can signal pending SDIO IRQs */ |
94 | #define MMC_CAP_SPI (1 << 5) /* Talks only SPI protocols */ | ||
94 | 95 | ||
95 | /* host specific block data */ | 96 | /* host specific block data */ |
96 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ | 97 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ |
@@ -107,6 +108,14 @@ struct mmc_host { | |||
107 | struct mmc_ios ios; /* current io bus settings */ | 108 | struct mmc_ios ios; /* current io bus settings */ |
108 | u32 ocr; /* the current OCR setting */ | 109 | u32 ocr; /* the current OCR setting */ |
109 | 110 | ||
111 | /* group bitfields together to minimize padding */ | ||
112 | unsigned int use_spi_crc:1; | ||
113 | unsigned int claimed:1; /* host exclusively claimed */ | ||
114 | unsigned int bus_dead:1; /* bus has been released */ | ||
115 | #ifdef CONFIG_MMC_DEBUG | ||
116 | unsigned int removed:1; /* host is being removed */ | ||
117 | #endif | ||
118 | |||
110 | unsigned int mode; /* current card mode of host */ | 119 | unsigned int mode; /* current card mode of host */ |
111 | #define MMC_MODE_MMC 0 | 120 | #define MMC_MODE_MMC 0 |
112 | #define MMC_MODE_SD 1 | 121 | #define MMC_MODE_SD 1 |
@@ -114,16 +123,11 @@ struct mmc_host { | |||
114 | struct mmc_card *card; /* device attached to this host */ | 123 | struct mmc_card *card; /* device attached to this host */ |
115 | 124 | ||
116 | wait_queue_head_t wq; | 125 | wait_queue_head_t wq; |
117 | unsigned int claimed:1; /* host exclusively claimed */ | ||
118 | 126 | ||
119 | struct delayed_work detect; | 127 | struct delayed_work detect; |
120 | #ifdef CONFIG_MMC_DEBUG | ||
121 | unsigned int removed:1; /* host is being removed */ | ||
122 | #endif | ||
123 | 128 | ||
124 | const struct mmc_bus_ops *bus_ops; /* current bus driver */ | 129 | const struct mmc_bus_ops *bus_ops; /* current bus driver */ |
125 | unsigned int bus_refs; /* reference counter */ | 130 | unsigned int bus_refs; /* reference counter */ |
126 | unsigned int bus_dead:1; /* bus has been released */ | ||
127 | 131 | ||
128 | unsigned int sdio_irqs; | 132 | unsigned int sdio_irqs; |
129 | struct task_struct *sdio_irq_thread; | 133 | struct task_struct *sdio_irq_thread; |
@@ -142,6 +146,8 @@ static inline void *mmc_priv(struct mmc_host *host) | |||
142 | return (void *)host->private; | 146 | return (void *)host->private; |
143 | } | 147 | } |
144 | 148 | ||
149 | #define mmc_host_is_spi(host) ((host)->caps & MMC_CAP_SPI) | ||
150 | |||
145 | #define mmc_dev(x) ((x)->parent) | 151 | #define mmc_dev(x) ((x)->parent) |
146 | #define mmc_classdev(x) (&(x)->class_dev) | 152 | #define mmc_classdev(x) (&(x)->class_dev) |
147 | #define mmc_hostname(x) ((x)->class_dev.bus_id) | 153 | #define mmc_hostname(x) ((x)->class_dev.bus_id) |