1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs
4 */
5#ifndef __LINUX_SPI_PXA2XX_SPI_H
6#define __LINUX_SPI_PXA2XX_SPI_H
7
8#include <linux/dmaengine.h>
9#include <linux/types.h>
10
11#include <linux/pxa2xx_ssp.h>
12
13struct dma_chan;
14
15/*
16 * The platform data for SSP controller devices
17 * (resides in device.platform_data).
18 */
19struct pxa2xx_spi_controller {
20	u16 num_chipselect;
21	u8 enable_dma;
22	u8 dma_burst_size;
23	bool is_target;
24
25	/* DMA engine specific config */
26	dma_filter_fn dma_filter;
27	void *tx_param;
28	void *rx_param;
29
30	/* For non-PXA arches */
31	struct ssp_device ssp;
32};
33
34/*
35 * The controller specific data for SPI target devices
36 * (resides in spi_board_info.controller_data),
37 * copied to spi_device.platform_data ... mostly for
38 * DMA tuning.
39 */
40struct pxa2xx_spi_chip {
41	u8 tx_threshold;
42	u8 tx_hi_threshold;
43	u8 rx_threshold;
44	u8 dma_burst_size;
45	u32 timeout;
46};
47
48#if defined(CONFIG_ARCH_PXA) || defined(CONFIG_ARCH_MMP)
49
50#include <linux/clk.h>
51
52extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info);
53
54#endif
55
56#endif	/* __LINUX_SPI_PXA2XX_SPI_H */
57