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

Commit b0a827be authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dsp: Reslove audiodlkm code warning"

parents 65bd6329 25c2fa7e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -622,7 +622,9 @@ void audio_cal_exit(void)
			kfree(client_info_node);
			client_info_node = NULL;
		}
		mutex_destroy(&audio_cal.cal_mutex[i]);
	}
	mutex_destroy(&audio_cal.common_lock);
	misc_deregister(&audio_cal_misc);
}

+6 −5
Original line number Diff line number Diff line
@@ -4312,7 +4312,6 @@ EXPORT_SYMBOL(adm_close);
int send_rtac_audvol_cal(void)
{
	int ret = 0;
	int ret2 = 0;
	int i = 0;
	int copp_idx, port_idx, acdb_id, app_id, path;
	struct cal_block_data *cal_block = NULL;
@@ -4358,7 +4357,7 @@ int send_rtac_audvol_cal(void)
				continue;
			}

			ret2 = adm_remap_and_send_cal_block(ADM_RTAC_AUDVOL_CAL,
			ret = adm_remap_and_send_cal_block(ADM_RTAC_AUDVOL_CAL,
				rtac_adm_data.device[i].afe_port,
				copp_idx, cal_block,
				atomic_read(&this_adm.copp.
@@ -4367,13 +4366,12 @@ int send_rtac_audvol_cal(void)
				audvol_cal_info->acdb_id,
				atomic_read(&this_adm.copp.
				rate[port_idx][copp_idx]));
			if (ret2 < 0) {
			if (ret < 0) {
				pr_debug("%s: remap and send failed for copp Id %d, acdb id %d, app type %d, path %d\n",
					__func__, rtac_adm_data.device[i].copp,
					audvol_cal_info->acdb_id,
					audvol_cal_info->app_type,
					audvol_cal_info->path);
				ret = ret2;
			}
		}
	}
@@ -5215,6 +5213,7 @@ int adm_wait_timeout(int port_id, int copp_idx, int wait_time)
	pr_debug("%s: return %d\n", __func__, ret);
	if (ret != 0)
		ret = -EINTR;

end:
	pr_debug("%s: return %d--\n", __func__, ret);
	return ret;
@@ -5275,8 +5274,10 @@ int adm_store_cal_data(int port_id, int copp_idx, int path, int perf_mode,
	mutex_lock(&this_adm.cal_data[cal_index]->lock);
	cal_block = adm_find_cal(cal_index, get_cal_path(path), app_type,
				acdb_id, sample_rate);
	if (cal_block == NULL)
	if (cal_block == NULL) {
		pr_err("%s: can't find cal block!\n", __func__);
		goto unlock;
	}

	if (cal_block->cal_data.size <= 0) {
		pr_debug("%s: No ADM cal send for port_id = 0x%x!\n",
+49 −9
Original line number Diff line number Diff line
@@ -3460,6 +3460,11 @@ int afe_send_port_vad_cfg_params(u16 port_id)
		return 0;
	}

	ret = afe_validate_port(port_id);
	if (ret < 0) {
		pr_err("%s: Not a valid port id = 0x%x ret %d\n", __func__,
		       port_id, ret);
	}
	port_index = afe_get_port_index(port_id);

	if (this_afe.vad_cfg[port_index].is_enable) {
@@ -4686,10 +4691,17 @@ EXPORT_SYMBOL(afe_tdm_port_start);
void afe_set_cal_mode(u16 port_id, enum afe_cal_mode afe_cal_mode)
{
	uint16_t port_index;
	int ret = 0;

	ret = afe_validate_port(port_id);
	if (ret < 0) {
		pr_err("%s: Not a valid port id = 0x%x ret %d\n", __func__,
		       port_id, ret);
	} else {
		port_index = afe_get_port_index(port_id);
		this_afe.afe_cal_mode[port_index] = afe_cal_mode;
	}
}
EXPORT_SYMBOL(afe_set_cal_mode);

/**
@@ -4723,12 +4735,19 @@ EXPORT_SYMBOL(afe_set_vad_cfg);
void afe_get_island_mode_cfg(u16 port_id, u32 *enable_flag)
{
	uint16_t port_index;
	int ret = 0;

	ret = afe_validate_port(port_id);
	if (ret < 0) {
		pr_err("%s: Not a valid port id = 0x%x ret %d\n", __func__,
		       port_id, ret);
	} else {
		if (enable_flag) {
			port_index = afe_get_port_index(port_id);
			*enable_flag = this_afe.island_mode[port_index];
		}
	}
}
EXPORT_SYMBOL(afe_get_island_mode_cfg);

/**
@@ -4742,13 +4761,20 @@ EXPORT_SYMBOL(afe_get_island_mode_cfg);
void afe_set_island_mode_cfg(u16 port_id, u32 enable_flag)
{
	uint16_t port_index;
	int ret = 0;

	ret = afe_validate_port(port_id);
	if (ret < 0) {
		pr_err("%s: Not a valid port id = 0x%x ret %d\n", __func__,
		       port_id, ret);
	} else {
		port_index = afe_get_port_index(port_id);
		this_afe.island_mode[port_index] = enable_flag;

		trace_printk("%s: set island mode cfg 0x%x for port 0x%x\n",
				__func__, this_afe.island_mode[port_index], port_id);
	}
}
EXPORT_SYMBOL(afe_set_island_mode_cfg);

/**
@@ -8031,6 +8057,8 @@ int afe_register_get_events(u16 port_id,

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

	memset(&rtproxy, 0, sizeof(rtproxy));

	if (this_afe.apr == NULL) {
		this_afe.apr = apr_register("ADSP", "AFE", afe_callback,
					0xFFFFFFFF, &this_afe);
@@ -8094,6 +8122,8 @@ int afe_unregister_get_events(u16 port_id)

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

	memset(&rtproxy, 0, sizeof(rtproxy));

	if (this_afe.apr == NULL) {
		this_afe.apr = apr_register("ADSP", "AFE", afe_callback,
					0xFFFFFFFF, &this_afe);
@@ -8178,6 +8208,8 @@ int afe_rt_proxy_port_write(phys_addr_t buf_addr_p,
	int ret = 0;
	struct afe_port_data_cmd_rt_proxy_port_write_v2 afecmd_wr;

	memset(&afecmd_wr, 0, sizeof(afecmd_wr));

	if (this_afe.apr == NULL) {
		pr_err("%s: register to AFE is not done\n", __func__);
		ret = -ENODEV;
@@ -8237,6 +8269,8 @@ int afe_rt_proxy_port_read(phys_addr_t buf_addr_p,
	struct afe_port_data_cmd_rt_proxy_port_read_v2 afecmd_rd;
	int port_id = VIRTUAL_ID_TO_PORTID(id);

	memset(&afecmd_rd, 0, sizeof(afecmd_rd));

	if (this_afe.apr == NULL) {
		pr_err("%s: register to AFE is not done\n", __func__);
		ret = -ENODEV;
@@ -8477,6 +8511,8 @@ int afe_dtmf_generate_rx(int64_t duration_in_ms,

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

	memset(&cmd_dtmf, 0, sizeof(cmd_dtmf));

	if (afe_validate_port(this_afe.dtmf_gen_rx_portid) < 0) {
		pr_err("%s: Failed : Invalid Port id = 0x%x\n",
		       __func__, this_afe.dtmf_gen_rx_portid);
@@ -9223,6 +9259,8 @@ int afe_port_stop_nowait(int port_id)
	struct afe_port_cmd_device_stop stop;
	int ret = 0;

	memset(&stop, 0, sizeof(stop));

	if (this_afe.apr == NULL) {
		pr_err("%s: AFE is already closed\n", __func__);
		ret = -EINVAL;
@@ -9266,6 +9304,8 @@ int afe_close(int port_id)
	int index = 0;
	uint16_t port_index;

	memset(&stop, 0, sizeof(stop));

	if (this_afe.apr == NULL) {
		pr_err("%s: AFE is already closed\n", __func__);

+8 −0
Original line number Diff line number Diff line
@@ -11691,5 +11691,13 @@ int __init q6asm_init(void)

void q6asm_exit(void)
{
	int lcnt;
	q6asm_delete_cal_data();
	for (lcnt = 0; lcnt <= OUT; lcnt++)
		mutex_destroy(&common_client.port[lcnt].lock);

	mutex_destroy(&common_client.cmd_lock);

	for (lcnt = 0; lcnt <= ASM_ACTIVE_STREAMS_ALLOWED; lcnt++)
		mutex_destroy(&(session[lcnt].mutex_lock_per_session));
}
+4 −0
Original line number Diff line number Diff line
@@ -3100,8 +3100,12 @@ int __init q6lsm_init(void)

void q6lsm_exit(void)
{
	int i = 0;
	lsm_delete_cal_data();

	for (; i <= LSM_MAX_SESSION_ID; i++)
		mutex_destroy(&lsm_common.common_client[i].cmd_lock);
	mutex_destroy(&lsm_common.apr_lock);
#ifdef CONFIG_DEBUG_FS
	debugfs_remove_recursive(lsm_common.entry);
	lsm_common.entry = NULL;
Loading