summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/arm64/dev/aplaudio.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/arch/arm64/dev/aplaudio.c b/sys/arch/arm64/dev/aplaudio.c
index 6c3665440ae..28e2aad2f1d 100644
--- a/sys/arch/arm64/dev/aplaudio.c
+++ b/sys/arch/arm64/dev/aplaudio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aplaudio.c,v 1.5 2022/12/05 07:30:51 kettenis Exp $ */
+/* $OpenBSD: aplaudio.c,v 1.6 2023/01/14 23:35:09 kettenis Exp $ */
/*
* Copyright (c) 2022 Mark Kettenis <kettenis@openbsd.org>
* Copyright (c) 2020 Patrick Wildt <patrick@blueri.se>
@@ -195,8 +195,18 @@ aplaudio_set_tdm_slots(struct aplaudio_softc *sc)
dai = sc->sc_dai_codec[i];
if (dai == NULL)
continue;
- if (dai->dd_set_tdm_slot)
- dai->dd_set_tdm_slot(dai->dd_cookie, i % 2);
+ if (dai->dd_set_tdm_slot) {
+ char prefix[8];
+ int slot = 0;
+
+ if (OF_getprop(dai->dd_node, "sound-name-prefix",
+ prefix, sizeof(prefix)) > 0) {
+ if (strncmp(prefix, "Right", 5) == 0)
+ slot = 1;
+ }
+
+ dai->dd_set_tdm_slot(dai->dd_cookie, slot);
+ }
}
}