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

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

Merge "ASoC: msm: Extend mixer cmd for device channel map"

parents f80cc53f 659779c6
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -652,11 +652,11 @@ static int msm_qti_pp_set_sec_auxpcm_lb_vol_mixer(
static int msm_qti_pp_get_channel_map_mixer(struct snd_kcontrol *kcontrol,
					    struct snd_ctl_elem_value *ucontrol)
{
	char channel_map[PCM_FORMAT_MAX_NUM_CHANNEL] = {0};
	char channel_map[PCM_FORMAT_MAX_NUM_CHANNEL_V2] = {0};
	int i;

	adm_get_multi_ch_map(channel_map, ADM_PATH_PLAYBACK);
	for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL; i++)
	for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL_V2; i++)
		ucontrol->value.integer.value[i] = (unsigned) channel_map[i];
	return 0;
}
@@ -664,10 +664,10 @@ static int msm_qti_pp_get_channel_map_mixer(struct snd_kcontrol *kcontrol,
static int msm_qti_pp_put_channel_map_mixer(struct snd_kcontrol *kcontrol,
					    struct snd_ctl_elem_value *ucontrol)
{
	char channel_map[PCM_FORMAT_MAX_NUM_CHANNEL];
	char channel_map[PCM_FORMAT_MAX_NUM_CHANNEL_V2] = {0};
	int i;

	for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL; i++)
	for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL_V2; i++)
		channel_map[i] = (char)(ucontrol->value.integer.value[i]);
	adm_set_multi_ch_map(channel_map, ADM_PATH_PLAYBACK);

@@ -1256,8 +1256,9 @@ static const struct snd_kcontrol_new sec_auxpcm_lb_vol_mixer_controls[] = {
};

static const struct snd_kcontrol_new multi_ch_channel_map_mixer_controls[] = {
	SOC_SINGLE_MULTI_EXT("Playback Device Channel Map", SND_SOC_NOPM, 0, 16,
	0, 8, msm_qti_pp_get_channel_map_mixer,
	SOC_SINGLE_MULTI_EXT("Playback Device Channel Map",
	SND_SOC_NOPM, 0, 255,
	0, 32, msm_qti_pp_get_channel_map_mixer,
	msm_qti_pp_put_channel_map_mixer),
};

+5 −5
Original line number Diff line number Diff line
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2019, 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
@@ -110,7 +110,7 @@ static struct adm_ctl this_adm;

struct adm_multi_ch_map {
	bool set_channel_map;
	char channel_mapping[PCM_FORMAT_MAX_NUM_CHANNEL];
	char channel_mapping[PCM_FORMAT_MAX_NUM_CHANNEL_V2];
};

#define ADM_MCH_MAP_IDX_PLAYBACK 0
@@ -1186,7 +1186,7 @@ int adm_set_multi_ch_map(char *channel_map, int path)
	}

	memcpy(multi_ch_maps[idx].channel_mapping, channel_map,
		PCM_FORMAT_MAX_NUM_CHANNEL);
		PCM_FORMAT_MAX_NUM_CHANNEL_V2);
	multi_ch_maps[idx].set_channel_map = true;

	return 0;
@@ -1207,7 +1207,7 @@ int adm_get_multi_ch_map(char *channel_map, int path)

	if (multi_ch_maps[idx].set_channel_map) {
		memcpy(channel_map, multi_ch_maps[idx].channel_mapping,
		       PCM_FORMAT_MAX_NUM_CHANNEL);
		       PCM_FORMAT_MAX_NUM_CHANNEL_V2);
	}

	return 0;
@@ -2360,7 +2360,7 @@ static int adm_arrange_mch_map_v8(
			multi_ch_maps[idx].set_channel_map) {
		memcpy(ep_payload->dev_channel_mapping,
			multi_ch_maps[idx].channel_mapping,
			PCM_FORMAT_MAX_NUM_CHANNEL);
			PCM_FORMAT_MAX_NUM_CHANNEL_V2);
	} else {
		if (channel_mode == 1) {
			ep_payload->dev_channel_mapping[0] = PCM_CHANNEL_FC;