Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
dw_mci Struct Reference

#include <dw_mmc.h>

Data Fields

spinlock_t lock
 
void __iomemregs
 
struct scatterlistsg
 
struct sg_mapping_iter sg_miter
 
struct dw_mci_slotcur_slot
 
struct mmc_requestmrq
 
struct mmc_commandcmd
 
struct mmc_datadata
 
struct workqueue_structcard_workqueue
 
int use_dma
 
int using_dma
 
dma_addr_t sg_dma
 
voidsg_cpu
 
struct dw_mci_dma_opsdma_ops
 
struct dw_mci_dma_data * dma_data
 
u32 cmd_status
 
u32 data_status
 
u32 stop_cmdr
 
u32 dir_status
 
struct tasklet_struct tasklet
 
struct work_struct card_work
 
unsigned long pending_events
 
unsigned long completed_events
 
enum dw_mci_state state
 
struct list_head queue
 
u32 bus_hz
 
u32 current_speed
 
u32 num_slots
 
u32 fifoth_val
 
u16 verid
 
u16 data_offset
 
struct devicedev
 
struct dw_mci_boardpdata
 
struct dw_mci_drv_datadrv_data
 
voidpriv
 
struct clkbiu_clk
 
struct clkciu_clk
 
struct dw_mci_slotslot [MAX_MCI_SLOTS]
 
int fifo_depth
 
int data_shift
 
u8 part_buf_start
 
u8 part_buf_count
 
union {
   u16   part_buf16
 
   u32   part_buf32
 
   u64   part_buf
 
}; 
 
void(* push_data )(struct dw_mci *host, void *buf, int cnt)
 
void(* pull_data )(struct dw_mci *host, void *buf, int cnt)
 
u32 quirks
 
struct regulatorvmmc
 
unsigned long irq_flags
 
int irq
 

Detailed Description

struct dw_mci - MMC controller state shared between all slots : Spinlock protecting the queue and associated data. : Pointer to MMIO registers. : Scatterlist entry currently being processed by PIO code, if any. : PIO mapping scatterlist iterator. : The slot which is currently using the controller. : The request currently being processed on , or NULL if the controller is idle. : The command currently being sent to the card, or NULL. : The data currently being transferred, or NULL if no data transfer is in progress. : Whether DMA channel is initialized or not. : Whether DMA is in use for the current transfer. : Bus address of DMA buffer. : Virtual address of DMA buffer. : Pointer to platform-specific DMA callbacks. : Snapshot of SR taken upon completion of the current command. Only valid when EVENT_CMD_COMPLETE is pending. : Snapshot of SR taken upon completion of the current data transfer. Only valid when EVENT_DATA_COMPLETE or EVENT_DATA_ERROR is pending. : Value to be loaded into CMDR when the stop command is to be sent. : Direction of current transfer. : Tasklet running the request state machine. : Tasklet handling card detect. : Bitmask of events flagged by the interrupt handler to be processed by the tasklet. : Bitmask of events which the state machine has processed. : Tasklet state. : List of slots waiting for access to the controller. : The rate of in Hz. This forms the basis for MMC bus rate and timeout calculations. : Configured rate of the controller. : Number of slots available. : Denote Version ID. : Set the offset of DATA register according to VERID. : Device associated with the MMC controller. : Platform data associated with the MMC controller. : Driver specific data for identified variant of the controller : Implementation defined private data. : Pointer to bus interface unit clock instance. : Pointer to card interface unit clock instance. : Slots sharing this MMC controller. : depth of FIFO. : log2 of FIFO item size. : Start index in part_buf. : Bytes of partial data in part_buf. : Simple buffer for partial fifo reads/writes. : Pointer to FIFO push function. : Pointer to FIFO pull function. : Set of quirks that apply to specific versions of the IP. : The flags to be passed to request_irq. : The irq value to be passed to request_irq.

Locking

is a softirq-safe spinlock protecting as well as , and . These must always be updated at the same time while holding .

The field of struct dw_mci_slot is also protected by , and must always be written at the same time as the slot is added to .

and are accessed using atomic bit operations, so they don't need any locking.

