From 9d827b4dfb7778e7fa31a3ab240b311fe142c726 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sat, 4 Feb 2023 20:04:21 +0000 Subject: Set default volume to -30 dB instead of using the hardware default of 0 dB (which means maximum volume). ok patrick@, ratchov@ --- sys/dev/fdt/tascodec.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sys/dev') 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 * @@ -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); -- cgit v1.2.3