diff options
| author | Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> | 2025-02-05 11:37:54 +0000 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2025-02-07 17:34:02 +0000 |
| commit | 19f6748abbab8523a7b32a5e371e39d4d8d4aba5 (patch) | |
| tree | 7e0c6336fda2bd006a34c42478f51a3fddd77b47 /include/sound/sdca_function.h | |
| parent | 996bf834d0b61cb5a1389356c1ed7db1230139d7 (diff) | |
ASoC: SDCA: Parse initialization write table
Each SDCA Function may contain a table of register writes that should be
written out before the Function is used. Add code to parse this table
from the DisCo tables in ACPI.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://patch.msgid.link/20250205113801.3699902-4-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.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/sound/sdca_function.h b/include/sound/sdca_function.h index 3f4031d285d6..47fc1da8e4f3 100644 --- a/include/sound/sdca_function.h +++ b/include/sound/sdca_function.h @@ -10,6 +10,7 @@ #define __SDCA_FUNCTION_H__ #include <linux/bits.h> +#include <linux/types.h> struct device; struct sdca_function_desc; @@ -20,6 +21,11 @@ struct sdca_function_desc; */ #define SDCA_MAX_ENTITY_COUNT 128 +/* + * Sanity check on number of initialization writes, can be expanded if needed. + */ +#define SDCA_MAX_INIT_COUNT 2048 + /** * enum sdca_function_type - SDCA Function Type codes * @SDCA_FUNCTION_TYPE_SMART_AMP: Amplifier with protection features. @@ -66,6 +72,16 @@ enum sdca_function_type { #define SDCA_FUNCTION_TYPE_IMP_DEF_NAME "ImplementationDefined" /** + * struct sdca_init_write - a single initialization write + * @addr: Register address to be written + * @val: Single byte value to be written + */ +struct sdca_init_write { + u32 addr; + u8 val; +}; + +/** * enum sdca_entity0_controls - SDCA Controls for Entity 0 * * Control Selectors for Entity 0 from SDCA specification v1.0 Section @@ -167,7 +183,9 @@ struct sdca_entity { /** * struct sdca_function_data - top-level information for one SDCA function * @desc: Pointer to short descriptor from initial parsing. + * @init_table: Pointer to a table of initialization writes. * @entities: Dynamically allocated array of Entities. + * @num_init_table: Number of initialization writes. * @num_entities: Number of Entities reported in this Function. * @busy_max_delay: Maximum Function busy delay in microseconds, before an * error should be reported. @@ -175,7 +193,9 @@ struct sdca_entity { struct sdca_function_data { struct sdca_function_desc *desc; + struct sdca_init_write *init_table; struct sdca_entity *entities; + int num_init_table; int num_entities; unsigned int busy_max_delay; |