Merge "asoc: add sys_usage automatically update function for tambora"

This commit is contained in:
qctecmdr
2024-03-28 10:21:29 -07:00
gecommit door Gerrit - the friendly Code Review server
bovenliggende 259f7b510e 1624212a65
commit fc13351e33
4 gewijzigde bestanden met toevoegingen van 499 en 501 verwijderingen

Bestand weergeven

@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef _WCD9378_INTERNAL_H
@@ -65,13 +65,14 @@ enum {
struct wcd9378_priv {
struct device *dev;
u32 sys_usage;
/* to track the sys_usage status */
unsigned long sys_usage_status;
u32 wcd_mode;
int variant;
struct snd_soc_component *component;
struct device_node *rst_np;
struct regmap *regmap;
bool sjmic_support;
struct swr_device *rx_swr_dev;
struct swr_device *tx_swr_dev;
@@ -86,6 +87,7 @@ struct wcd9378_priv {
struct mutex micb_lock;
struct mutex wakeup_lock;
struct mutex sys_usage_lock;
s32 dmic_0_1_clk_cnt;
s32 dmic_2_3_clk_cnt;
s32 dmic_4_5_clk_cnt;
@@ -97,14 +99,12 @@ struct wcd9378_priv {
u32 hph_mode;
u16 hph_gain;
u32 curr_micbias2;
u32 rx2_clk_mode;
u32 tx_mode[TX_ADC_MAX];
s32 adc_count;
bool comp1_enable;
bool comp2_enable;
bool va_amic_en;
bool ear_enable;
bool aux_enable;
bool ldoh;
bool bcs_dis;
bool dapm_bias_off;
@@ -138,8 +138,6 @@ struct wcd9378_priv {
struct snd_info_entry *version_entry;
struct snd_info_entry *variant_entry;
int flyback_cur_det_disable;
int ear_rx_path;
int aux_rx_path;
bool dev_up;
u8 tx_master_ch_map[WCD9378_MAX_SLAVE_CH_TYPES];
bool usbc_hs_status;
@@ -226,5 +224,5 @@ extern int wcd9378_mbhc_micb_adjust_voltage(struct snd_soc_component *component,
int volt, int micb_num);
extern int wcd9378_get_micb_vout_ctl_val(u32 micb_mv);
extern int wcd9378_micbias_control(struct snd_soc_component *component,
unsigned char tx_path, int req, bool is_dapm);
int micb_num, int req, bool is_dapm);
#endif /* _WCD9378_INTERNAL_H */

Bestand weergeven

@@ -223,6 +223,15 @@ static void wcd9378_mbhc_mbhc_bias_control(struct snd_soc_component *component,
0x01, 0x00);
}
static void wcd9378_mbhc_get_micbias_val(struct wcd_mbhc *mbhc,
int *mb)
{
struct snd_soc_component *component = mbhc->component;
struct wcd9378_priv *wcd9378 = dev_get_drvdata(component->dev);
*mb = wcd9378->curr_micbias2;
}
static void wcd9378_mbhc_program_btn_thr(struct snd_soc_component *component,
s16 *btn_low, s16 *btn_high,
int num_btn, bool is_micbias)
@@ -273,13 +282,12 @@ static int wcd9378_mbhc_register_notifier(struct wcd_mbhc *mbhc,
static bool wcd9378_mbhc_micb_en_status(struct wcd_mbhc *mbhc, int micb_num)
{
u8 val = 0;
struct snd_soc_component *component = mbhc->component;
struct wcd9378_priv *wcd9378 =
dev_get_drvdata(component->dev);
if (micb_num == MIC_BIAS_2) {
val = ((snd_soc_component_read(mbhc->component,
WCD9378_ANA_MICB2) & 0xC0)
>> 6);
if (val == 0x01)
if (wcd9378->curr_micbias2)
return true;
}
return false;
@@ -287,8 +295,10 @@ static bool wcd9378_mbhc_micb_en_status(struct wcd_mbhc *mbhc, int micb_num)
static bool wcd9378_mbhc_hph_pa_on_status(struct snd_soc_component *component)
{
return (snd_soc_component_read(component, WCD9378_ANA_HPH) & 0xC0) ?
true : false;
if (snd_soc_component_read(component, WCD9378_PDE47_ACT_PS))
return false;
else
return true;
}
static void wcd9378_mbhc_hph_l_pull_up_control(
@@ -311,18 +321,7 @@ static void wcd9378_mbhc_hph_l_pull_up_control(
static int wcd9378_mbhc_request_micbias(struct snd_soc_component *component,
int micb_num, int req)
{
int ret = 0, tx_path = 0;
if (micb_num == MIC_BIAS_2) {
tx_path = ADC2;
} else {
pr_err("%s: cannot support other micbias\n", __func__);
return -EINVAL;
}
ret = wcd9378_micbias_control(component, tx_path, req, false);
return ret;
return wcd9378_micbias_control(component, micb_num, req, false);
}
static void wcd9378_mbhc_micb_ramp_control(struct snd_soc_component *component,
@@ -841,6 +840,7 @@ static const struct wcd_mbhc_cb mbhc_cb = {
.clk_setup = wcd9378_mbhc_clk_setup,
.map_btn_code_to_num = wcd9378_mbhc_btn_to_num,
.mbhc_bias = wcd9378_mbhc_mbhc_bias_control,
.get_micbias_val = wcd9378_mbhc_get_micbias_val,
.set_btn_thr = wcd9378_mbhc_program_btn_thr,
.lock_sleep = wcd9378_mbhc_lock_sleep,
.register_notifier = wcd9378_mbhc_register_notifier,

Bestand weergeven

@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef WCD9378_REGISTERS_H
@@ -873,6 +873,7 @@ enum {
#define WCD9378_TX_NEW_TX_CH34_MUX_CH3_SEL_SHIFT 0x00
#define WCD9378_CDC_HPH_GAIN_CTL_HPHR_RX_EN_SHIFT 0x03
#define WCD9378_CDC_HPH_GAIN_CTL_HPHL_RX_EN_SHIFT 0x02
#define WCD9378_CDC_AUX_GAIN_CTL_AUX_EN_SHIFT 0x00
#define SWRS_SCP_BASE_CLK_BASE (0x004d)
#define SWRS_SCP_BUSCLOCK_SCALE_BANK0 (0x0062)

Diff onderdrukt omdat het te groot bestand Laad Diff