pxa2xx_spi.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #include <linux/types.h>
  8. #include <linux/pxa2xx_ssp.h>
  9. struct dma_chan;
  10. /*
  11. * The platform data for SSP controller devices
  12. * (resides in device.platform_data).
  13. */
  14. struct pxa2xx_spi_controller {
  15. u16 num_chipselect;
  16. u8 enable_dma;
  17. u8 dma_burst_size;
  18. bool is_slave;
  19. /* DMA engine specific config */
  20. bool (*dma_filter)(struct dma_chan *chan, void *param);
  21. void *tx_param;
  22. void *rx_param;
  23. /* For non-PXA arches */
  24. struct ssp_device ssp;
  25. };
  26. /*
  27. * The controller specific data for SPI slave devices
  28. * (resides in spi_board_info.controller_data),
  29. * copied to spi_device.platform_data ... mostly for
  30. * DMA tuning.
  31. */
  32. struct pxa2xx_spi_chip {
  33. u8 tx_threshold;
  34. u8 tx_hi_threshold;
  35. u8 rx_threshold;
  36. u8 dma_burst_size;
  37. u32 timeout;
  38. };
  39. #if defined(CONFIG_ARCH_PXA) || defined(CONFIG_ARCH_MMP)
  40. #include <linux/clk.h>
  41. extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info);
  42. #endif
  43. #endif /* __LINUX_SPI_PXA2XX_SPI_H */