2 * Copyright 2005 Openedhand Ltd.
4 * Author: Richard Purdie <richard@openedhand.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
17 #define CONFIG_HHTECH_MINIPMP 1
19 /* ES8323 register space */
21 #define ES8323_CONTROL1 0x00
22 #define ES8323_CONTROL2 0x01
23 #define ES8323_CHIPPOWER 0x02
24 #define ES8323_ADCPOWER 0x03
25 #define ES8323_DACPOWER 0x04
26 #define ES8323_CHIPLOPOW1 0x05
27 #define ES8323_CHIPLOPOW2 0x06
28 #define ES8323_ANAVOLMANAG 0x07
29 #define ES8323_MASTERMODE 0x08
30 #define ES8323_ADCCONTROL1 0x09
31 #define ES8323_ADCCONTROL2 0x0a
32 #define ES8323_ADCCONTROL3 0x0b
33 #define ES8323_ADCCONTROL4 0x0c
34 #define ES8323_ADCCONTROL5 0x0d
35 #define ES8323_ADCCONTROL6 0x0e
36 #define ES8323_ADCCONTROL7 0x0f
37 #define ES8323_ADCCONTROL8 0x10
38 #define ES8323_ADCCONTROL9 0x11
39 #define ES8323_ADCCONTROL10 0x12
40 #define ES8323_ADCCONTROL11 0x13
41 #define ES8323_ADCCONTROL12 0x14
42 #define ES8323_ADCCONTROL13 0x15
43 #define ES8323_ADCCONTROL14 0x16
45 #define ES8323_DACCONTROL1 0x17
46 #define ES8323_DACCONTROL2 0x18
47 #define ES8323_DACCONTROL3 0x19
48 #define ES8323_DACCONTROL4 0x1a
49 #define ES8323_DACCONTROL5 0x1b
50 #define ES8323_DACCONTROL6 0x1c
51 #define ES8323_DACCONTROL7 0x1d
52 #define ES8323_DACCONTROL8 0x1e
53 #define ES8323_DACCONTROL9 0x1f
54 #define ES8323_DACCONTROL10 0x20
55 #define ES8323_DACCONTROL11 0x21
56 #define ES8323_DACCONTROL12 0x22
57 #define ES8323_DACCONTROL13 0x23
58 #define ES8323_DACCONTROL14 0x24
59 #define ES8323_DACCONTROL15 0x25
60 #define ES8323_DACCONTROL16 0x26
61 #define ES8323_DACCONTROL17 0x27
62 #define ES8323_DACCONTROL18 0x28
63 #define ES8323_DACCONTROL19 0x29
64 #define ES8323_DACCONTROL20 0x2a
65 #define ES8323_DACCONTROL21 0x2b
66 #define ES8323_DACCONTROL22 0x2c
67 #define ES8323_DACCONTROL23 0x2d
68 #define ES8323_DACCONTROL24 0x2e
69 #define ES8323_DACCONTROL25 0x2f
70 #define ES8323_DACCONTROL26 0x30
71 #define ES8323_DACCONTROL27 0x31
72 #define ES8323_DACCONTROL28 0x32
73 #define ES8323_DACCONTROL29 0x33
74 #define ES8323_DACCONTROL30 0x34
76 #define ES8323_LADC_VOL ES8323_ADCCONTROL8
77 #define ES8323_RADC_VOL ES8323_ADCCONTROL9
79 #define ES8323_LDAC_VOL ES8323_DACCONTROL4
80 #define ES8323_RDAC_VOL ES8323_DACCONTROL5
82 #define ES8323_LOUT1_VOL ES8323_DACCONTROL24
83 #define ES8323_ROUT1_VOL ES8323_DACCONTROL25
84 #define ES8323_LOUT2_VOL ES8323_DACCONTROL26
85 #define ES8323_ROUT2_VOL ES8323_DACCONTROL27
87 #define ES8323_ADC_MUTE ES8323_ADCCONTROL7
88 #define ES8323_DAC_MUTE ES8323_DACCONTROL3
92 #define ES8323_IFACE ES8323_MASTERMODE
94 #define ES8323_ADC_IFACE ES8323_ADCCONTROL4
95 #define ES8323_ADC_SRATE ES8323_ADCCONTROL5
97 #define ES8323_DAC_IFACE ES8323_DACCONTROL1
98 #define ES8323_DAC_SRATE ES8323_DACCONTROL2
102 #define ES8323_CACHEREGNUM 53
103 #define ES8323_SYSCLK 0
105 struct es8323_setup_data {
107 unsigned short i2c_address;
111 #define ES8323_PLL1 0
112 #define ES8323_PLL2 1
115 #define ES8323_MCLK 0
116 #define ES8323_PCMCLK 1
118 /* clock divider id's */
119 #define ES8323_PCMDIV 0
120 #define ES8323_BCLKDIV 1
121 #define ES8323_VXCLKDIV 2
123 /* PCM clock dividers */
124 #define ES8323_PCM_DIV_1 (0 << 6)
125 #define ES8323_PCM_DIV_3 (2 << 6)
126 #define ES8323_PCM_DIV_5_5 (3 << 6)
127 #define ES8323_PCM_DIV_2 (4 << 6)
128 #define ES8323_PCM_DIV_4 (5 << 6)
129 #define ES8323_PCM_DIV_6 (6 << 6)
130 #define ES8323_PCM_DIV_8 (7 << 6)
132 /* BCLK clock dividers */
133 #define ES8323_BCLK_DIV_1 (0 << 7)
134 #define ES8323_BCLK_DIV_2 (1 << 7)
135 #define ES8323_BCLK_DIV_4 (2 << 7)
136 #define ES8323_BCLK_DIV_8 (3 << 7)
138 /* VXCLK clock dividers */
139 #define ES8323_VXCLK_DIV_1 (0 << 6)
140 #define ES8323_VXCLK_DIV_2 (1 << 6)
141 #define ES8323_VXCLK_DIV_4 (2 << 6)
142 #define ES8323_VXCLK_DIV_8 (3 << 6)
143 #define ES8323_VXCLK_DIV_16 (4 << 6)
145 #define ES8323_DAI_HIFI 0
146 #define ES8323_DAI_VOICE 1
148 #define ES8323_1536FS 1536
149 #define ES8323_1024FS 1024
150 #define ES8323_768FS 768
151 #define ES8323_512FS 512
152 #define ES8323_384FS 384
153 #define ES8323_256FS 256
154 #define ES8323_128FS 128