dsp: fix low volume in audio recording

ADM calibration is not sent in audio recording
use case which leads to low volume issue.
Since the LSM port ID is same as audio recording
port ID in case of internal codec, driver tries to
send LSM calibration for non LSM use case in which case
no calibration will be sent.
Instead of using port ID, use the pass_thr mode to
differentiate between LSM and non LSM use cases.

CRs-Fixed: 2167317
Change-Id: I1b6ea51d83330f6439791cf1bb6170306f6895b0
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
diff --git a/asoc/msm-pcm-routing-v2.c b/asoc/msm-pcm-routing-v2.c
index 66a4a5a..341f6f2 100644
--- a/asoc/msm-pcm-routing-v2.c
+++ b/asoc/msm-pcm-routing-v2.c
@@ -2578,7 +2578,6 @@
 
 	pr_debug("%s: port_id 0x%x, mad_type %d\n", __func__, port_id,
 		 mad_type);
-	adm_set_lsm_port_id(port_id);
 	return afe_port_set_mad_type(port_id, mad_type);
 }
 
diff --git a/dsp/q6adm.c b/dsp/q6adm.c
index 514af25..d5dc960 100644
--- a/dsp/q6adm.c
+++ b/dsp/q6adm.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -104,7 +104,6 @@
 	int num_ec_ref_rx_chans;
 	int ec_ref_rx_bit_width;
 	int ec_ref_rx_sampling_rate;
-	int lsm_port_id;
 };
 
 static struct adm_ctl			this_adm;
@@ -2299,25 +2298,13 @@
 		return TX_DEVICE;
 }
 
-/*
- * Command to set LSM port ID
- * which is used to send LSM cal
- *
- * @port_id: Port ID number to be set
- *
- */
-void adm_set_lsm_port_id(int port_id)
-{
-	this_adm.lsm_port_id = port_id;
-}
-EXPORT_SYMBOL(adm_set_lsm_port_id);
-
 static void send_adm_cal(int port_id, int copp_idx, int path, int perf_mode,
-			 int app_type, int acdb_id, int sample_rate)
+			 int app_type, int acdb_id, int sample_rate,
+			 int passthr_mode)
 {
 	pr_debug("%s: port id 0x%x copp_idx %d\n", __func__, port_id, copp_idx);
 
-	if (port_id != this_adm.lsm_port_id)
+	if (passthr_mode != LISTEN)
 		send_adm_cal_type(ADM_AUDPROC_CAL, path, port_id, copp_idx,
 				perf_mode, app_type, acdb_id, sample_rate);
 	else
@@ -3083,7 +3070,8 @@
 				     get_cal_path(path), perf_mode,
 				     payload_map.app_type[i],
 				     payload_map.acdb_dev_id[i],
-				     payload_map.sample_rate[i]);
+				     payload_map.sample_rate[i],
+				     passthr_mode);
 			/* ADM COPP calibration is already sent */
 			clear_bit(ADM_STATUS_CALIBRATION_REQUIRED,
 				(void *)&this_adm.copp.
diff --git a/include/dsp/q6adm-v2.h b/include/dsp/q6adm-v2.h
index 19a844c..881943b 100644
--- a/include/dsp/q6adm-v2.h
+++ b/include/dsp/q6adm-v2.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -187,5 +187,4 @@
 			int channel_index);
 void msm_dts_srs_acquire_lock(void);
 void msm_dts_srs_release_lock(void);
-void adm_set_lsm_port_id(int port_id);
 #endif /* __Q6_ADM_V2_H__ */