diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 17:37:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 17:37:00 -0400 |
commit | 70ada77920723fbc2b35e9b301022fb1e166b41b (patch) | |
tree | f30f24135eff89020d8ae21d6c7a83cf5c812585 /arch/blackfin | |
parent | b22793f7fdc38d73c4bb4299a313deef56dcfe66 (diff) | |
parent | 2764c500be0c1f057349ee6c81557239de060f87 (diff) |
Merge branch 'next-spi' of git://git.secretlab.ca/git/linux-2.6
* 'next-spi' of git://git.secretlab.ca/git/linux-2.6: (53 commits)
spi/omap2_mcspi: Verify TX reg is empty after TX only xfer with DMA
spi/omap2_mcspi: disable channel after TX_ONLY transfer in PIO mode
spi/bfin_spi: namespace local structs
spi/bfin_spi: init early
spi/bfin_spi: check per-transfer bits_per_word
spi/bfin_spi: warn when CS is driven by hardware (CPHA=0)
spi/bfin_spi: cs should be always low when a new transfer begins
spi/bfin_spi: fix typo in comment
spi/bfin_spi: reject unsupported SPI modes
spi/bfin_spi: use dma_disable_irq_nosync() in irq handler
spi/bfin_spi: combine duplicate SPI_CTL read/write logic
spi/bfin_spi: reset ctl_reg bits when setup is run again on a device
spi/bfin_spi: push all size checks into the transfer function
spi/bfin_spi: use nosync when disabling the IRQ from the IRQ handler
spi/bfin_spi: sync hardware state before reprogramming everything
spi/bfin_spi: save/restore state when suspending/resuming
spi/bfin_spi: redo GPIO CS handling
Blackfin: SPI: expand SPI bitmasks
spi/bfin_spi: use the SPI namespaced bit names
spi/bfin_spi: drop extra memory we don't need
...
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/include/asm/bfin5xx_spi.h | 81 |
1 files changed, 8 insertions, 73 deletions
diff --git a/arch/blackfin/include/asm/bfin5xx_spi.h b/arch/blackfin/include/asm/bfin5xx_spi.h index ed4f8c6db0cd..4223cf08ce83 100644 --- a/arch/blackfin/include/asm/bfin5xx_spi.h +++ b/arch/blackfin/include/asm/bfin5xx_spi.h | |||
@@ -11,26 +11,17 @@ | |||
11 | 11 | ||
12 | #define MIN_SPI_BAUD_VAL 2 | 12 | #define MIN_SPI_BAUD_VAL 2 |
13 | 13 | ||
14 | #define SPI_READ 0 | ||
15 | #define SPI_WRITE 1 | ||
16 | |||
17 | #define SPI_CTRL_OFF 0x0 | ||
18 | #define SPI_FLAG_OFF 0x4 | ||
19 | #define SPI_STAT_OFF 0x8 | ||
20 | #define SPI_TXBUFF_OFF 0xc | ||
21 | #define SPI_RXBUFF_OFF 0x10 | ||
22 | #define SPI_BAUD_OFF 0x14 | ||
23 | #define SPI_SHAW_OFF 0x18 | ||
24 | |||
25 | |||
26 | #define BIT_CTL_ENABLE 0x4000 | 14 | #define BIT_CTL_ENABLE 0x4000 |
27 | #define BIT_CTL_OPENDRAIN 0x2000 | 15 | #define BIT_CTL_OPENDRAIN 0x2000 |
28 | #define BIT_CTL_MASTER 0x1000 | 16 | #define BIT_CTL_MASTER 0x1000 |
29 | #define BIT_CTL_POLAR 0x0800 | 17 | #define BIT_CTL_CPOL 0x0800 |
30 | #define BIT_CTL_PHASE 0x0400 | 18 | #define BIT_CTL_CPHA 0x0400 |
31 | #define BIT_CTL_BITORDER 0x0200 | 19 | #define BIT_CTL_LSBF 0x0200 |
32 | #define BIT_CTL_WORDSIZE 0x0100 | 20 | #define BIT_CTL_WORDSIZE 0x0100 |
33 | #define BIT_CTL_MISOENABLE 0x0020 | 21 | #define BIT_CTL_EMISO 0x0020 |
22 | #define BIT_CTL_PSSE 0x0010 | ||
23 | #define BIT_CTL_GM 0x0008 | ||
24 | #define BIT_CTL_SZ 0x0004 | ||
34 | #define BIT_CTL_RXMOD 0x0000 | 25 | #define BIT_CTL_RXMOD 0x0000 |
35 | #define BIT_CTL_TXMOD 0x0001 | 26 | #define BIT_CTL_TXMOD 0x0001 |
36 | #define BIT_CTL_TIMOD_DMA_TX 0x0003 | 27 | #define BIT_CTL_TIMOD_DMA_TX 0x0003 |
@@ -50,61 +41,7 @@ | |||
50 | #define BIT_STU_SENDOVER 0x0001 | 41 | #define BIT_STU_SENDOVER 0x0001 |
51 | #define BIT_STU_RECVFULL 0x0020 | 42 | #define BIT_STU_RECVFULL 0x0020 |
52 | 43 | ||
53 | #define CFG_SPI_ENABLE 1 | 44 | #define MAX_CTRL_CS 8 /* cs in spi controller */ |
54 | #define CFG_SPI_DISABLE 0 | ||
55 | |||
56 | #define CFG_SPI_OUTENABLE 1 | ||
57 | #define CFG_SPI_OUTDISABLE 0 | ||
58 | |||
59 | #define CFG_SPI_ACTLOW 1 | ||
60 | #define CFG_SPI_ACTHIGH 0 | ||
61 | |||
62 | #define CFG_SPI_PHASESTART 1 | ||
63 | #define CFG_SPI_PHASEMID 0 | ||
64 | |||
65 | #define CFG_SPI_MASTER 1 | ||
66 | #define CFG_SPI_SLAVE 0 | ||
67 | |||
68 | #define CFG_SPI_SENELAST 0 | ||
69 | #define CFG_SPI_SENDZERO 1 | ||
70 | |||
71 | #define CFG_SPI_RCVFLUSH 1 | ||
72 | #define CFG_SPI_RCVDISCARD 0 | ||
73 | |||
74 | #define CFG_SPI_LSBFIRST 1 | ||
75 | #define CFG_SPI_MSBFIRST 0 | ||
76 | |||
77 | #define CFG_SPI_WORDSIZE16 1 | ||
78 | #define CFG_SPI_WORDSIZE8 0 | ||
79 | |||
80 | #define CFG_SPI_MISOENABLE 1 | ||
81 | #define CFG_SPI_MISODISABLE 0 | ||
82 | |||
83 | #define CFG_SPI_READ 0x00 | ||
84 | #define CFG_SPI_WRITE 0x01 | ||
85 | #define CFG_SPI_DMAREAD 0x02 | ||
86 | #define CFG_SPI_DMAWRITE 0x03 | ||
87 | |||
88 | #define CFG_SPI_CSCLEARALL 0 | ||
89 | #define CFG_SPI_CHIPSEL1 1 | ||
90 | #define CFG_SPI_CHIPSEL2 2 | ||
91 | #define CFG_SPI_CHIPSEL3 3 | ||
92 | #define CFG_SPI_CHIPSEL4 4 | ||
93 | #define CFG_SPI_CHIPSEL5 5 | ||
94 | #define CFG_SPI_CHIPSEL6 6 | ||
95 | #define CFG_SPI_CHIPSEL7 7 | ||
96 | |||
97 | #define CFG_SPI_CS1VALUE 1 | ||
98 | #define CFG_SPI_CS2VALUE 2 | ||
99 | #define CFG_SPI_CS3VALUE 3 | ||
100 | #define CFG_SPI_CS4VALUE 4 | ||
101 | #define CFG_SPI_CS5VALUE 5 | ||
102 | #define CFG_SPI_CS6VALUE 6 | ||
103 | #define CFG_SPI_CS7VALUE 7 | ||
104 | |||
105 | #define CMD_SPI_SET_BAUDRATE 2 | ||
106 | #define CMD_SPI_GET_SYSTEMCLOCK 25 | ||
107 | #define CMD_SPI_SET_WRITECONTINUOUS 26 | ||
108 | 45 | ||
109 | /* device.platform_data for SSP controller devices */ | 46 | /* device.platform_data for SSP controller devices */ |
110 | struct bfin5xx_spi_master { | 47 | struct bfin5xx_spi_master { |
@@ -120,9 +57,7 @@ struct bfin5xx_spi_chip { | |||
120 | u16 ctl_reg; | 57 | u16 ctl_reg; |
121 | u8 enable_dma; | 58 | u8 enable_dma; |
122 | u8 bits_per_word; | 59 | u8 bits_per_word; |
123 | u8 cs_change_per_word; | ||
124 | u16 cs_chg_udelay; /* Some devices require 16-bit delays */ | 60 | u16 cs_chg_udelay; /* Some devices require 16-bit delays */ |
125 | u32 cs_gpio; | ||
126 | /* Value to send if no TX value is supplied, usually 0x0 or 0xFFFF */ | 61 | /* Value to send if no TX value is supplied, usually 0x0 or 0xFFFF */ |
127 | u16 idle_tx_val; | 62 | u16 idle_tx_val; |
128 | u8 pio_interrupt; /* Enable spi data irq */ | 63 | u8 pio_interrupt; /* Enable spi data irq */ |