1 /* 2 * Synopsys DesignWare Multimedia Card Interface driver 3 * (Based on NXP driver for lpc 31xx) 4 * 5 * Copyright (C) 2009 NXP Semiconductors 6 * Copyright (C) 2009, 2010 Imagination Technologies Ltd. 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 2 of the License, or 11 * (at your option) any later version. 12 */ 13 14 #ifndef _DW_MMC_H_ 15 #define _DW_MMC_H_ 16 17 #include <linux/scatterlist.h> 18 #include <linux/mmc/core.h> 19 #include <linux/dmaengine.h> 20 #include <linux/reset.h> 21 #include <linux/interrupt.h> 22 23 enum dw_mci_state { 24 STATE_IDLE = 0, 25 STATE_SENDING_CMD, 26 STATE_SENDING_DATA, 27 STATE_DATA_BUSY, 28 STATE_SENDING_STOP, 29 STATE_DATA_ERROR, 30 STATE_SENDING_CMD11, 31 STATE_WAITING_CMD11_DONE, 32 }; 33 34 enum { 35 EVENT_CMD_COMPLETE = 0, 36 EVENT_XFER_COMPLETE, 37 EVENT_DATA_COMPLETE, 38 EVENT_DATA_ERROR, 39 }; 40 41 enum dw_mci_cookie { 42 COOKIE_UNMAPPED, 43 COOKIE_PRE_MAPPED, /* mapped by pre_req() of dwmmc */ 44 COOKIE_MAPPED, /* mapped by prepare_data() of dwmmc */ 45 }; 46 47 struct mmc_data; 48 49 enum { 50 TRANS_MODE_PIO = 0, 51 TRANS_MODE_IDMAC, 52 TRANS_MODE_EDMAC 53 }; 54 55 struct dw_mci_dma_slave { 56 struct dma_chan *ch; 57 enum dma_transfer_direction direction; 58 }; 59 60 /** 61 * struct dw_mci - MMC controller state shared between all slots 62 * @lock: Spinlock protecting the queue and associated data. 63 * @irq_lock: Spinlock protecting the INTMASK setting. 64 * @regs: Pointer to MMIO registers. 65 * @fifo_reg: Pointer to MMIO registers for data FIFO 66 * @sg: Scatterlist entry currently being processed by PIO code, if any. 67 * @sg_miter: PIO mapping scatterlist iterator. 68 * @mrq: The request currently being processed on @slot, 69 * or NULL if the controller is idle. 70 * @cmd: The command currently being sent to the card, or NULL. 71 * @data: The data currently being transferred, or NULL if no data 72 * transfer is in progress. 73 * @stop_abort: The command currently prepared for stoping transfer. 74 * @prev_blksz: The former transfer blksz record. 75 * @timing: Record of current ios timing. 76 * @use_dma: Which DMA channel is in use for the current transfer, zero 77 * denotes PIO mode. 78 * @using_dma: Whether DMA is in use for the current transfer. 79 * @dma_64bit_address: Whether DMA supports 64-bit address mode or not. 80 * @sg_dma: Bus address of DMA buffer. 81 * @sg_cpu: Virtual address of DMA buffer. 82 * @dma_ops: Pointer to platform-specific DMA callbacks. 83 * @cmd_status: Snapshot of SR taken upon completion of the current 84 * @ring_size: Buffer size for idma descriptors. 85 * command. Only valid when EVENT_CMD_COMPLETE is pending. 86 * @dms: structure of slave-dma private data. 87 * @phy_regs: physical address of controller's register map 88 * @data_status: Snapshot of SR taken upon completion of the current 89 * data transfer. Only valid when EVENT_DATA_COMPLETE or 90 * EVENT_DATA_ERROR is pending. 91 * @stop_cmdr: Value to be loaded into CMDR when the stop command is 92 * to be sent. 93 * @dir_status: Direction of current transfer. 94 * @tasklet: Tasklet running the request state machine. 95 * @pending_events: Bitmask of events flagged by the interrupt handler 96 * to be processed by the tasklet. 97 * @completed_events: Bitmask of events which the state machine has 98 * processed. 99 * @state: Tasklet state. 100 * @queue: List of slots waiting for access to the controller. 101 * @bus_hz: The rate of @mck in Hz. This forms the basis for MMC bus 102 * rate and timeout calculations. 103 * @current_speed: Configured rate of the controller. 104 * @fifoth_val: The value of FIFOTH register. 105 * @verid: Denote Version ID. 106 * @dev: Device associated with the MMC controller. 107 * @pdata: Platform data associated with the MMC controller. 108 * @drv_data: Driver specific data for identified variant of the controller 109 * @priv: Implementation defined private data. 110 * @biu_clk: Pointer to bus interface unit clock instance. 111 * @ciu_clk: Pointer to card interface unit clock instance. 112 * @slot: Slots sharing this MMC controller. 113 * @fifo_depth: depth of FIFO. 114 * @data_addr_override: override fifo reg offset with this value. 115 * @wm_aligned: force fifo watermark equal with data length in PIO mode. 116 * Set as true if alignment is needed. 117 * @data_shift: log2 of FIFO item size. 118 * @part_buf_start: Start index in part_buf. 119 * @part_buf_count: Bytes of partial data in part_buf. 120 * @part_buf: Simple buffer for partial fifo reads/writes. 121 * @push_data: Pointer to FIFO push function. 122 * @pull_data: Pointer to FIFO pull function. 123 * @vqmmc_enabled: Status of vqmmc, should be true or false. 124 * @irq_flags: The flags to be passed to request_irq. 125 * @irq: The irq value to be passed to request_irq. 126 * @sdio_id0: Number of slot0 in the SDIO interrupt registers. 127 * @cmd11_timer: Timer for SD3.0 voltage switch over scheme. 128 * @cto_timer: Timer for broken command transfer over scheme. 129 * @dto_timer: Timer for broken data transfer over scheme. 130 * 131 * Locking 132 * ======= 133 * 134 * @lock is a softirq-safe spinlock protecting @queue as well as 135 * @slot, @mrq and @state. These must always be updated 136 * at the same time while holding @lock. 137 * The @mrq field of struct dw_mci_slot is also protected by @lock, 138 * and must always be written at the same time as the slot is added to 139 * @queue. 140 * 141 * @irq_lock is an irq-safe spinlock protecting the INTMASK register 142 * to allow the interrupt handler to modify it directly. Held for only long 143 * enough to read-modify-write INTMASK and no other locks are grabbed when 144 * holding this one. 145 * 146 * @pending_events and @completed_events are accessed using atomic bit 147 * operations, so they don't need any locking. 148 * 149 * None of the fields touched by the interrupt handler need any 150 * locking. However, ordering is important: Before EVENT_DATA_ERROR or 151 * EVENT_DATA_COMPLETE is set in @pending_events, all data-related 152 * interrupts must be disabled and @data_status updated with a 153 * snapshot of SR. Similarly, before EVENT_CMD_COMPLETE is set, the 154 * CMDRDY interrupt must be disabled and @cmd_status updated with a 155 * snapshot of SR, and before EVENT_XFER_COMPLETE can be set, the 156 * bytes_xfered field of @data must be written. This is ensured by 157 * using barriers. 158 */ 159 struct dw_mci { 160 spinlock_t lock; 161 spinlock_t irq_lock; 162 void __iomem *regs; 163 void __iomem *fifo_reg; 164 u32 data_addr_override; 165 bool wm_aligned; 166 167 struct scatterlist *sg; 168 struct sg_mapping_iter sg_miter; 169 170 struct mmc_request *mrq; 171 struct mmc_command *cmd; 172 struct mmc_data *data; 173 struct mmc_command stop_abort; 174 unsigned int prev_blksz; 175 unsigned char timing; 176 177 /* DMA interface members*/ 178 int use_dma; 179 int using_dma; 180 int dma_64bit_address; 181 182 dma_addr_t sg_dma; 183 void *sg_cpu; 184 const struct dw_mci_dma_ops *dma_ops; 185 /* For idmac */ 186 unsigned int ring_size; 187 188 /* For edmac */ 189 struct dw_mci_dma_slave *dms; 190 /* Registers's physical base address */ 191 resource_size_t phy_regs; 192 193 u32 cmd_status; 194 u32 data_status; 195 u32 stop_cmdr; 196 u32 dir_status; 197 struct tasklet_struct tasklet; 198 unsigned long pending_events; 199 unsigned long completed_events; 200 enum dw_mci_state state; 201 struct list_head queue; 202 203 u32 bus_hz; 204 u32 current_speed; 205 u32 fifoth_val; 206 u16 verid; 207 struct device *dev; 208 struct dw_mci_board *pdata; 209 const struct dw_mci_drv_data *drv_data; 210 void *priv; 211 struct clk *biu_clk; 212 struct clk *ciu_clk; 213 struct dw_mci_slot *slot; 214 215 /* FIFO push and pull */ 216 int fifo_depth; 217 int data_shift; 218 u8 part_buf_start; 219 u8 part_buf_count; 220 union { 221 u16 part_buf16; 222 u32 part_buf32; 223 u64 part_buf; 224 }; 225 void (*push_data)(struct dw_mci *host, void *buf, int cnt); 226 void (*pull_data)(struct dw_mci *host, void *buf, int cnt); 227 228 bool vqmmc_enabled; 229 unsigned long irq_flags; /* IRQ flags */ 230 int irq; 231 232 int sdio_id0; 233 234 struct timer_list cmd11_timer; 235 struct timer_list cto_timer; 236 struct timer_list dto_timer; 237 }; 238 239 /* DMA ops for Internal/External DMAC interface */ 240 struct dw_mci_dma_ops { 241 /* DMA Ops */ 242 int (*init)(struct dw_mci *host); 243 int (*start)(struct dw_mci *host, unsigned int sg_len); 244 void (*complete)(void *host); 245 void (*stop)(struct dw_mci *host); 246 void (*cleanup)(struct dw_mci *host); 247 void (*exit)(struct dw_mci *host); 248 }; 249 250 struct dma_pdata; 251 252 /* Board platform data */ 253 struct dw_mci_board { 254 unsigned int bus_hz; /* Clock speed at the cclk_in pad */ 255 256 u32 caps; /* Capabilities */ 257 u32 caps2; /* More capabilities */ 258 u32 pm_caps; /* PM capabilities */ 259 /* 260 * Override fifo depth. If 0, autodetect it from the FIFOTH register, 261 * but note that this may not be reliable after a bootloader has used 262 * it. 263 */ 264 unsigned int fifo_depth; 265 266 /* delay in mS before detecting cards after interrupt */ 267 u32 detect_delay_ms; 268 269 struct reset_control *rstc; 270 struct dw_mci_dma_ops *dma_ops; 271 struct dma_pdata *data; 272 }; 273 274 #define DW_MMC_240A 0x240a 275 #define DW_MMC_280A 0x280a 276 277 #define SDMMC_CTRL 0x000 278 #define SDMMC_PWREN 0x004 279 #define SDMMC_CLKDIV 0x008 280 #define SDMMC_CLKSRC 0x00c 281 #define SDMMC_CLKENA 0x010 282 #define SDMMC_TMOUT 0x014 283 #define SDMMC_CTYPE 0x018 284 #define SDMMC_BLKSIZ 0x01c 285 #define SDMMC_BYTCNT 0x020 286 #define SDMMC_INTMASK 0x024 287 #define SDMMC_CMDARG 0x028 288 #define SDMMC_CMD 0x02c 289 #define SDMMC_RESP0 0x030 290 #define SDMMC_RESP1 0x034 291 #define SDMMC_RESP2 0x038 292 #define SDMMC_RESP3 0x03c 293 #define SDMMC_MINTSTS 0x040 294 #define SDMMC_RINTSTS 0x044 295 #define SDMMC_STATUS 0x048 296 #define SDMMC_FIFOTH 0x04c 297 #define SDMMC_CDETECT 0x050 298 #define SDMMC_WRTPRT 0x054 299 #define SDMMC_GPIO 0x058 300 #define SDMMC_TCBCNT 0x05c 301 #define SDMMC_TBBCNT 0x060 302 #define SDMMC_DEBNCE 0x064 303 #define SDMMC_USRID 0x068 304 #define SDMMC_VERID 0x06c 305 #define SDMMC_HCON 0x070 306 #define SDMMC_UHS_REG 0x074 307 #define SDMMC_RST_N 0x078 308 #define SDMMC_BMOD 0x080 309 #define SDMMC_PLDMND 0x084 310 #define SDMMC_DBADDR 0x088 311 #define SDMMC_IDSTS 0x08c 312 #define SDMMC_IDINTEN 0x090 313 #define SDMMC_DSCADDR 0x094 314 #define SDMMC_BUFADDR 0x098 315 #define SDMMC_CDTHRCTL 0x100 316 #define SDMMC_UHS_REG_EXT 0x108 317 #define SDMMC_ENABLE_SHIFT 0x110 318 #define SDMMC_DATA(x) (x) 319 /* 320 * Registers to support idmac 64-bit address mode 321 */ 322 #define SDMMC_DBADDRL 0x088 323 #define SDMMC_DBADDRU 0x08c 324 #define SDMMC_IDSTS64 0x090 325 #define SDMMC_IDINTEN64 0x094 326 #define SDMMC_DSCADDRL 0x098 327 #define SDMMC_DSCADDRU 0x09c 328 #define SDMMC_BUFADDRL 0x0A0 329 #define SDMMC_BUFADDRU 0x0A4 330 331 /* 332 * Data offset is difference according to Version 333 * Lower than 2.40a : data register offest is 0x100 334 */ 335 #define DATA_OFFSET 0x100 336 #define DATA_240A_OFFSET 0x200 337 338 /* shift bit field */ 339 #define _SBF(f, v) ((v) << (f)) 340 341 /* Control register defines */ 342 #define SDMMC_CTRL_USE_IDMAC BIT(25) 343 #define SDMMC_CTRL_CEATA_INT_EN BIT(11) 344 #define SDMMC_CTRL_SEND_AS_CCSD BIT(10) 345 #define SDMMC_CTRL_SEND_CCSD BIT(9) 346 #define SDMMC_CTRL_ABRT_READ_DATA BIT(8) 347 #define SDMMC_CTRL_SEND_IRQ_RESP BIT(7) 348 #define SDMMC_CTRL_READ_WAIT BIT(6) 349 #define SDMMC_CTRL_DMA_ENABLE BIT(5) 350 #define SDMMC_CTRL_INT_ENABLE BIT(4) 351 #define SDMMC_CTRL_DMA_RESET BIT(2) 352 #define SDMMC_CTRL_FIFO_RESET BIT(1) 353 #define SDMMC_CTRL_RESET BIT(0) 354 /* Clock Enable register defines */ 355 #define SDMMC_CLKEN_LOW_PWR BIT(16) 356 #define SDMMC_CLKEN_ENABLE BIT(0) 357 /* time-out register defines */ 358 #define SDMMC_TMOUT_DATA(n) _SBF(8, (n)) 359 #define SDMMC_TMOUT_DATA_MSK 0xFFFFFF00 360 #define SDMMC_TMOUT_RESP(n) ((n) & 0xFF) 361 #define SDMMC_TMOUT_RESP_MSK 0xFF 362 /* card-type register defines */ 363 #define SDMMC_CTYPE_8BIT BIT(16) 364 #define SDMMC_CTYPE_4BIT BIT(0) 365 #define SDMMC_CTYPE_1BIT 0 366 /* Interrupt status & mask register defines */ 367 #define SDMMC_INT_SDIO(n) BIT(16 + (n)) 368 #define SDMMC_INT_EBE BIT(15) 369 #define SDMMC_INT_ACD BIT(14) 370 #define SDMMC_INT_SBE BIT(13) 371 #define SDMMC_INT_HLE BIT(12) 372 #define SDMMC_INT_FRUN BIT(11) 373 #define SDMMC_INT_HTO BIT(10) 374 #define SDMMC_INT_VOLT_SWITCH BIT(10) /* overloads bit 10! */ 375 #define SDMMC_INT_DRTO BIT(9) 376 #define SDMMC_INT_RTO BIT(8) 377 #define SDMMC_INT_DCRC BIT(7) 378 #define SDMMC_INT_RCRC BIT(6) 379 #define SDMMC_INT_RXDR BIT(5) 380 #define SDMMC_INT_TXDR BIT(4) 381 #define SDMMC_INT_DATA_OVER BIT(3) 382 #define SDMMC_INT_CMD_DONE BIT(2) 383 #define SDMMC_INT_RESP_ERR BIT(1) 384 #define SDMMC_INT_CD BIT(0) 385 #define SDMMC_INT_ERROR 0xbfc2 386 /* Command register defines */ 387 #define SDMMC_CMD_START BIT(31) 388 #define SDMMC_CMD_USE_HOLD_REG BIT(29) 389 #define SDMMC_CMD_VOLT_SWITCH BIT(28) 390 #define SDMMC_CMD_CCS_EXP BIT(23) 391 #define SDMMC_CMD_CEATA_RD BIT(22) 392 #define SDMMC_CMD_UPD_CLK BIT(21) 393 #define SDMMC_CMD_INIT BIT(15) 394 #define SDMMC_CMD_STOP BIT(14) 395 #define SDMMC_CMD_PRV_DAT_WAIT BIT(13) 396 #define SDMMC_CMD_SEND_STOP BIT(12) 397 #define SDMMC_CMD_STRM_MODE BIT(11) 398 #define SDMMC_CMD_DAT_WR BIT(10) 399 #define SDMMC_CMD_DAT_EXP BIT(9) 400 #define SDMMC_CMD_RESP_CRC BIT(8) 401 #define SDMMC_CMD_RESP_LONG BIT(7) 402 #define SDMMC_CMD_RESP_EXP BIT(6) 403 #define SDMMC_CMD_INDX(n) ((n) & 0x1F) 404 /* Status register defines */ 405 #define SDMMC_GET_FCNT(x) (((x)>>17) & 0x1FFF) 406 #define SDMMC_STATUS_DMA_REQ BIT(31) 407 #define SDMMC_STATUS_BUSY BIT(9) 408 /* FIFOTH register defines */ 409 #define SDMMC_SET_FIFOTH(m, r, t) (((m) & 0x7) << 28 | \ 410 ((r) & 0xFFF) << 16 | \ 411 ((t) & 0xFFF)) 412 /* HCON register defines */ 413 #define DMA_INTERFACE_IDMA (0x0) 414 #define DMA_INTERFACE_DWDMA (0x1) 415 #define DMA_INTERFACE_GDMA (0x2) 416 #define DMA_INTERFACE_NODMA (0x3) 417 #define SDMMC_GET_TRANS_MODE(x) (((x)>>16) & 0x3) 418 #define SDMMC_GET_SLOT_NUM(x) ((((x)>>1) & 0x1F) + 1) 419 #define SDMMC_GET_HDATA_WIDTH(x) (((x)>>7) & 0x7) 420 #define SDMMC_GET_ADDR_CONFIG(x) (((x)>>27) & 0x1) 421 /* Internal DMAC interrupt defines */ 422 #define SDMMC_IDMAC_INT_AI BIT(9) 423 #define SDMMC_IDMAC_INT_NI BIT(8) 424 #define SDMMC_IDMAC_INT_CES BIT(5) 425 #define SDMMC_IDMAC_INT_DU BIT(4) 426 #define SDMMC_IDMAC_INT_FBE BIT(2) 427 #define SDMMC_IDMAC_INT_RI BIT(1) 428 #define SDMMC_IDMAC_INT_TI BIT(0) 429 /* Internal DMAC bus mode bits */ 430 #define SDMMC_IDMAC_ENABLE BIT(7) 431 #define SDMMC_IDMAC_FB BIT(1) 432 #define SDMMC_IDMAC_SWRESET BIT(0) 433 /* H/W reset */ 434 #define SDMMC_RST_HWACTIVE 0x1 435 /* Version ID register define */ 436 #define SDMMC_GET_VERID(x) ((x) & 0xFFFF) 437 /* Card read threshold */ 438 #define SDMMC_SET_THLD(v, x) (((v) & 0xFFF) << 16 | (x)) 439 #define SDMMC_CARD_WR_THR_EN BIT(2) 440 #define SDMMC_CARD_RD_THR_EN BIT(0) 441 /* UHS-1 register defines */ 442 #define SDMMC_UHS_18V BIT(0) 443 /* All ctrl reset bits */ 444 #define SDMMC_CTRL_ALL_RESET_FLAGS \ 445 (SDMMC_CTRL_RESET | SDMMC_CTRL_FIFO_RESET | SDMMC_CTRL_DMA_RESET) 446 447 /* FIFO register access macros. These should not change the data endian-ness 448 * as they are written to memory to be dealt with by the upper layers 449 */ 450 #define mci_fifo_readw(__reg) __raw_readw(__reg) 451 #define mci_fifo_readl(__reg) __raw_readl(__reg) 452 #define mci_fifo_readq(__reg) __raw_readq(__reg) 453 454 #define mci_fifo_writew(__value, __reg) __raw_writew(__reg, __value) 455 #define mci_fifo_writel(__value, __reg) __raw_writel(__reg, __value) 456 #define mci_fifo_writeq(__value, __reg) __raw_writeq(__reg, __value) 457 458 /* Register access macros */ 459 #define mci_readl(dev, reg) \ 460 readl_relaxed((dev)->regs + SDMMC_##reg) 461 #define mci_writel(dev, reg, value) \ 462 writel_relaxed((value), (dev)->regs + SDMMC_##reg) 463 464 /* 16-bit FIFO access macros */ 465 #define mci_readw(dev, reg) \ 466 readw_relaxed((dev)->regs + SDMMC_##reg) 467 #define mci_writew(dev, reg, value) \ 468 writew_relaxed((value), (dev)->regs + SDMMC_##reg) 469 470 /* 64-bit FIFO access macros */ 471 #ifdef readq 472 #define mci_readq(dev, reg) \ 473 readq_relaxed((dev)->regs + SDMMC_##reg) 474 #define mci_writeq(dev, reg, value) \ 475 writeq_relaxed((value), (dev)->regs + SDMMC_##reg) 476 #else 477 /* 478 * Dummy readq implementation for architectures that don't define it. 479 * 480 * We would assume that none of these architectures would configure 481 * the IP block with a 64bit FIFO width, so this code will never be 482 * executed on those machines. Defining these macros here keeps the 483 * rest of the code free from ifdefs. 484 */ 485 #define mci_readq(dev, reg) \ 486 (*(volatile u64 __force *)((dev)->regs + SDMMC_##reg)) 487 #define mci_writeq(dev, reg, value) \ 488 (*(volatile u64 __force *)((dev)->regs + SDMMC_##reg) = (value)) 489 490 #define __raw_writeq(__value, __reg) \ 491 (*(volatile u64 __force *)(__reg) = (__value)) 492 #define __raw_readq(__reg) (*(volatile u64 __force *)(__reg)) 493 #endif 494 495 extern int dw_mci_probe(struct dw_mci *host); 496 extern void dw_mci_remove(struct dw_mci *host); 497 #ifdef CONFIG_PM 498 extern int dw_mci_runtime_suspend(struct device *device); 499 extern int dw_mci_runtime_resume(struct device *device); 500 #endif 501 502 /** 503 * struct dw_mci_slot - MMC slot state 504 * @mmc: The mmc_host representing this slot. 505 * @host: The MMC controller this slot is using. 506 * @ctype: Card type for this slot. 507 * @mrq: mmc_request currently being processed or waiting to be 508 * processed, or NULL when the slot is idle. 509 * @queue_node: List node for placing this node in the @queue list of 510 * &struct dw_mci. 511 * @clock: Clock rate configured by set_ios(). Protected by host->lock. 512 * @__clk_old: The last clock value that was requested from core. 513 * Keeping track of this helps us to avoid spamming the console. 514 * @flags: Random state bits associated with the slot. 515 * @id: Number of this slot. 516 * @sdio_id: Number of this slot in the SDIO interrupt registers. 517 */ 518 struct dw_mci_slot { 519 struct mmc_host *mmc; 520 struct dw_mci *host; 521 522 u32 ctype; 523 524 struct mmc_request *mrq; 525 struct list_head queue_node; 526 527 unsigned int clock; 528 unsigned int __clk_old; 529 530 unsigned long flags; 531 #define DW_MMC_CARD_PRESENT 0 532 #define DW_MMC_CARD_NEED_INIT 1 533 #define DW_MMC_CARD_NO_LOW_PWR 2 534 #define DW_MMC_CARD_NO_USE_HOLD 3 535 #define DW_MMC_CARD_NEEDS_POLL 4 536 int id; 537 int sdio_id; 538 }; 539 540 /** 541 * dw_mci driver data - dw-mshc implementation specific driver data. 542 * @caps: mmc subsystem specified capabilities of the controller(s). 543 * @num_caps: number of capabilities specified by @caps. 544 * @init: early implementation specific initialization. 545 * @set_ios: handle bus specific extensions. 546 * @parse_dt: parse implementation specific device tree properties. 547 * @execute_tuning: implementation specific tuning procedure. 548 * 549 * Provide controller implementation specific extensions. The usage of this 550 * data structure is fully optional and usage of each member in this structure 551 * is optional as well. 552 */ 553 struct dw_mci_drv_data { 554 unsigned long *caps; 555 u32 num_caps; 556 int (*init)(struct dw_mci *host); 557 void (*set_ios)(struct dw_mci *host, struct mmc_ios *ios); 558 int (*parse_dt)(struct dw_mci *host); 559 int (*execute_tuning)(struct dw_mci_slot *slot, u32 opcode); 560 int (*prepare_hs400_tuning)(struct dw_mci *host, 561 struct mmc_ios *ios); 562 int (*switch_voltage)(struct mmc_host *mmc, 563 struct mmc_ios *ios); 564 }; 565 #endif /* _DW_MMC_H_ */ 566