aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ice1712/wtm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ice1712/wtm.c')
-rw-r--r--sound/pci/ice1712/wtm.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sound/pci/ice1712/wtm.c b/sound/pci/ice1712/wtm.c
index 59483b4d6dd0..c7ffafaa1c5c 100644
--- a/sound/pci/ice1712/wtm.c
+++ b/sound/pci/ice1712/wtm.c
@@ -29,6 +29,7 @@
29#include <linux/interrupt.h> 29#include <linux/interrupt.h>
30#include <linux/init.h> 30#include <linux/init.h>
31#include <sound/core.h> 31#include <sound/core.h>
32#include <sound/tlv.h>
32 33
33#include "ice1712.h" 34#include "ice1712.h"
34#include "envy24ht.h" 35#include "envy24ht.h"
@@ -380,17 +381,25 @@ static int stac9460_mic_sw_put(struct snd_kcontrol *kcontrol,
380 return change; 381 return change;
381} 382}
382 383
384
385/*Limits value in dB for fader*/
386static const DECLARE_TLV_DB_SCALE(db_scale_dac, -19125, 75, 0);
387static const DECLARE_TLV_DB_SCALE(db_scale_adc, 0, 150, 0);
388
383/* 389/*
384 * Control tabs 390 * Control tabs
385 */ 391 */
386static struct snd_kcontrol_new stac9640_controls[] = { 392static struct snd_kcontrol_new stac9640_controls[] = {
387 { 393 {
388 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 394 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
395 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
396 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
389 .name = "Master Playback Switch", 397 .name = "Master Playback Switch",
390 .info = stac9460_dac_mute_info, 398 .info = stac9460_dac_mute_info,
391 .get = stac9460_dac_mute_get, 399 .get = stac9460_dac_mute_get,
392 .put = stac9460_dac_mute_put, 400 .put = stac9460_dac_mute_put,
393 .private_value = 1 401 .private_value = 1,
402 .tlv = { .p = db_scale_dac }
394 }, 403 },
395 { 404 {
396 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 405 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -419,11 +428,15 @@ static struct snd_kcontrol_new stac9640_controls[] = {
419 }, 428 },
420 { 429 {
421 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 430 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
431 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
432 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
433
422 .name = "DAC Volume", 434 .name = "DAC Volume",
423 .count = 8, 435 .count = 8,
424 .info = stac9460_dac_vol_info, 436 .info = stac9460_dac_vol_info,
425 .get = stac9460_dac_vol_get, 437 .get = stac9460_dac_vol_get,
426 .put = stac9460_dac_vol_put, 438 .put = stac9460_dac_vol_put,
439 .tlv = { .p = db_scale_dac }
427 }, 440 },
428 { 441 {
429 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 442 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -435,12 +448,15 @@ static struct snd_kcontrol_new stac9640_controls[] = {
435 }, 448 },
436 { 449 {
437 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 450 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
451 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
452 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
453
438 .name = "ADC Volume", 454 .name = "ADC Volume",
439 .count = 2, 455 .count = 2,
440 .info = stac9460_adc_vol_info, 456 .info = stac9460_adc_vol_info,
441 .get = stac9460_adc_vol_get, 457 .get = stac9460_adc_vol_get,
442 .put = stac9460_adc_vol_put, 458 .put = stac9460_adc_vol_put,
443 459 .tlv = { .p = db_scale_adc }
444 } 460 }
445}; 461};
446 462