wm8960.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * wm8960.h -- WM8960 Soc Audio driver
  4. */
  5. #ifndef _WM8960_H
  6. #define _WM8960_H
  7. /* WM8960 register space */
  8. #define WM8960_CACHEREGNUM 56
  9. #define WM8960_LINVOL 0x0
  10. #define WM8960_RINVOL 0x1
  11. #define WM8960_LOUT1 0x2
  12. #define WM8960_ROUT1 0x3
  13. #define WM8960_CLOCK1 0x4
  14. #define WM8960_DACCTL1 0x5
  15. #define WM8960_DACCTL2 0x6
  16. #define WM8960_IFACE1 0x7
  17. #define WM8960_CLOCK2 0x8
  18. #define WM8960_IFACE2 0x9
  19. #define WM8960_LDAC 0xa
  20. #define WM8960_RDAC 0xb
  21. #define WM8960_RESET 0xf
  22. #define WM8960_3D 0x10
  23. #define WM8960_ALC1 0x11
  24. #define WM8960_ALC2 0x12
  25. #define WM8960_ALC3 0x13
  26. #define WM8960_NOISEG 0x14
  27. #define WM8960_LADC 0x15
  28. #define WM8960_RADC 0x16
  29. #define WM8960_ADDCTL1 0x17
  30. #define WM8960_ADDCTL2 0x18
  31. #define WM8960_POWER1 0x19
  32. #define WM8960_POWER2 0x1a
  33. #define WM8960_ADDCTL3 0x1b
  34. #define WM8960_APOP1 0x1c
  35. #define WM8960_APOP2 0x1d
  36. #define WM8960_LINPATH 0x20
  37. #define WM8960_RINPATH 0x21
  38. #define WM8960_LOUTMIX 0x22
  39. #define WM8960_ROUTMIX 0x25
  40. #define WM8960_MONOMIX1 0x26
  41. #define WM8960_MONOMIX2 0x27
  42. #define WM8960_LOUT2 0x28
  43. #define WM8960_ROUT2 0x29
  44. #define WM8960_MONO 0x2a
  45. #define WM8960_INBMIX1 0x2b
  46. #define WM8960_INBMIX2 0x2c
  47. #define WM8960_BYPASS1 0x2d
  48. #define WM8960_BYPASS2 0x2e
  49. #define WM8960_POWER3 0x2f
  50. #define WM8960_ADDCTL4 0x30
  51. #define WM8960_CLASSD1 0x31
  52. #define WM8960_CLASSD3 0x33
  53. #define WM8960_PLL1 0x34
  54. #define WM8960_PLL2 0x35
  55. #define WM8960_PLL3 0x36
  56. #define WM8960_PLL4 0x37
  57. /*
  58. * WM8960 Clock dividers
  59. */
  60. #define WM8960_SYSCLKDIV 0
  61. #define WM8960_DACDIV 1
  62. #define WM8960_OPCLKDIV 2
  63. #define WM8960_DCLKDIV 3
  64. #define WM8960_TOCLKSEL 4
  65. #define WM8960_SYSCLK_DIV_1 (0 << 1)
  66. #define WM8960_SYSCLK_DIV_2 (2 << 1)
  67. #define WM8960_SYSCLK_MCLK (0 << 0)
  68. #define WM8960_SYSCLK_PLL (1 << 0)
  69. #define WM8960_SYSCLK_AUTO (2 << 0)
  70. #define WM8960_DAC_DIV_1 (0 << 3)
  71. #define WM8960_DAC_DIV_1_5 (1 << 3)
  72. #define WM8960_DAC_DIV_2 (2 << 3)
  73. #define WM8960_DAC_DIV_3 (3 << 3)
  74. #define WM8960_DAC_DIV_4 (4 << 3)
  75. #define WM8960_DAC_DIV_5_5 (5 << 3)
  76. #define WM8960_DAC_DIV_6 (6 << 3)
  77. #define WM8960_DCLK_DIV_1_5 (0 << 6)
  78. #define WM8960_DCLK_DIV_2 (1 << 6)
  79. #define WM8960_DCLK_DIV_3 (2 << 6)
  80. #define WM8960_DCLK_DIV_4 (3 << 6)
  81. #define WM8960_DCLK_DIV_6 (4 << 6)
  82. #define WM8960_DCLK_DIV_8 (5 << 6)
  83. #define WM8960_DCLK_DIV_12 (6 << 6)
  84. #define WM8960_DCLK_DIV_16 (7 << 6)
  85. #define WM8960_TOCLK_F19 (0 << 1)
  86. #define WM8960_TOCLK_F21 (1 << 1)
  87. #define WM8960_OPCLK_DIV_1 (0 << 0)
  88. #define WM8960_OPCLK_DIV_2 (1 << 0)
  89. #define WM8960_OPCLK_DIV_3 (2 << 0)
  90. #define WM8960_OPCLK_DIV_4 (3 << 0)
  91. #define WM8960_OPCLK_DIV_5_5 (4 << 0)
  92. #define WM8960_OPCLK_DIV_6 (5 << 0)
  93. #endif