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

Commit f8012888 authored by Lakshman Chaluvaraju's avatar Lakshman Chaluvaraju Committed by ssizon
Browse files

Revert "rtac: Add mutex protection for rtac cal apis"

This reverts commit 9590bd0b.
parent 2e869e75
Loading
Loading
Loading
Loading
+1 −29
Original line number Diff line number Diff line
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, 2020 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
@@ -126,10 +126,6 @@ struct mutex rtac_asm_apr_mutex;
struct mutex			rtac_voice_mutex;
struct mutex			rtac_voice_apr_mutex;
struct mutex			rtac_afe_apr_mutex;
struct mutex			rtac_asm_cal_mutex;
struct mutex			rtac_adm_cal_mutex;
struct mutex			rtac_afe_cal_mutex;
struct mutex			rtac_voice_cal_mutex;

int rtac_clear_mapping(uint32_t cal_type)
{
@@ -1734,62 +1730,42 @@ static long rtac_ioctl_shared(struct file *f,
	}

	case AUDIO_GET_RTAC_ADM_CAL:
		mutex_lock(&rtac_adm_cal_mutex);
		result = send_adm_apr((void *)arg, ADM_CMD_GET_PP_PARAMS_V5);
		mutex_unlock(&rtac_adm_cal_mutex);
		break;
	case AUDIO_SET_RTAC_ADM_CAL:
		mutex_lock(&rtac_adm_cal_mutex);
		result = send_adm_apr((void *)arg, ADM_CMD_SET_PP_PARAMS_V5);
		mutex_unlock(&rtac_adm_cal_mutex);
		break;
	case AUDIO_GET_RTAC_ASM_CAL:
		mutex_lock(&rtac_asm_cal_mutex);
		result = send_rtac_asm_apr((void *)arg,
			ASM_STREAM_CMD_GET_PP_PARAMS_V2);
		mutex_unlock(&rtac_asm_cal_mutex);
		break;
	case AUDIO_SET_RTAC_ASM_CAL:
		mutex_lock(&rtac_asm_cal_mutex);
		result = send_rtac_asm_apr((void *)arg,
			ASM_STREAM_CMD_SET_PP_PARAMS_V2);
		mutex_unlock(&rtac_asm_cal_mutex);
		break;
	case AUDIO_GET_RTAC_CVS_CAL:
		mutex_lock(&rtac_voice_cal_mutex);
		result = send_voice_apr(RTAC_CVS, (void *) arg,
					VSS_ICOMMON_CMD_GET_PARAM_V2);
		mutex_unlock(&rtac_voice_cal_mutex);
		break;
	case AUDIO_SET_RTAC_CVS_CAL:
		mutex_lock(&rtac_voice_cal_mutex);
		result = send_voice_apr(RTAC_CVS, (void *) arg,
					VSS_ICOMMON_CMD_SET_PARAM_V2);
		mutex_unlock(&rtac_voice_cal_mutex);
		break;
	case AUDIO_GET_RTAC_CVP_CAL:
		mutex_lock(&rtac_voice_cal_mutex);
		result = send_voice_apr(RTAC_CVP, (void *) arg,
					VSS_ICOMMON_CMD_GET_PARAM_V2);
		mutex_unlock(&rtac_voice_cal_mutex);
		break;
	case AUDIO_SET_RTAC_CVP_CAL:
		mutex_lock(&rtac_voice_cal_mutex);
		result = send_voice_apr(RTAC_CVP, (void *) arg,
					VSS_ICOMMON_CMD_SET_PARAM_V2);
		mutex_unlock(&rtac_voice_cal_mutex);
		break;
	case AUDIO_GET_RTAC_AFE_CAL:
		mutex_lock(&rtac_afe_cal_mutex);
		result = send_rtac_afe_apr((void *)arg,
			AFE_PORT_CMD_GET_PARAM_V2);
		mutex_unlock(&rtac_afe_cal_mutex);
		break;
	case AUDIO_SET_RTAC_AFE_CAL:
		mutex_lock(&rtac_afe_cal_mutex);
		result = send_rtac_afe_apr((void *)arg,
			AFE_PORT_CMD_SET_PARAM_V2);
		mutex_unlock(&rtac_afe_cal_mutex);
		break;
	default:
		pr_err("%s: Invalid IOCTL, command = %d!\n",
@@ -1926,7 +1902,6 @@ int __init rtac_init(void)
	init_waitqueue_head(&rtac_adm_apr_data.cmd_wait);
	mutex_init(&rtac_adm_mutex);
	mutex_init(&rtac_adm_apr_mutex);
	mutex_init(&rtac_adm_cal_mutex);

	rtac_adm_buffer = kzalloc(
		rtac_cal[ADM_RTAC_CAL].map_data.map_size, GFP_KERNEL);
@@ -1940,7 +1915,6 @@ int __init rtac_init(void)
		init_waitqueue_head(&rtac_asm_apr_data[i].cmd_wait);
	}
	mutex_init(&rtac_asm_apr_mutex);
	mutex_init(&rtac_asm_cal_mutex);

	rtac_asm_buffer = kzalloc(
		rtac_cal[ASM_RTAC_CAL].map_data.map_size, GFP_KERNEL);
@@ -1954,7 +1928,6 @@ int __init rtac_init(void)
	atomic_set(&rtac_afe_apr_data.cmd_state, 0);
	init_waitqueue_head(&rtac_afe_apr_data.cmd_wait);
	mutex_init(&rtac_afe_apr_mutex);
	mutex_init(&rtac_afe_cal_mutex);

	rtac_afe_buffer = kzalloc(
		rtac_cal[AFE_RTAC_CAL].map_data.map_size, GFP_KERNEL);
@@ -1973,7 +1946,6 @@ int __init rtac_init(void)
	}
	mutex_init(&rtac_voice_mutex);
	mutex_init(&rtac_voice_apr_mutex);
	mutex_init(&rtac_voice_cal_mutex);

	rtac_voice_buffer = kzalloc(
		rtac_cal[VOICE_RTAC_CAL].map_data.map_size, GFP_KERNEL);