18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci// Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. 38c2ecf20Sopenharmony_ci// Copyright (c) 2018, Linaro Limited 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#include <linux/err.h> 68c2ecf20Sopenharmony_ci#include <linux/init.h> 78c2ecf20Sopenharmony_ci#include <linux/module.h> 88c2ecf20Sopenharmony_ci#include <linux/device.h> 98c2ecf20Sopenharmony_ci#include <linux/platform_device.h> 108c2ecf20Sopenharmony_ci#include <linux/slab.h> 118c2ecf20Sopenharmony_ci#include <sound/pcm.h> 128c2ecf20Sopenharmony_ci#include <sound/soc.h> 138c2ecf20Sopenharmony_ci#include <sound/pcm_params.h> 148c2ecf20Sopenharmony_ci#include "q6afe.h" 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci#define Q6AFE_TDM_PB_DAI(pre, num, did) { \ 178c2ecf20Sopenharmony_ci .playback = { \ 188c2ecf20Sopenharmony_ci .stream_name = pre" TDM"#num" Playback", \ 198c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\ 208c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 |\ 218c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_176400, \ 228c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | \ 238c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE | \ 248c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S32_LE, \ 258c2ecf20Sopenharmony_ci .channels_min = 1, \ 268c2ecf20Sopenharmony_ci .channels_max = 8, \ 278c2ecf20Sopenharmony_ci .rate_min = 8000, \ 288c2ecf20Sopenharmony_ci .rate_max = 176400, \ 298c2ecf20Sopenharmony_ci }, \ 308c2ecf20Sopenharmony_ci .name = #did, \ 318c2ecf20Sopenharmony_ci .ops = &q6tdm_ops, \ 328c2ecf20Sopenharmony_ci .id = did, \ 338c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, \ 348c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, \ 358c2ecf20Sopenharmony_ci } 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci#define Q6AFE_TDM_CAP_DAI(pre, num, did) { \ 388c2ecf20Sopenharmony_ci .capture = { \ 398c2ecf20Sopenharmony_ci .stream_name = pre" TDM"#num" Capture", \ 408c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\ 418c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 |\ 428c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_176400, \ 438c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | \ 448c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE | \ 458c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S32_LE, \ 468c2ecf20Sopenharmony_ci .channels_min = 1, \ 478c2ecf20Sopenharmony_ci .channels_max = 8, \ 488c2ecf20Sopenharmony_ci .rate_min = 8000, \ 498c2ecf20Sopenharmony_ci .rate_max = 176400, \ 508c2ecf20Sopenharmony_ci }, \ 518c2ecf20Sopenharmony_ci .name = #did, \ 528c2ecf20Sopenharmony_ci .ops = &q6tdm_ops, \ 538c2ecf20Sopenharmony_ci .id = did, \ 548c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, \ 558c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, \ 568c2ecf20Sopenharmony_ci } 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci#define Q6AFE_CDC_DMA_RX_DAI(did) { \ 598c2ecf20Sopenharmony_ci .playback = { \ 608c2ecf20Sopenharmony_ci .stream_name = #did" Playback", \ 618c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\ 628c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 |\ 638c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_176400, \ 648c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | \ 658c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE | \ 668c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S32_LE, \ 678c2ecf20Sopenharmony_ci .channels_min = 1, \ 688c2ecf20Sopenharmony_ci .channels_max = 8, \ 698c2ecf20Sopenharmony_ci .rate_min = 8000, \ 708c2ecf20Sopenharmony_ci .rate_max = 176400, \ 718c2ecf20Sopenharmony_ci }, \ 728c2ecf20Sopenharmony_ci .name = #did, \ 738c2ecf20Sopenharmony_ci .ops = &q6dma_ops, \ 748c2ecf20Sopenharmony_ci .id = did, \ 758c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, \ 768c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, \ 778c2ecf20Sopenharmony_ci } 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ci#define Q6AFE_CDC_DMA_TX_DAI(did) { \ 808c2ecf20Sopenharmony_ci .capture = { \ 818c2ecf20Sopenharmony_ci .stream_name = #did" Capture", \ 828c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\ 838c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 |\ 848c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_176400, \ 858c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | \ 868c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE | \ 878c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S32_LE, \ 888c2ecf20Sopenharmony_ci .channels_min = 1, \ 898c2ecf20Sopenharmony_ci .channels_max = 8, \ 908c2ecf20Sopenharmony_ci .rate_min = 8000, \ 918c2ecf20Sopenharmony_ci .rate_max = 176400, \ 928c2ecf20Sopenharmony_ci }, \ 938c2ecf20Sopenharmony_ci .name = #did, \ 948c2ecf20Sopenharmony_ci .ops = &q6dma_ops, \ 958c2ecf20Sopenharmony_ci .id = did, \ 968c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, \ 978c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, \ 988c2ecf20Sopenharmony_ci } 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_cistruct q6afe_dai_priv_data { 1018c2ecf20Sopenharmony_ci uint32_t sd_line_mask; 1028c2ecf20Sopenharmony_ci uint32_t sync_mode; 1038c2ecf20Sopenharmony_ci uint32_t sync_src; 1048c2ecf20Sopenharmony_ci uint32_t data_out_enable; 1058c2ecf20Sopenharmony_ci uint32_t invert_sync; 1068c2ecf20Sopenharmony_ci uint32_t data_delay; 1078c2ecf20Sopenharmony_ci uint32_t data_align; 1088c2ecf20Sopenharmony_ci}; 1098c2ecf20Sopenharmony_ci 1108c2ecf20Sopenharmony_cistruct q6afe_dai_data { 1118c2ecf20Sopenharmony_ci struct q6afe_port *port[AFE_PORT_MAX]; 1128c2ecf20Sopenharmony_ci struct q6afe_port_config port_config[AFE_PORT_MAX]; 1138c2ecf20Sopenharmony_ci bool is_port_started[AFE_PORT_MAX]; 1148c2ecf20Sopenharmony_ci struct q6afe_dai_priv_data priv[AFE_PORT_MAX]; 1158c2ecf20Sopenharmony_ci}; 1168c2ecf20Sopenharmony_ci 1178c2ecf20Sopenharmony_cistatic int q6slim_hw_params(struct snd_pcm_substream *substream, 1188c2ecf20Sopenharmony_ci struct snd_pcm_hw_params *params, 1198c2ecf20Sopenharmony_ci struct snd_soc_dai *dai) 1208c2ecf20Sopenharmony_ci{ 1218c2ecf20Sopenharmony_ci 1228c2ecf20Sopenharmony_ci struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); 1238c2ecf20Sopenharmony_ci struct q6afe_slim_cfg *slim = &dai_data->port_config[dai->id].slim; 1248c2ecf20Sopenharmony_ci 1258c2ecf20Sopenharmony_ci slim->sample_rate = params_rate(params); 1268c2ecf20Sopenharmony_ci 1278c2ecf20Sopenharmony_ci switch (params_format(params)) { 1288c2ecf20Sopenharmony_ci case SNDRV_PCM_FORMAT_S16_LE: 1298c2ecf20Sopenharmony_ci case SNDRV_PCM_FORMAT_SPECIAL: 1308c2ecf20Sopenharmony_ci slim->bit_width = 16; 1318c2ecf20Sopenharmony_ci break; 1328c2ecf20Sopenharmony_ci case SNDRV_PCM_FORMAT_S24_LE: 1338c2ecf20Sopenharmony_ci slim->bit_width = 24; 1348c2ecf20Sopenharmony_ci break; 1358c2ecf20Sopenharmony_ci case SNDRV_PCM_FORMAT_S32_LE: 1368c2ecf20Sopenharmony_ci slim->bit_width = 32; 1378c2ecf20Sopenharmony_ci break; 1388c2ecf20Sopenharmony_ci default: 1398c2ecf20Sopenharmony_ci pr_err("%s: format %d\n", 1408c2ecf20Sopenharmony_ci __func__, params_format(params)); 1418c2ecf20Sopenharmony_ci return -EINVAL; 1428c2ecf20Sopenharmony_ci } 1438c2ecf20Sopenharmony_ci 1448c2ecf20Sopenharmony_ci return 0; 1458c2ecf20Sopenharmony_ci} 1468c2ecf20Sopenharmony_ci 1478c2ecf20Sopenharmony_cistatic int q6hdmi_hw_params(struct snd_pcm_substream *substream, 1488c2ecf20Sopenharmony_ci struct snd_pcm_hw_params *params, 1498c2ecf20Sopenharmony_ci struct snd_soc_dai *dai) 1508c2ecf20Sopenharmony_ci{ 1518c2ecf20Sopenharmony_ci struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); 1528c2ecf20Sopenharmony_ci int channels = params_channels(params); 1538c2ecf20Sopenharmony_ci struct q6afe_hdmi_cfg *hdmi = &dai_data->port_config[dai->id].hdmi; 1548c2ecf20Sopenharmony_ci 1558c2ecf20Sopenharmony_ci hdmi->sample_rate = params_rate(params); 1568c2ecf20Sopenharmony_ci switch (params_format(params)) { 1578c2ecf20Sopenharmony_ci case SNDRV_PCM_FORMAT_S16_LE: 1588c2ecf20Sopenharmony_ci hdmi->bit_width = 16; 1598c2ecf20Sopenharmony_ci break; 1608c2ecf20Sopenharmony_ci case SNDRV_PCM_FORMAT_S24_LE: 1618c2ecf20Sopenharmony_ci hdmi->bit_width = 24; 1628c2ecf20Sopenharmony_ci break; 1638c2ecf20Sopenharmony_ci } 1648c2ecf20Sopenharmony_ci 1658c2ecf20Sopenharmony_ci /* HDMI spec CEA-861-E: Table 28 Audio InfoFrame Data Byte 4 */ 1668c2ecf20Sopenharmony_ci switch (channels) { 1678c2ecf20Sopenharmony_ci case 2: 1688c2ecf20Sopenharmony_ci hdmi->channel_allocation = 0; 1698c2ecf20Sopenharmony_ci break; 1708c2ecf20Sopenharmony_ci case 3: 1718c2ecf20Sopenharmony_ci hdmi->channel_allocation = 0x02; 1728c2ecf20Sopenharmony_ci break; 1738c2ecf20Sopenharmony_ci case 4: 1748c2ecf20Sopenharmony_ci hdmi->channel_allocation = 0x06; 1758c2ecf20Sopenharmony_ci break; 1768c2ecf20Sopenharmony_ci case 5: 1778c2ecf20Sopenharmony_ci hdmi->channel_allocation = 0x0A; 1788c2ecf20Sopenharmony_ci break; 1798c2ecf20Sopenharmony_ci case 6: 1808c2ecf20Sopenharmony_ci hdmi->channel_allocation = 0x0B; 1818c2ecf20Sopenharmony_ci break; 1828c2ecf20Sopenharmony_ci case 7: 1838c2ecf20Sopenharmony_ci hdmi->channel_allocation = 0x12; 1848c2ecf20Sopenharmony_ci break; 1858c2ecf20Sopenharmony_ci case 8: 1868c2ecf20Sopenharmony_ci hdmi->channel_allocation = 0x13; 1878c2ecf20Sopenharmony_ci break; 1888c2ecf20Sopenharmony_ci default: 1898c2ecf20Sopenharmony_ci dev_err(dai->dev, "invalid Channels = %u\n", channels); 1908c2ecf20Sopenharmony_ci return -EINVAL; 1918c2ecf20Sopenharmony_ci } 1928c2ecf20Sopenharmony_ci 1938c2ecf20Sopenharmony_ci return 0; 1948c2ecf20Sopenharmony_ci} 1958c2ecf20Sopenharmony_ci 1968c2ecf20Sopenharmony_cistatic int q6i2s_hw_params(struct snd_pcm_substream *substream, 1978c2ecf20Sopenharmony_ci struct snd_pcm_hw_params *params, 1988c2ecf20Sopenharmony_ci struct snd_soc_dai *dai) 1998c2ecf20Sopenharmony_ci{ 2008c2ecf20Sopenharmony_ci struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); 2018c2ecf20Sopenharmony_ci struct q6afe_i2s_cfg *i2s = &dai_data->port_config[dai->id].i2s_cfg; 2028c2ecf20Sopenharmony_ci 2038c2ecf20Sopenharmony_ci i2s->sample_rate = params_rate(params); 2048c2ecf20Sopenharmony_ci i2s->bit_width = params_width(params); 2058c2ecf20Sopenharmony_ci i2s->num_channels = params_channels(params); 2068c2ecf20Sopenharmony_ci i2s->sd_line_mask = dai_data->priv[dai->id].sd_line_mask; 2078c2ecf20Sopenharmony_ci 2088c2ecf20Sopenharmony_ci return 0; 2098c2ecf20Sopenharmony_ci} 2108c2ecf20Sopenharmony_ci 2118c2ecf20Sopenharmony_cistatic int q6i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) 2128c2ecf20Sopenharmony_ci{ 2138c2ecf20Sopenharmony_ci struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); 2148c2ecf20Sopenharmony_ci struct q6afe_i2s_cfg *i2s = &dai_data->port_config[dai->id].i2s_cfg; 2158c2ecf20Sopenharmony_ci 2168c2ecf20Sopenharmony_ci i2s->fmt = fmt; 2178c2ecf20Sopenharmony_ci 2188c2ecf20Sopenharmony_ci return 0; 2198c2ecf20Sopenharmony_ci} 2208c2ecf20Sopenharmony_ci 2218c2ecf20Sopenharmony_cistatic int q6tdm_set_tdm_slot(struct snd_soc_dai *dai, 2228c2ecf20Sopenharmony_ci unsigned int tx_mask, 2238c2ecf20Sopenharmony_ci unsigned int rx_mask, 2248c2ecf20Sopenharmony_ci int slots, int slot_width) 2258c2ecf20Sopenharmony_ci{ 2268c2ecf20Sopenharmony_ci 2278c2ecf20Sopenharmony_ci struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); 2288c2ecf20Sopenharmony_ci struct q6afe_tdm_cfg *tdm = &dai_data->port_config[dai->id].tdm; 2298c2ecf20Sopenharmony_ci unsigned int cap_mask; 2308c2ecf20Sopenharmony_ci int rc = 0; 2318c2ecf20Sopenharmony_ci 2328c2ecf20Sopenharmony_ci /* HW only supports 16 and 32 bit slot width configuration */ 2338c2ecf20Sopenharmony_ci if ((slot_width != 16) && (slot_width != 32)) { 2348c2ecf20Sopenharmony_ci dev_err(dai->dev, "%s: invalid slot_width %d\n", 2358c2ecf20Sopenharmony_ci __func__, slot_width); 2368c2ecf20Sopenharmony_ci return -EINVAL; 2378c2ecf20Sopenharmony_ci } 2388c2ecf20Sopenharmony_ci 2398c2ecf20Sopenharmony_ci /* HW supports 1-32 slots configuration. Typical: 1, 2, 4, 8, 16, 32 */ 2408c2ecf20Sopenharmony_ci switch (slots) { 2418c2ecf20Sopenharmony_ci case 2: 2428c2ecf20Sopenharmony_ci cap_mask = 0x03; 2438c2ecf20Sopenharmony_ci break; 2448c2ecf20Sopenharmony_ci case 4: 2458c2ecf20Sopenharmony_ci cap_mask = 0x0F; 2468c2ecf20Sopenharmony_ci break; 2478c2ecf20Sopenharmony_ci case 8: 2488c2ecf20Sopenharmony_ci cap_mask = 0xFF; 2498c2ecf20Sopenharmony_ci break; 2508c2ecf20Sopenharmony_ci case 16: 2518c2ecf20Sopenharmony_ci cap_mask = 0xFFFF; 2528c2ecf20Sopenharmony_ci break; 2538c2ecf20Sopenharmony_ci default: 2548c2ecf20Sopenharmony_ci dev_err(dai->dev, "%s: invalid slots %d\n", 2558c2ecf20Sopenharmony_ci __func__, slots); 2568c2ecf20Sopenharmony_ci return -EINVAL; 2578c2ecf20Sopenharmony_ci } 2588c2ecf20Sopenharmony_ci 2598c2ecf20Sopenharmony_ci switch (dai->id) { 2608c2ecf20Sopenharmony_ci case PRIMARY_TDM_RX_0 ... QUINARY_TDM_TX_7: 2618c2ecf20Sopenharmony_ci tdm->nslots_per_frame = slots; 2628c2ecf20Sopenharmony_ci tdm->slot_width = slot_width; 2638c2ecf20Sopenharmony_ci /* TDM RX dais ids are even and tx are odd */ 2648c2ecf20Sopenharmony_ci tdm->slot_mask = (dai->id & 0x1 ? tx_mask : rx_mask) & cap_mask; 2658c2ecf20Sopenharmony_ci break; 2668c2ecf20Sopenharmony_ci default: 2678c2ecf20Sopenharmony_ci dev_err(dai->dev, "%s: invalid dai id 0x%x\n", 2688c2ecf20Sopenharmony_ci __func__, dai->id); 2698c2ecf20Sopenharmony_ci return -EINVAL; 2708c2ecf20Sopenharmony_ci } 2718c2ecf20Sopenharmony_ci 2728c2ecf20Sopenharmony_ci return rc; 2738c2ecf20Sopenharmony_ci} 2748c2ecf20Sopenharmony_ci 2758c2ecf20Sopenharmony_cistatic int q6tdm_set_channel_map(struct snd_soc_dai *dai, 2768c2ecf20Sopenharmony_ci unsigned int tx_num, unsigned int *tx_slot, 2778c2ecf20Sopenharmony_ci unsigned int rx_num, unsigned int *rx_slot) 2788c2ecf20Sopenharmony_ci{ 2798c2ecf20Sopenharmony_ci 2808c2ecf20Sopenharmony_ci struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); 2818c2ecf20Sopenharmony_ci struct q6afe_tdm_cfg *tdm = &dai_data->port_config[dai->id].tdm; 2828c2ecf20Sopenharmony_ci int rc = 0; 2838c2ecf20Sopenharmony_ci int i = 0; 2848c2ecf20Sopenharmony_ci 2858c2ecf20Sopenharmony_ci switch (dai->id) { 2868c2ecf20Sopenharmony_ci case PRIMARY_TDM_RX_0 ... QUINARY_TDM_TX_7: 2878c2ecf20Sopenharmony_ci if (dai->id & 0x1) { 2888c2ecf20Sopenharmony_ci if (!tx_slot) { 2898c2ecf20Sopenharmony_ci dev_err(dai->dev, "tx slot not found\n"); 2908c2ecf20Sopenharmony_ci return -EINVAL; 2918c2ecf20Sopenharmony_ci } 2928c2ecf20Sopenharmony_ci if (tx_num > AFE_PORT_MAX_AUDIO_CHAN_CNT) { 2938c2ecf20Sopenharmony_ci dev_err(dai->dev, "invalid tx num %d\n", 2948c2ecf20Sopenharmony_ci tx_num); 2958c2ecf20Sopenharmony_ci return -EINVAL; 2968c2ecf20Sopenharmony_ci } 2978c2ecf20Sopenharmony_ci 2988c2ecf20Sopenharmony_ci for (i = 0; i < tx_num; i++) 2998c2ecf20Sopenharmony_ci tdm->ch_mapping[i] = tx_slot[i]; 3008c2ecf20Sopenharmony_ci 3018c2ecf20Sopenharmony_ci for (i = tx_num; i < AFE_PORT_MAX_AUDIO_CHAN_CNT; i++) 3028c2ecf20Sopenharmony_ci tdm->ch_mapping[i] = Q6AFE_CMAP_INVALID; 3038c2ecf20Sopenharmony_ci 3048c2ecf20Sopenharmony_ci tdm->num_channels = tx_num; 3058c2ecf20Sopenharmony_ci } else { 3068c2ecf20Sopenharmony_ci /* rx */ 3078c2ecf20Sopenharmony_ci if (!rx_slot) { 3088c2ecf20Sopenharmony_ci dev_err(dai->dev, "rx slot not found\n"); 3098c2ecf20Sopenharmony_ci return -EINVAL; 3108c2ecf20Sopenharmony_ci } 3118c2ecf20Sopenharmony_ci if (rx_num > AFE_PORT_MAX_AUDIO_CHAN_CNT) { 3128c2ecf20Sopenharmony_ci dev_err(dai->dev, "invalid rx num %d\n", 3138c2ecf20Sopenharmony_ci rx_num); 3148c2ecf20Sopenharmony_ci return -EINVAL; 3158c2ecf20Sopenharmony_ci } 3168c2ecf20Sopenharmony_ci 3178c2ecf20Sopenharmony_ci for (i = 0; i < rx_num; i++) 3188c2ecf20Sopenharmony_ci tdm->ch_mapping[i] = rx_slot[i]; 3198c2ecf20Sopenharmony_ci 3208c2ecf20Sopenharmony_ci for (i = rx_num; i < AFE_PORT_MAX_AUDIO_CHAN_CNT; i++) 3218c2ecf20Sopenharmony_ci tdm->ch_mapping[i] = Q6AFE_CMAP_INVALID; 3228c2ecf20Sopenharmony_ci 3238c2ecf20Sopenharmony_ci tdm->num_channels = rx_num; 3248c2ecf20Sopenharmony_ci } 3258c2ecf20Sopenharmony_ci 3268c2ecf20Sopenharmony_ci break; 3278c2ecf20Sopenharmony_ci default: 3288c2ecf20Sopenharmony_ci dev_err(dai->dev, "%s: invalid dai id 0x%x\n", 3298c2ecf20Sopenharmony_ci __func__, dai->id); 3308c2ecf20Sopenharmony_ci return -EINVAL; 3318c2ecf20Sopenharmony_ci } 3328c2ecf20Sopenharmony_ci 3338c2ecf20Sopenharmony_ci return rc; 3348c2ecf20Sopenharmony_ci} 3358c2ecf20Sopenharmony_ci 3368c2ecf20Sopenharmony_cistatic int q6tdm_hw_params(struct snd_pcm_substream *substream, 3378c2ecf20Sopenharmony_ci struct snd_pcm_hw_params *params, 3388c2ecf20Sopenharmony_ci struct snd_soc_dai *dai) 3398c2ecf20Sopenharmony_ci{ 3408c2ecf20Sopenharmony_ci struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); 3418c2ecf20Sopenharmony_ci struct q6afe_tdm_cfg *tdm = &dai_data->port_config[dai->id].tdm; 3428c2ecf20Sopenharmony_ci 3438c2ecf20Sopenharmony_ci tdm->bit_width = params_width(params); 3448c2ecf20Sopenharmony_ci tdm->sample_rate = params_rate(params); 3458c2ecf20Sopenharmony_ci tdm->num_channels = params_channels(params); 3468c2ecf20Sopenharmony_ci tdm->data_align_type = dai_data->priv[dai->id].data_align; 3478c2ecf20Sopenharmony_ci tdm->sync_src = dai_data->priv[dai->id].sync_src; 3488c2ecf20Sopenharmony_ci tdm->sync_mode = dai_data->priv[dai->id].sync_mode; 3498c2ecf20Sopenharmony_ci 3508c2ecf20Sopenharmony_ci return 0; 3518c2ecf20Sopenharmony_ci} 3528c2ecf20Sopenharmony_ci 3538c2ecf20Sopenharmony_cistatic int q6dma_set_channel_map(struct snd_soc_dai *dai, 3548c2ecf20Sopenharmony_ci unsigned int tx_num, unsigned int *tx_ch_mask, 3558c2ecf20Sopenharmony_ci unsigned int rx_num, unsigned int *rx_ch_mask) 3568c2ecf20Sopenharmony_ci{ 3578c2ecf20Sopenharmony_ci 3588c2ecf20Sopenharmony_ci struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); 3598c2ecf20Sopenharmony_ci struct q6afe_cdc_dma_cfg *cfg = &dai_data->port_config[dai->id].dma_cfg; 3608c2ecf20Sopenharmony_ci int ch_mask; 3618c2ecf20Sopenharmony_ci int rc = 0; 3628c2ecf20Sopenharmony_ci 3638c2ecf20Sopenharmony_ci switch (dai->id) { 3648c2ecf20Sopenharmony_ci case WSA_CODEC_DMA_TX_0: 3658c2ecf20Sopenharmony_ci case WSA_CODEC_DMA_TX_1: 3668c2ecf20Sopenharmony_ci case WSA_CODEC_DMA_TX_2: 3678c2ecf20Sopenharmony_ci case VA_CODEC_DMA_TX_0: 3688c2ecf20Sopenharmony_ci case VA_CODEC_DMA_TX_1: 3698c2ecf20Sopenharmony_ci case VA_CODEC_DMA_TX_2: 3708c2ecf20Sopenharmony_ci case TX_CODEC_DMA_TX_0: 3718c2ecf20Sopenharmony_ci case TX_CODEC_DMA_TX_1: 3728c2ecf20Sopenharmony_ci case TX_CODEC_DMA_TX_2: 3738c2ecf20Sopenharmony_ci case TX_CODEC_DMA_TX_3: 3748c2ecf20Sopenharmony_ci case TX_CODEC_DMA_TX_4: 3758c2ecf20Sopenharmony_ci case TX_CODEC_DMA_TX_5: 3768c2ecf20Sopenharmony_ci if (!tx_ch_mask) { 3778c2ecf20Sopenharmony_ci dev_err(dai->dev, "tx slot not found\n"); 3788c2ecf20Sopenharmony_ci return -EINVAL; 3798c2ecf20Sopenharmony_ci } 3808c2ecf20Sopenharmony_ci 3818c2ecf20Sopenharmony_ci if (tx_num > AFE_PORT_MAX_AUDIO_CHAN_CNT) { 3828c2ecf20Sopenharmony_ci dev_err(dai->dev, "invalid tx num %d\n", 3838c2ecf20Sopenharmony_ci tx_num); 3848c2ecf20Sopenharmony_ci return -EINVAL; 3858c2ecf20Sopenharmony_ci } 3868c2ecf20Sopenharmony_ci ch_mask = *tx_ch_mask; 3878c2ecf20Sopenharmony_ci 3888c2ecf20Sopenharmony_ci break; 3898c2ecf20Sopenharmony_ci case WSA_CODEC_DMA_RX_0: 3908c2ecf20Sopenharmony_ci case WSA_CODEC_DMA_RX_1: 3918c2ecf20Sopenharmony_ci case RX_CODEC_DMA_RX_0: 3928c2ecf20Sopenharmony_ci case RX_CODEC_DMA_RX_1: 3938c2ecf20Sopenharmony_ci case RX_CODEC_DMA_RX_2: 3948c2ecf20Sopenharmony_ci case RX_CODEC_DMA_RX_3: 3958c2ecf20Sopenharmony_ci case RX_CODEC_DMA_RX_4: 3968c2ecf20Sopenharmony_ci case RX_CODEC_DMA_RX_5: 3978c2ecf20Sopenharmony_ci case RX_CODEC_DMA_RX_6: 3988c2ecf20Sopenharmony_ci case RX_CODEC_DMA_RX_7: 3998c2ecf20Sopenharmony_ci /* rx */ 4008c2ecf20Sopenharmony_ci if (!rx_ch_mask) { 4018c2ecf20Sopenharmony_ci dev_err(dai->dev, "rx slot not found\n"); 4028c2ecf20Sopenharmony_ci return -EINVAL; 4038c2ecf20Sopenharmony_ci } 4048c2ecf20Sopenharmony_ci if (rx_num > AFE_PORT_MAX_AUDIO_CHAN_CNT) { 4058c2ecf20Sopenharmony_ci dev_err(dai->dev, "invalid rx num %d\n", 4068c2ecf20Sopenharmony_ci rx_num); 4078c2ecf20Sopenharmony_ci return -EINVAL; 4088c2ecf20Sopenharmony_ci } 4098c2ecf20Sopenharmony_ci ch_mask = *rx_ch_mask; 4108c2ecf20Sopenharmony_ci 4118c2ecf20Sopenharmony_ci break; 4128c2ecf20Sopenharmony_ci default: 4138c2ecf20Sopenharmony_ci dev_err(dai->dev, "%s: invalid dai id 0x%x\n", 4148c2ecf20Sopenharmony_ci __func__, dai->id); 4158c2ecf20Sopenharmony_ci return -EINVAL; 4168c2ecf20Sopenharmony_ci } 4178c2ecf20Sopenharmony_ci 4188c2ecf20Sopenharmony_ci cfg->active_channels_mask = ch_mask; 4198c2ecf20Sopenharmony_ci 4208c2ecf20Sopenharmony_ci return rc; 4218c2ecf20Sopenharmony_ci} 4228c2ecf20Sopenharmony_ci 4238c2ecf20Sopenharmony_cistatic int q6dma_hw_params(struct snd_pcm_substream *substream, 4248c2ecf20Sopenharmony_ci struct snd_pcm_hw_params *params, 4258c2ecf20Sopenharmony_ci struct snd_soc_dai *dai) 4268c2ecf20Sopenharmony_ci{ 4278c2ecf20Sopenharmony_ci struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); 4288c2ecf20Sopenharmony_ci struct q6afe_cdc_dma_cfg *cfg = &dai_data->port_config[dai->id].dma_cfg; 4298c2ecf20Sopenharmony_ci 4308c2ecf20Sopenharmony_ci cfg->bit_width = params_width(params); 4318c2ecf20Sopenharmony_ci cfg->sample_rate = params_rate(params); 4328c2ecf20Sopenharmony_ci cfg->num_channels = params_channels(params); 4338c2ecf20Sopenharmony_ci 4348c2ecf20Sopenharmony_ci return 0; 4358c2ecf20Sopenharmony_ci} 4368c2ecf20Sopenharmony_cistatic void q6afe_dai_shutdown(struct snd_pcm_substream *substream, 4378c2ecf20Sopenharmony_ci struct snd_soc_dai *dai) 4388c2ecf20Sopenharmony_ci{ 4398c2ecf20Sopenharmony_ci struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); 4408c2ecf20Sopenharmony_ci int rc; 4418c2ecf20Sopenharmony_ci 4428c2ecf20Sopenharmony_ci if (!dai_data->is_port_started[dai->id]) 4438c2ecf20Sopenharmony_ci return; 4448c2ecf20Sopenharmony_ci 4458c2ecf20Sopenharmony_ci rc = q6afe_port_stop(dai_data->port[dai->id]); 4468c2ecf20Sopenharmony_ci if (rc < 0) 4478c2ecf20Sopenharmony_ci dev_err(dai->dev, "fail to close AFE port (%d)\n", rc); 4488c2ecf20Sopenharmony_ci 4498c2ecf20Sopenharmony_ci dai_data->is_port_started[dai->id] = false; 4508c2ecf20Sopenharmony_ci 4518c2ecf20Sopenharmony_ci} 4528c2ecf20Sopenharmony_ci 4538c2ecf20Sopenharmony_cistatic int q6afe_dai_prepare(struct snd_pcm_substream *substream, 4548c2ecf20Sopenharmony_ci struct snd_soc_dai *dai) 4558c2ecf20Sopenharmony_ci{ 4568c2ecf20Sopenharmony_ci struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); 4578c2ecf20Sopenharmony_ci int rc; 4588c2ecf20Sopenharmony_ci 4598c2ecf20Sopenharmony_ci if (dai_data->is_port_started[dai->id]) { 4608c2ecf20Sopenharmony_ci /* stop the port and restart with new port config */ 4618c2ecf20Sopenharmony_ci rc = q6afe_port_stop(dai_data->port[dai->id]); 4628c2ecf20Sopenharmony_ci if (rc < 0) { 4638c2ecf20Sopenharmony_ci dev_err(dai->dev, "fail to close AFE port (%d)\n", rc); 4648c2ecf20Sopenharmony_ci return rc; 4658c2ecf20Sopenharmony_ci } 4668c2ecf20Sopenharmony_ci } 4678c2ecf20Sopenharmony_ci 4688c2ecf20Sopenharmony_ci switch (dai->id) { 4698c2ecf20Sopenharmony_ci case HDMI_RX: 4708c2ecf20Sopenharmony_ci case DISPLAY_PORT_RX: 4718c2ecf20Sopenharmony_ci q6afe_hdmi_port_prepare(dai_data->port[dai->id], 4728c2ecf20Sopenharmony_ci &dai_data->port_config[dai->id].hdmi); 4738c2ecf20Sopenharmony_ci break; 4748c2ecf20Sopenharmony_ci case SLIMBUS_0_RX ... SLIMBUS_6_TX: 4758c2ecf20Sopenharmony_ci q6afe_slim_port_prepare(dai_data->port[dai->id], 4768c2ecf20Sopenharmony_ci &dai_data->port_config[dai->id].slim); 4778c2ecf20Sopenharmony_ci break; 4788c2ecf20Sopenharmony_ci case PRIMARY_MI2S_RX ... QUATERNARY_MI2S_TX: 4798c2ecf20Sopenharmony_ci rc = q6afe_i2s_port_prepare(dai_data->port[dai->id], 4808c2ecf20Sopenharmony_ci &dai_data->port_config[dai->id].i2s_cfg); 4818c2ecf20Sopenharmony_ci if (rc < 0) { 4828c2ecf20Sopenharmony_ci dev_err(dai->dev, "fail to prepare AFE port %x\n", 4838c2ecf20Sopenharmony_ci dai->id); 4848c2ecf20Sopenharmony_ci return rc; 4858c2ecf20Sopenharmony_ci } 4868c2ecf20Sopenharmony_ci break; 4878c2ecf20Sopenharmony_ci case PRIMARY_TDM_RX_0 ... QUINARY_TDM_TX_7: 4888c2ecf20Sopenharmony_ci q6afe_tdm_port_prepare(dai_data->port[dai->id], 4898c2ecf20Sopenharmony_ci &dai_data->port_config[dai->id].tdm); 4908c2ecf20Sopenharmony_ci break; 4918c2ecf20Sopenharmony_ci case WSA_CODEC_DMA_RX_0 ... RX_CODEC_DMA_RX_7: 4928c2ecf20Sopenharmony_ci q6afe_cdc_dma_port_prepare(dai_data->port[dai->id], 4938c2ecf20Sopenharmony_ci &dai_data->port_config[dai->id].dma_cfg); 4948c2ecf20Sopenharmony_ci break; 4958c2ecf20Sopenharmony_ci default: 4968c2ecf20Sopenharmony_ci return -EINVAL; 4978c2ecf20Sopenharmony_ci } 4988c2ecf20Sopenharmony_ci 4998c2ecf20Sopenharmony_ci rc = q6afe_port_start(dai_data->port[dai->id]); 5008c2ecf20Sopenharmony_ci if (rc < 0) { 5018c2ecf20Sopenharmony_ci dev_err(dai->dev, "fail to start AFE port %x\n", dai->id); 5028c2ecf20Sopenharmony_ci return rc; 5038c2ecf20Sopenharmony_ci } 5048c2ecf20Sopenharmony_ci dai_data->is_port_started[dai->id] = true; 5058c2ecf20Sopenharmony_ci 5068c2ecf20Sopenharmony_ci return 0; 5078c2ecf20Sopenharmony_ci} 5088c2ecf20Sopenharmony_ci 5098c2ecf20Sopenharmony_cistatic int q6slim_set_channel_map(struct snd_soc_dai *dai, 5108c2ecf20Sopenharmony_ci unsigned int tx_num, unsigned int *tx_slot, 5118c2ecf20Sopenharmony_ci unsigned int rx_num, unsigned int *rx_slot) 5128c2ecf20Sopenharmony_ci{ 5138c2ecf20Sopenharmony_ci struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); 5148c2ecf20Sopenharmony_ci struct q6afe_port_config *pcfg = &dai_data->port_config[dai->id]; 5158c2ecf20Sopenharmony_ci int i; 5168c2ecf20Sopenharmony_ci 5178c2ecf20Sopenharmony_ci if (dai->id & 0x1) { 5188c2ecf20Sopenharmony_ci /* TX */ 5198c2ecf20Sopenharmony_ci if (!tx_slot) { 5208c2ecf20Sopenharmony_ci pr_err("%s: tx slot not found\n", __func__); 5218c2ecf20Sopenharmony_ci return -EINVAL; 5228c2ecf20Sopenharmony_ci } 5238c2ecf20Sopenharmony_ci 5248c2ecf20Sopenharmony_ci for (i = 0; i < tx_num; i++) 5258c2ecf20Sopenharmony_ci pcfg->slim.ch_mapping[i] = tx_slot[i]; 5268c2ecf20Sopenharmony_ci 5278c2ecf20Sopenharmony_ci pcfg->slim.num_channels = tx_num; 5288c2ecf20Sopenharmony_ci 5298c2ecf20Sopenharmony_ci 5308c2ecf20Sopenharmony_ci } else { 5318c2ecf20Sopenharmony_ci if (!rx_slot) { 5328c2ecf20Sopenharmony_ci pr_err("%s: rx slot not found\n", __func__); 5338c2ecf20Sopenharmony_ci return -EINVAL; 5348c2ecf20Sopenharmony_ci } 5358c2ecf20Sopenharmony_ci 5368c2ecf20Sopenharmony_ci for (i = 0; i < rx_num; i++) 5378c2ecf20Sopenharmony_ci pcfg->slim.ch_mapping[i] = rx_slot[i]; 5388c2ecf20Sopenharmony_ci 5398c2ecf20Sopenharmony_ci pcfg->slim.num_channels = rx_num; 5408c2ecf20Sopenharmony_ci 5418c2ecf20Sopenharmony_ci } 5428c2ecf20Sopenharmony_ci 5438c2ecf20Sopenharmony_ci return 0; 5448c2ecf20Sopenharmony_ci} 5458c2ecf20Sopenharmony_ci 5468c2ecf20Sopenharmony_cistatic int q6afe_mi2s_set_sysclk(struct snd_soc_dai *dai, 5478c2ecf20Sopenharmony_ci int clk_id, unsigned int freq, int dir) 5488c2ecf20Sopenharmony_ci{ 5498c2ecf20Sopenharmony_ci struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); 5508c2ecf20Sopenharmony_ci struct q6afe_port *port = dai_data->port[dai->id]; 5518c2ecf20Sopenharmony_ci 5528c2ecf20Sopenharmony_ci switch (clk_id) { 5538c2ecf20Sopenharmony_ci case LPAIF_DIG_CLK: 5548c2ecf20Sopenharmony_ci return q6afe_port_set_sysclk(port, clk_id, 0, 5, freq, dir); 5558c2ecf20Sopenharmony_ci case LPAIF_BIT_CLK: 5568c2ecf20Sopenharmony_ci case LPAIF_OSR_CLK: 5578c2ecf20Sopenharmony_ci return q6afe_port_set_sysclk(port, clk_id, 5588c2ecf20Sopenharmony_ci Q6AFE_LPASS_CLK_SRC_INTERNAL, 5598c2ecf20Sopenharmony_ci Q6AFE_LPASS_CLK_ROOT_DEFAULT, 5608c2ecf20Sopenharmony_ci freq, dir); 5618c2ecf20Sopenharmony_ci case Q6AFE_LPASS_CLK_ID_PRI_MI2S_IBIT ... Q6AFE_LPASS_CLK_ID_QUI_MI2S_OSR: 5628c2ecf20Sopenharmony_ci case Q6AFE_LPASS_CLK_ID_MCLK_1 ... Q6AFE_LPASS_CLK_ID_INT_MCLK_1: 5638c2ecf20Sopenharmony_ci case Q6AFE_LPASS_CLK_ID_WSA_CORE_MCLK ... Q6AFE_LPASS_CLK_ID_VA_CORE_2X_MCLK: 5648c2ecf20Sopenharmony_ci return q6afe_port_set_sysclk(port, clk_id, 5658c2ecf20Sopenharmony_ci Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO, 5668c2ecf20Sopenharmony_ci Q6AFE_LPASS_CLK_ROOT_DEFAULT, 5678c2ecf20Sopenharmony_ci freq, dir); 5688c2ecf20Sopenharmony_ci case Q6AFE_LPASS_CLK_ID_PRI_TDM_IBIT ... Q6AFE_LPASS_CLK_ID_QUIN_TDM_EBIT: 5698c2ecf20Sopenharmony_ci return q6afe_port_set_sysclk(port, clk_id, 5708c2ecf20Sopenharmony_ci Q6AFE_LPASS_CLK_ATTRIBUTE_INVERT_COUPLE_NO, 5718c2ecf20Sopenharmony_ci Q6AFE_LPASS_CLK_ROOT_DEFAULT, 5728c2ecf20Sopenharmony_ci freq, dir); 5738c2ecf20Sopenharmony_ci } 5748c2ecf20Sopenharmony_ci 5758c2ecf20Sopenharmony_ci return 0; 5768c2ecf20Sopenharmony_ci} 5778c2ecf20Sopenharmony_ci 5788c2ecf20Sopenharmony_cistatic const struct snd_soc_dapm_route q6afe_dapm_routes[] = { 5798c2ecf20Sopenharmony_ci {"HDMI Playback", NULL, "HDMI_RX"}, 5808c2ecf20Sopenharmony_ci {"Display Port Playback", NULL, "DISPLAY_PORT_RX"}, 5818c2ecf20Sopenharmony_ci {"Slimbus Playback", NULL, "SLIMBUS_0_RX"}, 5828c2ecf20Sopenharmony_ci {"Slimbus1 Playback", NULL, "SLIMBUS_1_RX"}, 5838c2ecf20Sopenharmony_ci {"Slimbus2 Playback", NULL, "SLIMBUS_2_RX"}, 5848c2ecf20Sopenharmony_ci {"Slimbus3 Playback", NULL, "SLIMBUS_3_RX"}, 5858c2ecf20Sopenharmony_ci {"Slimbus4 Playback", NULL, "SLIMBUS_4_RX"}, 5868c2ecf20Sopenharmony_ci {"Slimbus5 Playback", NULL, "SLIMBUS_5_RX"}, 5878c2ecf20Sopenharmony_ci {"Slimbus6 Playback", NULL, "SLIMBUS_6_RX"}, 5888c2ecf20Sopenharmony_ci 5898c2ecf20Sopenharmony_ci {"SLIMBUS_0_TX", NULL, "Slimbus Capture"}, 5908c2ecf20Sopenharmony_ci {"SLIMBUS_1_TX", NULL, "Slimbus1 Capture"}, 5918c2ecf20Sopenharmony_ci {"SLIMBUS_2_TX", NULL, "Slimbus2 Capture"}, 5928c2ecf20Sopenharmony_ci {"SLIMBUS_3_TX", NULL, "Slimbus3 Capture"}, 5938c2ecf20Sopenharmony_ci {"SLIMBUS_4_TX", NULL, "Slimbus4 Capture"}, 5948c2ecf20Sopenharmony_ci {"SLIMBUS_5_TX", NULL, "Slimbus5 Capture"}, 5958c2ecf20Sopenharmony_ci {"SLIMBUS_6_TX", NULL, "Slimbus6 Capture"}, 5968c2ecf20Sopenharmony_ci 5978c2ecf20Sopenharmony_ci {"Primary MI2S Playback", NULL, "PRI_MI2S_RX"}, 5988c2ecf20Sopenharmony_ci {"Secondary MI2S Playback", NULL, "SEC_MI2S_RX"}, 5998c2ecf20Sopenharmony_ci {"Tertiary MI2S Playback", NULL, "TERT_MI2S_RX"}, 6008c2ecf20Sopenharmony_ci {"Quaternary MI2S Playback", NULL, "QUAT_MI2S_RX"}, 6018c2ecf20Sopenharmony_ci 6028c2ecf20Sopenharmony_ci {"Primary TDM0 Playback", NULL, "PRIMARY_TDM_RX_0"}, 6038c2ecf20Sopenharmony_ci {"Primary TDM1 Playback", NULL, "PRIMARY_TDM_RX_1"}, 6048c2ecf20Sopenharmony_ci {"Primary TDM2 Playback", NULL, "PRIMARY_TDM_RX_2"}, 6058c2ecf20Sopenharmony_ci {"Primary TDM3 Playback", NULL, "PRIMARY_TDM_RX_3"}, 6068c2ecf20Sopenharmony_ci {"Primary TDM4 Playback", NULL, "PRIMARY_TDM_RX_4"}, 6078c2ecf20Sopenharmony_ci {"Primary TDM5 Playback", NULL, "PRIMARY_TDM_RX_5"}, 6088c2ecf20Sopenharmony_ci {"Primary TDM6 Playback", NULL, "PRIMARY_TDM_RX_6"}, 6098c2ecf20Sopenharmony_ci {"Primary TDM7 Playback", NULL, "PRIMARY_TDM_RX_7"}, 6108c2ecf20Sopenharmony_ci 6118c2ecf20Sopenharmony_ci {"Secondary TDM0 Playback", NULL, "SEC_TDM_RX_0"}, 6128c2ecf20Sopenharmony_ci {"Secondary TDM1 Playback", NULL, "SEC_TDM_RX_1"}, 6138c2ecf20Sopenharmony_ci {"Secondary TDM2 Playback", NULL, "SEC_TDM_RX_2"}, 6148c2ecf20Sopenharmony_ci {"Secondary TDM3 Playback", NULL, "SEC_TDM_RX_3"}, 6158c2ecf20Sopenharmony_ci {"Secondary TDM4 Playback", NULL, "SEC_TDM_RX_4"}, 6168c2ecf20Sopenharmony_ci {"Secondary TDM5 Playback", NULL, "SEC_TDM_RX_5"}, 6178c2ecf20Sopenharmony_ci {"Secondary TDM6 Playback", NULL, "SEC_TDM_RX_6"}, 6188c2ecf20Sopenharmony_ci {"Secondary TDM7 Playback", NULL, "SEC_TDM_RX_7"}, 6198c2ecf20Sopenharmony_ci 6208c2ecf20Sopenharmony_ci {"Tertiary TDM0 Playback", NULL, "TERT_TDM_RX_0"}, 6218c2ecf20Sopenharmony_ci {"Tertiary TDM1 Playback", NULL, "TERT_TDM_RX_1"}, 6228c2ecf20Sopenharmony_ci {"Tertiary TDM2 Playback", NULL, "TERT_TDM_RX_2"}, 6238c2ecf20Sopenharmony_ci {"Tertiary TDM3 Playback", NULL, "TERT_TDM_RX_3"}, 6248c2ecf20Sopenharmony_ci {"Tertiary TDM4 Playback", NULL, "TERT_TDM_RX_4"}, 6258c2ecf20Sopenharmony_ci {"Tertiary TDM5 Playback", NULL, "TERT_TDM_RX_5"}, 6268c2ecf20Sopenharmony_ci {"Tertiary TDM6 Playback", NULL, "TERT_TDM_RX_6"}, 6278c2ecf20Sopenharmony_ci {"Tertiary TDM7 Playback", NULL, "TERT_TDM_RX_7"}, 6288c2ecf20Sopenharmony_ci 6298c2ecf20Sopenharmony_ci {"Quaternary TDM0 Playback", NULL, "QUAT_TDM_RX_0"}, 6308c2ecf20Sopenharmony_ci {"Quaternary TDM1 Playback", NULL, "QUAT_TDM_RX_1"}, 6318c2ecf20Sopenharmony_ci {"Quaternary TDM2 Playback", NULL, "QUAT_TDM_RX_2"}, 6328c2ecf20Sopenharmony_ci {"Quaternary TDM3 Playback", NULL, "QUAT_TDM_RX_3"}, 6338c2ecf20Sopenharmony_ci {"Quaternary TDM4 Playback", NULL, "QUAT_TDM_RX_4"}, 6348c2ecf20Sopenharmony_ci {"Quaternary TDM5 Playback", NULL, "QUAT_TDM_RX_5"}, 6358c2ecf20Sopenharmony_ci {"Quaternary TDM6 Playback", NULL, "QUAT_TDM_RX_6"}, 6368c2ecf20Sopenharmony_ci {"Quaternary TDM7 Playback", NULL, "QUAT_TDM_RX_7"}, 6378c2ecf20Sopenharmony_ci 6388c2ecf20Sopenharmony_ci {"Quinary TDM0 Playback", NULL, "QUIN_TDM_RX_0"}, 6398c2ecf20Sopenharmony_ci {"Quinary TDM1 Playback", NULL, "QUIN_TDM_RX_1"}, 6408c2ecf20Sopenharmony_ci {"Quinary TDM2 Playback", NULL, "QUIN_TDM_RX_2"}, 6418c2ecf20Sopenharmony_ci {"Quinary TDM3 Playback", NULL, "QUIN_TDM_RX_3"}, 6428c2ecf20Sopenharmony_ci {"Quinary TDM4 Playback", NULL, "QUIN_TDM_RX_4"}, 6438c2ecf20Sopenharmony_ci {"Quinary TDM5 Playback", NULL, "QUIN_TDM_RX_5"}, 6448c2ecf20Sopenharmony_ci {"Quinary TDM6 Playback", NULL, "QUIN_TDM_RX_6"}, 6458c2ecf20Sopenharmony_ci {"Quinary TDM7 Playback", NULL, "QUIN_TDM_RX_7"}, 6468c2ecf20Sopenharmony_ci 6478c2ecf20Sopenharmony_ci {"PRIMARY_TDM_TX_0", NULL, "Primary TDM0 Capture"}, 6488c2ecf20Sopenharmony_ci {"PRIMARY_TDM_TX_1", NULL, "Primary TDM1 Capture"}, 6498c2ecf20Sopenharmony_ci {"PRIMARY_TDM_TX_2", NULL, "Primary TDM2 Capture"}, 6508c2ecf20Sopenharmony_ci {"PRIMARY_TDM_TX_3", NULL, "Primary TDM3 Capture"}, 6518c2ecf20Sopenharmony_ci {"PRIMARY_TDM_TX_4", NULL, "Primary TDM4 Capture"}, 6528c2ecf20Sopenharmony_ci {"PRIMARY_TDM_TX_5", NULL, "Primary TDM5 Capture"}, 6538c2ecf20Sopenharmony_ci {"PRIMARY_TDM_TX_6", NULL, "Primary TDM6 Capture"}, 6548c2ecf20Sopenharmony_ci {"PRIMARY_TDM_TX_7", NULL, "Primary TDM7 Capture"}, 6558c2ecf20Sopenharmony_ci 6568c2ecf20Sopenharmony_ci {"SEC_TDM_TX_0", NULL, "Secondary TDM0 Capture"}, 6578c2ecf20Sopenharmony_ci {"SEC_TDM_TX_1", NULL, "Secondary TDM1 Capture"}, 6588c2ecf20Sopenharmony_ci {"SEC_TDM_TX_2", NULL, "Secondary TDM2 Capture"}, 6598c2ecf20Sopenharmony_ci {"SEC_TDM_TX_3", NULL, "Secondary TDM3 Capture"}, 6608c2ecf20Sopenharmony_ci {"SEC_TDM_TX_4", NULL, "Secondary TDM4 Capture"}, 6618c2ecf20Sopenharmony_ci {"SEC_TDM_TX_5", NULL, "Secondary TDM5 Capture"}, 6628c2ecf20Sopenharmony_ci {"SEC_TDM_TX_6", NULL, "Secondary TDM6 Capture"}, 6638c2ecf20Sopenharmony_ci {"SEC_TDM_TX_7", NULL, "Secondary TDM7 Capture"}, 6648c2ecf20Sopenharmony_ci 6658c2ecf20Sopenharmony_ci {"TERT_TDM_TX_0", NULL, "Tertiary TDM0 Capture"}, 6668c2ecf20Sopenharmony_ci {"TERT_TDM_TX_1", NULL, "Tertiary TDM1 Capture"}, 6678c2ecf20Sopenharmony_ci {"TERT_TDM_TX_2", NULL, "Tertiary TDM2 Capture"}, 6688c2ecf20Sopenharmony_ci {"TERT_TDM_TX_3", NULL, "Tertiary TDM3 Capture"}, 6698c2ecf20Sopenharmony_ci {"TERT_TDM_TX_4", NULL, "Tertiary TDM4 Capture"}, 6708c2ecf20Sopenharmony_ci {"TERT_TDM_TX_5", NULL, "Tertiary TDM5 Capture"}, 6718c2ecf20Sopenharmony_ci {"TERT_TDM_TX_6", NULL, "Tertiary TDM6 Capture"}, 6728c2ecf20Sopenharmony_ci {"TERT_TDM_TX_7", NULL, "Tertiary TDM7 Capture"}, 6738c2ecf20Sopenharmony_ci 6748c2ecf20Sopenharmony_ci {"QUAT_TDM_TX_0", NULL, "Quaternary TDM0 Capture"}, 6758c2ecf20Sopenharmony_ci {"QUAT_TDM_TX_1", NULL, "Quaternary TDM1 Capture"}, 6768c2ecf20Sopenharmony_ci {"QUAT_TDM_TX_2", NULL, "Quaternary TDM2 Capture"}, 6778c2ecf20Sopenharmony_ci {"QUAT_TDM_TX_3", NULL, "Quaternary TDM3 Capture"}, 6788c2ecf20Sopenharmony_ci {"QUAT_TDM_TX_4", NULL, "Quaternary TDM4 Capture"}, 6798c2ecf20Sopenharmony_ci {"QUAT_TDM_TX_5", NULL, "Quaternary TDM5 Capture"}, 6808c2ecf20Sopenharmony_ci {"QUAT_TDM_TX_6", NULL, "Quaternary TDM6 Capture"}, 6818c2ecf20Sopenharmony_ci {"QUAT_TDM_TX_7", NULL, "Quaternary TDM7 Capture"}, 6828c2ecf20Sopenharmony_ci 6838c2ecf20Sopenharmony_ci {"QUIN_TDM_TX_0", NULL, "Quinary TDM0 Capture"}, 6848c2ecf20Sopenharmony_ci {"QUIN_TDM_TX_1", NULL, "Quinary TDM1 Capture"}, 6858c2ecf20Sopenharmony_ci {"QUIN_TDM_TX_2", NULL, "Quinary TDM2 Capture"}, 6868c2ecf20Sopenharmony_ci {"QUIN_TDM_TX_3", NULL, "Quinary TDM3 Capture"}, 6878c2ecf20Sopenharmony_ci {"QUIN_TDM_TX_4", NULL, "Quinary TDM4 Capture"}, 6888c2ecf20Sopenharmony_ci {"QUIN_TDM_TX_5", NULL, "Quinary TDM5 Capture"}, 6898c2ecf20Sopenharmony_ci {"QUIN_TDM_TX_6", NULL, "Quinary TDM6 Capture"}, 6908c2ecf20Sopenharmony_ci {"QUIN_TDM_TX_7", NULL, "Quinary TDM7 Capture"}, 6918c2ecf20Sopenharmony_ci 6928c2ecf20Sopenharmony_ci {"TERT_MI2S_TX", NULL, "Tertiary MI2S Capture"}, 6938c2ecf20Sopenharmony_ci {"PRI_MI2S_TX", NULL, "Primary MI2S Capture"}, 6948c2ecf20Sopenharmony_ci {"SEC_MI2S_TX", NULL, "Secondary MI2S Capture"}, 6958c2ecf20Sopenharmony_ci {"QUAT_MI2S_TX", NULL, "Quaternary MI2S Capture"}, 6968c2ecf20Sopenharmony_ci 6978c2ecf20Sopenharmony_ci {"WSA_CODEC_DMA_RX_0 Playback", NULL, "WSA_CODEC_DMA_RX_0"}, 6988c2ecf20Sopenharmony_ci {"WSA_CODEC_DMA_TX_0", NULL, "WSA_CODEC_DMA_TX_0 Capture"}, 6998c2ecf20Sopenharmony_ci {"WSA_CODEC_DMA_RX_1 Playback", NULL, "WSA_CODEC_DMA_RX_1"}, 7008c2ecf20Sopenharmony_ci {"WSA_CODEC_DMA_TX_1", NULL, "WSA_CODEC_DMA_TX_1 Capture"}, 7018c2ecf20Sopenharmony_ci {"WSA_CODEC_DMA_TX_2", NULL, "WSA_CODEC_DMA_TX_2 Capture"}, 7028c2ecf20Sopenharmony_ci {"VA_CODEC_DMA_TX_0", NULL, "VA_CODEC_DMA_TX_0 Capture"}, 7038c2ecf20Sopenharmony_ci {"VA_CODEC_DMA_TX_1", NULL, "VA_CODEC_DMA_TX_1 Capture"}, 7048c2ecf20Sopenharmony_ci {"VA_CODEC_DMA_TX_2", NULL, "VA_CODEC_DMA_TX_2 Capture"}, 7058c2ecf20Sopenharmony_ci {"RX_CODEC_DMA_RX_0 Playback", NULL, "RX_CODEC_DMA_RX_0"}, 7068c2ecf20Sopenharmony_ci {"TX_CODEC_DMA_TX_0", NULL, "TX_CODEC_DMA_TX_0 Capture"}, 7078c2ecf20Sopenharmony_ci {"RX_CODEC_DMA_RX_1 Playback", NULL, "RX_CODEC_DMA_RX_1"}, 7088c2ecf20Sopenharmony_ci {"TX_CODEC_DMA_TX_1", NULL, "TX_CODEC_DMA_TX_1 Capture"}, 7098c2ecf20Sopenharmony_ci {"RX_CODEC_DMA_RX_2 Playback", NULL, "RX_CODEC_DMA_RX_2"}, 7108c2ecf20Sopenharmony_ci {"TX_CODEC_DMA_TX_2", NULL, "TX_CODEC_DMA_TX_2 Capture"}, 7118c2ecf20Sopenharmony_ci {"RX_CODEC_DMA_RX_3 Playback", NULL, "RX_CODEC_DMA_RX_3"}, 7128c2ecf20Sopenharmony_ci {"TX_CODEC_DMA_TX_3", NULL, "TX_CODEC_DMA_TX_3 Capture"}, 7138c2ecf20Sopenharmony_ci {"RX_CODEC_DMA_RX_4 Playback", NULL, "RX_CODEC_DMA_RX_4"}, 7148c2ecf20Sopenharmony_ci {"TX_CODEC_DMA_TX_4", NULL, "TX_CODEC_DMA_TX_4 Capture"}, 7158c2ecf20Sopenharmony_ci {"RX_CODEC_DMA_RX_5 Playback", NULL, "RX_CODEC_DMA_RX_5"}, 7168c2ecf20Sopenharmony_ci {"TX_CODEC_DMA_TX_5", NULL, "TX_CODEC_DMA_TX_5 Capture"}, 7178c2ecf20Sopenharmony_ci {"RX_CODEC_DMA_RX_6 Playback", NULL, "RX_CODEC_DMA_RX_6"}, 7188c2ecf20Sopenharmony_ci {"RX_CODEC_DMA_RX_7 Playback", NULL, "RX_CODEC_DMA_RX_7"}, 7198c2ecf20Sopenharmony_ci}; 7208c2ecf20Sopenharmony_ci 7218c2ecf20Sopenharmony_cistatic const struct snd_soc_dai_ops q6hdmi_ops = { 7228c2ecf20Sopenharmony_ci .prepare = q6afe_dai_prepare, 7238c2ecf20Sopenharmony_ci .hw_params = q6hdmi_hw_params, 7248c2ecf20Sopenharmony_ci .shutdown = q6afe_dai_shutdown, 7258c2ecf20Sopenharmony_ci}; 7268c2ecf20Sopenharmony_ci 7278c2ecf20Sopenharmony_cistatic const struct snd_soc_dai_ops q6i2s_ops = { 7288c2ecf20Sopenharmony_ci .prepare = q6afe_dai_prepare, 7298c2ecf20Sopenharmony_ci .hw_params = q6i2s_hw_params, 7308c2ecf20Sopenharmony_ci .set_fmt = q6i2s_set_fmt, 7318c2ecf20Sopenharmony_ci .shutdown = q6afe_dai_shutdown, 7328c2ecf20Sopenharmony_ci .set_sysclk = q6afe_mi2s_set_sysclk, 7338c2ecf20Sopenharmony_ci}; 7348c2ecf20Sopenharmony_ci 7358c2ecf20Sopenharmony_cistatic const struct snd_soc_dai_ops q6slim_ops = { 7368c2ecf20Sopenharmony_ci .prepare = q6afe_dai_prepare, 7378c2ecf20Sopenharmony_ci .hw_params = q6slim_hw_params, 7388c2ecf20Sopenharmony_ci .shutdown = q6afe_dai_shutdown, 7398c2ecf20Sopenharmony_ci .set_channel_map = q6slim_set_channel_map, 7408c2ecf20Sopenharmony_ci}; 7418c2ecf20Sopenharmony_ci 7428c2ecf20Sopenharmony_cistatic const struct snd_soc_dai_ops q6tdm_ops = { 7438c2ecf20Sopenharmony_ci .prepare = q6afe_dai_prepare, 7448c2ecf20Sopenharmony_ci .shutdown = q6afe_dai_shutdown, 7458c2ecf20Sopenharmony_ci .set_sysclk = q6afe_mi2s_set_sysclk, 7468c2ecf20Sopenharmony_ci .set_tdm_slot = q6tdm_set_tdm_slot, 7478c2ecf20Sopenharmony_ci .set_channel_map = q6tdm_set_channel_map, 7488c2ecf20Sopenharmony_ci .hw_params = q6tdm_hw_params, 7498c2ecf20Sopenharmony_ci}; 7508c2ecf20Sopenharmony_ci 7518c2ecf20Sopenharmony_cistatic const struct snd_soc_dai_ops q6dma_ops = { 7528c2ecf20Sopenharmony_ci .prepare = q6afe_dai_prepare, 7538c2ecf20Sopenharmony_ci .shutdown = q6afe_dai_shutdown, 7548c2ecf20Sopenharmony_ci .set_sysclk = q6afe_mi2s_set_sysclk, 7558c2ecf20Sopenharmony_ci .set_channel_map = q6dma_set_channel_map, 7568c2ecf20Sopenharmony_ci .hw_params = q6dma_hw_params, 7578c2ecf20Sopenharmony_ci}; 7588c2ecf20Sopenharmony_ci 7598c2ecf20Sopenharmony_cistatic int msm_dai_q6_dai_probe(struct snd_soc_dai *dai) 7608c2ecf20Sopenharmony_ci{ 7618c2ecf20Sopenharmony_ci struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); 7628c2ecf20Sopenharmony_ci struct q6afe_port *port; 7638c2ecf20Sopenharmony_ci 7648c2ecf20Sopenharmony_ci port = q6afe_port_get_from_id(dai->dev, dai->id); 7658c2ecf20Sopenharmony_ci if (IS_ERR(port)) { 7668c2ecf20Sopenharmony_ci dev_err(dai->dev, "Unable to get afe port\n"); 7678c2ecf20Sopenharmony_ci return -EINVAL; 7688c2ecf20Sopenharmony_ci } 7698c2ecf20Sopenharmony_ci dai_data->port[dai->id] = port; 7708c2ecf20Sopenharmony_ci 7718c2ecf20Sopenharmony_ci return 0; 7728c2ecf20Sopenharmony_ci} 7738c2ecf20Sopenharmony_ci 7748c2ecf20Sopenharmony_cistatic int msm_dai_q6_dai_remove(struct snd_soc_dai *dai) 7758c2ecf20Sopenharmony_ci{ 7768c2ecf20Sopenharmony_ci struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); 7778c2ecf20Sopenharmony_ci 7788c2ecf20Sopenharmony_ci q6afe_port_put(dai_data->port[dai->id]); 7798c2ecf20Sopenharmony_ci dai_data->port[dai->id] = NULL; 7808c2ecf20Sopenharmony_ci 7818c2ecf20Sopenharmony_ci return 0; 7828c2ecf20Sopenharmony_ci} 7838c2ecf20Sopenharmony_ci 7848c2ecf20Sopenharmony_cistatic struct snd_soc_dai_driver q6afe_dais[] = { 7858c2ecf20Sopenharmony_ci { 7868c2ecf20Sopenharmony_ci .playback = { 7878c2ecf20Sopenharmony_ci .stream_name = "HDMI Playback", 7888c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | 7898c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_96000 | 7908c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_192000, 7918c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 7928c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 7938c2ecf20Sopenharmony_ci .channels_min = 2, 7948c2ecf20Sopenharmony_ci .channels_max = 8, 7958c2ecf20Sopenharmony_ci .rate_max = 192000, 7968c2ecf20Sopenharmony_ci .rate_min = 48000, 7978c2ecf20Sopenharmony_ci }, 7988c2ecf20Sopenharmony_ci .ops = &q6hdmi_ops, 7998c2ecf20Sopenharmony_ci .id = HDMI_RX, 8008c2ecf20Sopenharmony_ci .name = "HDMI", 8018c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 8028c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 8038c2ecf20Sopenharmony_ci }, { 8048c2ecf20Sopenharmony_ci .name = "SLIMBUS_0_RX", 8058c2ecf20Sopenharmony_ci .ops = &q6slim_ops, 8068c2ecf20Sopenharmony_ci .id = SLIMBUS_0_RX, 8078c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 8088c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 8098c2ecf20Sopenharmony_ci .playback = { 8108c2ecf20Sopenharmony_ci .stream_name = "Slimbus Playback", 8118c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | 8128c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 | 8138c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_192000, 8148c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 8158c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 8168c2ecf20Sopenharmony_ci .channels_min = 1, 8178c2ecf20Sopenharmony_ci .channels_max = 8, 8188c2ecf20Sopenharmony_ci .rate_min = 8000, 8198c2ecf20Sopenharmony_ci .rate_max = 192000, 8208c2ecf20Sopenharmony_ci }, 8218c2ecf20Sopenharmony_ci }, { 8228c2ecf20Sopenharmony_ci .name = "SLIMBUS_0_TX", 8238c2ecf20Sopenharmony_ci .ops = &q6slim_ops, 8248c2ecf20Sopenharmony_ci .id = SLIMBUS_0_TX, 8258c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 8268c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 8278c2ecf20Sopenharmony_ci .capture = { 8288c2ecf20Sopenharmony_ci .stream_name = "Slimbus Capture", 8298c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | 8308c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 | 8318c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_192000, 8328c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 8338c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 8348c2ecf20Sopenharmony_ci .channels_min = 1, 8358c2ecf20Sopenharmony_ci .channels_max = 8, 8368c2ecf20Sopenharmony_ci .rate_min = 8000, 8378c2ecf20Sopenharmony_ci .rate_max = 192000, 8388c2ecf20Sopenharmony_ci }, 8398c2ecf20Sopenharmony_ci }, { 8408c2ecf20Sopenharmony_ci .playback = { 8418c2ecf20Sopenharmony_ci .stream_name = "Slimbus1 Playback", 8428c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | 8438c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 | 8448c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_192000, 8458c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 8468c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 8478c2ecf20Sopenharmony_ci .channels_min = 1, 8488c2ecf20Sopenharmony_ci .channels_max = 2, 8498c2ecf20Sopenharmony_ci .rate_min = 8000, 8508c2ecf20Sopenharmony_ci .rate_max = 192000, 8518c2ecf20Sopenharmony_ci }, 8528c2ecf20Sopenharmony_ci .name = "SLIMBUS_1_RX", 8538c2ecf20Sopenharmony_ci .ops = &q6slim_ops, 8548c2ecf20Sopenharmony_ci .id = SLIMBUS_1_RX, 8558c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 8568c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 8578c2ecf20Sopenharmony_ci }, { 8588c2ecf20Sopenharmony_ci .name = "SLIMBUS_1_TX", 8598c2ecf20Sopenharmony_ci .ops = &q6slim_ops, 8608c2ecf20Sopenharmony_ci .id = SLIMBUS_1_TX, 8618c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 8628c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 8638c2ecf20Sopenharmony_ci .capture = { 8648c2ecf20Sopenharmony_ci .stream_name = "Slimbus1 Capture", 8658c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | 8668c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 | 8678c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_192000, 8688c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 8698c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 8708c2ecf20Sopenharmony_ci .channels_min = 1, 8718c2ecf20Sopenharmony_ci .channels_max = 8, 8728c2ecf20Sopenharmony_ci .rate_min = 8000, 8738c2ecf20Sopenharmony_ci .rate_max = 192000, 8748c2ecf20Sopenharmony_ci }, 8758c2ecf20Sopenharmony_ci }, { 8768c2ecf20Sopenharmony_ci .playback = { 8778c2ecf20Sopenharmony_ci .stream_name = "Slimbus2 Playback", 8788c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | 8798c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 | 8808c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_192000, 8818c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 8828c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 8838c2ecf20Sopenharmony_ci .channels_min = 1, 8848c2ecf20Sopenharmony_ci .channels_max = 8, 8858c2ecf20Sopenharmony_ci .rate_min = 8000, 8868c2ecf20Sopenharmony_ci .rate_max = 192000, 8878c2ecf20Sopenharmony_ci }, 8888c2ecf20Sopenharmony_ci .name = "SLIMBUS_2_RX", 8898c2ecf20Sopenharmony_ci .ops = &q6slim_ops, 8908c2ecf20Sopenharmony_ci .id = SLIMBUS_2_RX, 8918c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 8928c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 8938c2ecf20Sopenharmony_ci 8948c2ecf20Sopenharmony_ci }, { 8958c2ecf20Sopenharmony_ci .name = "SLIMBUS_2_TX", 8968c2ecf20Sopenharmony_ci .ops = &q6slim_ops, 8978c2ecf20Sopenharmony_ci .id = SLIMBUS_2_TX, 8988c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 8998c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 9008c2ecf20Sopenharmony_ci .capture = { 9018c2ecf20Sopenharmony_ci .stream_name = "Slimbus2 Capture", 9028c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | 9038c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 | 9048c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_192000, 9058c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 9068c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 9078c2ecf20Sopenharmony_ci .channels_min = 1, 9088c2ecf20Sopenharmony_ci .channels_max = 8, 9098c2ecf20Sopenharmony_ci .rate_min = 8000, 9108c2ecf20Sopenharmony_ci .rate_max = 192000, 9118c2ecf20Sopenharmony_ci }, 9128c2ecf20Sopenharmony_ci }, { 9138c2ecf20Sopenharmony_ci .playback = { 9148c2ecf20Sopenharmony_ci .stream_name = "Slimbus3 Playback", 9158c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | 9168c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 | 9178c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_192000, 9188c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 9198c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 9208c2ecf20Sopenharmony_ci .channels_min = 1, 9218c2ecf20Sopenharmony_ci .channels_max = 2, 9228c2ecf20Sopenharmony_ci .rate_min = 8000, 9238c2ecf20Sopenharmony_ci .rate_max = 192000, 9248c2ecf20Sopenharmony_ci }, 9258c2ecf20Sopenharmony_ci .name = "SLIMBUS_3_RX", 9268c2ecf20Sopenharmony_ci .ops = &q6slim_ops, 9278c2ecf20Sopenharmony_ci .id = SLIMBUS_3_RX, 9288c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 9298c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 9308c2ecf20Sopenharmony_ci 9318c2ecf20Sopenharmony_ci }, { 9328c2ecf20Sopenharmony_ci .name = "SLIMBUS_3_TX", 9338c2ecf20Sopenharmony_ci .ops = &q6slim_ops, 9348c2ecf20Sopenharmony_ci .id = SLIMBUS_3_TX, 9358c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 9368c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 9378c2ecf20Sopenharmony_ci .capture = { 9388c2ecf20Sopenharmony_ci .stream_name = "Slimbus3 Capture", 9398c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | 9408c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 | 9418c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_192000, 9428c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 9438c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 9448c2ecf20Sopenharmony_ci .channels_min = 1, 9458c2ecf20Sopenharmony_ci .channels_max = 8, 9468c2ecf20Sopenharmony_ci .rate_min = 8000, 9478c2ecf20Sopenharmony_ci .rate_max = 192000, 9488c2ecf20Sopenharmony_ci }, 9498c2ecf20Sopenharmony_ci }, { 9508c2ecf20Sopenharmony_ci .playback = { 9518c2ecf20Sopenharmony_ci .stream_name = "Slimbus4 Playback", 9528c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | 9538c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 | 9548c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_192000, 9558c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 9568c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 9578c2ecf20Sopenharmony_ci .channels_min = 1, 9588c2ecf20Sopenharmony_ci .channels_max = 2, 9598c2ecf20Sopenharmony_ci .rate_min = 8000, 9608c2ecf20Sopenharmony_ci .rate_max = 192000, 9618c2ecf20Sopenharmony_ci }, 9628c2ecf20Sopenharmony_ci .name = "SLIMBUS_4_RX", 9638c2ecf20Sopenharmony_ci .ops = &q6slim_ops, 9648c2ecf20Sopenharmony_ci .id = SLIMBUS_4_RX, 9658c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 9668c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 9678c2ecf20Sopenharmony_ci 9688c2ecf20Sopenharmony_ci }, { 9698c2ecf20Sopenharmony_ci .name = "SLIMBUS_4_TX", 9708c2ecf20Sopenharmony_ci .ops = &q6slim_ops, 9718c2ecf20Sopenharmony_ci .id = SLIMBUS_4_TX, 9728c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 9738c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 9748c2ecf20Sopenharmony_ci .capture = { 9758c2ecf20Sopenharmony_ci .stream_name = "Slimbus4 Capture", 9768c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | 9778c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 | 9788c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_192000, 9798c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 9808c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 9818c2ecf20Sopenharmony_ci .channels_min = 1, 9828c2ecf20Sopenharmony_ci .channels_max = 8, 9838c2ecf20Sopenharmony_ci .rate_min = 8000, 9848c2ecf20Sopenharmony_ci .rate_max = 192000, 9858c2ecf20Sopenharmony_ci }, 9868c2ecf20Sopenharmony_ci }, { 9878c2ecf20Sopenharmony_ci .playback = { 9888c2ecf20Sopenharmony_ci .stream_name = "Slimbus5 Playback", 9898c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | 9908c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 | 9918c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_192000, 9928c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 9938c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 9948c2ecf20Sopenharmony_ci .channels_min = 1, 9958c2ecf20Sopenharmony_ci .channels_max = 2, 9968c2ecf20Sopenharmony_ci .rate_min = 8000, 9978c2ecf20Sopenharmony_ci .rate_max = 192000, 9988c2ecf20Sopenharmony_ci }, 9998c2ecf20Sopenharmony_ci .name = "SLIMBUS_5_RX", 10008c2ecf20Sopenharmony_ci .ops = &q6slim_ops, 10018c2ecf20Sopenharmony_ci .id = SLIMBUS_5_RX, 10028c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 10038c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 10048c2ecf20Sopenharmony_ci 10058c2ecf20Sopenharmony_ci }, { 10068c2ecf20Sopenharmony_ci .name = "SLIMBUS_5_TX", 10078c2ecf20Sopenharmony_ci .ops = &q6slim_ops, 10088c2ecf20Sopenharmony_ci .id = SLIMBUS_5_TX, 10098c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 10108c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 10118c2ecf20Sopenharmony_ci .capture = { 10128c2ecf20Sopenharmony_ci .stream_name = "Slimbus5 Capture", 10138c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | 10148c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 | 10158c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_192000, 10168c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 10178c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 10188c2ecf20Sopenharmony_ci .channels_min = 1, 10198c2ecf20Sopenharmony_ci .channels_max = 8, 10208c2ecf20Sopenharmony_ci .rate_min = 8000, 10218c2ecf20Sopenharmony_ci .rate_max = 192000, 10228c2ecf20Sopenharmony_ci }, 10238c2ecf20Sopenharmony_ci }, { 10248c2ecf20Sopenharmony_ci .playback = { 10258c2ecf20Sopenharmony_ci .stream_name = "Slimbus6 Playback", 10268c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | 10278c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 | 10288c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_192000, 10298c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 10308c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 10318c2ecf20Sopenharmony_ci .channels_min = 1, 10328c2ecf20Sopenharmony_ci .channels_max = 2, 10338c2ecf20Sopenharmony_ci .rate_min = 8000, 10348c2ecf20Sopenharmony_ci .rate_max = 192000, 10358c2ecf20Sopenharmony_ci }, 10368c2ecf20Sopenharmony_ci .ops = &q6slim_ops, 10378c2ecf20Sopenharmony_ci .name = "SLIMBUS_6_RX", 10388c2ecf20Sopenharmony_ci .id = SLIMBUS_6_RX, 10398c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 10408c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 10418c2ecf20Sopenharmony_ci 10428c2ecf20Sopenharmony_ci }, { 10438c2ecf20Sopenharmony_ci .name = "SLIMBUS_6_TX", 10448c2ecf20Sopenharmony_ci .ops = &q6slim_ops, 10458c2ecf20Sopenharmony_ci .id = SLIMBUS_6_TX, 10468c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 10478c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 10488c2ecf20Sopenharmony_ci .capture = { 10498c2ecf20Sopenharmony_ci .stream_name = "Slimbus6 Capture", 10508c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | 10518c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 | 10528c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_192000, 10538c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 10548c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 10558c2ecf20Sopenharmony_ci .channels_min = 1, 10568c2ecf20Sopenharmony_ci .channels_max = 8, 10578c2ecf20Sopenharmony_ci .rate_min = 8000, 10588c2ecf20Sopenharmony_ci .rate_max = 192000, 10598c2ecf20Sopenharmony_ci }, 10608c2ecf20Sopenharmony_ci }, { 10618c2ecf20Sopenharmony_ci .playback = { 10628c2ecf20Sopenharmony_ci .stream_name = "Primary MI2S Playback", 10638c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | 10648c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_16000, 10658c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 10668c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 10678c2ecf20Sopenharmony_ci .channels_min = 1, 10688c2ecf20Sopenharmony_ci .channels_max = 8, 10698c2ecf20Sopenharmony_ci .rate_min = 8000, 10708c2ecf20Sopenharmony_ci .rate_max = 48000, 10718c2ecf20Sopenharmony_ci }, 10728c2ecf20Sopenharmony_ci .id = PRIMARY_MI2S_RX, 10738c2ecf20Sopenharmony_ci .name = "PRI_MI2S_RX", 10748c2ecf20Sopenharmony_ci .ops = &q6i2s_ops, 10758c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 10768c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 10778c2ecf20Sopenharmony_ci }, { 10788c2ecf20Sopenharmony_ci .capture = { 10798c2ecf20Sopenharmony_ci .stream_name = "Primary MI2S Capture", 10808c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | 10818c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_16000, 10828c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 10838c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 10848c2ecf20Sopenharmony_ci .channels_min = 1, 10858c2ecf20Sopenharmony_ci .channels_max = 8, 10868c2ecf20Sopenharmony_ci .rate_min = 8000, 10878c2ecf20Sopenharmony_ci .rate_max = 48000, 10888c2ecf20Sopenharmony_ci }, 10898c2ecf20Sopenharmony_ci .id = PRIMARY_MI2S_TX, 10908c2ecf20Sopenharmony_ci .name = "PRI_MI2S_TX", 10918c2ecf20Sopenharmony_ci .ops = &q6i2s_ops, 10928c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 10938c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 10948c2ecf20Sopenharmony_ci }, { 10958c2ecf20Sopenharmony_ci .playback = { 10968c2ecf20Sopenharmony_ci .stream_name = "Secondary MI2S Playback", 10978c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | 10988c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_16000, 10998c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE, 11008c2ecf20Sopenharmony_ci .channels_min = 1, 11018c2ecf20Sopenharmony_ci .channels_max = 8, 11028c2ecf20Sopenharmony_ci .rate_min = 8000, 11038c2ecf20Sopenharmony_ci .rate_max = 48000, 11048c2ecf20Sopenharmony_ci }, 11058c2ecf20Sopenharmony_ci .name = "SEC_MI2S_RX", 11068c2ecf20Sopenharmony_ci .id = SECONDARY_MI2S_RX, 11078c2ecf20Sopenharmony_ci .ops = &q6i2s_ops, 11088c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 11098c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 11108c2ecf20Sopenharmony_ci }, { 11118c2ecf20Sopenharmony_ci .capture = { 11128c2ecf20Sopenharmony_ci .stream_name = "Secondary MI2S Capture", 11138c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | 11148c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_16000, 11158c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 11168c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 11178c2ecf20Sopenharmony_ci .channels_min = 1, 11188c2ecf20Sopenharmony_ci .channels_max = 8, 11198c2ecf20Sopenharmony_ci .rate_min = 8000, 11208c2ecf20Sopenharmony_ci .rate_max = 48000, 11218c2ecf20Sopenharmony_ci }, 11228c2ecf20Sopenharmony_ci .id = SECONDARY_MI2S_TX, 11238c2ecf20Sopenharmony_ci .name = "SEC_MI2S_TX", 11248c2ecf20Sopenharmony_ci .ops = &q6i2s_ops, 11258c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 11268c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 11278c2ecf20Sopenharmony_ci }, { 11288c2ecf20Sopenharmony_ci .playback = { 11298c2ecf20Sopenharmony_ci .stream_name = "Tertiary MI2S Playback", 11308c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | 11318c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_16000, 11328c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE, 11338c2ecf20Sopenharmony_ci .channels_min = 1, 11348c2ecf20Sopenharmony_ci .channels_max = 8, 11358c2ecf20Sopenharmony_ci .rate_min = 8000, 11368c2ecf20Sopenharmony_ci .rate_max = 48000, 11378c2ecf20Sopenharmony_ci }, 11388c2ecf20Sopenharmony_ci .name = "TERT_MI2S_RX", 11398c2ecf20Sopenharmony_ci .id = TERTIARY_MI2S_RX, 11408c2ecf20Sopenharmony_ci .ops = &q6i2s_ops, 11418c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 11428c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 11438c2ecf20Sopenharmony_ci }, { 11448c2ecf20Sopenharmony_ci .capture = { 11458c2ecf20Sopenharmony_ci .stream_name = "Tertiary MI2S Capture", 11468c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | 11478c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_16000, 11488c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 11498c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 11508c2ecf20Sopenharmony_ci .channels_min = 1, 11518c2ecf20Sopenharmony_ci .channels_max = 8, 11528c2ecf20Sopenharmony_ci .rate_min = 8000, 11538c2ecf20Sopenharmony_ci .rate_max = 48000, 11548c2ecf20Sopenharmony_ci }, 11558c2ecf20Sopenharmony_ci .id = TERTIARY_MI2S_TX, 11568c2ecf20Sopenharmony_ci .name = "TERT_MI2S_TX", 11578c2ecf20Sopenharmony_ci .ops = &q6i2s_ops, 11588c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 11598c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 11608c2ecf20Sopenharmony_ci }, { 11618c2ecf20Sopenharmony_ci .playback = { 11628c2ecf20Sopenharmony_ci .stream_name = "Quaternary MI2S Playback", 11638c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | 11648c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_16000, 11658c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE, 11668c2ecf20Sopenharmony_ci .channels_min = 1, 11678c2ecf20Sopenharmony_ci .channels_max = 8, 11688c2ecf20Sopenharmony_ci .rate_min = 8000, 11698c2ecf20Sopenharmony_ci .rate_max = 48000, 11708c2ecf20Sopenharmony_ci }, 11718c2ecf20Sopenharmony_ci .name = "QUAT_MI2S_RX", 11728c2ecf20Sopenharmony_ci .id = QUATERNARY_MI2S_RX, 11738c2ecf20Sopenharmony_ci .ops = &q6i2s_ops, 11748c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 11758c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 11768c2ecf20Sopenharmony_ci }, { 11778c2ecf20Sopenharmony_ci .capture = { 11788c2ecf20Sopenharmony_ci .stream_name = "Quaternary MI2S Capture", 11798c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | 11808c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_16000, 11818c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 11828c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 11838c2ecf20Sopenharmony_ci .channels_min = 1, 11848c2ecf20Sopenharmony_ci .channels_max = 8, 11858c2ecf20Sopenharmony_ci .rate_min = 8000, 11868c2ecf20Sopenharmony_ci .rate_max = 48000, 11878c2ecf20Sopenharmony_ci }, 11888c2ecf20Sopenharmony_ci .id = QUATERNARY_MI2S_TX, 11898c2ecf20Sopenharmony_ci .name = "QUAT_MI2S_TX", 11908c2ecf20Sopenharmony_ci .ops = &q6i2s_ops, 11918c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 11928c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 11938c2ecf20Sopenharmony_ci }, 11948c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Primary", 0, PRIMARY_TDM_RX_0), 11958c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Primary", 1, PRIMARY_TDM_RX_1), 11968c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Primary", 2, PRIMARY_TDM_RX_2), 11978c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Primary", 3, PRIMARY_TDM_RX_3), 11988c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Primary", 4, PRIMARY_TDM_RX_4), 11998c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Primary", 5, PRIMARY_TDM_RX_5), 12008c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Primary", 6, PRIMARY_TDM_RX_6), 12018c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Primary", 7, PRIMARY_TDM_RX_7), 12028c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Primary", 0, PRIMARY_TDM_TX_0), 12038c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Primary", 1, PRIMARY_TDM_TX_1), 12048c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Primary", 2, PRIMARY_TDM_TX_2), 12058c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Primary", 3, PRIMARY_TDM_TX_3), 12068c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Primary", 4, PRIMARY_TDM_TX_4), 12078c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Primary", 5, PRIMARY_TDM_TX_5), 12088c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Primary", 6, PRIMARY_TDM_TX_6), 12098c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Primary", 7, PRIMARY_TDM_TX_7), 12108c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Secondary", 0, SECONDARY_TDM_RX_0), 12118c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Secondary", 1, SECONDARY_TDM_RX_1), 12128c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Secondary", 2, SECONDARY_TDM_RX_2), 12138c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Secondary", 3, SECONDARY_TDM_RX_3), 12148c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Secondary", 4, SECONDARY_TDM_RX_4), 12158c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Secondary", 5, SECONDARY_TDM_RX_5), 12168c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Secondary", 6, SECONDARY_TDM_RX_6), 12178c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Secondary", 7, SECONDARY_TDM_RX_7), 12188c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Secondary", 0, SECONDARY_TDM_TX_0), 12198c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Secondary", 1, SECONDARY_TDM_TX_1), 12208c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Secondary", 2, SECONDARY_TDM_TX_2), 12218c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Secondary", 3, SECONDARY_TDM_TX_3), 12228c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Secondary", 4, SECONDARY_TDM_TX_4), 12238c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Secondary", 5, SECONDARY_TDM_TX_5), 12248c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Secondary", 6, SECONDARY_TDM_TX_6), 12258c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Secondary", 7, SECONDARY_TDM_TX_7), 12268c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Tertiary", 0, TERTIARY_TDM_RX_0), 12278c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Tertiary", 1, TERTIARY_TDM_RX_1), 12288c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Tertiary", 2, TERTIARY_TDM_RX_2), 12298c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Tertiary", 3, TERTIARY_TDM_RX_3), 12308c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Tertiary", 4, TERTIARY_TDM_RX_4), 12318c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Tertiary", 5, TERTIARY_TDM_RX_5), 12328c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Tertiary", 6, TERTIARY_TDM_RX_6), 12338c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Tertiary", 7, TERTIARY_TDM_RX_7), 12348c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Tertiary", 0, TERTIARY_TDM_TX_0), 12358c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Tertiary", 1, TERTIARY_TDM_TX_1), 12368c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Tertiary", 2, TERTIARY_TDM_TX_2), 12378c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Tertiary", 3, TERTIARY_TDM_TX_3), 12388c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Tertiary", 4, TERTIARY_TDM_TX_4), 12398c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Tertiary", 5, TERTIARY_TDM_TX_5), 12408c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Tertiary", 6, TERTIARY_TDM_TX_6), 12418c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Tertiary", 7, TERTIARY_TDM_TX_7), 12428c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Quaternary", 0, QUATERNARY_TDM_RX_0), 12438c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Quaternary", 1, QUATERNARY_TDM_RX_1), 12448c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Quaternary", 2, QUATERNARY_TDM_RX_2), 12458c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Quaternary", 3, QUATERNARY_TDM_RX_3), 12468c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Quaternary", 4, QUATERNARY_TDM_RX_4), 12478c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Quaternary", 5, QUATERNARY_TDM_RX_5), 12488c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Quaternary", 6, QUATERNARY_TDM_RX_6), 12498c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Quaternary", 7, QUATERNARY_TDM_RX_7), 12508c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Quaternary", 0, QUATERNARY_TDM_TX_0), 12518c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Quaternary", 1, QUATERNARY_TDM_TX_1), 12528c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Quaternary", 2, QUATERNARY_TDM_TX_2), 12538c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Quaternary", 3, QUATERNARY_TDM_TX_3), 12548c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Quaternary", 4, QUATERNARY_TDM_TX_4), 12558c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Quaternary", 5, QUATERNARY_TDM_TX_5), 12568c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Quaternary", 6, QUATERNARY_TDM_TX_6), 12578c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Quaternary", 7, QUATERNARY_TDM_TX_7), 12588c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Quinary", 0, QUINARY_TDM_RX_0), 12598c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Quinary", 1, QUINARY_TDM_RX_1), 12608c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Quinary", 2, QUINARY_TDM_RX_2), 12618c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Quinary", 3, QUINARY_TDM_RX_3), 12628c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Quinary", 4, QUINARY_TDM_RX_4), 12638c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Quinary", 5, QUINARY_TDM_RX_5), 12648c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Quinary", 6, QUINARY_TDM_RX_6), 12658c2ecf20Sopenharmony_ci Q6AFE_TDM_PB_DAI("Quinary", 7, QUINARY_TDM_RX_7), 12668c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Quinary", 0, QUINARY_TDM_TX_0), 12678c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Quinary", 1, QUINARY_TDM_TX_1), 12688c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Quinary", 2, QUINARY_TDM_TX_2), 12698c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Quinary", 3, QUINARY_TDM_TX_3), 12708c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Quinary", 4, QUINARY_TDM_TX_4), 12718c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Quinary", 5, QUINARY_TDM_TX_5), 12728c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Quinary", 6, QUINARY_TDM_TX_6), 12738c2ecf20Sopenharmony_ci Q6AFE_TDM_CAP_DAI("Quinary", 7, QUINARY_TDM_TX_7), 12748c2ecf20Sopenharmony_ci { 12758c2ecf20Sopenharmony_ci .playback = { 12768c2ecf20Sopenharmony_ci .stream_name = "Display Port Playback", 12778c2ecf20Sopenharmony_ci .rates = SNDRV_PCM_RATE_48000 | 12788c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_96000 | 12798c2ecf20Sopenharmony_ci SNDRV_PCM_RATE_192000, 12808c2ecf20Sopenharmony_ci .formats = SNDRV_PCM_FMTBIT_S16_LE | 12818c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S24_LE, 12828c2ecf20Sopenharmony_ci .channels_min = 2, 12838c2ecf20Sopenharmony_ci .channels_max = 8, 12848c2ecf20Sopenharmony_ci .rate_max = 192000, 12858c2ecf20Sopenharmony_ci .rate_min = 48000, 12868c2ecf20Sopenharmony_ci }, 12878c2ecf20Sopenharmony_ci .ops = &q6hdmi_ops, 12888c2ecf20Sopenharmony_ci .id = DISPLAY_PORT_RX, 12898c2ecf20Sopenharmony_ci .name = "DISPLAY_PORT", 12908c2ecf20Sopenharmony_ci .probe = msm_dai_q6_dai_probe, 12918c2ecf20Sopenharmony_ci .remove = msm_dai_q6_dai_remove, 12928c2ecf20Sopenharmony_ci }, 12938c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_RX_DAI(WSA_CODEC_DMA_RX_0), 12948c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_TX_DAI(WSA_CODEC_DMA_TX_0), 12958c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_RX_DAI(WSA_CODEC_DMA_RX_1), 12968c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_TX_DAI(WSA_CODEC_DMA_TX_1), 12978c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_TX_DAI(WSA_CODEC_DMA_TX_2), 12988c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_TX_DAI(VA_CODEC_DMA_TX_0), 12998c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_TX_DAI(VA_CODEC_DMA_TX_1), 13008c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_TX_DAI(VA_CODEC_DMA_TX_2), 13018c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_RX_DAI(RX_CODEC_DMA_RX_0), 13028c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_TX_DAI(TX_CODEC_DMA_TX_0), 13038c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_RX_DAI(RX_CODEC_DMA_RX_1), 13048c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_TX_DAI(TX_CODEC_DMA_TX_1), 13058c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_RX_DAI(RX_CODEC_DMA_RX_2), 13068c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_TX_DAI(TX_CODEC_DMA_TX_2), 13078c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_RX_DAI(RX_CODEC_DMA_RX_3), 13088c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_TX_DAI(TX_CODEC_DMA_TX_3), 13098c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_RX_DAI(RX_CODEC_DMA_RX_4), 13108c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_TX_DAI(TX_CODEC_DMA_TX_4), 13118c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_RX_DAI(RX_CODEC_DMA_RX_5), 13128c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_TX_DAI(TX_CODEC_DMA_TX_5), 13138c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_RX_DAI(RX_CODEC_DMA_RX_6), 13148c2ecf20Sopenharmony_ci Q6AFE_CDC_DMA_RX_DAI(RX_CODEC_DMA_RX_7), 13158c2ecf20Sopenharmony_ci}; 13168c2ecf20Sopenharmony_ci 13178c2ecf20Sopenharmony_cistatic int q6afe_of_xlate_dai_name(struct snd_soc_component *component, 13188c2ecf20Sopenharmony_ci struct of_phandle_args *args, 13198c2ecf20Sopenharmony_ci const char **dai_name) 13208c2ecf20Sopenharmony_ci{ 13218c2ecf20Sopenharmony_ci int id = args->args[0]; 13228c2ecf20Sopenharmony_ci int ret = -EINVAL; 13238c2ecf20Sopenharmony_ci int i; 13248c2ecf20Sopenharmony_ci 13258c2ecf20Sopenharmony_ci for (i = 0; i < ARRAY_SIZE(q6afe_dais); i++) { 13268c2ecf20Sopenharmony_ci if (q6afe_dais[i].id == id) { 13278c2ecf20Sopenharmony_ci *dai_name = q6afe_dais[i].name; 13288c2ecf20Sopenharmony_ci ret = 0; 13298c2ecf20Sopenharmony_ci break; 13308c2ecf20Sopenharmony_ci } 13318c2ecf20Sopenharmony_ci } 13328c2ecf20Sopenharmony_ci 13338c2ecf20Sopenharmony_ci return ret; 13348c2ecf20Sopenharmony_ci} 13358c2ecf20Sopenharmony_ci 13368c2ecf20Sopenharmony_cistatic const struct snd_soc_dapm_widget q6afe_dai_widgets[] = { 13378c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("HDMI_RX", NULL, 0, SND_SOC_NOPM, 0, 0), 13388c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("SLIMBUS_0_RX", NULL, 0, SND_SOC_NOPM, 0, 0), 13398c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("SLIMBUS_1_RX", NULL, 0, SND_SOC_NOPM, 0, 0), 13408c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("SLIMBUS_2_RX", NULL, 0, SND_SOC_NOPM, 0, 0), 13418c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("SLIMBUS_3_RX", NULL, 0, SND_SOC_NOPM, 0, 0), 13428c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("SLIMBUS_4_RX", NULL, 0, SND_SOC_NOPM, 0, 0), 13438c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("SLIMBUS_5_RX", NULL, 0, SND_SOC_NOPM, 0, 0), 13448c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("SLIMBUS_6_RX", NULL, 0, SND_SOC_NOPM, 0, 0), 13458c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("SLIMBUS_0_TX", NULL, 0, SND_SOC_NOPM, 0, 0), 13468c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("SLIMBUS_1_TX", NULL, 0, SND_SOC_NOPM, 0, 0), 13478c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("SLIMBUS_2_TX", NULL, 0, SND_SOC_NOPM, 0, 0), 13488c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("SLIMBUS_3_TX", NULL, 0, SND_SOC_NOPM, 0, 0), 13498c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("SLIMBUS_4_TX", NULL, 0, SND_SOC_NOPM, 0, 0), 13508c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("SLIMBUS_5_TX", NULL, 0, SND_SOC_NOPM, 0, 0), 13518c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("SLIMBUS_6_TX", NULL, 0, SND_SOC_NOPM, 0, 0), 13528c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("QUAT_MI2S_RX", NULL, 13538c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13548c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("QUAT_MI2S_TX", NULL, 13558c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13568c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("TERT_MI2S_RX", NULL, 13578c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13588c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("TERT_MI2S_TX", NULL, 13598c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13608c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("SEC_MI2S_RX", NULL, 13618c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13628c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("SEC_MI2S_TX", NULL, 13638c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13648c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("SEC_MI2S_RX_SD1", 13658c2ecf20Sopenharmony_ci "Secondary MI2S Playback SD1", 13668c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13678c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("PRI_MI2S_RX", NULL, 13688c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13698c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("PRI_MI2S_TX", NULL, 13708c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13718c2ecf20Sopenharmony_ci 13728c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_RX_0", NULL, 13738c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13748c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_RX_1", NULL, 13758c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13768c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_RX_2", NULL, 13778c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13788c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_RX_3", NULL, 13798c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13808c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_RX_4", NULL, 13818c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13828c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_RX_5", NULL, 13838c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13848c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_RX_6", NULL, 13858c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13868c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_RX_7", NULL, 13878c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13888c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_TX_0", NULL, 13898c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13908c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_TX_1", NULL, 13918c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13928c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_TX_2", NULL, 13938c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13948c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_TX_3", NULL, 13958c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13968c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_TX_4", NULL, 13978c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 13988c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_TX_5", NULL, 13998c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14008c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_TX_6", NULL, 14018c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14028c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_TX_7", NULL, 14038c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14048c2ecf20Sopenharmony_ci 14058c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("SEC_TDM_RX_0", NULL, 14068c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14078c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("SEC_TDM_RX_1", NULL, 14088c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14098c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("SEC_TDM_RX_2", NULL, 14108c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14118c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("SEC_TDM_RX_3", NULL, 14128c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14138c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("SEC_TDM_RX_4", NULL, 14148c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14158c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("SEC_TDM_RX_5", NULL, 14168c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14178c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("SEC_TDM_RX_6", NULL, 14188c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14198c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("SEC_TDM_RX_7", NULL, 14208c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14218c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("SEC_TDM_TX_0", NULL, 14228c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14238c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("SEC_TDM_TX_1", NULL, 14248c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14258c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("SEC_TDM_TX_2", NULL, 14268c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14278c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("SEC_TDM_TX_3", NULL, 14288c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14298c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("SEC_TDM_TX_4", NULL, 14308c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14318c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("SEC_TDM_TX_5", NULL, 14328c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14338c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("SEC_TDM_TX_6", NULL, 14348c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14358c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("SEC_TDM_TX_7", NULL, 14368c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14378c2ecf20Sopenharmony_ci 14388c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("TERT_TDM_RX_0", NULL, 14398c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14408c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("TERT_TDM_RX_1", NULL, 14418c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14428c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("TERT_TDM_RX_2", NULL, 14438c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14448c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("TERT_TDM_RX_3", NULL, 14458c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14468c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("TERT_TDM_RX_4", NULL, 14478c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14488c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("TERT_TDM_RX_5", NULL, 14498c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14508c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("TERT_TDM_RX_6", NULL, 14518c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14528c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("TERT_TDM_RX_7", NULL, 14538c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14548c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("TERT_TDM_TX_0", NULL, 14558c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14568c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("TERT_TDM_TX_1", NULL, 14578c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14588c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("TERT_TDM_TX_2", NULL, 14598c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14608c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("TERT_TDM_TX_3", NULL, 14618c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14628c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("TERT_TDM_TX_4", NULL, 14638c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14648c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("TERT_TDM_TX_5", NULL, 14658c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14668c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("TERT_TDM_TX_6", NULL, 14678c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14688c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("TERT_TDM_TX_7", NULL, 14698c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14708c2ecf20Sopenharmony_ci 14718c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("QUAT_TDM_RX_0", NULL, 14728c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14738c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("QUAT_TDM_RX_1", NULL, 14748c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14758c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("QUAT_TDM_RX_2", NULL, 14768c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14778c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("QUAT_TDM_RX_3", NULL, 14788c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14798c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("QUAT_TDM_RX_4", NULL, 14808c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14818c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("QUAT_TDM_RX_5", NULL, 14828c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14838c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("QUAT_TDM_RX_6", NULL, 14848c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14858c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("QUAT_TDM_RX_7", NULL, 14868c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14878c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("QUAT_TDM_TX_0", NULL, 14888c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14898c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("QUAT_TDM_TX_1", NULL, 14908c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14918c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("QUAT_TDM_TX_2", NULL, 14928c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14938c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("QUAT_TDM_TX_3", NULL, 14948c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14958c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("QUAT_TDM_TX_4", NULL, 14968c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14978c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("QUAT_TDM_TX_5", NULL, 14988c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 14998c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("QUAT_TDM_TX_6", NULL, 15008c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15018c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("QUAT_TDM_TX_7", NULL, 15028c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15038c2ecf20Sopenharmony_ci 15048c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("QUIN_TDM_RX_0", NULL, 15058c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15068c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("QUIN_TDM_RX_1", NULL, 15078c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15088c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("QUIN_TDM_RX_2", NULL, 15098c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15108c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("QUIN_TDM_RX_3", NULL, 15118c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15128c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("QUIN_TDM_RX_4", NULL, 15138c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15148c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("QUIN_TDM_RX_5", NULL, 15158c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15168c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("QUIN_TDM_RX_6", NULL, 15178c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15188c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("QUIN_TDM_RX_7", NULL, 15198c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15208c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("QUIN_TDM_TX_0", NULL, 15218c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15228c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("QUIN_TDM_TX_1", NULL, 15238c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15248c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("QUIN_TDM_TX_2", NULL, 15258c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15268c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("QUIN_TDM_TX_3", NULL, 15278c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15288c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("QUIN_TDM_TX_4", NULL, 15298c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15308c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("QUIN_TDM_TX_5", NULL, 15318c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15328c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("QUIN_TDM_TX_6", NULL, 15338c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15348c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("QUIN_TDM_TX_7", NULL, 15358c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15368c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("DISPLAY_PORT_RX", "NULL", 0, SND_SOC_NOPM, 0, 0), 15378c2ecf20Sopenharmony_ci 15388c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("WSA_CODEC_DMA_RX_0", "NULL", 15398c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15408c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("WSA_CODEC_DMA_TX_0", "NULL", 15418c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15428c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("WSA_CODEC_DMA_RX_1", "NULL", 15438c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15448c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("WSA_CODEC_DMA_TX_1", "NULL", 15458c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15468c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("WSA_CODEC_DMA_TX_2", "NULL", 15478c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15488c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("VA_CODEC_DMA_TX_0", "NULL", 15498c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15508c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("VA_CODEC_DMA_TX_1", "NULL", 15518c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15528c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("VA_CODEC_DMA_TX_2", "NULL", 15538c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15548c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("RX_CODEC_DMA_RX_0", "NULL", 15558c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15568c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("TX_CODEC_DMA_TX_0", "NULL", 15578c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15588c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("RX_CODEC_DMA_RX_1", "NULL", 15598c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15608c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("TX_CODEC_DMA_TX_1", "NULL", 15618c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15628c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("RX_CODEC_DMA_RX_2", "NULL", 15638c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15648c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("TX_CODEC_DMA_TX_2", "NULL", 15658c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15668c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("RX_CODEC_DMA_RX_3", "NULL", 15678c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15688c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("TX_CODEC_DMA_TX_3", "NULL", 15698c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15708c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("RX_CODEC_DMA_RX_4", "NULL", 15718c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15728c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("TX_CODEC_DMA_TX_4", "NULL", 15738c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15748c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("RX_CODEC_DMA_RX_5", "NULL", 15758c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15768c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("TX_CODEC_DMA_TX_5", "NULL", 15778c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15788c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("RX_CODEC_DMA_RX_6", "NULL", 15798c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15808c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("RX_CODEC_DMA_RX_7", "NULL", 15818c2ecf20Sopenharmony_ci 0, SND_SOC_NOPM, 0, 0), 15828c2ecf20Sopenharmony_ci}; 15838c2ecf20Sopenharmony_ci 15848c2ecf20Sopenharmony_cistatic const struct snd_soc_component_driver q6afe_dai_component = { 15858c2ecf20Sopenharmony_ci .name = "q6afe-dai-component", 15868c2ecf20Sopenharmony_ci .dapm_widgets = q6afe_dai_widgets, 15878c2ecf20Sopenharmony_ci .num_dapm_widgets = ARRAY_SIZE(q6afe_dai_widgets), 15888c2ecf20Sopenharmony_ci .dapm_routes = q6afe_dapm_routes, 15898c2ecf20Sopenharmony_ci .num_dapm_routes = ARRAY_SIZE(q6afe_dapm_routes), 15908c2ecf20Sopenharmony_ci .of_xlate_dai_name = q6afe_of_xlate_dai_name, 15918c2ecf20Sopenharmony_ci 15928c2ecf20Sopenharmony_ci}; 15938c2ecf20Sopenharmony_ci 15948c2ecf20Sopenharmony_cistatic void of_q6afe_parse_dai_data(struct device *dev, 15958c2ecf20Sopenharmony_ci struct q6afe_dai_data *data) 15968c2ecf20Sopenharmony_ci{ 15978c2ecf20Sopenharmony_ci struct device_node *node; 15988c2ecf20Sopenharmony_ci int ret; 15998c2ecf20Sopenharmony_ci 16008c2ecf20Sopenharmony_ci for_each_child_of_node(dev->of_node, node) { 16018c2ecf20Sopenharmony_ci unsigned int lines[Q6AFE_MAX_MI2S_LINES]; 16028c2ecf20Sopenharmony_ci struct q6afe_dai_priv_data *priv; 16038c2ecf20Sopenharmony_ci int id, i, num_lines; 16048c2ecf20Sopenharmony_ci 16058c2ecf20Sopenharmony_ci ret = of_property_read_u32(node, "reg", &id); 16068c2ecf20Sopenharmony_ci if (ret || id < 0 || id >= AFE_PORT_MAX) { 16078c2ecf20Sopenharmony_ci dev_err(dev, "valid dai id not found:%d\n", ret); 16088c2ecf20Sopenharmony_ci continue; 16098c2ecf20Sopenharmony_ci } 16108c2ecf20Sopenharmony_ci 16118c2ecf20Sopenharmony_ci switch (id) { 16128c2ecf20Sopenharmony_ci /* MI2S specific properties */ 16138c2ecf20Sopenharmony_ci case PRIMARY_MI2S_RX ... QUATERNARY_MI2S_TX: 16148c2ecf20Sopenharmony_ci priv = &data->priv[id]; 16158c2ecf20Sopenharmony_ci ret = of_property_read_variable_u32_array(node, 16168c2ecf20Sopenharmony_ci "qcom,sd-lines", 16178c2ecf20Sopenharmony_ci lines, 0, 16188c2ecf20Sopenharmony_ci Q6AFE_MAX_MI2S_LINES); 16198c2ecf20Sopenharmony_ci if (ret < 0) 16208c2ecf20Sopenharmony_ci num_lines = 0; 16218c2ecf20Sopenharmony_ci else 16228c2ecf20Sopenharmony_ci num_lines = ret; 16238c2ecf20Sopenharmony_ci 16248c2ecf20Sopenharmony_ci priv->sd_line_mask = 0; 16258c2ecf20Sopenharmony_ci 16268c2ecf20Sopenharmony_ci for (i = 0; i < num_lines; i++) 16278c2ecf20Sopenharmony_ci priv->sd_line_mask |= BIT(lines[i]); 16288c2ecf20Sopenharmony_ci 16298c2ecf20Sopenharmony_ci break; 16308c2ecf20Sopenharmony_ci case PRIMARY_TDM_RX_0 ... QUINARY_TDM_TX_7: 16318c2ecf20Sopenharmony_ci priv = &data->priv[id]; 16328c2ecf20Sopenharmony_ci ret = of_property_read_u32(node, "qcom,tdm-sync-mode", 16338c2ecf20Sopenharmony_ci &priv->sync_mode); 16348c2ecf20Sopenharmony_ci if (ret) { 16358c2ecf20Sopenharmony_ci dev_err(dev, "No Sync mode from DT\n"); 16368c2ecf20Sopenharmony_ci break; 16378c2ecf20Sopenharmony_ci } 16388c2ecf20Sopenharmony_ci ret = of_property_read_u32(node, "qcom,tdm-sync-src", 16398c2ecf20Sopenharmony_ci &priv->sync_src); 16408c2ecf20Sopenharmony_ci if (ret) { 16418c2ecf20Sopenharmony_ci dev_err(dev, "No Sync Src from DT\n"); 16428c2ecf20Sopenharmony_ci break; 16438c2ecf20Sopenharmony_ci } 16448c2ecf20Sopenharmony_ci ret = of_property_read_u32(node, "qcom,tdm-data-out", 16458c2ecf20Sopenharmony_ci &priv->data_out_enable); 16468c2ecf20Sopenharmony_ci if (ret) { 16478c2ecf20Sopenharmony_ci dev_err(dev, "No Data out enable from DT\n"); 16488c2ecf20Sopenharmony_ci break; 16498c2ecf20Sopenharmony_ci } 16508c2ecf20Sopenharmony_ci ret = of_property_read_u32(node, "qcom,tdm-invert-sync", 16518c2ecf20Sopenharmony_ci &priv->invert_sync); 16528c2ecf20Sopenharmony_ci if (ret) { 16538c2ecf20Sopenharmony_ci dev_err(dev, "No Invert sync from DT\n"); 16548c2ecf20Sopenharmony_ci break; 16558c2ecf20Sopenharmony_ci } 16568c2ecf20Sopenharmony_ci ret = of_property_read_u32(node, "qcom,tdm-data-delay", 16578c2ecf20Sopenharmony_ci &priv->data_delay); 16588c2ecf20Sopenharmony_ci if (ret) { 16598c2ecf20Sopenharmony_ci dev_err(dev, "No Data Delay from DT\n"); 16608c2ecf20Sopenharmony_ci break; 16618c2ecf20Sopenharmony_ci } 16628c2ecf20Sopenharmony_ci ret = of_property_read_u32(node, "qcom,tdm-data-align", 16638c2ecf20Sopenharmony_ci &priv->data_align); 16648c2ecf20Sopenharmony_ci if (ret) { 16658c2ecf20Sopenharmony_ci dev_err(dev, "No Data align from DT\n"); 16668c2ecf20Sopenharmony_ci break; 16678c2ecf20Sopenharmony_ci } 16688c2ecf20Sopenharmony_ci break; 16698c2ecf20Sopenharmony_ci default: 16708c2ecf20Sopenharmony_ci break; 16718c2ecf20Sopenharmony_ci } 16728c2ecf20Sopenharmony_ci } 16738c2ecf20Sopenharmony_ci} 16748c2ecf20Sopenharmony_ci 16758c2ecf20Sopenharmony_cistatic int q6afe_dai_dev_probe(struct platform_device *pdev) 16768c2ecf20Sopenharmony_ci{ 16778c2ecf20Sopenharmony_ci struct q6afe_dai_data *dai_data; 16788c2ecf20Sopenharmony_ci struct device *dev = &pdev->dev; 16798c2ecf20Sopenharmony_ci 16808c2ecf20Sopenharmony_ci dai_data = devm_kzalloc(dev, sizeof(*dai_data), GFP_KERNEL); 16818c2ecf20Sopenharmony_ci if (!dai_data) 16828c2ecf20Sopenharmony_ci return -ENOMEM; 16838c2ecf20Sopenharmony_ci 16848c2ecf20Sopenharmony_ci dev_set_drvdata(dev, dai_data); 16858c2ecf20Sopenharmony_ci 16868c2ecf20Sopenharmony_ci of_q6afe_parse_dai_data(dev, dai_data); 16878c2ecf20Sopenharmony_ci 16888c2ecf20Sopenharmony_ci return devm_snd_soc_register_component(dev, &q6afe_dai_component, 16898c2ecf20Sopenharmony_ci q6afe_dais, ARRAY_SIZE(q6afe_dais)); 16908c2ecf20Sopenharmony_ci} 16918c2ecf20Sopenharmony_ci 16928c2ecf20Sopenharmony_ci#ifdef CONFIG_OF 16938c2ecf20Sopenharmony_cistatic const struct of_device_id q6afe_dai_device_id[] = { 16948c2ecf20Sopenharmony_ci { .compatible = "qcom,q6afe-dais" }, 16958c2ecf20Sopenharmony_ci {}, 16968c2ecf20Sopenharmony_ci}; 16978c2ecf20Sopenharmony_ciMODULE_DEVICE_TABLE(of, q6afe_dai_device_id); 16988c2ecf20Sopenharmony_ci#endif 16998c2ecf20Sopenharmony_ci 17008c2ecf20Sopenharmony_cistatic struct platform_driver q6afe_dai_platform_driver = { 17018c2ecf20Sopenharmony_ci .driver = { 17028c2ecf20Sopenharmony_ci .name = "q6afe-dai", 17038c2ecf20Sopenharmony_ci .of_match_table = of_match_ptr(q6afe_dai_device_id), 17048c2ecf20Sopenharmony_ci }, 17058c2ecf20Sopenharmony_ci .probe = q6afe_dai_dev_probe, 17068c2ecf20Sopenharmony_ci}; 17078c2ecf20Sopenharmony_cimodule_platform_driver(q6afe_dai_platform_driver); 17088c2ecf20Sopenharmony_ci 17098c2ecf20Sopenharmony_ciMODULE_DESCRIPTION("Q6 Audio Fronend dai driver"); 17108c2ecf20Sopenharmony_ciMODULE_LICENSE("GPL v2"); 1711