spi-imx.h 1.1 KB

123456789101112131415161718192021222324252627
  1. #ifndef __MACH_SPI_H_
  2. #define __MACH_SPI_H_
  3. /*
  4. * struct spi_imx_master - device.platform_data for SPI controller devices.
  5. * @chipselect: Array of chipselects for this master. Numbers >= 0 mean gpio
  6. * pins, numbers < 0 mean internal CSPI chipselects according
  7. * to MXC_SPI_CS(). Normally you want to use gpio based chip
  8. * selects as the CSPI module tries to be intelligent about
  9. * when to assert the chipselect: The CSPI module deasserts the
  10. * chipselect once it runs out of input data. The other problem
  11. * is that it is not possible to mix between high active and low
  12. * active chipselects on one single bus using the internal
  13. * chipselects. Unfortunately Freescale decided to put some
  14. * chipselects on dedicated pins which are not usable as gpios,
  15. * so we have to support the internal chipselects.
  16. * @num_chipselect: ARRAY_SIZE(chipselect)
  17. */
  18. struct spi_imx_master {
  19. int *chipselect;
  20. int num_chipselect;
  21. };
  22. #define MXC_SPI_CS(no) ((no) - 32)
  23. #endif /* __MACH_SPI_H_*/