None of the fields touched by the interrupt handler need any locking. However, ordering is important: Before EVENT_DATA_ERROR or EVENT_DATA_COMPLETE is set in , all data-related interrupts must be disabled and updated with a snapshot of SR. Similarly, before EVENT_CMD_COMPLETE is set, the CMDRDY interrupt must be disabled and updated with a snapshot of SR, and before EVENT_XFER_COMPLETE can be set, the bytes_xfered field of must be written. This is ensured by using barriers.

Definition at line 121 of file dw_mmc.h.

Field Documentation

union { ... }
struct clk* biu_clk

Definition at line 167 of file dw_mmc.h.

u32 bus_hz

Definition at line 157 of file dw_mmc.h.

struct work_struct card_work

Definition at line 151 of file dw_mmc.h.

struct workqueue_struct* card_workqueue

Definition at line 132 of file dw_mmc.h.

struct clk* ciu_clk

Definition at line 168 of file dw_mmc.h.

Definition at line 130 of file dw_mmc.h.

u32 cmd_status

Definition at line 146 of file dw_mmc.h.

unsigned long completed_events

Definition at line 153 of file dw_mmc.h.

struct dw_mci_slot* cur_slot

Definition at line 128 of file dw_mmc.h.

u32 current_speed

Definition at line 158 of file dw_mmc.h.

Definition at line 131 of file dw_mmc.h.

u16 data_offset

Definition at line 162 of file dw_mmc.h.

int data_shift

Definition at line 173 of file dw_mmc.h.

u32 data_status

Definition at line 147 of file dw_mmc.h.

struct device* dev

Definition at line 163 of file dw_mmc.h.

u32 dir_status

Definition at line 149 of file dw_mmc.h.

struct dw_mci_dma_data* dma_data

Definition at line 144 of file dw_mmc.h.

Definition at line 140 of file dw_mmc.h.

Definition at line 165 of file dw_mmc.h.

int fifo_depth

Definition at line 172 of file dw_mmc.h.

u32 fifoth_val

Definition at line 160 of file dw_mmc.h.

int irq

Definition at line 189 of file dw_mmc.h.

unsigned long irq_flags

Definition at line 188 of file dw_mmc.h.

spinlock_t lock

Definition at line 122 of file dw_mmc.h.

Definition at line 129 of file dw_mmc.h.

u32 num_slots

Definition at line 159 of file dw_mmc.h.

u64 part_buf

Definition at line 179 of file dw_mmc.h.

u16 part_buf16

Definition at line 177 of file dw_mmc.h.

u32 part_buf32

Definition at line 178 of file dw_mmc.h.

u8 part_buf_count

Definition at line 175 of file dw_mmc.h.

u8 part_buf_start

Definition at line 174 of file dw_mmc.h.

Definition at line 164 of file dw_mmc.h.

unsigned long pending_events

Definition at line 152 of file dw_mmc.h.

Definition at line 166 of file dw_mmc.h.

void(* pull_data)(struct dw_mci *host, void *buf, int cnt)

Definition at line 182 of file dw_mmc.h.

void(* push_data)(struct dw_mci *host, void *buf, int cnt)

Definition at line 181 of file dw_mmc.h.

Definition at line 155 of file dw_mmc.h.

u32 quirks

Definition at line 185 of file dw_mmc.h.

Definition at line 123 of file dw_mmc.h.

Definition at line 125 of file dw_mmc.h.

void* sg_cpu

Definition at line 139 of file dw_mmc.h.

dma_addr_t sg_dma

Definition at line 138 of file dw_mmc.h.

Definition at line 126 of file dw_mmc.h.

Definition at line 169 of file dw_mmc.h.

Definition at line 154 of file dw_mmc.h.

u32 stop_cmdr

Definition at line 148 of file dw_mmc.h.

Definition at line 150 of file dw_mmc.h.

int use_dma

Definition at line 135 of file dw_mmc.h.

int using_dma

Definition at line 136 of file dw_mmc.h.

u16 verid

Definition at line 161 of file dw_mmc.h.

Definition at line 187 of file dw_mmc.h.


The documentation for this struct was generated from the following file: