upload tizen1.0 source
[kernel/linux-2.6.36.git] / sound / soc / codecs / a1026.h
1 /*
2  * a1026.h -- Define field of A1026
3  *
4  * Copyright (C) 2010 Samsung Electronics Co.Ltd
5  *
6  * Author: Chanwoo Choi <cw00.choi@samsung.com>
7  *
8  *  This program is free software; you can redistribute  it and/or modify it
9  *  under  the terms of  the GNU General  Public License as published by the
10  *  Free Software Foundation;  either version 2 of the  License, or (at your
11  *  option) any later version.
12  *
13  */
14
15 #ifndef __A1026_H__
16 #define __A1026_H__
17
18 /**
19  * Msg Codes definitions
20  */
21 #define A1026_SYNC                      0x8000
22 #define A1026_RESET                     0x8002
23 #define A1026_BOOTLOAD_INIT             0x8003
24 #define A1026_GET_DEV_PARM              0x800B
25 #define A1026_SET_DEV_PARMID            0x800C
26 #define A1026_SET_DEV_PARM              0x800D
27 #define A1026_SET_POWER                 0x8010
28 #define A1026_GET_ALG_PARM              0x8016
29 #define A1026_SET_ALG_PARMID            0x8017
30 #define A1026_SET_ALG_PARM              0x8018
31 #define A1026_GET_DI_IN_GAIN            0x801A
32 #define A1026_SET_DI_IN_GAIN            0x801B
33
34
35 /**
36  * Msg Value definitions 
37  */
38 #define NOP                             0xFFFF
39 #define NOP_SIZE                        0
40
41 #define A1026_INIT                      0x0001
42
43 #define A1026_SYNC_POLLING              0x0000
44 #define A1026_SYNC_IRQ_LOW              0x0001
45 #define A1026_SYNC_IRQ_HIGH             0x0002
46 #define A1026_SYNC_IRQ_FALLING_EDGE     0x0003
47 #define A1026_SYNC_IRQ_RISING_EDGE      0x0004
48
49 #define A1026_RESET_IMMEDIATE           0x0000
50 #define A1026_RESET_DELAYED             0x0001
51
52 /* PCM0/1 */
53 #define A1026_PCM0_WORD_LEN             0x0100
54 #define A1026_PCM1_WORD_LEN             0x0200
55 #define A1026_PCM_WORD_LEN_16BIT        0x0010
56 #define A1026_PCM_WORD_LEN_24BIT        0x0018
57 #define A1026_PCM_WORD_LEN_32BIT        0x0020
58
59 #define A1026_PCM0_DELFROMFSTX          0x0101
60 #define A1026_PCM1_DELFROMFSTX          0x0201
61 #define A1026_PCM_DELFROMFSTX_MIN       0x0000
62 #define A1026_PCM_DELFROMFSTX_MAX       0x003F
63
64 #define A1026_PCM0_DELFROMFSRX          0x0102
65 #define A1026_PCM1_DELFROMFSRX          0x0202
66 #define A1026_PCM_DELFROMFSRX_MIN       0x0000
67 #define A1026_PCM_DELFROMFSRX_MAX       0x003F
68
69 #define A1026_PCM0_LATCH_EDGE           0x0103
70 #define A1026_PCM1_LATCH_EDGE           0x0203
71 #define A1026_PCM_LATCH_EDGE_TF_RR      0x0000
72 #define A1026_PCM_LATCH_EDGE_TR_RF      0x0003
73
74 #define A1026_PCM0_ENDIAN               0x0105
75 #define A1026_PCM1_ENDIAN               0x0205
76 #define A1026_PCM_ENDIAN_LITTLE         0x0000
77 #define A1026_PCM_ENDIAN_BIG            0x0001
78
79 #define A1026_PCM0_TRISTATE_EN          0x0107
80 #define A1026_PCM1_TRISTATE_EN          0x0207
81 #define A1026_PCM_TRISTATE_EN_DISABLE   0x0000
82 #define A1026_PCM_TRISTATE_EN_ENABLE    0x0001
83
84 /* ADC0/1 */
85 #define A1026_ADC0_GAIN                 0x0300
86 #define A1026_ADC1_GAIN                 0x0400
87 #define A1026_ADC_GAIN_0dB              0x0000
88 #define A1026_ADC_GAIN_6dB              0x0001
89 #define A1026_ADC_GAIN_12dB             0x0002
90 #define A1026_ADC_GAIN_18dB             0x0003
91 #define A1026_ADC_GAIN_24dB             0x0004
92 #define A1026_ADC_GAIN_30dB             0x0005
93
94
95 #define A1026_ADC0_RATE                 0x0301
96 #define A1026_ADC1_RATE                 0x0401
97 #define A1026_ADC_RATE_8KHZ             0x0000
98 #define A1026_ADC_RATE_16KHZ            0x0001
99
100 #define A1026_ADC0_CUTOFF_FREQ          0x0302
101 #define A1026_ADC1_CUTOFF_FREQ          0x0402
102 #define A1026_ADC_CUTOFF_FREQ_NO        0x0000
103 #define A1026_ADC_CUTOFF_FREQ_59HZ      0x0001
104 #define A1026_ADC_CUTOFF_FREQ_7HZ       0x0002
105 #define A1026_ADC_CUTOFF_FREQ_3HZ       0x0003
106
107 #define A1026_ADC0_INTERP_DECIM         0x0303
108 #define A1026_ADC1_INTERP_DECIM         0x0403
109 #define A1026_ADC_INTERP_DECIM_OFF      0x0000
110 #define A1026_ADC_INTERP_DECIM_ON       0x0001
111
112 #define A1026_POWER_SLEEP               0x0001
113
114 /* FIXME: I should define the fields of follwing tables:
115  * - Get/Set Algorithm Parameter ID Values"
116  */
117
118 #define A1026_DI_IN_GAIN_MAINMIC        0x0000
119 #define A1026_DI_IN_GAIN_SUBMIC         0x0001
120 #define A1026_DI_IN_GAIN_RCV            0x0002
121
122 #define A1026_DI_IN_GAIN_MAINMIC_MAX    0x001E /* +30dB */
123 #define A1026_DI_IN_GAIN_MAINMIC_MIN    0x00A6 /* -90dB */
124 #define A1026_DI_IN_GAIN_SUBMIC_MAX     0x011E /* +30dB */
125 #define A1026_DI_IN_GAIN_SUBMIC_MIN     0x01A6 /* -90dB */
126 #define A1026_DI_IN_GAIN_RCV_MAX        0x021E /* +30dB */
127 #define A1026_DI_IN_GAIN_RCV_MIN        0x02A6 /* -90dB */
128
129 /* FIXME: I should define the fields of follwing tables:
130  * - Get Digital Output Gain"
131  * - Set Digital Output Gain"
132  * - Enable/Disable Voice Processing"
133  * - Select Audio Route ID"
134  * - RouteID Table Description"
135  * - PCM0 Device Parameter ID Vlaues for Audio Routes 28 & 30"
136  * - PCM1 Device Parameter ID Vlaues for Audio Routes 28 & 30"
137  * - PCM0 Device Parameter ID Vlaues for Audio Routes 29 & 31"
138  * - PCM1 Device Parameter ID Vlaues for Audio Routes 29 & 31"
139  * - Route ID for Digital Input/Output"
140  * - Slot Select"
141  * - Select PDS Mode"
142  * - PDS Mode Description"
143  * - Get Mic RMS"
144  * - Get Mic Peak Value"
145  * - Output Known Signal"
146  */
147 #endif