diff options
-rw-r--r-- | firmware/drivers/audio/imx233-codec.c | 35 | ||||
-rw-r--r-- | firmware/export/imx233-codec.h | 3 |
2 files changed, 33 insertions, 5 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 | } |
diff --git a/firmware/export/imx233-codec.h b/firmware/export/imx233-codec.h index a02ef22fec..2bd6cba5de 100644 --- a/firmware/export/imx233-codec.h +++ b/firmware/export/imx233-codec.h | |||
@@ -37,6 +37,7 @@ AUDIOHW_SETTING(LEFT_GAIN, "dB", 1, 1, 0, 31, 23) | |||
37 | AUDIOHW_SETTING(RIGHT_GAIN, "dB", 1, 1, 0, 31, 23) | 37 | AUDIOHW_SETTING(RIGHT_GAIN, "dB", 1, 1, 0, 31, 23) |
38 | AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1, 0, 1, 1) | 38 | AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1, 0, 1, 1) |
39 | #endif /* HAVE_RECORDING */ | 39 | #endif /* HAVE_RECORDING */ |
40 | AUDIOHW_SETTING(DEPTH_3D, "%", 0, 1, 0, 15, 0) | 40 | /* i.MX233 has four settings: 0dB, 3dB, 4.5dB, 6dB so fake 1.5dB steps */ |
41 | AUDIOHW_SETTING(DEPTH_3D, "dB", 1, 15, 0, 60, 0) | ||
41 | 42 | ||
42 | #endif /* __IMX233_CODEC_H_ */ | 43 | #endif /* __IMX233_CODEC_H_ */ |