ad1938.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * File: sound/soc/codecs/ad1836.h
  3. * Based on:
  4. * Author: Barry Song <Barry.Song@analog.com>
  5. *
  6. * Created: May 25, 2009
  7. * Description: definitions for AD1938 registers
  8. *
  9. * Modified:
  10. *
  11. * Bugs: Enter bugs at http://blackfin.uclinux.org/
  12. *
  13. * This program is free software; you can redistribute it and/or modify
  14. * it under the terms of the GNU General Public License as published by
  15. * the Free Software Foundation; either version 2 of the License, or
  16. * (at your option) any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU General Public License
  24. * along with this program; if not, see the file COPYING, or write
  25. * to the Free Software Foundation, Inc.,
  26. * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  27. */
  28. #ifndef __AD1938_H__
  29. #define __AD1938_H__
  30. #define AD1938_PLL_CLK_CTRL0 0
  31. #define AD1938_PLL_POWERDOWN 0x01
  32. #define AD1938_PLL_CLK_CTRL1 1
  33. #define AD1938_DAC_CTRL0 2
  34. #define AD1938_DAC_POWERDOWN 0x01
  35. #define AD1938_DAC_SERFMT_MASK 0xC0
  36. #define AD1938_DAC_SERFMT_STEREO (0 << 6)
  37. #define AD1938_DAC_SERFMT_TDM (1 << 6)
  38. #define AD1938_DAC_CTRL1 3
  39. #define AD1938_DAC_2_CHANNELS 0
  40. #define AD1938_DAC_4_CHANNELS 1
  41. #define AD1938_DAC_8_CHANNELS 2
  42. #define AD1938_DAC_16_CHANNELS 3
  43. #define AD1938_DAC_CHAN_SHFT 1
  44. #define AD1938_DAC_CHAN_MASK (3 << AD1938_DAC_CHAN_SHFT)
  45. #define AD1938_DAC_LCR_MASTER (1 << 4)
  46. #define AD1938_DAC_BCLK_MASTER (1 << 5)
  47. #define AD1938_DAC_LEFT_HIGH (1 << 3)
  48. #define AD1938_DAC_BCLK_INV (1 << 7)
  49. #define AD1938_DAC_CTRL2 4
  50. #define AD1938_DAC_WORD_LEN_MASK 0xC
  51. #define AD1938_DAC_MASTER_MUTE 1
  52. #define AD1938_DAC_CHNL_MUTE 5
  53. #define AD1938_DACL1_MUTE 0
  54. #define AD1938_DACR1_MUTE 1
  55. #define AD1938_DACL2_MUTE 2
  56. #define AD1938_DACR2_MUTE 3
  57. #define AD1938_DACL3_MUTE 4
  58. #define AD1938_DACR3_MUTE 5
  59. #define AD1938_DACL4_MUTE 6
  60. #define AD1938_DACR4_MUTE 7
  61. #define AD1938_DAC_L1_VOL 6
  62. #define AD1938_DAC_R1_VOL 7
  63. #define AD1938_DAC_L2_VOL 8
  64. #define AD1938_DAC_R2_VOL 9
  65. #define AD1938_DAC_L3_VOL 10
  66. #define AD1938_DAC_R3_VOL 11
  67. #define AD1938_DAC_L4_VOL 12
  68. #define AD1938_DAC_R4_VOL 13
  69. #define AD1938_ADC_CTRL0 14
  70. #define AD1938_ADC_POWERDOWN 0x01
  71. #define AD1938_ADC_HIGHPASS_FILTER 1
  72. #define AD1938_ADCL1_MUTE 2
  73. #define AD1938_ADCR1_MUTE 3
  74. #define AD1938_ADCL2_MUTE 4
  75. #define AD1938_ADCR2_MUTE 5
  76. #define AD1938_ADC_CTRL1 15
  77. #define AD1938_ADC_SERFMT_MASK 0x60
  78. #define AD1938_ADC_SERFMT_STEREO (0 << 5)
  79. #define AD1938_ADC_SERFMT_TDM (1 << 2)
  80. #define AD1938_ADC_SERFMT_AUX (2 << 5)
  81. #define AD1938_ADC_WORD_LEN_MASK 0x3
  82. #define AD1938_ADC_CTRL2 16
  83. #define AD1938_ADC_2_CHANNELS 0
  84. #define AD1938_ADC_4_CHANNELS 1
  85. #define AD1938_ADC_8_CHANNELS 2
  86. #define AD1938_ADC_16_CHANNELS 3
  87. #define AD1938_ADC_CHAN_SHFT 4
  88. #define AD1938_ADC_CHAN_MASK (3 << AD1938_ADC_CHAN_SHFT)
  89. #define AD1938_ADC_LCR_MASTER (1 << 3)
  90. #define AD1938_ADC_BCLK_MASTER (1 << 6)
  91. #define AD1938_ADC_LEFT_HIGH (1 << 2)
  92. #define AD1938_ADC_BCLK_INV (1 << 1)
  93. #define AD1938_NUM_REGS 17
  94. extern struct snd_soc_dai ad1938_dai;
  95. extern struct snd_soc_codec_device soc_codec_dev_ad1938;
  96. #endif