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

Commit 3973929b authored by Dhanalakshmi Siddani's avatar Dhanalakshmi Siddani
Browse files

asoc: Update max channels for TDM ports



Update max channels supported for TDM ports from 8 to 16.
Update pcm driver to support 32 channels and 32bit format.

Change-Id: I3d3b42983fff22e0102b9eb2aaca1a5698820605
Signed-off-by: default avatarDhanalakshmi Siddani <dsiddani@codeaurora.org>
parent 77b2a511
Loading
Loading
Loading
Loading
+94 −90
Original line number Diff line number Diff line
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1510,12 +1510,18 @@ static int msm_dai_q6_prepare(struct snd_pcm_substream *substream,
		if (dai_data->enc_config.format != ENC_FMT_NONE) {
			int bitwidth = 0;

			if (dai_data->afe_in_bitformat ==
			    SNDRV_PCM_FORMAT_S24_LE)
			switch (dai_data->afe_in_bitformat) {
			case SNDRV_PCM_FORMAT_S32_LE:
				bitwidth = 32;
				break;
			case SNDRV_PCM_FORMAT_S24_LE:
				bitwidth = 24;
			else if (dai_data->afe_in_bitformat ==
				 SNDRV_PCM_FORMAT_S16_LE)
				break;
			case SNDRV_PCM_FORMAT_S16_LE:
			default:
				bitwidth = 16;
				break;
			}
			pr_debug("%s: calling AFE_PORT_START_V2 with enc_format: %d\n",
				 __func__, dai_data->enc_config.format);
			rc = afe_port_start_v2(dai->id, &dai_data->port_config,
@@ -2337,6 +2343,9 @@ static int msm_dai_q6_afe_input_bit_format_get(
	}

	switch (dai_data->afe_in_bitformat) {
	case SNDRV_PCM_FORMAT_S32_LE:
		ucontrol->value.integer.value[0] = 2;
		break;
	case SNDRV_PCM_FORMAT_S24_LE:
		ucontrol->value.integer.value[0] = 1;
		break;
@@ -2362,6 +2371,9 @@ static int msm_dai_q6_afe_input_bit_format_put(
		return -EINVAL;
	}
	switch (ucontrol->value.integer.value[0]) {
	case 2:
		dai_data->afe_in_bitformat = SNDRV_PCM_FORMAT_S32_LE;
		break;
	case 1:
		dai_data->afe_in_bitformat = SNDRV_PCM_FORMAT_S24_LE;
		break;
@@ -7424,11 +7436,17 @@ static int msm_dai_q6_tdm_set_tdm_slot(struct snd_soc_dai *dai,
		return -EINVAL;
	}

	/* HW only supports 16 and 8 slots configuration */
	/* HW supports 1-32 slots configuration. Typical: 1, 2, 4, 8, 16, 32 */
	switch (slots) {
	case 1:
		cap_mask = 0x01;
		break;
	case 2:
		cap_mask = 0x03;
		break;
	case 4:
		cap_mask = 0x0F;
		break;
	case 8:
		cap_mask = 0xFF;
		break;
@@ -7532,27 +7550,13 @@ static int msm_dai_q6_tdm_set_sysclk(struct snd_soc_dai *dai,
	struct msm_dai_q6_tdm_dai_data *dai_data =
		dev_get_drvdata(dai->dev);

	switch (dai->id) {
	case AFE_PORT_ID_PRIMARY_TDM_RX:
	case AFE_PORT_ID_PRIMARY_TDM_RX_1:
	case AFE_PORT_ID_PRIMARY_TDM_RX_2:
	case AFE_PORT_ID_PRIMARY_TDM_RX_3:
	case AFE_PORT_ID_PRIMARY_TDM_RX_4:
	case AFE_PORT_ID_PRIMARY_TDM_RX_5:
	case AFE_PORT_ID_PRIMARY_TDM_RX_6:
	case AFE_PORT_ID_PRIMARY_TDM_RX_7:
	case AFE_PORT_ID_PRIMARY_TDM_TX:
	case AFE_PORT_ID_PRIMARY_TDM_TX_1:
	case AFE_PORT_ID_PRIMARY_TDM_TX_2:
	case AFE_PORT_ID_PRIMARY_TDM_TX_3:
	case AFE_PORT_ID_PRIMARY_TDM_TX_4:
	case AFE_PORT_ID_PRIMARY_TDM_TX_5:
	case AFE_PORT_ID_PRIMARY_TDM_TX_6:
	case AFE_PORT_ID_PRIMARY_TDM_TX_7:
	if ((dai->id >= AFE_PORT_ID_PRIMARY_TDM_RX) &&
		(dai->id <= AFE_PORT_ID_QUATERNARY_TDM_TX_7)) {
		dai_data->clk_set.clk_freq_in_hz = freq;
		break;
	default:
		return 0;
	} else {
		dev_err(dai->dev, "%s: invalid dai id 0x%x\n",
			__func__, dai->id);
		return -EINVAL;
	}

	dev_dbg(dai->dev, "%s: dai id = 0x%x group clk_freq %d\n",
@@ -8116,7 +8120,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8136,7 +8140,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8156,7 +8160,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8176,7 +8180,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8196,7 +8200,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8216,7 +8220,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8236,7 +8240,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8256,7 +8260,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8276,7 +8280,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8296,7 +8300,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8316,7 +8320,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8336,7 +8340,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8356,7 +8360,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8376,7 +8380,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8396,7 +8400,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8416,7 +8420,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8436,7 +8440,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8456,7 +8460,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8476,7 +8480,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8496,7 +8500,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8516,7 +8520,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8536,7 +8540,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8556,7 +8560,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8576,7 +8580,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8596,7 +8600,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8616,7 +8620,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8636,7 +8640,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8656,7 +8660,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8676,7 +8680,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8696,7 +8700,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8716,7 +8720,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8736,7 +8740,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8756,7 +8760,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8776,7 +8780,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8796,7 +8800,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8816,7 +8820,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8836,7 +8840,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8856,7 +8860,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8876,7 +8880,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8896,7 +8900,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8916,7 +8920,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8936,7 +8940,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8956,7 +8960,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8976,7 +8980,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -8996,7 +9000,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9016,7 +9020,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9036,7 +9040,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9056,7 +9060,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9076,7 +9080,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9096,7 +9100,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9116,7 +9120,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9136,7 +9140,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9156,7 +9160,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9176,7 +9180,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9196,7 +9200,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9216,7 +9220,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9236,7 +9240,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9256,7 +9260,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9276,7 +9280,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9296,7 +9300,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9316,7 +9320,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9336,7 +9340,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9356,7 +9360,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
@@ -9376,7 +9380,7 @@ static struct snd_soc_dai_driver msm_dai_q6_tdm_dai[] = {
				   SNDRV_PCM_FMTBIT_S24_LE |
				   SNDRV_PCM_FMTBIT_S32_LE,
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 16,
			.rate_min = 8000,
			.rate_max = 352800,
		},
+7 −7
Original line number Diff line number Diff line
@@ -1550,7 +1550,7 @@ static int msm_pcm_chmap_ctl_put(struct snd_kcontrol *kcontrol,
	prtd = substream->runtime->private_data;
	if (prtd) {
		prtd->set_channel_map = true;
			for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL; i++)
			for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL_V2; i++)
				prtd->channel_map[i] =
				(char)(ucontrol->value.integer.value[i]);
	}
@@ -1578,11 +1578,11 @@ static int msm_pcm_chmap_ctl_get(struct snd_kcontrol *kcontrol,
	prtd = substream->runtime->private_data;

	if (prtd && prtd->set_channel_map == true) {
		for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL; i++)
		for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL_V2; i++)
			ucontrol->value.integer.value[i] =
					(int)prtd->channel_map[i];
	} else {
		for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL; i++)
		for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL_V2; i++)
			ucontrol->value.integer.value[i] = 0;
	}

@@ -1600,7 +1600,7 @@ static int msm_pcm_add_chmap_controls(struct snd_soc_pcm_runtime *rtd)
	pr_debug("%s, Channel map cntrl add\n", __func__);
	ret = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
				     snd_pcm_std_chmaps,
				     PCM_FORMAT_MAX_NUM_CHANNEL, 0,
				     PCM_FORMAT_MAX_NUM_CHANNEL_V2, 0,
				     &chmap_info);
	if (ret < 0) {
		pr_err("%s, channel map cntrl add failed\n", __func__);
@@ -2465,7 +2465,7 @@ static int msm_pcm_channel_mixer_output_map_info(struct snd_kcontrol *kcontrol,
				       struct snd_ctl_elem_info *uinfo)
{
	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
	uinfo->count = 32;
	uinfo->count = PCM_FORMAT_MAX_NUM_CHANNEL_V2;
	uinfo->value.integer.min = 1;
	uinfo->value.integer.max = 64;
	return 0;
@@ -2567,7 +2567,7 @@ static int msm_pcm_channel_mixer_input_map_info(struct snd_kcontrol *kcontrol,
				       struct snd_ctl_elem_info *uinfo)
{
	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
	uinfo->count = 32;
	uinfo->count = PCM_FORMAT_MAX_NUM_CHANNEL_V2;
	uinfo->value.integer.min = 1;
	uinfo->value.integer.max = 64;
	return 0;
@@ -2782,7 +2782,7 @@ static int msm_pcm_channel_mixer_weight_info(struct snd_kcontrol *kcontrol,
				       struct snd_ctl_elem_info *uinfo)
{
	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
	uinfo->count = 32;
	uinfo->count = PCM_FORMAT_MAX_NUM_CHANNEL_V2;
	uinfo->value.integer.min = 0;
	uinfo->value.integer.max = 0x4000;
	return 0;