1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2011 by Amaury Pouly
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 #include "audioout-imx233.h"
26 #include "audioin-imx233.h"
28 const struct sound_settings_info audiohw_settings
[] =
30 /* i.MX233 has half dB steps */
31 [SOUND_VOLUME
] = {"dB", 0, 5, VOLUME_MIN
/ 10, VOLUME_MAX
/ 10, -25},
32 /* HAVE_SW_TONE_CONTROLS */
33 [SOUND_BASS
] = {"dB", 0, 1, -24, 24, 0},
34 [SOUND_TREBLE
] = {"dB", 0, 1, -24, 24, 0},
35 [SOUND_BALANCE
] = {"%", 0, 1,-100, 100, 0},
36 [SOUND_CHANNELS
] = {"", 0, 1, 0, 5, 0},
37 [SOUND_STEREO_WIDTH
] = {"%", 0, 5, 0, 250, 100},
39 [SOUND_LEFT_GAIN
] = {"dB", 1, 1, 0, 31, 23},
40 [SOUND_RIGHT_GAIN
] = {"dB", 1, 1, 0, 31, 23},
41 [SOUND_MIC_GAIN
] = {"dB", 1, 1, 0, 1, 0},
43 [SOUND_DEPTH_3D
] = {"%", 0, 1, 0, 15, 0},
46 int tenthdb2master(int tdb
)
48 /* Just go from tenth of dB to half to dB */
52 void audiohw_preinit(void)
54 imx233_audioout_preinit();
55 imx233_audioin_preinit();
58 void audiohw_postinit(void)
60 imx233_audioout_postinit();
61 imx233_audioin_postinit();
64 void audiohw_close(void)
66 imx233_audioout_close();
67 imx233_audioin_close();
70 void audiohw_set_headphone_vol(int vol_l
, int vol_r
)
72 /* Use playback volume if <0 and headphone volume if >0 */
73 imx233_audioout_set_dac_vol(MIN(0, vol_l
), MIN(0, vol_r
));
74 imx233_audioout_set_hp_vol(MAX(0, vol_l
), MAX(0, vol_r
));
77 void audiohw_set_frequency(int fsel
)
79 imx233_audioout_set_freq(fsel
);
82 void audiohw_set_recvol(int left
, int right
, int type
)
89 void audiohw_set_depth_3d(int val
)