--- ali5451.c 2003-05-18 06:23:21.000000000 -0400 +++ ali5451_terse.c 2003-05-18 06:17:18.000000000 -0400 @@ -673,10 +673,11 @@ // recording if (rec) { - if (inl(ALI_REG(codec, ALI_GLOBAL_CONTROL)) & (1<<11) && + /*JPL SPDIF if (inl(ALI_REG(codec, ALI_GLOBAL_CONTROL)) & (1<<11) && ( codec->revision == ALI_5451_V02 )) idx = ALI_SPDIF_IN_CHANNEL; else + JPL SPDIF */ idx = ALI_PCM_IN_CHANNEL; if ((result = snd_ali_alloc_pcm_channel(codec,idx)) >= 0) { @@ -688,6 +689,7 @@ } //playback... + /* JPL SPDIF if (inl(ALI_REG(codec, ALI_GLOBAL_CONTROL)) & (1<<15)) { idx = ALI_SPDIF_OUT_CHANNEL; if ((result = snd_ali_alloc_pcm_channel(codec,idx)) >= 0) { @@ -696,7 +698,7 @@ snd_printk("ali_find_free_channel: S/PDIF out channel is in busy now.\n"); } } - + JPL SPDIF */ for (idx = 0; idx < ALI_CHANNELS; idx++) { if ((result = snd_ali_alloc_pcm_channel(codec,idx)) >= 0) return result; @@ -748,6 +750,9 @@ static void snd_ali_delay(ali_t *codec,int interval) { unsigned long begintimer,currenttimer; + printk("In snd_ali_delay\n"); + /* + begintimer = inl(ALI_REG(codec, ALI_STIMER)); currenttimer = inl(ALI_REG(codec, ALI_STIMER)); @@ -757,6 +762,7 @@ break; currenttimer = inl(ALI_REG(codec, ALI_STIMER)); } + */ } static void snd_ali_detect_spdif_rate(ali_t *codec) @@ -764,6 +770,9 @@ u16 wval = 0; u16 count = 0; u8 bval = 0, R1 = 0, R2 = 0; + printk("In snd_ali_detect_spdif_rate\n"); + /* + bval = inb(ALI_REG(codec,ALI_SPDIF_CTRL + 1)); bval |= 0x1F; @@ -811,12 +820,15 @@ bval = inb(ALI_REG(codec,ALI_SPDIF_CS +3)) & 0xF0; outb(bval|0x03,ALI_REG(codec,ALI_SPDIF_CS + 3)); } + */ } static unsigned int snd_ali_get_spdif_in_rate(ali_t *codec) { u32 dwRate = 0; u8 bval = 0; + printk("In snd_ali_get_spdif_in_rate\n"); + /* bval = inb(ALI_REG(codec,ALI_SPDIF_CTRL)); bval &= 0x7F; @@ -827,7 +839,7 @@ bval = inb(ALI_REG(codec,ALI_SPDIF_CS + 3)); bval &= 0x0F; - + */ if (bval == 0) dwRate = 44100; if (bval == 1) dwRate = 48000; if (bval == 2) dwRate = 32000; @@ -838,6 +850,8 @@ static void snd_ali_enable_spdif_in(ali_t *codec) { unsigned int dwVal; + printk("In snd_ali_enable_spdif_in\n"); + /* dwVal = inl(ALI_REG(codec, ALI_GLOBAL_CONTROL)); dwVal |= 1<<11; @@ -848,6 +862,7 @@ outb(dwVal, ALI_REG(codec, ALI_SPDIF_CTRL)); snd_ali_enable_special_channel(codec, ALI_SPDIF_IN_CHANNEL); + */ } static void snd_ali_disable_spdif_in(ali_t *codec) @@ -866,7 +881,8 @@ { unsigned char bVal; unsigned int dwRate = 0; - + printk("In snd_ali_set_spdif_out_rate\n"); + /* if (rate == 32000) dwRate = 0x300; if (rate == 44100) dwRate = 0; if (rate == 48000) dwRate = 0x200; @@ -881,6 +897,7 @@ bVal &= (~0x80); //select left outb(bVal, ALI_REG(codec, ALI_SPDIF_CTRL)); outw(rate | 0x10, ALI_REG(codec, ALI_SPDIF_CS + 2)); + */ } static void snd_ali_enable_spdif_out(ali_t *codec) @@ -1756,6 +1773,10 @@ unsigned long flags; ali_t *codec = snd_magic_cast(ali_t, kcontrol->private_data, -ENXIO); unsigned int enable; + printk("In snd_ali5451_spdif_get\n"); + + /* + enable = ucontrol->value.integer.value[0] ? 1 : 0; @@ -1775,12 +1796,18 @@ } ucontrol->value.integer.value[0] = enable; spin_unlock_irqrestore(&codec->reg_lock, flags); + */ return 0; } static int snd_ali5451_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) { unsigned long flags; + printk("In snd_ali5451_spdif_put\n"); + return 0; + /* + + ali_t *codec = snd_magic_cast(ali_t, kcontrol->private_data, -ENXIO); unsigned int change = 0, enable = 0; @@ -1834,6 +1861,7 @@ spin_unlock_irqrestore(&codec->reg_lock, flags); return change; + */ } static snd_kcontrol_new_t snd_ali5451_mixer_spdif[] __devinitdata = { @@ -1867,12 +1895,14 @@ snd_printk("ali mixer creating error.\n"); return err; } + /* JPL SPDIF if (codec->revision == ALI_5451_V02) { for(idx = 0; idx < ARRAY_SIZE(snd_ali5451_mixer_spdif); idx++) { err=snd_ctl_add(codec->card, snd_ctl_new1(&snd_ali5451_mixer_spdif[idx], codec)); if (err < 0) return err; } } + */ return 0; } @@ -2039,11 +2069,12 @@ codec->ac97_ext_id = snd_ali_codec_peek(codec, 0, AC97_EXTENDED_ID); codec->ac97_ext_status = snd_ali_codec_peek(codec, 0, AC97_EXTENDED_STATUS); + /* JPL SPDIF if (codec->revision == ALI_5451_V02) { snd_ali_enable_spdif_out(codec); codec->spdif_mask = 0x00000002; } - + */ snd_ali_printk("chip initialize succeed.\n"); return 0;