Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cca26767 authored by Vidyakumar Athota's avatar Vidyakumar Athota
Browse files

ASoC: apq8084: Fix voice call over BTSCO wideband



Voice call over BTSCO wideband does not work because of sample rate
mismatch. Userspace sets sample rate as string which is passed to
kernel as index. So sample rate checks should be based on index in kernel.

Change-Id: Iaee4ad5f91478173034068c4f2a184981b0fd394
Signed-off-by: default avatarVidyakumar Athota <vathota@codeaurora.org>
parent b8a2a10e
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ static void param_set_mask(struct snd_pcm_hw_params *p, int n, unsigned bit)
	}
}

static const char *const auxpcm_rate_text[] = {"rate_8000", "rate_16000"};
static const char *const auxpcm_rate_text[] = {"8000", "16000"};
static const struct soc_enum apq8084_auxpcm_enum[] = {
		SOC_ENUM_SINGLE_EXT(2, auxpcm_rate_text),
};
@@ -866,13 +866,13 @@ static int msm_slim_1_rate_put(struct snd_kcontrol *kcontrol,
			       struct snd_ctl_elem_value *ucontrol)
{
	switch (ucontrol->value.integer.value[0]) {
	case 16000:
		msm_slim_1_rate = SAMPLING_RATE_16KHZ;
		break;
	case 48000:
	case 2:
		msm_slim_1_rate = SAMPLING_RATE_48KHZ;
		break;
	case 8000:
	case 1:
		msm_slim_1_rate = SAMPLING_RATE_16KHZ;
		break;
	case 0:
	default:
		msm_slim_1_rate = SAMPLING_RATE_8KHZ;
		break;