rt5514-spi.h 913 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * rt5514-spi.h -- RT5514 driver
  4. *
  5. * Copyright 2015 Realtek Semiconductor Corp.
  6. * Author: Oder Chiou <oder_chiou@realtek.com>
  7. */
  8. #ifndef __RT5514_SPI_H__
  9. #define __RT5514_SPI_H__
  10. /**
  11. * RT5514_SPI_BUF_LEN is the buffer size of SPI master controller.
  12. */
  13. #define RT5514_SPI_BUF_LEN 240
  14. #define RT5514_BUFFER_VOICE_BASE 0x18000200
  15. #define RT5514_BUFFER_VOICE_LIMIT 0x18000204
  16. #define RT5514_BUFFER_VOICE_WP 0x1800020c
  17. #define RT5514_IRQ_CTRL 0x18002094
  18. #define RT5514_IRQ_STATUS_BIT (0x1 << 5)
  19. /* SPI Command */
  20. enum {
  21. RT5514_SPI_CMD_16_READ = 0,
  22. RT5514_SPI_CMD_16_WRITE,
  23. RT5514_SPI_CMD_32_READ,
  24. RT5514_SPI_CMD_32_WRITE,
  25. RT5514_SPI_CMD_BURST_READ,
  26. RT5514_SPI_CMD_BURST_WRITE,
  27. };
  28. int rt5514_spi_burst_read(unsigned int addr, u8 *rxbuf, size_t len);
  29. int rt5514_spi_burst_write(u32 addr, const u8 *txbuf, size_t len);
  30. #endif /* __RT5514_SPI_H__ */