1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2011 by Tomasz Moń
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
25 #define VOLUME_MIN -630
28 extern int tenthdb2master(int db
);
31 extern void audiohw_set_headphone_vol(int vol_l
, int vol_r
);
33 extern void aic3x_switch_output(bool stereo
);
35 /* Page 0 registers */
36 #define AIC3X_PAGE_SELECT 0
37 #define AIC3X_SOFT_RESET 1
38 #define AIC3X_SMPL_RATE 2
39 #define AIC3X_PLL_REG_A 3
40 #define AIC3X_PLL_REG_B 4
41 #define AIC3X_PLL_REG_C 5
42 #define AIC3X_PLL_REG_D 6
43 #define AIC3X_DATAPATH 7
44 #define AIC3X_DATA_REG_A 8
45 #define AIC3X_DATA_REG_B 9
46 #define AIC3X_DATA_REG_C 10
47 #define AIC3X_OVERFLOW 11
49 #define AIC3X_LINE1L_LEFTADC 19
51 #define AIC3X_LINE1R_RIGHTADC 22
53 #define AIC3X_DAC_POWER 37
54 #define AIC3X_HIGH_POWER 38
56 #define AIC3X_POWER_OUT 40
58 #define AIC3X_POP_REDUCT 42
59 #define AIC3X_LEFT_VOL 43
60 #define AIC3X_RIGHT_VOL 44
62 #define AIC3X_DAC_L1_VOL 47
63 #define AIC3X_HPLOUT_LVL 51
65 #define AIC3X_HPLCOM_LVL 58
67 #define AIC3X_DAC_R1_VOL 64
68 #define AIC3X_HPROUT_LVL 65
70 #define AIC3X_DAC_L1_MONO_LOP_M_VOL 75
72 #define AIC3X_LINE2R_MONO_LOP_M_VOL 76
73 #define AIC3X_PGA_R_MONO_LOP_M_VOL 77
74 #define AIC3X_DAC_R1_MONO_LOP_M_VOL 78
76 #define AIC3X_MONO_LOP_M_LVL 79
78 #define AIC3X_DAC_L1_LEFT_LOP_M_VOL 82
80 #define AIC3X_LEFT_LOP_M_LVL 86
82 #define AIC3X_DAC_R1_RIGHT_LOP_M_VOL 92
83 #define AIC3X_RIGHT_LOP_M_LVL 93
84 #define AIC3X_MOD_POWER 94
86 #define AIC3X_GPIO1_CTRL 98