summaryrefslogtreecommitdiff
path: root/firmware/sound.c
diff options
context:
space:
mode:
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;