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

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

Merge "ASoC: msm8x16-wcd: Set analog gain mode to manual if compander is off"

parents 8e3faba1 9185bf01
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2017, 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
@@ -3890,12 +3890,22 @@ static int msm8x16_wcd_codec_config_compander(struct snd_soc_codec *codec,
		msm8x16_wcd->comp_enabled[interp_n]);

	/* compander is not enabled */
	if (!msm8x16_wcd->comp_enabled[interp_n])
	if (!msm8x16_wcd->comp_enabled[interp_n]) {
		if (interp_n < MSM8X16_WCD_RX3)
			if (get_codec_version(msm8x16_wcd) >= DIANGU)
				snd_soc_update_bits(codec,
					MSM8X16_WCD_A_ANALOG_RX_COM_BIAS_DAC,
					0x08, 0x00);
		return 0;
	}

	switch (msm8x16_wcd->comp_enabled[interp_n]) {
	case COMPANDER_1:
		if (SND_SOC_DAPM_EVENT_ON(event)) {
			if (get_codec_version(msm8x16_wcd) >= DIANGU)
				snd_soc_update_bits(codec,
					MSM8X16_WCD_A_ANALOG_RX_COM_BIAS_DAC,
					0x08, 0x08);
			/* Enable Compander Clock */
			snd_soc_update_bits(codec,
				MSM8X16_WCD_A_CDC_COMP0_B2_CTL, 0x0F, 0x09);