mcfqspi.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Definitions for Freescale Coldfire QSPI module
  4. *
  5. * Copyright 2010 Steven King <[email protected]>
  6. */
  7. #ifndef mcfqspi_h
  8. #define mcfqspi_h
  9. /**
  10. * struct mcfqspi_cs_control - chip select control for the coldfire qspi driver
  11. * @setup: setup the control; allocate gpio's, etc. May be NULL.
  12. * @teardown: finish with the control; free gpio's, etc. May be NULL.
  13. * @select: output the signals to select the device. Can not be NULL.
  14. * @deselect: output the signals to deselect the device. Can not be NULL.
  15. *
  16. * The QSPI module has 4 hardware chip selects. We don't use them. Instead
  17. * platforms are required to supply a mcfqspi_cs_control as a part of the
  18. * platform data for each QSPI master controller. Only the select and
  19. * deselect functions are required.
  20. */
  21. struct mcfqspi_cs_control {
  22. int (*setup)(struct mcfqspi_cs_control *);
  23. void (*teardown)(struct mcfqspi_cs_control *);
  24. void (*select)(struct mcfqspi_cs_control *, u8, bool);
  25. void (*deselect)(struct mcfqspi_cs_control *, u8, bool);
  26. };
  27. /**
  28. * struct mcfqspi_platform_data - platform data for the coldfire qspi driver
  29. * @bus_num: board specific identifier for this qspi driver.
  30. * @num_chipselects: number of chip selects supported by this qspi driver.
  31. * @cs_control: platform dependent chip select control.
  32. */
  33. struct mcfqspi_platform_data {
  34. s16 bus_num;
  35. u16 num_chipselect;
  36. struct mcfqspi_cs_control *cs_control;
  37. };
  38. #endif /* mcfqspi_h */