1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

add a function to reinitialize the mixer, to be called by drivers on

resuming after suspend
This commit is contained in:
Cameron Grant 2000-03-20 15:21:50 +00:00
parent 562039fa5b
commit a0b4946276
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=58383
2 changed files with 14 additions and 0 deletions

View File

@ -61,6 +61,19 @@ mixer_init(snddev_info *d, snd_mixer *m, void *devinfo)
} else return -1;
}
int
mixer_reinit(snddev_info *d)
{
int i;
if (d == NULL) return -1;
if (d->mixer.init != NULL && d->mixer.init(&d->mixer) == 0) {
for (i = 0; i < SOUND_MIXER_NRDEVICES; i++)
mixer_set(d, i, d->mixer.level[i]);
mixer_setrecsrc(d, d->mixer.recsrc);
return 0;
} else return -1;
}
int
mixer_set(snddev_info *d, unsigned dev, unsigned lev)
{

View File

@ -27,6 +27,7 @@
*/
extern int mixer_init(snddev_info *d, snd_mixer *m, void *devinfo);
extern int mixer_reinit(snddev_info *d);
extern int mixer_set(snddev_info *d, unsigned dev, unsigned lev);
extern int mixer_get(snddev_info *d, int dev);
extern int mixer_setrecsrc(snddev_info *d, u_int32_t src);