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>
This commit is contained in:
parent
f0faba2ed8
commit
6c64afbb2d
6 changed files with 178 additions and 2 deletions
|
@ -792,7 +792,11 @@ struct adm_cmd_connect_afe_port_v5 {
|
|||
#define SLIMBUS_5_TX 0x400b
|
||||
#define SLIMBUS_6_RX 0x400c
|
||||
#define SLIMBUS_6_TX 0x400d
|
||||
#define SLIMBUS_PORT_LAST SLIMBUS_6_TX
|
||||
#define SLIMBUS_7_RX 0x400e
|
||||
#define SLIMBUS_7_TX 0x400f
|
||||
#define SLIMBUS_8_RX 0x4010
|
||||
#define SLIMBUS_8_TX 0x4011
|
||||
#define SLIMBUS_PORT_LAST SLIMBUS_8_TX
|
||||
#define INT_BT_SCO_RX 0x3000
|
||||
#define INT_BT_SCO_TX 0x3001
|
||||
#define INT_BT_A2DP_RX 0x3002
|
||||
|
@ -941,6 +945,14 @@ struct adm_cmd_connect_afe_port_v5 {
|
|||
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_6_RX 0x400c
|
||||
/* SLIMbus Tx port on channel 6. */
|
||||
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_6_TX 0x400d
|
||||
/* SLIMbus Rx port on channel 7. */
|
||||
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_7_RX 0x400e
|
||||
/* SLIMbus Tx port on channel 7. */
|
||||
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_7_TX 0x400f
|
||||
/* SLIMbus Rx port on channel 8. */
|
||||
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_8_RX 0x4010
|
||||
/* SLIMbus Tx port on channel 8. */
|
||||
#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_8_TX 0x4011
|
||||
|
||||
/* Generic pseudoport 1. */
|
||||
#define AFE_PORT_ID_PSEUDOPORT_01 0x8001
|
||||
|
|
|
@ -108,7 +108,7 @@ enum {
|
|||
IDX_AFE_PORT_ID_QUINARY_MI2S_RX,
|
||||
IDX_AFE_PORT_ID_QUINARY_MI2S_TX,
|
||||
IDX_AFE_PORT_ID_SENARY_MI2S_TX,
|
||||
/* IDX 54-> 118 */
|
||||
/* IDX 54->117 */
|
||||
IDX_AFE_PORT_ID_PRIMARY_TDM_RX_0,
|
||||
IDX_AFE_PORT_ID_PRIMARY_TDM_TX_0,
|
||||
IDX_AFE_PORT_ID_PRIMARY_TDM_RX_1,
|
||||
|
@ -173,6 +173,11 @@ enum {
|
|||
IDX_AFE_PORT_ID_QUATERNARY_TDM_TX_6,
|
||||
IDX_AFE_PORT_ID_QUATERNARY_TDM_RX_7,
|
||||
IDX_AFE_PORT_ID_QUATERNARY_TDM_TX_7,
|
||||
/* IDX 118->122 */
|
||||
IDX_SLIMBUS_7_RX,
|
||||
IDX_SLIMBUS_7_TX,
|
||||
IDX_SLIMBUS_8_RX,
|
||||
IDX_SLIMBUS_8_TX,
|
||||
AFE_MAX_PORTS
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue