static int ua_mixer_set(struct snd_mixer *m, unsigned type, unsigned left, unsigned right) { device_t pa_dev; struct ua_info *ua = mix_getdevinfo(m); pa_dev = device_get_parent(ua->sc_dev); uaudio_mixer_set(pa_dev, type, left, right); return left | (right << 8); }
static int ua_mixer_set(struct snd_mixer *m, unsigned type, unsigned left, unsigned right) { struct lock *lock = mixer_get_lock(m); uint8_t do_unlock; if (lockowned(lock)) { do_unlock = 0; } else { do_unlock = 1; lockmgr(lock, LK_EXCLUSIVE); } uaudio_mixer_set(mix_getdevinfo(m), type, left, right); if (do_unlock) { lockmgr(lock, LK_RELEASE); } return (left | (right << 8)); }
static int ua_mixer_set(struct snd_mixer *m, unsigned type, unsigned left, unsigned right) { struct mtx *mtx = mixer_get_lock(m); uint8_t do_unlock; if (mtx_owned(mtx)) { do_unlock = 0; } else { do_unlock = 1; mtx_lock(mtx); } uaudio_mixer_set(mix_getdevinfo(m), type, left, right); if (do_unlock) { mtx_unlock(mtx); } return (left | (right << 8)); }