ASoC: msm: Add 44.1Khz and 96 Khz sample rate support for tdm group device

Update tdm sample rate text and sample rate value/index mapping
functions to support 44.1Khz and 96 Khz rates

Change-Id: I72106dd342c7da84ad9c21674cacbfca680a7ba8
Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
This commit is contained in:
Alexy Joseph 2020-07-27 10:08:08 -07:00 • committed by Gerrit - the friendly Code Review server
commit aaf6fa8396
2 changed files with 26 additions and 2 deletions

View file

@ -627,7 +627,7 @@ static char const *tdm_ch_text[] = {
static char const *tdm_bit_format_text[] = {"S16_LE", "S24_LE", "S32_LE"};
static char const *tdm_sample_rate_text[] = {"KHZ_8", "KHZ_16", "KHZ_32",
"KHZ_48", "KHZ_176P4",
"KHZ_352P8"};
"KHZ_352P8", "KHZ_44P1", "KHZ_96"};
static const char *const tdm_slot_num_text[] = {"One", "Two", "Four",
"Eight", "Sixteen", "ThirtyTwo"};
static const char *const tdm_slot_width_text[] = {"16", "24", "32"};
@ -1334,6 +1334,12 @@ static int tdm_get_sample_rate(int value)
case 5:
sample_rate = SAMPLING_RATE_352P8KHZ;
break;
case 6:
sample_rate = SAMPLING_RATE_44P1KHZ:
break;
case 7:
sample_rate = SAMPLING_RATE_96KHZ;
break;
default:
sample_rate = SAMPLING_RATE_48KHZ;
break;
@ -1380,6 +1386,12 @@ static int tdm_get_sample_rate_val(int sample_rate)
case SAMPLING_RATE_352P8KHZ:
sample_rate_val = 5;
break;
case SAMPLING_RATE_44P1KHZ:
sample_rate_val = 6;
break;
case SAMPLING_RATE_96KHZ:
sample_rate_val = 7;
break;
default:
sample_rate_val = 3;
break;

View file

@ -631,7 +631,7 @@ static char const *tdm_ch_text[] = {
static char const *tdm_bit_format_text[] = {"S16_LE", "S24_LE", "S32_LE"};
static char const *tdm_sample_rate_text[] = {"KHZ_8", "KHZ_16", "KHZ_32",
"KHZ_48", "KHZ_176P4",
"KHZ_352P8"};
"KHZ_352P8", "KHZ_44P1", "KHZ_96"};
static const char *const tdm_slot_num_text[] = {"One", "Two", "Four",
"Eight", "Sixteen", "ThirtyTwo"};
static const char *const tdm_slot_width_text[] = {"16", "24", "32"};
@ -1338,6 +1338,12 @@ static int tdm_get_sample_rate(int value)
case 5:
sample_rate = SAMPLING_RATE_352P8KHZ;
break;
case 6:
sample_rate = SAMPLING_RATE_44P1KHZ;
break;
case 7:
sample_rate = SAMPLING_RATE_96KHZ;
break;
default:
sample_rate = SAMPLING_RATE_48KHZ;
break;
@ -1384,6 +1390,12 @@ static int tdm_get_sample_rate_val(int sample_rate)
case SAMPLING_RATE_352P8KHZ:
sample_rate_val = 5;
break;
case SAMPLING_RATE_44P1KHZ:
sample_rate_val = 6;
break;
case SAMPLING_RATE_96KHZ:
sample_rate_val = 7;
break;
default:
sample_rate_val = 3;
break;