Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c5706bb authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela
Browse files

[ALSA] ac97 - Allow drivers to set static volume resolution table



Modules: AC97 Codec

Add the pointer to a static volume resolution table to ac97 template,
so that the drivers can define the volume resolution, too.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 4ccb4a43
Loading
Loading
Loading
Loading
+7 −6
Original line number Original line Diff line number Diff line
@@ -433,6 +433,12 @@ struct snd_ac97_bus {
	struct snd_info_entry *proc;
	struct snd_info_entry *proc;
};
};


/* static resolution table */
struct snd_ac97_res_table {
	unsigned short reg;	/* register */
	unsigned short bits;	/* resolution bitmask */
};

struct snd_ac97_template {
struct snd_ac97_template {
	void *private_data;
	void *private_data;
	void (*private_free) (struct snd_ac97 *ac97);
	void (*private_free) (struct snd_ac97 *ac97);
@@ -442,12 +448,7 @@ struct snd_ac97_template {
	unsigned int scaps;	/* driver capabilities */
	unsigned int scaps;	/* driver capabilities */
	unsigned int limited_regs; /* allow limited registers only */
	unsigned int limited_regs; /* allow limited registers only */
	DECLARE_BITMAP(reg_accessed, 0x80); /* bit flags */
	DECLARE_BITMAP(reg_accessed, 0x80); /* bit flags */
};
	const struct snd_ac97_res_table *res_table;	/* static resolution */

/* static resolution table */
struct snd_ac97_res_table {
	unsigned short reg;	/* register */
	unsigned short bits;	/* resolution bitmask */
};
};


struct snd_ac97 {
struct snd_ac97 {
+1 −0
Original line number Original line Diff line number Diff line
@@ -1868,6 +1868,7 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
	ac97->scaps = template->scaps;
	ac97->scaps = template->scaps;
	ac97->limited_regs = template->limited_regs;
	ac97->limited_regs = template->limited_regs;
	memcpy(ac97->reg_accessed, template->reg_accessed, sizeof(ac97->reg_accessed));
	memcpy(ac97->reg_accessed, template->reg_accessed, sizeof(ac97->reg_accessed));
	ac97->res_table = template->res_table;
	bus->codec[ac97->num] = ac97;
	bus->codec[ac97->num] = ac97;
	mutex_init(&ac97->reg_mutex);
	mutex_init(&ac97->reg_mutex);
	mutex_init(&ac97->page_mutex);
	mutex_init(&ac97->page_mutex);