Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
spi-xilinx.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
#include <linux/spi/spi_bitbang.h>
#include <linux/spi/xilinx_spi.h>
#include <linux/io.h>

Go to the source code of this file.

Data Structures

struct  xilinx_spi
 

Macros

#define XILINX_SPI_NAME   "xilinx_spi"
 
#define XSPI_CR_OFFSET   0x60 /* Control Register */
 
#define XSPI_CR_ENABLE   0x02
 
#define XSPI_CR_MASTER_MODE   0x04
 
#define XSPI_CR_CPOL   0x08
 
#define XSPI_CR_CPHA   0x10
 
#define XSPI_CR_MODE_MASK   (XSPI_CR_CPHA | XSPI_CR_CPOL)
 
#define XSPI_CR_TXFIFO_RESET   0x20
 
#define XSPI_CR_RXFIFO_RESET   0x40
 
#define XSPI_CR_MANUAL_SSELECT   0x80
 
#define XSPI_CR_TRANS_INHIBIT   0x100
 
#define XSPI_CR_LSB_FIRST   0x200
 
#define XSPI_SR_OFFSET   0x64 /* Status Register */
 
#define XSPI_SR_RX_EMPTY_MASK   0x01 /* Receive FIFO is empty */
 
#define XSPI_SR_RX_FULL_MASK   0x02 /* Receive FIFO is full */
 
#define XSPI_SR_TX_EMPTY_MASK   0x04 /* Transmit FIFO is empty */
 
#define XSPI_SR_TX_FULL_MASK   0x08 /* Transmit FIFO is full */
 
#define XSPI_SR_MODE_FAULT_MASK   0x10 /* Mode fault error */
 
#define XSPI_TXD_OFFSET   0x68 /* Data Transmit Register */
 
#define XSPI_RXD_OFFSET   0x6c /* Data Receive Register */
 
#define XSPI_SSR_OFFSET   0x70 /* 32-bit Slave Select Register */
 
#define XIPIF_V123B_DGIER_OFFSET   0x1c /* IPIF global int enable reg */
 
#define XIPIF_V123B_GINTR_ENABLE   0x80000000
 
#define XIPIF_V123B_IISR_OFFSET   0x20 /* IPIF interrupt status reg */
 
#define XIPIF_V123B_IIER_OFFSET   0x28 /* IPIF interrupt enable reg */
 
#define XSPI_INTR_MODE_FAULT   0x01 /* Mode fault error */
 
#define XSPI_INTR_SLAVE_MODE_FAULT
 
#define XSPI_INTR_TX_EMPTY   0x04 /* TxFIFO is empty */
 
#define XSPI_INTR_TX_UNDERRUN   0x08 /* TxFIFO was underrun */
 
#define XSPI_INTR_RX_FULL   0x10 /* RxFIFO is full */
 
#define XSPI_INTR_RX_OVERRUN   0x20 /* RxFIFO was overrun */
 
#define XSPI_INTR_TX_HALF_EMPTY   0x40 /* TxFIFO is half empty */
 
#define XIPIF_V123B_RESETR_OFFSET   0x40 /* IPIF reset register */
 
#define XIPIF_V123B_RESET_MASK   0x0a /* the value to write */
 

Functions

 MODULE_DEVICE_TABLE (of, xilinx_spi_of_match)
 
struct spi_masterxilinx_spi_init (struct device *dev, struct resource *mem, u32 irq, s16 bus_num, int num_cs, int little_endian, int bits_per_word)
 
 EXPORT_SYMBOL (xilinx_spi_init)
 
