aic23.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * arch/arm/plat-omap/include/mach/aic23.h
  3. *
  4. * Hardware definitions for TI TLV320AIC23 audio codec
  5. *
  6. * Copyright (C) 2002 RidgeRun, Inc.
  7. * Author: Steve Johnson
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation; either version 2 of the License, or (at your
  12. * option) any later version.
  13. *
  14. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  15. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  16. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  17. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  18. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  19. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  20. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  21. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  23. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. *
  25. * You should have received a copy of the GNU General Public License along
  26. * with this program; if not, write to the Free Software Foundation, Inc.,
  27. * 675 Mass Ave, Cambridge, MA 02139, USA.
  28. */
  29. #ifndef __ASM_ARCH_AIC23_H
  30. #define __ASM_ARCH_AIC23_H
  31. // Codec TLV320AIC23
  32. #define LEFT_LINE_VOLUME_ADDR 0x00
  33. #define RIGHT_LINE_VOLUME_ADDR 0x01
  34. #define LEFT_CHANNEL_VOLUME_ADDR 0x02
  35. #define RIGHT_CHANNEL_VOLUME_ADDR 0x03
  36. #define ANALOG_AUDIO_CONTROL_ADDR 0x04
  37. #define DIGITAL_AUDIO_CONTROL_ADDR 0x05
  38. #define POWER_DOWN_CONTROL_ADDR 0x06
  39. #define DIGITAL_AUDIO_FORMAT_ADDR 0x07
  40. #define SAMPLE_RATE_CONTROL_ADDR 0x08
  41. #define DIGITAL_INTERFACE_ACT_ADDR 0x09
  42. #define RESET_CONTROL_ADDR 0x0F
  43. // Left (right) line input volume control register
  44. #define LRS_ENABLED 0x0100
  45. #define LIM_MUTED 0x0080
  46. #define LIV_DEFAULT 0x0017
  47. #define LIV_MAX 0x001f
  48. #define LIV_MIN 0x0000
  49. // Left (right) channel headphone volume control register
  50. #define LZC_ON 0x0080
  51. #define LHV_DEFAULT 0x0079
  52. #define LHV_MAX 0x007f
  53. #define LHV_MIN 0x0000
  54. // Analog audio path control register
  55. #define STA_REG(x) ((x)<<6)
  56. #define STE_ENABLED 0x0020
  57. #define DAC_SELECTED 0x0010
  58. #define BYPASS_ON 0x0008
  59. #define INSEL_MIC 0x0004
  60. #define MICM_MUTED 0x0002
  61. #define MICB_20DB 0x0001
  62. // Digital audio path control register
  63. #define DACM_MUTE 0x0008
  64. #define DEEMP_32K 0x0002
  65. #define DEEMP_44K 0x0004
  66. #define DEEMP_48K 0x0006
  67. #define ADCHP_ON 0x0001
  68. // Power control down register
  69. #define DEVICE_POWER_OFF 0x0080
  70. #define CLK_OFF 0x0040
  71. #define OSC_OFF 0x0020
  72. #define OUT_OFF 0x0010
  73. #define DAC_OFF 0x0008
  74. #define ADC_OFF 0x0004
  75. #define MIC_OFF 0x0002
  76. #define LINE_OFF 0x0001
  77. // Digital audio interface register
  78. #define MS_MASTER 0x0040
  79. #define LRSWAP_ON 0x0020
  80. #define LRP_ON 0x0010
  81. #define IWL_16 0x0000
  82. #define IWL_20 0x0004
  83. #define IWL_24 0x0008
  84. #define IWL_32 0x000C
  85. #define FOR_I2S 0x0002
  86. #define FOR_DSP 0x0003
  87. // Sample rate control register
  88. #define CLKOUT_HALF 0x0080
  89. #define CLKIN_HALF 0x0040
  90. #define BOSR_384fs 0x0002 // BOSR_272fs when in USB mode
  91. #define USB_CLK_ON 0x0001
  92. #define SR_MASK 0xf
  93. #define CLKOUT_SHIFT 7
  94. #define CLKIN_SHIFT 6
  95. #define SR_SHIFT 2
  96. #define BOSR_SHIFT 1
  97. // Digital interface register
  98. #define ACT_ON 0x0001
  99. #define TLV320AIC23ID1 (0x1a) // cs low
  100. #define TLV320AIC23ID2 (0x1b) // cs high
  101. void aic23_power_up(void);
  102. void aic23_power_down(void);
  103. #endif /* __ASM_ARCH_AIC23_H */