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