summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-06-18 16:09:07 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-06-18 16:09:07 +0200
commitd8368d58b0bd073ef6bed6a7b7d51c671b8ea4ae (patch)
treeefde4bae3aa10379e8f489a0026602dea8c27ed1
parent7fb0b893f9b6d167d4849e90fa923e76a68d72ce (diff)
downloadrockbox-d8368d58b0bd073ef6bed6a7b7d51c671b8ea4ae.tar.gz
rockbox-d8368d58b0bd073ef6bed6a7b7d51c671b8ea4ae.zip
imx233: add recording side and 3d to codec driver
Change-Id: I3587434749c401a28c6e77bd30395e7df15f2e8a
-rw-r--r--firmware/drivers/audio/imx233-codec.c35
-rw-r--r--firmware/export/imx233-codec.h3
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
56void 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
63void audiohw_disable_recording(void)
64{
65 imx233_audioin_close();
66}
67
56void audiohw_set_recvol(int left, int right, int type) 68void 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
63void audiohw_set_depth_3d(int val) 83void 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
90void 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)
37AUDIOHW_SETTING(RIGHT_GAIN, "dB", 1, 1, 0, 31, 23) 37AUDIOHW_SETTING(RIGHT_GAIN, "dB", 1, 1, 0, 31, 23)
38AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1, 0, 1, 1) 38AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1, 0, 1, 1)
39#endif /* HAVE_RECORDING */ 39#endif /* HAVE_RECORDING */
40AUDIOHW_SETTING(DEPTH_3D, "%", 0, 1, 0, 15, 0) 40/* i.MX233 has four settings: 0dB, 3dB, 4.5dB, 6dB so fake 1.5dB steps */
41AUDIOHW_SETTING(DEPTH_3D, "dB", 1, 15, 0, 60, 0)
41 42
42#endif /* __IMX233_CODEC_H_ */ 43#endif /* __IMX233_CODEC_H_ */