diff options
Diffstat (limited to 'sound/pci/ice1712/phase.c')
-rw-r--r-- | sound/pci/ice1712/phase.c | 39 |
1 files changed, 32 insertions, 7 deletions
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 | ||
700 | static DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1); | ||
701 | static DECLARE_TLV_DB_SCALE(db_scale_wm_pcm, -6400, 50, 1); | ||
702 | |||
699 | static struct snd_kcontrol_new phase28_dac_controls[] __devinitdata = { | 703 | static 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, |