Skip to content

Commit

Permalink
ALSA: opti93x: use dB scale for mixer controls
Browse files Browse the repository at this point in the history
Add dB scale for mixer controls. Fix dB scale for
Master Volume control.

Signed-off-by: Krzysztof Helt <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
Krzysztof-H authored and tiwai committed Dec 12, 2009
1 parent b2e8d7d commit e9d0a80
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions sound/isa/opti9xx/opti92x-ad1848.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,32 +547,40 @@ static int __devinit snd_opti9xx_configure(struct snd_opti9xx *chip,

#ifdef OPTi93X

static const DECLARE_TLV_DB_SCALE(db_scale_6bit, -9450, 150, 0);
static const DECLARE_TLV_DB_SCALE(db_scale_5bit_3db_step, -9300, 300, 0);
static const DECLARE_TLV_DB_SCALE(db_scale_5bit, -4650, 150, 0);
static const DECLARE_TLV_DB_SCALE(db_scale_4bit_12db_max, -3300, 300, 0);

static struct snd_kcontrol_new snd_opti93x_controls[] = {
WSS_DOUBLE("Master Playback Switch", 0,
OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 7, 7, 1, 1),
WSS_DOUBLE_TLV("Master Playback Volume", 0,
OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 1, 1, 31, 1,
db_scale_6bit),
WSS_DOUBLE("PCM Playback Volume", 0,
CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 0, 0, 31, 1),
WSS_DOUBLE("FM Playback Volume", 0,
CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 1, 1, 15, 1),
db_scale_5bit_3db_step),
WSS_DOUBLE_TLV("PCM Playback Volume", 0,
CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 0, 0, 31, 1,
db_scale_5bit),
WSS_DOUBLE_TLV("FM Playback Volume", 0,
CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 1, 1, 15, 1,
db_scale_4bit_12db_max),
WSS_DOUBLE("Line Playback Switch", 0,
CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 7, 7, 1, 1),
WSS_DOUBLE("Line Playback Volume", 0,
CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 0, 0, 15, 1),
WSS_DOUBLE_TLV("Line Playback Volume", 0,
CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 0, 0, 15, 1,
db_scale_4bit_12db_max),
WSS_DOUBLE("Mic Playback Switch", 0,
OPTi93X_MIC_LEFT_INPUT, OPTi93X_MIC_RIGHT_INPUT, 7, 7, 1, 1),
WSS_DOUBLE("Mic Playback Volume", 0,
OPTi93X_MIC_LEFT_INPUT, OPTi93X_MIC_RIGHT_INPUT, 1, 1, 15, 1),
WSS_DOUBLE("CD Playback Volume", 0,
CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 1, 1, 15, 1),
WSS_DOUBLE_TLV("Mic Playback Volume", 0,
OPTi93X_MIC_LEFT_INPUT, OPTi93X_MIC_RIGHT_INPUT, 1, 1, 15, 1,
db_scale_4bit_12db_max),
WSS_DOUBLE_TLV("CD Playback Volume", 0,
CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 1, 1, 15, 1,
db_scale_4bit_12db_max),
WSS_DOUBLE("Aux Playback Switch", 0,
OPTi931_AUX_LEFT_INPUT, OPTi931_AUX_RIGHT_INPUT, 7, 7, 1, 1),
WSS_DOUBLE("Aux Playback Volume", 0,
OPTi931_AUX_LEFT_INPUT, OPTi931_AUX_RIGHT_INPUT, 1, 1, 15, 1),
WSS_DOUBLE_TLV("Aux Playback Volume", 0,
OPTi931_AUX_LEFT_INPUT, OPTi931_AUX_RIGHT_INPUT, 1, 1, 15, 1,
db_scale_4bit_12db_max),
};

static int __devinit snd_opti93x_mixer(struct snd_wss *chip)
Expand Down

0 comments on commit e9d0a80

Please sign in to comment.