Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
spi-dw.h File Reference
#include <linux/io.h>
#include <linux/scatterlist.h>

Go to the source code of this file.

Data Structures

struct  dw_spi_dma_ops
 
struct  dw_spi
 
struct  dw_spi_chip
 

Macros

#define DW_SPI_CTRL0   0x00
 
#define DW_SPI_CTRL1   0x04
 
#define DW_SPI_SSIENR   0x08
 
#define DW_SPI_MWCR   0x0c
 
#define DW_SPI_SER   0x10
 
#define DW_SPI_BAUDR   0x14
 
#define DW_SPI_TXFLTR   0x18
 
#define DW_SPI_RXFLTR   0x1c
 
#define DW_SPI_TXFLR   0x20
 
#define DW_SPI_RXFLR   0x24
 
#define DW_SPI_SR   0x28
 
#define DW_SPI_IMR   0x2c
 
#define DW_SPI_ISR   0x30
 
#define DW_SPI_RISR   0x34
 
#define DW_SPI_TXOICR   0x38
 
#define DW_SPI_RXOICR   0x3c
 
#define DW_SPI_RXUICR   0x40
 
#define DW_SPI_MSTICR   0x44
 
#define DW_SPI_ICR   0x48
 
#define DW_SPI_DMACR   0x4c
 
#define DW_SPI_DMATDLR   0x50
 
#define DW_SPI_DMARDLR   0x54
 
#define DW_SPI_IDR   0x58
 
#define DW_SPI_VERSION   0x5c
 
#define DW_SPI_DR   0x60
 
#define SPI_DFS_OFFSET   0
 
#define SPI_FRF_OFFSET   4
 
#define SPI_FRF_SPI   0x0
 
#define SPI_FRF_SSP   0x1
 
#define SPI_FRF_MICROWIRE   0x2
 
#define SPI_FRF_RESV   0x3
 
#define SPI_MODE_OFFSET   6
 
#define SPI_SCPH_OFFSET   6
 
#define SPI_SCOL_OFFSET   7
 
#define SPI_TMOD_OFFSET   8
 
#define SPI_TMOD_MASK   (0x3 << SPI_TMOD_OFFSET)
 
#define SPI_TMOD_TR   0x0 /* xmit & recv */
 
#define SPI_TMOD_TO   0x1 /* xmit only */
 
#define SPI_TMOD_RO   0x2 /* recv only */
 
#define SPI_TMOD_EPROMREAD   0x3 /* eeprom read mode */
 
#define SPI_SLVOE_OFFSET   10
 
#define SPI_SRL_OFFSET   11
 
#define SPI_CFS_OFFSET   12
 
#define SR_MASK   0x7f /* cover 7 bits */
 
#define SR_BUSY   (1 << 0)
 
#define SR_TF_NOT_FULL   (1 << 1)
 
#define SR_TF_EMPT   (1 << 2)
 
#define SR_RF_NOT_EMPT   (1 << 3)
 
#define SR_RF_FULL   (1 << 4)
 
#define SR_TX_ERR   (1 << 5)
 
#define SR_DCOL   (1 << 6)
 
#define SPI_INT_TXEI   (1 << 0)
 
#define SPI_INT_TXOI   (1 << 1)
 
#define SPI_INT_RXUI   (1 << 2)
 
#define SPI_INT_RXOI   (1 << 3)
 
#define SPI_INT_RXFI   (1 << 4)
 
#define SPI_INT_MSTI   (1 << 5)
 
#define SPI_INT_THRESHOLD   32
 

Enumerations

enum  dw_ssi_type { SSI_MOTO_SPI = 0, SSI_TI_SSP, SSI_NS_MICROWIRE }
 

Functions

int dw_spi_add_host (struct dw_spi *dws)
 
void dw_spi_remove_host (struct dw_spi *dws)
 
int dw_spi_suspend_host (struct dw_spi *dws)
 
int dw_spi_resume_host (struct dw_spi *dws)
 
void dw_spi_xfer_done (struct dw_spi *dws)
 
int dw_spi_mid_init (struct dw_spi *dws)
 

Macro Definition Documentation

#define DW_SPI_BAUDR   0x14

Definition at line 13 of file spi-dw.h.

#define DW_SPI_CTRL0   0x00

Definition at line 8 of file spi-dw.h.

#define DW_SPI_CTRL1   0x04

Definition at line 9 of file spi-dw.h.

#define DW_SPI_DMACR   0x4c

Definition at line 27 of file spi-dw.h.

#define DW_SPI_DMARDLR   0x54

Definition at line 29 of file spi-dw.h.

#define DW_SPI_DMATDLR   0x50

Definition at line 28 of file spi-dw.h.

#define DW_SPI_DR   0x60

Definition at line 32 of file spi-dw.h.

#define DW_SPI_ICR   0x48

Definition at line 26 of file spi-dw.h.

#define DW_SPI_IDR   0x58

Definition at line 30 of file spi-dw.h.

#define DW_SPI_IMR   0x2c

Definition at line 19 of file spi-dw.h.

#define DW_SPI_ISR   0x30

Definition at line 20 of file spi-dw.h.

#define DW_SPI_MSTICR   0x44

Definition at line 25 of file spi-dw.h.

#define DW_SPI_MWCR   0x0c

Definition at line 11 of file spi-dw.h.

#define DW_SPI_RISR   0x34

