Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs
0004  */
0005 #ifndef __LINUX_SPI_PXA2XX_SPI_H
0006 #define __LINUX_SPI_PXA2XX_SPI_H
0007 
0008 #include <linux/types.h>
0009 
0010 #include <linux/pxa2xx_ssp.h>
0011 
0012 struct dma_chan;
0013 
0014 /*
0015  * The platform data for SSP controller devices
0016  * (resides in device.platform_data).
0017  */
0018 struct pxa2xx_spi_controller {
0019     u16 num_chipselect;
0020     u8 enable_dma;
0021     u8 dma_burst_size;
0022     bool is_slave;
0023 
0024     /* DMA engine specific config */
0025     bool (*dma_filter)(struct dma_chan *chan, void *param);
0026     void *tx_param;
0027     void *rx_param;
0028 
0029     /* For non-PXA arches */
0030     struct ssp_device ssp;
0031 };
0032 
0033 /*
0034  * The controller specific data for SPI slave devices
0035  * (resides in spi_board_info.controller_data),
0036  * copied to spi_device.platform_data ... mostly for
0037  * DMA tuning.
0038  */
0039 struct pxa2xx_spi_chip {
0040     u8 tx_threshold;
0041     u8 tx_hi_threshold;
0042     u8 rx_threshold;
0043     u8 dma_burst_size;
0044     u32 timeout;
0045 };
0046 
0047 #if defined(CONFIG_ARCH_PXA) || defined(CONFIG_ARCH_MMP)
0048 
0049 #include <linux/clk.h>
0050 
0051 extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info);
0052 
0053 #endif
0054 
0055 #endif  /* __LINUX_SPI_PXA2XX_SPI_H */