Skip to content

Commit f7d3d2d

Browse files
Brainikbroonie
authored andcommitted
ASoC: tas571x: add input channel mixer for TAS5717/19
Add channel 1 and 2 input mixer registers and the related ALSA mixer controls for TAS5717/19 chips. The mixer control coefficients on the chip are linear in the range -3.99999 to +3.99999, encoded in 3.23 number format. In this patch the mixer controls are limited to 128 values from 0.0 to 1.0 in 1/64 steps. Signed-off-by: Petr Kulhavy <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 4b9e385 commit f7d3d2d

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

sound/soc/codecs/tas571x.c

+18
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ static int tas571x_register_size(struct tas571x_private *priv, unsigned int reg)
6464
case TAS571X_INPUT_MUX_REG:
6565
case TAS571X_CH4_SRC_SELECT_REG:
6666
case TAS571X_PWM_MUX_REG:
67+
case TAS5717_CH1_RIGHT_CH_MIX_REG:
68+
case TAS5717_CH1_LEFT_CH_MIX_REG:
69+
case TAS5717_CH2_LEFT_CH_MIX_REG:
70+
case TAS5717_CH2_RIGHT_CH_MIX_REG:
6771
return 4;
6872
default:
6973
return 1;
@@ -397,6 +401,16 @@ static const struct snd_kcontrol_new tas5711_controls[] = {
397401
TAS571X_SOFT_MUTE_REG,
398402
TAS571X_SOFT_MUTE_CH1_SHIFT, TAS571X_SOFT_MUTE_CH2_SHIFT,
399403
1, 1),
404+
405+
SOC_DOUBLE_R_RANGE("CH1 Mixer Volume",
406+
TAS5717_CH1_LEFT_CH_MIX_REG,
407+
TAS5717_CH1_RIGHT_CH_MIX_REG,
408+
16, 0, 0x80, 0),
409+
410+
SOC_DOUBLE_R_RANGE("CH2 Mixer Volume",
411+
TAS5717_CH2_LEFT_CH_MIX_REG,
412+
TAS5717_CH2_RIGHT_CH_MIX_REG,
413+
16, 0, 0x80, 0),
400414
};
401415

402416
static const struct regmap_range tas571x_readonly_regs_range[] = {
@@ -520,6 +534,10 @@ static const struct reg_default tas5717_reg_defaults[] = {
520534
{ 0x08, 0x00c0 },
521535
{ 0x09, 0x00c0 },
522536
{ 0x1b, 0x82 },
537+
{ TAS5717_CH1_RIGHT_CH_MIX_REG, 0x0 },
538+
{ TAS5717_CH1_LEFT_CH_MIX_REG, 0x800000},
539+
{ TAS5717_CH2_LEFT_CH_MIX_REG, 0x0 },
540+
{ TAS5717_CH2_RIGHT_CH_MIX_REG, 0x800000},
523541
};
524542

525543
static const struct regmap_config tas5717_regmap_config = {

sound/soc/codecs/tas571x.h

+5
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,9 @@
8787
#define TAS5717_CH3_BQ0_REG 0x5e
8888
#define TAS5717_CH3_BQ1_REG 0x5f
8989

90+
#define TAS5717_CH1_RIGHT_CH_MIX_REG 0x72
91+
#define TAS5717_CH1_LEFT_CH_MIX_REG 0x73
92+
#define TAS5717_CH2_LEFT_CH_MIX_REG 0x76
93+
#define TAS5717_CH2_RIGHT_CH_MIX_REG 0x77
94+
9095
#endif /* _TAS571X_H */

0 commit comments

Comments
 (0)