Definition at line 21 of file spi-dw.h.

#define DW_SPI_RXFLR   0x24

Definition at line 17 of file spi-dw.h.

#define DW_SPI_RXFLTR   0x1c

Definition at line 15 of file spi-dw.h.

#define DW_SPI_RXOICR   0x3c

Definition at line 23 of file spi-dw.h.

#define DW_SPI_RXUICR   0x40

Definition at line 24 of file spi-dw.h.

#define DW_SPI_SER   0x10

Definition at line 12 of file spi-dw.h.

#define DW_SPI_SR   0x28

Definition at line 18 of file spi-dw.h.

#define DW_SPI_SSIENR   0x08

Definition at line 10 of file spi-dw.h.

#define DW_SPI_TXFLR   0x20

Definition at line 16 of file spi-dw.h.

#define DW_SPI_TXFLTR   0x18

Definition at line 14 of file spi-dw.h.

#define DW_SPI_TXOICR   0x38

Definition at line 22 of file spi-dw.h.

#define DW_SPI_VERSION   0x5c

Definition at line 31 of file spi-dw.h.

#define SPI_CFS_OFFSET   12

Definition at line 56 of file spi-dw.h.

#define SPI_DFS_OFFSET   0

Definition at line 35 of file spi-dw.h.

#define SPI_FRF_MICROWIRE   0x2

Definition at line 40 of file spi-dw.h.

#define SPI_FRF_OFFSET   4

Definition at line 37 of file spi-dw.h.

#define SPI_FRF_RESV   0x3

Definition at line 41 of file spi-dw.h.

#define SPI_FRF_SPI   0x0

Definition at line 38 of file spi-dw.h.

#define SPI_FRF_SSP   0x1

Definition at line 39 of file spi-dw.h.

#define SPI_INT_MSTI   (1 << 5)

Definition at line 74 of file spi-dw.h.

#define SPI_INT_RXFI   (1 << 4)

Definition at line 73 of file spi-dw.h.

#define SPI_INT_RXOI   (1 << 3)

Definition at line 72 of file spi-dw.h.

#define SPI_INT_RXUI   (1 << 2)

Definition at line 71 of file spi-dw.h.

#define SPI_INT_THRESHOLD   32

Definition at line 77 of file spi-dw.h.

#define SPI_INT_TXEI   (1 << 0)

Definition at line 69 of file spi-dw.h.

#define SPI_INT_TXOI   (1 << 1)

Definition at line 70 of file spi-dw.h.

#define SPI_MODE_OFFSET   6

Definition at line 43 of file spi-dw.h.

#define SPI_SCOL_OFFSET   7

Definition at line 45 of file spi-dw.h.

#define SPI_SCPH_OFFSET   6

Definition at line 44 of file spi-dw.h.

#define SPI_SLVOE_OFFSET   10

Definition at line 54 of file spi-dw.h.

#define SPI_SRL_OFFSET   11

Definition at line 55 of file spi-dw.h.

#define SPI_TMOD_EPROMREAD   0x3 /* eeprom read mode */

Definition at line 52 of file spi-dw.h.

#define SPI_TMOD_MASK   (0x3 << SPI_TMOD_OFFSET)

Definition at line 48 of file spi-dw.h.

#define SPI_TMOD_OFFSET   8

Definition at line 47 of file spi-dw.h.

#define SPI_TMOD_RO   0x2 /* recv only */

Definition at line 51 of file spi-dw.h.

#define SPI_TMOD_TO   0x1 /* xmit only */

Definition at line 50 of file spi-dw.h.

#define SPI_TMOD_TR   0x0 /* xmit & recv */

Definition at line 49 of file spi-dw.h.

#define SR_BUSY   (1 << 0)

Definition at line 60 of file spi-dw.h.

#define SR_DCOL   (1 << 6)

Definition at line 66 of file spi-dw.h.

#define SR_MASK   0x7f /* cover 7 bits */

Definition at line 59 of file spi-dw.h.

#define SR_RF_FULL   (1 << 4)

Definition at line 64 of file spi-dw.h.

#define SR_RF_NOT_EMPT   (1 << 3)

Definition at line 63 of file spi-dw.h.

#define SR_TF_EMPT   (1 << 2)

Definition at line 62 of file spi-dw.h.

#define SR_TF_NOT_FULL   (1 << 1)

Definition at line 61 of file spi-dw.h.

#define SR_TX_ERR   (1 << 5)

Definition at line 65 of file spi-dw.h.

Enumeration Type Documentation

Enumerator:
SSI_MOTO_SPI 
SSI_TI_SSP 
SSI_NS_MICROWIRE 

Definition at line 79 of file spi-dw.h.

Function Documentation

int dw_spi_add_host ( struct dw_spi dws)

Definition at line 798 of file spi-dw.c.

int dw_spi_mid_init ( struct dw_spi dws)

Definition at line 204 of file spi-dw-mid.c.

void dw_spi_remove_host ( struct dw_spi dws)

Definition at line 880 of file spi-dw.c.

int dw_spi_resume_host ( struct dw_spi dws)

Definition at line 919 of file spi-dw.c.

int dw_spi_suspend_host ( struct dw_spi dws)

Definition at line 906 of file spi-dw.c.

void dw_spi_xfer_done ( struct dw_spi dws)

Definition at line 301 of file spi-dw.c.