mcfqspi.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Definitions for Freescale Coldfire QSPI module
  3. *
  4. * Copyright 2010 Steven King <sfking@fdwdc.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2
  8. * as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #ifndef mcfqspi_h
  16. #define mcfqspi_h
  17. /**
  18. * struct mcfqspi_cs_control - chip select control for the coldfire qspi driver
  19. * @setup: setup the control; allocate gpio's, etc. May be NULL.
  20. * @teardown: finish with the control; free gpio's, etc. May be NULL.
  21. * @select: output the signals to select the device. Can not be NULL.
  22. * @deselect: output the signals to deselect the device. Can not be NULL.
  23. *
  24. * The QSPI module has 4 hardware chip selects. We don't use them. Instead
  25. * platforms are required to supply a mcfqspi_cs_control as a part of the
  26. * platform data for each QSPI master controller. Only the select and
  27. * deselect functions are required.
  28. */
  29. struct mcfqspi_cs_control {
  30. int (*setup)(struct mcfqspi_cs_control *);
  31. void (*teardown)(struct mcfqspi_cs_control *);
  32. void (*select)(struct mcfqspi_cs_control *, u8, bool);
  33. void (*deselect)(struct mcfqspi_cs_control *, u8, bool);
  34. };
  35. /**
  36. * struct mcfqspi_platform_data - platform data for the coldfire qspi driver
  37. * @bus_num: board specific identifier for this qspi driver.
  38. * @num_chipselects: number of chip selects supported by this qspi driver.
  39. * @cs_control: platform dependent chip select control.
  40. */
  41. struct mcfqspi_platform_data {
  42. s16 bus_num;
  43. u16 num_chipselect;
  44. struct mcfqspi_cs_control *cs_control;
  45. };
  46. #endif /* mcfqspi_h */