From 5106b5627c098e0631645a9ef44e8498a63bd0b2 Mon Sep 17 00:00:00 2001 From: Aditya Bavanari Date: Mon, 8 Jan 2018 13:16:32 +0530 Subject: [PATCH] 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 --- asoc/msm-pcm-routing-v2.c | 1 - dsp/q6adm.c | 24 ++++++------------------ include/dsp/q6adm-v2.h | 3 +-- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/asoc/msm-pcm-routing-v2.c b/asoc/msm-pcm-routing-v2.c index 1ff7c41222df..c0bc05736298 100644 --- a/asoc/msm-pcm-routing-v2.c +++ b/asoc/msm-pcm-routing-v2.c @@ -2572,7 +2572,6 @@ static int msm_routing_lsm_func_put(struct snd_kcontrol *kcontrol, 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 514af254db99..d5dc960de4a0 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 @@ struct adm_ctl { 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 @@ static int get_cal_path(int path) 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 @@ int adm_matrix_map(int path, struct route_payload payload_map, int perf_mode, 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 19a844c316e3..881943b464c3 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 adm_programable_channel_mixer(int port_id, int copp_idx, int session_id, 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__ */