diff options
author | gkoehler <gkoehler@cvs.openbsd.org> | 2020-06-06 21:01:31 +0000 |
---|---|---|
committer | gkoehler <gkoehler@cvs.openbsd.org> | 2020-06-06 21:01:31 +0000 |
commit | 59341e2d230985d837aed4db8bdaa2e4f3139833 (patch) | |
tree | 244a5a07a12e7426c80d498aa2024fd4ad82517b /sys/arch/macppc | |
parent | 93b488e1c1f2210b67cfebb6d409a4a9761d419a (diff) |
Move PowerBook5,4 audio from aoa(4) to snapper(4).
This adds the missing TAS3004 volume control. Before, I put my ear
near the speaker (to hear audio), because I had no way to turn up the
volume. Now, the default volume is much louder, so I use sndioctl(1)
to turn it down.
Check for the model string "PowerBook5,4". This model's device tree
has compatible = "AOAKeylargo" for the audio, doesn't show the TAS3004
in the same way as other models.
Diffstat (limited to 'sys/arch/macppc')
-rw-r--r-- | sys/arch/macppc/dev/aoa.c | 7 | ||||
-rw-r--r-- | sys/arch/macppc/dev/snapper.c | 7 |
2 files changed, 11 insertions, 3 deletions
diff --git a/sys/arch/macppc/dev/aoa.c b/sys/arch/macppc/dev/aoa.c index f4d2d367105..85b015a58b5 100644 --- a/sys/arch/macppc/dev/aoa.c +++ b/sys/arch/macppc/dev/aoa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aoa.c,v 1.9 2016/09/19 06:46:43 ratchov Exp $ */ +/* $OpenBSD: aoa.c,v 1.10 2020/06/06 21:01:30 gkoehler Exp $ */ /*- * Copyright (c) 2005 Tsubai Masanari. All rights reserved. @@ -57,6 +57,8 @@ void aoa_attach(struct device *, struct device *, void *); void aoa_defer(struct device *); void aoa_set_volume(struct aoa_softc *, int, int); +extern char *hw_prod; + struct cfattach aoa_ca = { sizeof(struct aoa_softc), aoa_match, aoa_attach }; @@ -107,7 +109,8 @@ aoa_match(struct device *parent, void *match, void *aux) bzero(compat, sizeof compat); OF_getprop(soundchip, "compatible", compat, sizeof compat); - if (strcmp(compat, "AOAKeylargo") == 0) + if (strcmp(compat, "AOAKeylargo") == 0 && + strcmp(hw_prod, "PowerBook5,4") != 0) return (1); if (strcmp(compat, "AOAK2") == 0) return (1); diff --git a/sys/arch/macppc/dev/snapper.c b/sys/arch/macppc/dev/snapper.c index 8297fe5731d..a4ebd7f54f3 100644 --- a/sys/arch/macppc/dev/snapper.c +++ b/sys/arch/macppc/dev/snapper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: snapper.c,v 1.37 2016/09/19 06:46:43 ratchov Exp $ */ +/* $OpenBSD: snapper.c,v 1.38 2020/06/06 21:01:30 gkoehler Exp $ */ /* $NetBSD: snapper.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */ /*- @@ -70,6 +70,8 @@ void snapper_set_input(struct snapper_softc *, int); int tas3004_write(struct snapper_softc *, u_int, const void *); int tas3004_init(struct snapper_softc *); +extern char *hw_prod; + struct cfattach snapper_ca = { sizeof(struct snapper_softc), snapper_match, snapper_attach }; @@ -442,6 +444,9 @@ snapper_match(struct device *parent, void *match, void *aux) bzero(compat, sizeof compat); OF_getprop(soundchip, "compatible", compat, sizeof compat); + if (strcmp(compat, "AOAKeylargo") == 0 && + strcmp(hw_prod, "PowerBook5,4") == 0) + return (1); if (strcmp(compat, "snapper") == 0) return (1); |