summaryrefslogtreecommitdiff
path: root/include/sound/sdca_function.h
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2025-03-12 17:22:05 +0000
committerMark Brown <broonie@kernel.org>2025-03-16 23:27:58 +0000
commitd1cd13f80dc6c8525c539a28d4eb1df913d542de (patch)
tree1036ba857567f598dd588754e07d679cb0598884 /include/sound/sdca_function.h
parent1bcbb88bedb17804491e692a3f1a38223e09152c (diff)
ASoC: SDCA: Add support for GE Entity properties
Add support for parsing the Group Entity properties from DisCo/ACPI. Group Entities allow control of several other Entities, typically Selector Units, from a single control. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20250312172205.4152686-7-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound/sdca_function.h')
-rw-r--r--include/sound/sdca_function.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/include/sound/sdca_function.h b/include/sound/sdca_function.h
index d7489e3c7e47..253654568a41 100644
--- a/include/sound/sdca_function.h
+++ b/include/sound/sdca_function.h
@@ -44,6 +44,11 @@ struct sdca_function_desc;
*/
#define SDCA_MAX_DELAY_COUNT 256
+/*
+ * Sanity check on size of affected controls data, can be expanded if needed.
+ */
+#define SDCA_MAX_AFFECTED_COUNT 2048
+
/**
* enum sdca_function_type - SDCA Function Type codes
* @SDCA_FUNCTION_TYPE_SMART_AMP: Amplifier with protection features.
@@ -928,10 +933,50 @@ enum sdca_entity_type {
};
/**
+ * struct sdca_ge_control - control entry in the affected controls list
+ * @id: Entity ID of the Control affected.
+ * @sel: Control Selector of the Control affected.
+ * @cn: Control Number of the Control affected.
+ * @val: Value written to Control for this Mode.
+ */
+struct sdca_ge_control {
+ int id;
+ int sel;
+ int cn;
+ int val;
+};
+
+/**
+ * struct sdca_ge_mode - mode entry in the affected controls list
+ * @controls: Dynamically allocated array of controls written for this Mode.
+ * @num_controls: Number of controls written in this Mode.
+ * @val: GE Selector Mode value.
+ */
+struct sdca_ge_mode {
+ struct sdca_ge_control *controls;
+ int num_controls;
+ int val;
+};
+
+/**
+ * struct sdca_entity_ge - information specific to Group Entities
+ * @kctl: ALSA control pointer that can be used by linked Entities.
+ * @modes: Dynamically allocated array of Modes and the Controls written
+ * in each mode.
+ * @num_modes: Number of Modes.
+ */
+struct sdca_entity_ge {
+ struct snd_kcontrol_new *kctl;
+ struct sdca_ge_mode *modes;
+ int num_modes;
+};
+
+/**
* struct sdca_entity - information for one SDCA Entity
* @label: String such as "OT 12".
* @id: Identifier used for addressing.
* @type: Type code for the Entity.
+ * @group: Pointer to Group Entity controlling this one, NULL if N/A.
* @sources: Dynamically allocated array pointing to each input Entity
* connected to this Entity.
* @controls: Dynamically allocated array of Controls.
@@ -940,12 +985,14 @@ enum sdca_entity_type {
* @iot: Input/Output Terminal specific Entity properties.
* @cs: Clock Source specific Entity properties.
* @pde: Power Domain Entity specific Entity properties.
+ * @ge: Group Entity specific Entity properties.
*/
struct sdca_entity {
const char *label;
int id;
enum sdca_entity_type type;
+ struct sdca_entity *group;
struct sdca_entity **sources;
struct sdca_control *controls;
int num_sources;
@@ -954,6 +1001,7 @@ struct sdca_entity {
struct sdca_entity_iot iot;
struct sdca_entity_cs cs;
struct sdca_entity_pde pde;
+ struct sdca_entity_ge ge;
};
};