summaryrefslogtreecommitdiff
path: root/firmware/sound.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2006-07-21 08:42:28 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2006-07-21 08:42:28 +0000
commited4d7a33bdeba5ce11512ee617398a2840797203 (patch)
tree1027077148ace8e13c8fa49ae3794b2038a2d67a /firmware/sound.c
parente8818efbe9c814ad3b46ee0e5d0ae250b7c96cf4 (diff)
downloadrockbox-ed4d7a33bdeba5ce11512ee617398a2840797203.tar.gz
rockbox-ed4d7a33bdeba5ce11512ee617398a2840797203.zip
Patch #5347 by Rani Hod - Adds FM radio and recording features to the iAudio X5.
Also includes a rewrite of the Coldfire I2C driver to include both read and write. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10272 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/sound.c')
-rw-r--r--firmware/sound.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/firmware/sound.c b/firmware/sound.c
index 057cfc0995..5e4cd5db48 100644
--- a/firmware/sound.c
+++ b/firmware/sound.c
@@ -111,7 +111,11 @@ static const struct sound_settings_info sound_settings_table[] = {
111 [SOUND_LEFT_GAIN] = {"dB", 1, 1,-128, 96, 0, NULL}, 111 [SOUND_LEFT_GAIN] = {"dB", 1, 1,-128, 96, 0, NULL},
112 [SOUND_RIGHT_GAIN] = {"dB", 1, 1,-128, 96, 0, NULL}, 112 [SOUND_RIGHT_GAIN] = {"dB", 1, 1,-128, 96, 0, NULL},
113 [SOUND_MIC_GAIN] = {"dB", 1, 1,-128, 108, 16, NULL}, 113 [SOUND_MIC_GAIN] = {"dB", 1, 1,-128, 108, 16, NULL},
114#endif 114#elif defined(HAVE_TLV320)
115 [SOUND_LEFT_GAIN] = {"dB", 1, 1, 0, 31, 23, NULL},
116 [SOUND_RIGHT_GAIN] = {"dB", 1, 1, 0, 31, 23, NULL},
117 [SOUND_MIC_GAIN] = {"dB", 1, 1, 0, 1, 1, NULL},
118 #endif
115}; 119};
116 120
117const char *sound_unit(int setting) 121const char *sound_unit(int setting)
@@ -901,6 +905,25 @@ int sound_val2phys(int setting, int value)
901 break; 905 break;
902 } 906 }
903 return result; 907 return result;
908#elif defined(HAVE_TLV320)
909 int result = 0;
910
911 switch(setting)
912 {
913 case SOUND_LEFT_GAIN:
914 case SOUND_RIGHT_GAIN:
915 result = (value - 23) * 15; /* (x - 23)/1.5 *10 */
916 break;
917
918 case SOUND_MIC_GAIN:
919 result = value * 200; /* 0 or 20 dB */
920 break;
921
922 default:
923 result = value;
924 break;
925 }
926 return result;
904#else 927#else
905 (void)setting; 928 (void)setting;
906 return value; 929 return value;