Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
caif_spi.h File Reference
#include <net/caif/caif_device.h>

Go to the source code of this file.

Data Structures

struct  cfspi_xfer
 
struct  cfspi_ifc
 
struct  cfspi_dev
 
struct  cfspi
 

Macros

#define SPI_CMD_WR   0x00
 
#define SPI_CMD_RD   0x01
 
#define SPI_CMD_EOT   0x02
 
#define SPI_CMD_IND   0x04
 
#define SPI_DMA_BUF_LEN   8192
 
#define WL_SZ   2 /* 16 bits. */
 
#define SPI_CMD_SZ   4 /* 32 bits. */
 
#define SPI_IND_SZ   4 /* 32 bits. */
 
#define SPI_XFER   0
 
#define SPI_SS_ON   1
 
#define SPI_SS_OFF   2
 
#define SPI_TERMINATE   3
 
#define MIN_TRANSITION_TIME_USEC   50
 
#define SPI_MASTER_CLK_MHZ   13
 
#define SPI_XFER_TIME_USEC(bytes, clk)   (((bytes) * 8) / clk)
 
#define CAIF_MAX_SPI_FRAME   4092
 
#define CAIF_MAX_SPI_PKTS   9
 
#define CFSPI_DBG_PREFILL   0
 

Enumerations

enum  cfspi_state {
  CFSPI_STATE_WAITING = 0, CFSPI_STATE_AWAKE, CFSPI_STATE_FETCH_PKT, CFSPI_STATE_GET_NEXT,
  CFSPI_STATE_INIT_XFER, CFSPI_STATE_WAIT_ACTIVE, CFSPI_STATE_SIG_ACTIVE, CFSPI_STATE_WAIT_XFER_DONE,
  CFSPI_STATE_XFER_DONE, CFSPI_STATE_WAIT_INACTIVE, CFSPI_STATE_SIG_INACTIVE, CFSPI_STATE_DELIVER_PKT,
  CFSPI_STATE_MAX
}
 

Functions

void cfspi_dbg_state (struct cfspi *cfspi, int state)
 
int cfspi_xmitfrm (struct cfspi *cfspi, u8 *buf, size_t len)
 
int cfspi_xmitlen (struct cfspi *cfspi)
 
int cfspi_rxfrm (struct cfspi *cfspi, u8 *buf, size_t len)
 
int cfspi_spi_remove (struct platform_device *pdev)
 
int cfspi_spi_probe (struct platform_device *pdev)
 
void cfspi_xfer (struct work_struct *work)
 

Variables

int spi_frm_align
 
int spi_up_head_align
 
int spi_up_tail_align
 
int spi_down_head_align
 
int spi_down_tail_align
 
struct platform_driver cfspi_spi_driver
 

Macro Definition Documentation

#define CAIF_MAX_SPI_FRAME   4092

Definition at line 41 of file caif_spi.h.

#define CAIF_MAX_SPI_PKTS   9

Definition at line 47 of file caif_spi.h.

#define CFSPI_DBG_PREFILL   0

Definition at line 52 of file caif_spi.h.

#define MIN_TRANSITION_TIME_USEC   50

Definition at line 29 of file caif_spi.h.

#define SPI_CMD_EOT   0x02

Definition at line 14 of file caif_spi.h.

#define SPI_CMD_IND   0x04

Definition at line 15 of file caif_spi.h.

#define SPI_CMD_RD   0x01

Definition at line 13 of file caif_spi.h.

#define SPI_CMD_SZ   4 /* 32 bits. */

Definition at line 20 of file caif_spi.h.

#define SPI_CMD_WR   0x00

Definition at line 12 of file caif_spi.h.

#define SPI_DMA_BUF_LEN   8192

Definition at line 17 of file caif_spi.h.

#define SPI_IND_SZ   4 /* 32 bits. */

Definition at line 21 of file caif_spi.h.

#define SPI_MASTER_CLK_MHZ   13

Definition at line 34 of file caif_spi.h.

#define SPI_SS_OFF   2

Definition at line 25 of file caif_spi.h.

#define SPI_SS_ON   1

Definition at line 24 of file caif_spi.h.

#define SPI_TERMINATE   3

Definition at line 26 of file caif_spi.h.

#define SPI_XFER   0

Definition at line 23 of file caif_spi.h.

#define SPI_XFER_TIME_USEC (   bytes,
  clk 
)    (((bytes) * 8) / clk)

Definition at line 35 of file caif_spi.h.

#define WL_SZ   2 /* 16 bits. */

Definition at line 19 of file caif_spi.h.

Enumeration Type Documentation

Enumerator:
CFSPI_STATE_WAITING 
CFSPI_STATE_AWAKE 
CFSPI_STATE_FETCH_PKT 
CFSPI_STATE_GET_NEXT 
CFSPI_STATE_INIT_XFER 
CFSPI_STATE_WAIT_ACTIVE 
CFSPI_STATE_SIG_ACTIVE 
CFSPI_STATE_WAIT_XFER_DONE 
CFSPI_STATE_XFER_DONE 
CFSPI_STATE_WAIT_INACTIVE 
CFSPI_STATE_SIG_INACTIVE 
CFSPI_STATE_DELIVER_PKT 
CFSPI_STATE_MAX 

Definition at line 82 of file caif_spi.h.

Function Documentation

void cfspi_dbg_state ( struct cfspi cfspi,
int  state 
)
inline

Definition at line 284 of file caif_spi.c.

int cfspi_rxfrm ( struct cfspi cfspi,
u8 buf,
size_t  len 
)

Definition at line 519 of file caif_spi.c.

int cfspi_spi_probe ( struct platform_device pdev)

Definition at line 727 of file caif_spi.c.

int cfspi_spi_remove ( struct platform_device pdev)

Definition at line 764 of file caif_spi.c.

Definition at line 63 of file caif_spi_slave.c.

int cfspi_xmitfrm ( struct cfspi cfspi,
u8 buf,
size_t  len 
)

Definition at line 332 of file caif_spi.c.

int cfspi_xmitlen ( struct cfspi cfspi)

Definition at line 386 of file caif_spi.c.

Variable Documentation

struct platform_driver cfspi_spi_driver

Definition at line 249 of file caif_spi_slave.c.

int spi_down_head_align

Definition at line 45 of file caif_spi_slave.c.

int spi_down_tail_align

Definition at line 46 of file caif_spi_slave.c.

int spi_frm_align

Definition at line 37 of file caif_spi_slave.c.

int spi_up_head_align

Definition at line 43 of file caif_spi_slave.c.

int spi_up_tail_align

Definition at line 44 of file caif_spi_slave.c.