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

Commit 26a6208c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dsp: fix MFC config param payload alignment issue"

parents 15a87dad e061e09c
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
/*  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
@@ -4120,6 +4120,7 @@ static int voice_send_cvp_mfc_config_v2(struct voice_data *v)
	struct cvp_set_mfc_config_cmd_v2 cvp_set_mfc_config_cmd;
	void *apr_cvp;
	u16 cvp_handle;
	uint8_t ch_idx;
	struct vss_icommon_param_data_mfc_config_v2_t *cvp_config_param_data =
		&cvp_set_mfc_config_cmd.cvp_set_mfc_param_v2.param_data;
	struct vss_param_mfc_config_info_t *mfc_config_info =
@@ -4168,9 +4169,15 @@ static int voice_send_cvp_mfc_config_v2(struct voice_data *v)
	mfc_config_info->num_channels = v->dev_rx.no_of_channels;
	mfc_config_info->bits_per_sample = 16;
	mfc_config_info->sample_rate = v->dev_rx.sample_rate;
	memcpy(&mfc_config_info->channel_type,
	       v->dev_rx.channel_mapping,
	       VSS_NUM_CHANNELS_MAX * sizeof(uint8_t));

	/*
	 * Do not use memcpy here as channel_type in mfc_config structure is a
	 * uint16_t array while channel_mapping array of device is of uint8_t
	 */
	for (ch_idx = 0; ch_idx < VSS_NUM_CHANNELS_MAX; ch_idx++) {
		mfc_config_info->channel_type[ch_idx] =
					v->dev_rx.channel_mapping[ch_idx];
	}

	v->cvp_state = CMD_STATUS_FAIL;
	v->async_err = 0;