void xilinx_spi_deinit (struct spi_master *master)
 
 EXPORT_SYMBOL (xilinx_spi_deinit)
 
 MODULE_ALIAS ("platform:"XILINX_SPI_NAME)
 
 module_platform_driver (xilinx_spi_driver)
 
 MODULE_AUTHOR ("MontaVista Software, Inc. <source@mvista.com>")
 
 MODULE_DESCRIPTION ("Xilinx SPI driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define XILINX_SPI_NAME   "xilinx_spi"

Definition at line 26 of file spi-xilinx.c.

#define XIPIF_V123B_DGIER_OFFSET   0x1c /* IPIF global int enable reg */

Definition at line 60 of file spi-xilinx.c.

#define XIPIF_V123B_GINTR_ENABLE   0x80000000

Definition at line 61 of file spi-xilinx.c.

#define XIPIF_V123B_IIER_OFFSET   0x28 /* IPIF interrupt enable reg */

Definition at line 64 of file spi-xilinx.c.

#define XIPIF_V123B_IISR_OFFSET   0x20 /* IPIF interrupt status reg */

Definition at line 63 of file spi-xilinx.c.

#define XIPIF_V123B_RESET_MASK   0x0a /* the value to write */

Definition at line 75 of file spi-xilinx.c.

#define XIPIF_V123B_RESETR_OFFSET   0x40 /* IPIF reset register */

Definition at line 74 of file spi-xilinx.c.

#define XSPI_CR_CPHA   0x10

Definition at line 36 of file spi-xilinx.c.

#define XSPI_CR_CPOL   0x08

Definition at line 35 of file spi-xilinx.c.

#define XSPI_CR_ENABLE   0x02

Definition at line 33 of file spi-xilinx.c.

#define XSPI_CR_LSB_FIRST   0x200

Definition at line 42 of file spi-xilinx.c.

#define XSPI_CR_MANUAL_SSELECT   0x80

Definition at line 40 of file spi-xilinx.c.

#define XSPI_CR_MASTER_MODE   0x04

Definition at line 34 of file spi-xilinx.c.

#define XSPI_CR_MODE_MASK   (XSPI_CR_CPHA | XSPI_CR_CPOL)

Definition at line 37 of file spi-xilinx.c.

#define XSPI_CR_OFFSET   0x60 /* Control Register */

Definition at line 31 of file spi-xilinx.c.

#define XSPI_CR_RXFIFO_RESET   0x40

Definition at line 39 of file spi-xilinx.c.

#define XSPI_CR_TRANS_INHIBIT   0x100

Definition at line 41 of file spi-xilinx.c.

#define XSPI_CR_TXFIFO_RESET   0x20

Definition at line 38 of file spi-xilinx.c.

#define XSPI_INTR_MODE_FAULT   0x01 /* Mode fault error */

Definition at line 66 of file spi-xilinx.c.

#define XSPI_INTR_RX_FULL   0x10 /* RxFIFO is full */

Definition at line 70 of file spi-xilinx.c.

#define XSPI_INTR_RX_OVERRUN   0x20 /* RxFIFO was overrun */

Definition at line 71 of file spi-xilinx.c.

#define XSPI_INTR_SLAVE_MODE_FAULT
Value:
0x02 /* Selected as slave while
* disabled */

Definition at line 67 of file spi-xilinx.c.

#define XSPI_INTR_TX_EMPTY   0x04 /* TxFIFO is empty */

Definition at line 68 of file spi-xilinx.c.

#define XSPI_INTR_TX_HALF_EMPTY   0x40 /* TxFIFO is half empty */

Definition at line 72 of file spi-xilinx.c.

#define XSPI_INTR_TX_UNDERRUN   0x08 /* TxFIFO was underrun */

Definition at line 69 of file spi-xilinx.c.

#define XSPI_RXD_OFFSET   0x6c /* Data Receive Register */

Definition at line 53 of file spi-xilinx.c.

#define XSPI_SR_MODE_FAULT_MASK   0x10 /* Mode fault error */

Definition at line 50 of file spi-xilinx.c.

#define XSPI_SR_OFFSET   0x64 /* Status Register */

Definition at line 44 of file spi-xilinx.c.

#define XSPI_SR_RX_EMPTY_MASK   0x01 /* Receive FIFO is empty */

Definition at line 46 of file spi-xilinx.c.

#define XSPI_SR_RX_FULL_MASK   0x02 /* Receive FIFO is full */

Definition at line 47 of file spi-xilinx.c.

#define XSPI_SR_TX_EMPTY_MASK   0x04 /* Transmit FIFO is empty */

Definition at line 48 of file spi-xilinx.c.

#define XSPI_SR_TX_FULL_MASK   0x08 /* Transmit FIFO is full */

Definition at line 49 of file spi-xilinx.c.

#define XSPI_SSR_OFFSET   0x70 /* 32-bit Slave Select Register */

Definition at line 55 of file spi-xilinx.c.

#define XSPI_TXD_OFFSET   0x68 /* Data Transmit Register */

Definition at line 52 of file spi-xilinx.c.

Function Documentation

EXPORT_SYMBOL ( xilinx_spi_init  )
EXPORT_SYMBOL ( xilinx_spi_deinit  )
MODULE_ALIAS ( "platform:"  XILINX_SPI_NAME)
MODULE_AUTHOR ( "MontaVista  Software,
Inc.< source @mvista.com >"   
)
MODULE_DESCRIPTION ( "Xilinx SPI driver )
MODULE_DEVICE_TABLE ( of  ,
xilinx_spi_of_match   
)
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( xilinx_spi_driver  )
void xilinx_spi_deinit ( struct spi_master master)

Definition at line 449 of file spi-xilinx.c.

struct spi_master* xilinx_spi_init ( struct device dev,
struct resource mem,
u32  irq,
s16  bus_num,
int  num_cs,
int  little_endian,
int  bits_per_word 
)
read

Definition at line 360 of file spi-xilinx.c.