diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-06-18 16:09:07 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-06-18 16:09:07 +0200 |
commit | d8368d58b0bd073ef6bed6a7b7d51c671b8ea4ae (patch) | |
tree | efde4bae3aa10379e8f489a0026602dea8c27ed1 /firmware/drivers/audio | |
parent | 7fb0b893f9b6d167d4849e90fa923e76a68d72ce (diff) |
imx233: add recording side and 3d to codec driver
Change-Id: I3587434749c401a28c6e77bd30395e7df15f2e8a
Diffstat (limited to 'firmware/drivers/audio')
-rw-r--r-- | firmware/drivers/audio/imx233-codec.c | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/firmware/drivers/audio/imx233-codec.c b/firmware/drivers/audio/imx233-codec.c index f808a73fae..512bab6280 100644 --- a/firmware/drivers/audio/imx233-codec.c +++ b/firmware/drivers/audio/imx233-codec.c @@ -53,14 +53,41 @@ void audiohw_set_frequency(int fsel) imx233_audioout_set_freq(fsel); } +void audiohw_enable_recording(bool source_mic) +{ + imx233_audioin_open(); + /* if source is microhpone we need to power the microphone too */ + imx233_audioin_enable_mic(source_mic); +} + +void audiohw_disable_recording(void) +{ + imx233_audioin_close(); +} + void audiohw_set_recvol(int left, int right, int type) { - (void) left; - (void) right; - (void) type; + if(type == AUDIO_GAIN_LINEIN) + { + imx233_audioin_set_vol(false, left, AUDIOIN_SELECT_LINE1); + imx233_audioin_set_vol(true, right, AUDIOIN_SELECT_LINE1); + imx233_audioin_set_vol(false, left, AUDIOIN_SELECT_LINE2); + imx233_audioin_set_vol(true, right, AUDIOIN_SELECT_LINE2); + imx233_audioin_set_vol(false, left, AUDIOIN_SELECT_HEADPHONE); + imx233_audioin_set_vol(true, right, AUDIOIN_SELECT_HEADPHONE); + } + else + imx233_audioin_set_vol(false, left, AUDIOIN_SELECT_MICROPHONE); } void audiohw_set_depth_3d(int val) { - (void) val; + /* input is raw value ranging from 0dB to 6dB in tenth of dB + * convert to value in 1.5dB steps */ + imx233_audioout_set_3d_effect(val / 15); +} + +void audiohw_set_monitor(bool enable) +{ + imx233_audioout_select_hp_input(enable); } |