From aaf6fa83960ec02e6e6cece1eeae2f5c37ffad8c Mon Sep 17 00:00:00 2001 From: Alexy Joseph Date: Mon, 27 Jul 2020 10:08:08 -0700 Subject: [PATCH] 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 --- asoc/sa6155.c | 14 +++++++++++++- asoc/sa8155.c | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/asoc/sa6155.c b/asoc/sa6155.c index 0aab88387b55..8176977c7014 100644 --- a/asoc/sa6155.c +++ b/asoc/sa6155.c @@ -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; diff --git a/asoc/sa8155.c b/asoc/sa8155.c index 5a672c867a99..3553509144fa 100644 --- a/asoc/sa8155.c +++ b/asoc/sa8155.c @@ -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;