spi-s3c64xx.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2009 Samsung Electronics Ltd.
  4. * Jaswinder Singh <[email protected]>
  5. */
  6. #ifndef __SPI_S3C64XX_H
  7. #define __SPI_S3C64XX_H
  8. #include <linux/dmaengine.h>
  9. struct platform_device;
  10. /**
  11. * struct s3c64xx_spi_csinfo - ChipSelect description
  12. * @fb_delay: Slave specific feedback delay.
  13. * Refer to FB_CLK_SEL register definition in SPI chapter.
  14. *
  15. * This is per SPI-Slave Chipselect information.
  16. * Allocate and initialize one in machine init code and make the
  17. * spi_board_info.controller_data point to it.
  18. */
  19. struct s3c64xx_spi_csinfo {
  20. u8 fb_delay;
  21. };
  22. /**
  23. * struct s3c64xx_spi_info - SPI Controller defining structure
  24. * @src_clk_nr: Clock source index for the CLK_CFG[SPI_CLKSEL] field.
  25. * @num_cs: Number of CS this controller emulates.
  26. * @cfg_gpio: Configure pins for this SPI controller.
  27. */
  28. struct s3c64xx_spi_info {
  29. int src_clk_nr;
  30. int num_cs;
  31. bool no_cs;
  32. int (*cfg_gpio)(void);
  33. };
  34. /**
  35. * s3c64xx_spi_set_platdata - SPI Controller configure callback by the board
  36. * initialization code.
  37. * @src_clk_nr: Clock the SPI controller is to use to generate SPI clocks.
  38. * @num_cs: Number of elements in the 'cs' array.
  39. *
  40. * Call this from machine init code for each SPI Controller that
  41. * has some chips attached to it.
  42. */
  43. extern void s3c64xx_spi0_set_platdata(int src_clk_nr, int num_cs);
  44. /* defined by architecture to configure gpio */
  45. extern int s3c64xx_spi0_cfg_gpio(void);
  46. extern struct s3c64xx_spi_info s3c64xx_spi0_pdata;
  47. #endif /*__SPI_S3C64XX_H */