For creating an ac97 instance, first call snd_ac97_bus
with an ac97_bus_ops_t record with callback functions.
struct snd_ac97_bus *bus;
static struct snd_ac97_bus_ops ops = {
.write = snd_mychip_ac97_write,
.read = snd_mychip_ac97_read,
};
snd_ac97_bus(card, 0, &ops, NULL, &pbus);
And then call snd_ac97_mixer() with an
struct snd_ac97_template
record together with the bus pointer created above.
struct snd_ac97_template ac97;
int err;
memset(&ac97, 0, sizeof(ac97));
ac97.private_data = chip;
snd_ac97_mixer(bus, &ac97, &chip->ac97);