diff --git a/techpack/audio/asoc/codecs/Kbuild b/techpack/audio/asoc/codecs/Kbuild index 5240b93ad5cf..19e374e43045 100644 --- a/techpack/audio/asoc/codecs/Kbuild +++ b/techpack/audio/asoc/codecs/Kbuild @@ -220,6 +220,7 @@ CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ -DPTT_SOCK_SVC_ENABLE \ -Wall\ -Werror\ + -Wno-enum-conversion \ -D__linux__ KBUILD_CPPFLAGS += $(CDEFINES) diff --git a/techpack/audio/asoc/msm-pcm-routing-v2.c b/techpack/audio/asoc/msm-pcm-routing-v2.c index 5529c803d6d1..9f5e331d958c 100644 --- a/techpack/audio/asoc/msm-pcm-routing-v2.c +++ b/techpack/audio/asoc/msm-pcm-routing-v2.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -5566,6 +5566,14 @@ static int get_ec_ref_port_id(int value, int *index) *index = 40; port_id = AFE_PORT_ID_QUINARY_TDM_TX; break; + case 41: + *index = 41; + port_id = AFE_PORT_ID_PRIMARY_TDM_RX; + break; + case 42: + *index = 42; + port_id = AFE_PORT_ID_PRIMARY_TDM_TX; + break; default: *index = 0; /* NONE */ pr_err("%s: Invalid value %d\n", __func__, value); @@ -5624,6 +5632,7 @@ static const char *const ec_ref_rx[] = { "None", "SLIM_RX", "I2S_RX", "SLIM_7_RX", "RX_CDC_DMA_RX_0", "RX_CDC_DMA_RX_1", "RX_CDC_DMA_RX_2", "RX_CDC_DMA_RX_3", "TX_CDC_DMA_TX_0", "TERT_TDM_RX_2", "SEC_TDM_TX_0", "DISPLAY_PORT1", "SEN_MI2S_RX", "SENARY_MI2S_TX", "QUIN_TDM_TX_0", + "PRI_TDM_RX_0", "PRI_TDM_TX_0", }; static const struct soc_enum msm_route_ec_ref_rx_enum[] = { @@ -29694,6 +29703,8 @@ static const struct snd_soc_dapm_route intercon_tdm[] = { {"AUDIO_REF_EC_UL1 MUX", "TERT_TDM_RX_2", "TERT_TDM_RX_2"}, {"AUDIO_REF_EC_UL1 MUX", "SEC_TDM_TX_0", "SEC_TDM_TX_0"}, {"AUDIO_REF_EC_UL1 MUX", "QUIN_TDM_TX_0", "QUIN_TDM_TX_0"}, + {"AUDIO_REF_EC_UL1 MUX", "PRI_TDM_RX_0", "PRI_TDM_RX_0"}, + {"AUDIO_REF_EC_UL1 MUX", "PRI_TDM_TX_0", "PRI_TDM_TX_0"}, {"AUDIO_REF_EC_UL10 MUX", "QUAT_TDM_TX_1", "QUAT_TDM_TX_1"}, {"AUDIO_REF_EC_UL10 MUX", "QUAT_TDM_RX_0", "QUAT_TDM_RX_0"}, @@ -29702,6 +29713,8 @@ static const struct snd_soc_dapm_route intercon_tdm[] = { {"AUDIO_REF_EC_UL10 MUX", "TERT_TDM_TX_0", "TERT_TDM_TX_0"}, {"AUDIO_REF_EC_UL10 MUX", "TERT_TDM_RX_2", "TERT_TDM_RX_2"}, {"AUDIO_REF_EC_UL10 MUX", "SEC_TDM_TX_0", "SEC_TDM_TX_0"}, + {"AUDIO_REF_EC_UL10 MUX", "PRI_TDM_RX_0", "PRI_TDM_RX_0"}, + {"AUDIO_REF_EC_UL10 MUX", "PRI_TDM_TX_0", "PRI_TDM_TX_0"}, {"LSM1 Mixer", "QUIN_TDM_TX_0", "QUIN_TDM_TX_0"}, {"LSM1 Mixer", "TERT_TDM_TX_0", "TERT_TDM_TX_0"}, diff --git a/techpack/audio/dsp/msm_audio_ion.c b/techpack/audio/dsp/msm_audio_ion.c index 2bf02fcad7bb..a204bc39fa15 100644 --- a/techpack/audio/dsp/msm_audio_ion.c +++ b/techpack/audio/dsp/msm_audio_ion.c @@ -1,6 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. + * + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -63,6 +65,7 @@ static void msm_audio_ion_add_allocation( mutex_unlock(&(msm_audio_ion_data->list_mutex)); } +/* This function is called with ion_data list mutex lock */ static int msm_audio_dma_buf_map(struct dma_buf *dma_buf, dma_addr_t *addr, size_t *len) { @@ -151,7 +154,6 @@ static int msm_audio_dma_buf_unmap(struct dma_buf *dma_buf) * should be explicitly acquired to avoid race condition * on adding elements to the list. */ - mutex_lock(&(msm_audio_ion_data.list_mutex)); list_for_each_safe(ptr, next, &(msm_audio_ion_data.alloc_list)) { @@ -175,7 +177,6 @@ static int msm_audio_dma_buf_unmap(struct dma_buf *dma_buf) break; } } - mutex_unlock(&(msm_audio_ion_data.list_mutex)); if (!found) { dev_err(cb_dev, @@ -230,6 +231,7 @@ int msm_audio_ion_get_smmu_info(struct device **cb_dev, return 0; } +/* This function is called with ion_data list mutex lock */ static void *msm_audio_ion_map_kernel(struct dma_buf *dma_buf) { int rc = 0; @@ -278,7 +280,6 @@ static int msm_audio_ion_unmap_kernel(struct dma_buf *dma_buf) * TBD: remove the below section once new API * for unmapping kernel virtual address is available. */ - mutex_lock(&(msm_audio_ion_data.list_mutex)); list_for_each_entry(alloc_data, &(msm_audio_ion_data.alloc_list), list) { if (alloc_data->dma_buf == dma_buf) { @@ -286,7 +287,6 @@ static int msm_audio_ion_unmap_kernel(struct dma_buf *dma_buf) break; } } - mutex_unlock(&(msm_audio_ion_data.list_mutex)); if (!vaddr) { dev_err(cb_dev, @@ -309,7 +309,8 @@ static int msm_audio_ion_unmap_kernel(struct dma_buf *dma_buf) return rc; } -static int msm_audio_ion_map_buf(struct dma_buf *dma_buf, dma_addr_t *paddr, +/* This function is called with ion_data list mutex lock */ +static int msm_audio_ion_buf_map(struct dma_buf *dma_buf, dma_addr_t *paddr, size_t *plen, void **vaddr) { int rc = 0; @@ -331,7 +332,9 @@ static int msm_audio_ion_map_buf(struct dma_buf *dma_buf, dma_addr_t *paddr, if (IS_ERR_OR_NULL(*vaddr)) { pr_err("%s: ION memory mapping for AUDIO failed\n", __func__); rc = -ENOMEM; + mutex_lock(&(msm_audio_ion_data.list_mutex)); msm_audio_dma_buf_unmap(dma_buf); + mutex_unlock(&(msm_audio_ion_data.list_mutex)); goto err; } @@ -390,7 +393,7 @@ int msm_audio_ion_alloc(struct dma_buf **dma_buf, size_t bufsz, goto err; } - rc = msm_audio_ion_map_buf(*dma_buf, paddr, plen, vaddr); + rc = msm_audio_ion_buf_map(*dma_buf, paddr, plen, vaddr); if (rc) { pr_err("%s: failed to map ION buf, rc = %d\n", __func__, rc); goto err; @@ -490,7 +493,7 @@ int msm_audio_ion_import(struct dma_buf **dma_buf, int fd, } } - rc = msm_audio_ion_map_buf(*dma_buf, paddr, plen, vaddr); + rc = msm_audio_ion_buf_map(*dma_buf, paddr, plen, vaddr); if (rc) { pr_err("%s: failed to map ION buf, rc = %d\n", __func__, rc); goto err; @@ -516,6 +519,7 @@ EXPORT_SYMBOL(msm_audio_ion_import); * * Returns 0 on success or error on failure */ +/* This funtion is called with ion_data list mutex lock */ int msm_audio_ion_free(struct dma_buf *dma_buf) { int ret = 0; @@ -525,11 +529,15 @@ int msm_audio_ion_free(struct dma_buf *dma_buf) return -EINVAL; } + mutex_lock(&(msm_audio_ion_data.list_mutex)); ret = msm_audio_ion_unmap_kernel(dma_buf); - if (ret) + if (ret) { + mutex_unlock(&(msm_audio_ion_data.list_mutex)); return ret; + } msm_audio_dma_buf_unmap(dma_buf); + mutex_unlock(&(msm_audio_ion_data.list_mutex)); return 0; } diff --git a/techpack/audio/dsp/q6asm.c b/techpack/audio/dsp/q6asm.c index 4effafb90629..88f3acf62618 100644 --- a/techpack/audio/dsp/q6asm.c +++ b/techpack/audio/dsp/q6asm.c @@ -2291,7 +2291,7 @@ static int32_t q6asm_callback(struct apr_client_data *data, void *priv) config_debug_fs_read_cb(); if (data->payload_size != (READDONE_IDX_SEQ_ID + 1) * sizeof(uint32_t)) { - pr_err("%s: payload size of %d is less than expected %d.\n", + pr_err("%s: payload size of %d is less than expected %ld.\n", __func__, data->payload_size, ((READDONE_IDX_SEQ_ID + 1) * sizeof(uint32_t))); spin_unlock_irqrestore( diff --git a/techpack/audio/dsp/q6voice.c b/techpack/audio/dsp/q6voice.c index ee16121c15a1..cbe123de7761 100644 --- a/techpack/audio/dsp/q6voice.c +++ b/techpack/audio/dsp/q6voice.c @@ -2760,7 +2760,7 @@ static int voice_send_cvs_register_cal_cmd(struct voice_data *v) } if (col_data->cal_data.size >= MAX_COL_INFO_SIZE) { - pr_err("%s: Invalid cal data size %d!\n", + pr_err("%s: Invalid cal data size %ld!\n", __func__, col_data->cal_data.size); ret = -EINVAL; goto unlock;