Commit | Line | Data |
---|---|---|
c942fddf | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
e0c9905e SS |
2 | /* |
3 | * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs | |
e0c9905e | 4 | */ |
8348c259 SAS |
5 | #ifndef __linux_pxa2xx_spi_h |
6 | #define __linux_pxa2xx_spi_h | |
e0c9905e | 7 | |
8348c259 | 8 | #include <linux/pxa2xx_ssp.h> |
e0c9905e SS |
9 | |
10 | #define PXA2XX_CS_ASSERT (0x01) | |
11 | #define PXA2XX_CS_DEASSERT (0x02) | |
12 | ||
b729bf34 MW |
13 | struct dma_chan; |
14 | ||
e0c9905e | 15 | /* device.platform_data for SSP controller devices */ |
51eea52d | 16 | struct pxa2xx_spi_controller { |
e0c9905e SS |
17 | u16 num_chipselect; |
18 | u8 enable_dma; | |
37821a82 | 19 | u8 dma_burst_size; |
ec93cb6f | 20 | bool is_slave; |
851bacf5 | 21 | |
5928808e | 22 | /* DMA engine specific config */ |
b729bf34 MW |
23 | bool (*dma_filter)(struct dma_chan *chan, void *param); |
24 | void *tx_param; | |
25 | void *rx_param; | |
5928808e | 26 | |
851bacf5 MW |
27 | /* For non-PXA arches */ |
28 | struct ssp_device ssp; | |
e0c9905e SS |
29 | }; |
30 | ||
31 | /* spi_board_info.controller_data for SPI slave devices, | |
32 | * copied to spi_device.platform_data ... mostly for dma tuning | |
33 | */ | |
34 | struct pxa2xx_spi_chip { | |
35 | u8 tx_threshold; | |
a0d2642e | 36 | u8 tx_hi_threshold; |
e0c9905e SS |
37 | u8 rx_threshold; |
38 | u8 dma_burst_size; | |
8d94cc50 | 39 | u32 timeout; |
e0c9905e | 40 | u8 enable_loopback; |
a7bb3909 | 41 | int gpio_cs; |
e0c9905e SS |
42 | void (*cs_control)(u32 command); |
43 | }; | |
44 | ||
60172215 | 45 | #if defined(CONFIG_ARCH_PXA) || defined(CONFIG_ARCH_MMP) |
d6ea3df0 SAS |
46 | |
47 | #include <linux/clk.h> | |
d6ea3df0 | 48 | |
51eea52d | 49 | extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info); |
e172274c | 50 | |
d6ea3df0 | 51 | #endif |
8348c259 | 52 | #endif |