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

Commit 9f7dcd45 authored by Honghao Liu's avatar Honghao Liu
Browse files

ASoC: msm: support 5 and 7 channel for TDM hw param



Add support for 5 and 7 channel for TDM hw param configuration.

CRs-fixed: 2021342
Change-Id: I933d5aa29c5c5578c884a3533772747db721fc0f
Signed-off-by: default avatarHonghao Liu <honghaol@codeaurora.org>
parent 56ba1e20
Loading
Loading
Loading
Loading
+27 −33
Original line number Diff line number Diff line
@@ -2316,13 +2316,12 @@ static int apq8096_tdm_snd_hw_params(struct snd_pcm_substream *substream,
	pr_debug("%s: dai id = 0x%x\n", __func__, cpu_dai->id);

	channels = params_channels(params);
	switch (channels) {
	case 1:
	case 2:
	case 3:
	case 4:
	case 6:
	case 8:
	if (channels < 1 || channels > 8) {
		pr_err("%s: invalid param channels %d\n",
			__func__, channels);
		return -EINVAL;
	}

	switch (params_format(params)) {
	case SNDRV_PCM_FORMAT_S32_LE:
	case SNDRV_PCM_FORMAT_S24_LE:
@@ -2339,6 +2338,7 @@ static int apq8096_tdm_snd_hw_params(struct snd_pcm_substream *substream,
			__func__, params_format(params));
		return -EINVAL;
	}

	slots = msm_tdm_num_slots;
	slot_mask = tdm_param_set_slot_mask(cpu_dai->id,
		slot_width, slots);
@@ -2347,12 +2347,6 @@ static int apq8096_tdm_snd_hw_params(struct snd_pcm_substream *substream,
			__func__, slot_mask);
		return -EINVAL;
	}
		break;
	default:
		pr_err("%s: invalid param channels %d\n",
			__func__, channels);
		return -EINVAL;
	}

	switch (cpu_dai->id) {
	case AFE_PORT_ID_SECONDARY_TDM_RX: