Merge 36711408f2 on remote branch

Change-Id: I4de2f87f907d94350d492ed68e9224efd0b881fe
This commit is contained in:
Linux Build Service Account 2022-09-19 05:16:38 -07:00
commit a0063f941d
9 changed files with 175 additions and 69 deletions

View file

@ -186,7 +186,7 @@ ifdef CONFIG_SND_SOC_SA8155
MACHINE_OBJS += sa8155.o
endif
# for gvmgh sound card driver
# for gvm sound card driver
ifdef CONFIG_SND_SOC_GVM_AUTO_SPF
SPF_MACHINE_OBJS += gvm_auto_spf_dummy.o
endif

View file

@ -324,7 +324,7 @@ static struct snd_soc_dai_link msm_common_dai_links[] = {
},
};
static struct snd_soc_dai_link msm_gvm8295_dai_links[] = {
static struct snd_soc_dai_link msm_gvm_auto_dai_links[] = {
/* BackEnd DAI Links */
{
.name = "PRI_TDM_RX_0_DUMMY",
@ -467,6 +467,26 @@ static struct snd_soc_dai_link msm_gvm8295_dai_links[] = {
SND_SOC_DAILINK_REG(sep_tdm_tx_0_dummy),
},
{
.name = "OCT_TDM_RX_0_DUMMY",
.stream_name = "TDM-LPAIF_WSA2-RX-PRIMARY",
.dpcm_playback = 1,
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
SND_SOC_DPCM_TRIGGER_POST},
.ignore_suspend = 1,
.ignore_pmdown_time = 1,
SND_SOC_DAILINK_REG(oct_tdm_rx_0_dummy),
},
{
.name = "OCT_TDM_TX_0_DUMMY",
.stream_name = "TDM-LPAIF_WSA2-TX-PRIMARY",
.dpcm_capture = 1,
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
SND_SOC_DPCM_TRIGGER_POST},
.ignore_suspend = 1,
.ignore_pmdown_time = 1,
SND_SOC_DAILINK_REG(oct_tdm_tx_0_dummy),
},
{
.name = "HS_IF0_TDM_RX_0_DUMMY",
.stream_name = "TDM-LPAIF_SDR-RX-PRIMARY",
.dpcm_playback = 1,
@ -526,6 +546,46 @@ static struct snd_soc_dai_link msm_gvm8295_dai_links[] = {
.ignore_pmdown_time = 1,
SND_SOC_DAILINK_REG(hs_if2_tdm_tx_0_dummy),
},
{
.name = "HS_IF3_TDM_RX_0",
.stream_name = "TDM-LPAIF_SDR-RX-QUATERNARY",
.dpcm_playback = 1,
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
SND_SOC_DPCM_TRIGGER_POST},
.ignore_suspend = 1,
.ignore_pmdown_time = 1,
SND_SOC_DAILINK_REG(hs_if3_tdm_rx_0_dummy),
},
{
.name = "HS_IF3_TDM_TX_0",
.stream_name = "TDM-LPAIF_SDR-TX-QUATERNARY",
.dpcm_capture = 1,
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
SND_SOC_DPCM_TRIGGER_POST},
.ignore_suspend = 1,
.ignore_pmdown_time = 1,
SND_SOC_DAILINK_REG(hs_if3_tdm_tx_0_dummy),
},
{
.name = "HS_IF4_TDM_RX_0",
.stream_name = "TDM-LPAIF_SDR-RX-QUINARY",
.dpcm_playback = 1,
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
SND_SOC_DPCM_TRIGGER_POST},
.ignore_suspend = 1,
.ignore_pmdown_time = 1,
SND_SOC_DAILINK_REG(hs_if4_tdm_rx_0_dummy),
},
{
.name = "HS_IF4_TDM_TX_0",
.stream_name = "TDM-LPAIF_SDR-TX-QUINARY",
.dpcm_capture = 1,
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
SND_SOC_DPCM_TRIGGER_POST},
.ignore_suspend = 1,
.ignore_pmdown_time = 1,
SND_SOC_DAILINK_REG(hs_if4_tdm_tx_0_dummy),
},
};
static struct snd_soc_dai_link msm_talos_dai_links[] = {
@ -632,17 +692,7 @@ static struct snd_soc_dai_link msm_talos_dai_links[] = {
},
};
struct snd_soc_card snd_soc_card_auto_hana_dummy_msm = {
.name = "gvmauto-8155-snd-card",
};
struct snd_soc_card snd_soc_card_auto_talos_dummy_msm = {
.name = "gvmauto-6155-snd-card",
};
struct snd_soc_card snd_soc_card_auto_makena_dummy_msm = {
.name = "gvmauto-8295-snd-card",
};
struct snd_soc_card snd_soc_card_gvm_auto_dummy_msm;
static int msm_populate_dai_link_component_of_node(
struct snd_soc_card *card)
@ -751,21 +801,11 @@ static const struct of_device_id gvm_asoc_machine_of_match[] = {
.data = "adp_star_codec"},
{},
};
static struct snd_soc_dai_link msm_auto_dai_links[
ARRAY_SIZE(msm_common_dai_links)];
static struct snd_soc_dai_link msm_auto_talos_dai_links[
ARRAY_SIZE(msm_talos_dai_links)];
static struct snd_soc_dai_link msm_auto_gvm8295_dai_links[
ARRAY_SIZE(msm_gvm8295_dai_links)];
static struct snd_soc_card *populate_snd_card_dailinks(struct device *dev)
{
struct snd_soc_card *card = NULL;
struct snd_soc_dai_link *dailink;
int total_links;
const struct of_device_id *match;
const struct of_device_id *match = NULL;
match = of_match_node(gvm_asoc_machine_of_match, dev->of_node);
if (!match) {
@ -774,34 +814,18 @@ static struct snd_soc_card *populate_snd_card_dailinks(struct device *dev)
return NULL;
}
card = &snd_soc_card_gvm_auto_dummy_msm;
if (!strcmp(match->compatible, "qcom,8155-spf-asoc-snd-adp-star")) {
card = &snd_soc_card_auto_hana_dummy_msm;
total_links = ARRAY_SIZE(msm_common_dai_links);
memcpy(msm_auto_dai_links,
msm_common_dai_links,
sizeof(msm_common_dai_links));
dailink = msm_auto_dai_links;
card->dai_link = msm_common_dai_links;
card->num_links = ARRAY_SIZE(msm_common_dai_links);
} else if (!strcmp(match->compatible, "qcom,6155-spf-asoc-snd-adp-star")) {
card = &snd_soc_card_auto_talos_dummy_msm;
total_links = ARRAY_SIZE(msm_talos_dai_links);
memcpy(msm_auto_talos_dai_links,
msm_talos_dai_links,
sizeof(msm_talos_dai_links));
dailink = msm_auto_talos_dai_links;
card->dai_link = msm_talos_dai_links;
card->num_links = ARRAY_SIZE(msm_talos_dai_links);
} else if (!strcmp(match->compatible, "qcom,gvm-auto-spf-asoc-snd-adp-star")) {
card = &snd_soc_card_auto_makena_dummy_msm;
total_links = ARRAY_SIZE(msm_gvm8295_dai_links);
memcpy(msm_auto_gvm8295_dai_links,
msm_gvm8295_dai_links,
sizeof(msm_gvm8295_dai_links));
dailink = msm_auto_gvm8295_dai_links;
}
if (card) {
card->dai_link = dailink;
card->num_links = total_links;
}
card->dai_link = msm_gvm_auto_dai_links;
card->num_links = ARRAY_SIZE(msm_gvm_auto_dai_links);
}
return card;
}

