nuc900-audio.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * Copyright (c) 2010 Nuvoton technology corporation.
  3. *
  4. * Wan ZongShun <mcuos.com@gmail.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation;version 2 of the License.
  9. *
  10. */
  11. #ifndef _NUC900_AUDIO_H
  12. #define _NUC900_AUDIO_H
  13. #include <linux/io.h>
  14. /* Audio Control Registers */
  15. #define ACTL_CON 0x00
  16. #define ACTL_RESET 0x04
  17. #define ACTL_RDSTB 0x08
  18. #define ACTL_RDST_LENGTH 0x0C
  19. #define ACTL_RDSTC 0x10
  20. #define ACTL_RSR 0x14
  21. #define ACTL_PDSTB 0x18
  22. #define ACTL_PDST_LENGTH 0x1C
  23. #define ACTL_PDSTC 0x20
  24. #define ACTL_PSR 0x24
  25. #define ACTL_IISCON 0x28
  26. #define ACTL_ACCON 0x2C
  27. #define ACTL_ACOS0 0x30
  28. #define ACTL_ACOS1 0x34
  29. #define ACTL_ACOS2 0x38
  30. #define ACTL_ACIS0 0x3C
  31. #define ACTL_ACIS1 0x40
  32. #define ACTL_ACIS2 0x44
  33. #define ACTL_COUNTER 0x48
  34. /* bit definition of REG_ACTL_CON register */
  35. #define R_DMA_IRQ 0x1000
  36. #define T_DMA_IRQ 0x0800
  37. #define IIS_AC_PIN_SEL 0x0100
  38. #define FIFO_TH 0x0080
  39. #define ADC_EN 0x0010
  40. #define M80_EN 0x0008
  41. #define ACLINK_EN 0x0004
  42. #define IIS_EN 0x0002
  43. /* bit definition of REG_ACTL_RESET register */
  44. #define W5691_PLAY 0x20000
  45. #define ACTL_RESET_BIT 0x10000
  46. #define RECORD_RIGHT_CHNNEL 0x08000
  47. #define RECORD_LEFT_CHNNEL 0x04000
  48. #define PLAY_RIGHT_CHNNEL 0x02000
  49. #define PLAY_LEFT_CHNNEL 0x01000
  50. #define DAC_PLAY 0x00800
  51. #define ADC_RECORD 0x00400
  52. #define M80_PLAY 0x00200
  53. #define AC_RECORD 0x00100
  54. #define AC_PLAY 0x00080
  55. #define IIS_RECORD 0x00040
  56. #define IIS_PLAY 0x00020
  57. #define DAC_RESET 0x00010
  58. #define ADC_RESET 0x00008
  59. #define M80_RESET 0x00004
  60. #define AC_RESET 0x00002
  61. #define IIS_RESET 0x00001
  62. /* bit definition of REG_ACTL_ACCON register */
  63. #define AC_BCLK_PU_EN 0x20
  64. #define AC_R_FINISH 0x10
  65. #define AC_W_FINISH 0x08
  66. #define AC_W_RES 0x04
  67. #define AC_C_RES 0x02
  68. /* bit definition of ACTL_RSR register */
  69. #define R_FIFO_EMPTY 0x04
  70. #define R_DMA_END_IRQ 0x02
  71. #define R_DMA_MIDDLE_IRQ 0x01
  72. /* bit definition of ACTL_PSR register */
  73. #define P_FIFO_EMPTY 0x04
  74. #define P_DMA_END_IRQ 0x02
  75. #define P_DMA_MIDDLE_IRQ 0x01
  76. /* bit definition of ACTL_ACOS0 register */
  77. #define SLOT1_VALID 0x01
  78. #define SLOT2_VALID 0x02
  79. #define SLOT3_VALID 0x04
  80. #define SLOT4_VALID 0x08
  81. #define VALID_FRAME 0x10
  82. /* bit definition of ACTL_ACOS1 register */
  83. #define R_WB 0x80
  84. #define CODEC_READY 0x10
  85. #define RESET_PRSR 0x00
  86. #define AUDIO_WRITE(addr, val) __raw_writel(val, addr)
  87. #define AUDIO_READ(addr) __raw_readl(addr)
  88. struct nuc900_audio {
  89. void __iomem *mmio;
  90. spinlock_t lock;
  91. unsigned long irq_num;
  92. struct resource *res;
  93. struct clk *clk;
  94. struct device *dev;
  95. };
  96. extern struct nuc900_audio *nuc900_ac97_data;
  97. #endif /*end _NUC900_AUDIO_H */