diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /include/linux/spi | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'include/linux/spi')
-rw-r--r-- | include/linux/spi/74x164.h | 11 | ||||
-rw-r--r-- | include/linux/spi/ads7846.h | 3 | ||||
-rw-r--r-- | include/linux/spi/dw_spi.h | 219 | ||||
-rw-r--r-- | include/linux/spi/ifx_modem.h | 19 | ||||
-rw-r--r-- | include/linux/spi/mcp23s08.h | 15 | ||||
-rw-r--r-- | include/linux/spi/pxa2xx_spi.h | 152 | ||||
-rw-r--r-- | include/linux/spi/spi.h | 11 | ||||
-rw-r--r-- | include/linux/spi/spi_oc_tiny.h | 20 | ||||
-rw-r--r-- | include/linux/spi/spidev.h | 2 | ||||
-rw-r--r-- | include/linux/spi/tsc2005.h | 41 | ||||
-rw-r--r-- | include/linux/spi/wl12xx.h | 34 |
11 files changed, 262 insertions, 265 deletions
diff --git a/include/linux/spi/74x164.h b/include/linux/spi/74x164.h new file mode 100644 index 000000000000..d85c52f294a0 --- /dev/null +++ b/include/linux/spi/74x164.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef LINUX_SPI_74X164_H | ||
2 | #define LINUX_SPI_74X164_H | ||
3 | |||
4 | #define GEN_74X164_DRIVER_NAME "74x164" | ||
5 | |||
6 | struct gen_74x164_chip_platform_data { | ||
7 | /* number assigned to the first GPIO */ | ||
8 | unsigned base; | ||
9 | }; | ||
10 | |||
11 | #endif | ||
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index 92bd0839d5b4..c64de9dd7631 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h | |||
@@ -14,7 +14,8 @@ enum ads7846_filter { | |||
14 | struct ads7846_platform_data { | 14 | struct ads7846_platform_data { |
15 | u16 model; /* 7843, 7845, 7846, 7873. */ | 15 | u16 model; /* 7843, 7845, 7846, 7873. */ |
16 | u16 vref_delay_usecs; /* 0 for external vref; etc */ | 16 | u16 vref_delay_usecs; /* 0 for external vref; etc */ |
17 | u16 vref_mv; /* external vref value, milliVolts */ | 17 | u16 vref_mv; /* external vref value, milliVolts |
18 | * ads7846: if 0, use internal vref */ | ||
18 | bool keep_vref_on; /* set to keep vref on for differential | 19 | bool keep_vref_on; /* set to keep vref on for differential |
19 | * measurements as well */ | 20 | * measurements as well */ |
20 | bool swap_xy; /* swap x and y axes */ | 21 | bool swap_xy; /* swap x and y axes */ |
diff --git a/include/linux/spi/dw_spi.h b/include/linux/spi/dw_spi.h deleted file mode 100644 index c91302f3a257..000000000000 --- a/include/linux/spi/dw_spi.h +++ /dev/null | |||
@@ -1,219 +0,0 @@ | |||
1 | #ifndef DW_SPI_HEADER_H | ||
2 | #define DW_SPI_HEADER_H | ||
3 | #include <linux/io.h> | ||
4 | |||
5 | /* Bit fields in CTRLR0 */ | ||
6 | #define SPI_DFS_OFFSET 0 | ||
7 | |||
8 | #define SPI_FRF_OFFSET 4 | ||
9 | #define SPI_FRF_SPI 0x0 | ||
10 | #define SPI_FRF_SSP 0x1 | ||
11 | #define SPI_FRF_MICROWIRE 0x2 | ||
12 | #define SPI_FRF_RESV 0x3 | ||
13 | |||
14 | #define SPI_MODE_OFFSET 6 | ||
15 | #define SPI_SCPH_OFFSET 6 | ||
16 | #define SPI_SCOL_OFFSET 7 | ||
17 | |||
18 | #define SPI_TMOD_OFFSET 8 | ||
19 | #define SPI_TMOD_MASK (0x3 << SPI_TMOD_OFFSET) | ||
20 | #define SPI_TMOD_TR 0x0 /* xmit & recv */ | ||
21 | #define SPI_TMOD_TO 0x1 /* xmit only */ | ||
22 | #define SPI_TMOD_RO 0x2 /* recv only */ | ||
23 | #define SPI_TMOD_EPROMREAD 0x3 /* eeprom read mode */ | ||
24 | |||
25 | #define SPI_SLVOE_OFFSET 10 | ||
26 | #define SPI_SRL_OFFSET 11 | ||
27 | #define SPI_CFS_OFFSET 12 | ||
28 | |||
29 | /* Bit fields in SR, 7 bits */ | ||
30 | #define SR_MASK 0x7f /* cover 7 bits */ | ||
31 | #define SR_BUSY (1 << 0) | ||
32 | #define SR_TF_NOT_FULL (1 << 1) | ||
33 | #define SR_TF_EMPT (1 << 2) | ||
34 | #define SR_RF_NOT_EMPT (1 << 3) | ||
35 | #define SR_RF_FULL (1 << 4) | ||
36 | #define SR_TX_ERR (1 << 5) | ||
37 | #define SR_DCOL (1 << 6) | ||
38 | |||
39 | /* Bit fields in ISR, IMR, RISR, 7 bits */ | ||
40 | #define SPI_INT_TXEI (1 << 0) | ||
41 | #define SPI_INT_TXOI (1 << 1) | ||
42 | #define SPI_INT_RXUI (1 << 2) | ||
43 | #define SPI_INT_RXOI (1 << 3) | ||
44 | #define SPI_INT_RXFI (1 << 4) | ||
45 | #define SPI_INT_MSTI (1 << 5) | ||
46 | |||
47 | /* TX RX interrupt level threshhold, max can be 256 */ | ||
48 | #define SPI_INT_THRESHOLD 32 | ||
49 | |||
50 | enum dw_ssi_type { | ||
51 | SSI_MOTO_SPI = 0, | ||
52 | SSI_TI_SSP, | ||
53 | SSI_NS_MICROWIRE, | ||
54 | }; | ||
55 | |||
56 | struct dw_spi_reg { | ||
57 | u32 ctrl0; | ||
58 | u32 ctrl1; | ||
59 | u32 ssienr; | ||
60 | u32 mwcr; | ||
61 | u32 ser; | ||
62 | u32 baudr; | ||
63 | u32 txfltr; | ||
64 | u32 rxfltr; | ||
65 | u32 txflr; | ||
66 | u32 rxflr; | ||
67 | u32 sr; | ||
68 | u32 imr; | ||
69 | u32 isr; | ||
70 | u32 risr; | ||
71 | u32 txoicr; | ||
72 | u32 rxoicr; | ||
73 | u32 rxuicr; | ||
74 | u32 msticr; | ||
75 | u32 icr; | ||
76 | u32 dmacr; | ||
77 | u32 dmatdlr; | ||
78 | u32 dmardlr; | ||
79 | u32 idr; | ||
80 | u32 version; | ||
81 | u32 dr; /* Currently oper as 32 bits, | ||
82 | though only low 16 bits matters */ | ||
83 | } __packed; | ||
84 | |||
85 | struct dw_spi { | ||
86 | struct spi_master *master; | ||
87 | struct spi_device *cur_dev; | ||
88 | struct device *parent_dev; | ||
89 | enum dw_ssi_type type; | ||
90 | |||
91 | void __iomem *regs; | ||
92 | unsigned long paddr; | ||
93 | u32 iolen; | ||
94 | int irq; | ||
95 | u32 fifo_len; /* depth of the FIFO buffer */ | ||
96 | u32 max_freq; /* max bus freq supported */ | ||
97 | |||
98 | u16 bus_num; | ||
99 | u16 num_cs; /* supported slave numbers */ | ||
100 | |||
101 | /* Driver message queue */ | ||
102 | struct workqueue_struct *workqueue; | ||
103 | struct work_struct pump_messages; | ||
104 | spinlock_t lock; | ||
105 | struct list_head queue; | ||
106 | int busy; | ||
107 | int run; | ||
108 | |||
109 | /* Message Transfer pump */ | ||
110 | struct tasklet_struct pump_transfers; | ||
111 | |||
112 | /* Current message transfer state info */ | ||
113 | struct spi_message *cur_msg; | ||
114 | struct spi_transfer *cur_transfer; | ||
115 | struct chip_data *cur_chip; | ||
116 | struct chip_data *prev_chip; | ||
117 | size_t len; | ||
118 | void *tx; | ||
119 | void *tx_end; | ||
120 | void *rx; | ||
121 | void *rx_end; | ||
122 | int dma_mapped; | ||
123 | dma_addr_t rx_dma; | ||
124 | dma_addr_t tx_dma; | ||
125 | size_t rx_map_len; | ||
126 | size_t tx_map_len; | ||
127 | u8 n_bytes; /* current is a 1/2 bytes op */ | ||
128 | u8 max_bits_per_word; /* maxim is 16b */ | ||
129 | u32 dma_width; | ||
130 | int cs_change; | ||
131 | int (*write)(struct dw_spi *dws); | ||
132 | int (*read)(struct dw_spi *dws); | ||
133 | irqreturn_t (*transfer_handler)(struct dw_spi *dws); | ||
134 | void (*cs_control)(u32 command); | ||
135 | |||
136 | /* Dma info */ | ||
137 | int dma_inited; | ||
138 | struct dma_chan *txchan; | ||
139 | struct dma_chan *rxchan; | ||
140 | int txdma_done; | ||
141 | int rxdma_done; | ||
142 | u64 tx_param; | ||
143 | u64 rx_param; | ||
144 | struct device *dma_dev; | ||
145 | dma_addr_t dma_addr; | ||
146 | |||
147 | /* Bus interface info */ | ||
148 | void *priv; | ||
149 | #ifdef CONFIG_DEBUG_FS | ||
150 | struct dentry *debugfs; | ||
151 | #endif | ||
152 | }; | ||
153 | |||
154 | #define dw_readl(dw, name) \ | ||
155 | __raw_readl(&(((struct dw_spi_reg *)dw->regs)->name)) | ||
156 | #define dw_writel(dw, name, val) \ | ||
157 | __raw_writel((val), &(((struct dw_spi_reg *)dw->regs)->name)) | ||
158 | #define dw_readw(dw, name) \ | ||
159 | __raw_readw(&(((struct dw_spi_reg *)dw->regs)->name)) | ||
160 | #define dw_writew(dw, name, val) \ | ||
161 | __raw_writew((val), &(((struct dw_spi_reg *)dw->regs)->name)) | ||
162 | |||
163 | static inline void spi_enable_chip(struct dw_spi *dws, int enable) | ||
164 | { | ||
165 | dw_writel(dws, ssienr, (enable ? 1 : 0)); | ||
166 | } | ||
167 | |||
168 | static inline void spi_set_clk(struct dw_spi *dws, u16 div) | ||
169 | { | ||
170 | dw_writel(dws, baudr, div); | ||
171 | } | ||
172 | |||
173 | static inline void spi_chip_sel(struct dw_spi *dws, u16 cs) | ||
174 | { | ||
175 | if (cs > dws->num_cs) | ||
176 | return; | ||
177 | |||
178 | if (dws->cs_control) | ||
179 | dws->cs_control(1); | ||
180 | |||
181 | dw_writel(dws, ser, 1 << cs); | ||
182 | } | ||
183 | |||
184 | /* Disable IRQ bits */ | ||
185 | static inline void spi_mask_intr(struct dw_spi *dws, u32 mask) | ||
186 | { | ||
187 | u32 new_mask; | ||
188 | |||
189 | new_mask = dw_readl(dws, imr) & ~mask; | ||
190 | dw_writel(dws, imr, new_mask); | ||
191 | } | ||
192 | |||
193 | /* Enable IRQ bits */ | ||
194 | static inline void spi_umask_intr(struct dw_spi *dws, u32 mask) | ||
195 | { | ||
196 | u32 new_mask; | ||
197 | |||
198 | new_mask = dw_readl(dws, imr) | mask; | ||
199 | dw_writel(dws, imr, new_mask); | ||
200 | } | ||
201 | |||
202 | /* | ||
203 | * Each SPI slave device to work with dw_api controller should | ||
204 | * has such a structure claiming its working mode (PIO/DMA etc), | ||
205 | * which can be save in the "controller_data" member of the | ||
206 | * struct spi_device | ||
207 | */ | ||
208 | struct dw_spi_chip { | ||
209 | u8 poll_mode; /* 0 for contoller polling mode */ | ||
210 | u8 type; /* SPI/SSP/Micrwire */ | ||
211 | u8 enable_dma; | ||
212 | void (*cs_control)(u32 command); | ||
213 | }; | ||
214 | |||
215 | extern int dw_spi_add_host(struct dw_spi *dws); | ||
216 | extern void dw_spi_remove_host(struct dw_spi *dws); | ||
217 | extern int dw_spi_suspend_host(struct dw_spi *dws); | ||
218 | extern int dw_spi_resume_host(struct dw_spi *dws); | ||
219 | #endif /* DW_SPI_HEADER_H */ | ||
diff --git a/include/linux/spi/ifx_modem.h b/include/linux/spi/ifx_modem.h new file mode 100644 index 000000000000..394fec9e7722 --- /dev/null +++ b/include/linux/spi/ifx_modem.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef LINUX_IFX_MODEM_H | ||
2 | #define LINUX_IFX_MODEM_H | ||
3 | |||
4 | struct ifx_modem_platform_data { | ||
5 | unsigned short rst_out; /* modem reset out */ | ||
6 | unsigned short pwr_on; /* power on */ | ||
7 | unsigned short rst_pmu; /* reset modem */ | ||
8 | unsigned short tx_pwr; /* modem power threshold */ | ||
9 | unsigned short srdy; /* SRDY */ | ||
10 | unsigned short mrdy; /* MRDY */ | ||
11 | unsigned char modem_type; /* Modem type */ | ||
12 | unsigned long max_hz; /* max SPI frequency */ | ||
13 | unsigned short use_dma:1; /* spi protocol driver supplies | ||
14 | dma-able addrs */ | ||
15 | }; | ||
16 | #define IFX_MODEM_6160 1 | ||
17 | #define IFX_MODEM_6260 2 | ||
18 | |||
19 | #endif | ||
diff --git a/include/linux/spi/mcp23s08.h b/include/linux/spi/mcp23s08.h index 22ef107d7704..c42cff8ca191 100644 --- a/include/linux/spi/mcp23s08.h +++ b/include/linux/spi/mcp23s08.h | |||
@@ -2,21 +2,24 @@ | |||
2 | /* FIXME driver should be able to handle IRQs... */ | 2 | /* FIXME driver should be able to handle IRQs... */ |
3 | 3 | ||
4 | struct mcp23s08_chip_info { | 4 | struct mcp23s08_chip_info { |
5 | bool is_present; /* true iff populated */ | 5 | bool is_present; /* true if populated */ |
6 | u8 pullups; /* BIT(x) means enable pullup x */ | 6 | unsigned pullups; /* BIT(x) means enable pullup x */ |
7 | }; | 7 | }; |
8 | 8 | ||
9 | struct mcp23s08_platform_data { | 9 | struct mcp23s08_platform_data { |
10 | /* Four slaves (numbered 0..3) can share one SPI chipselect, and | 10 | /* For mcp23s08, up to 4 slaves (numbered 0..3) can share one SPI |
11 | * will provide 8..32 GPIOs using 1..4 gpio_chip instances. | 11 | * chipselect, each providing 1 gpio_chip instance with 8 gpios. |
12 | * For mpc23s17, up to 8 slaves (numbered 0..7) can share one SPI | ||
13 | * chipselect, each providing 1 gpio_chip (port A + port B) with | ||
14 | * 16 gpios. | ||
12 | */ | 15 | */ |
13 | struct mcp23s08_chip_info chip[4]; | 16 | struct mcp23s08_chip_info chip[8]; |
14 | 17 | ||
15 | /* "base" is the number of the first GPIO. Dynamic assignment is | 18 | /* "base" is the number of the first GPIO. Dynamic assignment is |
16 | * not currently supported, and even if there are gaps in chip | 19 | * not currently supported, and even if there are gaps in chip |
17 | * addressing the GPIO numbers are sequential .. so for example | 20 | * addressing the GPIO numbers are sequential .. so for example |
18 | * if only slaves 0 and 3 are present, their GPIOs range from | 21 | * if only slaves 0 and 3 are present, their GPIOs range from |
19 | * base to base+15. | 22 | * base to base+15 (or base+31 for s17 variant). |
20 | */ | 23 | */ |
21 | unsigned base; | 24 | unsigned base; |
22 | 25 | ||
diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h new file mode 100644 index 000000000000..d3e1075f7b60 --- /dev/null +++ b/include/linux/spi/pxa2xx_spi.h | |||
@@ -0,0 +1,152 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
17 | */ | ||
18 | #ifndef __linux_pxa2xx_spi_h | ||
19 | #define __linux_pxa2xx_spi_h | ||
20 | |||
21 | #include <linux/pxa2xx_ssp.h> | ||
22 | |||
23 | #define PXA2XX_CS_ASSERT (0x01) | ||
24 | #define PXA2XX_CS_DEASSERT (0x02) | ||
25 | |||
26 | /* device.platform_data for SSP controller devices */ | ||
27 | struct pxa2xx_spi_master { | ||
28 | u32 clock_enable; | ||
29 | u16 num_chipselect; | ||
30 | u8 enable_dma; | ||
31 | }; | ||
32 | |||
33 | /* spi_board_info.controller_data for SPI slave devices, | ||
34 | * copied to spi_device.platform_data ... mostly for dma tuning | ||
35 | */ | ||
36 | struct pxa2xx_spi_chip { | ||
37 | u8 tx_threshold; | ||
38 | u8 rx_threshold; | ||
39 | u8 dma_burst_size; | ||
40 | u32 timeout; | ||
41 | u8 enable_loopback; | ||
42 | int gpio_cs; | ||
43 | void (*cs_control)(u32 command); | ||
44 | }; | ||
45 | |||
46 | #ifdef CONFIG_ARCH_PXA | ||
47 | |||
48 | #include <linux/clk.h> | ||
49 | #include <mach/dma.h> | ||
50 | |||
51 | extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info); | ||
52 | |||
53 | #else | ||
54 | /* | ||
55 | * This is the implemtation for CE4100 on x86. ARM defines them in mach/ or | ||
56 | * plat/ include path. | ||
57 | * The CE4100 does not provide DMA support. This bits are here to let the driver | ||
58 | * compile and will never be used. Maybe we get DMA support at a later point in | ||
59 | * time. | ||
60 | */ | ||
61 | |||
62 | #define DCSR(n) (n) | ||
63 | #define DSADR(n) (n) | ||
64 | #define DTADR(n) (n) | ||
65 | #define DCMD(n) (n) | ||
66 | #define DRCMR(n) (n) | ||
67 | |||
68 | #define DCSR_RUN (1 << 31) /* Run Bit */ | ||
69 | #define DCSR_NODESC (1 << 30) /* No-Descriptor Fetch */ | ||
70 | #define DCSR_STOPIRQEN (1 << 29) /* Stop Interrupt Enable */ | ||
71 | #define DCSR_REQPEND (1 << 8) /* Request Pending (read-only) */ | ||
72 | #define DCSR_STOPSTATE (1 << 3) /* Stop State (read-only) */ | ||
73 | #define DCSR_ENDINTR (1 << 2) /* End Interrupt */ | ||
74 | #define DCSR_STARTINTR (1 << 1) /* Start Interrupt */ | ||
75 | #define DCSR_BUSERR (1 << 0) /* Bus Error Interrupt */ | ||
76 | |||
77 | #define DCSR_EORIRQEN (1 << 28) /* End of Receive Interrupt Enable */ | ||
78 | #define DCSR_EORJMPEN (1 << 27) /* Jump to next descriptor on EOR */ | ||
79 | #define DCSR_EORSTOPEN (1 << 26) /* STOP on an EOR */ | ||
80 | #define DCSR_SETCMPST (1 << 25) /* Set Descriptor Compare Status */ | ||
81 | #define DCSR_CLRCMPST (1 << 24) /* Clear Descriptor Compare Status */ | ||
82 | #define DCSR_CMPST (1 << 10) /* The Descriptor Compare Status */ | ||
83 | #define DCSR_EORINTR (1 << 9) /* The end of Receive */ | ||
84 | |||
85 | #define DRCMR_MAPVLD (1 << 7) /* Map Valid */ | ||
86 | #define DRCMR_CHLNUM 0x1f /* mask for Channel Number */ | ||
87 | |||
88 | #define DDADR_DESCADDR 0xfffffff0 /* Address of next descriptor */ | ||
89 | #define DDADR_STOP (1 << 0) /* Stop */ | ||
90 | |||
91 | #define DCMD_INCSRCADDR (1 << 31) /* Source Address Increment Setting. */ | ||
92 | #define DCMD_INCTRGADDR (1 << 30) /* Target Address Increment Setting. */ | ||
93 | #define DCMD_FLOWSRC (1 << 29) /* Flow Control by the source. */ | ||
94 | #define DCMD_FLOWTRG (1 << 28) /* Flow Control by the target. */ | ||
95 | #define DCMD_STARTIRQEN (1 << 22) /* Start Interrupt Enable */ | ||
96 | #define DCMD_ENDIRQEN (1 << 21) /* End Interrupt Enable */ | ||
97 | #define DCMD_ENDIAN (1 << 18) /* Device Endian-ness. */ | ||
98 | #define DCMD_BURST8 (1 << 16) /* 8 byte burst */ | ||
99 | #define DCMD_BURST16 (2 << 16) /* 16 byte burst */ | ||
100 | #define DCMD_BURST32 (3 << 16) /* 32 byte burst */ | ||
101 | #define DCMD_WIDTH1 (1 << 14) /* 1 byte width */ | ||
102 | #define DCMD_WIDTH2 (2 << 14) /* 2 byte width (HalfWord) */ | ||
103 | #define DCMD_WIDTH4 (3 << 14) /* 4 byte width (Word) */ | ||
104 | #define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */ | ||
105 | |||
106 | /* | ||
107 | * Descriptor structure for PXA's DMA engine | ||
108 | * Note: this structure must always be aligned to a 16-byte boundary. | ||
109 | */ | ||
110 | |||
111 | typedef enum { | ||
112 | DMA_PRIO_HIGH = 0, | ||
113 | DMA_PRIO_MEDIUM = 1, | ||
114 | DMA_PRIO_LOW = 2 | ||
115 | } pxa_dma_prio; | ||
116 | |||
117 | /* | ||
118 | * DMA registration | ||
119 | */ | ||
120 | |||
121 | static inline int pxa_request_dma(char *name, | ||
122 | pxa_dma_prio prio, | ||
123 | void (*irq_handler)(int, void *), | ||
124 | void *data) | ||
125 | { | ||
126 | return -ENODEV; | ||
127 | } | ||
128 | |||
129 | static inline void pxa_free_dma(int dma_ch) | ||
130 | { | ||
131 | } | ||
132 | |||
133 | /* | ||
134 | * The CE4100 does not have the clk framework implemented and SPI clock can | ||
135 | * not be switched on/off or the divider changed. | ||
136 | */ | ||
137 | static inline void clk_disable(struct clk *clk) | ||
138 | { | ||
139 | } | ||
140 | |||
141 | static inline int clk_enable(struct clk *clk) | ||
142 | { | ||
143 | return 0; | ||
144 | } | ||
145 | |||
146 | static inline unsigned long clk_get_rate(struct clk *clk) | ||
147 | { | ||
148 | return 3686400; | ||
149 | } | ||
150 | |||
151 | #endif | ||
152 | #endif | ||
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 92e52a1e6af3..bb4f5fbbbd8e 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -204,6 +204,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
204 | /** | 204 | /** |
205 | * struct spi_master - interface to SPI master controller | 205 | * struct spi_master - interface to SPI master controller |
206 | * @dev: device interface to this driver | 206 | * @dev: device interface to this driver |
207 | * @list: link with the global spi_master list | ||
207 | * @bus_num: board-specific (and often SOC-specific) identifier for a | 208 | * @bus_num: board-specific (and often SOC-specific) identifier for a |
208 | * given SPI controller. | 209 | * given SPI controller. |
209 | * @num_chipselect: chipselects are used to distinguish individual | 210 | * @num_chipselect: chipselects are used to distinguish individual |
@@ -238,6 +239,8 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
238 | struct spi_master { | 239 | struct spi_master { |
239 | struct device dev; | 240 | struct device dev; |
240 | 241 | ||
242 | struct list_head list; | ||
243 | |||
241 | /* other than negative (== assign one dynamically), bus_num is fully | 244 | /* other than negative (== assign one dynamically), bus_num is fully |
242 | * board-specific. usually that simplifies to being SOC-specific. | 245 | * board-specific. usually that simplifies to being SOC-specific. |
243 | * example: one SOC has three SPI controllers, numbered 0..2, | 246 | * example: one SOC has three SPI controllers, numbered 0..2, |
@@ -578,7 +581,7 @@ extern int spi_bus_unlock(struct spi_master *master); | |||
578 | * Callable only from contexts that can sleep. | 581 | * Callable only from contexts that can sleep. |
579 | */ | 582 | */ |
580 | static inline int | 583 | static inline int |
581 | spi_write(struct spi_device *spi, const u8 *buf, size_t len) | 584 | spi_write(struct spi_device *spi, const void *buf, size_t len) |
582 | { | 585 | { |
583 | struct spi_transfer t = { | 586 | struct spi_transfer t = { |
584 | .tx_buf = buf, | 587 | .tx_buf = buf, |
@@ -602,7 +605,7 @@ spi_write(struct spi_device *spi, const u8 *buf, size_t len) | |||
602 | * Callable only from contexts that can sleep. | 605 | * Callable only from contexts that can sleep. |
603 | */ | 606 | */ |
604 | static inline int | 607 | static inline int |
605 | spi_read(struct spi_device *spi, u8 *buf, size_t len) | 608 | spi_read(struct spi_device *spi, void *buf, size_t len) |
606 | { | 609 | { |
607 | struct spi_transfer t = { | 610 | struct spi_transfer t = { |
608 | .rx_buf = buf, | 611 | .rx_buf = buf, |
@@ -617,8 +620,8 @@ spi_read(struct spi_device *spi, u8 *buf, size_t len) | |||
617 | 620 | ||
618 | /* this copies txbuf and rxbuf data; for small transfers only! */ | 621 | /* this copies txbuf and rxbuf data; for small transfers only! */ |
619 | extern int spi_write_then_read(struct spi_device *spi, | 622 | extern int spi_write_then_read(struct spi_device *spi, |
620 | const u8 *txbuf, unsigned n_tx, | 623 | const void *txbuf, unsigned n_tx, |
621 | u8 *rxbuf, unsigned n_rx); | 624 | void *rxbuf, unsigned n_rx); |
622 | 625 | ||
623 | /** | 626 | /** |
624 | * spi_w8r8 - SPI synchronous 8 bit write followed by 8 bit read | 627 | * spi_w8r8 - SPI synchronous 8 bit write followed by 8 bit read |
diff --git a/include/linux/spi/spi_oc_tiny.h b/include/linux/spi/spi_oc_tiny.h new file mode 100644 index 000000000000..1ac529cf4f06 --- /dev/null +++ b/include/linux/spi/spi_oc_tiny.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef _LINUX_SPI_SPI_OC_TINY_H | ||
2 | #define _LINUX_SPI_SPI_OC_TINY_H | ||
3 | |||
4 | /** | ||
5 | * struct tiny_spi_platform_data - platform data of the OpenCores tiny SPI | ||
6 | * @freq: input clock freq to the core. | ||
7 | * @baudwidth: baud rate divider width of the core. | ||
8 | * @gpio_cs_count: number of gpio pins used for chipselect. | ||
9 | * @gpio_cs: array of gpio pins used for chipselect. | ||
10 | * | ||
11 | * freq and baudwidth are used only if the divider is programmable. | ||
12 | */ | ||
13 | struct tiny_spi_platform_data { | ||
14 | unsigned int freq; | ||
15 | unsigned int baudwidth; | ||
16 | unsigned int gpio_cs_count; | ||
17 | int *gpio_cs; | ||
18 | }; | ||
19 | |||
20 | #endif /* _LINUX_SPI_SPI_OC_TINY_H */ | ||
diff --git a/include/linux/spi/spidev.h b/include/linux/spi/spidev.h index bf0570a84f7a..52d9ed01855f 100644 --- a/include/linux/spi/spidev.h +++ b/include/linux/spi/spidev.h | |||
@@ -66,7 +66,7 @@ | |||
66 | * are in a different address space (and may be of different sizes in some | 66 | * are in a different address space (and may be of different sizes in some |
67 | * cases, such as 32-bit i386 userspace over a 64-bit x86_64 kernel). | 67 | * cases, such as 32-bit i386 userspace over a 64-bit x86_64 kernel). |
68 | * Zero-initialize the structure, including currently unused fields, to | 68 | * Zero-initialize the structure, including currently unused fields, to |
69 | * accomodate potential future updates. | 69 | * accommodate potential future updates. |
70 | * | 70 | * |
71 | * SPI_IOC_MESSAGE gives userspace the equivalent of kernel spi_sync(). | 71 | * SPI_IOC_MESSAGE gives userspace the equivalent of kernel spi_sync(). |
72 | * Pass it an array of related transfers, they'll execute together. | 72 | * Pass it an array of related transfers, they'll execute together. |
diff --git a/include/linux/spi/tsc2005.h b/include/linux/spi/tsc2005.h new file mode 100644 index 000000000000..d9b0c84220c7 --- /dev/null +++ b/include/linux/spi/tsc2005.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * This file is part of TSC2005 touchscreen driver | ||
3 | * | ||
4 | * Copyright (C) 2009-2010 Nokia Corporation | ||
5 | * | ||
6 | * Contact: Aaro Koskinen <aaro.koskinen@nokia.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef _LINUX_SPI_TSC2005_H | ||
25 | #define _LINUX_SPI_TSC2005_H | ||
26 | |||
27 | #include <linux/types.h> | ||
28 | |||
29 | struct tsc2005_platform_data { | ||
30 | int ts_pressure_max; | ||
31 | int ts_pressure_fudge; | ||
32 | int ts_x_max; | ||
33 | int ts_x_fudge; | ||
34 | int ts_y_max; | ||
35 | int ts_y_fudge; | ||
36 | int ts_x_plate_ohm; | ||
37 | unsigned int esd_timeout_ms; | ||
38 | void (*set_reset)(bool enable); | ||
39 | }; | ||
40 | |||
41 | #endif | ||
diff --git a/include/linux/spi/wl12xx.h b/include/linux/spi/wl12xx.h deleted file mode 100644 index a223ecbc71ef..000000000000 --- a/include/linux/spi/wl12xx.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /* | ||
2 | * This file is part of wl12xx | ||
3 | * | ||
4 | * Copyright (C) 2009 Nokia Corporation | ||
5 | * | ||
6 | * Contact: Kalle Valo <kalle.valo@nokia.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
20 | * 02110-1301 USA | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef _LINUX_SPI_WL12XX_H | ||
25 | #define _LINUX_SPI_WL12XX_H | ||
26 | |||
27 | struct wl12xx_platform_data { | ||
28 | void (*set_power)(bool enable); | ||
29 | /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ | ||
30 | int irq; | ||
31 | bool use_eeprom; | ||
32 | }; | ||
33 | |||
34 | #endif | ||