Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70deebb7 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge deec79da on remote branch

Change-Id: I306d45f69ed4bc1aab6eead736abd2764fcf2dce
parents 408afe18 deec79da
Loading
Loading
Loading
Loading
+11 −12
Original line number Diff line number Diff line
@@ -1106,7 +1106,7 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w,
				   &tx_priv->tx_mute_dwork[decimator].dwork,
				   msecs_to_jiffies(unmute_delay));
		if (tx_priv->tx_hpf_work[decimator].hpf_cut_off_freq !=
							CF_MIN_3DB_150HZ) {
							CF_MIN_3DB_150HZ)
			queue_delayed_work(system_freezable_wq,
				&tx_priv->tx_hpf_work[decimator].dwork,
				msecs_to_jiffies(hpf_delay));
@@ -1121,7 +1121,6 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w,
		 * 6ms delay is required as per HW spec
		 */
		usleep_range(6000, 6010);
		}
		/* apply gain after decimator is enabled */
		snd_soc_component_write(component, tx_gain_ctl_reg,
			      snd_soc_component_read32(component,
+8 −1
Original line number Diff line number Diff line
@@ -180,9 +180,16 @@ static int wcd937x_init_reg(struct snd_soc_component *component)
				0xFF, 0xFA);
	/* Set Bandgap Fine Adjustment to +5mV for Tanggu SMIC part */
	if (snd_soc_component_read32(component, WCD937X_DIGITAL_EFUSE_REG_16)
	    == 0x01)
	    == 0x01) {
		snd_soc_component_update_bits(component,
				WCD937X_BIAS_VBG_FINE_ADJ, 0xF0, 0xB0);
	} else if (snd_soc_component_read32(component,
		WCD937X_DIGITAL_EFUSE_REG_16) == 0x02) {
		snd_soc_component_update_bits(component,
				WCD937X_HPH_NEW_INT_RDAC_HD2_CTL_L, 0x1F, 0x04);
		snd_soc_component_update_bits(component,
				WCD937X_HPH_NEW_INT_RDAC_HD2_CTL_R, 0x1F, 0x04);
	}
	return 0;
}

dsp/audio_calibration.c

100644 → 100755
+4 −4
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2014, 2016-2017, 2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2014, 2016-2017, 2020-2021, The Linux Foundation. All rights reserved.
 */
#include <linux/slab.h>
#include <linux/fs.h>
@@ -409,7 +409,7 @@ static long audio_cal_shared_ioctl(struct file *file, unsigned int cmd,
		goto done;
	}

	if (copy_from_user(&size, (void *)arg, sizeof(size))) {
	if (copy_from_user(&size, arg, sizeof(size))) {
		pr_err("%s: Could not copy size value from user\n", __func__);
		ret = -EFAULT;
		goto done;
@@ -426,7 +426,7 @@ static long audio_cal_shared_ioctl(struct file *file, unsigned int cmd,
	if (data == NULL) {
		ret = -ENOMEM;
		goto done;
	} else if (copy_from_user(data, (void *)arg, size)) {
	} else if (copy_from_user(data, arg, size)) {
		pr_err("%s: Could not copy data from user\n",
			__func__);
		ret = -EFAULT;
@@ -579,7 +579,7 @@ static const struct file_operations audio_cal_fops = {
#endif
};

struct miscdevice audio_cal_misc = {
static struct miscdevice audio_cal_misc = {
	.minor	= MISC_DYNAMIC_MINOR,
	.name	= "msm_audio_cal",
	.fops	= &audio_cal_fops,
+18 −4
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@
#endif

#define SESSION_TYPE_RX 0
#define COPP_VOL_DEFAULT 0x2000

/* ENUM for adm_status */
enum adm_cal_status {
@@ -111,6 +112,7 @@ struct adm_ctl {
	int tx_port_id;
	bool hyp_assigned;
	int fnn_app_type;
	bool is_channel_swapped;
};

static struct adm_ctl			this_adm;
@@ -288,7 +290,7 @@ static int adm_get_copp_id(int port_idx, int copp_idx)
}

static int adm_get_idx_if_single_copp_exists(int port_idx,
			int topology, int mode,
			int topology,
			int rate, int bit_width,
			uint32_t copp_token)
{
@@ -299,8 +301,6 @@ static int adm_get_idx_if_single_copp_exists(int port_idx,
	for (idx = 0; idx < MAX_COPPS_PER_PORT; idx++)
		if ((topology ==
			atomic_read(&this_adm.copp.topology[port_idx][idx])) &&
			(mode ==
			 atomic_read(&this_adm.copp.mode[port_idx][idx])) &&
			(rate ==
			 atomic_read(&this_adm.copp.rate[port_idx][idx])) &&
			(bit_width ==
@@ -322,7 +322,7 @@ static int adm_get_idx_if_copp_exists(int port_idx, int topology, int mode,

	if (copp_token)
		return adm_get_idx_if_single_copp_exists(port_idx,
				topology, mode,
				topology,
				rate, bit_width,
				copp_token);

@@ -5476,6 +5476,13 @@ int adm_swap_speaker_channels(int port_id, int copp_idx,
			(uint16_t) PCM_CHANNEL_FR;
	}

	if(spk_swap || this_adm.is_channel_swapped) {
		/* Before applying swap channel, mute the device to avoid pop */
		ret = adm_set_volume(port_id, copp_idx, 0);
		/* Add delay after mute as per hw requirement */
		msleep(50);
	}

	ret = adm_pack_and_set_one_pp_param(port_id, copp_idx, param_hdr,
					    (u8 *) &mfc_cfg);
	if (ret < 0) {
@@ -5484,6 +5491,12 @@ int adm_swap_speaker_channels(int port_id, int copp_idx,
		return ret;
	}

	if(spk_swap || this_adm.is_channel_swapped) {
		/* After applying swap channel, reset to default */
		ret = adm_set_volume(port_id, copp_idx, COPP_VOL_DEFAULT);
	}
	this_adm.is_channel_swapped = spk_swap;

	pr_debug("%s: mfc_cfg Set params returned success", __func__);
	return 0;
}
@@ -5865,6 +5878,7 @@ int __init adm_init(void)
	this_adm.tx_port_id = -1;
	this_adm.hyp_assigned = false;
	this_adm.fnn_app_type = -1;
	this_adm.is_channel_swapped = false;
	init_waitqueue_head(&this_adm.matrix_map_wait);
	init_waitqueue_head(&this_adm.adm_wait);
	mutex_init(&this_adm.adm_apr_lock);
+3 −1
Original line number Diff line number Diff line
@@ -443,9 +443,11 @@ static int q6afe_load_avcs_modules(int num_modules, u16 port_id,
						AVS_MODULE_ID_DEPACKETIZER_COP;
					goto load_unload;
				}
				if (format_id == ASM_MEDIA_FMT_LC3) {
				if (format_id == ASM_MEDIA_FMT_LC3 ||
				    format_id == ASM_MEDIA_FMT_APTX_ADAPTIVE) {
					pm[i]->payload->load_unload_info[0].id1 =
					AVS_MODULE_ID_DEPACKETIZER_COP_V2;
					goto load_unload;
				}

				pm[i]->payload->load_unload_info[1].module_type =
Loading