aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/dw_mmc.h
diff options
context:
space:
mode:
authorSeungwon Jeon <tgih.jun@samsung.com>2013-08-30 11:12:42 -0400
committerChris Ball <cjb@laptop.org>2013-09-25 21:32:59 -0400
commit0976f16d2d7fdd3d33738c1f64b83cde6f783db3 (patch)
treef6de0fe07a393779626b76fc61322fa54c070b80 /drivers/mmc/host/dw_mmc.h
parent6bce431ca13bb72261adbd20b7bc58c447ef2ce3 (diff)
mmc: dw_mmc: add support tuning scheme
For the speed modes HS200 and SDR104, tuning is needed to determine the correct sampling point. Actual tuning procedure is provided by specific host controller driver. This patch defines the tuning command and tuning data. Additionally, 'struct dw_mci_slot' is moved to header file to consider the extensive usages in driver. Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com> Tested-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/dw_mmc.h')
-rw-r--r--drivers/mmc/host/dw_mmc.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h
index 81b29941c5b9..b281fdc6835f 100644
--- a/drivers/mmc/host/dw_mmc.h
+++ b/drivers/mmc/host/dw_mmc.h
@@ -184,6 +184,52 @@ extern int dw_mci_resume(struct dw_mci *host);
184#endif 184#endif
185 185
186/** 186/**
187 * struct dw_mci_slot - MMC slot state
188 * @mmc: The mmc_host representing this slot.
189 * @host: The MMC controller this slot is using.
190 * @quirks: Slot-level quirks (DW_MCI_SLOT_QUIRK_XXX)
191 * @wp_gpio: If gpio_is_valid() we'll use this to read write protect.
192 * @ctype: Card type for this slot.
193 * @mrq: mmc_request currently being processed or waiting to be
194 * processed, or NULL when the slot is idle.
195 * @queue_node: List node for placing this node in the @queue list of
196 * &struct dw_mci.
197 * @clock: Clock rate configured by set_ios(). Protected by host->lock.
198 * @__clk_old: The last updated clock with reflecting clock divider.
199 * Keeping track of this helps us to avoid spamming the console
200 * with CONFIG_MMC_CLKGATE.
201 * @flags: Random state bits associated with the slot.
202 * @id: Number of this slot.
203 * @last_detect_state: Most recently observed card detect state.
204 */
205struct dw_mci_slot {
206 struct mmc_host *mmc;
207 struct dw_mci *host;
208
209 int quirks;
210 int wp_gpio;
211
212 u32 ctype;
213
214 struct mmc_request *mrq;
215 struct list_head queue_node;
216
217 unsigned int clock;
218 unsigned int __clk_old;
219
220 unsigned long flags;
221#define DW_MMC_CARD_PRESENT 0
222#define DW_MMC_CARD_NEED_INIT 1
223 int id;
224 int last_detect_state;
225};
226
227struct dw_mci_tuning_data {
228 const u8 *blk_pattern;
229 unsigned int blksz;
230};
231
232/**
187 * dw_mci driver data - dw-mshc implementation specific driver data. 233 * dw_mci driver data - dw-mshc implementation specific driver data.
188 * @caps: mmc subsystem specified capabilities of the controller(s). 234 * @caps: mmc subsystem specified capabilities of the controller(s).
189 * @init: early implementation specific initialization. 235 * @init: early implementation specific initialization.
@@ -203,5 +249,7 @@ struct dw_mci_drv_data {
203 void (*prepare_command)(struct dw_mci *host, u32 *cmdr); 249 void (*prepare_command)(struct dw_mci *host, u32 *cmdr);
204 void (*set_ios)(struct dw_mci *host, struct mmc_ios *ios); 250 void (*set_ios)(struct dw_mci *host, struct mmc_ios *ios);
205 int (*parse_dt)(struct dw_mci *host); 251 int (*parse_dt)(struct dw_mci *host);
252 int (*execute_tuning)(struct dw_mci_slot *slot, u32 opcode,
253 struct dw_mci_tuning_data *tuning_data);
206}; 254};
207#endif /* _DW_MMC_H_ */ 255#endif /* _DW_MMC_H_ */