ac97_patch.c (ee71508e7359c16b43d6232e52cd19ec328e1f7c) ac97_patch.c (a5022b0dc6e45254437b75289e773876bb43e262)
1/*
2 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
3 * Universal interface for Audio Codec '97
4 *
5 * For more details look to AC '97 component specification revision 2.2
6 * by Intel Corporation (http://developer.intel.com) and to datasheets
7 * for specific codecs.
8 *

--- 2120 unchanged lines hidden (view full) ---

2129 .build_specific = patch_alc655_specific,
2130 .update_jacks = alc655_update_jacks
2131};
2132
2133int patch_alc655(ac97_t * ac97)
2134{
2135 unsigned int val;
2136
1/*
2 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
3 * Universal interface for Audio Codec '97
4 *
5 * For more details look to AC '97 component specification revision 2.2
6 * by Intel Corporation (http://developer.intel.com) and to datasheets
7 * for specific codecs.
8 *

--- 2120 unchanged lines hidden (view full) ---

2129 .build_specific = patch_alc655_specific,
2130 .update_jacks = alc655_update_jacks
2131};
2132
2133int patch_alc655(ac97_t * ac97)
2134{
2135 unsigned int val;
2136
2137 ac97->spec.dev_flags = (ac97->id == 0x414c4780); /* ALC658 */
2137 if (ac97->id == AC97_ID_ALC658) {
2138 ac97->spec.dev_flags = 1; /* ALC658 */
2139 if ((snd_ac97_read(ac97, AC97_ALC650_REVISION) & 0x3f) == 2) {
2140 ac97->id = AC97_ID_ALC658D;
2141 ac97->spec.dev_flags = 2;
2142 }
2143 }
2138
2139 ac97->build_ops = &patch_alc655_ops;
2140
2141 /* assume only page 0 for writing cache */
2142 snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, AC97_PAGE_VENDOR);
2143
2144 /* adjust default values */
2145 val = snd_ac97_read(ac97, 0x7a); /* misc control */
2144
2145 ac97->build_ops = &patch_alc655_ops;
2146
2147 /* assume only page 0 for writing cache */
2148 snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, AC97_PAGE_VENDOR);
2149
2150 /* adjust default values */
2151 val = snd_ac97_read(ac97, 0x7a); /* misc control */
2146 if (ac97->id == 0x414c4780) /* ALC658 */
2152 if (ac97->spec.dev_flags) /* ALC658 */
2147 val &= ~(1 << 1); /* Pin 47 is spdif input pin */
2148 else { /* ALC655 */
2149 if (ac97->subsystem_vendor == 0x1462 &&
2150 ac97->subsystem_device == 0x0131) /* MSI S270 laptop */
2151 val &= ~(1 << 1); /* Pin 47 is EAPD (for internal speaker) */
2152 else
2153 val |= (1 << 1); /* Pin 47 is spdif input pin */
2154 }

--- 4 unchanged lines hidden (view full) ---

2159 center on mic off, surround on line-in off
2160 duplicate front off
2161 */
2162 snd_ac97_write_cache(ac97, AC97_ALC650_MULTICH, 1<<15);
2163
2164 /* full DAC volume */
2165 snd_ac97_write_cache(ac97, AC97_ALC650_SURR_DAC_VOL, 0x0808);
2166 snd_ac97_write_cache(ac97, AC97_ALC650_LFE_DAC_VOL, 0x0808);
2153 val &= ~(1 << 1); /* Pin 47 is spdif input pin */
2154 else { /* ALC655 */
2155 if (ac97->subsystem_vendor == 0x1462 &&
2156 ac97->subsystem_device == 0x0131) /* MSI S270 laptop */
2157 val &= ~(1 << 1); /* Pin 47 is EAPD (for internal speaker) */
2158 else
2159 val |= (1 << 1); /* Pin 47 is spdif input pin */
2160 }

--- 4 unchanged lines hidden (view full) ---

2165 center on mic off, surround on line-in off
2166 duplicate front off
2167 */
2168 snd_ac97_write_cache(ac97, AC97_ALC650_MULTICH, 1<<15);
2169
2170 /* full DAC volume */
2171 snd_ac97_write_cache(ac97, AC97_ALC650_SURR_DAC_VOL, 0x0808);
2172 snd_ac97_write_cache(ac97, AC97_ALC650_LFE_DAC_VOL, 0x0808);
2173
2174 /* update undocumented bit... */
2175 if (ac97->id == AC97_ID_ALC658D)
2176 snd_ac97_update_bits(ac97, 0x74, 0x0800, 0x0800);
2177
2167 return 0;
2168}
2169
2170
2171#define AC97_ALC850_JACK_SELECT 0x76
2172#define AC97_ALC850_MISC1 0x7a
2173
2174static void alc850_update_jacks(ac97_t *ac97)

--- 583 unchanged lines hidden ---
2178 return 0;
2179}
2180
2181
2182#define AC97_ALC850_JACK_SELECT 0x76
2183#define AC97_ALC850_MISC1 0x7a
2184
2185static void alc850_update_jacks(ac97_t *ac97)

--- 583 unchanged lines hidden ---