ALSA: emu10k1: use high-level I/O in set_filterQ()
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>
Sun, 23 Apr 2023 18:10:02 +0000 (20:10 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 24 Apr 2023 06:16:26 +0000 (08:16 +0200)
This makes the code shorter and more legible.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Link: https://lore.kernel.org/r/20230423181002.1246793-2-oswald.buddenhagen@gmx.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/emu10k1.h
sound/pci/emu10k1/emu10k1_callback.c

index 05a09826eef0a0b122afecefb7743393f8547062..8fe80dcee71b2e7dde3d860fd6d51c7c8200151d 100644 (file)
 #define DSL_LOOPENDADDR                0x18000007
 
 #define CCCA                   0x08            /* Filter Q, interp. ROM, byte size, cur. addr register */
-#define CCCA_RESONANCE         0xf0000000      /* Lowpass filter resonance (Q) height                  */
+#define CCCA_RESONANCE_MASK    0xf0000000      /* Lowpass filter resonance (Q) height                  */
+#define CCCA_RESONANCE         0x041c0008
 #define CCCA_INTERPROM_MASK    0x0e000000      /* Selects passband of interpolation ROM                */
                                                /* 1 == full band, 7 == lowpass                         */
                                                /* ROM 0 is used when pitch shifting downward or less   */
index dba1e9fc2eecf78b0ad717520f3e0dd8181917b1..c6d15257518194ec128dc4166b20aa268d0133b2 100644 (file)
@@ -531,8 +531,5 @@ set_fm2frq2(struct snd_emu10k1 *hw, struct snd_emux_voice *vp)
 static void
 set_filterQ(struct snd_emu10k1 *hw, struct snd_emux_voice *vp)
 {
-       unsigned int val;
-       val = snd_emu10k1_ptr_read(hw, CCCA, vp->ch) & ~CCCA_RESONANCE;
-       val |= (vp->reg.parm.filterQ << 28);
-       snd_emu10k1_ptr_write(hw, CCCA, vp->ch, val);
+       snd_emu10k1_ptr_write(hw, CCCA_RESONANCE, vp->ch, vp->reg.parm.filterQ);
 }