summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorBanajit Goswami <bgoswami@codeaurora.org>2015-11-24 09:49:29 -0800
committerJeevan Shriram <jshriram@codeaurora.org>2016-05-06 12:06:25 -0700
commit6c64afbb2d11f91f19599e98875a042cff27a3ef (patch)
tree4164201496a2f9fd8f191b945f9cf5615ea8dfa9 /sound/soc
parentf0faba2ed8a90173c9e1d6af59570274aeedf680 (diff)
ASoC: msm: q6dspv2: add support for Slimbus 7 and 8 ports
Add support for SLIMBUS_7 and SLIMBUS_8 Rx and Tx ports for MSM audio drivers. Change-Id: I839ac07a3ee1e1e778c4d1e43d0bac89f01bd21a Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/msm/qdsp6v2/msm-dai-q6-v2.c114
-rw-r--r--sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.h9
-rw-r--r--sound/soc/msm/qdsp6v2/q6afe.c24
-rw-r--r--sound/soc/msm/qdsp6v2/q6audio-v2.c12
4 files changed, 159 insertions, 0 deletions
diff --git a/sound/soc/msm/qdsp6v2/msm-dai-q6-v2.c b/sound/soc/msm/qdsp6v2/msm-dai-q6-v2.c
index e1c789ff343f..07fd1a44df7f 100644
--- a/sound/soc/msm/qdsp6v2/msm-dai-q6-v2.c
+++ b/sound/soc/msm/qdsp6v2/msm-dai-q6-v2.c
@@ -1463,6 +1463,20 @@ static int msm_dai_q6_slim_bus_hw_params(struct snd_pcm_hw_params *params,
dai_data->port_config.slim_sch.sample_rate = dai_data->rate;
dai_data->port_config.slim_sch.num_channels = dai_data->channels;
+ switch (dai->id) {
+ case SLIMBUS_7_RX:
+ case SLIMBUS_7_TX:
+ case SLIMBUS_8_RX:
+ case SLIMBUS_8_TX:
+ dai_data->port_config.slim_sch.slimbus_dev_id =
+ AFE_SLIMBUS_DEVICE_2;
+ break;
+ default:
+ dai_data->port_config.slim_sch.slimbus_dev_id =
+ AFE_SLIMBUS_DEVICE_1;
+ break;
+ }
+
dev_dbg(dai->dev, "%s:slimbus_dev_id[%hu] bit_wd[%hu] format[%hu]\n"
"num_channel %hu shared_ch_mapping[0] %hu\n"
"slave_port_mapping[1] %hu slave_port_mapping[2] %hu\n"
@@ -1584,6 +1598,8 @@ static int msm_dai_q6_hw_params(struct snd_pcm_substream *substream,
case SLIMBUS_4_RX:
case SLIMBUS_5_RX:
case SLIMBUS_6_RX:
+ case SLIMBUS_7_RX:
+ case SLIMBUS_8_RX:
case SLIMBUS_0_TX:
case SLIMBUS_1_TX:
case SLIMBUS_2_TX:
@@ -1591,6 +1607,8 @@ static int msm_dai_q6_hw_params(struct snd_pcm_substream *substream,
case SLIMBUS_4_TX:
case SLIMBUS_5_TX:
case SLIMBUS_6_TX:
+ case SLIMBUS_7_TX:
+ case SLIMBUS_8_TX:
rc = msm_dai_q6_slim_bus_hw_params(params, dai,
substream->stream);
break;
@@ -1701,6 +1719,8 @@ static int msm_dai_q6_set_channel_map(struct snd_soc_dai *dai,
case SLIMBUS_4_RX:
case SLIMBUS_5_RX:
case SLIMBUS_6_RX:
+ case SLIMBUS_7_RX:
+ case SLIMBUS_8_RX:
/*
* channel number to be between 128 and 255.
* For RX port use channel numbers
@@ -1731,6 +1751,8 @@ static int msm_dai_q6_set_channel_map(struct snd_soc_dai *dai,
case SLIMBUS_4_TX:
case SLIMBUS_5_TX:
case SLIMBUS_6_TX:
+ case SLIMBUS_7_TX:
+ case SLIMBUS_8_TX:
/*
* channel number to be between 128 and 255.
* For TX port use channel numbers
@@ -2591,6 +2613,44 @@ static struct snd_soc_dai_driver msm_dai_q6_slimbus_rx_dai[] = {
.probe = msm_dai_q6_dai_probe,
.remove = msm_dai_q6_dai_remove,
},
+ {
+ .playback = {
+ .stream_name = "Slimbus7 Playback",
+ .aif_name = "SLIMBUS_7_RX",
+ .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |
+ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |
+ SNDRV_PCM_RATE_192000 | SNDRV_PCM_RATE_44100,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE |
+ SNDRV_PCM_FMTBIT_S24_LE,
+ .channels_min = 1,
+ .channels_max = 8,
+ .rate_min = 8000,
+ .rate_max = 192000,
+ },
+ .ops = &msm_dai_q6_ops,
+ .id = SLIMBUS_7_RX,
+ .probe = msm_dai_q6_dai_probe,
+ .remove = msm_dai_q6_dai_remove,
+ },
+ {
+ .playback = {
+ .stream_name = "Slimbus8 Playback",
+ .aif_name = "SLIMBUS_8_RX",
+ .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |
+ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |
+ SNDRV_PCM_RATE_192000 | SNDRV_PCM_RATE_44100,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE |
+ SNDRV_PCM_FMTBIT_S24_LE,
+ .channels_min = 1,
+ .channels_max = 8,
+ .rate_min = 8000,
+ .rate_max = 192000,
+ },
+ .ops = &msm_dai_q6_ops,
+ .id = SLIMBUS_8_RX,
+ .probe = msm_dai_q6_dai_probe,
+ .remove = msm_dai_q6_dai_remove,
+ },
};
static struct snd_soc_dai_driver msm_dai_q6_slimbus_tx_dai[] = {
@@ -2728,6 +2788,46 @@ static struct snd_soc_dai_driver msm_dai_q6_slimbus_tx_dai[] = {
.probe = msm_dai_q6_dai_probe,
.remove = msm_dai_q6_dai_remove,
},
+ {
+ .capture = {
+ .stream_name = "Slimbus7 Capture",
+ .aif_name = "SLIMBUS_7_TX",
+ .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |
+ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |
+ SNDRV_PCM_RATE_192000,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE |
+ SNDRV_PCM_FMTBIT_S24_LE |
+ SNDRV_PCM_FMTBIT_S32_LE,
+ .channels_min = 1,
+ .channels_max = 8,
+ .rate_min = 8000,
+ .rate_max = 192000,
+ },
+ .ops = &msm_dai_q6_ops,
+ .id = SLIMBUS_7_TX,
+ .probe = msm_dai_q6_dai_probe,
+ .remove = msm_dai_q6_dai_remove,
+ },
+ {
+ .capture = {
+ .stream_name = "Slimbus8 Capture",
+ .aif_name = "SLIMBUS_8_TX",
+ .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |
+ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |
+ SNDRV_PCM_RATE_192000,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE |
+ SNDRV_PCM_FMTBIT_S24_LE |
+ SNDRV_PCM_FMTBIT_S32_LE,
+ .channels_min = 1,
+ .channels_max = 8,
+ .rate_min = 8000,
+ .rate_max = 192000,
+ },
+ .ops = &msm_dai_q6_ops,
+ .id = SLIMBUS_8_TX,
+ .probe = msm_dai_q6_dai_probe,
+ .remove = msm_dai_q6_dai_remove,
+ },
};
static int msm_dai_q6_mi2s_format_put(struct snd_kcontrol *kcontrol,
@@ -3667,6 +3767,13 @@ static int msm_dai_q6_dev_probe(struct platform_device *pdev)
goto register_slim_playback;
case SLIMBUS_6_RX:
strlcpy(stream_name, "Slimbus6 Playback", 80);
+ goto register_slim_playback;
+ case SLIMBUS_7_RX:
+ strlcpy(stream_name, "Slimbus7 Playback", sizeof(stream_name));
+ goto register_slim_playback;
+ case SLIMBUS_8_RX:
+ strlcpy(stream_name, "Slimbus8 Playback", sizeof(stream_name));
+ goto register_slim_playback;
register_slim_playback:
rc = -ENODEV;
len = strnlen(stream_name , 80);
@@ -3705,6 +3812,13 @@ register_slim_playback:
goto register_slim_capture;
case SLIMBUS_6_TX:
strlcpy(stream_name, "Slimbus6 Capture", 80);
+ goto register_slim_capture;
+ case SLIMBUS_7_TX:
+ strlcpy(stream_name, "Slimbus7 Capture", sizeof(stream_name));
+ goto register_slim_capture;
+ case SLIMBUS_8_TX:
+ strlcpy(stream_name, "Slimbus8 Capture", sizeof(stream_name));
+ goto register_slim_capture;
register_slim_capture:
rc = -ENODEV;
len = strnlen(stream_name , 80);
diff --git a/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.h b/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.h
index 384f370ae040..01e7d8641c69 100644
--- a/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.h
+++ b/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.h
@@ -130,6 +130,11 @@
#define LPASS_BE_QUAT_TDM_RX_7 "QUAT_TDM_RX_7"
#define LPASS_BE_QUAT_TDM_TX_7 "QUAT_TDM_TX_7"
+#define LPASS_BE_SLIMBUS_7_RX "SLIMBUS_7_RX"
+#define LPASS_BE_SLIMBUS_7_TX "SLIMBUS_7_TX"
+#define LPASS_BE_SLIMBUS_8_RX "SLIMBUS_8_RX"
+#define LPASS_BE_SLIMBUS_8_TX "SLIMBUS_8_TX"
+
/* For multimedia front-ends, asm session is allocated dynamically.
* Hence, asm session/multimedia front-end mapping has to be maintained.
* Due to this reason, additional multimedia front-end must be placed before
@@ -296,6 +301,10 @@ enum {
MSM_BACKEND_DAI_QUAT_TDM_RX_7,
MSM_BACKEND_DAI_QUAT_TDM_TX_7,
MSM_BACKEND_DAI_INT_BT_A2DP_RX,
+ MSM_BACKEND_DAI_SLIMBUS_7_RX,
+ MSM_BACKEND_DAI_SLIMBUS_7_TX,
+ MSM_BACKEND_DAI_SLIMBUS_8_RX,
+ MSM_BACKEND_DAI_SLIMBUS_8_TX,
MSM_BACKEND_DAI_MAX,
};
diff --git a/sound/soc/msm/qdsp6v2/q6afe.c b/sound/soc/msm/qdsp6v2/q6afe.c
index 803c913b04b1..48cd7c8ebff0 100644
--- a/sound/soc/msm/qdsp6v2/q6afe.c
+++ b/sound/soc/msm/qdsp6v2/q6afe.c
@@ -429,6 +429,8 @@ int afe_get_port_type(u16 port_id)
case SLIMBUS_4_RX:
case SLIMBUS_5_RX:
case SLIMBUS_6_RX:
+ case SLIMBUS_7_RX:
+ case SLIMBUS_8_RX:
case INT_BT_SCO_RX:
case INT_BT_A2DP_RX:
case INT_FM_RX:
@@ -491,6 +493,8 @@ int afe_get_port_type(u16 port_id)
case SLIMBUS_4_TX:
case SLIMBUS_5_TX:
case SLIMBUS_6_TX:
+ case SLIMBUS_7_TX:
+ case SLIMBUS_8_TX:
case INT_FM_TX:
case VOICE_RECORD_RX:
case INT_BT_SCO_TX:
@@ -583,6 +587,10 @@ int afe_sizeof_cfg_cmd(u16 port_id)
case SLIMBUS_5_TX:
case SLIMBUS_6_RX:
case SLIMBUS_6_TX:
+ case SLIMBUS_7_RX:
+ case SLIMBUS_7_TX:
+ case SLIMBUS_8_RX:
+ case SLIMBUS_8_TX:
ret_size = SIZEOF_CFG_CMD(afe_param_id_slimbus_cfg);
break;
case VOICE_PLAYBACK_TX:
@@ -2737,6 +2745,10 @@ int afe_port_start(u16 port_id, union afe_port_config *afe_config,
case SLIMBUS_5_TX:
case SLIMBUS_6_RX:
case SLIMBUS_6_TX:
+ case SLIMBUS_7_RX:
+ case SLIMBUS_7_TX:
+ case SLIMBUS_8_RX:
+ case SLIMBUS_8_TX:
cfg_type = AFE_PARAM_ID_SLIMBUS_CONFIG;
break;
case RT_PROXY_PORT_001_RX:
@@ -2854,6 +2866,10 @@ int afe_get_port_index(u16 port_id)
case SLIMBUS_5_TX: return IDX_SLIMBUS_5_TX;
case SLIMBUS_6_RX: return IDX_SLIMBUS_6_RX;
case SLIMBUS_6_TX: return IDX_SLIMBUS_6_TX;
+ case SLIMBUS_7_RX: return IDX_SLIMBUS_7_RX;
+ case SLIMBUS_7_TX: return IDX_SLIMBUS_7_TX;
+ case SLIMBUS_8_RX: return IDX_SLIMBUS_8_RX;
+ case SLIMBUS_8_TX: return IDX_SLIMBUS_8_TX;
case AFE_PORT_ID_PRIMARY_MI2S_RX:
return IDX_AFE_PORT_ID_PRIMARY_MI2S_RX;
case AFE_PORT_ID_PRIMARY_MI2S_TX:
@@ -3113,6 +3129,10 @@ int afe_open(u16 port_id,
case SLIMBUS_5_RX:
case SLIMBUS_6_RX:
case SLIMBUS_6_TX:
+ case SLIMBUS_7_RX:
+ case SLIMBUS_7_TX:
+ case SLIMBUS_8_RX:
+ case SLIMBUS_8_TX:
cfg_type = AFE_PARAM_ID_SLIMBUS_CONFIG;
break;
default:
@@ -4574,6 +4594,10 @@ int afe_validate_port(u16 port_id)
case SLIMBUS_5_RX:
case SLIMBUS_6_RX:
case SLIMBUS_6_TX:
+ case SLIMBUS_7_RX:
+ case SLIMBUS_7_TX:
+ case SLIMBUS_8_RX:
+ case SLIMBUS_8_TX:
case AFE_PORT_ID_PRIMARY_MI2S_RX:
case AFE_PORT_ID_PRIMARY_MI2S_TX:
case AFE_PORT_ID_SECONDARY_MI2S_RX:
diff --git a/sound/soc/msm/qdsp6v2/q6audio-v2.c b/sound/soc/msm/qdsp6v2/q6audio-v2.c
index 9a08966cf9f5..232132f90e4d 100644
--- a/sound/soc/msm/qdsp6v2/q6audio-v2.c
+++ b/sound/soc/msm/qdsp6v2/q6audio-v2.c
@@ -59,6 +59,10 @@ int q6audio_get_port_index(u16 port_id)
case SLIMBUS_5_TX: return IDX_SLIMBUS_5_TX;
case SLIMBUS_6_RX: return IDX_SLIMBUS_6_RX;
case SLIMBUS_6_TX: return IDX_SLIMBUS_6_TX;
+ case SLIMBUS_7_RX: return IDX_SLIMBUS_7_RX;
+ case SLIMBUS_7_TX: return IDX_SLIMBUS_7_TX;
+ case SLIMBUS_8_RX: return IDX_SLIMBUS_8_RX;
+ case SLIMBUS_8_TX: return IDX_SLIMBUS_8_TX;
case INT_BT_SCO_RX: return IDX_INT_BT_SCO_RX;
case INT_BT_SCO_TX: return IDX_INT_BT_SCO_TX;
case INT_BT_A2DP_RX: return IDX_INT_BT_A2DP_RX;
@@ -260,6 +264,10 @@ int q6audio_get_port_id(u16 port_id)
case SLIMBUS_5_TX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_5_TX;
case SLIMBUS_6_RX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_6_RX;
case SLIMBUS_6_TX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_6_TX;
+ case SLIMBUS_7_RX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_7_RX;
+ case SLIMBUS_7_TX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_7_TX;
+ case SLIMBUS_8_RX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_8_RX;
+ case SLIMBUS_8_TX: return AFE_PORT_ID_SLIMBUS_MULTI_CHAN_8_TX;
case INT_BT_SCO_RX: return AFE_PORT_ID_INTERNAL_BT_SCO_RX;
case INT_BT_SCO_TX: return AFE_PORT_ID_INTERNAL_BT_SCO_TX;
case INT_BT_A2DP_RX: return AFE_PORT_ID_INTERNAL_BT_A2DP_RX;
@@ -578,6 +586,10 @@ int q6audio_validate_port(u16 port_id)
case SLIMBUS_5_TX:
case SLIMBUS_6_RX:
case SLIMBUS_6_TX:
+ case SLIMBUS_7_RX:
+ case SLIMBUS_7_TX:
+ case SLIMBUS_8_RX:
+ case SLIMBUS_8_TX:
case INT_BT_SCO_RX:
case INT_BT_SCO_TX:
case INT_BT_A2DP_RX: