Ignore:
Timestamp:
May 23, 2010, 10:17:06 PM (15 years ago)
Author:
David Azarewicz
Message:

Added quirk for Gateway 2000 ICH2/AD1885

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/alsa-kernel/pci/ac97/ac97_codec.c

    r426 r485  
    153153{ 0x49434511, 0xffffffff, "ICE1232",            NULL,           NULL }, // alias VIA VT1611A?
    154154{ 0x49434514, 0xffffffff, "ICE1232A",           NULL,           NULL },
    155 { 0x49434551, 0xffffffff, "VT1616",             patch_vt1616,   NULL }, 
     155{ 0x49434551, 0xffffffff, "VT1616",             patch_vt1616,   NULL },
    156156{ 0x49434552, 0xffffffff, "VT1616i",            patch_vt1616,   NULL }, // VT1616 compatible (chipset integrated)
    157157{ 0x49544520, 0xffffffff, "IT2226E",            NULL,           NULL },
     
    159159{ 0x4e534300, 0xffffffff, "LM4540,43,45,46,48", NULL,           NULL }, // only guess --jk
    160160{ 0x4e534331, 0xffffffff, "LM4549",             NULL,           NULL },
    161 { 0x4e534350, 0xffffffff, "LM4550",             patch_lm4550,   NULL }, // volume wrap fix 
     161{ 0x4e534350, 0xffffffff, "LM4550",             patch_lm4550,   NULL }, // volume wrap fix
    162162{ 0x50534304, 0xffffffff, "UCB1400",            patch_ucb1400,  NULL },
    163163{ 0x53494c20, 0xffffffe0, "Si3036,8",           mpatch_si3036,  mpatch_si3036, AC97_MODEM_PATCH },
     
    276276/**
    277277 * snd_ac97_read - read a value from the given register
    278  * 
     278 *
    279279 * @ac97: the ac97 instance
    280280 * @reg: the register to read
     
    624624};
    625625
    626 static const struct snd_kcontrol_new snd_ac97_control_capture_src = 
    627 AC97_ENUM("Capture Source", std_enum[0]); 
     626static const struct snd_kcontrol_new snd_ac97_control_capture_src =
     627AC97_ENUM("Capture Source", std_enum[0]);
    628628
    629629static const struct snd_kcontrol_new snd_ac97_control_capture_vol =
     
    692692        return 0;
    693693}
    694                        
     694
    695695static int snd_ac97_spdif_cmask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
    696696{
     
    704704        return 0;
    705705}
    706                        
     706
    707707static int snd_ac97_spdif_pmask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
    708708{
     
    727727        return 0;
    728728}
    729                        
     729
    730730static int snd_ac97_spdif_default_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
    731731{
     
    779779                v = new & (IEC958_AES0_CON_EMPHASIS_5015|IEC958_AES0_CON_NOT_COPYRIGHT) ? 0 : AC97_CXR_COPYRGT;
    780780                v |= new & IEC958_AES0_NONAUDIO ? AC97_CXR_SPDIF_AC3 : AC97_CXR_SPDIF_PCM;
    781                 change |= snd_ac97_update_bits_nolock(ac97, AC97_CXR_AUDIO_MISC, 
     781                change |= snd_ac97_update_bits_nolock(ac97, AC97_CXR_AUDIO_MISC,
    782782                                                      AC97_CXR_SPDIF_MASK | AC97_CXR_COPYRGT,
    783783                                                      v);
     
    13651365
    13661366        /* build center controls */
    1367         if ((snd_ac97_try_volume_mix(ac97, AC97_CENTER_LFE_MASTER)) 
     1367        if ((snd_ac97_try_volume_mix(ac97, AC97_CENTER_LFE_MASTER))
    13681368                && !(ac97->flags & AC97_AD_MULTI)) {
    13691369                if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_center[0], ac97))) < 0)
     
    13931393
    13941394        /* build surround controls */
    1395         if ((snd_ac97_try_volume_mix(ac97, AC97_SURROUND_MASTER)) 
     1395        if ((snd_ac97_try_volume_mix(ac97, AC97_SURROUND_MASTER))
    13961396                && !(ac97->flags & AC97_AD_MULTI)) {
    13971397                /* Surround Master (0x38) is with stereo mutes */
     
    14331433       
    14341434        /* build PC Speaker controls */
    1435         if (!(ac97->flags & AC97_HAS_NO_PC_BEEP) && 
     1435        if (!(ac97->flags & AC97_HAS_NO_PC_BEEP) &&
    14361436                ((ac97->flags & AC97_HAS_PC_BEEP) ||
    14371437            snd_ac97_try_volume_mix(ac97, AC97_PC_BEEP))) {
     
    18271827                    (! modem && ! (pid->flags & AC97_MODEM_PATCH)))
    18281828                        pid->patch(ac97);
    1829         } 
     1829        }
    18301830
    18311831        pid = look_for_codec_id(snd_ac97_codec_ids, id);
     
    19151915 * The ops table must include valid callbacks (at least read and
    19161916 * write).  The other callbacks, wait and reset, are not mandatory.
    1917  * 
     1917 *
    19181918 * The clock is set to 48000.  If another clock is needed, set
    19191919 * (*rbus)->clock manually.
     
    20192019 * The template must include the codec number (num) and address (addr),
    20202020 * and the private data (private_data).
    2021  * 
     2021 *
    20222022 * The ac97 instance is registered as a low-level device, so you don't
    20232023 * have to release it manually.
     
    27472747}
    27482748
    2749 static const struct snd_kcontrol_new snd_ac97_alc_jack_detect = 
     2749static const struct snd_kcontrol_new snd_ac97_alc_jack_detect =
    27502750AC97_SINGLE("Jack Detect", AC97_ALC650_CLOCK, 5, 1, 0);
    27512751
     
    29042904        int result;
    29052905
     2906        snd_printdd("ac97_tune_hardware quirk=%lx override=%s pci=(%04x:%04x %04x:%04x) ac97=(%04x:%04x)\n",
     2907                quirk, override,
     2908                ac97->pci->vendor, ac97->pci->device, ac97->pci->subsystem_vendor, ac97->pci->subsystem_device,         
     2909                ac97->subsystem_vendor, ac97->subsystem_device);
    29062910        /* quirk overriden? */
    29072911        if (override && strcmp(override, "-1") && strcmp(override, "default")) {
     2912                snd_printdd("ac97 quirk for %s (%04x:%04x)\n", override, ac97->subsystem_vendor, ac97->subsystem_device);
    29082913                result = apply_quirk_str(ac97, override);
    29092914                if (result < 0)
     
    29162921
    29172922        for (; quirk->subvendor; quirk++) {
    2918                 if (quirk->subvendor != ac97->subsystem_vendor)
    2919                         continue;
    2920                 if ((! quirk->mask && quirk->subdevice == ac97->subsystem_device) ||
    2921                     quirk->subdevice == (quirk->mask & ac97->subsystem_device)) {
    2922                         if (quirk->codec_id && quirk->codec_id != ac97->id)
    2923                                 continue;
    2924                         snd_printdd("ac97 quirk for %s (%04x:%04x)\n", quirk->name, ac97->subsystem_vendor, ac97->subsystem_device);
    2925                         result = apply_quirk(ac97, quirk->type);
    2926                         if (result < 0)
    2927                                 snd_printk(KERN_ERR "applying quirk type %d for %s failed (%d)\n", quirk->type, quirk->name, result);
    2928                         return result;
    2929                 }
     2923                if (quirk->subvendor != ac97->subsystem_vendor) continue;
     2924                /* DAZ - the comments in ac97_codec.h say that if mask=0 then 'accept all' but it appears not to be the way the code works.
     2925                 * it really is: if mask=0 then 'accept exact match only'
     2926                 * functionality not changed, I just made the code easier to read
     2927                 * if ((! quirk->mask && quirk->subdevice == ac97->subsystem_device) || quirk->subdevice == (quirk->mask & ac97->subsystem_device)) {
     2928                 */
     2929                if (quirk->mask) {
     2930                        if ( quirk->subdevice != (quirk->mask & ac97->subsystem_device) ) continue;
     2931                } else {
     2932                        if (quirk->subdevice != ac97->subsystem_device) continue;
     2933                }
     2934                if ( quirk->codec_id && (quirk->codec_id != ac97->id) ) continue;
     2935                snd_printdd("ac97 quirk for %s (%04x:%04x)\n", quirk->name, ac97->subsystem_vendor, ac97->subsystem_device);
     2936                result = apply_quirk(ac97, quirk->type);
     2937                if (result < 0) snd_printk(KERN_ERR "applying quirk type %d for %s failed (%d)\n", quirk->type, quirk->name, result);
     2938                return result;
    29302939        }
    29312940        return 0;
Note: See TracChangeset for help on using the changeset viewer.