37
asoc/msm-pcm-routing-auto.c Normal file → Executable file
View file

@ -2475,14 +2475,20 @@ int msm_pcm_routing_reg_phy_stream(int fedai_id, int perf_mode,
bits_per_sample = msm_routing_get_bit_width(
msm_bedais[i].format);
topology = msm_routing_get_adm_topology(fedai_id,
session_type,
i);
app_type =
fe_dai_app_type_cfg[fedai_id][session_type][i].app_type;
if (app_type) {
app_type_idx =
msm_pcm_routing_get_app_type_idx(app_type);
sample_rate =
fe_dai_app_type_cfg[fedai_id][session_type][i]
.sample_rate;
if ((fe_dai_app_type_cfg[fedai_id][session_type][i].sample_rate != msm_bedais[i].sample_rate) &&
(topology == AUDIO_COPP_MFC)) {
pr_debug("%s: FE and BE SR is not equal", __func__);
sample_rate = msm_bedais[i].sample_rate;
} else
sample_rate = fe_dai_app_type_cfg[fedai_id][session_type][i].sample_rate;
bits_per_sample =
(fe_dai_app_type_cfg[fedai_id][session_type][i].bit_width) ?
fe_dai_app_type_cfg[fedai_id][session_type][i].bit_width :
@ -2496,9 +2502,7 @@ int msm_pcm_routing_reg_phy_stream(int fedai_id, int perf_mode,
acdb_dev_id =
fe_dai_app_type_cfg[fedai_id][session_type][i]
.acdb_dev_id;
topology = msm_routing_get_adm_topology(fedai_id,
session_type,
i);
be_bit_width = msm_routing_get_bit_width(
msm_bedais[i].format);
copp_perf_mode = get_copp_perf_mode(fedai_id, session_type, i);
@ -2563,11 +2567,16 @@ int msm_pcm_routing_reg_phy_stream(int fedai_id, int perf_mode,
&session_copp_map[fedai_id][session_type][i]);
if (msm_is_resample_needed(
sample_rate,
msm_bedais[i].sample_rate))
adm_copp_mfc_cfg(port_id, copp_idx,
msm_bedais[i].sample_rate);
fe_dai_app_type_cfg[fedai_id][session_type][i].sample_rate,
msm_bedais[i].sample_rate)) {
if ((session_type == SESSION_TYPE_TX) && (topology == AUDIO_COPP_MFC)) {
adm_copp_mfc_cfg(port_id, copp_idx,
fe_dai_app_type_cfg[fedai_id][session_type][i].sample_rate);
} else {
adm_copp_mfc_cfg(port_id, copp_idx,
msm_bedais[i].sample_rate);
}
}
for (j = 0; j < MAX_COPPS_PER_PORT; j++) {
unsigned long copp =
session_copp_map[fedai_id][session_type][i];
@ -14407,6 +14416,11 @@ static const struct snd_kcontrol_new quat_tdm_rx_3_port_mixer_controls[] = {
};
static const struct snd_kcontrol_new quat_tdm_rx_7_port_mixer_controls[] = {
SOC_DOUBLE_EXT("TERT_TDM_TX_7", SND_SOC_NOPM,
MSM_BACKEND_DAI_QUAT_TDM_RX_7,
MSM_BACKEND_DAI_TERT_TDM_TX_7, 1, 0,
msm_routing_get_port_mixer,
msm_routing_put_port_mixer),
SOC_DOUBLE_EXT("QUAT_TDM_TX_7", SND_SOC_NOPM,
MSM_BACKEND_DAI_QUAT_TDM_RX_7,
MSM_BACKEND_DAI_QUAT_TDM_TX_7, 1, 0,
@ -29200,6 +29214,7 @@ static const struct snd_soc_dapm_route intercon_tdm[] = {
{"QUAT_TDM_RX_3 Port Mixer", "SEN_TDM_TX_3", "SEN_TDM_TX_3"},
{"QUAT_TDM_RX_3", NULL, "QUAT_TDM_RX_3 Port Mixer"},
{"QUAT_TDM_RX_7 Port Mixer", "TERT_TDM_TX_7", "TERT_TDM_TX_7"},
{"QUAT_TDM_RX_7 Port Mixer", "QUAT_TDM_TX_7", "QUAT_TDM_TX_7"},
{"QUAT_TDM_RX_7 Port Mixer", "QUIN_TDM_TX_7", "QUIN_TDM_TX_7"},
{"QUAT_TDM_RX_7", NULL, "QUAT_TDM_RX_7 Port Mixer"},

View file

@ -1392,6 +1392,16 @@ SND_SOC_DAILINK_DEFS(sep_tdm_tx_0_dummy,
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
SND_SOC_DAILINK_DEFS(oct_tdm_rx_0_dummy,
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
SND_SOC_DAILINK_DEFS(oct_tdm_tx_0_dummy,
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
SND_SOC_DAILINK_DEFS(hs_if0_tdm_rx_0_dummy,
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
@ -1422,6 +1432,26 @@ SND_SOC_DAILINK_DEFS(hs_if2_tdm_tx_0_dummy,
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
SND_SOC_DAILINK_DEFS(hs_if3_tdm_rx_0_dummy,
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
SND_SOC_DAILINK_DEFS(hs_if3_tdm_tx_0_dummy,
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
SND_SOC_DAILINK_DEFS(hs_if4_tdm_rx_0_dummy,
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
SND_SOC_DAILINK_DEFS(hs_if4_tdm_tx_0_dummy,
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
SND_SOC_DAILINK_DEFS(voicemmode1_hostless,
DAILINK_COMP_ARRAY(COMP_CPU("VoiceMMode1")),
DAILINK_COMP_ARRAY(COMP_CODEC("snd-soc-dummy", "snd-soc-dummy-dai")),

View file

@ -5503,7 +5503,7 @@ static int msm_pinctrl_mclk_enable(struct platform_device *pdev)
np = of_parse_phandle(pdev->dev.of_node, mclk_gpio_phandle[i], 0);
if (!np) {
pr_err("%s: device node %s is null\n", __func__, mclk_gpio_phandle[i]);
pr_debug("%s: device node %s is null\n", __func__, mclk_gpio_phandle[i]);
continue;
}
pdev_np = of_find_device_by_node(np);

View file

@ -423,7 +423,7 @@ static int audio_notifier_convert_opcode(unsigned long opcode,
int ret = 0;
switch (opcode) {
case SUBSYS_BEFORE_SHUTDOWN:
case SUBSYS_AFTER_SHUTDOWN:
case SERVREG_NOTIF_SERVICE_STATE_DOWN_V01:
*notifier_opcode = AUDIO_NOTIFIER_SERVICE_DOWN;
break;

View file

@ -8526,10 +8526,11 @@ static int voice_alloc_oob_shared_mem(void)
bufsz * bufcnt,
&phys, &len,
&mem_addr);
if (rc < 0) {
if (rc) {
pr_err("%s: audio ION alloc failed, rc = %d\n",
__func__, rc);
rc = -EINVAL;
goto done;
}
@ -8578,10 +8579,11 @@ static int voice_alloc_oob_mem_table(void)
&v->shmem_info.memtbl.phys,
&len,
&(v->shmem_info.memtbl.data));
if (rc < 0) {
if (rc) {
pr_err("%s: audio ION alloc failed, rc = %d\n",
__func__, rc);
rc = -EINVAL;
goto done;
}
@ -8964,9 +8966,10 @@ static int voice_alloc_cal_mem_map_table(void)
&common.cal_mem_map_table.phys,
&len,
&(common.cal_mem_map_table.data));
if ((ret < 0) && (ret != -EPROBE_DEFER)) {
if ((ret) && (ret != -EPROBE_DEFER)) {
pr_err("%s: audio ION alloc failed, rc = %d\n",
__func__, ret);
ret = -EINVAL;
goto done;
}
@ -8990,9 +8993,10 @@ static int voice_alloc_rtac_mem_map_table(void)
&common.rtac_mem_map_table.phys,
&len,
&(common.rtac_mem_map_table.data));
if (ret < 0) {
if (ret) {
pr_err("%s: audio ION alloc failed, rc = %d\n",
__func__, ret);
ret = -EINVAL;
goto done;
}
@ -9722,7 +9726,7 @@ static int voice_alloc_source_tracking_shared_memory(void)
&(common.source_tracking_sh_mem.sh_mem_block.phys),
(size_t *)&(common.source_tracking_sh_mem.sh_mem_block.size),
&(common.source_tracking_sh_mem.sh_mem_block.data));
if (ret < 0) {
if (ret) {
pr_err("%s: audio ION alloc failed for sh_mem block, ret = %d\n",
__func__, ret);
@ -9744,7 +9748,7 @@ static int voice_alloc_source_tracking_shared_memory(void)
&(common.source_tracking_sh_mem.sh_mem_table.phys),
(size_t *)&(common.source_tracking_sh_mem.sh_mem_table.size),
&(common.source_tracking_sh_mem.sh_mem_table.data));
if (ret < 0) {
if (ret) {
pr_err("%s: audio ION alloc failed for sh_mem table, ret = %d\n",
__func__, ret);

View file

@ -159,9 +159,10 @@ int rtac_allocate_cal_buffer(uint32_t cal_type)
&rtac_cal[cal_type].cal_data.paddr,
&len,
&rtac_cal[cal_type].cal_data.kvaddr);
if (result < 0) {
if (result) {
pr_err("%s: ION create client for RTAC failed\n",
__func__);
result = -EINVAL;
goto done;
}

32
include/dsp/apr_audio-v2.h Normal file → Executable file
View file

@ -846,6 +846,10 @@ struct audproc_softvolume_params {
*/
#define AUDPROC_PARAM_ID_MFC_OUTPUT_MEDIA_FORMAT 0x00010913
/* ID of the Output Media Format V2 parameters used by AUDPROC_MODULE_ID_MFC.
*/
#define AUDPROC_PARAM_ID_MFC_OUTPUT_MEDIA_FORMAT_V2 0x00010942
/* Param ID of Channel Mixer used by AUDPROC_MODULE_ID_MFC */
#define AUDPROC_CHMIXER_PARAM_ID_COEFF 0x00010342
@ -881,6 +885,33 @@ struct adm_cmd_set_pp_params_v5 {
*/
} __packed;
/* Payload of the AUDPROC_PARAM_ID_MFC_OUTPUT_MEDIA_FORMAT_V2 parameter in the
Media Format Converter Module. Following this will be the variable payload for channel_map.
*/
struct audproc_mfc_output_media_fmt_v2_t
{
uint32_t sampling_rate;
/**< @h2xmle_description {Sampling rate in samples per second.}
@h2xmle_range {0..384000} */
uint16_t bits_per_sample;
/**< @h2xmle_description {Number of bits used to store each sample.}
@h2xmle_rangeList {"16 bits per sample (Q15 format)"= 16;"24 bits per sample (Q27 format)"=24;"32 bits per sample (Q31 format)"=32
@h2xmle_default {16}
*/
uint16_t num_channels;
/**< @h2xmle_description {Number of channels.}
@h2xmle_default {1}
@h2xmle_range {1..32} */
uint16_t channel_type[0];
/**< @h2xmle_description {Channel mapping array. Specify a channel mapping for each output channel.If the number of channels is not a multiple of four, zero padding must be added to the channel type array to align the packet to a multiple of 32 bits.}
@h2xmle_variableArraySize {num_channels}
@h2xmle_range {1..63}
@h2xmle_default {1}*/
} __packed;
/* Maximum number of channels supported by MFC media fmt params */
#define AUDPROC_MFC_OUT_CHANNELS_MAX 8
@ -5716,6 +5747,7 @@ struct afe_param_id_lpass_core_shared_clk_cfg {
#define NULL_POPP_TOPOLOGY 0x00010C68
#define NULL_COPP_TOPOLOGY 0x00010312
#define AUDIO_COPP_MFC 0x10000098
#define DEFAULT_COPP_TOPOLOGY 0x00010314
#define DEFAULT_POPP_TOPOLOGY 0x00010BE4
#define COMPRESSED_PASSTHROUGH_DEFAULT_TOPOLOGY 0x0001076B