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

Commit b0e13cce authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: qdsp6v2: send afe calibration in acdb id mismatch cases"

parents a42c0634 2bbbac2c
Loading
Loading
Loading
Loading
+25 −7
Original line number Diff line number Diff line
@@ -1303,15 +1303,24 @@ static struct cal_block_data *afe_find_cal_topo_id_by_port(
			MSM_AFE_PORT_TYPE_TX)?(TX_DEVICE):(RX_DEVICE));
		afe_top =
		(struct audio_cal_info_afe_top *)cal_block->cal_info;
		if ((afe_top->path == path) &&
		    (afe_top->acdb_id ==
		     this_afe.dev_acdb_id[afe_port_index])) {
		if (afe_top->path == path) {
			if (this_afe.dev_acdb_id[afe_port_index] > 0) {
				if (afe_top->acdb_id ==
				    this_afe.dev_acdb_id[afe_port_index]) {
					pr_debug("%s: top_id:%x acdb_id:%d afe_port_id:%d\n",
						 __func__, afe_top->topology,
						 afe_top->acdb_id,
						 q6audio_get_port_id(port_id));
					return cal_block;
				}
			} else {
				pr_debug("%s: top_id:%x acdb_id:%d afe_port:%d\n",
				 __func__, afe_top->topology, afe_top->acdb_id,
				 q6audio_get_port_id(port_id));
				return cal_block;
			}
		}
	}

err_exit:
	return NULL;
@@ -1497,6 +1506,8 @@ static void send_afe_cal_type(int cal_index, int port_id)
{
	struct cal_block_data		*cal_block = NULL;
	int ret;
	int afe_port_index = q6audio_get_port_index(port_id);

	pr_debug("%s:\n", __func__);

	if (this_afe.cal_data[cal_index] == NULL) {
@@ -1505,10 +1516,17 @@ static void send_afe_cal_type(int cal_index, int port_id)
		goto done;
	}

	if (afe_port_index < 0) {
		pr_err("%s: Error getting AFE port index %d\n",
			__func__, afe_port_index);
		goto done;
	}

	mutex_lock(&this_afe.cal_data[cal_index]->lock);

	if ((cal_index == AFE_COMMON_RX_CAL) ||
	    (cal_index == AFE_COMMON_TX_CAL))
	if (((cal_index == AFE_COMMON_RX_CAL) ||
	     (cal_index == AFE_COMMON_TX_CAL)) &&
	    (this_afe.dev_acdb_id[afe_port_index] > 0))
		cal_block = afe_find_cal(cal_index, port_id);
	else
		cal_block = cal_utils_get_only_cal_block(