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

Commit deec79da authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dsp: q6adm: Resolve pop noise heard during playback when screen rotated"

parents 169b8b1e e66ba137
Loading
Loading
Loading
Loading
+16 −0
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;
@@ -5474,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) {
@@ -5482,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;
}
@@ -5863,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);