Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
caif_spi.c File Reference
#include <linux/init.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/string.h>
#include <linux/workqueue.h>
#include <linux/completion.h>
#include <linux/list.h>
#include <linux/interrupt.h>
#include <linux/dma-mapping.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/debugfs.h>
#include <linux/if_arp.h>
#include <net/caif/caif_layer.h>
#include <net/caif/caif_spi.h>

Go to the source code of this file.

Macros

#define FLAVOR   "Flavour: Vanilla.\n"
 
#define PAD_POW2(x, pow)   ((((x)&((pow)-1))==0) ? 0 : (((pow)-((x)&((pow)-1)))))
 
#define BYTE_HEX_FMT   "%02hhX"
 
#define SPI_MAX_PAYLOAD_SIZE   4096
 
#define LOW_WATER_MARK   100
 
#define HIGH_WATER_MARK   (LOW_WATER_MARK*5)
 

Functions

 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("Daniel Martensson<[email protected]>")
 
 MODULE_DESCRIPTION ("CAIF SPI driver")
 
 module_param (spi_loop, bool, S_IRUGO)
 
 MODULE_PARM_DESC (spi_loop,"SPI running in loopback mode.")
 
 module_param (spi_frm_align, int, S_IRUGO)
 
 MODULE_PARM_DESC (spi_frm_align,"SPI frame alignment.")
 
 module_param (spi_up_head_align, int, S_IRUGO)
 
 MODULE_PARM_DESC (spi_up_head_align,"SPI uplink head alignment.")
 
 module_param (spi_up_tail_align, int, S_IRUGO)
 
 MODULE_PARM_DESC (spi_up_tail_align,"SPI uplink tail alignment.")
 
 module_param (spi_down_head_align, int, S_IRUGO)
 
 MODULE_PARM_DESC (spi_down_head_align,"SPI downlink head alignment.")
 
 module_param (spi_down_tail_align, int, S_IRUGO)
 
 MODULE_PARM_DESC (spi_down_tail_align,"SPI downlink tail alignment.")
 
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_probe (struct platform_device *pdev)
 
int cfspi_spi_remove (struct platform_device *pdev)
 
 module_init (cfspi_init_module)
 
 module_exit (cfspi_exit_module)
 

Macro Definition Documentation

#define BYTE_HEX_FMT   "%02hhX"

Definition at line 65 of file caif_spi.c.

#define FLAVOR   "Flavour: Vanilla.\n"

Definition at line 26 of file caif_spi.c.

#define HIGH_WATER_MARK   (LOW_WATER_MARK*5)

Definition at line 75 of file caif_spi.c.

#define LOW_WATER_MARK   100

Definition at line 74 of file caif_spi.c.

#define PAD_POW2 (   x,
  pow 
)    ((((x)&((pow)-1))==0) ? 0 : (((pow)-((x)&((pow)-1)))))

Definition at line 36 of file caif_spi.c.

#define SPI_MAX_PAYLOAD_SIZE   4096

Definition at line 68 of file caif_spi.c.

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.

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.

MODULE_AUTHOR ( "Daniel Martensson<[email protected]>"  )
MODULE_DESCRIPTION ( "CAIF SPI driver )
module_exit ( cfspi_exit_module  )
module_init ( cfspi_init_module  )
MODULE_LICENSE ( "GPL"  )
module_param ( spi_loop  ,
bool  ,
S_IRUGO   
)
module_param ( spi_frm_align  ,
int  ,
S_IRUGO   
)
module_param ( spi_up_head_align  ,
int  ,
S_IRUGO   
)
module_param ( spi_up_tail_align  ,
int  ,
S_IRUGO   
)
module_param ( spi_down_head_align  ,
int  ,
S_IRUGO   
)
module_param ( spi_down_tail_align  ,
int  ,
S_IRUGO   
)
MODULE_PARM_DESC ( spi_loop  ,
"SPI running in loopback mode."   
)
MODULE_PARM_DESC ( spi_frm_align  ,
"SPI frame alignment."   
)
MODULE_PARM_DESC ( spi_up_head_align  ,
"SPI uplink head alignment."   
)
MODULE_PARM_DESC ( spi_up_tail_align  ,
"SPI uplink tail alignment."   
)
MODULE_PARM_DESC ( spi_down_head_align  ,
"SPI downlink head alignment."   
)
MODULE_PARM_DESC ( spi_down_tail_align  ,
"SPI downlink tail alignment."   
)