ASoC: msm: qdsp6v2: allow zero size calibration for LSM

It is possible that LSM (Listen Stream Manager) could have an usecase
that does not need any audio calibration. In such cases, currently
the driver returns an error and does not allow the usecase setup with
LSM causing the usecase to fail. Fix this by allowing zero size audio
calibration for LSM.

CRs-fixed: 2031503
Change-Id: I42d89792a4fd6a0d6e1908a36720680b63ff0c30
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
This commit is contained in:
Bhalchandra Gajare
2017-04-17 15:27:55 -07:00
committed by Gerrit - the friendly Code Review server
parent b93c90d637
commit 53e904e27f

View File

@@ -1243,14 +1243,12 @@ static int q6lsm_send_cal(struct lsm_client *client,
mutex_lock(&lsm_common.cal_data[LSM_CAL_IDX]->lock);
cal_block = cal_utils_get_only_cal_block(
lsm_common.cal_data[LSM_CAL_IDX]);
if (cal_block == NULL)
goto unlock;
if (cal_block->cal_data.size <= 0) {
if (!cal_block || cal_block->cal_data.size <= 0) {
pr_debug("%s: No cal to send!\n", __func__);
rc = -EINVAL;
goto unlock;
}
if (cal_block->cal_data.size != client->lsm_cal_size) {
pr_err("%s: Cal size %zd doesn't match lsm cal size %d\n",
__func__, cal_block->cal_data.size,