Merge tag 'LA.UM.8.4.r1-06000-8x98.0' into op8998-ten

"LA.UM.8.4.r1-06000-8x98.0"
This commit is contained in:
Timi 2020-11-06 21:21:43 +01:00
commit 2752a1a668
22 changed files with 348 additions and 66 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2017, 2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2015-2017, 2020 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -357,6 +357,16 @@
qcom,msm-dai-q6-dev-id = <32770>;
};
proxy_rx: qcom,msm-dai-q6-proxy-rx {
compatible = "qcom,msm-dai-q6-dev";
qcom,msm-dai-q6-dev-id = <8194>;
};
proxy_tx: qcom,msm-dai-q6-proxy-tx {
compatible = "qcom,msm-dai-q6-dev";
qcom,msm-dai-q6-dev-id = <8195>;
};
usb_audio_rx: qcom,msm-dai-q6-usb-audio-rx {
compatible = "qcom,msm-dai-q6-dev";
qcom,msm-dai-q6-dev-id = <28672>;
@ -679,7 +689,8 @@
<&dai_pri_tdm_rx_0>, <&dai_pri_tdm_tx_0>,
<&dai_sec_tdm_rx_0>, <&dai_sec_tdm_tx_0>,
<&dai_tert_tdm_rx_0>, <&dai_tert_tdm_tx_0>,
<&dai_quat_tdm_rx_0>, <&dai_quat_tdm_tx_0>;
<&dai_quat_tdm_rx_0>, <&dai_quat_tdm_tx_0>,
<&proxy_rx>, <&proxy_tx>;
asoc-cpu-names = "msm-dai-q6-dp.24608", "msm-dai-q6-mi2s.0",
"msm-dai-q6-mi2s.1",
"msm-dai-q6-mi2s.2", "msm-dai-q6-mi2s.3",
@ -702,7 +713,8 @@
"msm-dai-q6-tdm.36865", "msm-dai-q6-tdm.36880",
"msm-dai-q6-tdm.36881", "msm-dai-q6-tdm.36896",
"msm-dai-q6-tdm.36897", "msm-dai-q6-tdm.36912",
"msm-dai-q6-tdm.36913";
"msm-dai-q6-tdm.36913",
"msm-dai-q6-dev.8194", "msm-dai-q6-dev.8195";
asoc-codec = <&stub_codec>, <&ext_disp_audio_codec>;
asoc-codec-names = "msm-stub-codec.1",
"msm-ext-disp-audio-codec-rx";
@ -784,7 +796,8 @@
<&dai_pri_tdm_rx_0>, <&dai_pri_tdm_tx_0>,
<&dai_sec_tdm_rx_0>, <&dai_sec_tdm_tx_0>,
<&dai_tert_tdm_rx_0>, <&dai_tert_tdm_tx_0>,
<&dai_quat_tdm_rx_0>, <&dai_quat_tdm_tx_0>;
<&dai_quat_tdm_rx_0>, <&dai_quat_tdm_tx_0>,
<&proxy_rx>, <&proxy_tx>;
asoc-cpu-names = "msm-dai-q6-dp.24608", "msm-dai-q6-mi2s.0",
"msm-dai-q6-mi2s.1",
"msm-dai-q6-mi2s.2", "msm-dai-q6-mi2s.3",
@ -807,7 +820,8 @@
"msm-dai-q6-tdm.36865", "msm-dai-q6-tdm.36880",
"msm-dai-q6-tdm.36881", "msm-dai-q6-tdm.36896",
"msm-dai-q6-tdm.36897", "msm-dai-q6-tdm.36912",
"msm-dai-q6-tdm.36913";
"msm-dai-q6-tdm.36913",
"msm-dai-q6-dev.8194", "msm-dai-q6-dev.8195";
asoc-codec = <&stub_codec>, <&ext_disp_audio_codec>;
asoc-codec-names = "msm-stub-codec.1",
"msm-ext-disp-audio-codec-rx";
@ -893,7 +907,8 @@
<&dai_pri_tdm_rx_0>, <&dai_pri_tdm_tx_0>,
<&dai_sec_tdm_rx_0>, <&dai_sec_tdm_tx_0>,
<&dai_tert_tdm_rx_0>, <&dai_tert_tdm_tx_0>,
<&dai_quat_tdm_rx_0>, <&dai_quat_tdm_tx_0>;
<&dai_quat_tdm_rx_0>, <&dai_quat_tdm_tx_0>,
<&proxy_rx>, <&proxy_tx>;
asoc-cpu-names = "msm-dai-q6-dp.24608", "msm-dai-q6-mi2s.0",
"msm-dai-q6-mi2s.1",
"msm-dai-q6-mi2s.2", "msm-dai-q6-mi2s.3",
@ -912,7 +927,8 @@
"msm-dai-q6-tdm.36864", "msm-dai-q6-tdm.36865",
"msm-dai-q6-tdm.36880", "msm-dai-q6-tdm.36881",
"msm-dai-q6-tdm.36896", "msm-dai-q6-tdm.36897",
"msm-dai-q6-tdm.36912", "msm-dai-q6-tdm.36913";
"msm-dai-q6-tdm.36912", "msm-dai-q6-tdm.36913",
"msm-dai-q6-dev.8194", "msm-dai-q6-dev.8195";
asoc-codec = <&stub_codec>, <&msm_digital_codec>,
<&pmic_analog_codec>, <&msm_sdw_codec>,
<&ext_disp_audio_codec>;

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2008-2018,2020 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2002,2007-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2002,2007-2017,2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -473,11 +473,12 @@ void adreno_drawctxt_detach(struct kgsl_context *context)
drawctxt = ADRENO_CONTEXT(context);
rb = drawctxt->rb;
spin_lock(&drawctxt->lock);
spin_lock(&adreno_dev->active_list_lock);
list_del_init(&drawctxt->active_node);
spin_unlock(&adreno_dev->active_list_lock);
spin_lock(&drawctxt->lock);
count = drawctxt_detach_drawobjs(drawctxt, list);
spin_unlock(&drawctxt->lock);

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2002,2007-2017,2019-2020, The Linux Foundation. All rights reserved.
/* Copyright (c) 2002,2007-2017,2019-2020 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2008-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -2490,7 +2490,7 @@ long kgsl_ioctl_gpuobj_import(struct kgsl_device_private *dev_priv,
return 0;
unmap:
if (param->type == KGSL_USER_MEM_TYPE_DMABUF) {
if (kgsl_memdesc_usermem_type(&entry->memdesc) == KGSL_MEM_ENTRY_ION) {
kgsl_destroy_ion(entry->priv_data);
entry->memdesc.sgt = NULL;
}
@ -2799,7 +2799,7 @@ long kgsl_ioctl_map_user_mem(struct kgsl_device_private *dev_priv,
return result;
error_attach:
switch (memtype) {
switch (kgsl_memdesc_usermem_type(&entry->memdesc)) {
case KGSL_MEM_ENTRY_ION:
kgsl_destroy_ion(entry->priv_data);
entry->memdesc.sgt = NULL;
@ -4206,6 +4206,8 @@ kgsl_mmap_memstore(struct kgsl_device *device, struct vm_area_struct *vma)
if (vma->vm_flags & VM_WRITE)
return -EPERM;
vma->vm_flags &= ~VM_MAYWRITE;
if (memdesc->size != vma_size) {
KGSL_MEM_ERR(device, "memstore bad size: %d should be %llu\n",
vma_size, memdesc->size);

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -2389,6 +2389,22 @@ static uint64_t kgsl_iommu_find_svm_region(struct kgsl_pagetable *pagetable,
return addr;
}
static bool iommu_addr_in_svm_ranges(struct kgsl_iommu_pt *pt,
u64 gpuaddr, u64 size)
{
if ((gpuaddr >= pt->compat_va_start && gpuaddr < pt->compat_va_end) &&
((gpuaddr + size) > pt->compat_va_start &&
(gpuaddr + size) <= pt->compat_va_end))
return true;
if ((gpuaddr >= pt->svm_start && gpuaddr < pt->svm_end) &&
((gpuaddr + size) > pt->svm_start &&
(gpuaddr + size) <= pt->svm_end))
return true;
return false;
}
static int kgsl_iommu_set_svm_region(struct kgsl_pagetable *pagetable,
uint64_t gpuaddr, uint64_t size)
{
@ -2396,9 +2412,8 @@ static int kgsl_iommu_set_svm_region(struct kgsl_pagetable *pagetable,
struct kgsl_iommu_pt *pt = pagetable->priv;
struct rb_node *node;
/* Make sure the requested address doesn't fall in the global range */
if (ADDR_IN_GLOBAL(pagetable->mmu, gpuaddr) ||
ADDR_IN_GLOBAL(pagetable->mmu, gpuaddr + size))
/* Make sure the requested address doesn't fall out of SVM range */
if (!iommu_addr_in_svm_ranges(pt, gpuaddr, size))
return -ENOMEM;
spin_lock(&pagetable->lock);

View file

@ -853,16 +853,18 @@ static int input_default_setkeycode(struct input_dev *dev,
}
}
__clear_bit(*old_keycode, dev->keybit);
__set_bit(ke->keycode, dev->keybit);
for (i = 0; i < dev->keycodemax; i++) {
if (input_fetch_keycode(dev, i) == *old_keycode) {
__set_bit(*old_keycode, dev->keybit);
break; /* Setting the bit twice is useless, so break */
if (*old_keycode <= KEY_MAX) {
__clear_bit(*old_keycode, dev->keybit);
for (i = 0; i < dev->keycodemax; i++) {
if (input_fetch_keycode(dev, i) == *old_keycode) {
__set_bit(*old_keycode, dev->keybit);
/* Setting the bit twice is useless, so break */
break;
}
}
}
__set_bit(ke->keycode, dev->keybit);
return 0;
}
@ -918,9 +920,13 @@ int input_set_keycode(struct input_dev *dev,
* Simulate keyup event if keycode is not present
* in the keymap anymore
*/
if (test_bit(EV_KEY, dev->evbit) &&
!is_event_supported(old_keycode, dev->keybit, KEY_MAX) &&
__test_and_clear_bit(old_keycode, dev->key)) {
if (old_keycode > KEY_MAX) {
dev_warn(dev->dev.parent ?: &dev->dev,
"%s: got too big old keycode %#x\n",
__func__, old_keycode);
} else if (test_bit(EV_KEY, dev->evbit) &&
!is_event_supported(old_keycode, dev->keybit, KEY_MAX) &&
__test_and_clear_bit(old_keycode, dev->key)) {
struct input_value vals[] = {
{ EV_KEY, old_keycode, 0 },
input_value_sync

View file

@ -1411,6 +1411,11 @@ static int uvc_scan_chain_forward(struct uvc_video_chain *chain,
break;
if (forward == prev)
continue;
if (forward->chain.next || forward->chain.prev) {
uvc_trace(UVC_TRACE_DESCR, "Found reference to "
"entity %d already in chain.\n", forward->id);
return -EINVAL;
}
switch (UVC_ENTITY_TYPE(forward)) {
case UVC_VC_EXTENSION_UNIT:
@ -1492,6 +1497,13 @@ static int uvc_scan_chain_backward(struct uvc_video_chain *chain,
return -1;
}
if (term->chain.next || term->chain.prev) {
uvc_trace(UVC_TRACE_DESCR, "Found reference to "
"entity %d already in chain.\n",
term->id);
return -EINVAL;
}
if (uvc_trace_param & UVC_TRACE_PROBE)
printk(" %d", term->id);

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, 2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -1429,7 +1429,7 @@ struct adm_cmd_connect_afe_port_v5 {
#define AFE_PORT_ID_SLIMBUS_RANGE_SIZE 0xA
/* Size of the range of port IDs for real-time proxy ports. */
#define AFE_PORT_ID_RT_PROXY_PORT_RANGE_SIZE 0x2
#define AFE_PORT_ID_RT_PROXY_PORT_RANGE_SIZE 0x4
/* Size of the range of port IDs for pseudoports. */
#define AFE_PORT_ID_PSEUDOPORT_RANGE_SIZE 0x5
@ -1643,6 +1643,15 @@ struct adm_cmd_connect_afe_port_v5 {
*/
#define AFE_PORT_ID_VOICE2_PLAYBACK_TX 0x8002
#define AFE_PORT_ID_VOICE_PLAYBACK_TX 0x8005
/*
* Proxyport used for voice call data processing.
* In cases like call-screening feature, where user can communicate
* with caller with the help of "call screen" mode, and without
* connecting the call with any HW input/output devices in the phon,
* voice call can use Pseudo port to start voice data processing.
*/
#define RT_PROXY_PORT_002_TX 0x2003
#define RT_PROXY_PORT_002_RX 0x2002
#define AFE_PORT_ID_PRIMARY_TDM_RX \
(AFE_PORT_ID_TDM_PORT_RANGE_START + 0x00)

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, 2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -235,6 +235,9 @@ enum {
IDX_AFE_PORT_ID_QUATERNARY_MI2S_TX_2,
IDX_AFE_PORT_ID_QUATERNARY_MI2S_TX_3,
IDX_AFE_PORT_ID_QUATERNARY_MI2S_TX_4,
/* IDX 167 -> 168 */
IDX_RT_PROXY_PORT_002_RX,
IDX_RT_PROXY_PORT_002_TX,
AFE_MAX_PORTS
};

View file

@ -99,24 +99,12 @@ enum {
AFE_FB_SPKR_PROT_TH_VI_CAL_TYPE,
AFE_FB_SPKR_PROT_EX_VI_CAL_TYPE,
AFE_SIDETONE_IIR_CAL_TYPE,
AFE_LSM_TOPOLOGY_CAL_TYPE,
AFE_LSM_TX_CAL_TYPE,
ADM_LSM_TOPOLOGY_CAL_TYPE,
ADM_LSM_AUDPROC_CAL_TYPE,
ADM_LSM_AUDPROC_PERSISTENT_CAL_TYPE,
ADM_AUDPROC_PERSISTENT_CAL_TYPE,
MAX_CAL_TYPES,
};
#define AFE_FB_SPKR_PROT_TH_VI_CAL_TYPE AFE_FB_SPKR_PROT_TH_VI_CAL_TYPE
#define AFE_FB_SPKR_PROT_EX_VI_CAL_TYPE AFE_FB_SPKR_PROT_EX_VI_CAL_TYPE
#define ADM_AUDPROC_PERSISTENT_CAL_TYPE ADM_AUDPROC_PERSISTENT_CAL_TYPE
#define ADM_LSM_AUDPROC_PERSISTENT_CAL_TYPE ADM_LSM_AUDPROC_PERSISTENT_CAL_TYPE
#define ADM_LSM_AUDPROC_CAL_TYPE ADM_LSM_AUDPROC_CAL_TYPE
#define AFE_LSM_TOPOLOGY_CAL_TYPE AFE_LSM_TOPOLOGY_CAL_TYPE
#define AFE_LSM_TX_CAL_TYPE AFE_LSM_TX_CAL_TYPE
#define ADM_LSM_AUDPROC_CAL_TYPE ADM_LSM_AUDPROC_CAL_TYPE
#define AFE_SIDETONE_IIR_CAL_TYPE AFE_SIDETONE_IIR_CAL_TYPE
enum {

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2017, 2020 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -71,8 +71,8 @@ static struct cluster_data cluster_state[MAX_CLUSTERS];
static unsigned int num_clusters;
#define for_each_cluster(cluster, idx) \
for ((cluster) = &cluster_state[idx]; (idx) < num_clusters;\
(idx)++, (cluster) = &cluster_state[idx])
for (; (idx) < num_clusters && ((cluster) = &cluster_state[idx]);\
(idx)++)
static DEFINE_SPINLOCK(state_lock);
static void apply_need(struct cluster_data *state);

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -1876,6 +1876,8 @@ static int msm_dai_q6_hw_params(struct snd_pcm_substream *substream,
case RT_PROXY_DAI_001_RX:
case RT_PROXY_DAI_002_TX:
case RT_PROXY_DAI_002_RX:
case RT_PROXY_PORT_002_TX:
case RT_PROXY_PORT_002_RX:
rc = msm_dai_q6_afe_rtproxy_hw_params(params, dai);
break;
case VOICE_PLAYBACK_TX:
@ -2872,6 +2874,42 @@ static struct snd_soc_dai_driver msm_dai_q6_incall_record_dai[] = {
},
};
static struct snd_soc_dai_driver msm_dai_q6_proxy_tx_dai = {
.capture = {
.stream_name = "Proxy Capture",
.aif_name = "PROXY_TX",
.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 |
SNDRV_PCM_RATE_16000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
.channels_min = 1,
.channels_max = 2,
.rate_min = 8000,
.rate_max = 48000,
},
.ops = &msm_dai_q6_ops,
.id = RT_PROXY_PORT_002_TX,
.probe = msm_dai_q6_dai_probe,
.remove = msm_dai_q6_dai_remove,
};
static struct snd_soc_dai_driver msm_dai_q6_proxy_rx_dai = {
.playback = {
.stream_name = "Proxy Playback",
.aif_name = "PROXY_RX",
.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 |
SNDRV_PCM_RATE_16000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
.channels_min = 1,
.channels_max = 2,
.rate_min = 8000,
.rate_max = 48000,
},
.ops = &msm_dai_q6_ops,
.id = RT_PROXY_PORT_002_RX,
.probe = msm_dai_q6_dai_probe,
.remove = msm_dai_q6_dai_remove,
};
static struct snd_soc_dai_driver msm_dai_q6_usb_rx_dai = {
.playback = {
.stream_name = "USB Audio Playback",
@ -5872,7 +5910,14 @@ register_uplink_capture:
pr_err("%s: Device not found stream name %s\n",
__func__, stream_name);
break;
case RT_PROXY_PORT_002_RX:
rc = snd_soc_register_component(&pdev->dev,
&msm_dai_q6_component, &msm_dai_q6_proxy_rx_dai, 1);
break;
case RT_PROXY_PORT_002_TX:
rc = snd_soc_register_component(&pdev->dev,
&msm_dai_q6_component, &msm_dai_q6_proxy_tx_dai, 1);
break;
default:
rc = -ENODEV;
break;

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -545,11 +545,23 @@ static int msm_pcm_volume_ctl_put(struct snd_kcontrol *kcontrol,
{
int rc = 0;
struct snd_pcm_volume *vol = kcontrol->private_data;
struct snd_pcm_substream *substream = vol->pcm->streams[0].substream;
struct snd_pcm_substream *substream = NULL;
struct msm_pcm_loopback *prtd;
int volume = ucontrol->value.integer.value[0];
pr_debug("%s: volume : 0x%x\n", __func__, volume);
if (!vol) {
pr_err("%s: vol is NULL\n", __func__);
return -ENODEV;
}
if (!vol->pcm) {
pr_err("%s: vol->pcm is NULL\n", __func__);
return -ENODEV;
}
substream = vol->pcm->streams[0].substream;
mutex_lock(&loopback_session_lock);
if ((!substream) || (!substream->runtime)) {
pr_err("%s substream or runtime not found\n", __func__);
@ -579,6 +591,19 @@ static int msm_pcm_volume_ctl_get(struct snd_kcontrol *kcontrol,
struct msm_pcm_loopback *prtd;
pr_debug("%s\n", __func__);
if (!vol) {
pr_err("%s: vol is NULL\n", __func__);
return -ENODEV;
}
if (!vol->pcm) {
pr_err("%s: vol->pcm is NULL\n", __func__);
return -ENODEV;
}
substream = vol->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
if ((!substream) || (!substream->runtime)) {
pr_err("%s substream or runtime not found\n", __func__);
rc = -ENODEV;

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2017, 2019-2020 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -668,12 +668,22 @@ static int msm_pcm_volume_ctl_get(struct snd_kcontrol *kcontrol,
{
struct snd_pcm_volume *vol = snd_kcontrol_chip(kcontrol);
struct msm_plat_data *pdata = NULL;
struct snd_pcm_substream *substream =
vol->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
struct snd_pcm_substream *substream = NULL;
struct snd_soc_pcm_runtime *soc_prtd = NULL;
struct msm_audio *prtd;
pr_debug("%s\n", __func__);
if (!vol) {
pr_err("%s: vol is NULL\n", __func__);
return -ENODEV;
}
if (!vol->pcm) {
pr_err("%s: vol->pcm is NULL\n", __func__);
return -ENODEV;
}
substream = vol->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
if (!substream) {
pr_err("%s substream not found\n", __func__);
return -ENODEV;
@ -705,13 +715,25 @@ static int msm_pcm_volume_ctl_put(struct snd_kcontrol *kcontrol,
int rc = 0;
struct snd_pcm_volume *vol = snd_kcontrol_chip(kcontrol);
struct msm_plat_data *pdata = NULL;
struct snd_pcm_substream *substream =
vol->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
struct snd_pcm_substream *substream = NULL;
struct snd_soc_pcm_runtime *soc_prtd = NULL;
struct msm_audio *prtd;
int volume = ucontrol->value.integer.value[0];
pr_debug("%s: volume : 0x%x\n", __func__, volume);
if (!vol) {
pr_err("%s: vol is NULL\n", __func__);
return -ENODEV;
}
if (!vol->pcm) {
pr_err("%s: vol->pcm is NULL\n", __func__);
return -ENODEV;
}
substream = vol->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
if (!substream) {
pr_err("%s substream not found\n", __func__);
return -ENODEV;

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -1393,12 +1393,22 @@ static int msm_pcm_volume_ctl_get(struct snd_kcontrol *kcontrol,
{
struct snd_pcm_volume *vol = snd_kcontrol_chip(kcontrol);
struct msm_plat_data *pdata = NULL;
struct snd_pcm_substream *substream =
vol->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
struct snd_pcm_substream *substream = NULL;
struct snd_soc_pcm_runtime *soc_prtd = NULL;
struct msm_audio *prtd;
pr_debug("%s\n", __func__);
if (!vol) {
pr_err("%s: vol is NULL\n", __func__);
return -ENODEV;
}
if (!vol->pcm) {
pr_err("%s: vol->pcm is NULL\n", __func__);
return -ENODEV;
}
substream = vol->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
if (!substream) {
pr_err("%s substream not found\n", __func__);
return -ENODEV;
@ -1430,14 +1440,24 @@ static int msm_pcm_volume_ctl_put(struct snd_kcontrol *kcontrol,
{
int rc = 0;
struct snd_pcm_volume *vol = snd_kcontrol_chip(kcontrol);
struct snd_pcm_substream *substream =
vol->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
struct snd_pcm_substream *substream = NULL;
struct msm_audio *prtd;
int volume = ucontrol->value.integer.value[0];
struct snd_soc_pcm_runtime *soc_prtd = NULL;
struct msm_plat_data *pdata = NULL;
pr_debug("%s: volume : 0x%x\n", __func__, volume);
if (!vol) {
pr_err("%s: vol is NULL\n", __func__);
return -ENODEV;
}
if (!vol->pcm) {
pr_err("%s: vol->pcm is NULL\n", __func__);
return -ENODEV;
}
substream = vol->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
if (!substream) {
pr_err("%s: substream not found\n", __func__);
return -ENODEV;

View file

@ -593,7 +593,11 @@ struct msm_pcm_routing_bdai_data msm_bedais[MSM_BACKEND_DAI_MAX] = {
{ AFE_PORT_ID_QUATERNARY_MI2S_TX_3, 0, {0}, {0}, 0, 0, 0, 0, {0},
LPASS_BE_QUAT_MI2S_TX_3},
{ AFE_PORT_ID_QUATERNARY_MI2S_TX_4, 0, {0}, {0}, 0, 0, 0, 0, {0},
LPASS_BE_QUAT_MI2S_TX_4}
LPASS_BE_QUAT_MI2S_TX_4},
{ RT_PROXY_PORT_002_RX, 0, {0}, {0}, 0, 0, 0, 0, {0},
LPASS_BE_PROXY_RX},
{ RT_PROXY_PORT_002_TX, 0, {0}, {0}, 0, 0, 0, 0, {0},
LPASS_BE_PROXY_TX}
};
/* Track ASM playback & capture sessions of DAI
@ -3028,7 +3032,7 @@ static const char *const be_name[] = {
"INT0_MI2S_RX", "INT0_MI2S_TX", "INT1_MI2S_RX", "INT1_MI2S_TX",
"INT2_MI2S_RX", "INT2_MI2S_TX", "INT3_MI2S_RX", "INT3_MI2S_TX",
"INT4_MI2S_RX", "INT4_MI2S_TX", "INT5_MI2S_RX", "INT5_MI2S_TX",
"INT6_MI2S_RX", "INT6_MI2S_TX"
"INT6_MI2S_RX", "INT6_MI2S_TX", "PROXY_RX", "PROXY_TX"
};
static SOC_ENUM_SINGLE_DECL(mm1_channel_mux,
@ -13262,6 +13266,17 @@ static const struct snd_kcontrol_new tx_vowlan_mixer_controls[] = {
msm_routing_put_voice_mixer),
};
static const struct snd_kcontrol_new proxy_rx_voice_mixer_controls[] = {
SOC_DOUBLE_EXT("VoiceMMode1", SND_SOC_NOPM,
MSM_BACKEND_DAI_PROXY_RX,
MSM_FRONTEND_DAI_VOICEMMODE1, 1, 0, msm_routing_get_voice_mixer,
msm_routing_put_voice_mixer),
SOC_DOUBLE_EXT("VoiceMMode2", SND_SOC_NOPM,
MSM_BACKEND_DAI_PROXY_RX,
MSM_FRONTEND_DAI_VOICEMMODE2, 1, 0, msm_routing_get_voice_mixer,
msm_routing_put_voice_mixer),
};
static const struct snd_kcontrol_new tx_voicemmode1_mixer_controls[] = {
SOC_DOUBLE_EXT("PRI_TX_MMode1", SND_SOC_NOPM,
MSM_BACKEND_DAI_PRI_I2S_TX,
@ -13314,6 +13329,12 @@ static const struct snd_kcontrol_new tx_voicemmode1_mixer_controls[] = {
SOC_DOUBLE_EXT("QUAT_TDM_TX_0_MMode1", SND_SOC_NOPM,
MSM_BACKEND_DAI_QUAT_TDM_TX_0, MSM_FRONTEND_DAI_VOICEMMODE1,
1, 0, msm_routing_get_voice_mixer, msm_routing_put_voice_mixer),
SOC_DOUBLE_EXT("PROXY_TX_MMode1", SND_SOC_NOPM,
MSM_BACKEND_DAI_PROXY_TX, MSM_FRONTEND_DAI_VOICEMMODE1,
1, 0, msm_routing_get_voice_mixer, msm_routing_put_voice_mixer),
SOC_DOUBLE_EXT("PROXY_TX_MMode2", SND_SOC_NOPM,
MSM_BACKEND_DAI_PROXY_TX, MSM_FRONTEND_DAI_VOICEMMODE2,
1, 0, msm_routing_get_voice_mixer, msm_routing_put_voice_mixer),
};
static const struct snd_kcontrol_new tx_voicemmode2_mixer_controls[] = {
@ -17636,6 +17657,8 @@ static const struct snd_soc_dapm_widget msm_qdsp6_widgets[] = {
SND_SOC_DAPM_AIF_IN("SLIMBUS_8_TX", "Slimbus8 Capture", 0, 0, 0, 0),
SND_SOC_DAPM_AIF_OUT("USB_AUDIO_RX", "USB Audio Playback", 0, 0, 0, 0),
SND_SOC_DAPM_AIF_IN("USB_AUDIO_TX", "USB Audio Capture", 0, 0, 0, 0),
SND_SOC_DAPM_AIF_OUT("PROXY_RX", "Proxy Playback", 0, 0, 0, 0),
SND_SOC_DAPM_AIF_IN("PROXY_TX", "Proxy Capture", 0, 0, 0, 0),
/* Switch Definitions */
SND_SOC_DAPM_SWITCH("SLIMBUS_DL_HL", SND_SOC_NOPM, 0, 0,
@ -17985,6 +18008,10 @@ static const struct snd_soc_dapm_widget msm_qdsp6_widgets[] = {
SND_SOC_DAPM_MIXER("Voice2_Tx Mixer",
SND_SOC_NOPM, 0, 0, tx_voice2_mixer_controls,
ARRAY_SIZE(tx_voice2_mixer_controls)),
SND_SOC_DAPM_MIXER("PROXY_RX_Voice Mixer",
SND_SOC_NOPM, 0, 0,
proxy_rx_voice_mixer_controls,
ARRAY_SIZE(proxy_rx_voice_mixer_controls)),
SND_SOC_DAPM_MIXER("Voip_Tx Mixer",
SND_SOC_NOPM, 0, 0, tx_voip_mixer_controls,
ARRAY_SIZE(tx_voip_mixer_controls)),
@ -18463,9 +18490,11 @@ static const struct snd_soc_dapm_route intercon[] = {
{"MultiMedia1 Mixer", "VOC_REC_UL", "INCALL_RECORD_TX"},
{"MultiMedia4 Mixer", "VOC_REC_UL", "INCALL_RECORD_TX"},
{"MultiMedia8 Mixer", "VOC_REC_UL", "INCALL_RECORD_TX"},
{"MultiMedia9 Mixer", "VOC_REC_UL", "INCALL_RECORD_TX"},
{"MultiMedia1 Mixer", "VOC_REC_DL", "INCALL_RECORD_RX"},
{"MultiMedia4 Mixer", "VOC_REC_DL", "INCALL_RECORD_RX"},
{"MultiMedia8 Mixer", "VOC_REC_DL", "INCALL_RECORD_RX"},
{"MultiMedia9 Mixer", "VOC_REC_DL", "INCALL_RECORD_RX"},
{"MultiMedia1 Mixer", "SLIM_4_TX", "SLIMBUS_4_TX"},
{"MultiMedia1 Mixer", "SLIM_6_TX", "SLIMBUS_6_TX"},
{"MultiMedia1 Mixer", "SLIM_7_TX", "SLIMBUS_7_TX"},
@ -20332,6 +20361,12 @@ static const struct snd_soc_dapm_route intercon[] = {
{"QUAT_TDM_RX_2_Voice Mixer", "DTMF", "DTMF_DL_HL"},
{"QUAT_TDM_RX_2", NULL, "QUAT_TDM_RX_2_Voice Mixer"},
{"PROXY_RX_Voice Mixer", "VoiceMMode1", "VOICEMMODE1_DL"},
{"PROXY_RX", NULL, "PROXY_RX_Voice Mixer"},
{"PROXY_RX_Voice Mixer", "VoiceMMode2", "VOICEMMODE2_DL"},
{"PROXY_RX", NULL, "PROXY_RX_Voice Mixer"},
{"VOC_EXT_EC MUX", "PRI_MI2S_TX" , "PRI_MI2S_TX"},
{"VOC_EXT_EC MUX", "SEC_MI2S_TX" , "SEC_MI2S_TX"},
{"VOC_EXT_EC MUX", "TERT_MI2S_TX" , "TERT_MI2S_TX"},
@ -20522,6 +20557,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"VoiceMMode1_Tx Mixer", "TERT_AUX_PCM_TX_MMode1", "TERT_AUX_PCM_TX"},
{"VoiceMMode1_Tx Mixer", "QUAT_AUX_PCM_TX_MMode1", "QUAT_AUX_PCM_TX"},
{"VoiceMMode1_Tx Mixer", "QUAT_TDM_TX_0_MMode1", "QUAT_TDM_TX_0"},
{"VoiceMMode1_Tx Mixer", "PROXY_TX_MMode1", "PROXY_TX"},
{"VOICEMMODE1_UL", NULL, "VoiceMMode1_Tx Mixer"},
{"VoiceMMode2_Tx Mixer", "PRI_TX_MMode2", "PRI_I2S_TX"},
@ -20539,6 +20575,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"VoiceMMode2_Tx Mixer", "SEC_AUX_PCM_TX_MMode2", "SEC_AUX_PCM_TX"},
{"VoiceMMode2_Tx Mixer", "TERT_AUX_PCM_TX_MMode2", "TERT_AUX_PCM_TX"},
{"VoiceMMode2_Tx Mixer", "QUAT_AUX_PCM_TX_MMode2", "QUAT_AUX_PCM_TX"},
{"VoiceMMode2_Tx Mixer", "PROXY_TX_MMode2", "PROXY_TX"},
{"VOICEMMODE2_UL", NULL, "VoiceMMode2_Tx Mixer"},
{"Voip_Tx Mixer", "PRI_TX_Voip", "PRI_I2S_TX"},
@ -21371,6 +21408,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"BE_OUT", NULL, "QUAT_MI2S_RX_2"},
{"BE_OUT", NULL, "QUAT_MI2S_RX_3"},
{"BE_OUT", NULL, "QUAT_MI2S_RX_4"},
{"BE_OUT", NULL, "PROXY_RX"},
{"PRI_I2S_TX", NULL, "BE_IN"},
{"MI2S_TX", NULL, "BE_IN"},
@ -21446,6 +21484,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"QUAT_TDM_TX_1", NULL, "BE_IN"},
{"QUAT_TDM_TX_2", NULL, "BE_IN"},
{"QUAT_TDM_TX_3", NULL, "BE_IN"},
{"PROXY_TX", NULL, "BE_IN"},
};
static int msm_pcm_routing_hw_params(struct snd_pcm_substream *substream,

View file

@ -45,6 +45,8 @@
#define LPASS_BE_VOICE2_PLAYBACK_TX "VOICE2_PLAYBACK_TX"
#define LPASS_BE_INCALL_RECORD_RX "INCALL_RECORD_RX"
#define LPASS_BE_INCALL_RECORD_TX "INCALL_RECORD_TX"
#define LPASS_BE_PROXY_RX "PROXY_RX"
#define LPASS_BE_PROXY_TX "PROXY_TX"
#define LPASS_BE_SEC_I2S_RX "SECONDARY_I2S_RX"
#define LPASS_BE_SPDIF_RX "SPDIF_RX"
@ -429,6 +431,8 @@ enum {
MSM_BACKEND_DAI_QUATERNARY_MI2S_TX_2,
MSM_BACKEND_DAI_QUATERNARY_MI2S_TX_3,
MSM_BACKEND_DAI_QUATERNARY_MI2S_TX_4,
MSM_BACKEND_DAI_PROXY_RX,
MSM_BACKEND_DAI_PROXY_TX,
MSM_BACKEND_DAI_MAX,
};

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -785,6 +785,8 @@ int afe_get_port_type(u16 port_id)
case VOICE_PLAYBACK_TX:
case VOICE2_PLAYBACK_TX:
case RT_PROXY_PORT_001_RX:
case RT_PROXY_PORT_002_RX:
case RT_PROXY_PORT_002_TX:
case AUDIO_PORT_ID_I2S_RX:
case AFE_PORT_ID_PRIMARY_MI2S_RX:
case AFE_PORT_ID_SECONDARY_MI2S_RX:
@ -3422,6 +3424,8 @@ static int __afe_port_start(u16 port_id, union afe_port_config *afe_config,
break;
case RT_PROXY_PORT_001_RX:
case RT_PROXY_PORT_001_TX:
case RT_PROXY_PORT_002_RX:
case RT_PROXY_PORT_002_TX:
cfg_type = AFE_PARAM_ID_RT_PROXY_CONFIG;
break;
case INT_BT_SCO_RX:
@ -3833,6 +3837,10 @@ int afe_get_port_index(u16 port_id)
return IDX_AFE_PORT_ID_QUATERNARY_MI2S_RX_3;
case AFE_PORT_ID_QUATERNARY_MI2S_RX_4:
return IDX_AFE_PORT_ID_QUATERNARY_MI2S_RX_4;
case RT_PROXY_PORT_002_RX:
return IDX_RT_PROXY_PORT_002_RX;
case RT_PROXY_PORT_002_TX:
return IDX_RT_PROXY_PORT_002_TX;
default:
pr_err("%s: port 0x%x\n", __func__, port_id);
return -EINVAL;
@ -5810,6 +5818,8 @@ int afe_validate_port(u16 port_id)
case AFE_PORT_ID_INT4_MI2S_TX:
case AFE_PORT_ID_INT5_MI2S_TX:
case AFE_PORT_ID_INT6_MI2S_TX:
case RT_PROXY_PORT_002_RX:
case RT_PROXY_PORT_002_TX:
{
ret = 0;
break;

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, 2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -309,6 +309,10 @@ int q6audio_get_port_index(u16 port_id)
return IDX_AFE_PORT_ID_INT6_MI2S_RX;
case AFE_PORT_ID_INT6_MI2S_TX:
return IDX_AFE_PORT_ID_INT6_MI2S_TX;
case RT_PROXY_PORT_002_RX:
return IDX_RT_PROXY_PORT_002_RX;
case RT_PROXY_PORT_002_TX:
return IDX_RT_PROXY_PORT_002_TX;
default: return -EINVAL;
}
}
@ -604,6 +608,10 @@ int q6audio_get_port_id(u16 port_id)
return AFE_PORT_ID_INT6_MI2S_RX;
case AFE_PORT_ID_INT6_MI2S_TX:
return AFE_PORT_ID_INT6_MI2S_TX;
case RT_PROXY_PORT_002_RX:
return RT_PROXY_PORT_002_RX;
case RT_PROXY_PORT_002_TX:
return RT_PROXY_PORT_002_TX;
default:
pr_warn("%s: Invalid port_id %d\n", __func__, port_id);
return -EINVAL;
@ -939,6 +947,8 @@ int q6audio_validate_port(u16 port_id)
case AFE_PORT_ID_QUATERNARY_MI2S_TX_2:
case AFE_PORT_ID_QUATERNARY_MI2S_TX_3:
case AFE_PORT_ID_QUATERNARY_MI2S_TX_4:
case RT_PROXY_PORT_002_RX:
case RT_PROXY_PORT_002_TX:
{
ret = 0;
break;

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2018, 2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -1449,6 +1449,34 @@ static struct snd_soc_dai_link msm_ext_common_be_dai[] = {
.be_hw_params_fixup = msm_ext_be_hw_params_fixup,
.ignore_suspend = 1,
},
/* Proxy Tx BACK END DAI Link */
{
.name = LPASS_BE_PROXY_TX,
.stream_name = "Proxy Capture",
.cpu_dai_name = "msm-dai-q6-dev.8195",
.platform_name = "msm-pcm-routing",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-tx",
.no_pcm = 1,
.dpcm_capture = 1,
.be_id = MSM_BACKEND_DAI_PROXY_TX,
.ignore_suspend = 1,
},
/* Proxy Rx BACK END DAI Link */
{
.name = LPASS_BE_PROXY_RX,
.stream_name = "Proxy Playback",
.cpu_dai_name = "msm-dai-q6-dev.8194",
.platform_name = "msm-pcm-routing",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-rx",
.no_pcm = 1,
.dpcm_playback = 1,
.be_id = MSM_BACKEND_DAI_PROXY_RX,
.ignore_pmdown_time = 1,
.ignore_suspend = 1,
},
{
.name = LPASS_BE_USB_AUDIO_RX,
.stream_name = "USB Audio Playback",

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2018, 2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -2587,6 +2587,33 @@ static struct snd_soc_dai_link msm_int_be_dai[] = {
.be_hw_params_fixup = msm_be_hw_params_fixup,
.ignore_suspend = 1,
},
/* Proxy Tx BACK END DAI Link */
{
.name = LPASS_BE_PROXY_TX,
.stream_name = "Proxy Capture",
.cpu_dai_name = "msm-dai-q6-dev.8195",
.platform_name = "msm-pcm-routing",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-tx",
.no_pcm = 1,
.dpcm_capture = 1,
.be_id = MSM_BACKEND_DAI_PROXY_TX,
.ignore_suspend = 1,
},
/* Proxy Rx BACK END DAI Link */
{
.name = LPASS_BE_PROXY_RX,
.stream_name = "Proxy Playback",
.cpu_dai_name = "msm-dai-q6-dev.8194",
.platform_name = "msm-pcm-routing",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-rx",
.no_pcm = 1,
.dpcm_playback = 1,
.be_id = MSM_BACKEND_DAI_PROXY_RX,
.ignore_pmdown_time = 1,
.ignore_suspend = 1,
},
{
.name = LPASS_BE_USB_AUDIO_RX,
.stream_name = "USB Audio Playback",