spi-fsl-cpm.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Freescale SPI controller driver cpm functions.
  3. *
  4. * Maintainer: Kumar Gala
  5. *
  6. * Copyright (C) 2006 Polycom, Inc.
  7. * Copyright 2010 Freescale Semiconductor, Inc.
  8. *
  9. * CPM SPI and QE buffer descriptors mode support:
  10. * Copyright (c) 2009 MontaVista Software, Inc.
  11. * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
  12. *
  13. * This program is free software; you can redistribute it and/or modify it
  14. * under the terms of the GNU General Public License as published by the
  15. * Free Software Foundation; either version 2 of the License, or (at your
  16. * option) any later version.
  17. */
  18. #ifndef __SPI_FSL_CPM_H__
  19. #define __SPI_FSL_CPM_H__
  20. #include "spi-fsl-lib.h"
  21. #ifdef CONFIG_FSL_SOC
  22. extern void fsl_spi_cpm_reinit_txrx(struct mpc8xxx_spi *mspi);
  23. extern int fsl_spi_cpm_bufs(struct mpc8xxx_spi *mspi,
  24. struct spi_transfer *t, bool is_dma_mapped);
  25. extern void fsl_spi_cpm_bufs_complete(struct mpc8xxx_spi *mspi);
  26. extern void fsl_spi_cpm_irq(struct mpc8xxx_spi *mspi, u32 events);
  27. extern int fsl_spi_cpm_init(struct mpc8xxx_spi *mspi);
  28. extern void fsl_spi_cpm_free(struct mpc8xxx_spi *mspi);
  29. #else
  30. static inline void fsl_spi_cpm_reinit_txrx(struct mpc8xxx_spi *mspi) { }
  31. static inline int fsl_spi_cpm_bufs(struct mpc8xxx_spi *mspi,
  32. struct spi_transfer *t,
  33. bool is_dma_mapped) { return 0; }
  34. static inline void fsl_spi_cpm_bufs_complete(struct mpc8xxx_spi *mspi) { }
  35. static inline void fsl_spi_cpm_irq(struct mpc8xxx_spi *mspi, u32 events) { }
  36. static inline int fsl_spi_cpm_init(struct mpc8xxx_spi *mspi) { return 0; }
  37. static inline void fsl_spi_cpm_free(struct mpc8xxx_spi *mspi) { }
  38. #endif
  39. #endif /* __SPI_FSL_CPM_H__ */