aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorChristos Margiolis <christos@FreeBSD.org>2026-04-16 12:41:13 +0000
committerChristos Margiolis <christos@FreeBSD.org>2026-05-27 15:32:12 +0000
commit1e72608a3c6a60b76938c5ded2a290d0b9ff6456 (patch)
tree623c39ac2fa0f97b3832e77ed64230f97c3d10a7 /sys/dev
parente87654db5a0923856afbaace9bd0975331782044 (diff)
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sound/macio/onyx.c17
-rw-r--r--sys/dev/sound/macio/snapper.c17
-rw-r--r--sys/dev/sound/macio/tumbler.c17
3 files changed, 0 insertions, 51 deletions
diff --git a/sys/dev/sound/macio/onyx.c b/sys/dev/sound/macio/onyx.c
index f4f825a705cc..5ba22dd7c495 100644
--- a/sys/dev/sound/macio/onyx.c
+++ b/sys/dev/sound/macio/onyx.c
@@ -268,38 +268,21 @@ static int
onyx_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
{
struct onyx_softc *sc;
- struct mtx *mixer_lock;
- int locked;
uint8_t l, r;
sc = device_get_softc(mix_getdevinfo(m));
- mixer_lock = mixer_get_lock(m);
- locked = mtx_owned(mixer_lock);
switch (dev) {
case SOUND_MIXER_VOLUME:
-
- /*
- * We need to unlock the mixer lock because iicbus_transfer()
- * may sleep. The mixer lock itself is unnecessary here
- * because it is meant to serialize hardware access, which
- * is taken care of by the I2C layer, so this is safe.
- */
if (left > 100 || right > 100)
return (0);
l = left + 128;
r = right + 128;
- if (locked)
- mtx_unlock(mixer_lock);
-
onyx_write(sc, PCM3052_REG_LEFT_ATTN, l);
onyx_write(sc, PCM3052_REG_RIGHT_ATTN, r);
- if (locked)
- mtx_lock(mixer_lock);
-
return (left | (right << 8));
}
diff --git a/sys/dev/sound/macio/snapper.c b/sys/dev/sound/macio/snapper.c
index f14009f447a8..ed83990d563b 100644
--- a/sys/dev/sound/macio/snapper.c
+++ b/sys/dev/sound/macio/snapper.c
@@ -436,14 +436,10 @@ static int
snapper_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
{
struct snapper_softc *sc;
- struct mtx *mixer_lock;
- int locked;
u_int l, r;
u_char reg[6];
sc = device_get_softc(mix_getdevinfo(m));
- mixer_lock = mixer_get_lock(m);
- locked = mtx_owned(mixer_lock);
if (left > 100 || right > 100)
return (0);
@@ -460,21 +456,8 @@ snapper_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
reg[4] = (r & 0x00ff00) >> 8;
reg[5] = r & 0x0000ff;
- /*
- * We need to unlock the mixer lock because iicbus_transfer()
- * may sleep. The mixer lock itself is unnecessary here
- * because it is meant to serialize hardware access, which
- * is taken care of by the I2C layer, so this is safe.
- */
-
- if (locked)
- mtx_unlock(mixer_lock);
-
snapper_write(sc, SNAPPER_VOLUME, reg);
- if (locked)
- mtx_lock(mixer_lock);
-
return (left | (right << 8));
}
diff --git a/sys/dev/sound/macio/tumbler.c b/sys/dev/sound/macio/tumbler.c
index bd40ea6b4f6b..89af4434e7fe 100644
--- a/sys/dev/sound/macio/tumbler.c
+++ b/sys/dev/sound/macio/tumbler.c
@@ -383,14 +383,10 @@ static int
tumbler_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
{
struct tumbler_softc *sc;
- struct mtx *mixer_lock;
- int locked;
u_int l, r;
u_char reg[6];
sc = device_get_softc(mix_getdevinfo(m));
- mixer_lock = mixer_get_lock(m);
- locked = mtx_owned(mixer_lock);
switch (dev) {
case SOUND_MIXER_VOLUME:
@@ -407,21 +403,8 @@ tumbler_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
reg[4] = (r & 0x00ff00) >> 8;
reg[5] = r & 0x0000ff;
- /*
- * We need to unlock the mixer lock because iicbus_transfer()
- * may sleep. The mixer lock itself is unnecessary here
- * because it is meant to serialize hardware access, which
- * is taken care of by the I2C layer, so this is safe.
- */
-
- if (locked)
- mtx_unlock(mixer_lock);
-
tumbler_write(sc, TUMBLER_VOLUME, reg);
- if (locked)
- mtx_lock(mixer_lock);
-
return (left | (right << 8));
}