summaryrefslogtreecommitdiff
path: root/sys/dev/fdt/tascodec.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2023-02-04 20:04:21 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2023-02-04 20:04:21 +0000
commit9d827b4dfb7778e7fa31a3ab240b311fe142c726 (patch)
treec14621efc53145fb02a83d4d771f3dd0dd2b08be /sys/dev/fdt/tascodec.c
parentabc876fa38da5d346544477df175f74a6f057bce (diff)
Set default volume to -30 dB instead of using the hardware default of 0 dB
(which means maximum volume). ok patrick@, ratchov@
Diffstat (limited to 'sys/dev/fdt/tascodec.c')
-rw-r--r--sys/dev/fdt/tascodec.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/fdt/tascodec.c b/sys/dev/fdt/tascodec.c
index a7d5b295715..572847c22ff 100644
--- a/sys/dev/fdt/tascodec.c
+++ b/sys/dev/fdt/tascodec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tascodec.c,v 1.5 2022/09/02 16:53:28 kettenis Exp $ */
+/* $OpenBSD: tascodec.c,v 1.6 2023/02/04 20:04:20 kettenis Exp $ */
/*
* Copyright (c) 2022 Mark Kettenis <kettenis@openbsd.org>
*
@@ -40,6 +40,7 @@
#define PWR_CTL_MODE_SHUTDOWN (2 << 0)
#define PB_CFG2 0x05
#define PB_CFG2_DVC_PCM_MIN 0xc9
+#define PB_CFG2_DVC_PCM_30DB 0x3c
#define TDM_CFG0 0x0a
#define TDM_CFG0_FRAME_START (1 << 0)
#define TDM_CFG1 0x0b
@@ -135,9 +136,9 @@ tascodec_attach(struct device *parent, struct device *self, void *aux)
delay(1000);
}
- sc->sc_dvc = tascodec_read(sc, PB_CFG2);
- if (sc->sc_dvc > PB_CFG2_DVC_PCM_MIN)
- sc->sc_dvc = PB_CFG2_DVC_PCM_MIN;
+ /* Set volume to a reasonable level. */
+ sc->sc_dvc = PB_CFG2_DVC_PCM_30DB;
+ tascodec_write(sc, PB_CFG2, sc->sc_dvc);
/* Default to stereo downmix mode for now. */
cfg2 = tascodec_read(sc, TDM_CFG2);