From 2a4667f3d589524bd2fbfe4f7dc0e2f12b832e10 Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Wed, 12 Mar 2025 17:22:03 +0000 Subject: ASoC: SDCA: Add type flag for Controls SDCA Controls come in a variety of data formats, to simplify later parsing work out this data type as the control is parsed and stash it for later use. Signed-off-by: Charles Keepax Link: https://patch.msgid.link/20250312172205.4152686-5-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown --- include/sound/sdca_function.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'include') diff --git a/include/sound/sdca_function.h b/include/sound/sdca_function.h index f001ab643fed..ca0376903e87 100644 --- a/include/sound/sdca_function.h +++ b/include/sound/sdca_function.h @@ -600,6 +600,27 @@ enum sdca_entity0_controls { #define SDCA_CTL_DEVICE_VERSION_NAME "Device Version" #define SDCA_CTL_DEVICE_SDCA_VERSION_NAME "Device SDCA Version" +/** + * enum sdca_control_datatype - SDCA Control Data Types + * + * Data Types as described in the SDCA specification v1.0 section + * 7.3. + */ +enum sdca_control_datatype { + SDCA_CTL_DATATYPE_ONEBIT, + SDCA_CTL_DATATYPE_INTEGER, + SDCA_CTL_DATATYPE_SPEC_ENCODED_VALUE, + SDCA_CTL_DATATYPE_BCD, + SDCA_CTL_DATATYPE_Q7P8DB, + SDCA_CTL_DATATYPE_BYTEINDEX, + SDCA_CTL_DATATYPE_POSTURENUMBER, + SDCA_CTL_DATATYPE_DP_INDEX, + SDCA_CTL_DATATYPE_BITINDEX, + SDCA_CTL_DATATYPE_BITMAP, + SDCA_CTL_DATATYPE_GUID, + SDCA_CTL_DATATYPE_IMPDEF, +}; + /** * enum sdca_access_mode - SDCA Control access mode * @@ -653,6 +674,7 @@ struct sdca_control_range { * @cn_list: A bitmask showing the valid Control Numbers within this Control, * Control Numbers typically represent channels. * @range: Buffer describing valid range of values for the Control. + * @type: Format of the data in the Control. * @mode: Access mode of the Control. * @layers: Bitmask of access layers of the Control. * @deferrable: Indicates if the access to the Control can be deferred. @@ -669,6 +691,7 @@ struct sdca_control { u64 cn_list; struct sdca_control_range range; + enum sdca_control_datatype type; enum sdca_access_mode mode; u8 layers; -- cgit v1.2.3