aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-08-30 10:57:37 -0400
committerJaroslav Kysela <perex@suse.cz>2006-09-23 04:45:18 -0400
commitf640c3205aca4fe231beccc9e719c946cf3fee7a (patch)
tree4fd4b1db6e426e2640be9eaecab71f14ab27d1cc
parent680ef792a1afdb3bf38e4a0296cce996a5b95317 (diff)
[ALSA] Add dB scale information to ice1724 driver
Added the dB scale information to each board support code of ice1724 driver. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r--sound/pci/ice1712/aureon.c104
-rw-r--r--sound/pci/ice1712/phase.c39
-rw-r--r--sound/pci/ice1712/pontis.c9
-rw-r--r--sound/pci/ice1712/prodigy192.c14
4 files changed, 139 insertions, 27 deletions
diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c
index 9492f3d2455b..9e76cebd2d22 100644
--- a/sound/pci/ice1712/aureon.c
+++ b/sound/pci/ice1712/aureon.c
@@ -60,6 +60,7 @@
60#include "ice1712.h" 60#include "ice1712.h"
61#include "envy24ht.h" 61#include "envy24ht.h"
62#include "aureon.h" 62#include "aureon.h"
63#include <sound/tlv.h>
63 64
64/* WM8770 registers */ 65/* WM8770 registers */
65#define WM_DAC_ATTEN 0x00 /* DAC1-8 analog attenuation */ 66#define WM_DAC_ATTEN 0x00 /* DAC1-8 analog attenuation */
@@ -660,6 +661,12 @@ static int aureon_ac97_mmute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_e
660 return change; 661 return change;
661} 662}
662 663
664static DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1);
665static DECLARE_TLV_DB_SCALE(db_scale_wm_pcm, -6400, 50, 1);
666static DECLARE_TLV_DB_SCALE(db_scale_wm_adc, -1200, 100, 0);
667static DECLARE_TLV_DB_SCALE(db_scale_ac97_master, -4650, 150, 0);
668static DECLARE_TLV_DB_SCALE(db_scale_ac97_gain, -3450, 150, 0);
669
663/* 670/*
664 * Logarithmic volume values for WM8770 671 * Logarithmic volume values for WM8770
665 * Computed as 20 * Log10(255 / x) 672 * Computed as 20 * Log10(255 / x)
@@ -1409,10 +1416,13 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
1409 }, 1416 },
1410 { 1417 {
1411 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1418 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1419 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1420 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1412 .name = "Master Playback Volume", 1421 .name = "Master Playback Volume",
1413 .info = wm_master_vol_info, 1422 .info = wm_master_vol_info,
1414 .get = wm_master_vol_get, 1423 .get = wm_master_vol_get,
1415 .put = wm_master_vol_put 1424 .put = wm_master_vol_put,
1425 .tlv = { .p = db_scale_wm_dac }
1416 }, 1426 },
1417 { 1427 {
1418 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1428 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1424,11 +1434,14 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
1424 }, 1434 },
1425 { 1435 {
1426 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1436 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1437 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1438 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1427 .name = "Front Playback Volume", 1439 .name = "Front Playback Volume",
1428 .info = wm_vol_info, 1440 .info = wm_vol_info,
1429 .get = wm_vol_get, 1441 .get = wm_vol_get,
1430 .put = wm_vol_put, 1442 .put = wm_vol_put,
1431 .private_value = (2 << 8) | 0 1443 .private_value = (2 << 8) | 0,
1444 .tlv = { .p = db_scale_wm_dac }
1432 }, 1445 },
1433 { 1446 {
1434 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1447 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1440,11 +1453,14 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
1440 }, 1453 },
1441 { 1454 {
1442 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1455 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1456 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1457 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1443 .name = "Rear Playback Volume", 1458 .name = "Rear Playback Volume",
1444 .info = wm_vol_info, 1459 .info = wm_vol_info,
1445 .get = wm_vol_get, 1460 .get = wm_vol_get,
1446 .put = wm_vol_put, 1461 .put = wm_vol_put,
1447 .private_value = (2 << 8) | 2 1462 .private_value = (2 << 8) | 2,
1463 .tlv = { .p = db_scale_wm_dac }
1448 }, 1464 },
1449 { 1465 {
1450 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1466 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1456,11 +1472,14 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
1456 }, 1472 },
1457 { 1473 {
1458 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1474 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1475 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1476 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1459 .name = "Center Playback Volume", 1477 .name = "Center Playback Volume",
1460 .info = wm_vol_info, 1478 .info = wm_vol_info,
1461 .get = wm_vol_get, 1479 .get = wm_vol_get,
1462 .put = wm_vol_put, 1480 .put = wm_vol_put,
1463 .private_value = (1 << 8) | 4 1481 .private_value = (1 << 8) | 4,
1482 .tlv = { .p = db_scale_wm_dac }
1464 }, 1483 },
1465 { 1484 {
1466 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1485 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1472,11 +1491,14 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
1472 }, 1491 },
1473 { 1492 {
1474 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1493 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1494 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1495 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1475 .name = "LFE Playback Volume", 1496 .name = "LFE Playback Volume",
1476 .info = wm_vol_info, 1497 .info = wm_vol_info,
1477 .get = wm_vol_get, 1498 .get = wm_vol_get,
1478 .put = wm_vol_put, 1499 .put = wm_vol_put,
1479 .private_value = (1 << 8) | 5 1500 .private_value = (1 << 8) | 5,
1501 .tlv = { .p = db_scale_wm_dac }
1480 }, 1502 },
1481 { 1503 {
1482 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1504 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1488,11 +1510,14 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
1488 }, 1510 },
1489 { 1511 {
1490 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1512 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1513 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1514 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1491 .name = "Side Playback Volume", 1515 .name = "Side Playback Volume",
1492 .info = wm_vol_info, 1516 .info = wm_vol_info,
1493 .get = wm_vol_get, 1517 .get = wm_vol_get,
1494 .put = wm_vol_put, 1518 .put = wm_vol_put,
1495 .private_value = (2 << 8) | 6 1519 .private_value = (2 << 8) | 6,
1520 .tlv = { .p = db_scale_wm_dac }
1496 } 1521 }
1497}; 1522};
1498 1523
@@ -1506,10 +1531,13 @@ static struct snd_kcontrol_new wm_controls[] __devinitdata = {
1506 }, 1531 },
1507 { 1532 {
1508 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1533 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1534 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1535 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1509 .name = "PCM Playback Volume", 1536 .name = "PCM Playback Volume",
1510 .info = wm_pcm_vol_info, 1537 .info = wm_pcm_vol_info,
1511 .get = wm_pcm_vol_get, 1538 .get = wm_pcm_vol_get,
1512 .put = wm_pcm_vol_put 1539 .put = wm_pcm_vol_put,
1540 .tlv = { .p = db_scale_wm_pcm }
1513 }, 1541 },
1514 { 1542 {
1515 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1543 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1520,10 +1548,13 @@ static struct snd_kcontrol_new wm_controls[] __devinitdata = {
1520 }, 1548 },
1521 { 1549 {
1522 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1550 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1551 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1552 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1523 .name = "Capture Volume", 1553 .name = "Capture Volume",
1524 .info = wm_adc_vol_info, 1554 .info = wm_adc_vol_info,
1525 .get = wm_adc_vol_get, 1555 .get = wm_adc_vol_get,
1526 .put = wm_adc_vol_put 1556 .put = wm_adc_vol_put,
1557 .tlv = { .p = db_scale_wm_adc }
1527 }, 1558 },
1528 { 1559 {
1529 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1560 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1567,11 +1598,14 @@ static struct snd_kcontrol_new ac97_controls[] __devinitdata = {
1567 }, 1598 },
1568 { 1599 {
1569 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1600 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1601 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1602 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1570 .name = "AC97 Playback Volume", 1603 .name = "AC97 Playback Volume",
1571 .info = aureon_ac97_vol_info, 1604 .info = aureon_ac97_vol_info,
1572 .get = aureon_ac97_vol_get, 1605 .get = aureon_ac97_vol_get,
1573 .put = aureon_ac97_vol_put, 1606 .put = aureon_ac97_vol_put,
1574 .private_value = AC97_MASTER|AUREON_AC97_STEREO 1607 .private_value = AC97_MASTER|AUREON_AC97_STEREO,
1608 .tlv = { .p = db_scale_ac97_master }
1575 }, 1609 },
1576 { 1610 {
1577 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1611 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1583,11 +1617,14 @@ static struct snd_kcontrol_new ac97_controls[] __devinitdata = {
1583 }, 1617 },
1584 { 1618 {
1585 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1619 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1620 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1621 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1586 .name = "CD Playback Volume", 1622 .name = "CD Playback Volume",
1587 .info = aureon_ac97_vol_info, 1623 .info = aureon_ac97_vol_info,
1588 .get = aureon_ac97_vol_get, 1624 .get = aureon_ac97_vol_get,
1589 .put = aureon_ac97_vol_put, 1625 .put = aureon_ac97_vol_put,
1590 .private_value = AC97_CD|AUREON_AC97_STEREO 1626 .private_value = AC97_CD|AUREON_AC97_STEREO,
1627 .tlv = { .p = db_scale_ac97_gain }
1591 }, 1628 },
1592 { 1629 {
1593 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1630 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1599,11 +1636,14 @@ static struct snd_kcontrol_new ac97_controls[] __devinitdata = {
1599 }, 1636 },
1600 { 1637 {
1601 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1638 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1639 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1640 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1602 .name = "Aux Playback Volume", 1641 .name = "Aux Playback Volume",
1603 .info = aureon_ac97_vol_info, 1642 .info = aureon_ac97_vol_info,
1604 .get = aureon_ac97_vol_get, 1643 .get = aureon_ac97_vol_get,
1605 .put = aureon_ac97_vol_put, 1644 .put = aureon_ac97_vol_put,
1606 .private_value = AC97_AUX|AUREON_AC97_STEREO 1645 .private_value = AC97_AUX|AUREON_AC97_STEREO,
1646 .tlv = { .p = db_scale_ac97_gain }
1607 }, 1647 },
1608 { 1648 {
1609 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1649 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1615,11 +1655,14 @@ static struct snd_kcontrol_new ac97_controls[] __devinitdata = {
1615 }, 1655 },
1616 { 1656 {
1617 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1657 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1658 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1659 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1618 .name = "Line Playback Volume", 1660 .name = "Line Playback Volume",
1619 .info = aureon_ac97_vol_info, 1661 .info = aureon_ac97_vol_info,
1620 .get = aureon_ac97_vol_get, 1662 .get = aureon_ac97_vol_get,
1621 .put = aureon_ac97_vol_put, 1663 .put = aureon_ac97_vol_put,
1622 .private_value = AC97_LINE|AUREON_AC97_STEREO 1664 .private_value = AC97_LINE|AUREON_AC97_STEREO,
1665 .tlv = { .p = db_scale_ac97_gain }
1623 }, 1666 },
1624 { 1667 {
1625 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1668 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1631,11 +1674,14 @@ static struct snd_kcontrol_new ac97_controls[] __devinitdata = {
1631 }, 1674 },
1632 { 1675 {
1633 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1676 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1677 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1678 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1634 .name = "Mic Playback Volume", 1679 .name = "Mic Playback Volume",
1635 .info = aureon_ac97_vol_info, 1680 .info = aureon_ac97_vol_info,
1636 .get = aureon_ac97_vol_get, 1681 .get = aureon_ac97_vol_get,
1637 .put = aureon_ac97_vol_put, 1682 .put = aureon_ac97_vol_put,
1638 .private_value = AC97_MIC 1683 .private_value = AC97_MIC,
1684 .tlv = { .p = db_scale_ac97_gain }
1639 }, 1685 },
1640 { 1686 {
1641 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1687 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1657,11 +1703,14 @@ static struct snd_kcontrol_new universe_ac97_controls[] __devinitdata = {
1657 }, 1703 },
1658 { 1704 {
1659 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1705 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1706 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1707 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1660 .name = "AC97 Playback Volume", 1708 .name = "AC97 Playback Volume",
1661 .info = aureon_ac97_vol_info, 1709 .info = aureon_ac97_vol_info,
1662 .get = aureon_ac97_vol_get, 1710 .get = aureon_ac97_vol_get,
1663 .put = aureon_ac97_vol_put, 1711 .put = aureon_ac97_vol_put,
1664 .private_value = AC97_MASTER|AUREON_AC97_STEREO 1712 .private_value = AC97_MASTER|AUREON_AC97_STEREO,
1713 .tlv = { .p = db_scale_ac97_master }
1665 }, 1714 },
1666 { 1715 {
1667 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1716 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1673,11 +1722,14 @@ static struct snd_kcontrol_new universe_ac97_controls[] __devinitdata = {
1673 }, 1722 },
1674 { 1723 {
1675 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1724 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1725 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1726 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1676 .name = "CD Playback Volume", 1727 .name = "CD Playback Volume",
1677 .info = aureon_ac97_vol_info, 1728 .info = aureon_ac97_vol_info,
1678 .get = aureon_ac97_vol_get, 1729 .get = aureon_ac97_vol_get,
1679 .put = aureon_ac97_vol_put, 1730 .put = aureon_ac97_vol_put,
1680 .private_value = AC97_AUX|AUREON_AC97_STEREO 1731 .private_value = AC97_AUX|AUREON_AC97_STEREO,
1732 .tlv = { .p = db_scale_ac97_gain }
1681 }, 1733 },
1682 { 1734 {
1683 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1735 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1685,15 +1737,18 @@ static struct snd_kcontrol_new universe_ac97_controls[] __devinitdata = {
1685 .info = aureon_ac97_mute_info, 1737 .info = aureon_ac97_mute_info,
1686 .get = aureon_ac97_mute_get, 1738 .get = aureon_ac97_mute_get,
1687 .put = aureon_ac97_mute_put, 1739 .put = aureon_ac97_mute_put,
1688 .private_value = AC97_CD, 1740 .private_value = AC97_CD
1689 }, 1741 },
1690 { 1742 {
1691 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1743 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1744 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1745 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1692 .name = "Phono Playback Volume", 1746 .name = "Phono Playback Volume",
1693 .info = aureon_ac97_vol_info, 1747 .info = aureon_ac97_vol_info,
1694 .get = aureon_ac97_vol_get, 1748 .get = aureon_ac97_vol_get,
1695 .put = aureon_ac97_vol_put, 1749 .put = aureon_ac97_vol_put,
1696 .private_value = AC97_CD|AUREON_AC97_STEREO 1750 .private_value = AC97_CD|AUREON_AC97_STEREO,
1751 .tlv = { .p = db_scale_ac97_gain }
1697 }, 1752 },
1698 { 1753 {
1699 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1754 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1705,11 +1760,14 @@ static struct snd_kcontrol_new universe_ac97_controls[] __devinitdata = {
1705 }, 1760 },
1706 { 1761 {
1707 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1762 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1763 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1764 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1708 .name = "Line Playback Volume", 1765 .name = "Line Playback Volume",
1709 .info = aureon_ac97_vol_info, 1766 .info = aureon_ac97_vol_info,
1710 .get = aureon_ac97_vol_get, 1767 .get = aureon_ac97_vol_get,
1711 .put = aureon_ac97_vol_put, 1768 .put = aureon_ac97_vol_put,
1712 .private_value = AC97_LINE|AUREON_AC97_STEREO 1769 .private_value = AC97_LINE|AUREON_AC97_STEREO,
1770 .tlv = { .p = db_scale_ac97_gain }
1713 }, 1771 },
1714 { 1772 {
1715 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1773 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1721,11 +1779,14 @@ static struct snd_kcontrol_new universe_ac97_controls[] __devinitdata = {
1721 }, 1779 },
1722 { 1780 {
1723 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1781 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1782 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1783 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1724 .name = "Mic Playback Volume", 1784 .name = "Mic Playback Volume",
1725 .info = aureon_ac97_vol_info, 1785 .info = aureon_ac97_vol_info,
1726 .get = aureon_ac97_vol_get, 1786 .get = aureon_ac97_vol_get,
1727 .put = aureon_ac97_vol_put, 1787 .put = aureon_ac97_vol_put,
1728 .private_value = AC97_MIC 1788 .private_value = AC97_MIC,
1789 .tlv = { .p = db_scale_ac97_gain }
1729 }, 1790 },
1730 { 1791 {
1731 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1792 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1744,11 +1805,14 @@ static struct snd_kcontrol_new universe_ac97_controls[] __devinitdata = {
1744 }, 1805 },
1745 { 1806 {
1746 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1807 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1808 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1809 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
1747 .name = "Aux Playback Volume", 1810 .name = "Aux Playback Volume",
1748 .info = aureon_ac97_vol_info, 1811 .info = aureon_ac97_vol_info,
1749 .get = aureon_ac97_vol_get, 1812 .get = aureon_ac97_vol_get,
1750 .put = aureon_ac97_vol_put, 1813 .put = aureon_ac97_vol_put,
1751 .private_value = AC97_VIDEO|AUREON_AC97_STEREO 1814 .private_value = AC97_VIDEO|AUREON_AC97_STEREO,
1815 .tlv = { .p = db_scale_ac97_gain }
1752 }, 1816 },
1753 { 1817 {
1754 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1818 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
diff --git a/sound/pci/ice1712/phase.c b/sound/pci/ice1712/phase.c
index 502da1c8b5f7..e08d73f4ff85 100644
--- a/sound/pci/ice1712/phase.c
+++ b/sound/pci/ice1712/phase.c
@@ -46,6 +46,7 @@
46#include "ice1712.h" 46#include "ice1712.h"
47#include "envy24ht.h" 47#include "envy24ht.h"
48#include "phase.h" 48#include "phase.h"
49#include <sound/tlv.h>
49 50
50/* WM8770 registers */ 51/* WM8770 registers */
51#define WM_DAC_ATTEN 0x00 /* DAC1-8 analog attenuation */ 52#define WM_DAC_ATTEN 0x00 /* DAC1-8 analog attenuation */
@@ -696,6 +697,9 @@ static int phase28_oversampling_put(struct snd_kcontrol *kcontrol, struct snd_ct
696 return 0; 697 return 0;
697} 698}
698 699
700static DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1);
701static DECLARE_TLV_DB_SCALE(db_scale_wm_pcm, -6400, 50, 1);
702
699static struct snd_kcontrol_new phase28_dac_controls[] __devinitdata = { 703static struct snd_kcontrol_new phase28_dac_controls[] __devinitdata = {
700 { 704 {
701 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 705 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -706,10 +710,13 @@ static struct snd_kcontrol_new phase28_dac_controls[] __devinitdata = {
706 }, 710 },
707 { 711 {
708 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 712 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
713 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
714 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
709 .name = "Master Playback Volume", 715 .name = "Master Playback Volume",
710 .info = wm_master_vol_info, 716 .info = wm_master_vol_info,
711 .get = wm_master_vol_get, 717 .get = wm_master_vol_get,
712 .put = wm_master_vol_put 718 .put = wm_master_vol_put,
719 .tlv = { .p = db_scale_wm_dac }
713 }, 720 },
714 { 721 {
715 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 722 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -721,11 +728,14 @@ static struct snd_kcontrol_new phase28_dac_controls[] __devinitdata = {
721 }, 728 },
722 { 729 {
723 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 730 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
731 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
732 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
724 .name = "Front Playback Volume", 733 .name = "Front Playback Volume",
725 .info = wm_vol_info, 734 .info = wm_vol_info,
726 .get = wm_vol_get, 735 .get = wm_vol_get,
727 .put = wm_vol_put, 736 .put = wm_vol_put,
728 .private_value = (2 << 8) | 0 737 .private_value = (2 << 8) | 0,
738 .tlv = { .p = db_scale_wm_dac }
729 }, 739 },
730 { 740 {
731 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 741 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -737,11 +747,14 @@ static struct snd_kcontrol_new phase28_dac_controls[] __devinitdata = {
737 }, 747 },
738 { 748 {
739 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 749 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
750 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
751 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
740 .name = "Rear Playback Volume", 752 .name = "Rear Playback Volume",
741 .info = wm_vol_info, 753 .info = wm_vol_info,
742 .get = wm_vol_get, 754 .get = wm_vol_get,
743 .put = wm_vol_put, 755 .put = wm_vol_put,
744 .private_value = (2 << 8) | 2 756 .private_value = (2 << 8) | 2,
757 .tlv = { .p = db_scale_wm_dac }
745 }, 758 },
746 { 759 {
747 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 760 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -753,11 +766,14 @@ static struct snd_kcontrol_new phase28_dac_controls[] __devinitdata = {
753 }, 766 },
754 { 767 {
755 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 768 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
769 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
770 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
756 .name = "Center Playback Volume", 771 .name = "Center Playback Volume",
757 .info = wm_vol_info, 772 .info = wm_vol_info,
758 .get = wm_vol_get, 773 .get = wm_vol_get,
759 .put = wm_vol_put, 774 .put = wm_vol_put,
760 .private_value = (1 << 8) | 4 775 .private_value = (1 << 8) | 4,
776 .tlv = { .p = db_scale_wm_dac }
761 }, 777 },
762 { 778 {
763 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 779 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -769,11 +785,14 @@ static struct snd_kcontrol_new phase28_dac_controls[] __devinitdata = {
769 }, 785 },
770 { 786 {
771 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 787 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
788 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
789 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
772 .name = "LFE Playback Volume", 790 .name = "LFE Playback Volume",
773 .info = wm_vol_info, 791 .info = wm_vol_info,
774 .get = wm_vol_get, 792 .get = wm_vol_get,
775 .put = wm_vol_put, 793 .put = wm_vol_put,
776 .private_value = (1 << 8) | 5 794 .private_value = (1 << 8) | 5,
795 .tlv = { .p = db_scale_wm_dac }
777 }, 796 },
778 { 797 {
779 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 798 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -785,11 +804,14 @@ static struct snd_kcontrol_new phase28_dac_controls[] __devinitdata = {
785 }, 804 },
786 { 805 {
787 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 806 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
807 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
808 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
788 .name = "Side Playback Volume", 809 .name = "Side Playback Volume",
789 .info = wm_vol_info, 810 .info = wm_vol_info,
790 .get = wm_vol_get, 811 .get = wm_vol_get,
791 .put = wm_vol_put, 812 .put = wm_vol_put,
792 .private_value = (2 << 8) | 6 813 .private_value = (2 << 8) | 6,
814 .tlv = { .p = db_scale_wm_dac }
793 } 815 }
794}; 816};
795 817
@@ -803,10 +825,13 @@ static struct snd_kcontrol_new wm_controls[] __devinitdata = {
803 }, 825 },
804 { 826 {
805 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 827 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
828 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
829 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
806 .name = "PCM Playback Volume", 830 .name = "PCM Playback Volume",
807 .info = wm_pcm_vol_info, 831 .info = wm_pcm_vol_info,
808 .get = wm_pcm_vol_get, 832 .get = wm_pcm_vol_get,
809 .put = wm_pcm_vol_put 833 .put = wm_pcm_vol_put,
834 .tlv = { .p = db_scale_wm_pcm }
810 }, 835 },
811 { 836 {
812 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 837 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
diff --git a/sound/pci/ice1712/pontis.c b/sound/pci/ice1712/pontis.c
index 0efcad9260a5..6c74c2d2e7f3 100644
--- a/sound/pci/ice1712/pontis.c
+++ b/sound/pci/ice1712/pontis.c
@@ -31,6 +31,7 @@
31 31
32#include <sound/core.h> 32#include <sound/core.h>
33#include <sound/info.h> 33#include <sound/info.h>
34#include <sound/tlv.h>
34 35
35#include "ice1712.h" 36#include "ice1712.h"
36#include "envy24ht.h" 37#include "envy24ht.h"
@@ -564,6 +565,8 @@ static int pontis_gpio_data_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el
564 return changed; 565 return changed;
565} 566}
566 567
568static DECLARE_TLV_DB_SCALE(db_scale_volume, -6400, 50, 1);
569
567/* 570/*
568 * mixers 571 * mixers
569 */ 572 */
@@ -571,17 +574,23 @@ static int pontis_gpio_data_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el
571static struct snd_kcontrol_new pontis_controls[] __devinitdata = { 574static struct snd_kcontrol_new pontis_controls[] __devinitdata = {
572 { 575 {
573 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 576 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
577 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
578 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
574 .name = "PCM Playback Volume", 579 .name = "PCM Playback Volume",
575 .info = wm_dac_vol_info, 580 .info = wm_dac_vol_info,
576 .get = wm_dac_vol_get, 581 .get = wm_dac_vol_get,
577 .put = wm_dac_vol_put, 582 .put = wm_dac_vol_put,
583 .tlv = { .p = db_scale_volume },
578 }, 584 },
579 { 585 {
580 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 586 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
587 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
588 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
581 .name = "Capture Volume", 589 .name = "Capture Volume",
582 .info = wm_adc_vol_info, 590 .info = wm_adc_vol_info,
583 .get = wm_adc_vol_get, 591 .get = wm_adc_vol_get,
584 .put = wm_adc_vol_put, 592 .put = wm_adc_vol_put,
593 .tlv = { .p = db_scale_volume },
585 }, 594 },
586 { 595 {
587 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 596 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
diff --git a/sound/pci/ice1712/prodigy192.c b/sound/pci/ice1712/prodigy192.c
index fdb5cb8fac97..41b2605daa3a 100644
--- a/sound/pci/ice1712/prodigy192.c
+++ b/sound/pci/ice1712/prodigy192.c
@@ -35,6 +35,7 @@
35#include "envy24ht.h" 35#include "envy24ht.h"
36#include "prodigy192.h" 36#include "prodigy192.h"
37#include "stac946x.h" 37#include "stac946x.h"
38#include <sound/tlv.h>
38 39
39static inline void stac9460_put(struct snd_ice1712 *ice, int reg, unsigned char val) 40static inline void stac9460_put(struct snd_ice1712 *ice, int reg, unsigned char val)
40{ 41{
@@ -356,6 +357,9 @@ static int aureon_oversampling_put(struct snd_kcontrol *kcontrol, struct snd_ctl
356} 357}
357#endif 358#endif
358 359
360static DECLARE_TLV_DB_SCALE(db_scale_dac, -19125, 75, 0);
361static DECLARE_TLV_DB_SCALE(db_scale_adc, 0, 150, 0);
362
359/* 363/*
360 * mixers 364 * mixers
361 */ 365 */
@@ -368,14 +372,18 @@ static struct snd_kcontrol_new stac_controls[] __devinitdata = {
368 .get = stac9460_dac_mute_get, 372 .get = stac9460_dac_mute_get,
369 .put = stac9460_dac_mute_put, 373 .put = stac9460_dac_mute_put,
370 .private_value = 1, 374 .private_value = 1,
375 .tlv = { .p = db_scale_dac }
371 }, 376 },
372 { 377 {
373 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 378 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
379 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
380 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
374 .name = "Master Playback Volume", 381 .name = "Master Playback Volume",
375 .info = stac9460_dac_vol_info, 382 .info = stac9460_dac_vol_info,
376 .get = stac9460_dac_vol_get, 383 .get = stac9460_dac_vol_get,
377 .put = stac9460_dac_vol_put, 384 .put = stac9460_dac_vol_put,
378 .private_value = 1, 385 .private_value = 1,
386 .tlv = { .p = db_scale_dac }
379 }, 387 },
380 { 388 {
381 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 389 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -387,11 +395,14 @@ static struct snd_kcontrol_new stac_controls[] __devinitdata = {
387 }, 395 },
388 { 396 {
389 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 397 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
398 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
399 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
390 .name = "DAC Volume", 400 .name = "DAC Volume",
391 .count = 6, 401 .count = 6,
392 .info = stac9460_dac_vol_info, 402 .info = stac9460_dac_vol_info,
393 .get = stac9460_dac_vol_get, 403 .get = stac9460_dac_vol_get,
394 .put = stac9460_dac_vol_put, 404 .put = stac9460_dac_vol_put,
405 .tlv = { .p = db_scale_dac }
395 }, 406 },
396 { 407 {
397 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 408 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -404,11 +415,14 @@ static struct snd_kcontrol_new stac_controls[] __devinitdata = {
404 }, 415 },
405 { 416 {
406 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 417 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
418 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
419 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
407 .name = "ADC Volume", 420 .name = "ADC Volume",
408 .count = 1, 421 .count = 1,
409 .info = stac9460_adc_vol_info, 422 .info = stac9460_adc_vol_info,
410 .get = stac9460_adc_vol_get, 423 .get = stac9460_adc_vol_get,
411 .put = stac9460_adc_vol_put, 424 .put = stac9460_adc_vol_put,
425 .tlv = { .p = db_scale_adc }
412 }, 426 },
413#if 0 427#if 0
414 { 428 {