Skip to content

Commit 70a65e2

Browse files
chleroygregkh
authored andcommitted
ASoC: codecs: Fix gain setting ranges for Renesas IDT821034 codec
[ Upstream commit 6370a99 ] The gain ranges specified in Renesas IDT821034 codec documentation are [-3dB;+13dB] in the transmit path (ADC) and [-13dB;+3dB] in the receive path (DAC). Allthough the registers allow programming values outside those ranges, the signal S/N and distorsion are only guaranteed in the specified ranges. Set ranges to the specified ones. Fixes: e511669 ("ASoC: codecs: Add support for the Renesas IDT821034 codec") Signed-off-by: Christophe Leroy <[email protected]> Link: https://patch.msgid.link/2bd547194f3398e6182f770d7d6be711c702b4b2.1760029099.git.christophe.leroy@csgroup.eu Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent e2a7c66 commit 70a65e2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sound/soc/codecs/idt821034.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -548,14 +548,14 @@ static int idt821034_kctrl_mute_put(struct snd_kcontrol *kcontrol,
548548
return ret;
549549
}
550550

551-
static const DECLARE_TLV_DB_LINEAR(idt821034_gain_in, -6520, 1306);
552-
#define IDT821034_GAIN_IN_MIN_RAW 1 /* -65.20 dB -> 10^(-65.2/20.0) * 1820 = 1 */
553-
#define IDT821034_GAIN_IN_MAX_RAW 8191 /* 13.06 dB -> 10^(13.06/20.0) * 1820 = 8191 */
551+
static const DECLARE_TLV_DB_LINEAR(idt821034_gain_in, -300, 1300);
552+
#define IDT821034_GAIN_IN_MIN_RAW 1288 /* -3.0 dB -> 10^(-3.0/20.0) * 1820 = 1288 */
553+
#define IDT821034_GAIN_IN_MAX_RAW 8130 /* 13.0 dB -> 10^(13.0/20.0) * 1820 = 8130 */
554554
#define IDT821034_GAIN_IN_INIT_RAW 1820 /* 0dB -> 10^(0/20) * 1820 = 1820 */
555555

556-
static const DECLARE_TLV_DB_LINEAR(idt821034_gain_out, -6798, 1029);
557-
#define IDT821034_GAIN_OUT_MIN_RAW 1 /* -67.98 dB -> 10^(-67.98/20.0) * 2506 = 1*/
558-
#define IDT821034_GAIN_OUT_MAX_RAW 8191 /* 10.29 dB -> 10^(10.29/20.0) * 2506 = 8191 */
556+
static const DECLARE_TLV_DB_LINEAR(idt821034_gain_out, -1300, 300);
557+
#define IDT821034_GAIN_OUT_MIN_RAW 561 /* -13.0 dB -> 10^(-13.0/20.0) * 2506 = 561 */
558+
#define IDT821034_GAIN_OUT_MAX_RAW 3540 /* 3.0 dB -> 10^(3.0/20.0) * 2506 = 3540 */
559559
#define IDT821034_GAIN_OUT_INIT_RAW 2506 /* 0dB -> 10^(0/20) * 2506 = 2506 */
560560

561561
static const struct snd_kcontrol_new idt821034_controls[] = {

0 commit comments

Comments
 (0)