The ALSA AC97 codec layer is a well-defined one, and you don't have to write many codes to control it. Only low-level control routines are necessary. The AC97 codec API is defined in <sound/ac97_codec.h>.