Skip to content

Commit

Permalink
Merge tag 'LA.UM.12.2.1.r1-03100-sdm660.0' of https://git.codelinaro.…
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoleGun committed Apr 20, 2024
2 parents 712e00f + efc2e87 commit 0a36898
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 15 deletions.
3 changes: 2 additions & 1 deletion techpack/audio/asoc/codecs/bolero/rx-macro.c
Original file line number Diff line number Diff line change
Expand Up @@ -2590,7 +2590,8 @@ static void rx_macro_hphdelay_lutbypass(struct snd_soc_component *component,
}

if (hph_lut_bypass_reg && SND_SOC_DAPM_EVENT_OFF(event)) {
snd_soc_component_update_bits(component,
if (!rx_priv->is_ear_mode_on)
snd_soc_component_update_bits(component,
BOLERO_CDC_RX_RX0_RX_PATH_CFG1,
0x02, 0x00);
snd_soc_component_update_bits(component, hph_lut_bypass_reg,
Expand Down
48 changes: 35 additions & 13 deletions techpack/audio/asoc/codecs/wcd937x/wcd937x.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/

#include <linux/module.h>
Expand Down Expand Up @@ -49,6 +50,8 @@ enum {
HPH_COMP_DELAY,
HPH_PA_DELAY,
AMIC2_BCS_ENABLE,
WCD_HPHL_EN,
WCD_EAR_EN,
};

static const DECLARE_TLV_DB_SCALE(line_gain, 0, 7, 1);
Expand Down Expand Up @@ -834,6 +837,7 @@ static int wcd937x_codec_enable_hphl_pa(struct snd_soc_dapm_widget *w,
set_bit(HPH_PA_DELAY, &wcd937x->status_mask);
snd_soc_component_update_bits(component,
WCD937X_DIGITAL_PDM_WD_CTL0, 0x17, 0x13);
set_bit(WCD_HPHL_EN, &wcd937x->status_mask);
break;
case SND_SOC_DAPM_POST_PMU:
/*
Expand Down Expand Up @@ -864,12 +868,14 @@ static int wcd937x_codec_enable_hphl_pa(struct snd_soc_dapm_widget *w,
WCD937X_IRQ_HPHL_PDM_WD_INT);
break;
case SND_SOC_DAPM_PRE_PMD:
wcd_disable_irq(&wcd937x->irq_info,
if (!test_bit(WCD_EAR_EN, &wcd937x->status_mask)) {
wcd_disable_irq(&wcd937x->irq_info,
WCD937X_IRQ_HPHL_PDM_WD_INT);
if (wcd937x->update_wcd_event)
wcd937x->update_wcd_event(wcd937x->handle,
WCD_BOLERO_EVT_RX_MUTE,
(WCD_RX1 << 0x10 | 0x1));
}
blocking_notifier_call_chain(&wcd937x->mbhc->notifier,
WCD_EVENT_PRE_HPHL_PA_OFF,
&wcd937x->mbhc->wcd_mbhc);
Expand Down Expand Up @@ -900,6 +906,7 @@ static int wcd937x_codec_enable_hphl_pa(struct snd_soc_dapm_widget *w,
WCD_CLSH_EVENT_POST_PA,
WCD_CLSH_STATE_HPHL,
hph_mode);
clear_bit(WCD_HPHL_EN, &wcd937x->status_mask);
break;
};
return ret;
Expand Down Expand Up @@ -988,10 +995,12 @@ static int wcd937x_codec_enable_ear_pa(struct snd_soc_dapm_widget *w,
snd_soc_component_update_bits(component,
WCD937X_DIGITAL_PDM_WD_CTL2,
0x05, 0x05);
else
else {
snd_soc_component_update_bits(component,
WCD937X_DIGITAL_PDM_WD_CTL0,
0x17, 0x13);
set_bit(WCD_EAR_EN, &wcd937x->status_mask);
}
if (!wcd937x->comp1_enable)
snd_soc_component_update_bits(component,
WCD937X_ANA_EAR_COMPANDER_CTL, 0x80, 0x80);
Expand All @@ -1014,16 +1023,24 @@ static int wcd937x_codec_enable_ear_pa(struct snd_soc_dapm_widget *w,
WCD937X_IRQ_HPHL_PDM_WD_INT);
break;
case SND_SOC_DAPM_PRE_PMD:
if (wcd937x->ear_rx_path & EAR_RX_PATH_AUX)
if (wcd937x->ear_rx_path & EAR_RX_PATH_AUX) {
wcd_disable_irq(&wcd937x->irq_info,
WCD937X_IRQ_AUX_PDM_WD_INT);
else
wcd_disable_irq(&wcd937x->irq_info,
if (wcd937x->update_wcd_event)
wcd937x->update_wcd_event(wcd937x->handle,
WCD_BOLERO_EVT_RX_MUTE,
(WCD_RX1 << 0x10 | 0x1));
}
else {
if(!test_bit(WCD_HPHL_EN, &wcd937x->status_mask)) {
wcd_disable_irq(&wcd937x->irq_info,
WCD937X_IRQ_HPHL_PDM_WD_INT);
if (wcd937x->update_wcd_event)
wcd937x->update_wcd_event(wcd937x->handle,
if (wcd937x->update_wcd_event)
wcd937x->update_wcd_event(wcd937x->handle,
WCD_BOLERO_EVT_RX_MUTE,
(WCD_RX1 << 0x10 | 0x1));
}
}
break;
case SND_SOC_DAPM_POST_PMD:
if (!wcd937x->comp1_enable)
Expand All @@ -1040,10 +1057,12 @@ static int wcd937x_codec_enable_ear_pa(struct snd_soc_dapm_widget *w,
snd_soc_component_update_bits(component,
WCD937X_DIGITAL_PDM_WD_CTL2,
0x05, 0x00);
else
else {
snd_soc_component_update_bits(component,
WCD937X_DIGITAL_PDM_WD_CTL0,
0x17, 0x00);
clear_bit(WCD_EAR_EN, &wcd937x->status_mask);
}
usleep_range(10000, 10010);
/* disable EAR CnP FSM */
snd_soc_component_update_bits(component,
Expand Down Expand Up @@ -1109,13 +1128,16 @@ static int wcd937x_enable_rx1(struct snd_soc_dapm_widget *w,
wcd937x_rx_connect_port(component, COMP_L, true);
break;
case SND_SOC_DAPM_POST_PMD:
wcd937x_rx_connect_port(component, HPH_L, false);
if (wcd937x->comp1_enable)
wcd937x_rx_connect_port(component, COMP_L, false);
wcd937x_rx_clk_disable(component);
snd_soc_component_update_bits(component,
if (!test_bit(WCD_HPHL_EN, &wcd937x->status_mask) &&
!test_bit(WCD_EAR_EN, &wcd937x->status_mask)) {
wcd937x_rx_connect_port(component, HPH_L, false);
if (wcd937x->comp1_enable)
wcd937x_rx_connect_port(component, COMP_L, false);
wcd937x_rx_clk_disable(component);
snd_soc_component_update_bits(component,
WCD937X_DIGITAL_CDC_DIG_CLK_CTL,
0x01, 0x00);
}
break;
};
return 0;
Expand Down
7 changes: 6 additions & 1 deletion techpack/audio/asoc/msm-lsm-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -2167,8 +2167,13 @@ static int msm_lsm_ioctl_compat(struct snd_pcm_substream *substream,
prtd->lsm_client->get_param_payload = NULL;
goto done;
}
if (__builtin_uadd_overflow(sizeof(p_info_32), p_info_32.param_size, &size)) {
pr_err("%s: param size exceeds limit of %u bytes.\n",
__func__, UINT_MAX);
err = -EINVAL;
goto done;
}

size = sizeof(p_info_32) + p_info_32.param_size;
param_info_rsp = kzalloc(size, GFP_KERNEL);

if (!param_info_rsp) {
Expand Down

0 comments on commit 0a36898

Please sign in to comment.