diff options
Diffstat (limited to 'firmware/drivers/audio/imx233-codec.c')
-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) | |||
53 | imx233_audioout_set_freq(fsel); | 53 | imx233_audioout_set_freq(fsel); |
54 | } | 54 | } |
55 | 55 | ||
56 | void audiohw_enable_recording(bool source_mic) | ||
57 | { | ||
58 | imx233_audioin_open(); | ||
59 | /* if source is microhpone we need to power the microphone too */ | ||
60 | imx233_audioin_enable_mic(source_mic); | ||
61 | } | ||
62 | |||
63 | void audiohw_disable_recording(void) | ||
64 | { | ||
65 | imx233_audioin_close(); | ||
66 | } | ||
67 | |||
56 | void audiohw_set_recvol(int left, int right, int type) | 68 | void audiohw_set_recvol(int left, int right, int type) |
57 | { | 69 | { |
58 | (void) left; | 70 | if(type == AUDIO_GAIN_LINEIN) |
59 | (void) right; | 71 | { |
60 | (void) type; | 72 | imx233_audioin_set_vol(false, left, AUDIOIN_SELECT_LINE1); |
73 | imx233_audioin_set_vol(true, right, AUDIOIN_SELECT_LINE1); | ||
74 | imx233_audioin_set_vol(false, left, AUDIOIN_SELECT_LINE2); | ||
75 | imx233_audioin_set_vol(true, right, AUDIOIN_SELECT_LINE2); | ||
76 | imx233_audioin_set_vol(false, left, AUDIOIN_SELECT_HEADPHONE); | ||
77 | imx233_audioin_set_vol(true, right, AUDIOIN_SELECT_HEADPHONE); | ||
78 | } | ||
79 | else | ||
80 | imx233_audioin_set_vol(false, left, AUDIOIN_SELECT_MICROPHONE); | ||
61 | } | 81 | } |
62 | 82 | ||
63 | void audiohw_set_depth_3d(int val) | 83 | void audiohw_set_depth_3d(int val) |
64 | { | 84 | { |
65 | (void) val; | 85 | /* input is raw value ranging from 0dB to 6dB in tenth of dB |
86 | * convert to value in 1.5dB steps */ | ||
87 | imx233_audioout_set_3d_effect(val / 15); | ||
88 | } | ||
89 | |||
90 | void audiohw_set_monitor(bool enable) | ||
91 | { | ||
92 | imx233_audioout_select_hp_input(enable); | ||
66 | } | 93 | } |