aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/cs423x/cs4236_lib.c152
1 files changed, 108 insertions, 44 deletions
diff --git a/sound/isa/cs423x/cs4236_lib.c b/sound/isa/cs423x/cs4236_lib.c
index 4c4024a73c6b..c5adca300632 100644
--- a/sound/isa/cs423x/cs4236_lib.c
+++ b/sound/isa/cs423x/cs4236_lib.c
@@ -88,6 +88,7 @@
88#include <sound/wss.h> 88#include <sound/wss.h>
89#include <sound/asoundef.h> 89#include <sound/asoundef.h>
90#include <sound/initval.h> 90#include <sound/initval.h>
91#include <sound/tlv.h>
91 92
92/* 93/*
93 * 94 *
@@ -399,6 +400,14 @@ int snd_cs4236_pcm(struct snd_wss *chip, int device, struct snd_pcm **rpcm)
399 .get = snd_cs4236_get_single, .put = snd_cs4236_put_single, \ 400 .get = snd_cs4236_get_single, .put = snd_cs4236_put_single, \
400 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } 401 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) }
401 402
403#define CS4236_SINGLE_TLV(xname, xindex, reg, shift, mask, invert, xtlv) \
404{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
405 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, \
406 .info = snd_cs4236_info_single, \
407 .get = snd_cs4236_get_single, .put = snd_cs4236_put_single, \
408 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24), \
409 .tlv = { .p = (xtlv) } }
410
402static int snd_cs4236_info_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 411static int snd_cs4236_info_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
403{ 412{
404 int mask = (kcontrol->private_value >> 16) & 0xff; 413 int mask = (kcontrol->private_value >> 16) & 0xff;
@@ -502,6 +511,16 @@ static int snd_cs4236_put_singlec(struct snd_kcontrol *kcontrol, struct snd_ctl_
502 .get = snd_cs4236_get_double, .put = snd_cs4236_put_double, \ 511 .get = snd_cs4236_get_double, .put = snd_cs4236_put_double, \
503 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 512 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) }
504 513
514#define CS4236_DOUBLE_TLV(xname, xindex, left_reg, right_reg, shift_left, \
515 shift_right, mask, invert, xtlv) \
516{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
517 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, \
518 .info = snd_cs4236_info_double, \
519 .get = snd_cs4236_get_double, .put = snd_cs4236_put_double, \
520 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | \
521 (shift_right << 19) | (mask << 24) | (invert << 22), \
522 .tlv = { .p = (xtlv) } }
523
505static int snd_cs4236_info_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 524static int snd_cs4236_info_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
506{ 525{
507 int mask = (kcontrol->private_value >> 24) & 0xff; 526 int mask = (kcontrol->private_value >> 24) & 0xff;
@@ -572,12 +591,23 @@ static int snd_cs4236_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_e
572 return change; 591 return change;
573} 592}
574 593
575#define CS4236_DOUBLE1(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 594#define CS4236_DOUBLE1(xname, xindex, left_reg, right_reg, shift_left, \
595 shift_right, mask, invert) \
576{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 596{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
577 .info = snd_cs4236_info_double, \ 597 .info = snd_cs4236_info_double, \
578 .get = snd_cs4236_get_double1, .put = snd_cs4236_put_double1, \ 598 .get = snd_cs4236_get_double1, .put = snd_cs4236_put_double1, \
579 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 599 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) }
580 600
601#define CS4236_DOUBLE1_TLV(xname, xindex, left_reg, right_reg, shift_left, \
602 shift_right, mask, invert, xtlv) \
603{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
604 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, \
605 .info = snd_cs4236_info_double, \
606 .get = snd_cs4236_get_double1, .put = snd_cs4236_put_double1, \
607 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | \
608 (shift_right << 19) | (mask << 24) | (invert << 22), \
609 .tlv = { .p = (xtlv) } }
610
581static int snd_cs4236_get_double1(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) 611static int snd_cs4236_get_double1(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
582{ 612{
583 struct snd_wss *chip = snd_kcontrol_chip(kcontrol); 613 struct snd_wss *chip = snd_kcontrol_chip(kcontrol);
@@ -631,16 +661,18 @@ static int snd_cs4236_put_double1(struct snd_kcontrol *kcontrol, struct snd_ctl_
631 return change; 661 return change;
632} 662}
633 663
634#define CS4236_MASTER_DIGITAL(xname, xindex) \ 664#define CS4236_MASTER_DIGITAL(xname, xindex, xtlv) \
635{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 665{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
666 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, \
636 .info = snd_cs4236_info_double, \ 667 .info = snd_cs4236_info_double, \
637 .get = snd_cs4236_get_master_digital, .put = snd_cs4236_put_master_digital, \ 668 .get = snd_cs4236_get_master_digital, .put = snd_cs4236_put_master_digital, \
638 .private_value = 71 << 24 } 669 .private_value = 71 << 24, \
670 .tlv = { .p = (xtlv) } }
639 671
640static inline int snd_cs4236_mixer_master_digital_invert_volume(int vol) 672static inline int snd_cs4236_mixer_master_digital_invert_volume(int vol)
641{ 673{
642 return (vol < 64) ? 63 - vol : 64 + (71 - vol); 674 return (vol < 64) ? 63 - vol : 64 + (71 - vol);
643} 675}
644 676
645static int snd_cs4236_get_master_digital(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) 677static int snd_cs4236_get_master_digital(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
646{ 678{
@@ -673,11 +705,13 @@ static int snd_cs4236_put_master_digital(struct snd_kcontrol *kcontrol, struct s
673 return change; 705 return change;
674} 706}
675 707
676#define CS4235_OUTPUT_ACCU(xname, xindex) \ 708#define CS4235_OUTPUT_ACCU(xname, xindex, xtlv) \
677{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 709{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
710 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, \
678 .info = snd_cs4236_info_double, \ 711 .info = snd_cs4236_info_double, \
679 .get = snd_cs4235_get_output_accu, .put = snd_cs4235_put_output_accu, \ 712 .get = snd_cs4235_get_output_accu, .put = snd_cs4235_put_output_accu, \
680 .private_value = 3 << 24 } 713 .private_value = 3 << 24, \
714 .tlv = { .p = (xtlv) } }
681 715
682static inline int snd_cs4235_mixer_output_accu_get_volume(int vol) 716static inline int snd_cs4235_mixer_output_accu_get_volume(int vol)
683{ 717{
@@ -732,41 +766,56 @@ static int snd_cs4235_put_output_accu(struct snd_kcontrol *kcontrol, struct snd_
732 return change; 766 return change;
733} 767}
734 768
769static const DECLARE_TLV_DB_SCALE(db_scale_7bit, -9450, 150, 0);
770static const DECLARE_TLV_DB_SCALE(db_scale_6bit, -9450, 150, 0);
771static const DECLARE_TLV_DB_SCALE(db_scale_6bit_12db_max, -8250, 150, 0);
772static const DECLARE_TLV_DB_SCALE(db_scale_5bit_12db_max, -3450, 150, 0);
773static const DECLARE_TLV_DB_SCALE(db_scale_5bit_22db_max, -2400, 150, 0);
774static const DECLARE_TLV_DB_SCALE(db_scale_4bit, -4500, 300, 0);
775static const DECLARE_TLV_DB_SCALE(db_scale_2bit, -1800, 600, 0);
776static const DECLARE_TLV_DB_SCALE(db_scale_rec_gain, 0, 150, 0);
777
735static struct snd_kcontrol_new snd_cs4236_controls[] = { 778static struct snd_kcontrol_new snd_cs4236_controls[] = {
736 779
737CS4236_DOUBLE("Master Digital Playback Switch", 0, 780CS4236_DOUBLE("Master Digital Playback Switch", 0,
738 CS4236_LEFT_MASTER, CS4236_RIGHT_MASTER, 7, 7, 1, 1), 781 CS4236_LEFT_MASTER, CS4236_RIGHT_MASTER, 7, 7, 1, 1),
739CS4236_DOUBLE("Master Digital Capture Switch", 0, 782CS4236_DOUBLE("Master Digital Capture Switch", 0,
740 CS4236_DAC_MUTE, CS4236_DAC_MUTE, 7, 6, 1, 1), 783 CS4236_DAC_MUTE, CS4236_DAC_MUTE, 7, 6, 1, 1),
741CS4236_MASTER_DIGITAL("Master Digital Volume", 0), 784CS4236_MASTER_DIGITAL("Master Digital Volume", 0, db_scale_7bit),
742 785
743CS4236_DOUBLE("Capture Boost Volume", 0, 786CS4236_DOUBLE_TLV("Capture Boost Volume", 0,
744 CS4236_LEFT_MIX_CTRL, CS4236_RIGHT_MIX_CTRL, 5, 5, 3, 1), 787 CS4236_LEFT_MIX_CTRL, CS4236_RIGHT_MIX_CTRL, 5, 5, 3, 1,
788 db_scale_2bit),
745 789
746WSS_DOUBLE("PCM Playback Switch", 0, 790WSS_DOUBLE("PCM Playback Switch", 0,
747 CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1), 791 CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1),
748WSS_DOUBLE("PCM Playback Volume", 0, 792WSS_DOUBLE_TLV("PCM Playback Volume", 0,
749 CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 0, 0, 63, 1), 793 CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 0, 0, 63, 1,
794 db_scale_6bit),
750 795
751CS4236_DOUBLE("DSP Playback Switch", 0, 796CS4236_DOUBLE("DSP Playback Switch", 0,
752 CS4236_LEFT_DSP, CS4236_RIGHT_DSP, 7, 7, 1, 1), 797 CS4236_LEFT_DSP, CS4236_RIGHT_DSP, 7, 7, 1, 1),
753CS4236_DOUBLE("DSP Playback Volume", 0, 798CS4236_DOUBLE_TLV("DSP Playback Volume", 0,
754 CS4236_LEFT_DSP, CS4236_RIGHT_DSP, 0, 0, 63, 1), 799 CS4236_LEFT_DSP, CS4236_RIGHT_DSP, 0, 0, 63, 1,
800 db_scale_6bit),
755 801
756CS4236_DOUBLE("FM Playback Switch", 0, 802CS4236_DOUBLE("FM Playback Switch", 0,
757 CS4236_LEFT_FM, CS4236_RIGHT_FM, 7, 7, 1, 1), 803 CS4236_LEFT_FM, CS4236_RIGHT_FM, 7, 7, 1, 1),
758CS4236_DOUBLE("FM Playback Volume", 0, 804CS4236_DOUBLE_TLV("FM Playback Volume", 0,
759 CS4236_LEFT_FM, CS4236_RIGHT_FM, 0, 0, 63, 1), 805 CS4236_LEFT_FM, CS4236_RIGHT_FM, 0, 0, 63, 1,
806 db_scale_6bit),
760 807
761CS4236_DOUBLE("Wavetable Playback Switch", 0, 808CS4236_DOUBLE("Wavetable Playback Switch", 0,
762 CS4236_LEFT_WAVE, CS4236_RIGHT_WAVE, 7, 7, 1, 1), 809 CS4236_LEFT_WAVE, CS4236_RIGHT_WAVE, 7, 7, 1, 1),
763CS4236_DOUBLE("Wavetable Playback Volume", 0, 810CS4236_DOUBLE_TLV("Wavetable Playback Volume", 0,
764 CS4236_LEFT_WAVE, CS4236_RIGHT_WAVE, 0, 0, 63, 1), 811 CS4236_LEFT_WAVE, CS4236_RIGHT_WAVE, 0, 0, 63, 1,
812 db_scale_6bit_12db_max),
765 813
766WSS_DOUBLE("Synth Playback Switch", 0, 814WSS_DOUBLE("Synth Playback Switch", 0,
767 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 7, 7, 1, 1), 815 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 7, 7, 1, 1),
768WSS_DOUBLE("Synth Volume", 0, 816WSS_DOUBLE_TLV("Synth Volume", 0,
769 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 0, 0, 31, 1), 817 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 0, 0, 31, 1,
818 db_scale_5bit_12db_max),
770WSS_DOUBLE("Synth Capture Switch", 0, 819WSS_DOUBLE("Synth Capture Switch", 0,
771 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 6, 6, 1, 1), 820 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 6, 6, 1, 1),
772WSS_DOUBLE("Synth Capture Bypass", 0, 821WSS_DOUBLE("Synth Capture Bypass", 0,
@@ -776,14 +825,16 @@ CS4236_DOUBLE("Mic Playback Switch", 0,
776 CS4236_LEFT_MIC, CS4236_RIGHT_MIC, 6, 6, 1, 1), 825 CS4236_LEFT_MIC, CS4236_RIGHT_MIC, 6, 6, 1, 1),
777CS4236_DOUBLE("Mic Capture Switch", 0, 826CS4236_DOUBLE("Mic Capture Switch", 0,
778 CS4236_LEFT_MIC, CS4236_RIGHT_MIC, 7, 7, 1, 1), 827 CS4236_LEFT_MIC, CS4236_RIGHT_MIC, 7, 7, 1, 1),
779CS4236_DOUBLE("Mic Volume", 0, CS4236_LEFT_MIC, CS4236_RIGHT_MIC, 0, 0, 31, 1), 828CS4236_DOUBLE_TLV("Mic Volume", 0, CS4236_LEFT_MIC, CS4236_RIGHT_MIC,
829 0, 0, 31, 1, db_scale_5bit_22db_max),
780CS4236_DOUBLE("Mic Playback Boost (+20dB)", 0, 830CS4236_DOUBLE("Mic Playback Boost (+20dB)", 0,
781 CS4236_LEFT_MIC, CS4236_RIGHT_MIC, 5, 5, 1, 0), 831 CS4236_LEFT_MIC, CS4236_RIGHT_MIC, 5, 5, 1, 0),
782 832
783WSS_DOUBLE("Line Playback Switch", 0, 833WSS_DOUBLE("Line Playback Switch", 0,
784 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 7, 7, 1, 1), 834 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 7, 7, 1, 1),
785WSS_DOUBLE("Line Volume", 0, 835WSS_DOUBLE_TLV("Line Volume", 0,
786 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 0, 0, 31, 1), 836 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 0, 0, 31, 1,
837 db_scale_5bit_12db_max),
787WSS_DOUBLE("Line Capture Switch", 0, 838WSS_DOUBLE("Line Capture Switch", 0,
788 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 6, 6, 1, 1), 839 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 6, 6, 1, 1),
789WSS_DOUBLE("Line Capture Bypass", 0, 840WSS_DOUBLE("Line Capture Bypass", 0,
@@ -791,8 +842,9 @@ WSS_DOUBLE("Line Capture Bypass", 0,
791 842
792WSS_DOUBLE("CD Playback Switch", 0, 843WSS_DOUBLE("CD Playback Switch", 0,
793 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 7, 7, 1, 1), 844 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 7, 7, 1, 1),
794WSS_DOUBLE("CD Volume", 0, 845WSS_DOUBLE_TLV("CD Volume", 0,
795 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 0, 0, 31, 1), 846 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 0, 0, 31, 1,
847 db_scale_5bit_12db_max),
796WSS_DOUBLE("CD Capture Switch", 0, 848WSS_DOUBLE("CD Capture Switch", 0,
797 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 6, 6, 1, 1), 849 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 6, 6, 1, 1),
798 850
@@ -800,44 +852,53 @@ CS4236_DOUBLE1("Mono Output Playback Switch", 0,
800 CS4231_MONO_CTRL, CS4236_RIGHT_MIX_CTRL, 6, 7, 1, 1), 852 CS4231_MONO_CTRL, CS4236_RIGHT_MIX_CTRL, 6, 7, 1, 1),
801CS4236_DOUBLE1("Beep Playback Switch", 0, 853CS4236_DOUBLE1("Beep Playback Switch", 0,
802 CS4231_MONO_CTRL, CS4236_LEFT_MIX_CTRL, 7, 7, 1, 1), 854 CS4231_MONO_CTRL, CS4236_LEFT_MIX_CTRL, 7, 7, 1, 1),
803WSS_SINGLE("Beep Playback Volume", 0, CS4231_MONO_CTRL, 0, 15, 1), 855WSS_SINGLE_TLV("Beep Playback Volume", 0, CS4231_MONO_CTRL, 0, 15, 1,
856 db_scale_4bit),
804WSS_SINGLE("Beep Bypass Playback Switch", 0, CS4231_MONO_CTRL, 5, 1, 0), 857WSS_SINGLE("Beep Bypass Playback Switch", 0, CS4231_MONO_CTRL, 5, 1, 0),
805 858
806WSS_DOUBLE("Capture Volume", 0, 859WSS_DOUBLE_TLV("Capture Volume", 0, CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT,
807 CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT, 0, 0, 15, 0), 860 0, 0, 15, 0, db_scale_rec_gain),
808WSS_DOUBLE("Analog Loopback Capture Switch", 0, 861WSS_DOUBLE("Analog Loopback Capture Switch", 0,
809 CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT, 7, 7, 1, 0), 862 CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT, 7, 7, 1, 0),
810 863
811WSS_SINGLE("Digital Loopback Playback Switch", 0, CS4231_LOOPBACK, 0, 1, 0), 864WSS_SINGLE("Loopback Digital Playback Switch", 0, CS4231_LOOPBACK, 0, 1, 0),
812CS4236_DOUBLE1("Digital Loopback Playback Volume", 0, 865CS4236_DOUBLE1_TLV("Loopback Digital Playback Volume", 0,
813 CS4231_LOOPBACK, CS4236_RIGHT_LOOPBACK, 2, 0, 63, 1) 866 CS4231_LOOPBACK, CS4236_RIGHT_LOOPBACK, 2, 0, 63, 1,
867 db_scale_6bit),
814}; 868};
815 869
870static const DECLARE_TLV_DB_SCALE(db_scale_5bit_6db_max, -5600, 200, 0);
871static const DECLARE_TLV_DB_SCALE(db_scale_2bit_16db_max, -2400, 800, 0);
872
816static struct snd_kcontrol_new snd_cs4235_controls[] = { 873static struct snd_kcontrol_new snd_cs4235_controls[] = {
817 874
818WSS_DOUBLE("Master Playback Switch", 0, 875WSS_DOUBLE("Master Playback Switch", 0,
819 CS4235_LEFT_MASTER, CS4235_RIGHT_MASTER, 7, 7, 1, 1), 876 CS4235_LEFT_MASTER, CS4235_RIGHT_MASTER, 7, 7, 1, 1),
820WSS_DOUBLE("Master Playback Volume", 0, 877WSS_DOUBLE_TLV("Master Playback Volume", 0,
821 CS4235_LEFT_MASTER, CS4235_RIGHT_MASTER, 0, 0, 31, 1), 878 CS4235_LEFT_MASTER, CS4235_RIGHT_MASTER, 0, 0, 31, 1,
879 db_scale_5bit_6db_max),
822 880
823CS4235_OUTPUT_ACCU("Playback Volume", 0), 881CS4235_OUTPUT_ACCU("Playback Volume", 0, db_scale_2bit_16db_max),
824 882
825WSS_DOUBLE("Synth Playback Switch", 1, 883WSS_DOUBLE("Synth Playback Switch", 1,
826 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 7, 7, 1, 1), 884 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 7, 7, 1, 1),
827WSS_DOUBLE("Synth Capture Switch", 1, 885WSS_DOUBLE("Synth Capture Switch", 1,
828 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 6, 6, 1, 1), 886 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 6, 6, 1, 1),
829WSS_DOUBLE("Synth Volume", 1, 887WSS_DOUBLE_TLV("Synth Volume", 1,
830 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 0, 0, 31, 1), 888 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 0, 0, 31, 1,
889 db_scale_5bit_12db_max),
831 890
832CS4236_DOUBLE("Capture Volume", 0, 891CS4236_DOUBLE_TLV("Capture Volume", 0,
833 CS4236_LEFT_MIX_CTRL, CS4236_RIGHT_MIX_CTRL, 5, 5, 3, 1), 892 CS4236_LEFT_MIX_CTRL, CS4236_RIGHT_MIX_CTRL, 5, 5, 3, 1,
893 db_scale_2bit),
834 894
835WSS_DOUBLE("PCM Playback Switch", 0, 895WSS_DOUBLE("PCM Playback Switch", 0,
836 CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1), 896 CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1),
837WSS_DOUBLE("PCM Capture Switch", 0, 897WSS_DOUBLE("PCM Capture Switch", 0,
838 CS4236_DAC_MUTE, CS4236_DAC_MUTE, 7, 6, 1, 1), 898 CS4236_DAC_MUTE, CS4236_DAC_MUTE, 7, 6, 1, 1),
839WSS_DOUBLE("PCM Volume", 0, 899WSS_DOUBLE_TLV("PCM Volume", 0,
840 CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 0, 0, 63, 1), 900 CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 0, 0, 63, 1,
901 db_scale_6bit),
841 902
842CS4236_DOUBLE("DSP Switch", 0, CS4236_LEFT_DSP, CS4236_RIGHT_DSP, 7, 7, 1, 1), 903CS4236_DOUBLE("DSP Switch", 0, CS4236_LEFT_DSP, CS4236_RIGHT_DSP, 7, 7, 1, 1),
843 904
@@ -850,22 +911,25 @@ CS4236_DOUBLE("Mic Capture Switch", 0,
850 CS4236_LEFT_MIC, CS4236_RIGHT_MIC, 7, 7, 1, 1), 911 CS4236_LEFT_MIC, CS4236_RIGHT_MIC, 7, 7, 1, 1),
851CS4236_DOUBLE("Mic Playback Switch", 0, 912CS4236_DOUBLE("Mic Playback Switch", 0,
852 CS4236_LEFT_MIC, CS4236_RIGHT_MIC, 6, 6, 1, 1), 913 CS4236_LEFT_MIC, CS4236_RIGHT_MIC, 6, 6, 1, 1),
853CS4236_SINGLE("Mic Volume", 0, CS4236_LEFT_MIC, 0, 31, 1), 914CS4236_SINGLE_TLV("Mic Volume", 0, CS4236_LEFT_MIC, 0, 31, 1,
915 db_scale_5bit_22db_max),
854CS4236_SINGLE("Mic Boost (+20dB)", 0, CS4236_LEFT_MIC, 5, 1, 0), 916CS4236_SINGLE("Mic Boost (+20dB)", 0, CS4236_LEFT_MIC, 5, 1, 0),
855 917
856WSS_DOUBLE("Line Playback Switch", 0, 918WSS_DOUBLE("Line Playback Switch", 0,
857 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 7, 7, 1, 1), 919 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 7, 7, 1, 1),
858WSS_DOUBLE("Line Capture Switch", 0, 920WSS_DOUBLE("Line Capture Switch", 0,
859 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 6, 6, 1, 1), 921 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 6, 6, 1, 1),
860WSS_DOUBLE("Line Volume", 0, 922WSS_DOUBLE_TLV("Line Volume", 0,
861 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 0, 0, 31, 1), 923 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 0, 0, 31, 1,
924 db_scale_5bit_12db_max),
862 925
863WSS_DOUBLE("CD Playback Switch", 1, 926WSS_DOUBLE("CD Playback Switch", 1,
864 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 7, 7, 1, 1), 927 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 7, 7, 1, 1),
865WSS_DOUBLE("CD Capture Switch", 1, 928WSS_DOUBLE("CD Capture Switch", 1,
866 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 6, 6, 1, 1), 929 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 6, 6, 1, 1),
867WSS_DOUBLE("CD Volume", 1, 930WSS_DOUBLE_TLV("CD Volume", 1,
868 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 0, 0, 31, 1), 931 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 0, 0, 31, 1,
932 db_scale_5bit_12db_max),
869 933
870CS4236_DOUBLE1("Beep Playback Switch", 0, 934CS4236_DOUBLE1("Beep Playback Switch", 0,
871 CS4231_MONO_CTRL, CS4236_LEFT_MIX_CTRL, 7, 7, 1, 1), 935 CS4231_MONO_CTRL, CS4236_LEFT_MIX_CTRL, 7, 7, 1, 1),