Skip to content

Commit 7002cbd

Browse files
ossilatortiwai
authored andcommitted
ALSA: emu10k1: use high-level I/O in set_filterQ()
This makes the code shorter and more legible. Signed-off-by: Oswald Buddenhagen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 8d60d5c commit 7002cbd

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

include/sound/emu10k1.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,8 @@
429429
#define DSL_LOOPENDADDR 0x18000007
430430

431431
#define CCCA 0x08 /* Filter Q, interp. ROM, byte size, cur. addr register */
432-
#define CCCA_RESONANCE 0xf0000000 /* Lowpass filter resonance (Q) height */
432+
#define CCCA_RESONANCE_MASK 0xf0000000 /* Lowpass filter resonance (Q) height */
433+
#define CCCA_RESONANCE 0x041c0008
433434
#define CCCA_INTERPROM_MASK 0x0e000000 /* Selects passband of interpolation ROM */
434435
/* 1 == full band, 7 == lowpass */
435436
/* ROM 0 is used when pitch shifting downward or less */

sound/pci/emu10k1/emu10k1_callback.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,5 @@ set_fm2frq2(struct snd_emu10k1 *hw, struct snd_emux_voice *vp)
531531
static void
532532
set_filterQ(struct snd_emu10k1 *hw, struct snd_emux_voice *vp)
533533
{
534-
unsigned int val;
535-
val = snd_emu10k1_ptr_read(hw, CCCA, vp->ch) & ~CCCA_RESONANCE;
536-
val |= (vp->reg.parm.filterQ << 28);
537-
snd_emu10k1_ptr_write(hw, CCCA, vp->ch, val);
534+
snd_emu10k1_ptr_write(hw, CCCA_RESONANCE, vp->ch, vp->reg.parm.filterQ);
538535
}

0 commit comments

Comments
 (0)