2011-09-13 23:40:12 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2011 by Amaury Pouly
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
#include "config.h"
|
|
|
|
#include "system.h"
|
|
|
|
#include "audiohw.h"
|
|
|
|
#include "audio.h"
|
2011-10-18 22:08:41 +00:00
|
|
|
#include "audioout-imx233.h"
|
|
|
|
#include "audioin-imx233.h"
|
2011-09-13 23:40:12 +00:00
|
|
|
|
|
|
|
const struct sound_settings_info audiohw_settings[] =
|
|
|
|
{
|
2011-10-18 22:08:41 +00:00
|
|
|
/* i.MX233 has half dB steps */
|
|
|
|
[SOUND_VOLUME] = {"dB", 0, 5, VOLUME_MIN / 10, VOLUME_MAX / 10, -25},
|
|
|
|
/* HAVE_SW_TONE_CONTROLS */
|
|
|
|
[SOUND_BASS] = {"dB", 0, 1, -24, 24, 0},
|
|
|
|
[SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0},
|
2011-09-13 23:40:12 +00:00
|
|
|
[SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0},
|
|
|
|
[SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0},
|
|
|
|
[SOUND_STEREO_WIDTH] = {"%", 0, 5, 0, 250, 100},
|
2011-10-18 22:08:41 +00:00
|
|
|
#ifdef HAVE_RECORDING
|
2011-09-13 23:40:12 +00:00
|
|
|
[SOUND_LEFT_GAIN] = {"dB", 1, 1, 0, 31, 23},
|
|
|
|
[SOUND_RIGHT_GAIN] = {"dB", 1, 1, 0, 31, 23},
|
|
|
|
[SOUND_MIC_GAIN] = {"dB", 1, 1, 0, 1, 0},
|
2011-10-18 22:08:41 +00:00
|
|
|
#endif
|
2011-10-08 12:29:37 +00:00
|
|
|
[SOUND_DEPTH_3D] = {"%", 0, 1, 0, 15, 0},
|
2011-09-13 23:40:12 +00:00
|
|
|
};
|
|
|
|
|
2011-10-18 22:08:41 +00:00
|
|
|
int tenthdb2master(int tdb)
|
2011-09-13 23:40:12 +00:00
|
|
|
{
|
2011-10-18 22:08:41 +00:00
|
|
|
/* Just go from tenth of dB to half to dB */
|
|
|
|
return tdb / 5;
|
2011-09-13 23:40:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void audiohw_preinit(void)
|
|
|
|
{
|
2011-10-18 22:08:41 +00:00
|
|
|
imx233_audioout_preinit();
|
|
|
|
imx233_audioin_preinit();
|
2011-09-13 23:40:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void audiohw_postinit(void)
|
|
|
|
{
|
2011-10-18 22:08:41 +00:00
|
|
|
imx233_audioout_postinit();
|
|
|
|
imx233_audioin_postinit();
|
2011-09-13 23:40:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void audiohw_close(void)
|
|
|
|
{
|
2011-10-18 22:08:41 +00:00
|
|
|
imx233_audioout_close();
|
|
|
|
imx233_audioin_close();
|
|
|
|
}
|
|
|
|
|
|
|
|
void audiohw_set_headphone_vol(int vol_l, int vol_r)
|
|
|
|
{
|
2012-02-03 18:58:25 +00:00
|
|
|
imx233_audioout_set_hp_vol(vol_l, vol_r);
|
2011-10-18 22:08:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void audiohw_set_frequency(int fsel)
|
|
|
|
{
|
|
|
|
imx233_audioout_set_freq(fsel);
|
2011-09-13 23:40:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void audiohw_set_recvol(int left, int right, int type)
|
|
|
|
{
|
|
|
|
(void) left;
|
|
|
|
(void) right;
|
|
|
|
(void) type;
|
|
|
|
}
|
2011-10-08 12:29:37 +00:00
|
|
|
|
|
|
|
void audiohw_set_depth_3d(int val)
|
|
|
|
{
|
|
|
|
(void) val;
|
|
|
|
}
|