aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1/emu10k1_callback.c
diff options
context:
space:
mode:
authorJames Courtier-Dutton <James@superbug.co.uk>2007-11-10 12:55:14 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:30:24 -0500
commitc94fa4c9168e51a8dab8e72cb9f0d89673fc8d8c (patch)
tree08169553a3b69a284b322941131f406661e499e8 /sound/pci/emu10k1/emu10k1_callback.c
parent3839e4f136d6da3dc85d237aa9569ee94bfea763 (diff)
[ALSA] emu10k1: General cleanup, add new locks, fix alsa bug#3501, kernel bug#9304.
Signed-off-by: James Courtier-Dutton <James@superbug.co.uk> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/emu10k1/emu10k1_callback.c')
-rw-r--r--sound/pci/emu10k1/emu10k1_callback.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sound/pci/emu10k1/emu10k1_callback.c b/sound/pci/emu10k1/emu10k1_callback.c
index 01965bd99966..45088ebcce50 100644
--- a/sound/pci/emu10k1/emu10k1_callback.c
+++ b/sound/pci/emu10k1/emu10k1_callback.c
@@ -35,9 +35,9 @@ struct best_voice {
35/* 35/*
36 * prototypes 36 * prototypes
37 */ 37 */
38static void lookup_voices(struct snd_emux *emu, struct snd_emu10k1 *hw, 38static void lookup_voices(struct snd_emux *emux, struct snd_emu10k1 *hw,
39 struct best_voice *best, int active_only); 39 struct best_voice *best, int active_only);
40static struct snd_emux_voice *get_voice(struct snd_emux *emu, 40static struct snd_emux_voice *get_voice(struct snd_emux *emux,
41 struct snd_emux_port *port); 41 struct snd_emux_port *port);
42static int start_voice(struct snd_emux_voice *vp); 42static int start_voice(struct snd_emux_voice *vp);
43static void trigger_voice(struct snd_emux_voice *vp); 43static void trigger_voice(struct snd_emux_voice *vp);
@@ -45,7 +45,6 @@ static void release_voice(struct snd_emux_voice *vp);
45static void update_voice(struct snd_emux_voice *vp, int update); 45static void update_voice(struct snd_emux_voice *vp, int update);
46static void terminate_voice(struct snd_emux_voice *vp); 46static void terminate_voice(struct snd_emux_voice *vp);
47static void free_voice(struct snd_emux_voice *vp); 47static void free_voice(struct snd_emux_voice *vp);
48
49static void set_fmmod(struct snd_emu10k1 *hw, struct snd_emux_voice *vp); 48static void set_fmmod(struct snd_emu10k1 *hw, struct snd_emux_voice *vp);
50static void set_fm2frq2(struct snd_emu10k1 *hw, struct snd_emux_voice *vp); 49static void set_fm2frq2(struct snd_emu10k1 *hw, struct snd_emux_voice *vp);
51static void set_filterQ(struct snd_emu10k1 *hw, struct snd_emux_voice *vp); 50static void set_filterQ(struct snd_emu10k1 *hw, struct snd_emux_voice *vp);
@@ -75,9 +74,9 @@ static struct snd_emux_operators emu10k1_ops = {
75}; 74};
76 75
77void 76void
78snd_emu10k1_ops_setup(struct snd_emux *emu) 77snd_emu10k1_ops_setup(struct snd_emux *emux)
79{ 78{
80 emu->ops = emu10k1_ops; 79 emux->ops = emu10k1_ops;
81} 80}
82 81
83 82
@@ -166,7 +165,11 @@ free_voice(struct snd_emux_voice *vp)
166 struct snd_emu10k1 *hw; 165 struct snd_emu10k1 *hw;
167 166
168 hw = vp->hw; 167 hw = vp->hw;
169 if (vp->ch >= 0) { 168 /* FIXME: emu10k1_synth is broken. */
169 /* This can get called with hw == 0 */
170 /* Problem apparent on plug, unplug then plug */
171 /* on the Audigy 2 ZS Notebook. */
172 if (hw && (vp->ch >= 0)) {
170 snd_emu10k1_ptr_write(hw, IFATN, vp->ch, 0xff00); 173 snd_emu10k1_ptr_write(hw, IFATN, vp->ch, 0xff00);
171 snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0x807f | DCYSUSV_CHANNELENABLE_MASK); 174 snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0x807f | DCYSUSV_CHANNELENABLE_MASK);
172 // snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0); 175 // snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0);