summaryrefslogtreecommitdiff
path: root/src/vendorcode/google/dsm_calib.h
diff options
context:
space:
mode:
authorMatt DeVillier <matt.devillier@gmail.com>2023-01-17 13:51:29 -0600
committerMatt DeVillier <matt.devillier@amd.corp-partner.google.com>2023-05-05 15:38:53 +0000
commit1db8c57470f373787448d8fb8961b0dc1208a953 (patch)
tree0671fc7de6fef5690a199b524a59d5bf04d5f7cb /src/vendorcode/google/dsm_calib.h
parentb78e4620375cc5668db668d900340fd89271c330 (diff)
vc/google: Decouple DSM_CALIB from CHROMEOS
DSM (Dynamic Speaker Management) uses calibration parameters stored in a VPD (Vital Product Data) FMAP region to configure the audio output via an ACPI _DSD table. This has no dependency on a ChromeOS, and can be used by Linux/Windows drivers if appropriately configured. Remove the dependency of DSM_CALIB (and the calibration file) on CHROMEOS and replace it with VPD, so that non-CHROMEOS builds can utilize this feature as well. Move files from underneath vc/google/chromeos to underscore the point. TEST=build/boot google/nightfury, dump ACPI, verify DSM calibraton parameters present in _DSD table. Change-Id: I643b3581bcc662befc9e30736dae806f94b055af Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/74812 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: CoolStar <coolstarorganization@gmail.com> Reviewed-by: Sean Rhodes <sean@starlabs.systems> Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Diffstat (limited to 'src/vendorcode/google/dsm_calib.h')
-rw-r--r--src/vendorcode/google/dsm_calib.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/vendorcode/google/dsm_calib.h b/src/vendorcode/google/dsm_calib.h
new file mode 100644
index 0000000000..efbfe045c1
--- /dev/null
+++ b/src/vendorcode/google/dsm_calib.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __DSM_CALIB_H__
+#define __DSM_CALIB_H__
+
+#include <stddef.h>
+#include <stdint.h>
+#include <types.h>
+
+/**
+ * get_dsm_calibration_from_key - Gets value related to DSM calibration from VPD
+ * @key: The key in RO_VPD. The valid prefix is "dsm_calib_". The valid keys are
+ * documented in https://chromeos.google.com/partner/dlm/docs/factory/vpd.html.
+ * @value: Output value. The value read from VPD parsed into uint64_t integer.
+ *
+ * Returns CB_SUCCESS on success or CB_ERR on failure.
+ */
+enum cb_err get_dsm_calibration_from_key(const char *key, uint64_t *value);
+
+#endif /* __DSM_CALIB_H__ */