diff options
author | Uk Kim <w0806.kim@samsung.com> | 2011-01-15 09:08:09 +0900 |
---|---|---|
committer | Arve Hjønnevåg <arve@android.com> | 2011-11-17 17:52:51 -0800 |
commit | d3a0fc7f77d13d04850103eabd9d7db3548a67ce (patch) | |
tree | b8a304d90ed046ea6464a9a30b856677eeb43445 /sound/soc/codecs/wm8994_samsung.c | |
parent | bb0dfdaff64373d80dfe724443e77506898cbb3b (diff) | |
download | kernel_samsung_crespo-d3a0fc7f77d13d04850103eabd9d7db3548a67ce.zip kernel_samsung_crespo-d3a0fc7f77d13d04850103eabd9d7db3548a67ce.tar.gz kernel_samsung_crespo-d3a0fc7f77d13d04850103eabd9d7db3548a67ce.tar.bz2 |
ASOC: support multi gain tables for several operator.
Change-Id: Iffc4340f37e80c446e212d656c5605687da6555d
Signed-off-by: Uk Kim <w0806.kim@samsung.com>
Diffstat (limited to 'sound/soc/codecs/wm8994_samsung.c')
-rwxr-xr-x | sound/soc/codecs/wm8994_samsung.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sound/soc/codecs/wm8994_samsung.c b/sound/soc/codecs/wm8994_samsung.c index 84e8064..74a75dd 100755 --- a/sound/soc/codecs/wm8994_samsung.c +++ b/sound/soc/codecs/wm8994_samsung.c @@ -1209,6 +1209,17 @@ struct snd_soc_dai wm8994_dai = { .ops = &wm8994_ops, }; +/* gain_code range : integer 0~3 */ +static int is_valid_gain_code(char *str) +{ + if ((*str >= 0x30) && (*str <= 0x33)) + return 1; + else { + DEBUG_LOG_ERR("gain code is invalid (%d)", *str); + return 0; + } +} + static int __init gain_code_setup(char *str) { @@ -1219,8 +1230,11 @@ static int __init gain_code_setup(char *str) return 0; } - if (!strcmp(str, "1")) - gain_code = 1; + if (is_valid_gain_code(str)) { + gain_code = *str - 0x30; + DEBUG_LOG("gain_code : %d", gain_code); + } else + DEBUG_LOG_ERR("gain code is invalid and so use default value"); return 0; } |