Commit | Line | Data |
---|---|---|
1274738d BS |
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 | ||
29 | #ifndef __AD1938_H__ | |
30 | #define __AD1938_H__ | |
31 | ||
32 | #define AD1938_PLL_CLK_CTRL0 0 | |
33 | #define AD1938_PLL_POWERDOWN 0x01 | |
34 | #define AD1938_PLL_CLK_CTRL1 1 | |
35 | #define AD1938_DAC_CTRL0 2 | |
36 | #define AD1938_DAC_POWERDOWN 0x01 | |
37 | #define AD1938_DAC_SERFMT_MASK 0xC0 | |
38 | #define AD1938_DAC_SERFMT_STEREO (0 << 6) | |
39 | #define AD1938_DAC_SERFMT_TDM (1 << 6) | |
40 | #define AD1938_DAC_CTRL1 3 | |
41 | #define AD1938_DAC_2_CHANNELS 0 | |
42 | #define AD1938_DAC_4_CHANNELS 1 | |
43 | #define AD1938_DAC_8_CHANNELS 2 | |
44 | #define AD1938_DAC_16_CHANNELS 3 | |
45 | #define AD1938_DAC_CHAN_SHFT 1 | |
46 | #define AD1938_DAC_CHAN_MASK (3 << AD1938_DAC_CHAN_SHFT) | |
47 | #define AD1938_DAC_LCR_MASTER (1 << 4) | |
48 | #define AD1938_DAC_BCLK_MASTER (1 << 5) | |
49 | #define AD1938_DAC_LEFT_HIGH (1 << 3) | |
50 | #define AD1938_DAC_BCLK_INV (1 << 7) | |
51 | #define AD1938_DAC_CTRL2 4 | |
52 | #define AD1938_DAC_WORD_LEN_MASK 0xC | |
53 | #define AD1938_DAC_MASTER_MUTE 1 | |
54 | #define AD1938_DAC_CHNL_MUTE 5 | |
55 | #define AD1938_DACL1_MUTE 0 | |
56 | #define AD1938_DACR1_MUTE 1 | |
57 | #define AD1938_DACL2_MUTE 2 | |
58 | #define AD1938_DACR2_MUTE 3 | |
59 | #define AD1938_DACL3_MUTE 4 | |
60 | #define AD1938_DACR3_MUTE 5 | |
61 | #define AD1938_DACL4_MUTE 6 | |
62 | #define AD1938_DACR4_MUTE 7 | |
63 | #define AD1938_DAC_L1_VOL 6 | |
64 | #define AD1938_DAC_R1_VOL 7 | |
65 | #define AD1938_DAC_L2_VOL 8 | |
66 | #define AD1938_DAC_R2_VOL 9 | |
67 | #define AD1938_DAC_L3_VOL 10 | |
68 | #define AD1938_DAC_R3_VOL 11 | |
69 | #define AD1938_DAC_L4_VOL 12 | |
70 | #define AD1938_DAC_R4_VOL 13 | |
71 | #define AD1938_ADC_CTRL0 14 | |
72 | #define AD1938_ADC_POWERDOWN 0x01 | |
73 | #define AD1938_ADC_HIGHPASS_FILTER 1 | |
74 | #define AD1938_ADCL1_MUTE 2 | |
75 | #define AD1938_ADCR1_MUTE 3 | |
76 | #define AD1938_ADCL2_MUTE 4 | |
77 | #define AD1938_ADCR2_MUTE 5 | |
78 | #define AD1938_ADC_CTRL1 15 | |
79 | #define AD1938_ADC_SERFMT_MASK 0x60 | |
80 | #define AD1938_ADC_SERFMT_STEREO (0 << 5) | |
81 | #define AD1938_ADC_SERFMT_TDM (1 << 2) | |
82 | #define AD1938_ADC_SERFMT_AUX (2 << 5) | |
83 | #define AD1938_ADC_WORD_LEN_MASK 0x3 | |
84 | #define AD1938_ADC_CTRL2 16 | |
85 | #define AD1938_ADC_2_CHANNELS 0 | |
86 | #define AD1938_ADC_4_CHANNELS 1 | |
87 | #define AD1938_ADC_8_CHANNELS 2 | |
88 | #define AD1938_ADC_16_CHANNELS 3 | |
89 | #define AD1938_ADC_CHAN_SHFT 4 | |
90 | #define AD1938_ADC_CHAN_MASK (3 << AD1938_ADC_CHAN_SHFT) | |
91 | #define AD1938_ADC_LCR_MASTER (1 << 3) | |
92 | #define AD1938_ADC_BCLK_MASTER (1 << 6) | |
93 | #define AD1938_ADC_LEFT_HIGH (1 << 2) | |
94 | #define AD1938_ADC_BCLK_INV (1 << 1) | |
95 | ||
96 | #define AD1938_NUM_REGS 17 | |
97 | ||
98 | extern struct snd_soc_dai ad1938_dai; | |
99 | extern struct snd_soc_codec_device soc_codec_dev_ad1938; | |
100 | #endif |