rt5670-dsp.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * rt5670-dsp.h -- RT5670 ALSA SoC DSP driver
  3. *
  4. * Copyright 2014 Realtek Microelectronics
  5. * Author: Bard Liao <bardliao@realtek.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef __RT5670_DSP_H__
  12. #define __RT5670_DSP_H__
  13. #define RT5670_DSP_CTRL1 0xe0
  14. #define RT5670_DSP_CTRL2 0xe1
  15. #define RT5670_DSP_CTRL3 0xe2
  16. #define RT5670_DSP_CTRL4 0xe3
  17. #define RT5670_DSP_CTRL5 0xe4
  18. /* DSP Control 1 (0xe0) */
  19. #define RT5670_DSP_CMD_MASK (0xff << 8)
  20. #define RT5670_DSP_CMD_PE (0x0d << 8) /* Patch Entry */
  21. #define RT5670_DSP_CMD_MW (0x3b << 8) /* Memory Write */
  22. #define RT5670_DSP_CMD_MR (0x37 << 8) /* Memory Read */
  23. #define RT5670_DSP_CMD_RR (0x60 << 8) /* Register Read */
  24. #define RT5670_DSP_CMD_RW (0x68 << 8) /* Register Write */
  25. #define RT5670_DSP_REG_DATHI (0x26 << 8) /* High Data Addr */
  26. #define RT5670_DSP_REG_DATLO (0x25 << 8) /* Low Data Addr */
  27. #define RT5670_DSP_CLK_MASK (0x3 << 6)
  28. #define RT5670_DSP_CLK_SFT 6
  29. #define RT5670_DSP_CLK_768K (0x0 << 6)
  30. #define RT5670_DSP_CLK_384K (0x1 << 6)
  31. #define RT5670_DSP_CLK_192K (0x2 << 6)
  32. #define RT5670_DSP_CLK_96K (0x3 << 6)
  33. #define RT5670_DSP_BUSY_MASK (0x1 << 5)
  34. #define RT5670_DSP_RW_MASK (0x1 << 4)
  35. #define RT5670_DSP_DL_MASK (0x3 << 2)
  36. #define RT5670_DSP_DL_0 (0x0 << 2)
  37. #define RT5670_DSP_DL_1 (0x1 << 2)
  38. #define RT5670_DSP_DL_2 (0x2 << 2)
  39. #define RT5670_DSP_DL_3 (0x3 << 2)
  40. #define RT5670_DSP_I2C_AL_16 (0x1 << 1)
  41. #define RT5670_DSP_CMD_EN (0x1)
  42. struct rt5670_dsp_param {
  43. u16 cmd_fmt;
  44. u16 addr;
  45. u16 data;
  46. u8 cmd;
  47. };
  48. #endif /* __RT5670_DSP_H__ */