1 /******************************************************************************
10 * MT6583 FPGA LDVT Audio Driver
18 * Chipeng Chang (MTK02308)
20 *---------------------------------------------------------------------------
28 *******************************************************************************/
35 typedef signed char int8
;
39 typedef unsigned char uint8
;
47 typedef unsigned short uint16
;
55 typedef unsigned int uint32
;
59 typedef long long int64
;
63 typedef unsigned long long uint64
;
66 #define PM_MANAGER_API
67 #define AUDIO_MEMORY_SRAM
68 #define AUDIO_MEM_IOREMAP
71 // below for audio debugging
79 #define PRINTK_AUDDRV(format, args...) xlog_printk( ANDROID_LOG_VERBOSE,"Sound",format, ##args )
81 #define PRINTK_AUDDRV(format, args...)
85 #define PRINTK_AFE_REG(format, args...) xlog_printk( ANDROID_LOG_VERBOSE,"Sound",format, ##args )
87 #define PRINTK_AFE_REG(format, args...)
91 #define PRINTK_ANA_REG(format, args...) xlog_printk( ANDROID_LOG_VERBOSE,"Sound",format, ##args )
93 #define PRINTK_ANA_REG(format, args...)
97 #define PRINTK_AUD_CLK(format, args...) xlog_printk( ANDROID_LOG_VERBOSE,"Sound",format, ##args )
99 #define PRINTK_AUD_CLK(format, args...)
102 #define PRINTK_AUD_ERROR(format, args...) xlog_printk( ANDROID_LOG_VERBOSE,"Sound",format, ##args )
106 #define PRINTK_AUDDRV(format, args...) printk(format, ##args )
108 #define PRINTK_AUDDRV(format, args...)
112 #define PRINTK_AFE_REG(format, args...) printk(format, ##args )
114 #define PRINTK_AFE_REG(format, args...)
118 #define PRINTK_ANA_REG(format, args...) printk(format, ##args )
120 #define PRINTK_ANA_REG(format, args...)
124 #define PRINTK_AUD_CLK(format, args...) printk(format, ##args )
126 #define PRINTK_AUD_CLK(format, args...)
129 #define PRINTK_AUD_ERROR(format, args...) printk(format, ##args )
131 // if need assert , use AUDIO_ASSERT(true)
132 #define AUDIO_ASSERT(value) BUG_ON(false)
135 /**********************************
136 * Other Definitions *
137 **********************************/
138 #define BIT_00 0x00000001 /* ---- ---- ---- ---- ---- ---- ---- ---1 */
139 #define BIT_01 0x00000002 /* ---- ---- ---- ---- ---- ---- ---- --1- */
140 #define BIT_02 0x00000004 /* ---- ---- ---- ---- ---- ---- ---- -1-- */
141 #define BIT_03 0x00000008 /* ---- ---- ---- ---- ---- ---- ---- 1--- */
142 #define BIT_04 0x00000010 /* ---- ---- ---- ---- ---- ---- ---1 ---- */
143 #define BIT_05 0x00000020 /* ---- ---- ---- ---- ---- ---- --1- ---- */
144 #define BIT_06 0x00000040 /* ---- ---- ---- ---- ---- ---- -1-- ---- */
145 #define BIT_07 0x00000080 /* ---- ---- ---- ---- ---- ---- 1--- ---- */
146 #define BIT_08 0x00000100 /* ---- ---- ---- ---- ---- ---1 ---- ---- */
147 #define BIT_09 0x00000200 /* ---- ---- ---- ---- ---- --1- ---- ---- */
148 #define BIT_10 0x00000400 /* ---- ---- ---- ---- ---- -1-- ---- ---- */
149 #define BIT_11 0x00000800 /* ---- ---- ---- ---- ---- 1--- ---- ---- */
150 #define BIT_12 0x00001000 /* ---- ---- ---- ---- ---1 ---- ---- ---- */
151 #define BIT_13 0x00002000 /* ---- ---- ---- ---- --1- ---- ---- ---- */
152 #define BIT_14 0x00004000 /* ---- ---- ---- ---- -1-- ---- ---- ---- */
153 #define BIT_15 0x00008000 /* ---- ---- ---- ---- 1--- ---- ---- ---- */
154 #define BIT_16 0x00010000 /* ---- ---- ---- ---1 ---- ---- ---- ---- */
155 #define BIT_17 0x00020000 /* ---- ---- ---- --1- ---- ---- ---- ---- */
156 #define BIT_18 0x00040000 /* ---- ---- ---- -1-- ---- ---- ---- ---- */
157 #define BIT_19 0x00080000 /* ---- ---- ---- 1--- ---- ---- ---- ---- */
158 #define BIT_20 0x00100000 /* ---- ---- ---1 ---- ---- ---- ---- ---- */
159 #define BIT_21 0x00200000 /* ---- ---- --1- ---- ---- ---- ---- ---- */
160 #define BIT_22 0x00400000 /* ---- ---- -1-- ---- ---- ---- ---- ---- */
161 #define BIT_23 0x00800000 /* ---- ---- 1--- ---- ---- ---- ---- ---- */
162 #define BIT_24 0x01000000 /* ---- ---1 ---- ---- ---- ---- ---- ---- */
163 #define BIT_25 0x02000000 /* ---- --1- ---- ---- ---- ---- ---- ---- */
164 #define BIT_26 0x04000000 /* ---- -1-- ---- ---- ---- ---- ---- ---- */
165 #define BIT_27 0x08000000 /* ---- 1--- ---- ---- ---- ---- ---- ---- */
166 #define BIT_28 0x10000000 /* ---1 ---- ---- ---- ---- ---- ---- ---- */
167 #define BIT_29 0x20000000 /* --1- ---- ---- ---- ---- ---- ---- ---- */
168 #define BIT_30 0x40000000 /* -1-- ---- ---- ---- ---- ---- ---- ---- */
169 #define BIT_31 0x80000000 /* 1--- ---- ---- ---- ---- ---- ---- ---- */