ALSA: emu10k1: automate encoding of sub-register definitions
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>
Sun, 14 May 2023 17:03:20 +0000 (19:03 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 15 May 2023 20:00:54 +0000 (22:00 +0200)
commit60571ac9ea621d3d1404f78bc0f27b709e82f2fd
tree336c18f2f3d59463c525b72b42a8cd248904acc0
parent59f038a09c62d77de91387ddcff66e54d99f2ec9
ALSA: emu10k1: automate encoding of sub-register definitions

The idea to encode the bitfield manipulation in the register address is
quite clever, but doing that by hand is ugly and error-prone. So derive
it automatically from the mask instead.

Macros cannot #define other macros, so we now declare enums instead.

This also adds macros for decoding the register definitions. These will
be used by later commits.

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