diff options
author | Muli Ben-Yehuda <muli@il.ibm.com> | 2007-07-17 07:05:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-17 13:23:09 -0400 |
commit | d8f75b9183d613d3c29ea451a1cfb793daad5034 (patch) | |
tree | 11ca2fc177f57733f34eea35b5acd5c5c2275bcc | |
parent | b5b9068c1ef2ea760beb4962cf611b45bd303fb6 (diff) |
OSS trident: massive whitespace removal
Signed-off-by: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | sound/oss/trident.c | 358 |
1 files changed, 179 insertions, 179 deletions
diff --git a/sound/oss/trident.c b/sound/oss/trident.c index 3bc1f6e9e4a3..3e408f491927 100644 --- a/sound/oss/trident.c +++ b/sound/oss/trident.c | |||
@@ -11,12 +11,12 @@ | |||
11 | * Built from: | 11 | * Built from: |
12 | * Low level code: <audio@tridentmicro.com> from ALSA | 12 | * Low level code: <audio@tridentmicro.com> from ALSA |
13 | * Framework: Thomas Sailer <sailer@ife.ee.ethz.ch> | 13 | * Framework: Thomas Sailer <sailer@ife.ee.ethz.ch> |
14 | * Extended by: Zach Brown <zab@redhat.com> | 14 | * Extended by: Zach Brown <zab@redhat.com> |
15 | * | 15 | * |
16 | * Hacked up by: | 16 | * Hacked up by: |
17 | * Aaron Holtzman <aholtzma@ess.engr.uvic.ca> | 17 | * Aaron Holtzman <aholtzma@ess.engr.uvic.ca> |
18 | * Ollie Lho <ollie@sis.com.tw> SiS 7018 Audio Core Support | 18 | * Ollie Lho <ollie@sis.com.tw> SiS 7018 Audio Core Support |
19 | * Ching-Ling Lee <cling-li@ali.com.tw> ALi 5451 Audio Core Support | 19 | * Ching-Ling Lee <cling-li@ali.com.tw> ALi 5451 Audio Core Support |
20 | * Matt Wu <mattwu@acersoftech.com.cn> ALi 5451 Audio Core Support | 20 | * Matt Wu <mattwu@acersoftech.com.cn> ALi 5451 Audio Core Support |
21 | * Peter Wächtler <pwaechtler@loewe-komp.de> CyberPro5050 support | 21 | * Peter Wächtler <pwaechtler@loewe-komp.de> CyberPro5050 support |
22 | * Muli Ben-Yehuda <mulix@mulix.org> | 22 | * Muli Ben-Yehuda <mulix@mulix.org> |
@@ -54,33 +54,33 @@ | |||
54 | * adapt to new pci joystick attachment interface | 54 | * adapt to new pci joystick attachment interface |
55 | * v0.14.10f | 55 | * v0.14.10f |
56 | * July 24 2002 Muli Ben-Yehuda <mulix@actcom.co.il> | 56 | * July 24 2002 Muli Ben-Yehuda <mulix@actcom.co.il> |
57 | * patch from Eric Lemar (via Ian Soboroff): in suspend and resume, | 57 | * patch from Eric Lemar (via Ian Soboroff): in suspend and resume, |
58 | * fix wrong cast from pci_dev* to struct trident_card*. | 58 | * fix wrong cast from pci_dev* to struct trident_card*. |
59 | * v0.14.10e | 59 | * v0.14.10e |
60 | * July 19 2002 Muli Ben-Yehuda <mulix@actcom.co.il> | 60 | * July 19 2002 Muli Ben-Yehuda <mulix@actcom.co.il> |
61 | * rewrite the DMA buffer allocation/deallcoation functions, to make it | 61 | * rewrite the DMA buffer allocation/deallcoation functions, to make it |
62 | * modular and fix a bug where we would call free_pages on memory | 62 | * modular and fix a bug where we would call free_pages on memory |
63 | * obtained with pci_alloc_consistent. Also remove unnecessary #ifdef | 63 | * obtained with pci_alloc_consistent. Also remove unnecessary #ifdef |
64 | * CONFIG_PROC_FS and various other cleanups. | 64 | * CONFIG_PROC_FS and various other cleanups. |
65 | * v0.14.10d | 65 | * v0.14.10d |
66 | * July 19 2002 Muli Ben-Yehuda <mulix@actcom.co.il> | 66 | * July 19 2002 Muli Ben-Yehuda <mulix@actcom.co.il> |
67 | * made several printk(KERN_NOTICE...) into TRDBG(...), to avoid spamming | 67 | * made several printk(KERN_NOTICE...) into TRDBG(...), to avoid spamming |
68 | * my syslog with hundreds of messages. | 68 | * my syslog with hundreds of messages. |
69 | * v0.14.10c | 69 | * v0.14.10c |
70 | * July 16 2002 Muli Ben-Yehuda <mulix@actcom.co.il> | 70 | * July 16 2002 Muli Ben-Yehuda <mulix@actcom.co.il> |
71 | * Cleaned up Lei Hu's 0.4.10 driver to conform to Documentation/CodingStyle | 71 | * Cleaned up Lei Hu's 0.4.10 driver to conform to Documentation/CodingStyle |
72 | * and the coding style used in the rest of the file. | 72 | * and the coding style used in the rest of the file. |
73 | * v0.14.10b | 73 | * v0.14.10b |
74 | * June 23 2002 Muli Ben-Yehuda <mulix@actcom.co.il> | 74 | * June 23 2002 Muli Ben-Yehuda <mulix@actcom.co.il> |
75 | * add a missing unlock_set_fmt, remove a superflous lock/unlock pair | 75 | * add a missing unlock_set_fmt, remove a superflous lock/unlock pair |
76 | * with nothing in between. | 76 | * with nothing in between. |
77 | * v0.14.10a | 77 | * v0.14.10a |
78 | * June 21 2002 Muli Ben-Yehuda <mulix@actcom.co.il> | 78 | * June 21 2002 Muli Ben-Yehuda <mulix@actcom.co.il> |
79 | * use a debug macro instead of #ifdef CONFIG_DEBUG, trim to 80 columns | 79 | * use a debug macro instead of #ifdef CONFIG_DEBUG, trim to 80 columns |
80 | * per line, use 'do {} while (0)' in statement macros. | 80 | * per line, use 'do {} while (0)' in statement macros. |
81 | * v0.14.10 | 81 | * v0.14.10 |
82 | * June 6 2002 Lei Hu <Lei_hu@ali.com.tw> | 82 | * June 6 2002 Lei Hu <Lei_hu@ali.com.tw> |
83 | * rewrite the part to read/write registers of audio codec for Ali5451 | 83 | * rewrite the part to read/write registers of audio codec for Ali5451 |
84 | * v0.14.9e | 84 | * v0.14.9e |
85 | * January 2 2002 Vojtech Pavlik <vojtech@ucw.cz> added gameport | 85 | * January 2 2002 Vojtech Pavlik <vojtech@ucw.cz> added gameport |
86 | * support to avoid resource conflict with pcigame.c | 86 | * support to avoid resource conflict with pcigame.c |
@@ -111,7 +111,7 @@ | |||
111 | * Set EBUF1 and EBUF2 to still mode | 111 | * Set EBUF1 and EBUF2 to still mode |
112 | * Add dc97/ac97 reset function | 112 | * Add dc97/ac97 reset function |
113 | * Fix power management: ali_restore_regs | 113 | * Fix power management: ali_restore_regs |
114 | * unreleased | 114 | * unreleased |
115 | * Mar 09 2001 Matt Wu | 115 | * Mar 09 2001 Matt Wu |
116 | * Add cache for ac97 access | 116 | * Add cache for ac97 access |
117 | * v0.14.7 | 117 | * v0.14.7 |
@@ -120,7 +120,7 @@ | |||
120 | * Fix bug: an extra tail will be played when playing | 120 | * Fix bug: an extra tail will be played when playing |
121 | * Jan 05 2001 Matt Wu | 121 | * Jan 05 2001 Matt Wu |
122 | * Implement multi-channels and S/PDIF in support for ALi 1535+ | 122 | * Implement multi-channels and S/PDIF in support for ALi 1535+ |
123 | * v0.14.6 | 123 | * v0.14.6 |
124 | * Nov 1 2000 Ching-Ling Lee | 124 | * Nov 1 2000 Ching-Ling Lee |
125 | * Fix the bug of memory leak when switching 5.1-channels to 2 channels. | 125 | * Fix the bug of memory leak when switching 5.1-channels to 2 channels. |
126 | * Add lock protection into dynamic changing format of data. | 126 | * Add lock protection into dynamic changing format of data. |
@@ -138,7 +138,7 @@ | |||
138 | * v0.14.3 May 10 2000 Ollie Lho | 138 | * v0.14.3 May 10 2000 Ollie Lho |
139 | * fixed a small bug in trident_update_ptr, xmms 1.0.1 no longer uses 100% CPU | 139 | * fixed a small bug in trident_update_ptr, xmms 1.0.1 no longer uses 100% CPU |
140 | * v0.14.2 Mar 29 2000 Ching-Ling Lee | 140 | * v0.14.2 Mar 29 2000 Ching-Ling Lee |
141 | * Add clear to silence advance in trident_update_ptr | 141 | * Add clear to silence advance in trident_update_ptr |
142 | * fix invalid data of the end of the sound | 142 | * fix invalid data of the end of the sound |
143 | * v0.14.1 Mar 24 2000 Ching-Ling Lee | 143 | * v0.14.1 Mar 24 2000 Ching-Ling Lee |
144 | * ALi 5451 support added, playback and recording O.K. | 144 | * ALi 5451 support added, playback and recording O.K. |
@@ -178,7 +178,7 @@ | |||
178 | * SiS 7018 support added, playback O.K. | 178 | * SiS 7018 support added, playback O.K. |
179 | * v0.01 Alan Cox et. al. | 179 | * v0.01 Alan Cox et. al. |
180 | * Initial Release in kernel 2.3.30, does not work | 180 | * Initial Release in kernel 2.3.30, does not work |
181 | * | 181 | * |
182 | * ToDo | 182 | * ToDo |
183 | * Clean up of low level channel register access code. (done) | 183 | * Clean up of low level channel register access code. (done) |
184 | * Fix the bug on dma buffer management in update_ptr, read/write, drain_dac (done) | 184 | * Fix the bug on dma buffer management in update_ptr, read/write, drain_dac (done) |
@@ -326,7 +326,7 @@ struct trident_state { | |||
326 | 326 | ||
327 | unsigned error; /* number of over/underruns */ | 327 | unsigned error; /* number of over/underruns */ |
328 | /* put process on wait queue when no more space in buffer */ | 328 | /* put process on wait queue when no more space in buffer */ |
329 | wait_queue_head_t wait; | 329 | wait_queue_head_t wait; |
330 | 330 | ||
331 | /* redundant, but makes calculations easier */ | 331 | /* redundant, but makes calculations easier */ |
332 | unsigned fragsize; | 332 | unsigned fragsize; |
@@ -358,7 +358,7 @@ struct trident_state { | |||
358 | struct trident_channel { | 358 | struct trident_channel { |
359 | int num; /* channel number */ | 359 | int num; /* channel number */ |
360 | u32 lba; /* Loop Begine Address, where dma buffer starts */ | 360 | u32 lba; /* Loop Begine Address, where dma buffer starts */ |
361 | u32 eso; /* End Sample Offset, wehre dma buffer ends */ | 361 | u32 eso; /* End Sample Offset, wehre dma buffer ends */ |
362 | /* (in the unit of samples) */ | 362 | /* (in the unit of samples) */ |
363 | u32 delta; /* delta value, sample rate / 48k for playback, */ | 363 | u32 delta; /* delta value, sample rate / 48k for playback, */ |
364 | /* 48k/sample rate for recording */ | 364 | /* 48k/sample rate for recording */ |
@@ -417,7 +417,7 @@ struct trident_card { | |||
417 | /* soundcore stuff */ | 417 | /* soundcore stuff */ |
418 | int dev_audio; | 418 | int dev_audio; |
419 | 419 | ||
420 | /* structures for abstraction of hardware facilities, codecs, */ | 420 | /* structures for abstraction of hardware facilities, codecs, */ |
421 | /* banks and channels */ | 421 | /* banks and channels */ |
422 | struct ac97_codec *ac97_codec[NR_AC97]; | 422 | struct ac97_codec *ac97_codec[NR_AC97]; |
423 | struct trident_pcm_bank banks[NR_BANKS]; | 423 | struct trident_pcm_bank banks[NR_BANKS]; |
@@ -479,7 +479,7 @@ static void trident_ac97_set(struct ac97_codec *codec, u8 reg, u16 val); | |||
479 | static u16 trident_ac97_get(struct ac97_codec *codec, u8 reg); | 479 | static u16 trident_ac97_get(struct ac97_codec *codec, u8 reg); |
480 | 480 | ||
481 | static int trident_open_mixdev(struct inode *inode, struct file *file); | 481 | static int trident_open_mixdev(struct inode *inode, struct file *file); |
482 | static int trident_ioctl_mixdev(struct inode *inode, struct file *file, | 482 | static int trident_ioctl_mixdev(struct inode *inode, struct file *file, |
483 | unsigned int cmd, unsigned long arg); | 483 | unsigned int cmd, unsigned long arg); |
484 | 484 | ||
485 | static void ali_ac97_set(struct trident_card *card, int secondary, u8 reg, u16 val); | 485 | static void ali_ac97_set(struct trident_card *card, int secondary, u8 reg, u16 val); |
@@ -496,10 +496,10 @@ static void ali_disable_spdif_in(struct trident_card *card); | |||
496 | static void ali_disable_special_channel(struct trident_card *card, int ch); | 496 | static void ali_disable_special_channel(struct trident_card *card, int ch); |
497 | static void ali_setup_spdif_out(struct trident_card *card, int flag); | 497 | static void ali_setup_spdif_out(struct trident_card *card, int flag); |
498 | static int ali_write_5_1(struct trident_state *state, | 498 | static int ali_write_5_1(struct trident_state *state, |
499 | const char __user *buffer, | 499 | const char __user *buffer, |
500 | int cnt_for_multi_channel, unsigned int *copy_count, | 500 | int cnt_for_multi_channel, unsigned int *copy_count, |
501 | unsigned int *state_cnt); | 501 | unsigned int *state_cnt); |
502 | static int ali_allocate_other_states_resources(struct trident_state *state, | 502 | static int ali_allocate_other_states_resources(struct trident_state *state, |
503 | int chan_nums); | 503 | int chan_nums); |
504 | static void ali_free_other_states_resources(struct trident_state *state); | 504 | static void ali_free_other_states_resources(struct trident_state *state); |
505 | 505 | ||
@@ -722,7 +722,7 @@ trident_free_pcm_channel(struct trident_card *card, unsigned int channel) | |||
722 | if (channel < 31 || channel > 63) | 722 | if (channel < 31 || channel > 63) |
723 | return; | 723 | return; |
724 | 724 | ||
725 | if (card->pci_id == PCI_DEVICE_ID_TRIDENT_4DWAVE_DX || | 725 | if (card->pci_id == PCI_DEVICE_ID_TRIDENT_4DWAVE_DX || |
726 | card->pci_id == PCI_DEVICE_ID_TRIDENT_4DWAVE_NX) { | 726 | card->pci_id == PCI_DEVICE_ID_TRIDENT_4DWAVE_NX) { |
727 | b = inb(TRID_REG(card, T4D_REC_CH)); | 727 | b = inb(TRID_REG(card, T4D_REC_CH)); |
728 | if ((b & ~0x80) == channel) | 728 | if ((b & ~0x80) == channel) |
@@ -742,7 +742,7 @@ cyber_alloc_pcm_channel(struct trident_card *card) | |||
742 | int idx; | 742 | int idx; |
743 | 743 | ||
744 | /* The cyberpro 5050 has only 32 voices and one bank */ | 744 | /* The cyberpro 5050 has only 32 voices and one bank */ |
745 | /* .. at least they are not documented (if you want to call that | 745 | /* .. at least they are not documented (if you want to call that |
746 | * crap documentation), perhaps broken ? */ | 746 | * crap documentation), perhaps broken ? */ |
747 | 747 | ||
748 | bank = &card->banks[BANK_A]; | 748 | bank = &card->banks[BANK_A]; |
@@ -802,7 +802,7 @@ cyber_init_ritual(struct trident_card *card) | |||
802 | /* enable, if it was disabled */ | 802 | /* enable, if it was disabled */ |
803 | if ((portDat & CYBER_BMSK_AUENZ) != CYBER_BMSK_AUENZ_ENABLE) { | 803 | if ((portDat & CYBER_BMSK_AUENZ) != CYBER_BMSK_AUENZ_ENABLE) { |
804 | printk(KERN_INFO "cyberpro5050: enabling audio controller\n"); | 804 | printk(KERN_INFO "cyberpro5050: enabling audio controller\n"); |
805 | cyber_outidx(CYBER_PORT_AUDIO, CYBER_IDX_AUDIO_ENABLE, | 805 | cyber_outidx(CYBER_PORT_AUDIO, CYBER_IDX_AUDIO_ENABLE, |
806 | portDat | CYBER_BMSK_AUENZ_ENABLE); | 806 | portDat | CYBER_BMSK_AUENZ_ENABLE); |
807 | /* check again if hardware is enabled now */ | 807 | /* check again if hardware is enabled now */ |
808 | portDat = cyber_inidx(CYBER_PORT_AUDIO, CYBER_IDX_AUDIO_ENABLE); | 808 | portDat = cyber_inidx(CYBER_PORT_AUDIO, CYBER_IDX_AUDIO_ENABLE); |
@@ -811,7 +811,7 @@ cyber_init_ritual(struct trident_card *card) | |||
811 | printk(KERN_ERR "cyberpro5050: initAudioAccess: no success\n"); | 811 | printk(KERN_ERR "cyberpro5050: initAudioAccess: no success\n"); |
812 | ret = -1; | 812 | ret = -1; |
813 | } else { | 813 | } else { |
814 | cyber_outidx(CYBER_PORT_AUDIO, CYBER_IDX_IRQ_ENABLE, | 814 | cyber_outidx(CYBER_PORT_AUDIO, CYBER_IDX_IRQ_ENABLE, |
815 | CYBER_BMSK_AUDIO_INT_ENABLE); | 815 | CYBER_BMSK_AUDIO_INT_ENABLE); |
816 | cyber_outidx(CYBER_PORT_AUDIO, 0xbf, 0x01); | 816 | cyber_outidx(CYBER_PORT_AUDIO, 0xbf, 0x01); |
817 | cyber_outidx(CYBER_PORT_AUDIO, 0xba, 0x20); | 817 | cyber_outidx(CYBER_PORT_AUDIO, 0xba, 0x20); |
@@ -827,7 +827,7 @@ cyber_init_ritual(struct trident_card *card) | |||
827 | /* called with spin lock held */ | 827 | /* called with spin lock held */ |
828 | 828 | ||
829 | static int | 829 | static int |
830 | trident_load_channel_registers(struct trident_card *card, u32 * data, | 830 | trident_load_channel_registers(struct trident_card *card, u32 * data, |
831 | unsigned int channel) | 831 | unsigned int channel) |
832 | { | 832 | { |
833 | int i; | 833 | int i; |
@@ -845,7 +845,7 @@ trident_load_channel_registers(struct trident_card *card, u32 * data, | |||
845 | continue; | 845 | continue; |
846 | outl(data[i], TRID_REG(card, CHANNEL_START + 4 * i)); | 846 | outl(data[i], TRID_REG(card, CHANNEL_START + 4 * i)); |
847 | } | 847 | } |
848 | if (card->pci_id == PCI_DEVICE_ID_ALI_5451 || | 848 | if (card->pci_id == PCI_DEVICE_ID_ALI_5451 || |
849 | card->pci_id == PCI_DEVICE_ID_INTERG_5050) { | 849 | card->pci_id == PCI_DEVICE_ID_INTERG_5050) { |
850 | outl(ALI_EMOD_Still, TRID_REG(card, ALI_EBUF1)); | 850 | outl(ALI_EMOD_Still, TRID_REG(card, ALI_EBUF1)); |
851 | outl(ALI_EMOD_Still, TRID_REG(card, ALI_EBUF2)); | 851 | outl(ALI_EMOD_Still, TRID_REG(card, ALI_EBUF2)); |
@@ -884,7 +884,7 @@ trident_write_voice_regs(struct trident_state *state) | |||
884 | break; | 884 | break; |
885 | case PCI_DEVICE_ID_TRIDENT_4DWAVE_NX: | 885 | case PCI_DEVICE_ID_TRIDENT_4DWAVE_NX: |
886 | data[0] = (channel->delta << 24); | 886 | data[0] = (channel->delta << 24); |
887 | data[2] = ((channel->delta << 16) & 0xff000000) | | 887 | data[2] = ((channel->delta << 16) & 0xff000000) | |
888 | (channel->eso & 0x00ffffff); | 888 | (channel->eso & 0x00ffffff); |
889 | data[3] = channel->fm_vol & 0xffff; | 889 | data[3] = channel->fm_vol & 0xffff; |
890 | break; | 890 | break; |
@@ -989,13 +989,13 @@ trident_play_setup(struct trident_state *state) | |||
989 | if (state->card->pci_id != PCI_DEVICE_ID_SI_7018) { | 989 | if (state->card->pci_id != PCI_DEVICE_ID_SI_7018) { |
990 | channel->attribute = 0; | 990 | channel->attribute = 0; |
991 | if (state->card->pci_id == PCI_DEVICE_ID_ALI_5451) { | 991 | if (state->card->pci_id == PCI_DEVICE_ID_ALI_5451) { |
992 | if ((channel->num == ALI_SPDIF_IN_CHANNEL) || | 992 | if ((channel->num == ALI_SPDIF_IN_CHANNEL) || |
993 | (channel->num == ALI_PCM_IN_CHANNEL)) | 993 | (channel->num == ALI_PCM_IN_CHANNEL)) |
994 | ali_disable_special_channel(state->card, channel->num); | 994 | ali_disable_special_channel(state->card, channel->num); |
995 | else if ((inl(TRID_REG(state->card, ALI_GLOBAL_CONTROL)) | 995 | else if ((inl(TRID_REG(state->card, ALI_GLOBAL_CONTROL)) |
996 | & ALI_SPDIF_OUT_CH_ENABLE) | 996 | & ALI_SPDIF_OUT_CH_ENABLE) |
997 | && (channel->num == ALI_SPDIF_OUT_CHANNEL)) { | 997 | && (channel->num == ALI_SPDIF_OUT_CHANNEL)) { |
998 | ali_set_spdif_out_rate(state->card, | 998 | ali_set_spdif_out_rate(state->card, |
999 | state->dmabuf.rate); | 999 | state->dmabuf.rate); |
1000 | state->dmabuf.channel->delta = 0x1000; | 1000 | state->dmabuf.channel->delta = 0x1000; |
1001 | } | 1001 | } |
@@ -1063,7 +1063,7 @@ trident_rec_setup(struct trident_state *state) | |||
1063 | 1063 | ||
1064 | channel->lba = dmabuf->dma_handle; | 1064 | channel->lba = dmabuf->dma_handle; |
1065 | channel->delta = compute_rate_rec(dmabuf->rate); | 1065 | channel->delta = compute_rate_rec(dmabuf->rate); |
1066 | if ((card->pci_id == PCI_DEVICE_ID_ALI_5451) && | 1066 | if ((card->pci_id == PCI_DEVICE_ID_ALI_5451) && |
1067 | (channel->num == ALI_SPDIF_IN_CHANNEL)) { | 1067 | (channel->num == ALI_SPDIF_IN_CHANNEL)) { |
1068 | rate = ali_get_spdif_in_rate(card); | 1068 | rate = ali_get_spdif_in_rate(card); |
1069 | if (rate == 0) { | 1069 | if (rate == 0) { |
@@ -1180,8 +1180,8 @@ start_adc(struct trident_state *state) | |||
1180 | unsigned long flags; | 1180 | unsigned long flags; |
1181 | 1181 | ||
1182 | spin_lock_irqsave(&card->lock, flags); | 1182 | spin_lock_irqsave(&card->lock, flags); |
1183 | if ((dmabuf->mapped || | 1183 | if ((dmabuf->mapped || |
1184 | dmabuf->count < (signed) dmabuf->dmasize) && | 1184 | dmabuf->count < (signed) dmabuf->dmasize) && |
1185 | dmabuf->ready) { | 1185 | dmabuf->ready) { |
1186 | dmabuf->enable |= ADC_RUNNING; | 1186 | dmabuf->enable |= ADC_RUNNING; |
1187 | trident_enable_voice_irq(card, chan_num); | 1187 | trident_enable_voice_irq(card, chan_num); |
@@ -1261,7 +1261,7 @@ alloc_dmabuf(struct dmabuf *dmabuf, struct pci_dev *pci_dev, int order) | |||
1261 | void *rawbuf = NULL; | 1261 | void *rawbuf = NULL; |
1262 | struct page *page, *pend; | 1262 | struct page *page, *pend; |
1263 | 1263 | ||
1264 | if (!(rawbuf = pci_alloc_consistent(pci_dev, PAGE_SIZE << order, | 1264 | if (!(rawbuf = pci_alloc_consistent(pci_dev, PAGE_SIZE << order, |
1265 | &dmabuf->dma_handle))) | 1265 | &dmabuf->dma_handle))) |
1266 | return -ENOMEM; | 1266 | return -ENOMEM; |
1267 | 1267 | ||
@@ -1272,7 +1272,7 @@ alloc_dmabuf(struct dmabuf *dmabuf, struct pci_dev *pci_dev, int order) | |||
1272 | dmabuf->rawbuf = rawbuf; | 1272 | dmabuf->rawbuf = rawbuf; |
1273 | dmabuf->buforder = order; | 1273 | dmabuf->buforder = order; |
1274 | 1274 | ||
1275 | /* now mark the pages as reserved; otherwise */ | 1275 | /* now mark the pages as reserved; otherwise */ |
1276 | /* remap_pfn_range doesn't do what we want */ | 1276 | /* remap_pfn_range doesn't do what we want */ |
1277 | pend = virt_to_page(rawbuf + (PAGE_SIZE << order) - 1); | 1277 | pend = virt_to_page(rawbuf + (PAGE_SIZE << order) - 1); |
1278 | for (page = virt_to_page(rawbuf); page <= pend; page++) | 1278 | for (page = virt_to_page(rawbuf); page <= pend; page++) |
@@ -1310,7 +1310,7 @@ dealloc_dmabuf(struct dmabuf *dmabuf, struct pci_dev *pci_dev) | |||
1310 | pend = virt_to_page(dmabuf->rawbuf + (PAGE_SIZE << dmabuf->buforder) - 1); | 1310 | pend = virt_to_page(dmabuf->rawbuf + (PAGE_SIZE << dmabuf->buforder) - 1); |
1311 | for (page = virt_to_page(dmabuf->rawbuf); page <= pend; page++) | 1311 | for (page = virt_to_page(dmabuf->rawbuf); page <= pend; page++) |
1312 | ClearPageReserved(page); | 1312 | ClearPageReserved(page); |
1313 | pci_free_consistent(pci_dev, PAGE_SIZE << dmabuf->buforder, | 1313 | pci_free_consistent(pci_dev, PAGE_SIZE << dmabuf->buforder, |
1314 | dmabuf->rawbuf, dmabuf->dma_handle); | 1314 | dmabuf->rawbuf, dmabuf->dma_handle); |
1315 | dmabuf->rawbuf = NULL; | 1315 | dmabuf->rawbuf = NULL; |
1316 | } | 1316 | } |
@@ -1368,7 +1368,7 @@ prog_dmabuf(struct trident_state *state, enum dmabuf_mode rec) | |||
1368 | dealloc_dmabuf(&state->dmabuf, state->card->pci_dev); | 1368 | dealloc_dmabuf(&state->dmabuf, state->card->pci_dev); |
1369 | /* release the auxiliary DMA buffers */ | 1369 | /* release the auxiliary DMA buffers */ |
1370 | for (i -= 2; i >= 0; i--) | 1370 | for (i -= 2; i >= 0; i--) |
1371 | dealloc_dmabuf(&state->other_states[i]->dmabuf, | 1371 | dealloc_dmabuf(&state->other_states[i]->dmabuf, |
1372 | state->card->pci_dev); | 1372 | state->card->pci_dev); |
1373 | unlock_set_fmt(state); | 1373 | unlock_set_fmt(state); |
1374 | return ret; | 1374 | return ret; |
@@ -1398,7 +1398,7 @@ prog_dmabuf(struct trident_state *state, enum dmabuf_mode rec) | |||
1398 | dmabuf->fragsamples = dmabuf->fragsize >> sample_shift[dmabuf->fmt]; | 1398 | dmabuf->fragsamples = dmabuf->fragsize >> sample_shift[dmabuf->fmt]; |
1399 | dmabuf->dmasize = dmabuf->numfrag << dmabuf->fragshift; | 1399 | dmabuf->dmasize = dmabuf->numfrag << dmabuf->fragshift; |
1400 | 1400 | ||
1401 | memset(dmabuf->rawbuf, (dmabuf->fmt & TRIDENT_FMT_16BIT) ? 0 : 0x80, | 1401 | memset(dmabuf->rawbuf, (dmabuf->fmt & TRIDENT_FMT_16BIT) ? 0 : 0x80, |
1402 | dmabuf->dmasize); | 1402 | dmabuf->dmasize); |
1403 | 1403 | ||
1404 | spin_lock_irqsave(&s->card->lock, flags); | 1404 | spin_lock_irqsave(&s->card->lock, flags); |
@@ -1453,7 +1453,7 @@ trident_clear_tail(struct trident_state *state) | |||
1453 | swptr = dmabuf->swptr; | 1453 | swptr = dmabuf->swptr; |
1454 | spin_unlock_irqrestore(&state->card->lock, flags); | 1454 | spin_unlock_irqrestore(&state->card->lock, flags); |
1455 | 1455 | ||
1456 | if (swptr == 0 || swptr == dmabuf->dmasize / 2 || | 1456 | if (swptr == 0 || swptr == dmabuf->dmasize / 2 || |
1457 | swptr == dmabuf->dmasize) | 1457 | swptr == dmabuf->dmasize) |
1458 | return; | 1458 | return; |
1459 | 1459 | ||
@@ -1511,7 +1511,7 @@ drain_dac(struct trident_state *state, int nonblock) | |||
1511 | 1511 | ||
1512 | /* No matter how much data is left in the buffer, we have to wait until | 1512 | /* No matter how much data is left in the buffer, we have to wait until |
1513 | CSO == ESO/2 or CSO == ESO when address engine interrupts */ | 1513 | CSO == ESO/2 or CSO == ESO when address engine interrupts */ |
1514 | if (state->card->pci_id == PCI_DEVICE_ID_ALI_5451 || | 1514 | if (state->card->pci_id == PCI_DEVICE_ID_ALI_5451 || |
1515 | state->card->pci_id == PCI_DEVICE_ID_INTERG_5050) { | 1515 | state->card->pci_id == PCI_DEVICE_ID_INTERG_5050) { |
1516 | diff = dmabuf->swptr - trident_get_dma_addr(state) + dmabuf->dmasize; | 1516 | diff = dmabuf->swptr - trident_get_dma_addr(state) + dmabuf->dmasize; |
1517 | diff = diff % (dmabuf->dmasize); | 1517 | diff = diff % (dmabuf->dmasize); |
@@ -1532,7 +1532,7 @@ drain_dac(struct trident_state *state, int nonblock) | |||
1532 | return 0; | 1532 | return 0; |
1533 | } | 1533 | } |
1534 | 1534 | ||
1535 | /* update buffer manangement pointers, especially, */ | 1535 | /* update buffer manangement pointers, especially, */ |
1536 | /* dmabuf->count and dmabuf->hwptr */ | 1536 | /* dmabuf->count and dmabuf->hwptr */ |
1537 | static void | 1537 | static void |
1538 | trident_update_ptr(struct trident_state *state) | 1538 | trident_update_ptr(struct trident_state *state) |
@@ -1559,11 +1559,11 @@ trident_update_ptr(struct trident_state *state) | |||
1559 | } else { | 1559 | } else { |
1560 | dmabuf->count += diff; | 1560 | dmabuf->count += diff; |
1561 | 1561 | ||
1562 | if (dmabuf->count < 0 || | 1562 | if (dmabuf->count < 0 || |
1563 | dmabuf->count > dmabuf->dmasize) { | 1563 | dmabuf->count > dmabuf->dmasize) { |
1564 | /* buffer underrun or buffer overrun, */ | 1564 | /* buffer underrun or buffer overrun, */ |
1565 | /* we have no way to recover it here, just */ | 1565 | /* we have no way to recover it here, just */ |
1566 | /* stop the machine and let the process */ | 1566 | /* stop the machine and let the process */ |
1567 | /* force hwptr and swptr to sync */ | 1567 | /* force hwptr and swptr to sync */ |
1568 | __stop_adc(state); | 1568 | __stop_adc(state); |
1569 | dmabuf->error++; | 1569 | dmabuf->error++; |
@@ -1582,7 +1582,7 @@ trident_update_ptr(struct trident_state *state) | |||
1582 | } else { | 1582 | } else { |
1583 | dmabuf->count -= diff; | 1583 | dmabuf->count -= diff; |
1584 | 1584 | ||
1585 | if (dmabuf->count < 0 || | 1585 | if (dmabuf->count < 0 || |
1586 | dmabuf->count > dmabuf->dmasize) { | 1586 | dmabuf->count > dmabuf->dmasize) { |
1587 | /* buffer underrun or buffer overrun, we have no way to recover | 1587 | /* buffer underrun or buffer overrun, we have no way to recover |
1588 | it here, just stop the machine and let the process force hwptr | 1588 | it here, just stop the machine and let the process force hwptr |
@@ -1608,13 +1608,13 @@ trident_update_ptr(struct trident_state *state) | |||
1608 | if (state->chans_num == 6) { | 1608 | if (state->chans_num == 6) { |
1609 | clear_cnt = clear_cnt / 2; | 1609 | clear_cnt = clear_cnt / 2; |
1610 | swptr = swptr / 2; | 1610 | swptr = swptr / 2; |
1611 | memset(state->other_states[0]->dmabuf.rawbuf + swptr, | 1611 | memset(state->other_states[0]->dmabuf.rawbuf + swptr, |
1612 | silence, clear_cnt); | 1612 | silence, clear_cnt); |
1613 | memset(state->other_states[1]->dmabuf.rawbuf + swptr, | 1613 | memset(state->other_states[1]->dmabuf.rawbuf + swptr, |
1614 | silence, clear_cnt); | 1614 | silence, clear_cnt); |
1615 | memset(state->other_states[2]->dmabuf.rawbuf + swptr, | 1615 | memset(state->other_states[2]->dmabuf.rawbuf + swptr, |
1616 | silence, clear_cnt); | 1616 | silence, clear_cnt); |
1617 | memset(state->other_states[3]->dmabuf.rawbuf + swptr, | 1617 | memset(state->other_states[3]->dmabuf.rawbuf + swptr, |
1618 | silence, clear_cnt); | 1618 | silence, clear_cnt); |
1619 | } | 1619 | } |
1620 | dmabuf->endcleared = 1; | 1620 | dmabuf->endcleared = 1; |
@@ -1627,13 +1627,13 @@ trident_update_ptr(struct trident_state *state) | |||
1627 | if (state->chans_num == 6) { | 1627 | if (state->chans_num == 6) { |
1628 | clear_cnt = clear_cnt / 2; | 1628 | clear_cnt = clear_cnt / 2; |
1629 | swptr = swptr / 2; | 1629 | swptr = swptr / 2; |
1630 | memset(state->other_states[0]->dmabuf.rawbuf + swptr, | 1630 | memset(state->other_states[0]->dmabuf.rawbuf + swptr, |
1631 | silence, clear_cnt); | 1631 | silence, clear_cnt); |
1632 | memset(state->other_states[1]->dmabuf.rawbuf + swptr, | 1632 | memset(state->other_states[1]->dmabuf.rawbuf + swptr, |
1633 | silence, clear_cnt); | 1633 | silence, clear_cnt); |
1634 | memset(state->other_states[2]->dmabuf.rawbuf + swptr, | 1634 | memset(state->other_states[2]->dmabuf.rawbuf + swptr, |
1635 | silence, clear_cnt); | 1635 | silence, clear_cnt); |
1636 | memset(state->other_states[3]->dmabuf.rawbuf + swptr, | 1636 | memset(state->other_states[3]->dmabuf.rawbuf + swptr, |
1637 | silence, clear_cnt); | 1637 | silence, clear_cnt); |
1638 | } | 1638 | } |
1639 | dmabuf->endcleared = 1; | 1639 | dmabuf->endcleared = 1; |
@@ -1665,7 +1665,7 @@ trident_address_interrupt(struct trident_card *card) | |||
1665 | if ((state = card->states[i]) != NULL) { | 1665 | if ((state = card->states[i]) != NULL) { |
1666 | trident_update_ptr(state); | 1666 | trident_update_ptr(state); |
1667 | } else { | 1667 | } else { |
1668 | printk(KERN_WARNING "trident: spurious channel " | 1668 | printk(KERN_WARNING "trident: spurious channel " |
1669 | "irq %d.\n", channel); | 1669 | "irq %d.\n", channel); |
1670 | trident_stop_voice(card, channel); | 1670 | trident_stop_voice(card, channel); |
1671 | trident_disable_voice_irq(card, channel); | 1671 | trident_disable_voice_irq(card, channel); |
@@ -1694,7 +1694,7 @@ ali_hwvol_control(struct trident_card *card, int opt) | |||
1694 | 1694 | ||
1695 | if (opt == 1) { // MUTE | 1695 | if (opt == 1) { // MUTE |
1696 | dwTemp ^= 0x8000; | 1696 | dwTemp ^= 0x8000; |
1697 | ali_ac97_write(card->ac97_codec[0], | 1697 | ali_ac97_write(card->ac97_codec[0], |
1698 | 0x02, dwTemp); | 1698 | 0x02, dwTemp); |
1699 | } else if (opt == 2) { // Down | 1699 | } else if (opt == 2) { // Down |
1700 | if (mute) | 1700 | if (mute) |
@@ -1706,7 +1706,7 @@ ali_hwvol_control(struct trident_card *card, int opt) | |||
1706 | dwTemp &= 0xe0e0; | 1706 | dwTemp &= 0xe0e0; |
1707 | dwTemp |= (volume[0]) | (volume[1] << 8); | 1707 | dwTemp |= (volume[0]) | (volume[1] << 8); |
1708 | ali_ac97_write(card->ac97_codec[0], 0x02, dwTemp); | 1708 | ali_ac97_write(card->ac97_codec[0], 0x02, dwTemp); |
1709 | card->ac97_codec[0]->mixer_state[0] = ((32 - volume[0]) * 25 / 8) | | 1709 | card->ac97_codec[0]->mixer_state[0] = ((32 - volume[0]) * 25 / 8) | |
1710 | (((32 - volume[1]) * 25 / 8) << 8); | 1710 | (((32 - volume[1]) * 25 / 8) << 8); |
1711 | } else if (opt == 4) { // Up | 1711 | } else if (opt == 4) { // Up |
1712 | if (mute) | 1712 | if (mute) |
@@ -1718,7 +1718,7 @@ ali_hwvol_control(struct trident_card *card, int opt) | |||
1718 | dwTemp &= 0xe0e0; | 1718 | dwTemp &= 0xe0e0; |
1719 | dwTemp |= (volume[0]) | (volume[1] << 8); | 1719 | dwTemp |= (volume[0]) | (volume[1] << 8); |
1720 | ali_ac97_write(card->ac97_codec[0], 0x02, dwTemp); | 1720 | ali_ac97_write(card->ac97_codec[0], 0x02, dwTemp); |
1721 | card->ac97_codec[0]->mixer_state[0] = ((32 - volume[0]) * 25 / 8) | | 1721 | card->ac97_codec[0]->mixer_state[0] = ((32 - volume[0]) * 25 / 8) | |
1722 | (((32 - volume[1]) * 25 / 8) << 8); | 1722 | (((32 - volume[1]) * 25 / 8) << 8); |
1723 | } else { | 1723 | } else { |
1724 | /* Nothing needs doing */ | 1724 | /* Nothing needs doing */ |
@@ -1801,7 +1801,7 @@ cyber_address_interrupt(struct trident_card *card) | |||
1801 | if ((state = card->states[i]) != NULL) { | 1801 | if ((state = card->states[i]) != NULL) { |
1802 | trident_update_ptr(state); | 1802 | trident_update_ptr(state); |
1803 | } else { | 1803 | } else { |
1804 | printk(KERN_WARNING "cyber5050: spurious " | 1804 | printk(KERN_WARNING "cyber5050: spurious " |
1805 | "channel irq %d.\n", channel); | 1805 | "channel irq %d.\n", channel); |
1806 | trident_stop_voice(card, channel); | 1806 | trident_stop_voice(card, channel); |
1807 | trident_disable_voice_irq(card, channel); | 1807 | trident_disable_voice_irq(card, channel); |
@@ -1836,21 +1836,21 @@ trident_interrupt(int irq, void *dev_id) | |||
1836 | ali_queue_task(card, gpio & 0x07); | 1836 | ali_queue_task(card, gpio & 0x07); |
1837 | } | 1837 | } |
1838 | event = inl(TRID_REG(card, T4D_MISCINT)); | 1838 | event = inl(TRID_REG(card, T4D_MISCINT)); |
1839 | outl(event | (ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), | 1839 | outl(event | (ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), |
1840 | TRID_REG(card, T4D_MISCINT)); | 1840 | TRID_REG(card, T4D_MISCINT)); |
1841 | spin_unlock(&card->lock); | 1841 | spin_unlock(&card->lock); |
1842 | return IRQ_HANDLED; | 1842 | return IRQ_HANDLED; |
1843 | } | 1843 | } |
1844 | 1844 | ||
1845 | /* manually clear interrupt status, bad hardware design, blame T^2 */ | 1845 | /* manually clear interrupt status, bad hardware design, blame T^2 */ |
1846 | outl((ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), | 1846 | outl((ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), |
1847 | TRID_REG(card, T4D_MISCINT)); | 1847 | TRID_REG(card, T4D_MISCINT)); |
1848 | spin_unlock(&card->lock); | 1848 | spin_unlock(&card->lock); |
1849 | return IRQ_HANDLED; | 1849 | return IRQ_HANDLED; |
1850 | } | 1850 | } |
1851 | 1851 | ||
1852 | /* in this loop, dmabuf.count signifies the amount of data that is waiting */ | 1852 | /* in this loop, dmabuf.count signifies the amount of data that is waiting */ |
1853 | /* to be copied to the user's buffer. it is filled by the dma machine and */ | 1853 | /* to be copied to the user's buffer. it is filled by the dma machine and */ |
1854 | /* drained by this loop. */ | 1854 | /* drained by this loop. */ |
1855 | static ssize_t | 1855 | static ssize_t |
1856 | trident_read(struct file *file, char __user *buffer, size_t count, loff_t * ppos) | 1856 | trident_read(struct file *file, char __user *buffer, size_t count, loff_t * ppos) |
@@ -1878,8 +1878,8 @@ trident_read(struct file *file, char __user *buffer, size_t count, loff_t * ppos | |||
1878 | while (count > 0) { | 1878 | while (count > 0) { |
1879 | spin_lock_irqsave(&state->card->lock, flags); | 1879 | spin_lock_irqsave(&state->card->lock, flags); |
1880 | if (dmabuf->count > (signed) dmabuf->dmasize) { | 1880 | if (dmabuf->count > (signed) dmabuf->dmasize) { |
1881 | /* buffer overrun, we are recovering from */ | 1881 | /* buffer overrun, we are recovering from */ |
1882 | /* sleep_on_timeout, resync hwptr and swptr, */ | 1882 | /* sleep_on_timeout, resync hwptr and swptr, */ |
1883 | /* make process flush the buffer */ | 1883 | /* make process flush the buffer */ |
1884 | dmabuf->count = dmabuf->dmasize; | 1884 | dmabuf->count = dmabuf->dmasize; |
1885 | dmabuf->swptr = dmabuf->hwptr; | 1885 | dmabuf->swptr = dmabuf->hwptr; |
@@ -1894,7 +1894,7 @@ trident_read(struct file *file, char __user *buffer, size_t count, loff_t * ppos | |||
1894 | cnt = count; | 1894 | cnt = count; |
1895 | if (cnt <= 0) { | 1895 | if (cnt <= 0) { |
1896 | unsigned long tmo; | 1896 | unsigned long tmo; |
1897 | /* buffer is empty, start the dma machine and */ | 1897 | /* buffer is empty, start the dma machine and */ |
1898 | /* wait for data to be recorded */ | 1898 | /* wait for data to be recorded */ |
1899 | start_adc(state); | 1899 | start_adc(state); |
1900 | if (file->f_flags & O_NONBLOCK) { | 1900 | if (file->f_flags & O_NONBLOCK) { |
@@ -1904,8 +1904,8 @@ trident_read(struct file *file, char __user *buffer, size_t count, loff_t * ppos | |||
1904 | } | 1904 | } |
1905 | 1905 | ||
1906 | mutex_unlock(&state->sem); | 1906 | mutex_unlock(&state->sem); |
1907 | /* No matter how much space left in the buffer, */ | 1907 | /* No matter how much space left in the buffer, */ |
1908 | /* we have to wait until CSO == ESO/2 or CSO == ESO */ | 1908 | /* we have to wait until CSO == ESO/2 or CSO == ESO */ |
1909 | /* when address engine interrupts */ | 1909 | /* when address engine interrupts */ |
1910 | tmo = (dmabuf->dmasize * HZ) / (dmabuf->rate * 2); | 1910 | tmo = (dmabuf->dmasize * HZ) / (dmabuf->rate * 2); |
1911 | tmo >>= sample_shift[dmabuf->fmt]; | 1911 | tmo >>= sample_shift[dmabuf->fmt]; |
@@ -2005,7 +2005,7 @@ trident_write(struct file *file, const char __user *buffer, size_t count, loff_t | |||
2005 | while (count > 0) { | 2005 | while (count > 0) { |
2006 | spin_lock_irqsave(&state->card->lock, flags); | 2006 | spin_lock_irqsave(&state->card->lock, flags); |
2007 | if (dmabuf->count < 0) { | 2007 | if (dmabuf->count < 0) { |
2008 | /* buffer underrun, we are recovering from */ | 2008 | /* buffer underrun, we are recovering from */ |
2009 | /* sleep_on_timeout, resync hwptr and swptr */ | 2009 | /* sleep_on_timeout, resync hwptr and swptr */ |
2010 | dmabuf->count = 0; | 2010 | dmabuf->count = 0; |
2011 | dmabuf->swptr = dmabuf->hwptr; | 2011 | dmabuf->swptr = dmabuf->hwptr; |
@@ -2020,7 +2020,7 @@ trident_write(struct file *file, const char __user *buffer, size_t count, loff_t | |||
2020 | cnt = count; | 2020 | cnt = count; |
2021 | if (cnt <= 0) { | 2021 | if (cnt <= 0) { |
2022 | unsigned long tmo; | 2022 | unsigned long tmo; |
2023 | /* buffer is full, start the dma machine and */ | 2023 | /* buffer is full, start the dma machine and */ |
2024 | /* wait for data to be played */ | 2024 | /* wait for data to be played */ |
2025 | start_dac(state); | 2025 | start_dac(state); |
2026 | if (file->f_flags & O_NONBLOCK) { | 2026 | if (file->f_flags & O_NONBLOCK) { |
@@ -2028,8 +2028,8 @@ trident_write(struct file *file, const char __user *buffer, size_t count, loff_t | |||
2028 | ret = -EAGAIN; | 2028 | ret = -EAGAIN; |
2029 | goto out; | 2029 | goto out; |
2030 | } | 2030 | } |
2031 | /* No matter how much data left in the buffer, */ | 2031 | /* No matter how much data left in the buffer, */ |
2032 | /* we have to wait until CSO == ESO/2 or CSO == ESO */ | 2032 | /* we have to wait until CSO == ESO/2 or CSO == ESO */ |
2033 | /* when address engine interrupts */ | 2033 | /* when address engine interrupts */ |
2034 | lock_set_fmt(state); | 2034 | lock_set_fmt(state); |
2035 | tmo = (dmabuf->dmasize * HZ) / (dmabuf->rate * 2); | 2035 | tmo = (dmabuf->dmasize * HZ) / (dmabuf->rate * 2); |
@@ -2037,15 +2037,15 @@ trident_write(struct file *file, const char __user *buffer, size_t count, loff_t | |||
2037 | unlock_set_fmt(state); | 2037 | unlock_set_fmt(state); |
2038 | mutex_unlock(&state->sem); | 2038 | mutex_unlock(&state->sem); |
2039 | 2039 | ||
2040 | /* There are two situations when sleep_on_timeout */ | 2040 | /* There are two situations when sleep_on_timeout */ |
2041 | /* returns, one is when the interrupt is serviced */ | 2041 | /* returns, one is when the interrupt is serviced */ |
2042 | /* correctly and the process is waked up by ISR */ | 2042 | /* correctly and the process is waked up by ISR */ |
2043 | /* ON TIME. Another is when timeout is expired, which */ | 2043 | /* ON TIME. Another is when timeout is expired, which */ |
2044 | /* means that either interrupt is NOT serviced */ | 2044 | /* means that either interrupt is NOT serviced */ |
2045 | /* correctly (pending interrupt) or it is TOO LATE */ | 2045 | /* correctly (pending interrupt) or it is TOO LATE */ |
2046 | /* for the process to be scheduled to run */ | 2046 | /* for the process to be scheduled to run */ |
2047 | /* (scheduler latency) which results in a (potential) */ | 2047 | /* (scheduler latency) which results in a (potential) */ |
2048 | /* buffer underrun. And worse, there is NOTHING we */ | 2048 | /* buffer underrun. And worse, there is NOTHING we */ |
2049 | /* can do to prevent it. */ | 2049 | /* can do to prevent it. */ |
2050 | if (!interruptible_sleep_on_timeout(&dmabuf->wait, tmo)) { | 2050 | if (!interruptible_sleep_on_timeout(&dmabuf->wait, tmo)) { |
2051 | pr_debug(KERN_ERR "trident: playback schedule " | 2051 | pr_debug(KERN_ERR "trident: playback schedule " |
@@ -2054,8 +2054,8 @@ trident_write(struct file *file, const char __user *buffer, size_t count, loff_t | |||
2054 | dmabuf->fragsize, dmabuf->count, | 2054 | dmabuf->fragsize, dmabuf->count, |
2055 | dmabuf->hwptr, dmabuf->swptr); | 2055 | dmabuf->hwptr, dmabuf->swptr); |
2056 | 2056 | ||
2057 | /* a buffer underrun, we delay the recovery */ | 2057 | /* a buffer underrun, we delay the recovery */ |
2058 | /* until next time the while loop begin and */ | 2058 | /* until next time the while loop begin and */ |
2059 | /* we REALLY have data to play */ | 2059 | /* we REALLY have data to play */ |
2060 | } | 2060 | } |
2061 | if (signal_pending(current)) { | 2061 | if (signal_pending(current)) { |
@@ -2079,7 +2079,7 @@ trident_write(struct file *file, const char __user *buffer, size_t count, loff_t | |||
2079 | if (state->chans_num == 6) { | 2079 | if (state->chans_num == 6) { |
2080 | copy_count = 0; | 2080 | copy_count = 0; |
2081 | state_cnt = 0; | 2081 | state_cnt = 0; |
2082 | if (ali_write_5_1(state, buffer, cnt, ©_count, | 2082 | if (ali_write_5_1(state, buffer, cnt, ©_count, |
2083 | &state_cnt) == -EFAULT) { | 2083 | &state_cnt) == -EFAULT) { |
2084 | if (state_cnt) { | 2084 | if (state_cnt) { |
2085 | swptr = (swptr + state_cnt) % dmabuf->dmasize; | 2085 | swptr = (swptr + state_cnt) % dmabuf->dmasize; |
@@ -2096,7 +2096,7 @@ trident_write(struct file *file, const char __user *buffer, size_t count, loff_t | |||
2096 | goto out; | 2096 | goto out; |
2097 | } | 2097 | } |
2098 | } else { | 2098 | } else { |
2099 | if (copy_from_user(dmabuf->rawbuf + swptr, | 2099 | if (copy_from_user(dmabuf->rawbuf + swptr, |
2100 | buffer, cnt)) { | 2100 | buffer, cnt)) { |
2101 | if (!ret) | 2101 | if (!ret) |
2102 | ret = -EFAULT; | 2102 | ret = -EFAULT; |
@@ -2172,7 +2172,7 @@ trident_poll(struct file *file, struct poll_table_struct *wait) | |||
2172 | if (dmabuf->count >= (signed) dmabuf->fragsize) | 2172 | if (dmabuf->count >= (signed) dmabuf->fragsize) |
2173 | mask |= POLLOUT | POLLWRNORM; | 2173 | mask |= POLLOUT | POLLWRNORM; |
2174 | } else { | 2174 | } else { |
2175 | if ((signed) dmabuf->dmasize >= dmabuf->count + | 2175 | if ((signed) dmabuf->dmasize >= dmabuf->count + |
2176 | (signed) dmabuf->fragsize) | 2176 | (signed) dmabuf->fragsize) |
2177 | mask |= POLLOUT | POLLWRNORM; | 2177 | mask |= POLLOUT | POLLWRNORM; |
2178 | } | 2178 | } |
@@ -2227,7 +2227,7 @@ out: | |||
2227 | } | 2227 | } |
2228 | 2228 | ||
2229 | static int | 2229 | static int |
2230 | trident_ioctl(struct inode *inode, struct file *file, | 2230 | trident_ioctl(struct inode *inode, struct file *file, |
2231 | unsigned int cmd, unsigned long arg) | 2231 | unsigned int cmd, unsigned long arg) |
2232 | { | 2232 | { |
2233 | struct trident_state *state = (struct trident_state *)file->private_data; | 2233 | struct trident_state *state = (struct trident_state *)file->private_data; |
@@ -2348,7 +2348,7 @@ trident_ioctl(struct inode *inode, struct file *file, | |||
2348 | 2348 | ||
2349 | 2349 | ||
2350 | case SNDCTL_DSP_GETFMTS: /* Returns a mask of supported sample format */ | 2350 | case SNDCTL_DSP_GETFMTS: /* Returns a mask of supported sample format */ |
2351 | ret = put_user(AFMT_S16_LE | AFMT_U16_LE | AFMT_S8 | | 2351 | ret = put_user(AFMT_S16_LE | AFMT_U16_LE | AFMT_S8 | |
2352 | AFMT_U8, p); | 2352 | AFMT_U8, p); |
2353 | break; | 2353 | break; |
2354 | 2354 | ||
@@ -2379,7 +2379,7 @@ trident_ioctl(struct inode *inode, struct file *file, | |||
2379 | } | 2379 | } |
2380 | } | 2380 | } |
2381 | unlock_set_fmt(state); | 2381 | unlock_set_fmt(state); |
2382 | ret = put_user((dmabuf->fmt & TRIDENT_FMT_16BIT) ? AFMT_S16_LE : | 2382 | ret = put_user((dmabuf->fmt & TRIDENT_FMT_16BIT) ? AFMT_S16_LE : |
2383 | AFMT_U8, p); | 2383 | AFMT_U8, p); |
2384 | break; | 2384 | break; |
2385 | 2385 | ||
@@ -2438,7 +2438,7 @@ trident_ioctl(struct inode *inode, struct file *file, | |||
2438 | stop_adc(state); | 2438 | stop_adc(state); |
2439 | dmabuf->ready = 0; | 2439 | dmabuf->ready = 0; |
2440 | if (val >= 2) { | 2440 | if (val >= 2) { |
2441 | if (!((file->f_mode & FMODE_WRITE) && | 2441 | if (!((file->f_mode & FMODE_WRITE) && |
2442 | (val == 6))) | 2442 | (val == 6))) |
2443 | val = 2; | 2443 | val = 2; |
2444 | dmabuf->fmt |= TRIDENT_FMT_STEREO; | 2444 | dmabuf->fmt |= TRIDENT_FMT_STEREO; |
@@ -2504,7 +2504,7 @@ trident_ioctl(struct inode *inode, struct file *file, | |||
2504 | abinfo.fragstotal = dmabuf->numfrag; | 2504 | abinfo.fragstotal = dmabuf->numfrag; |
2505 | abinfo.fragments = abinfo.bytes >> dmabuf->fragshift; | 2505 | abinfo.fragments = abinfo.bytes >> dmabuf->fragshift; |
2506 | spin_unlock_irqrestore(&state->card->lock, flags); | 2506 | spin_unlock_irqrestore(&state->card->lock, flags); |
2507 | ret = copy_to_user(argp, &abinfo, sizeof (abinfo)) ? | 2507 | ret = copy_to_user(argp, &abinfo, sizeof (abinfo)) ? |
2508 | -EFAULT : 0; | 2508 | -EFAULT : 0; |
2509 | break; | 2509 | break; |
2510 | 2510 | ||
@@ -2524,7 +2524,7 @@ trident_ioctl(struct inode *inode, struct file *file, | |||
2524 | abinfo.fragstotal = dmabuf->numfrag; | 2524 | abinfo.fragstotal = dmabuf->numfrag; |
2525 | abinfo.fragments = abinfo.bytes >> dmabuf->fragshift; | 2525 | abinfo.fragments = abinfo.bytes >> dmabuf->fragshift; |
2526 | spin_unlock_irqrestore(&state->card->lock, flags); | 2526 | spin_unlock_irqrestore(&state->card->lock, flags); |
2527 | ret = copy_to_user(argp, &abinfo, sizeof (abinfo)) ? | 2527 | ret = copy_to_user(argp, &abinfo, sizeof (abinfo)) ? |
2528 | -EFAULT : 0; | 2528 | -EFAULT : 0; |
2529 | break; | 2529 | break; |
2530 | 2530 | ||
@@ -2533,7 +2533,7 @@ trident_ioctl(struct inode *inode, struct file *file, | |||
2533 | break; | 2533 | break; |
2534 | 2534 | ||
2535 | case SNDCTL_DSP_GETCAPS: | 2535 | case SNDCTL_DSP_GETCAPS: |
2536 | ret = put_user(DSP_CAP_REALTIME | DSP_CAP_TRIGGER | | 2536 | ret = put_user(DSP_CAP_REALTIME | DSP_CAP_TRIGGER | |
2537 | DSP_CAP_MMAP | DSP_CAP_BIND, p); | 2537 | DSP_CAP_MMAP | DSP_CAP_BIND, p); |
2538 | break; | 2538 | break; |
2539 | 2539 | ||
@@ -2553,7 +2553,7 @@ trident_ioctl(struct inode *inode, struct file *file, | |||
2553 | } | 2553 | } |
2554 | if (file->f_mode & FMODE_READ) { | 2554 | if (file->f_mode & FMODE_READ) { |
2555 | if (val & PCM_ENABLE_INPUT) { | 2555 | if (val & PCM_ENABLE_INPUT) { |
2556 | if (!dmabuf->ready && | 2556 | if (!dmabuf->ready && |
2557 | (ret = prog_dmabuf_record(state))) | 2557 | (ret = prog_dmabuf_record(state))) |
2558 | break; | 2558 | break; |
2559 | start_adc(state); | 2559 | start_adc(state); |
@@ -2562,7 +2562,7 @@ trident_ioctl(struct inode *inode, struct file *file, | |||
2562 | } | 2562 | } |
2563 | if (file->f_mode & FMODE_WRITE) { | 2563 | if (file->f_mode & FMODE_WRITE) { |
2564 | if (val & PCM_ENABLE_OUTPUT) { | 2564 | if (val & PCM_ENABLE_OUTPUT) { |
2565 | if (!dmabuf->ready && | 2565 | if (!dmabuf->ready && |
2566 | (ret = prog_dmabuf_playback(state))) | 2566 | (ret = prog_dmabuf_playback(state))) |
2567 | break; | 2567 | break; |
2568 | start_dac(state); | 2568 | start_dac(state); |
@@ -2589,7 +2589,7 @@ trident_ioctl(struct inode *inode, struct file *file, | |||
2589 | if (dmabuf->mapped) | 2589 | if (dmabuf->mapped) |
2590 | dmabuf->count &= dmabuf->fragsize - 1; | 2590 | dmabuf->count &= dmabuf->fragsize - 1; |
2591 | spin_unlock_irqrestore(&state->card->lock, flags); | 2591 | spin_unlock_irqrestore(&state->card->lock, flags); |
2592 | ret = copy_to_user(argp, &cinfo, sizeof (cinfo)) ? | 2592 | ret = copy_to_user(argp, &cinfo, sizeof (cinfo)) ? |
2593 | -EFAULT : 0; | 2593 | -EFAULT : 0; |
2594 | break; | 2594 | break; |
2595 | 2595 | ||
@@ -2612,7 +2612,7 @@ trident_ioctl(struct inode *inode, struct file *file, | |||
2612 | if (dmabuf->mapped) | 2612 | if (dmabuf->mapped) |
2613 | dmabuf->count &= dmabuf->fragsize - 1; | 2613 | dmabuf->count &= dmabuf->fragsize - 1; |
2614 | spin_unlock_irqrestore(&state->card->lock, flags); | 2614 | spin_unlock_irqrestore(&state->card->lock, flags); |
2615 | ret = copy_to_user(argp, &cinfo, sizeof (cinfo)) ? | 2615 | ret = copy_to_user(argp, &cinfo, sizeof (cinfo)) ? |
2616 | -EFAULT : 0; | 2616 | -EFAULT : 0; |
2617 | break; | 2617 | break; |
2618 | 2618 | ||
@@ -2641,17 +2641,17 @@ trident_ioctl(struct inode *inode, struct file *file, | |||
2641 | break; | 2641 | break; |
2642 | 2642 | ||
2643 | case SOUND_PCM_READ_CHANNELS: | 2643 | case SOUND_PCM_READ_CHANNELS: |
2644 | ret = put_user((dmabuf->fmt & TRIDENT_FMT_STEREO) ? 2 : 1, | 2644 | ret = put_user((dmabuf->fmt & TRIDENT_FMT_STEREO) ? 2 : 1, |
2645 | p); | 2645 | p); |
2646 | break; | 2646 | break; |
2647 | 2647 | ||
2648 | case SOUND_PCM_READ_BITS: | 2648 | case SOUND_PCM_READ_BITS: |
2649 | ret = put_user((dmabuf->fmt & TRIDENT_FMT_16BIT) ? AFMT_S16_LE : | 2649 | ret = put_user((dmabuf->fmt & TRIDENT_FMT_16BIT) ? AFMT_S16_LE : |
2650 | AFMT_U8, p); | 2650 | AFMT_U8, p); |
2651 | break; | 2651 | break; |
2652 | 2652 | ||
2653 | case SNDCTL_DSP_GETCHANNELMASK: | 2653 | case SNDCTL_DSP_GETCHANNELMASK: |
2654 | ret = put_user(DSP_BIND_FRONT | DSP_BIND_SURR | | 2654 | ret = put_user(DSP_BIND_FRONT | DSP_BIND_SURR | |
2655 | DSP_BIND_CENTER_LFE, p); | 2655 | DSP_BIND_CENTER_LFE, p); |
2656 | break; | 2656 | break; |
2657 | 2657 | ||
@@ -2671,10 +2671,10 @@ trident_ioctl(struct inode *inode, struct file *file, | |||
2671 | } else { | 2671 | } else { |
2672 | dmabuf->ready = 0; | 2672 | dmabuf->ready = 0; |
2673 | if (file->f_mode & FMODE_READ) | 2673 | if (file->f_mode & FMODE_READ) |
2674 | dmabuf->channel->attribute = (CHANNEL_REC | | 2674 | dmabuf->channel->attribute = (CHANNEL_REC | |
2675 | SRC_ENABLE); | 2675 | SRC_ENABLE); |
2676 | if (file->f_mode & FMODE_WRITE) | 2676 | if (file->f_mode & FMODE_WRITE) |
2677 | dmabuf->channel->attribute = (CHANNEL_SPC_PB | | 2677 | dmabuf->channel->attribute = (CHANNEL_SPC_PB | |
2678 | SRC_ENABLE); | 2678 | SRC_ENABLE); |
2679 | dmabuf->channel->attribute |= mask2attr[ffs(val)]; | 2679 | dmabuf->channel->attribute |= mask2attr[ffs(val)]; |
2680 | } | 2680 | } |
@@ -2765,8 +2765,8 @@ trident_open(struct inode *inode, struct file *file) | |||
2765 | init_waitqueue_head(&dmabuf->wait); | 2765 | init_waitqueue_head(&dmabuf->wait); |
2766 | file->private_data = state; | 2766 | file->private_data = state; |
2767 | 2767 | ||
2768 | /* set default sample format. According to OSS Programmer's */ | 2768 | /* set default sample format. According to OSS Programmer's */ |
2769 | /* Guide /dev/dsp should be default to unsigned 8-bits, mono, */ | 2769 | /* Guide /dev/dsp should be default to unsigned 8-bits, mono, */ |
2770 | /* with sample rate 8kHz and /dev/dspW will accept 16-bits sample */ | 2770 | /* with sample rate 8kHz and /dev/dspW will accept 16-bits sample */ |
2771 | if (file->f_mode & FMODE_WRITE) { | 2771 | if (file->f_mode & FMODE_WRITE) { |
2772 | dmabuf->fmt &= ~TRIDENT_FMT_MASK; | 2772 | dmabuf->fmt &= ~TRIDENT_FMT_MASK; |
@@ -2783,7 +2783,7 @@ trident_open(struct inode *inode, struct file *file) | |||
2783 | } | 2783 | } |
2784 | 2784 | ||
2785 | if (file->f_mode & FMODE_READ) { | 2785 | if (file->f_mode & FMODE_READ) { |
2786 | /* FIXME: Trident 4d can only record in signed 16-bits stereo, */ | 2786 | /* FIXME: Trident 4d can only record in signed 16-bits stereo, */ |
2787 | /* 48kHz sample, to be dealed with in trident_set_adc_rate() ?? */ | 2787 | /* 48kHz sample, to be dealed with in trident_set_adc_rate() ?? */ |
2788 | dmabuf->fmt &= ~TRIDENT_FMT_MASK; | 2788 | dmabuf->fmt &= ~TRIDENT_FMT_MASK; |
2789 | if ((minor & 0x0f) == SND_DEV_DSP16) | 2789 | if ((minor & 0x0f) == SND_DEV_DSP16) |
@@ -2794,7 +2794,7 @@ trident_open(struct inode *inode, struct file *file) | |||
2794 | if (card->pci_id == PCI_DEVICE_ID_SI_7018) { | 2794 | if (card->pci_id == PCI_DEVICE_ID_SI_7018) { |
2795 | /* set default channel attribute to 0x8a80, record from | 2795 | /* set default channel attribute to 0x8a80, record from |
2796 | PCM L/R FIFO and mono = (left + right + 1)/2 */ | 2796 | PCM L/R FIFO and mono = (left + right + 1)/2 */ |
2797 | dmabuf->channel->attribute = (CHANNEL_REC | PCM_LR | | 2797 | dmabuf->channel->attribute = (CHANNEL_REC | PCM_LR | |
2798 | MONO_MIX); | 2798 | MONO_MIX); |
2799 | } | 2799 | } |
2800 | trident_set_adc_rate(state, 8000); | 2800 | trident_set_adc_rate(state, 8000); |
@@ -3020,7 +3020,7 @@ acquirecodecaccess(struct trident_card *card) | |||
3020 | break; | 3020 | break; |
3021 | if (wsemabits == 0) { | 3021 | if (wsemabits == 0) { |
3022 | unlock: | 3022 | unlock: |
3023 | outl(((u32) (wcontrol & 0x1eff) | 0x00004000), | 3023 | outl(((u32) (wcontrol & 0x1eff) | 0x00004000), |
3024 | TRID_REG(card, ALI_AC97_WRITE)); | 3024 | TRID_REG(card, ALI_AC97_WRITE)); |
3025 | continue; | 3025 | continue; |
3026 | } | 3026 | } |
@@ -3104,7 +3104,7 @@ ali_ac97_get(struct trident_card *card, int secondary, u8 reg) | |||
3104 | ncount = 10; | 3104 | ncount = 10; |
3105 | 3105 | ||
3106 | while (1) { | 3106 | while (1) { |
3107 | if ((inw(TRID_REG(card, ALI_AC97_WRITE)) & ALI_AC97_BUSY_READ) | 3107 | if ((inw(TRID_REG(card, ALI_AC97_WRITE)) & ALI_AC97_BUSY_READ) |
3108 | != 0) | 3108 | != 0) |
3109 | break; | 3109 | break; |
3110 | if (ncount <= 0) | 3110 | if (ncount <= 0) |
@@ -3112,7 +3112,7 @@ ali_ac97_get(struct trident_card *card, int secondary, u8 reg) | |||
3112 | if (ncount-- == 1) { | 3112 | if (ncount-- == 1) { |
3113 | pr_debug("ali_ac97_read :try clear busy flag\n"); | 3113 | pr_debug("ali_ac97_read :try clear busy flag\n"); |
3114 | aud_reg = inl(TRID_REG(card, ALI_AC97_WRITE)); | 3114 | aud_reg = inl(TRID_REG(card, ALI_AC97_WRITE)); |
3115 | outl((aud_reg & 0xffff7fff), | 3115 | outl((aud_reg & 0xffff7fff), |
3116 | TRID_REG(card, ALI_AC97_WRITE)); | 3116 | TRID_REG(card, ALI_AC97_WRITE)); |
3117 | } | 3117 | } |
3118 | udelay(10); | 3118 | udelay(10); |
@@ -3159,7 +3159,7 @@ ali_ac97_set(struct trident_card *card, int secondary, u8 reg, u16 val) | |||
3159 | 3159 | ||
3160 | wcontrol = inw(TRID_REG(card, ALI_AC97_WRITE)); | 3160 | wcontrol = inw(TRID_REG(card, ALI_AC97_WRITE)); |
3161 | wcontrol &= 0xff00; | 3161 | wcontrol &= 0xff00; |
3162 | wcontrol |= (0x8100 | reg); /* bit 8=1: (ali1535 )reserved/ */ | 3162 | wcontrol |= (0x8100 | reg); /* bit 8=1: (ali1535 )reserved/ */ |
3163 | /* ali1535+ write */ | 3163 | /* ali1535+ write */ |
3164 | outl((data | wcontrol), TRID_REG(card, ALI_AC97_WRITE)); | 3164 | outl((data | wcontrol), TRID_REG(card, ALI_AC97_WRITE)); |
3165 | 3165 | ||
@@ -3177,7 +3177,7 @@ ali_ac97_set(struct trident_card *card, int secondary, u8 reg, u16 val) | |||
3177 | break; | 3177 | break; |
3178 | if (ncount-- == 1) { | 3178 | if (ncount-- == 1) { |
3179 | pr_debug("ali_ac97_set :try clear busy flag!!\n"); | 3179 | pr_debug("ali_ac97_set :try clear busy flag!!\n"); |
3180 | outw(wcontrol & 0x7fff, | 3180 | outw(wcontrol & 0x7fff, |
3181 | TRID_REG(card, ALI_AC97_WRITE)); | 3181 | TRID_REG(card, ALI_AC97_WRITE)); |
3182 | } | 3182 | } |
3183 | udelay(10); | 3183 | udelay(10); |
@@ -3382,7 +3382,7 @@ ali_detect_spdif_rate(struct trident_card *card) | |||
3382 | bval |= 0x1F; | 3382 | bval |= 0x1F; |
3383 | outb(bval, TRID_REG(card, ALI_SPDIF_CTRL + 1)); | 3383 | outb(bval, TRID_REG(card, ALI_SPDIF_CTRL + 1)); |
3384 | 3384 | ||
3385 | while (((R1 < 0x0B) || (R1 > 0x0E)) && (R1 != 0x12) && | 3385 | while (((R1 < 0x0B) || (R1 > 0x0E)) && (R1 != 0x12) && |
3386 | count <= 50000) { | 3386 | count <= 50000) { |
3387 | count++; | 3387 | count++; |
3388 | 3388 | ||
@@ -3669,14 +3669,14 @@ ali_save_regs(struct trident_card *card) | |||
3669 | spin_lock_irqsave(&card->lock, flags); | 3669 | spin_lock_irqsave(&card->lock, flags); |
3670 | 3670 | ||
3671 | ali_registers.global_regs[0x2c] = inl(TRID_REG(card, T4D_MISCINT)); | 3671 | ali_registers.global_regs[0x2c] = inl(TRID_REG(card, T4D_MISCINT)); |
3672 | //ali_registers.global_regs[0x20] = inl(TRID_REG(card,T4D_START_A)); | 3672 | //ali_registers.global_regs[0x20] = inl(TRID_REG(card,T4D_START_A)); |
3673 | ali_registers.global_regs[0x21] = inl(TRID_REG(card, T4D_STOP_A)); | 3673 | ali_registers.global_regs[0x21] = inl(TRID_REG(card, T4D_STOP_A)); |
3674 | 3674 | ||
3675 | //disable all IRQ bits | 3675 | //disable all IRQ bits |
3676 | outl(ALI_DISABLE_ALL_IRQ, TRID_REG(card, T4D_MISCINT)); | 3676 | outl(ALI_DISABLE_ALL_IRQ, TRID_REG(card, T4D_MISCINT)); |
3677 | 3677 | ||
3678 | for (i = 1; i < ALI_MIXER_REGS; i++) | 3678 | for (i = 1; i < ALI_MIXER_REGS; i++) |
3679 | ali_registers.mixer_regs[i] = ali_ac97_read(card->ac97_codec[0], | 3679 | ali_registers.mixer_regs[i] = ali_ac97_read(card->ac97_codec[0], |
3680 | i * 2); | 3680 | i * 2); |
3681 | 3681 | ||
3682 | for (i = 0; i < ALI_GLOBAL_REGS; i++) { | 3682 | for (i = 0; i < ALI_GLOBAL_REGS; i++) { |
@@ -3688,7 +3688,7 @@ ali_save_regs(struct trident_card *card) | |||
3688 | for (i = 0; i < ALI_CHANNELS; i++) { | 3688 | for (i = 0; i < ALI_CHANNELS; i++) { |
3689 | outb(i, TRID_REG(card, T4D_LFO_GC_CIR)); | 3689 | outb(i, TRID_REG(card, T4D_LFO_GC_CIR)); |
3690 | for (j = 0; j < ALI_CHANNEL_REGS; j++) | 3690 | for (j = 0; j < ALI_CHANNEL_REGS; j++) |
3691 | ali_registers.channel_regs[i][j] = inl(TRID_REG(card, | 3691 | ali_registers.channel_regs[i][j] = inl(TRID_REG(card, |
3692 | j * 4 + 0xe0)); | 3692 | j * 4 + 0xe0)); |
3693 | } | 3693 | } |
3694 | 3694 | ||
@@ -3707,18 +3707,18 @@ ali_restore_regs(struct trident_card *card) | |||
3707 | spin_lock_irqsave(&card->lock, flags); | 3707 | spin_lock_irqsave(&card->lock, flags); |
3708 | 3708 | ||
3709 | for (i = 1; i < ALI_MIXER_REGS; i++) | 3709 | for (i = 1; i < ALI_MIXER_REGS; i++) |
3710 | ali_ac97_write(card->ac97_codec[0], i * 2, | 3710 | ali_ac97_write(card->ac97_codec[0], i * 2, |
3711 | ali_registers.mixer_regs[i]); | 3711 | ali_registers.mixer_regs[i]); |
3712 | 3712 | ||
3713 | for (i = 0; i < ALI_CHANNELS; i++) { | 3713 | for (i = 0; i < ALI_CHANNELS; i++) { |
3714 | outb(i, TRID_REG(card, T4D_LFO_GC_CIR)); | 3714 | outb(i, TRID_REG(card, T4D_LFO_GC_CIR)); |
3715 | for (j = 0; j < ALI_CHANNEL_REGS; j++) | 3715 | for (j = 0; j < ALI_CHANNEL_REGS; j++) |
3716 | outl(ali_registers.channel_regs[i][j], | 3716 | outl(ali_registers.channel_regs[i][j], |
3717 | TRID_REG(card, j * 4 + 0xe0)); | 3717 | TRID_REG(card, j * 4 + 0xe0)); |
3718 | } | 3718 | } |
3719 | 3719 | ||
3720 | for (i = 0; i < ALI_GLOBAL_REGS; i++) { | 3720 | for (i = 0; i < ALI_GLOBAL_REGS; i++) { |
3721 | if ((i * 4 == T4D_MISCINT) || (i * 4 == T4D_STOP_A) || | 3721 | if ((i * 4 == T4D_MISCINT) || (i * 4 == T4D_STOP_A) || |
3722 | (i * 4 == T4D_START_A)) | 3722 | (i * 4 == T4D_START_A)) |
3723 | continue; | 3723 | continue; |
3724 | outl(ali_registers.global_regs[i], TRID_REG(card, i * 4)); | 3724 | outl(ali_registers.global_regs[i], TRID_REG(card, i * 4)); |
@@ -3763,7 +3763,7 @@ ali_alloc_pcm_channel(struct trident_card *card) | |||
3763 | 3763 | ||
3764 | bank = &card->banks[BANK_A]; | 3764 | bank = &card->banks[BANK_A]; |
3765 | 3765 | ||
3766 | if (inl(TRID_REG(card, ALI_GLOBAL_CONTROL)) & | 3766 | if (inl(TRID_REG(card, ALI_GLOBAL_CONTROL)) & |
3767 | (ALI_SPDIF_OUT_CH_ENABLE)) { | 3767 | (ALI_SPDIF_OUT_CH_ENABLE)) { |
3768 | idx = ALI_SPDIF_OUT_CHANNEL; | 3768 | idx = ALI_SPDIF_OUT_CHANNEL; |
3769 | if (!(bank->bitmap & (1 << idx))) { | 3769 | if (!(bank->bitmap & (1 << idx))) { |
@@ -3774,7 +3774,7 @@ ali_alloc_pcm_channel(struct trident_card *card) | |||
3774 | } | 3774 | } |
3775 | } | 3775 | } |
3776 | 3776 | ||
3777 | for (idx = ALI_PCM_OUT_CHANNEL_FIRST; idx <= ALI_PCM_OUT_CHANNEL_LAST; | 3777 | for (idx = ALI_PCM_OUT_CHANNEL_FIRST; idx <= ALI_PCM_OUT_CHANNEL_LAST; |
3778 | idx++) { | 3778 | idx++) { |
3779 | if (!(bank->bitmap & (1 << idx))) { | 3779 | if (!(bank->bitmap & (1 << idx))) { |
3780 | struct trident_channel *channel = &bank->channels[idx]; | 3780 | struct trident_channel *channel = &bank->channels[idx]; |
@@ -3785,9 +3785,9 @@ ali_alloc_pcm_channel(struct trident_card *card) | |||
3785 | } | 3785 | } |
3786 | 3786 | ||
3787 | /* no more free channels avaliable */ | 3787 | /* no more free channels avaliable */ |
3788 | #if 0 | 3788 | #if 0 |
3789 | printk(KERN_ERR "ali: no more channels available on Bank A.\n"); | 3789 | printk(KERN_ERR "ali: no more channels available on Bank A.\n"); |
3790 | #endif /* 0 */ | 3790 | #endif /* 0 */ |
3791 | return NULL; | 3791 | return NULL; |
3792 | } | 3792 | } |
3793 | 3793 | ||
@@ -3812,9 +3812,9 @@ ali_alloc_rec_pcm_channel(struct trident_card *card) | |||
3812 | } | 3812 | } |
3813 | 3813 | ||
3814 | /* no free recordable channels avaliable */ | 3814 | /* no free recordable channels avaliable */ |
3815 | #if 0 | 3815 | #if 0 |
3816 | printk(KERN_ERR "ali: no recordable channels available on Bank A.\n"); | 3816 | printk(KERN_ERR "ali: no recordable channels available on Bank A.\n"); |
3817 | #endif /* 0 */ | 3817 | #endif /* 0 */ |
3818 | return NULL; | 3818 | return NULL; |
3819 | } | 3819 | } |
3820 | 3820 | ||
@@ -3837,14 +3837,14 @@ ali_set_spdif_out_rate(struct trident_card *card, unsigned int rate) | |||
3837 | break; | 3837 | break; |
3838 | } | 3838 | } |
3839 | 3839 | ||
3840 | /* select spdif_out */ | 3840 | /* select spdif_out */ |
3841 | ch_st_sel = inb(TRID_REG(card, ALI_SPDIF_CTRL)) & ALI_SPDIF_OUT_CH_STATUS; | 3841 | ch_st_sel = inb(TRID_REG(card, ALI_SPDIF_CTRL)) & ALI_SPDIF_OUT_CH_STATUS; |
3842 | 3842 | ||
3843 | ch_st_sel |= 0x80; /* select right */ | 3843 | ch_st_sel |= 0x80; /* select right */ |
3844 | outb(ch_st_sel, TRID_REG(card, ALI_SPDIF_CTRL)); | 3844 | outb(ch_st_sel, TRID_REG(card, ALI_SPDIF_CTRL)); |
3845 | outb(status_rate | 0x20, TRID_REG(card, ALI_SPDIF_CS + 2)); | 3845 | outb(status_rate | 0x20, TRID_REG(card, ALI_SPDIF_CS + 2)); |
3846 | 3846 | ||
3847 | ch_st_sel &= (~0x80); /* select left */ | 3847 | ch_st_sel &= (~0x80); /* select left */ |
3848 | outb(ch_st_sel, TRID_REG(card, ALI_SPDIF_CTRL)); | 3848 | outb(ch_st_sel, TRID_REG(card, ALI_SPDIF_CTRL)); |
3849 | outw(status_rate | 0x10, TRID_REG(card, ALI_SPDIF_CS + 2)); | 3849 | outw(status_rate | 0x10, TRID_REG(card, ALI_SPDIF_CS + 2)); |
3850 | } | 3850 | } |
@@ -3881,14 +3881,14 @@ ali_address_interrupt(struct trident_card *card) | |||
3881 | } | 3881 | } |
3882 | } | 3882 | } |
3883 | 3883 | ||
3884 | /* Updating the values of counters of other_states' DMAs without lock | 3884 | /* Updating the values of counters of other_states' DMAs without lock |
3885 | protection is no harm because all DMAs of multi-channels and interrupt | 3885 | protection is no harm because all DMAs of multi-channels and interrupt |
3886 | depend on a master state's DMA, and changing the counters of the master | 3886 | depend on a master state's DMA, and changing the counters of the master |
3887 | state DMA is protected by a spinlock. | 3887 | state DMA is protected by a spinlock. |
3888 | */ | 3888 | */ |
3889 | static int | 3889 | static int |
3890 | ali_write_5_1(struct trident_state *state, const char __user *buf, | 3890 | ali_write_5_1(struct trident_state *state, const char __user *buf, |
3891 | int cnt_for_multi_channel, unsigned int *copy_count, | 3891 | int cnt_for_multi_channel, unsigned int *copy_count, |
3892 | unsigned int *state_cnt) | 3892 | unsigned int *state_cnt) |
3893 | { | 3893 | { |
3894 | 3894 | ||
@@ -3904,10 +3904,10 @@ ali_write_5_1(struct trident_state *state, const char __user *buf, | |||
3904 | 3904 | ||
3905 | if ((i = state->multi_channels_adjust_count) > 0) { | 3905 | if ((i = state->multi_channels_adjust_count) > 0) { |
3906 | if (i == 1) { | 3906 | if (i == 1) { |
3907 | if (copy_from_user(dmabuf->rawbuf + swptr, | 3907 | if (copy_from_user(dmabuf->rawbuf + swptr, |
3908 | buffer, sample_s)) | 3908 | buffer, sample_s)) |
3909 | return -EFAULT; | 3909 | return -EFAULT; |
3910 | seek_offset(swptr, buffer, cnt_for_multi_channel, | 3910 | seek_offset(swptr, buffer, cnt_for_multi_channel, |
3911 | sample_s, *copy_count); | 3911 | sample_s, *copy_count); |
3912 | i--; | 3912 | i--; |
3913 | (*state_cnt) += sample_s; | 3913 | (*state_cnt) += sample_s; |
@@ -3916,10 +3916,10 @@ ali_write_5_1(struct trident_state *state, const char __user *buf, | |||
3916 | i = i - (state->chans_num - other_dma_nums); | 3916 | i = i - (state->chans_num - other_dma_nums); |
3917 | for (; (i < other_dma_nums) && (cnt_for_multi_channel > 0); i++) { | 3917 | for (; (i < other_dma_nums) && (cnt_for_multi_channel > 0); i++) { |
3918 | dmabuf_temp = &state->other_states[i]->dmabuf; | 3918 | dmabuf_temp = &state->other_states[i]->dmabuf; |
3919 | if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, | 3919 | if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, |
3920 | buffer, sample_s)) | 3920 | buffer, sample_s)) |
3921 | return -EFAULT; | 3921 | return -EFAULT; |
3922 | seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, | 3922 | seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, |
3923 | sample_s, *copy_count); | 3923 | sample_s, *copy_count); |
3924 | } | 3924 | } |
3925 | if (cnt_for_multi_channel == 0) | 3925 | if (cnt_for_multi_channel == 0) |
@@ -3928,39 +3928,39 @@ ali_write_5_1(struct trident_state *state, const char __user *buf, | |||
3928 | if (cnt_for_multi_channel > 0) { | 3928 | if (cnt_for_multi_channel > 0) { |
3929 | loop = cnt_for_multi_channel / (state->chans_num * sample_s); | 3929 | loop = cnt_for_multi_channel / (state->chans_num * sample_s); |
3930 | for (i = 0; i < loop; i++) { | 3930 | for (i = 0; i < loop; i++) { |
3931 | if (copy_from_user(dmabuf->rawbuf + swptr, buffer, | 3931 | if (copy_from_user(dmabuf->rawbuf + swptr, buffer, |
3932 | sample_s * 2)) | 3932 | sample_s * 2)) |
3933 | return -EFAULT; | 3933 | return -EFAULT; |
3934 | seek_offset(swptr, buffer, cnt_for_multi_channel, | 3934 | seek_offset(swptr, buffer, cnt_for_multi_channel, |
3935 | sample_s * 2, *copy_count); | 3935 | sample_s * 2, *copy_count); |
3936 | (*state_cnt) += (sample_s * 2); | 3936 | (*state_cnt) += (sample_s * 2); |
3937 | 3937 | ||
3938 | dmabuf_temp = &state->other_states[0]->dmabuf; | 3938 | dmabuf_temp = &state->other_states[0]->dmabuf; |
3939 | if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, | 3939 | if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, |
3940 | buffer, sample_s)) | 3940 | buffer, sample_s)) |
3941 | return -EFAULT; | 3941 | return -EFAULT; |
3942 | seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, | 3942 | seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, |
3943 | sample_s, *copy_count); | 3943 | sample_s, *copy_count); |
3944 | 3944 | ||
3945 | dmabuf_temp = &state->other_states[1]->dmabuf; | 3945 | dmabuf_temp = &state->other_states[1]->dmabuf; |
3946 | if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, | 3946 | if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, |
3947 | buffer, sample_s)) | 3947 | buffer, sample_s)) |
3948 | return -EFAULT; | 3948 | return -EFAULT; |
3949 | seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, | 3949 | seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, |
3950 | sample_s, *copy_count); | 3950 | sample_s, *copy_count); |
3951 | 3951 | ||
3952 | dmabuf_temp = &state->other_states[2]->dmabuf; | 3952 | dmabuf_temp = &state->other_states[2]->dmabuf; |
3953 | if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, | 3953 | if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, |
3954 | buffer, sample_s)) | 3954 | buffer, sample_s)) |
3955 | return -EFAULT; | 3955 | return -EFAULT; |
3956 | seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, | 3956 | seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, |
3957 | sample_s, *copy_count); | 3957 | sample_s, *copy_count); |
3958 | 3958 | ||
3959 | dmabuf_temp = &state->other_states[3]->dmabuf; | 3959 | dmabuf_temp = &state->other_states[3]->dmabuf; |
3960 | if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, | 3960 | if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, |
3961 | buffer, sample_s)) | 3961 | buffer, sample_s)) |
3962 | return -EFAULT; | 3962 | return -EFAULT; |
3963 | seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, | 3963 | seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, |
3964 | sample_s, *copy_count); | 3964 | sample_s, *copy_count); |
3965 | } | 3965 | } |
3966 | 3966 | ||
@@ -3969,15 +3969,15 @@ ali_write_5_1(struct trident_state *state, const char __user *buf, | |||
3969 | 3969 | ||
3970 | if (copy_from_user(dmabuf->rawbuf + swptr, buffer, sample_s)) | 3970 | if (copy_from_user(dmabuf->rawbuf + swptr, buffer, sample_s)) |
3971 | return -EFAULT; | 3971 | return -EFAULT; |
3972 | seek_offset(swptr, buffer, cnt_for_multi_channel, | 3972 | seek_offset(swptr, buffer, cnt_for_multi_channel, |
3973 | sample_s, *copy_count); | 3973 | sample_s, *copy_count); |
3974 | (*state_cnt) += sample_s; | 3974 | (*state_cnt) += sample_s; |
3975 | 3975 | ||
3976 | if (cnt_for_multi_channel > 0) { | 3976 | if (cnt_for_multi_channel > 0) { |
3977 | if (copy_from_user(dmabuf->rawbuf + swptr, | 3977 | if (copy_from_user(dmabuf->rawbuf + swptr, |
3978 | buffer, sample_s)) | 3978 | buffer, sample_s)) |
3979 | return -EFAULT; | 3979 | return -EFAULT; |
3980 | seek_offset(swptr, buffer, cnt_for_multi_channel, | 3980 | seek_offset(swptr, buffer, cnt_for_multi_channel, |
3981 | sample_s, *copy_count); | 3981 | sample_s, *copy_count); |
3982 | (*state_cnt) += sample_s; | 3982 | (*state_cnt) += sample_s; |
3983 | 3983 | ||
@@ -3986,12 +3986,12 @@ ali_write_5_1(struct trident_state *state, const char __user *buf, | |||
3986 | loop = state->multi_channels_adjust_count - diff; | 3986 | loop = state->multi_channels_adjust_count - diff; |
3987 | for (i = 0; i < loop; i++) { | 3987 | for (i = 0; i < loop; i++) { |
3988 | dmabuf_temp = &state->other_states[i]->dmabuf; | 3988 | dmabuf_temp = &state->other_states[i]->dmabuf; |
3989 | if (copy_from_user(dmabuf_temp->rawbuf + | 3989 | if (copy_from_user(dmabuf_temp->rawbuf + |
3990 | dmabuf_temp->swptr, | 3990 | dmabuf_temp->swptr, |
3991 | buffer, sample_s)) | 3991 | buffer, sample_s)) |
3992 | return -EFAULT; | 3992 | return -EFAULT; |
3993 | seek_offset(dmabuf_temp->swptr, buffer, | 3993 | seek_offset(dmabuf_temp->swptr, buffer, |
3994 | cnt_for_multi_channel, | 3994 | cnt_for_multi_channel, |
3995 | sample_s, *copy_count); | 3995 | sample_s, *copy_count); |
3996 | } | 3996 | } |
3997 | } | 3997 | } |
@@ -4048,11 +4048,11 @@ ali_write_proc(struct file *file, const char __user *buffer, unsigned long count | |||
4048 | ali_disable_special_channel(card, ALI_SPDIF_OUT_CHANNEL); | 4048 | ali_disable_special_channel(card, ALI_SPDIF_OUT_CHANNEL); |
4049 | break; | 4049 | break; |
4050 | case '1': | 4050 | case '1': |
4051 | ali_setup_spdif_out(card, ALI_SPDIF_OUT_TO_SPDIF_OUT | | 4051 | ali_setup_spdif_out(card, ALI_SPDIF_OUT_TO_SPDIF_OUT | |
4052 | ALI_SPDIF_OUT_PCM); | 4052 | ALI_SPDIF_OUT_PCM); |
4053 | break; | 4053 | break; |
4054 | case '2': | 4054 | case '2': |
4055 | ali_setup_spdif_out(card, ALI_SPDIF_OUT_TO_SPDIF_OUT | | 4055 | ali_setup_spdif_out(card, ALI_SPDIF_OUT_TO_SPDIF_OUT | |
4056 | ALI_SPDIF_OUT_NON_PCM); | 4056 | ALI_SPDIF_OUT_NON_PCM); |
4057 | break; | 4057 | break; |
4058 | case '3': | 4058 | case '3': |
@@ -4077,7 +4077,7 @@ trident_open_mixdev(struct inode *inode, struct file *file) | |||
4077 | 4077 | ||
4078 | for (card = devs; card != NULL; card = card->next) | 4078 | for (card = devs; card != NULL; card = card->next) |
4079 | for (i = 0; i < NR_AC97; i++) | 4079 | for (i = 0; i < NR_AC97; i++) |
4080 | if (card->ac97_codec[i] != NULL && | 4080 | if (card->ac97_codec[i] != NULL && |
4081 | card->ac97_codec[i]->dev_mixer == minor) | 4081 | card->ac97_codec[i]->dev_mixer == minor) |
4082 | goto match; | 4082 | goto match; |
4083 | 4083 | ||
@@ -4091,7 +4091,7 @@ trident_open_mixdev(struct inode *inode, struct file *file) | |||
4091 | } | 4091 | } |
4092 | 4092 | ||
4093 | static int | 4093 | static int |
4094 | trident_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int cmd, | 4094 | trident_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int cmd, |
4095 | unsigned long arg) | 4095 | unsigned long arg) |
4096 | { | 4096 | { |
4097 | struct ac97_codec *codec = (struct ac97_codec *) file->private_data; | 4097 | struct ac97_codec *codec = (struct ac97_codec *) file->private_data; |
@@ -4185,9 +4185,9 @@ trident_ac97_init(struct trident_card *card) | |||
4185 | /* disable AC97 GPIO interrupt */ | 4185 | /* disable AC97 GPIO interrupt */ |
4186 | outl(0x00, TRID_REG(card, SI_AC97_GPIO)); | 4186 | outl(0x00, TRID_REG(card, SI_AC97_GPIO)); |
4187 | /* when power up the AC link is in cold reset mode so stop it */ | 4187 | /* when power up the AC link is in cold reset mode so stop it */ |
4188 | outl(PCMOUT | SURROUT | CENTEROUT | LFEOUT | SECONDARY_ID, | 4188 | outl(PCMOUT | SURROUT | CENTEROUT | LFEOUT | SECONDARY_ID, |
4189 | TRID_REG(card, SI_SERIAL_INTF_CTRL)); | 4189 | TRID_REG(card, SI_SERIAL_INTF_CTRL)); |
4190 | /* it take a long time to recover from a cold reset */ | 4190 | /* it take a long time to recover from a cold reset */ |
4191 | /* (especially when you have more than one codec) */ | 4191 | /* (especially when you have more than one codec) */ |
4192 | udelay(2000); | 4192 | udelay(2000); |
4193 | ready_2nd = inl(TRID_REG(card, SI_SERIAL_INTF_CTRL)); | 4193 | ready_2nd = inl(TRID_REG(card, SI_SERIAL_INTF_CTRL)); |
@@ -4207,9 +4207,9 @@ trident_ac97_init(struct trident_card *card) | |||
4207 | /* disable AC97 GPIO interrupt */ | 4207 | /* disable AC97 GPIO interrupt */ |
4208 | outl(0x00, TRID_REG(card, SI_AC97_GPIO)); | 4208 | outl(0x00, TRID_REG(card, SI_AC97_GPIO)); |
4209 | /* when power up, the AC link is in cold reset mode, so stop it */ | 4209 | /* when power up, the AC link is in cold reset mode, so stop it */ |
4210 | outl(PCMOUT | SURROUT | CENTEROUT | LFEOUT, | 4210 | outl(PCMOUT | SURROUT | CENTEROUT | LFEOUT, |
4211 | TRID_REG(card, SI_SERIAL_INTF_CTRL)); | 4211 | TRID_REG(card, SI_SERIAL_INTF_CTRL)); |
4212 | /* it take a long time to recover from a cold reset (especially */ | 4212 | /* it take a long time to recover from a cold reset (especially */ |
4213 | /* when you have more than one codec) */ | 4213 | /* when you have more than one codec) */ |
4214 | udelay(2000); | 4214 | udelay(2000); |
4215 | ready_2nd = inl(TRID_REG(card, SI_SERIAL_INTF_CTRL)); | 4215 | ready_2nd = inl(TRID_REG(card, SI_SERIAL_INTF_CTRL)); |
@@ -4221,7 +4221,7 @@ trident_ac97_init(struct trident_card *card) | |||
4221 | if ((codec = ac97_alloc_codec()) == NULL) | 4221 | if ((codec = ac97_alloc_codec()) == NULL) |
4222 | return -ENOMEM; | 4222 | return -ENOMEM; |
4223 | 4223 | ||
4224 | /* initialize some basic codec information, other fields */ | 4224 | /* initialize some basic codec information, other fields */ |
4225 | /* will be filled in ac97_probe_codec */ | 4225 | /* will be filled in ac97_probe_codec */ |
4226 | codec->private_data = card; | 4226 | codec->private_data = card; |
4227 | codec->id = num_ac97; | 4227 | codec->id = num_ac97; |
@@ -4352,8 +4352,8 @@ static inline int trident_register_gameport(struct trident_card *card) { return | |||
4352 | static inline void trident_unregister_gameport(struct trident_card *card) { } | 4352 | static inline void trident_unregister_gameport(struct trident_card *card) { } |
4353 | #endif /* SUPPORT_JOYSTICK */ | 4353 | #endif /* SUPPORT_JOYSTICK */ |
4354 | 4354 | ||
4355 | /* install the driver, we do not allocate hardware channel nor DMA buffer */ | 4355 | /* install the driver, we do not allocate hardware channel nor DMA buffer */ |
4356 | /* now, they are defered until "ACCESS" time (in prog_dmabuf called by */ | 4356 | /* now, they are defered until "ACCESS" time (in prog_dmabuf called by */ |
4357 | /* open/read/write/ioctl/mmap) */ | 4357 | /* open/read/write/ioctl/mmap) */ |
4358 | static int __devinit | 4358 | static int __devinit |
4359 | trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) | 4359 | trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) |
@@ -4376,9 +4376,9 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) | |||
4376 | else | 4376 | else |
4377 | dma_mask = TRIDENT_DMA_MASK; | 4377 | dma_mask = TRIDENT_DMA_MASK; |
4378 | if (pci_set_dma_mask(pci_dev, dma_mask)) { | 4378 | if (pci_set_dma_mask(pci_dev, dma_mask)) { |
4379 | printk(KERN_ERR "trident: architecture does not support" | 4379 | printk(KERN_ERR "trident: architecture does not support" |
4380 | " %s PCI busmaster DMA\n", | 4380 | " %s PCI busmaster DMA\n", |
4381 | pci_dev->device == PCI_DEVICE_ID_ALI_5451 ? | 4381 | pci_dev->device == PCI_DEVICE_ID_ALI_5451 ? |
4382 | "32-bit" : "30-bit"); | 4382 | "32-bit" : "30-bit"); |
4383 | goto out; | 4383 | goto out; |
4384 | } | 4384 | } |
@@ -4422,7 +4422,7 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) | |||
4422 | 4422 | ||
4423 | pci_set_master(pci_dev); | 4423 | pci_set_master(pci_dev); |
4424 | 4424 | ||
4425 | printk(KERN_INFO "trident: %s found at IO 0x%04lx, IRQ %d\n", | 4425 | printk(KERN_INFO "trident: %s found at IO 0x%04lx, IRQ %d\n", |
4426 | card_names[pci_id->driver_data], card->iobase, card->irq); | 4426 | card_names[pci_id->driver_data], card->iobase, card->irq); |
4427 | 4427 | ||
4428 | if (card->pci_id == PCI_DEVICE_ID_ALI_5451) { | 4428 | if (card->pci_id == PCI_DEVICE_ID_ALI_5451) { |
@@ -4449,8 +4449,8 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) | |||
4449 | 4449 | ||
4450 | /* Add H/W Volume Control By Matt Wu Jul. 06, 2001 */ | 4450 | /* Add H/W Volume Control By Matt Wu Jul. 06, 2001 */ |
4451 | card->hwvolctl = 0; | 4451 | card->hwvolctl = 0; |
4452 | pci_dev_m1533 = pci_find_device(PCI_VENDOR_ID_AL, | 4452 | pci_dev_m1533 = pci_find_device(PCI_VENDOR_ID_AL, |
4453 | PCI_DEVICE_ID_AL_M1533, | 4453 | PCI_DEVICE_ID_AL_M1533, |
4454 | pci_dev_m1533); | 4454 | pci_dev_m1533); |
4455 | rc = -ENODEV; | 4455 | rc = -ENODEV; |
4456 | if (pci_dev_m1533 == NULL) | 4456 | if (pci_dev_m1533 == NULL) |
@@ -4482,7 +4482,7 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) | |||
4482 | rc = -ENODEV; | 4482 | rc = -ENODEV; |
4483 | if (request_irq(card->irq, &trident_interrupt, IRQF_SHARED, | 4483 | if (request_irq(card->irq, &trident_interrupt, IRQF_SHARED, |
4484 | card_names[pci_id->driver_data], card)) { | 4484 | card_names[pci_id->driver_data], card)) { |
4485 | printk(KERN_ERR "trident: unable to allocate irq %d\n", | 4485 | printk(KERN_ERR "trident: unable to allocate irq %d\n", |
4486 | card->irq); | 4486 | card->irq); |
4487 | goto out_proc_fs; | 4487 | goto out_proc_fs; |
4488 | } | 4488 | } |
@@ -4533,7 +4533,7 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) | |||
4533 | printk(KERN_INFO "trident: Running on Alpha system " | 4533 | printk(KERN_INFO "trident: Running on Alpha system " |
4534 | "type Nautilus\n"); | 4534 | "type Nautilus\n"); |
4535 | ac97_data = ali_ac97_get(card, 0, AC97_POWER_CONTROL); | 4535 | ac97_data = ali_ac97_get(card, 0, AC97_POWER_CONTROL); |
4536 | ali_ac97_set(card, 0, AC97_POWER_CONTROL, | 4536 | ali_ac97_set(card, 0, AC97_POWER_CONTROL, |
4537 | ac97_data | ALI_EAPD_POWER_DOWN); | 4537 | ac97_data | ALI_EAPD_POWER_DOWN); |
4538 | } | 4538 | } |
4539 | } | 4539 | } |
@@ -4566,7 +4566,7 @@ out_proc_fs: | |||
4566 | devs = NULL; | 4566 | devs = NULL; |
4567 | out_release_region: | 4567 | out_release_region: |
4568 | release_region(iobase, 256); | 4568 | release_region(iobase, 256); |
4569 | return rc; | 4569 | return rc; |
4570 | } | 4570 | } |
4571 | 4571 | ||
4572 | static void __devexit | 4572 | static void __devexit |
@@ -4634,8 +4634,8 @@ static struct pci_driver trident_pci_driver = { | |||
4634 | static int __init | 4634 | static int __init |
4635 | trident_init_module(void) | 4635 | trident_init_module(void) |
4636 | { | 4636 | { |
4637 | printk(KERN_INFO "Trident 4DWave/SiS 7018/ALi 5451,Tvia CyberPro " | 4637 | printk(KERN_INFO "Trident 4DWave/SiS 7018/ALi 5451,Tvia CyberPro " |
4638 | "5050 PCI Audio, version " DRIVER_VERSION ", " __TIME__ " " | 4638 | "5050 PCI Audio, version " DRIVER_VERSION ", " __TIME__ " " |
4639 | __DATE__ "\n"); | 4639 | __DATE__ "\n"); |
4640 | 4640 | ||
4641 | return pci_register_driver(&trident_pci_driver); | 4641 | return pci_register_driver(&trident_pci_driver); |