Commit fffe138b authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update

D:2003/09/01 10:53:26
C:AC97 Codec Core
A:Takashi Iwai <tiwai@suse.de>
F:include/ac97_codec.h:1.33->1.34 
F:pci/ac97/ac97_patch.c:1.21->1.22 
F:pci/ac97/ac97_proc.c:1.1->1.2 
L:James Courtier-Dutton <James@superbug.demon.co.uk>:
L:- enabled SPDIF input of ALC650.
parent 92d4d9fc
...@@ -214,10 +214,45 @@ ...@@ -214,10 +214,45 @@
#define AC97_CXR_SPDIF_AC3 0x2 #define AC97_CXR_SPDIF_AC3 0x2
/* specific - ALC */ /* specific - ALC */
#define AC97_ALC650_SPDIF_INPUT_STATUS1 0x60
/* S/PDIF input status 1 bit defines */
#define AC97_ALC650_PRO 0x0001 /* Professional status */
#define AC97_ALC650_NAUDIO 0x0002 /* Non audio stream */
#define AC97_ALC650_COPY 0x0004 /* Copyright status */
#define AC97_ALC650_PRE 0x0038 /* Preemphasis status */
#define AC97_ALC650_PRE_SHIFT 3
#define AC97_ALC650_MODE 0x00C0 /* Preemphasis status */
#define AC97_ALC650_MODE_SHIFT 6
#define AC97_ALC650_CC_MASK 0x7f00 /* Category Code mask */
#define AC97_ALC650_CC_SHIFT 8
#define AC97_ALC650_L 0x8000 /* Generation Level status */
#define AC97_ALC650_SPDIF_INPUT_STATUS2 0x62
/* S/PDIF input status 2 bit defines */
#define AC97_ALC650_SOUCE_MASK 0x000f /* Source number */
#define AC97_ALC650_CHANNEL_MASK 0x00f0 /* Channel number */
#define AC97_ALC650_CHANNEL_SHIFT 4
#define AC97_ALC650_SPSR_MASK 0x0f00 /* S/PDIF Sample Rate bits */
#define AC97_ALC650_SPSR_SHIFT 8
#define AC97_ALC650_SPSR_44K 0x0000 /* Use 44.1kHz Sample rate */
#define AC97_ALC650_SPSR_48K 0x0200 /* Use 48kHz Sample rate */
#define AC97_ALC650_SPSR_32K 0x0300 /* Use 32kHz Sample rate */
#define AC97_ALC650_CLOCK_ACCURACY 0x3000 /* Clock accuracy */
#define AC97_ALC650_CLOCK_SHIFT 12
#define AC97_ALC650_CLOCK_LOCK 0x4000 /* Clock locked status */
#define AC97_ALC650_V 0x8000 /* Validity status */
#define AC97_ALC650_SURR_DAC_VOL 0x64 #define AC97_ALC650_SURR_DAC_VOL 0x64
#define AC97_ALC650_LFE_DAC_VOL 0x66 #define AC97_ALC650_LFE_DAC_VOL 0x66
#define AC97_ALC650_UNKNOWN1 0x68
#define AC97_ALC650_MULTICH 0x6a #define AC97_ALC650_MULTICH 0x6a
#define AC97_ALC650_UNKNOWN2 0x6c
#define AC97_ALC650_REVISION 0x6e #define AC97_ALC650_REVISION 0x6e
#define AC97_ALC650_UNKNOWN3 0x70
#define AC97_ALC650_UNKNOWN4 0x72
#define AC97_ALC650_MISC 0x74
#define AC97_ALC650_GPIO_SETUP 0x76
#define AC97_ALC650_GPIO_STATUS 0x78
#define AC97_ALC650_CLOCK 0x7a #define AC97_ALC650_CLOCK 0x7a
/* specific - Yamaha YMF753 */ /* specific - Yamaha YMF753 */
......
...@@ -915,6 +915,9 @@ int patch_alc650(ac97_t * ac97) ...@@ -915,6 +915,9 @@ int patch_alc650(ac97_t * ac97)
} }
if (spdif) { if (spdif) {
/* enable AC97_ALC650_GPIO_SETUP, AC97_ALC650_CLOCK for R/W */
snd_ac97_write_cache(ac97, AC97_ALC650_GPIO_STATUS,
snd_ac97_read(ac97, AC97_ALC650_GPIO_STATUS) | 0x8000);
/* enable spdif in */ /* enable spdif in */
snd_ac97_write_cache(ac97, AC97_ALC650_CLOCK, snd_ac97_write_cache(ac97, AC97_ALC650_CLOCK,
snd_ac97_read(ac97, AC97_ALC650_CLOCK) | 0x03); snd_ac97_read(ac97, AC97_ALC650_CLOCK) | 0x03);
...@@ -930,18 +933,18 @@ int patch_alc650(ac97_t * ac97) ...@@ -930,18 +933,18 @@ int patch_alc650(ac97_t * ac97)
int mic_off; int mic_off;
mic_off = snd_ac97_read(ac97, AC97_ALC650_MULTICH) & (1 << 10); mic_off = snd_ac97_read(ac97, AC97_ALC650_MULTICH) & (1 << 10);
/* GPIO0 direction */ /* GPIO0 direction */
val = snd_ac97_read(ac97, 0x76); val = snd_ac97_read(ac97, AC97_ALC650_GPIO_SETUP);
if (mic_off) if (mic_off)
val &= ~0x01; val &= ~0x01;
else else
val |= 0x01; val |= 0x01;
snd_ac97_write_cache(ac97, 0x76, val); snd_ac97_write_cache(ac97, AC97_ALC650_GPIO_SETUP, val);
val = snd_ac97_read(ac97, 0x78); val = snd_ac97_read(ac97, AC97_ALC650_GPIO_STATUS);
if (mic_off) if (mic_off)
val &= ~0x100; val &= ~0x100;
else else
val = val | 0x100; val = val | 0x100;
snd_ac97_write_cache(ac97, 0x78, val); snd_ac97_write_cache(ac97, AC97_ALC650_GPIO_STATUS, val);
} }
/* full DAC volume */ /* full DAC volume */
......
...@@ -151,7 +151,7 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in ...@@ -151,7 +151,7 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in
snd_iprintf(buffer, "SPDIF Control :%s%s%s%s Category=0x%x Generation=%i%s%s%s\n", snd_iprintf(buffer, "SPDIF Control :%s%s%s%s Category=0x%x Generation=%i%s%s%s\n",
val & AC97_SC_PRO ? " PRO" : " Consumer", val & AC97_SC_PRO ? " PRO" : " Consumer",
val & AC97_SC_NAUDIO ? " Non-audio" : " PCM", val & AC97_SC_NAUDIO ? " Non-audio" : " PCM",
val & AC97_SC_COPY ? " Copyright" : "", val & AC97_SC_COPY ? "" : " Copyright",
val & AC97_SC_PRE ? " Preemph50/15" : "", val & AC97_SC_PRE ? " Preemph50/15" : "",
(val & AC97_SC_CC_MASK) >> AC97_SC_CC_SHIFT, (val & AC97_SC_CC_MASK) >> AC97_SC_CC_SHIFT,
(val & AC97_SC_L) >> 11, (val & AC97_SC_L) >> 11,
...@@ -164,7 +164,31 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in ...@@ -164,7 +164,31 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in
(ac97->flags & AC97_CS_SPDIF) ? (ac97->flags & AC97_CS_SPDIF) ?
(val & AC97_SC_V ? " Enabled" : "") : (val & AC97_SC_V ? " Enabled" : "") :
(val & AC97_SC_V ? " Validity" : "")); (val & AC97_SC_V ? " Validity" : ""));
/* ALC650 specific*/
if ((ac97->id & 0xfffffff0) == 0x414c4720 &&
(snd_ac97_read(ac97, AC97_ALC650_CLOCK) & 0x01)) {
val = snd_ac97_read(ac97, AC97_ALC650_SPDIF_INPUT_STATUS2);
if (val & AC97_ALC650_CLOCK_LOCK) {
val = snd_ac97_read(ac97, AC97_ALC650_SPDIF_INPUT_STATUS1);
snd_iprintf(buffer, "SPDIF In Status :%s%s%s%s Category=0x%x Generation=%i",
val & AC97_ALC650_PRO ? " PRO" : " Consumer",
val & AC97_ALC650_NAUDIO ? " Non-audio" : " PCM",
val & AC97_ALC650_COPY ? "" : " Copyright",
val & AC97_ALC650_PRE ? " Preemph50/15" : "",
(val & AC97_ALC650_CC_MASK) >> AC97_ALC650_CC_SHIFT,
(val & AC97_ALC650_L) >> 15);
val = snd_ac97_read(ac97, AC97_ALC650_SPDIF_INPUT_STATUS2);
snd_iprintf(buffer, "%s Accuracy=%i%s%s\n",
spdif_rates[(val & AC97_ALC650_SPSR_MASK) >> AC97_ALC650_SPSR_SHIFT],
(val & AC97_ALC650_CLOCK_ACCURACY) >> AC97_ALC650_CLOCK_SHIFT,
(val & AC97_ALC650_CLOCK_LOCK ? " Locked" : " Unlocked"),
(val & AC97_ALC650_V ? " Validity?" : ""));
} else {
snd_iprintf(buffer, "SPDIF In Status : Not Locked\n");
}
} }
}
__modem: __modem:
mext = snd_ac97_read(ac97, AC97_EXTENDED_MID); mext = snd_ac97_read(ac97, AC97_EXTENDED_MID);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment