spi_gpio.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * spi_gpio interface to platform code
  3. *
  4. * Copyright (c) 2008 Piotr Skamruk
  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 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef _LINUX_SPI_SPI_GPIO
  11. #define _LINUX_SPI_SPI_GPIO
  12. #include <linux/types.h>
  13. #include <linux/spi/spi.h>
  14. /** struct spi_gpio_platform_data - Data definitions for a SPI-GPIO device.
  15. * This structure holds information about a GPIO-based SPI device.
  16. *
  17. * @pin_clk: The GPIO pin number of the CLOCK pin.
  18. *
  19. * @pin_miso: The GPIO pin number of the MISO pin.
  20. *
  21. * @pin_mosi: The GPIO pin number of the MOSI pin.
  22. *
  23. * @pin_cs: The GPIO pin number of the CHIPSELECT pin.
  24. *
  25. * @cs_activelow: If true, the chip is selected when the CS line is low.
  26. *
  27. * @no_spi_delay: If true, no delay is done in the lowlevel bitbanging.
  28. * Note that doing no delay is not standards compliant,
  29. * but it might be needed to speed up transfers on some
  30. * slow embedded machines.
  31. *
  32. * @boardinfo_setup: This callback is called after the
  33. * SPI master device was registered, but before the
  34. * device is registered.
  35. * @boardinfo_setup_data: Data argument passed to boardinfo_setup().
  36. */
  37. struct spi_gpio_platform_data {
  38. unsigned int pin_clk;
  39. unsigned int pin_miso;
  40. unsigned int pin_mosi;
  41. unsigned int pin_cs;
  42. bool cs_activelow;
  43. bool no_spi_delay;
  44. int (*boardinfo_setup)(struct spi_board_info *bi,
  45. struct spi_master *master,
  46. void *data);
  47. void *boardinfo_setup_data;
  48. };
  49. #endif /* _LINUX_SPI_SPI_GPIO */