sirf-audio-codec.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * SiRF inner codec controllers define
  4. *
  5. * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
  6. */
  7. #ifndef _SIRF_AUDIO_CODEC_H
  8. #define _SIRF_AUDIO_CODEC_H
  9. #define AUDIO_IC_CODEC_PWR (0x00E0)
  10. #define AUDIO_IC_CODEC_CTRL0 (0x00E4)
  11. #define AUDIO_IC_CODEC_CTRL1 (0x00E8)
  12. #define AUDIO_IC_CODEC_CTRL2 (0x00EC)
  13. #define AUDIO_IC_CODEC_CTRL3 (0x00F0)
  14. #define MICBIASEN (1 << 3)
  15. #define IC_RDACEN (1 << 0)
  16. #define IC_LDACEN (1 << 1)
  17. #define IC_HSREN (1 << 2)
  18. #define IC_HSLEN (1 << 3)
  19. #define IC_SPEN (1 << 4)
  20. #define IC_CPEN (1 << 5)
  21. #define IC_HPRSELR (1 << 6)
  22. #define IC_HPLSELR (1 << 7)
  23. #define IC_HPRSELL (1 << 8)
  24. #define IC_HPLSELL (1 << 9)
  25. #define IC_SPSELR (1 << 10)
  26. #define IC_SPSELL (1 << 11)
  27. #define IC_MONOR (1 << 12)
  28. #define IC_MONOL (1 << 13)
  29. #define IC_RXOSRSEL (1 << 28)
  30. #define IC_CPFREQ (1 << 29)
  31. #define IC_HSINVEN (1 << 30)
  32. #define IC_MICINREN (1 << 0)
  33. #define IC_MICINLEN (1 << 1)
  34. #define IC_MICIN1SEL (1 << 2)
  35. #define IC_MICIN2SEL (1 << 3)
  36. #define IC_MICDIFSEL (1 << 4)
  37. #define IC_LINEIN1SEL (1 << 5)
  38. #define IC_LINEIN2SEL (1 << 6)
  39. #define IC_RADCEN (1 << 7)
  40. #define IC_LADCEN (1 << 8)
  41. #define IC_ALM (1 << 9)
  42. #define IC_DIGMICEN (1 << 22)
  43. #define IC_DIGMICFREQ (1 << 23)
  44. #define IC_ADC14B_12 (1 << 24)
  45. #define IC_FIRDAC_HSL_EN (1 << 25)
  46. #define IC_FIRDAC_HSR_EN (1 << 26)
  47. #define IC_FIRDAC_LOUT_EN (1 << 27)
  48. #define IC_POR (1 << 28)
  49. #define IC_CODEC_CLK_EN (1 << 29)
  50. #define IC_HP_3DB_BOOST (1 << 30)
  51. #define IC_ADC_LEFT_GAIN_SHIFT 16
  52. #define IC_ADC_RIGHT_GAIN_SHIFT 10
  53. #define IC_ADC_GAIN_MASK 0x3F
  54. #define IC_MIC_MAX_GAIN 0x39
  55. #define IC_RXPGAR_MASK 0x3F
  56. #define IC_RXPGAR_SHIFT 14
  57. #define IC_RXPGAL_MASK 0x3F
  58. #define IC_RXPGAL_SHIFT 21
  59. #define IC_RXPGAR 0x7B
  60. #define IC_RXPGAL 0x7B
  61. #define AUDIO_PORT_TX_FIFO_LEVEL_CHECK_MASK 0x3F
  62. #define AUDIO_PORT_TX_FIFO_SC_OFFSET 0
  63. #define AUDIO_PORT_TX_FIFO_LC_OFFSET 10
  64. #define AUDIO_PORT_TX_FIFO_HC_OFFSET 20
  65. #define TX_FIFO_SC(x) (((x) & AUDIO_PORT_TX_FIFO_LEVEL_CHECK_MASK) \
  66. << AUDIO_PORT_TX_FIFO_SC_OFFSET)
  67. #define TX_FIFO_LC(x) (((x) & AUDIO_PORT_TX_FIFO_LEVEL_CHECK_MASK) \
  68. << AUDIO_PORT_TX_FIFO_LC_OFFSET)
  69. #define TX_FIFO_HC(x) (((x) & AUDIO_PORT_TX_FIFO_LEVEL_CHECK_MASK) \
  70. << AUDIO_PORT_TX_FIFO_HC_OFFSET)
  71. #define AUDIO_PORT_RX_FIFO_LEVEL_CHECK_MASK 0x0F
  72. #define AUDIO_PORT_RX_FIFO_SC_OFFSET 0
  73. #define AUDIO_PORT_RX_FIFO_LC_OFFSET 10
  74. #define AUDIO_PORT_RX_FIFO_HC_OFFSET 20
  75. #define RX_FIFO_SC(x) (((x) & AUDIO_PORT_RX_FIFO_LEVEL_CHECK_MASK) \
  76. << AUDIO_PORT_RX_FIFO_SC_OFFSET)
  77. #define RX_FIFO_LC(x) (((x) & AUDIO_PORT_RX_FIFO_LEVEL_CHECK_MASK) \
  78. << AUDIO_PORT_RX_FIFO_LC_OFFSET)
  79. #define RX_FIFO_HC(x) (((x) & AUDIO_PORT_RX_FIFO_LEVEL_CHECK_MASK) \
  80. << AUDIO_PORT_RX_FIFO_HC_OFFSET)
  81. #define AUDIO_PORT_IC_CODEC_TX_CTRL (0x00F4)
  82. #define AUDIO_PORT_IC_CODEC_RX_CTRL (0x00F8)
  83. #define AUDIO_PORT_IC_TXFIFO_OP (0x00FC)
  84. #define AUDIO_PORT_IC_TXFIFO_LEV_CHK (0x0100)
  85. #define AUDIO_PORT_IC_TXFIFO_STS (0x0104)
  86. #define AUDIO_PORT_IC_TXFIFO_INT (0x0108)
  87. #define AUDIO_PORT_IC_TXFIFO_INT_MSK (0x010C)
  88. #define AUDIO_PORT_IC_RXFIFO_OP (0x0110)
  89. #define AUDIO_PORT_IC_RXFIFO_LEV_CHK (0x0114)
  90. #define AUDIO_PORT_IC_RXFIFO_STS (0x0118)
  91. #define AUDIO_PORT_IC_RXFIFO_INT (0x011C)
  92. #define AUDIO_PORT_IC_RXFIFO_INT_MSK (0x0120)
  93. #define AUDIO_FIFO_START (1 << 0)
  94. #define AUDIO_FIFO_RESET (1 << 1)
  95. #define AUDIO_FIFO_FULL (1 << 0)
  96. #define AUDIO_FIFO_EMPTY (1 << 1)
  97. #define AUDIO_FIFO_OFLOW (1 << 2)
  98. #define AUDIO_FIFO_UFLOW (1 << 3)
  99. #define IC_TX_ENABLE (0x03)
  100. #define IC_RX_ENABLE_MONO (0x01)
  101. #define IC_RX_ENABLE_STEREO (0x03)
  102. #endif /*__SIRF_AUDIO_CODEC_H*/