Ignore:
Timestamp:
Apr 3, 2017, 4:51:56 PM (9 years ago)
Author:
David Azarewicz
Message:

Merged/reintegrated v2 branch into trunk. Trunk is now v2

Location:
GPL/trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/isa/cs423x/cs4236.c

    r426 r598  
    2323#include <linux/err.h>
    2424#include <linux/isa.h>
    25 #include <linux/slab.h>
    2625#include <linux/pnp.h>
    2726#include <linux/moduleparam.h>
     
    178177        /* Digital PC 5000 Onboard - CS4236B */
    179178        { .id = "CSC0735", .devs = { { "CSC0000" }, { "CSC0010" } } },
    180         /* some uknown CS4236B */
     179        /* some unknown CS4236B */
    181180        { .id = "CSC0b35", .devs = { { "CSC0000" }, { "CSC0010" }, { "CSC0003" } } },
    182181        /* Intel PR440FX Onboard sound */
     
    395394                }
    396395
    397         err = snd_wss_create(card, port[dev], cport[dev],
     396        err = snd_cs4236_create(card, port[dev], cport[dev],
    398397                             irq[dev],
    399398                             dma1[dev], dma2[dev],
     
    401400        if (err < 0)
    402401                return err;
     402
     403        acard->chip = chip;
    403404        if (chip->hardware & WSS_HW_CS4236B_MASK) {
    404                 snd_wss_free(chip);
    405                 err = snd_cs4236_create(card,
    406                                         port[dev], cport[dev],
    407                                         irq[dev], dma1[dev], dma2[dev],
    408                                         WSS_HW_DETECT, 0, &chip);
    409                 if (err < 0)
    410                         return err;
    411                 acard->chip = chip;
    412405
    413406                err = snd_cs4236_pcm(chip, 0, &pcm);
     
    419412                        return err;
    420413        } else {
    421                 acard->chip = chip;
    422414                err = snd_wss_pcm(chip, 0, &pcm);
    423415                if (err < 0)
  • GPL/trunk/alsa-kernel/isa/cs423x/cs4236_lib.c

    r426 r598  
    8888#include <sound/wss.h>
    8989#include <sound/asoundef.h>
     90#include <sound/initval.h>
     91#include <sound/tlv.h>
    9092
    9193/*
     
    265267
    266268#endif /* CONFIG_PM */
    267 
     269/*
     270 * This function does no fail if the chip is not CS4236B or compatible.
     271 * It just an equivalent to the snd_wss_create() then.
     272 */
    268273int snd_cs4236_create(struct snd_card *card,
    269274                      unsigned long port,
     
    282287        if (hardware == WSS_HW_DETECT)
    283288                hardware = WSS_HW_DETECT3;
    284         if (cport < 0x100) {
    285                 snd_printk(KERN_ERR "please, specify control port "
    286                            "for CS4236+ chips\n");
    287                 return -ENODEV;
    288         }
     289
    289290        err = snd_wss_create(card, port, cport,
    290291                             irq, dma1, dma2, hardware, hwshare, &chip);
     
    292293                return err;
    293294
    294         if (!(chip->hardware & WSS_HW_CS4236B_MASK)) {
    295                 snd_printk(KERN_ERR "CS4236+: MODE3 and extended registers "
    296                            "not available, hardware=0x%x\n", chip->hardware);
    297                 snd_device_free(card, chip);
    298                 return -ENODEV;
     295        if ((chip->hardware & WSS_HW_CS4236B_MASK) == 0) {
     296                snd_printd("chip is not CS4236+, hardware=0x%x\n",
     297                           chip->hardware);
     298                *rchip = chip;
     299                return 0;
    299300        }
    300301#if 0
     
    309310        }
    310311#endif
     312        if (cport < 0x100 || cport == SNDRV_AUTO_PORT) {
     313                snd_printk(KERN_ERR "please, specify control port "
     314                           "for CS4236+ chips\n");
     315                snd_device_free(card, chip);
     316                return -ENODEV;
     317        }
    311318        ver1 = snd_cs4236_ctrl_in(chip, 1);
    312319        ver2 = snd_cs4236_ext_in(chip, CS4236_VERSION);
    313         snd_printdd("CS4236: [0x%lx] C1 (version) = 0x%x, ext = 0x%x\n", cport, ver1, ver2);
     320        snd_printdd("CS4236: [0x%lx] C1 (version) = 0x%x, ext = 0x%x\n",
     321                        cport, ver1, ver2);
    314322        if (ver1 != ver2) {
    315323                snd_printk(KERN_ERR "CS4236+ chip detected, but "
     
    322330        snd_cs4236_ctrl_out(chip, 3, 0x00);
    323331        snd_cs4236_ctrl_out(chip, 4, 0x80);
    324         snd_cs4236_ctrl_out(chip, 5, ((IEC958_AES1_CON_PCM_CODER & 3) << 6) | IEC958_AES0_CON_EMPHASIS_NONE);
     332        reg = ((IEC958_AES1_CON_PCM_CODER & 3) << 6) |
     333              IEC958_AES0_CON_EMPHASIS_NONE;
     334        snd_cs4236_ctrl_out(chip, 5, reg);
    325335        snd_cs4236_ctrl_out(chip, 6, IEC958_AES1_CON_PCM_CODER >> 2);
    326336        snd_cs4236_ctrl_out(chip, 7, 0x00);
    327         /* 0x8c for C8 is valid for Turtle Beach Malibu - the IEC-958 output */
    328         /* is working with this setup, other hardware should have */
    329         /* different signal paths and this value should be selectable */
    330         /* in the future */
     337        /*
     338         * 0x8c for C8 is valid for Turtle Beach Malibu - the IEC-958
     339         * output is working with this setup, other hardware should
     340         * have different signal paths and this value should be
     341         * selectable in the future
     342         */
    331343        snd_cs4236_ctrl_out(chip, 8, 0x8c);
    332344        chip->rate_constraint = snd_cs4236_xrate;
     
    340352        /* initialize extended registers */
    341353        for (reg = 0; reg < sizeof(snd_cs4236_ext_map); reg++)
    342                 snd_cs4236_ext_out(chip, CS4236_I23VAL(reg), snd_cs4236_ext_map[reg]);
    343 
    344         /* initialize compatible but more featured registers */
     354                snd_cs4236_ext_out(chip, CS4236_I23VAL(reg),
     355                                   snd_cs4236_ext_map[reg]);
     356
     357        /* initialize compatible but more featured registers */
    345358        snd_wss_out(chip, CS4231_LEFT_INPUT, 0x40);
    346359        snd_wss_out(chip, CS4231_RIGHT_INPUT, 0x40);
     
    388401  .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) }
    389402
     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
    390411static int snd_cs4236_info_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
    391412{
     
    490511  .get = snd_cs4236_get_double, .put = snd_cs4236_put_double, \
    491512  .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) }
     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) } }
    492523
    493524static int snd_cs4236_info_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
     
    561592}
    562593
    563 #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) \
    564596{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
    565597  .info = snd_cs4236_info_double, \
    566598  .get = snd_cs4236_get_double1, .put = snd_cs4236_put_double1, \
    567599  .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) }
     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) } }
    568610
    569611static int snd_cs4236_get_double1(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
     
    620662}
    621663
    622 #define CS4236_MASTER_DIGITAL(xname, xindex) \
     664#define CS4236_MASTER_DIGITAL(xname, xindex, xtlv) \
    623665{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
     666  .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, \
    624667  .info = snd_cs4236_info_double, \
    625668  .get = snd_cs4236_get_master_digital, .put = snd_cs4236_put_master_digital, \
    626   .private_value = 71 << 24 }
     669  .private_value = 71 << 24, \
     670  .tlv = { .p = (xtlv) } }
    627671
    628672static inline int snd_cs4236_mixer_master_digital_invert_volume(int vol)
    629673{
    630674        return (vol < 64) ? 63 - vol : 64 + (71 - vol);
    631 }       
     675}
    632676
    633677static int snd_cs4236_get_master_digital(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
     
    662706}
    663707
    664 #define CS4235_OUTPUT_ACCU(xname, xindex) \
     708#define CS4235_OUTPUT_ACCU(xname, xindex, xtlv) \
    665709{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
     710  .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, \
    666711  .info = snd_cs4236_info_double, \
    667712  .get = snd_cs4235_get_output_accu, .put = snd_cs4235_put_output_accu, \
    668   .private_value = 3 << 24 }
     713  .private_value = 3 << 24, \
     714  .tlv = { .p = (xtlv) } }
    669715
    670716static inline int snd_cs4235_mixer_output_accu_get_volume(int vol)
     
    721767}
    722768
     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
    723778static struct snd_kcontrol_new snd_cs4236_controls[] = {
    724779
     
    727782CS4236_DOUBLE("Master Digital Capture Switch", 0,
    728783                CS4236_DAC_MUTE, CS4236_DAC_MUTE, 7, 6, 1, 1),
    729 CS4236_MASTER_DIGITAL("Master Digital Volume", 0),
    730 
    731 CS4236_DOUBLE("Capture Boost Volume", 0,
    732                 CS4236_LEFT_MIX_CTRL, CS4236_RIGHT_MIX_CTRL, 5, 5, 3, 1),
     784CS4236_MASTER_DIGITAL("Master Digital Volume", 0, db_scale_7bit),
     785
     786CS4236_DOUBLE_TLV("Capture Boost Volume", 0,
     787                  CS4236_LEFT_MIX_CTRL, CS4236_RIGHT_MIX_CTRL, 5, 5, 3, 1,
     788                  db_scale_2bit),
    733789
    734790WSS_DOUBLE("PCM Playback Switch", 0,
    735791                CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1),
    736 WSS_DOUBLE("PCM Playback Volume", 0,
    737                 CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 0, 0, 63, 1),
     792WSS_DOUBLE_TLV("PCM Playback Volume", 0,
     793                CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 0, 0, 63, 1,
     794                db_scale_6bit),
    738795
    739796CS4236_DOUBLE("DSP Playback Switch", 0,
    740797                CS4236_LEFT_DSP, CS4236_RIGHT_DSP, 7, 7, 1, 1),
    741 CS4236_DOUBLE("DSP Playback Volume", 0,
    742                 CS4236_LEFT_DSP, CS4236_RIGHT_DSP, 0, 0, 63, 1),
     798CS4236_DOUBLE_TLV("DSP Playback Volume", 0,
     799                  CS4236_LEFT_DSP, CS4236_RIGHT_DSP, 0, 0, 63, 1,
     800                  db_scale_6bit),
    743801
    744802CS4236_DOUBLE("FM Playback Switch", 0,
    745803                CS4236_LEFT_FM, CS4236_RIGHT_FM, 7, 7, 1, 1),
    746 CS4236_DOUBLE("FM Playback Volume", 0,
    747                 CS4236_LEFT_FM, CS4236_RIGHT_FM, 0, 0, 63, 1),
     804CS4236_DOUBLE_TLV("FM Playback Volume", 0,
     805                  CS4236_LEFT_FM, CS4236_RIGHT_FM, 0, 0, 63, 1,
     806                  db_scale_6bit),
    748807
    749808CS4236_DOUBLE("Wavetable Playback Switch", 0,
    750809                CS4236_LEFT_WAVE, CS4236_RIGHT_WAVE, 7, 7, 1, 1),
    751 CS4236_DOUBLE("Wavetable Playback Volume", 0,
    752                 CS4236_LEFT_WAVE, CS4236_RIGHT_WAVE, 0, 0, 63, 1),
     810CS4236_DOUBLE_TLV("Wavetable Playback Volume", 0,
     811                  CS4236_LEFT_WAVE, CS4236_RIGHT_WAVE, 0, 0, 63, 1,
     812                  db_scale_6bit_12db_max),
    753813
    754814WSS_DOUBLE("Synth Playback Switch", 0,
    755815                CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 7, 7, 1, 1),
    756 WSS_DOUBLE("Synth Volume", 0,
    757                 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 0, 0, 31, 1),
     816WSS_DOUBLE_TLV("Synth Volume", 0,
     817                CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 0, 0, 31, 1,
     818                db_scale_5bit_12db_max),
    758819WSS_DOUBLE("Synth Capture Switch", 0,
    759820                CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 6, 6, 1, 1),
     
    765826CS4236_DOUBLE("Mic Capture Switch", 0,
    766827                CS4236_LEFT_MIC, CS4236_RIGHT_MIC, 7, 7, 1, 1),
    767 CS4236_DOUBLE("Mic Volume", 0, CS4236_LEFT_MIC, CS4236_RIGHT_MIC, 0, 0, 31, 1),
    768 CS4236_DOUBLE("Mic Playback Boost", 0,
     828CS4236_DOUBLE_TLV("Mic Volume", 0, CS4236_LEFT_MIC, CS4236_RIGHT_MIC,
     829                  0, 0, 31, 1, db_scale_5bit_22db_max),
     830CS4236_DOUBLE("Mic Playback Boost (+20dB)", 0,
    769831                CS4236_LEFT_MIC, CS4236_RIGHT_MIC, 5, 5, 1, 0),
    770832
    771833WSS_DOUBLE("Line Playback Switch", 0,
    772834                CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 7, 7, 1, 1),
    773 WSS_DOUBLE("Line Volume", 0,
    774                 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 0, 0, 31, 1),
     835WSS_DOUBLE_TLV("Line Volume", 0,
     836                CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 0, 0, 31, 1,
     837                db_scale_5bit_12db_max),
    775838WSS_DOUBLE("Line Capture Switch", 0,
    776839                CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 6, 6, 1, 1),
     
    780843WSS_DOUBLE("CD Playback Switch", 0,
    781844                CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 7, 7, 1, 1),
    782 WSS_DOUBLE("CD Volume", 0,
    783                 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 0, 0, 31, 1),
     845WSS_DOUBLE_TLV("CD Volume", 0,
     846                CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 0, 0, 31, 1,
     847                db_scale_5bit_12db_max),
    784848WSS_DOUBLE("CD Capture Switch", 0,
    785849                CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 6, 6, 1, 1),
     
    787851CS4236_DOUBLE1("Mono Output Playback Switch", 0,
    788852                CS4231_MONO_CTRL, CS4236_RIGHT_MIX_CTRL, 6, 7, 1, 1),
    789 CS4236_DOUBLE1("Mono Playback Switch", 0,
     853CS4236_DOUBLE1("Beep Playback Switch", 0,
    790854                CS4231_MONO_CTRL, CS4236_LEFT_MIX_CTRL, 7, 7, 1, 1),
    791 WSS_SINGLE("Mono Playback Volume", 0, CS4231_MONO_CTRL, 0, 15, 1),
    792 WSS_SINGLE("Mono Playback Bypass", 0, CS4231_MONO_CTRL, 5, 1, 0),
    793 
    794 WSS_DOUBLE("Capture Volume", 0,
    795                 CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT, 0, 0, 15, 0),
     855WSS_SINGLE_TLV("Beep Playback Volume", 0, CS4231_MONO_CTRL, 0, 15, 1,
     856                db_scale_4bit),
     857WSS_SINGLE("Beep Bypass Playback Switch", 0, CS4231_MONO_CTRL, 5, 1, 0),
     858
     859WSS_DOUBLE_TLV("Capture Volume", 0, CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT,
     860                0, 0, 15, 0, db_scale_rec_gain),
    796861WSS_DOUBLE("Analog Loopback Capture Switch", 0,
    797862                CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT, 7, 7, 1, 0),
    798863
    799 WSS_SINGLE("Digital Loopback Playback Switch", 0, CS4231_LOOPBACK, 0, 1, 0),
    800 CS4236_DOUBLE1("Digital Loopback Playback Volume", 0,
    801                 CS4231_LOOPBACK, CS4236_RIGHT_LOOPBACK, 2, 0, 63, 1)
     864WSS_SINGLE("Loopback Digital Playback Switch", 0, CS4231_LOOPBACK, 0, 1, 0),
     865CS4236_DOUBLE1_TLV("Loopback Digital Playback Volume", 0,
     866                   CS4231_LOOPBACK, CS4236_RIGHT_LOOPBACK, 2, 0, 63, 1,
     867                   db_scale_6bit),
    802868};
    803869
     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
    804873static struct snd_kcontrol_new snd_cs4235_controls[] = {
    805874
    806 WSS_DOUBLE("Master Switch", 0,
     875WSS_DOUBLE("Master Playback Switch", 0,
    807876                CS4235_LEFT_MASTER, CS4235_RIGHT_MASTER, 7, 7, 1, 1),
    808 WSS_DOUBLE("Master Volume", 0,
    809                 CS4235_LEFT_MASTER, CS4235_RIGHT_MASTER, 0, 0, 31, 1),
    810 
    811 CS4235_OUTPUT_ACCU("Playback Volume", 0),
    812 
    813 CS4236_DOUBLE("Master Digital Playback Switch", 0,
    814                 CS4236_LEFT_MASTER, CS4236_RIGHT_MASTER, 7, 7, 1, 1),
    815 CS4236_DOUBLE("Master Digital Capture Switch", 0,
     877WSS_DOUBLE_TLV("Master Playback Volume", 0,
     878                CS4235_LEFT_MASTER, CS4235_RIGHT_MASTER, 0, 0, 31, 1,
     879                db_scale_5bit_6db_max),
     880
     881CS4235_OUTPUT_ACCU("Playback Volume", 0, db_scale_2bit_16db_max),
     882
     883WSS_DOUBLE("Synth Playback Switch", 1,
     884                CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 7, 7, 1, 1),
     885WSS_DOUBLE("Synth Capture Switch", 1,
     886                CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 6, 6, 1, 1),
     887WSS_DOUBLE_TLV("Synth Volume", 1,
     888                CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 0, 0, 31, 1,
     889                db_scale_5bit_12db_max),
     890
     891CS4236_DOUBLE_TLV("Capture Volume", 0,
     892                  CS4236_LEFT_MIX_CTRL, CS4236_RIGHT_MIX_CTRL, 5, 5, 3, 1,
     893                  db_scale_2bit),
     894
     895WSS_DOUBLE("PCM Playback Switch", 0,
     896                CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1),
     897WSS_DOUBLE("PCM Capture Switch", 0,
    816898                CS4236_DAC_MUTE, CS4236_DAC_MUTE, 7, 6, 1, 1),
    817 CS4236_MASTER_DIGITAL("Master Digital Volume", 0),
    818 
    819 WSS_DOUBLE("Master Digital Playback Switch", 1,
    820                 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 7, 7, 1, 1),
    821 WSS_DOUBLE("Master Digital Capture Switch", 1,
    822                 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 6, 6, 1, 1),
    823 WSS_DOUBLE("Master Digital Volume", 1,
    824                 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 0, 0, 31, 1),
    825 
    826 CS4236_DOUBLE("Capture Volume", 0,
    827                 CS4236_LEFT_MIX_CTRL, CS4236_RIGHT_MIX_CTRL, 5, 5, 3, 1),
    828 
    829 WSS_DOUBLE("PCM Switch", 0,
    830                 CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1),
    831 WSS_DOUBLE("PCM Volume", 0,
    832                 CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 0, 0, 63, 1),
     899WSS_DOUBLE_TLV("PCM Volume", 0,
     900                CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 0, 0, 63, 1,
     901                db_scale_6bit),
    833902
    834903CS4236_DOUBLE("DSP Switch", 0, CS4236_LEFT_DSP, CS4236_RIGHT_DSP, 7, 7, 1, 1),
     
    843912CS4236_DOUBLE("Mic Playback Switch", 0,
    844913                CS4236_LEFT_MIC, CS4236_RIGHT_MIC, 6, 6, 1, 1),
    845 CS4236_SINGLE("Mic Volume", 0, CS4236_LEFT_MIC, 0, 31, 1),
    846 CS4236_SINGLE("Mic Playback Boost", 0, CS4236_LEFT_MIC, 5, 1, 0),
    847 
    848 WSS_DOUBLE("Aux Playback Switch", 0,
     914CS4236_SINGLE_TLV("Mic Volume", 0, CS4236_LEFT_MIC, 0, 31, 1,
     915                  db_scale_5bit_22db_max),
     916CS4236_SINGLE("Mic Boost (+20dB)", 0, CS4236_LEFT_MIC, 5, 1, 0),
     917
     918WSS_DOUBLE("Line Playback Switch", 0,
    849919                CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 7, 7, 1, 1),
    850 WSS_DOUBLE("Aux Capture Switch", 0,
     920WSS_DOUBLE("Line Capture Switch", 0,
    851921                CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 6, 6, 1, 1),
    852 WSS_DOUBLE("Aux Volume", 0,
    853                 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 0, 0, 31, 1),
    854 
    855 WSS_DOUBLE("Aux Playback Switch", 1,
     922WSS_DOUBLE_TLV("Line Volume", 0,
     923                CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 0, 0, 31, 1,
     924                db_scale_5bit_12db_max),
     925
     926WSS_DOUBLE("CD Playback Switch", 1,
    856927                CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 7, 7, 1, 1),
    857 WSS_DOUBLE("Aux Capture Switch", 1,
     928WSS_DOUBLE("CD Capture Switch", 1,
    858929                CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 6, 6, 1, 1),
    859 WSS_DOUBLE("Aux Volume", 1,
    860                 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 0, 0, 31, 1),
    861 
    862 CS4236_DOUBLE1("Master Mono Switch", 0,
    863                 CS4231_MONO_CTRL, CS4236_RIGHT_MIX_CTRL, 6, 7, 1, 1),
    864 
    865 CS4236_DOUBLE1("Mono Switch", 0,
     930WSS_DOUBLE_TLV("CD Volume", 1,
     931                CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 0, 0, 31, 1,
     932                db_scale_5bit_12db_max),
     933
     934CS4236_DOUBLE1("Beep Playback Switch", 0,
    866935                CS4231_MONO_CTRL, CS4236_LEFT_MIX_CTRL, 7, 7, 1, 1),
    867 WSS_SINGLE("Mono Volume", 0, CS4231_MONO_CTRL, 0, 15, 1),
     936WSS_SINGLE("Beep Playback Volume", 0, CS4231_MONO_CTRL, 0, 15, 1),
    868937
    869938WSS_DOUBLE("Analog Loopback Switch", 0,
Note: See TracChangeset for help on using the changeset viewer.