xref: /linux-6.15/include/sound/sdca_function.h (revision d1cd13f8)
13a513da1SPierre-Louis Bossart /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
23a513da1SPierre-Louis Bossart /*
33a513da1SPierre-Louis Bossart  * The MIPI SDCA specification is available for public downloads at
43a513da1SPierre-Louis Bossart  * https://www.mipi.org/mipi-sdca-v1-0-download
53a513da1SPierre-Louis Bossart  *
63a513da1SPierre-Louis Bossart  * Copyright(c) 2024 Intel Corporation
73a513da1SPierre-Louis Bossart  */
83a513da1SPierre-Louis Bossart 
93a513da1SPierre-Louis Bossart #ifndef __SDCA_FUNCTION_H__
103a513da1SPierre-Louis Bossart #define __SDCA_FUNCTION_H__
113a513da1SPierre-Louis Bossart 
12deb01520SCharles Keepax #include <linux/bits.h>
1319f6748aSPierre-Louis Bossart #include <linux/types.h>
14deb01520SCharles Keepax 
15996bf834SPierre-Louis Bossart struct device;
165c93b20fSCharles Keepax struct sdca_entity;
17996bf834SPierre-Louis Bossart struct sdca_function_desc;
18996bf834SPierre-Louis Bossart 
19996bf834SPierre-Louis Bossart /*
20996bf834SPierre-Louis Bossart  * The addressing space for SDCA relies on 7 bits for Entities, so a
21996bf834SPierre-Louis Bossart  * maximum of 128 Entities per function can be represented.
22996bf834SPierre-Louis Bossart  */
23996bf834SPierre-Louis Bossart #define SDCA_MAX_ENTITY_COUNT 128
24996bf834SPierre-Louis Bossart 
2519f6748aSPierre-Louis Bossart /*
2619f6748aSPierre-Louis Bossart  * Sanity check on number of initialization writes, can be expanded if needed.
2719f6748aSPierre-Louis Bossart  */
2819f6748aSPierre-Louis Bossart #define SDCA_MAX_INIT_COUNT 2048
2919f6748aSPierre-Louis Bossart 
30f87c2a27SCharles Keepax /*
31f87c2a27SCharles Keepax  * The Cluster IDs are 16-bit, so a maximum of 65535 Clusters per
32f87c2a27SCharles Keepax  * function can be represented, however limit this to a slightly
33f87c2a27SCharles Keepax  * more reasonable value. Can be expanded if needed.
34f87c2a27SCharles Keepax  */
35f87c2a27SCharles Keepax #define SDCA_MAX_CLUSTER_COUNT 256
36f87c2a27SCharles Keepax 
37f87c2a27SCharles Keepax /*
38f87c2a27SCharles Keepax  * Sanity check on number of channels per Cluster, can be expanded if needed.
39f87c2a27SCharles Keepax  */
40f87c2a27SCharles Keepax #define SDCA_MAX_CHANNEL_COUNT 32
41f87c2a27SCharles Keepax 
429da19588SCharles Keepax /*
439da19588SCharles Keepax  * Sanity check on number of PDE delays, can be expanded if needed.
449da19588SCharles Keepax  */
459da19588SCharles Keepax #define SDCA_MAX_DELAY_COUNT 256
469da19588SCharles Keepax 
47*d1cd13f8SCharles Keepax /*
48*d1cd13f8SCharles Keepax  * Sanity check on size of affected controls data, can be expanded if needed.
49*d1cd13f8SCharles Keepax  */
50*d1cd13f8SCharles Keepax #define SDCA_MAX_AFFECTED_COUNT 2048
51*d1cd13f8SCharles Keepax 
52629dd55cSCharles Keepax /**
53629dd55cSCharles Keepax  * enum sdca_function_type - SDCA Function Type codes
54629dd55cSCharles Keepax  * @SDCA_FUNCTION_TYPE_SMART_AMP: Amplifier with protection features.
55629dd55cSCharles Keepax  * @SDCA_FUNCTION_TYPE_SIMPLE_AMP: Subset of SmartAmp.
56629dd55cSCharles Keepax  * @SDCA_FUNCTION_TYPE_SMART_MIC: Smart microphone with acoustic triggers.
57629dd55cSCharles Keepax  * @SDCA_FUNCTION_TYPE_SIMPLE_MIC: Subset of SmartMic.
58629dd55cSCharles Keepax  * @SDCA_FUNCTION_TYPE_SPEAKER_MIC: Combination of SmartMic and SmartAmp.
59629dd55cSCharles Keepax  * @SDCA_FUNCTION_TYPE_UAJ: 3.5mm Universal Audio jack.
60629dd55cSCharles Keepax  * @SDCA_FUNCTION_TYPE_RJ: Retaskable jack.
61629dd55cSCharles Keepax  * @SDCA_FUNCTION_TYPE_SIMPLE_JACK: Subset of UAJ.
62629dd55cSCharles Keepax  * @SDCA_FUNCTION_TYPE_HID: Human Interface Device, for e.g. buttons.
63629dd55cSCharles Keepax  * @SDCA_FUNCTION_TYPE_IMP_DEF: Implementation-defined function.
64629dd55cSCharles Keepax  *
653a513da1SPierre-Louis Bossart  * SDCA Function Types from SDCA specification v1.0a Section 5.1.2
66629dd55cSCharles Keepax  * all Function types not described are reserved.
67629dd55cSCharles Keepax  *
683a513da1SPierre-Louis Bossart  * Note that SIMPLE_AMP, SIMPLE_MIC and SIMPLE_JACK Function Types
693a513da1SPierre-Louis Bossart  * are NOT defined in SDCA 1.0a, but they were defined in earlier
703a513da1SPierre-Louis Bossart  * drafts and are planned for 1.1.
713a513da1SPierre-Louis Bossart  */
723a513da1SPierre-Louis Bossart enum sdca_function_type {
73629dd55cSCharles Keepax 	SDCA_FUNCTION_TYPE_SMART_AMP			= 0x01,
74629dd55cSCharles Keepax 	SDCA_FUNCTION_TYPE_SIMPLE_AMP			= 0x02,
75629dd55cSCharles Keepax 	SDCA_FUNCTION_TYPE_SMART_MIC			= 0x03,
76629dd55cSCharles Keepax 	SDCA_FUNCTION_TYPE_SIMPLE_MIC			= 0x04,
77629dd55cSCharles Keepax 	SDCA_FUNCTION_TYPE_SPEAKER_MIC			= 0x05,
78629dd55cSCharles Keepax 	SDCA_FUNCTION_TYPE_UAJ				= 0x06,
79629dd55cSCharles Keepax 	SDCA_FUNCTION_TYPE_RJ				= 0x07,
80629dd55cSCharles Keepax 	SDCA_FUNCTION_TYPE_SIMPLE_JACK			= 0x08,
81629dd55cSCharles Keepax 	SDCA_FUNCTION_TYPE_HID				= 0x0A,
82629dd55cSCharles Keepax 	SDCA_FUNCTION_TYPE_IMP_DEF			= 0x1F,
833a513da1SPierre-Louis Bossart };
843a513da1SPierre-Louis Bossart 
853a513da1SPierre-Louis Bossart /* Human-readable names used for kernel logs and Function device registration/bind */
863a513da1SPierre-Louis Bossart #define	SDCA_FUNCTION_TYPE_SMART_AMP_NAME		"SmartAmp"
873a513da1SPierre-Louis Bossart #define	SDCA_FUNCTION_TYPE_SIMPLE_AMP_NAME		"SimpleAmp"
883a513da1SPierre-Louis Bossart #define	SDCA_FUNCTION_TYPE_SMART_MIC_NAME		"SmartMic"
893a513da1SPierre-Louis Bossart #define	SDCA_FUNCTION_TYPE_SIMPLE_MIC_NAME		"SimpleMic"
903a513da1SPierre-Louis Bossart #define	SDCA_FUNCTION_TYPE_SPEAKER_MIC_NAME		"SpeakerMic"
913a513da1SPierre-Louis Bossart #define	SDCA_FUNCTION_TYPE_UAJ_NAME			"UAJ"
923a513da1SPierre-Louis Bossart #define	SDCA_FUNCTION_TYPE_RJ_NAME			"RJ"
933a513da1SPierre-Louis Bossart #define	SDCA_FUNCTION_TYPE_SIMPLE_NAME			"SimpleJack"
943a513da1SPierre-Louis Bossart #define	SDCA_FUNCTION_TYPE_HID_NAME			"HID"
95c1ed5eb1SCharles Keepax #define	SDCA_FUNCTION_TYPE_IMP_DEF_NAME			"ImplementationDefined"
963a513da1SPierre-Louis Bossart 
97629dd55cSCharles Keepax /**
9819f6748aSPierre-Louis Bossart  * struct sdca_init_write - a single initialization write
9919f6748aSPierre-Louis Bossart  * @addr: Register address to be written
10019f6748aSPierre-Louis Bossart  * @val: Single byte value to be written
10119f6748aSPierre-Louis Bossart  */
10219f6748aSPierre-Louis Bossart struct sdca_init_write {
10319f6748aSPierre-Louis Bossart 	u32 addr;
10419f6748aSPierre-Louis Bossart 	u8 val;
10519f6748aSPierre-Louis Bossart };
10619f6748aSPierre-Louis Bossart 
10719f6748aSPierre-Louis Bossart /**
10842b144cbSCharles Keepax  * define SDCA_CTL_TYPE - create a unique identifier for an SDCA Control
10942b144cbSCharles Keepax  * @ent: Entity Type code.
11042b144cbSCharles Keepax  * @sel: Control Selector code.
11142b144cbSCharles Keepax  *
11242b144cbSCharles Keepax  * Sometimes there is a need to identify a type of Control, for example to
11342b144cbSCharles Keepax  * determine what name the control should have. SDCA Selectors are reused
11442b144cbSCharles Keepax  * across Entity types, as such it is necessary to combine both the Entity
11542b144cbSCharles Keepax  * Type and the Control Selector to obtain a unique identifier.
11642b144cbSCharles Keepax  */
11742b144cbSCharles Keepax #define SDCA_CTL_TYPE(ent, sel) ((ent) << 8 | (sel))
11842b144cbSCharles Keepax 
11942b144cbSCharles Keepax /**
12042b144cbSCharles Keepax  * define SDCA_CTL_TYPE_S - static version of SDCA_CTL_TYPE
12142b144cbSCharles Keepax  * @ent: Entity name, for example IT, MFPU, etc. this string can be read
12242b144cbSCharles Keepax  * from the last characters of the SDCA_ENTITY_TYPE_* macros.
12342b144cbSCharles Keepax  * @sel: Control Selector name, for example MIC_BIAS, MUTE, etc. this
12442b144cbSCharles Keepax  * string can be read from the last characters of the SDCA_CTL_*_*
12542b144cbSCharles Keepax  * macros.
12642b144cbSCharles Keepax  *
12742b144cbSCharles Keepax  * Short hand to specific a Control type statically for example:
12842b144cbSCharles Keepax  * SDAC_CTL_TYPE_S(IT, MIC_BIAS).
12942b144cbSCharles Keepax  */
13042b144cbSCharles Keepax #define SDCA_CTL_TYPE_S(ent, sel) SDCA_CTL_TYPE(SDCA_ENTITY_TYPE_##ent, \
13142b144cbSCharles Keepax 						SDCA_CTL_##ent##_##sel)
13242b144cbSCharles Keepax 
13342b144cbSCharles Keepax /**
13442b144cbSCharles Keepax  * enum sdca_it_controls - SDCA Controls for Input Terminal
13542b144cbSCharles Keepax  *
13642b144cbSCharles Keepax  * Control Selectors for Input Terminal from SDCA specification v1.0
13742b144cbSCharles Keepax  * section 6.2.1.3.
13842b144cbSCharles Keepax  */
13942b144cbSCharles Keepax enum sdca_it_controls {
14042b144cbSCharles Keepax 	SDCA_CTL_IT_MIC_BIAS				= 0x03,
14142b144cbSCharles Keepax 	SDCA_CTL_IT_USAGE				= 0x04,
14242b144cbSCharles Keepax 	SDCA_CTL_IT_LATENCY				= 0x08,
14342b144cbSCharles Keepax 	SDCA_CTL_IT_CLUSTERINDEX			= 0x10,
14442b144cbSCharles Keepax 	SDCA_CTL_IT_DATAPORT_SELECTOR			= 0x11,
14542b144cbSCharles Keepax 	SDCA_CTL_IT_MATCHING_GUID			= 0x12,
14642b144cbSCharles Keepax 	SDCA_CTL_IT_KEEP_ALIVE				= 0x13,
14742b144cbSCharles Keepax 	SDCA_CTL_IT_NDAI_STREAM				= 0x14,
14842b144cbSCharles Keepax 	SDCA_CTL_IT_NDAI_CATEGORY			= 0x15,
14942b144cbSCharles Keepax 	SDCA_CTL_IT_NDAI_CODINGTYPE			= 0x16,
15042b144cbSCharles Keepax 	SDCA_CTL_IT_NDAI_PACKETTYPE			= 0x17,
15142b144cbSCharles Keepax };
15242b144cbSCharles Keepax 
15342b144cbSCharles Keepax /**
15442b144cbSCharles Keepax  * enum sdca_ot_controls - SDCA Controls for Output Terminal
15542b144cbSCharles Keepax  *
15642b144cbSCharles Keepax  * Control Selectors for Output Terminal from SDCA specification v1.0
15742b144cbSCharles Keepax  * section 6.2.2.3.
15842b144cbSCharles Keepax  */
15942b144cbSCharles Keepax enum sdca_ot_controls {
16042b144cbSCharles Keepax 	SDCA_CTL_OT_USAGE				= 0x04,
16142b144cbSCharles Keepax 	SDCA_CTL_OT_LATENCY				= 0x08,
16242b144cbSCharles Keepax 	SDCA_CTL_OT_DATAPORT_SELECTOR			= 0x11,
16342b144cbSCharles Keepax 	SDCA_CTL_OT_MATCHING_GUID			= 0x12,
16442b144cbSCharles Keepax 	SDCA_CTL_OT_KEEP_ALIVE				= 0x13,
16542b144cbSCharles Keepax 	SDCA_CTL_OT_NDAI_STREAM				= 0x14,
16642b144cbSCharles Keepax 	SDCA_CTL_OT_NDAI_CATEGORY			= 0x15,
16742b144cbSCharles Keepax 	SDCA_CTL_OT_NDAI_CODINGTYPE			= 0x16,
16842b144cbSCharles Keepax 	SDCA_CTL_OT_NDAI_PACKETTYPE			= 0x17,
16942b144cbSCharles Keepax };
17042b144cbSCharles Keepax 
17142b144cbSCharles Keepax /**
17242b144cbSCharles Keepax  * enum sdca_mu_controls - SDCA Controls for Mixer Unit
17342b144cbSCharles Keepax  *
17442b144cbSCharles Keepax  * Control Selectors for Mixer Unit from SDCA specification v1.0
17542b144cbSCharles Keepax  * section 6.3.4.2.
17642b144cbSCharles Keepax  */
17742b144cbSCharles Keepax enum sdca_mu_controls {
17842b144cbSCharles Keepax 	SDCA_CTL_MU_MIXER				= 0x01,
17942b144cbSCharles Keepax 	SDCA_CTL_MU_LATENCY				= 0x06,
18042b144cbSCharles Keepax };
18142b144cbSCharles Keepax 
18242b144cbSCharles Keepax /**
18342b144cbSCharles Keepax  * enum sdca_su_controls - SDCA Controls for Selector Unit
18442b144cbSCharles Keepax  *
18542b144cbSCharles Keepax  * Control Selectors for Selector Unit from SDCA specification v1.0
18642b144cbSCharles Keepax  * section 6.3.8.3.
18742b144cbSCharles Keepax  */
18842b144cbSCharles Keepax enum sdca_su_controls {
18942b144cbSCharles Keepax 	SDCA_CTL_SU_SELECTOR				= 0x01,
19042b144cbSCharles Keepax 	SDCA_CTL_SU_LATENCY				= 0x02,
19142b144cbSCharles Keepax };
19242b144cbSCharles Keepax 
19342b144cbSCharles Keepax /**
19442b144cbSCharles Keepax  * enum sdca_fu_controls - SDCA Controls for Feature Unit
19542b144cbSCharles Keepax  *
19642b144cbSCharles Keepax  * Control Selectors for Feature Unit from SDCA specification v1.0
19742b144cbSCharles Keepax  * section 6.3.2.3.
19842b144cbSCharles Keepax  */
19942b144cbSCharles Keepax enum sdca_fu_controls {
20042b144cbSCharles Keepax 	SDCA_CTL_FU_MUTE				= 0x01,
20142b144cbSCharles Keepax 	SDCA_CTL_FU_CHANNEL_VOLUME			= 0x02,
20242b144cbSCharles Keepax 	SDCA_CTL_FU_AGC					= 0x07,
20342b144cbSCharles Keepax 	SDCA_CTL_FU_BASS_BOOST				= 0x09,
20442b144cbSCharles Keepax 	SDCA_CTL_FU_LOUDNESS				= 0x0A,
20542b144cbSCharles Keepax 	SDCA_CTL_FU_GAIN				= 0x0B,
20642b144cbSCharles Keepax 	SDCA_CTL_FU_LATENCY				= 0x10,
20742b144cbSCharles Keepax };
20842b144cbSCharles Keepax 
20942b144cbSCharles Keepax /**
21042b144cbSCharles Keepax  * enum sdca_xu_controls - SDCA Controls for Extension Unit
21142b144cbSCharles Keepax  *
21242b144cbSCharles Keepax  * Control Selectors for Extension Unit from SDCA specification v1.0
21342b144cbSCharles Keepax  * section 6.3.10.3.
21442b144cbSCharles Keepax  */
21542b144cbSCharles Keepax enum sdca_xu_controls {
21642b144cbSCharles Keepax 	SDCA_CTL_XU_BYPASS				= 0x01,
21742b144cbSCharles Keepax 	SDCA_CTL_XU_LATENCY				= 0x06,
21842b144cbSCharles Keepax 	SDCA_CTL_XU_XU_ID				= 0x07,
21942b144cbSCharles Keepax 	SDCA_CTL_XU_XU_VERSION				= 0x08,
22042b144cbSCharles Keepax 	SDCA_CTL_XU_FDL_CURRENTOWNER			= 0x10,
22142b144cbSCharles Keepax 	SDCA_CTL_XU_FDL_MESSAGEOFFSET			= 0x12,
22242b144cbSCharles Keepax 	SDCA_CTL_XU_FDL_MESSAGELENGTH			= 0x13,
22342b144cbSCharles Keepax 	SDCA_CTL_XU_FDL_STATUS				= 0x14,
22442b144cbSCharles Keepax 	SDCA_CTL_XU_FDL_SET_INDEX			= 0x15,
22542b144cbSCharles Keepax 	SDCA_CTL_XU_FDL_HOST_REQUEST			= 0x16,
22642b144cbSCharles Keepax };
22742b144cbSCharles Keepax 
22842b144cbSCharles Keepax /**
22942b144cbSCharles Keepax  * enum sdca_cs_controls - SDCA Controls for Clock Source
23042b144cbSCharles Keepax  *
23142b144cbSCharles Keepax  * Control Selectors for Clock Source from SDCA specification v1.0
23242b144cbSCharles Keepax  * section 6.4.1.3.
23342b144cbSCharles Keepax  */
23442b144cbSCharles Keepax enum sdca_cs_controls {
23542b144cbSCharles Keepax 	SDCA_CTL_CS_CLOCK_VALID				= 0x02,
23642b144cbSCharles Keepax 	SDCA_CTL_CS_SAMPLERATEINDEX			= 0x10,
23742b144cbSCharles Keepax };
23842b144cbSCharles Keepax 
23942b144cbSCharles Keepax /**
24042b144cbSCharles Keepax  * enum sdca_cx_controls - SDCA Controls for Clock Selector
24142b144cbSCharles Keepax  *
24242b144cbSCharles Keepax  * Control Selectors for Clock Selector from SDCA specification v1.0
24342b144cbSCharles Keepax  * section 6.4.2.3.
24442b144cbSCharles Keepax  */
24542b144cbSCharles Keepax enum sdca_cx_controls {
24642b144cbSCharles Keepax 	SDCA_CTL_CX_CLOCK_SELECT			= 0x01,
24742b144cbSCharles Keepax };
24842b144cbSCharles Keepax 
24942b144cbSCharles Keepax /**
25042b144cbSCharles Keepax  * enum sdca_pde_controls - SDCA Controls for Power Domain Entity
25142b144cbSCharles Keepax  *
25242b144cbSCharles Keepax  * Control Selectors for Power Domain Entity from SDCA specification
25342b144cbSCharles Keepax  * v1.0 section 6.5.2.2.
25442b144cbSCharles Keepax  */
25542b144cbSCharles Keepax enum sdca_pde_controls {
25642b144cbSCharles Keepax 	SDCA_CTL_PDE_REQUESTED_PS			= 0x01,
25742b144cbSCharles Keepax 	SDCA_CTL_PDE_ACTUAL_PS				= 0x10,
25842b144cbSCharles Keepax };
25942b144cbSCharles Keepax 
26042b144cbSCharles Keepax /**
26142b144cbSCharles Keepax  * enum sdca_ge_controls - SDCA Controls for Group Unit
26242b144cbSCharles Keepax  *
26342b144cbSCharles Keepax  * Control Selectors for Group Unit from SDCA specification v1.0
26442b144cbSCharles Keepax  * section 6.5.1.4.
26542b144cbSCharles Keepax  */
26642b144cbSCharles Keepax enum sdca_ge_controls {
26742b144cbSCharles Keepax 	SDCA_CTL_GE_SELECTED_MODE			= 0x01,
26842b144cbSCharles Keepax 	SDCA_CTL_GE_DETECTED_MODE			= 0x02,
26942b144cbSCharles Keepax };
27042b144cbSCharles Keepax 
27142b144cbSCharles Keepax /**
27242b144cbSCharles Keepax  * enum sdca_spe_controls - SDCA Controls for Security & Privacy Unit
27342b144cbSCharles Keepax  *
27442b144cbSCharles Keepax  * Control Selectors for Security & Privacy Unit from SDCA
27542b144cbSCharles Keepax  * specification v1.0 Section 6.5.3.2.
27642b144cbSCharles Keepax  */
27742b144cbSCharles Keepax enum sdca_spe_controls {
27842b144cbSCharles Keepax 	SDCA_CTL_SPE_PRIVATE				= 0x01,
27942b144cbSCharles Keepax 	SDCA_CTL_SPE_PRIVACY_POLICY			= 0x02,
28042b144cbSCharles Keepax 	SDCA_CTL_SPE_PRIVACY_LOCKSTATE			= 0x03,
28142b144cbSCharles Keepax 	SDCA_CTL_SPE_PRIVACY_OWNER			= 0x04,
28242b144cbSCharles Keepax 	SDCA_CTL_SPE_AUTHTX_CURRENTOWNER		= 0x10,
28342b144cbSCharles Keepax 	SDCA_CTL_SPE_AUTHTX_MESSAGEOFFSET		= 0x12,
28442b144cbSCharles Keepax 	SDCA_CTL_SPE_AUTHTX_MESSAGELENGTH		= 0x13,
28542b144cbSCharles Keepax 	SDCA_CTL_SPE_AUTHRX_CURRENTOWNER		= 0x14,
28642b144cbSCharles Keepax 	SDCA_CTL_SPE_AUTHRX_MESSAGEOFFSET		= 0x16,
28742b144cbSCharles Keepax 	SDCA_CTL_SPE_AUTHRX_MESSAGELENGTH		= 0x17,
28842b144cbSCharles Keepax };
28942b144cbSCharles Keepax 
29042b144cbSCharles Keepax /**
29142b144cbSCharles Keepax  * enum sdca_cru_controls - SDCA Controls for Channel Remapping Unit
29242b144cbSCharles Keepax  *
29342b144cbSCharles Keepax  * Control Selectors for Channel Remapping Unit from SDCA
29442b144cbSCharles Keepax  * specification v1.0 Section 6.3.1.3.
29542b144cbSCharles Keepax  */
29642b144cbSCharles Keepax enum sdca_cru_controls {
29742b144cbSCharles Keepax 	SDCA_CTL_CRU_LATENCY				= 0x06,
29842b144cbSCharles Keepax 	SDCA_CTL_CRU_CLUSTERINDEX			= 0x10,
29942b144cbSCharles Keepax };
30042b144cbSCharles Keepax 
30142b144cbSCharles Keepax /**
30242b144cbSCharles Keepax  * enum sdca_udmpu_controls - SDCA Controls for Up-Down Mixer Processing Unit
30342b144cbSCharles Keepax  *
30442b144cbSCharles Keepax  * Control Selectors for Up-Down Mixer Processing Unit from SDCA
30542b144cbSCharles Keepax  * specification v1.0 Section 6.3.9.3.
30642b144cbSCharles Keepax  */
30742b144cbSCharles Keepax enum sdca_udmpu_controls {
30842b144cbSCharles Keepax 	SDCA_CTL_UDMPU_LATENCY				= 0x06,
30942b144cbSCharles Keepax 	SDCA_CTL_UDMPU_CLUSTERINDEX			= 0x10,
31042b144cbSCharles Keepax 	SDCA_CTL_UDMPU_ACOUSTIC_ENERGY_LEVEL_MONITOR	= 0x11,
31142b144cbSCharles Keepax 	SDCA_CTL_UDMPU_ULTRASOUND_LOOP_GAIN		= 0x12,
31242b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_0			= 0x18,
31342b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_1			= 0x19,
31442b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_2			= 0x1A,
31542b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_3			= 0x1B,
31642b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_4			= 0x1C,
31742b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_5			= 0x1D,
31842b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_6			= 0x1E,
31942b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_7			= 0x1F,
32042b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_8			= 0x20,
32142b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_9			= 0x21,
32242b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_10			= 0x22,
32342b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_11			= 0x23,
32442b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_12			= 0x24,
32542b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_13			= 0x25,
32642b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_14			= 0x26,
32742b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_15			= 0x27,
32842b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_16			= 0x28,
32942b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_17			= 0x29,
33042b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_18			= 0x2A,
33142b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_19			= 0x2B,
33242b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_20			= 0x2C,
33342b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_21			= 0x2D,
33442b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_22			= 0x2E,
33542b144cbSCharles Keepax 	SDCA_CTL_UDMPU_OPAQUESET_23			= 0x2F,
33642b144cbSCharles Keepax };
33742b144cbSCharles Keepax 
33842b144cbSCharles Keepax /**
33942b144cbSCharles Keepax  * enum sdca_mfpu_controls - SDCA Controls for Multi-Function Processing Unit
34042b144cbSCharles Keepax  *
34142b144cbSCharles Keepax  * Control Selectors for Multi-Function Processing Unit from SDCA
34242b144cbSCharles Keepax  * specification v1.0 Section 6.3.3.4.
34342b144cbSCharles Keepax  */
34442b144cbSCharles Keepax enum sdca_mfpu_controls {
34542b144cbSCharles Keepax 	SDCA_CTL_MFPU_BYPASS				= 0x01,
34642b144cbSCharles Keepax 	SDCA_CTL_MFPU_ALGORITHM_READY			= 0x04,
34742b144cbSCharles Keepax 	SDCA_CTL_MFPU_ALGORITHM_ENABLE			= 0x05,
34842b144cbSCharles Keepax 	SDCA_CTL_MFPU_LATENCY				= 0x08,
34942b144cbSCharles Keepax 	SDCA_CTL_MFPU_ALGORITHM_PREPARE			= 0x09,
35042b144cbSCharles Keepax 	SDCA_CTL_MFPU_CLUSTERINDEX			= 0x10,
35142b144cbSCharles Keepax 	SDCA_CTL_MFPU_CENTER_FREQUENCY_INDEX		= 0x11,
35242b144cbSCharles Keepax 	SDCA_CTL_MFPU_ULTRASOUND_LEVEL			= 0x12,
35342b144cbSCharles Keepax 	SDCA_CTL_MFPU_AE_NUMBER				= 0x13,
35442b144cbSCharles Keepax 	SDCA_CTL_MFPU_AE_CURRENTOWNER			= 0x14,
35542b144cbSCharles Keepax 	SDCA_CTL_MFPU_AE_MESSAGEOFFSET			= 0x16,
35642b144cbSCharles Keepax 	SDCA_CTL_MFPU_AE_MESSAGELENGTH			= 0x17,
35742b144cbSCharles Keepax };
35842b144cbSCharles Keepax 
35942b144cbSCharles Keepax /**
36042b144cbSCharles Keepax  * enum sdca_smpu_controls - SDCA Controls for Smart Mic Processing Unit
36142b144cbSCharles Keepax  *
36242b144cbSCharles Keepax  * Control Selectors for Smart Mic Processing Unit from SDCA
36342b144cbSCharles Keepax  * specification v1.0 Section 6.3.7.3.
36442b144cbSCharles Keepax  */
36542b144cbSCharles Keepax enum sdca_smpu_controls {
36642b144cbSCharles Keepax 	SDCA_CTL_SMPU_LATENCY				= 0x06,
36742b144cbSCharles Keepax 	SDCA_CTL_SMPU_TRIGGER_ENABLE			= 0x10,
36842b144cbSCharles Keepax 	SDCA_CTL_SMPU_TRIGGER_STATUS			= 0x11,
36942b144cbSCharles Keepax 	SDCA_CTL_SMPU_HIST_BUFFER_MODE			= 0x12,
37042b144cbSCharles Keepax 	SDCA_CTL_SMPU_HIST_BUFFER_PREAMBLE		= 0x13,
37142b144cbSCharles Keepax 	SDCA_CTL_SMPU_HIST_ERROR			= 0x14,
37242b144cbSCharles Keepax 	SDCA_CTL_SMPU_TRIGGER_EXTENSION			= 0x15,
37342b144cbSCharles Keepax 	SDCA_CTL_SMPU_TRIGGER_READY			= 0x16,
37442b144cbSCharles Keepax 	SDCA_CTL_SMPU_HIST_CURRENTOWNER			= 0x18,
37542b144cbSCharles Keepax 	SDCA_CTL_SMPU_HIST_MESSAGEOFFSET		= 0x1A,
37642b144cbSCharles Keepax 	SDCA_CTL_SMPU_HIST_MESSAGELENGTH		= 0x1B,
37742b144cbSCharles Keepax 	SDCA_CTL_SMPU_DTODTX_CURRENTOWNER		= 0x1C,
37842b144cbSCharles Keepax 	SDCA_CTL_SMPU_DTODTX_MESSAGEOFFSET		= 0x1E,
37942b144cbSCharles Keepax 	SDCA_CTL_SMPU_DTODTX_MESSAGELENGTH		= 0x1F,
38042b144cbSCharles Keepax 	SDCA_CTL_SMPU_DTODRX_CURRENTOWNER		= 0x20,
38142b144cbSCharles Keepax 	SDCA_CTL_SMPU_DTODRX_MESSAGEOFFSET		= 0x22,
38242b144cbSCharles Keepax 	SDCA_CTL_SMPU_DTODRX_MESSAGELENGTH		= 0x23,
38342b144cbSCharles Keepax };
38442b144cbSCharles Keepax 
38542b144cbSCharles Keepax /**
38642b144cbSCharles Keepax  * enum sdca_sapu_controls - SDCA Controls for Smart Amp Processing Unit
38742b144cbSCharles Keepax  *
38842b144cbSCharles Keepax  * Control Selectors for Smart Amp Processing Unit from SDCA
38942b144cbSCharles Keepax  * specification v1.0 Section 6.3.6.3.
39042b144cbSCharles Keepax  */
39142b144cbSCharles Keepax enum sdca_sapu_controls {
39242b144cbSCharles Keepax 	SDCA_CTL_SAPU_LATENCY				= 0x05,
39342b144cbSCharles Keepax 	SDCA_CTL_SAPU_PROTECTION_MODE			= 0x10,
39442b144cbSCharles Keepax 	SDCA_CTL_SAPU_PROTECTION_STATUS			= 0x11,
39542b144cbSCharles Keepax 	SDCA_CTL_SAPU_OPAQUESETREQ_INDEX		= 0x12,
39642b144cbSCharles Keepax 	SDCA_CTL_SAPU_DTODTX_CURRENTOWNER		= 0x14,
39742b144cbSCharles Keepax 	SDCA_CTL_SAPU_DTODTX_MESSAGEOFFSET		= 0x16,
39842b144cbSCharles Keepax 	SDCA_CTL_SAPU_DTODTX_MESSAGELENGTH		= 0x17,
39942b144cbSCharles Keepax 	SDCA_CTL_SAPU_DTODRX_CURRENTOWNER		= 0x18,
40042b144cbSCharles Keepax 	SDCA_CTL_SAPU_DTODRX_MESSAGEOFFSET		= 0x1A,
40142b144cbSCharles Keepax 	SDCA_CTL_SAPU_DTODRX_MESSAGELENGTH		= 0x1B,
40242b144cbSCharles Keepax };
40342b144cbSCharles Keepax 
40442b144cbSCharles Keepax /**
40542b144cbSCharles Keepax  * enum sdca_ppu_controls - SDCA Controls for Post Processing Unit
40642b144cbSCharles Keepax  *
40742b144cbSCharles Keepax  * Control Selectors for Post Processing Unit from SDCA specification
40842b144cbSCharles Keepax  * v1.0 Section 6.3.5.3.
40942b144cbSCharles Keepax  */
41042b144cbSCharles Keepax enum sdca_ppu_controls {
41142b144cbSCharles Keepax 	SDCA_CTL_PPU_LATENCY				= 0x06,
41242b144cbSCharles Keepax 	SDCA_CTL_PPU_POSTURENUMBER			= 0x10,
41342b144cbSCharles Keepax 	SDCA_CTL_PPU_POSTUREEXTENSION			= 0x11,
41442b144cbSCharles Keepax 	SDCA_CTL_PPU_HORIZONTALBALANCE			= 0x12,
41542b144cbSCharles Keepax 	SDCA_CTL_PPU_VERTICALBALANCE			= 0x13,
41642b144cbSCharles Keepax };
41742b144cbSCharles Keepax 
41842b144cbSCharles Keepax /**
41942b144cbSCharles Keepax  * enum sdca_tg_controls - SDCA Controls for Tone Generator Entity
42042b144cbSCharles Keepax  *
42142b144cbSCharles Keepax  * Control Selectors for Tone Generator from SDCA specification v1.0
42242b144cbSCharles Keepax  * Section 6.5.4.4.
42342b144cbSCharles Keepax  */
42442b144cbSCharles Keepax enum sdca_tg_controls {
42542b144cbSCharles Keepax 	SDCA_CTL_TG_TONE_DIVIDER			= 0x10,
42642b144cbSCharles Keepax };
42742b144cbSCharles Keepax 
42842b144cbSCharles Keepax /**
42942b144cbSCharles Keepax  * enum sdca_hide_controls - SDCA Controls for HIDE Entity
43042b144cbSCharles Keepax  *
43142b144cbSCharles Keepax  * Control Selectors for HIDE from SDCA specification v1.0 Section
43242b144cbSCharles Keepax  * 6.6.1.2.
43342b144cbSCharles Keepax  */
43442b144cbSCharles Keepax enum sdca_hide_controls {
43542b144cbSCharles Keepax 	SDCA_CTL_HIDE_HIDTX_CURRENTOWNER		= 0x10,
43642b144cbSCharles Keepax 	SDCA_CTL_HIDE_HIDTX_MESSAGEOFFSET		= 0x12,
43742b144cbSCharles Keepax 	SDCA_CTL_HIDE_HIDTX_MESSAGELENGTH		= 0x13,
43842b144cbSCharles Keepax 	SDCA_CTL_HIDE_HIDRX_CURRENTOWNER		= 0x14,
43942b144cbSCharles Keepax 	SDCA_CTL_HIDE_HIDRX_MESSAGEOFFSET		= 0x16,
44042b144cbSCharles Keepax 	SDCA_CTL_HIDE_HIDRX_MESSAGELENGTH		= 0x17,
44142b144cbSCharles Keepax };
44242b144cbSCharles Keepax 
44342b144cbSCharles Keepax /**
444629dd55cSCharles Keepax  * enum sdca_entity0_controls - SDCA Controls for Entity 0
445629dd55cSCharles Keepax  *
446629dd55cSCharles Keepax  * Control Selectors for Entity 0 from SDCA specification v1.0 Section
447629dd55cSCharles Keepax  * 6.7.1.1.
448629dd55cSCharles Keepax  */
4493a513da1SPierre-Louis Bossart enum sdca_entity0_controls {
450b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_COMMIT_GROUP_MASK		= 0x01,
451b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_FUNCTION_SDCA_VERSION		= 0x04,
452b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_FUNCTION_TYPE			= 0x05,
453b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_FUNCTION_MANUFACTURER_ID	= 0x06,
454b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_FUNCTION_ID			= 0x07,
455b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_FUNCTION_VERSION		= 0x08,
456b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_FUNCTION_EXTENSION_ID		= 0x09,
457b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_FUNCTION_EXTENSION_VERSION	= 0x0A,
458b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_FUNCTION_STATUS		= 0x10,
459b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_FUNCTION_ACTION		= 0x11,
460b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_MATCHING_GUID			= 0x12,
461b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_DEVICE_MANUFACTURER_ID	= 0x2C,
462b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_DEVICE_PART_ID		= 0x2D,
463b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_DEVICE_VERSION		= 0x2E,
464b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_DEVICE_SDCA_VERSION		= 0x2F,
465b21468e8SCharles Keepax 
466b21468e8SCharles Keepax 	/* Function Status Bits */
467b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_DEVICE_NEWLY_ATTACHED		= BIT(0),
468b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_INTS_DISABLED_ABNORMALLY	= BIT(1),
469b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_STREAMING_STOPPED_ABNORMALLY	= BIT(2),
470b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_FUNCTION_FAULT		= BIT(3),
471b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_UMP_SEQUENCE_FAULT		= BIT(4),
472b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_FUNCTION_NEEDS_INITIALIZATION	= BIT(5),
473b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_FUNCTION_HAS_BEEN_RESET	= BIT(6),
474b21468e8SCharles Keepax 	SDCA_CTL_ENTITY_0_FUNCTION_BUSY			= BIT(7),
4753a513da1SPierre-Louis Bossart };
4763a513da1SPierre-Louis Bossart 
47742b144cbSCharles Keepax #define SDCA_CTL_MIC_BIAS_NAME				"Mic Bias"
47842b144cbSCharles Keepax #define SDCA_CTL_USAGE_NAME				"Usage"
47942b144cbSCharles Keepax #define SDCA_CTL_LATENCY_NAME				"Latency"
48042b144cbSCharles Keepax #define SDCA_CTL_CLUSTERINDEX_NAME			"Cluster Index"
48142b144cbSCharles Keepax #define SDCA_CTL_DATAPORT_SELECTOR_NAME			"Dataport Selector"
48242b144cbSCharles Keepax #define SDCA_CTL_MATCHING_GUID_NAME			"Matching GUID"
48342b144cbSCharles Keepax #define SDCA_CTL_KEEP_ALIVE_NAME			"Keep Alive"
48442b144cbSCharles Keepax #define SDCA_CTL_NDAI_STREAM_NAME			"NDAI Stream"
48542b144cbSCharles Keepax #define SDCA_CTL_NDAI_CATEGORY_NAME			"NDAI Category"
48642b144cbSCharles Keepax #define SDCA_CTL_NDAI_CODINGTYPE_NAME			"NDAI Coding Type"
48742b144cbSCharles Keepax #define SDCA_CTL_NDAI_PACKETTYPE_NAME			"NDAI Packet Type"
48842b144cbSCharles Keepax #define SDCA_CTL_MIXER_NAME				"Mixer"
48942b144cbSCharles Keepax #define SDCA_CTL_SELECTOR_NAME				"Selector"
49042b144cbSCharles Keepax #define SDCA_CTL_MUTE_NAME				"Mute"
49142b144cbSCharles Keepax #define SDCA_CTL_CHANNEL_VOLUME_NAME			"Channel Volume"
49242b144cbSCharles Keepax #define SDCA_CTL_AGC_NAME				"AGC"
49342b144cbSCharles Keepax #define SDCA_CTL_BASS_BOOST_NAME			"Bass Boost"
49442b144cbSCharles Keepax #define SDCA_CTL_LOUDNESS_NAME				"Loudness"
49542b144cbSCharles Keepax #define SDCA_CTL_GAIN_NAME				"Gain"
49642b144cbSCharles Keepax #define SDCA_CTL_BYPASS_NAME				"Bypass"
49742b144cbSCharles Keepax #define SDCA_CTL_XU_ID_NAME				"XU ID"
49842b144cbSCharles Keepax #define SDCA_CTL_XU_VERSION_NAME			"XU Version"
49942b144cbSCharles Keepax #define SDCA_CTL_FDL_CURRENTOWNER_NAME			"FDL Current Owner"
50042b144cbSCharles Keepax #define SDCA_CTL_FDL_MESSAGEOFFSET_NAME			"FDL Message Offset"
50142b144cbSCharles Keepax #define SDCA_CTL_FDL_MESSAGELENGTH_NAME			"FDL Message Length"
50242b144cbSCharles Keepax #define SDCA_CTL_FDL_STATUS_NAME			"FDL Status"
50342b144cbSCharles Keepax #define SDCA_CTL_FDL_SET_INDEX_NAME			"FDL Set Index"
50442b144cbSCharles Keepax #define SDCA_CTL_FDL_HOST_REQUEST_NAME			"FDL Host Request"
50542b144cbSCharles Keepax #define SDCA_CTL_CLOCK_VALID_NAME			"Clock Valid"
50642b144cbSCharles Keepax #define SDCA_CTL_SAMPLERATEINDEX_NAME			"Sample Rate Index"
50742b144cbSCharles Keepax #define SDCA_CTL_CLOCK_SELECT_NAME			"Clock Select"
50842b144cbSCharles Keepax #define SDCA_CTL_REQUESTED_PS_NAME			"Requested PS"
50942b144cbSCharles Keepax #define SDCA_CTL_ACTUAL_PS_NAME				"Actual PS"
51042b144cbSCharles Keepax #define SDCA_CTL_SELECTED_MODE_NAME			"Selected Mode"
51142b144cbSCharles Keepax #define SDCA_CTL_DETECTED_MODE_NAME			"Detected Mode"
51242b144cbSCharles Keepax #define SDCA_CTL_PRIVATE_NAME				"Private"
51342b144cbSCharles Keepax #define SDCA_CTL_PRIVACY_POLICY_NAME			"Privacy Policy"
51442b144cbSCharles Keepax #define SDCA_CTL_PRIVACY_LOCKSTATE_NAME			"Privacy Lockstate"
51542b144cbSCharles Keepax #define SDCA_CTL_PRIVACY_OWNER_NAME			"Privacy Owner"
51642b144cbSCharles Keepax #define SDCA_CTL_AUTHTX_CURRENTOWNER_NAME		"AuthTX Current Owner"
51742b144cbSCharles Keepax #define SDCA_CTL_AUTHTX_MESSAGEOFFSET_NAME		"AuthTX Message Offset"
51842b144cbSCharles Keepax #define SDCA_CTL_AUTHTX_MESSAGELENGTH_NAME		"AuthTX Message Length"
51942b144cbSCharles Keepax #define SDCA_CTL_AUTHRX_CURRENTOWNER_NAME		"AuthRX Current Owner"
52042b144cbSCharles Keepax #define SDCA_CTL_AUTHRX_MESSAGEOFFSET_NAME		"AuthRX Message Offset"
52142b144cbSCharles Keepax #define SDCA_CTL_AUTHRX_MESSAGELENGTH_NAME		"AuthRX Message Length"
52242b144cbSCharles Keepax #define SDCA_CTL_ACOUSTIC_ENERGY_LEVEL_MONITOR_NAME	"Acoustic Energy Level Monitor"
52342b144cbSCharles Keepax #define SDCA_CTL_ULTRASOUND_LOOP_GAIN_NAME		"Ultrasound Loop Gain"
52442b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_0_NAME			"Opaqueset 0"
52542b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_1_NAME			"Opaqueset 1"
52642b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_2_NAME			"Opaqueset 2"
52742b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_3_NAME			"Opaqueset 3"
52842b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_4_NAME			"Opaqueset 4"
52942b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_5_NAME			"Opaqueset 5"
53042b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_6_NAME			"Opaqueset 6"
53142b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_7_NAME			"Opaqueset 7"
53242b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_8_NAME			"Opaqueset 8"
53342b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_9_NAME			"Opaqueset 9"
53442b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_10_NAME			"Opaqueset 10"
53542b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_11_NAME			"Opaqueset 11"
53642b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_12_NAME			"Opaqueset 12"
53742b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_13_NAME			"Opaqueset 13"
53842b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_14_NAME			"Opaqueset 14"
53942b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_15_NAME			"Opaqueset 15"
54042b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_16_NAME			"Opaqueset 16"
54142b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_17_NAME			"Opaqueset 17"
54242b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_18_NAME			"Opaqueset 18"
54342b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_19_NAME			"Opaqueset 19"
54442b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_20_NAME			"Opaqueset 20"
54542b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_21_NAME			"Opaqueset 21"
54642b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_22_NAME			"Opaqueset 22"
54742b144cbSCharles Keepax #define SDCA_CTL_OPAQUESET_23_NAME			"Opaqueset 23"
54842b144cbSCharles Keepax #define SDCA_CTL_ALGORITHM_READY_NAME			"Algorithm Ready"
54942b144cbSCharles Keepax #define SDCA_CTL_ALGORITHM_ENABLE_NAME			"Algorithm Enable"
55042b144cbSCharles Keepax #define SDCA_CTL_ALGORITHM_PREPARE_NAME			"Algorithm Prepare"
55142b144cbSCharles Keepax #define SDCA_CTL_CENTER_FREQUENCY_INDEX_NAME		"Center Frequency Index"
55242b144cbSCharles Keepax #define SDCA_CTL_ULTRASOUND_LEVEL_NAME			"Ultrasound Level"
55342b144cbSCharles Keepax #define SDCA_CTL_AE_NUMBER_NAME				"AE Number"
55442b144cbSCharles Keepax #define SDCA_CTL_AE_CURRENTOWNER_NAME			"AE Current Owner"
55542b144cbSCharles Keepax #define SDCA_CTL_AE_MESSAGEOFFSET_NAME			"AE Message Offset"
55642b144cbSCharles Keepax #define SDCA_CTL_AE_MESSAGELENGTH_NAME			"AE Message Length"
55742b144cbSCharles Keepax #define SDCA_CTL_TRIGGER_ENABLE_NAME			"Trigger Enable"
55842b144cbSCharles Keepax #define SDCA_CTL_TRIGGER_STATUS_NAME			"Trigger Status"
55942b144cbSCharles Keepax #define SDCA_CTL_HIST_BUFFER_MODE_NAME			"Hist Buffer Mode"
56042b144cbSCharles Keepax #define SDCA_CTL_HIST_BUFFER_PREAMBLE_NAME		"Hist Buffer Preamble"
56142b144cbSCharles Keepax #define SDCA_CTL_HIST_ERROR_NAME			"Hist Error"
56242b144cbSCharles Keepax #define SDCA_CTL_TRIGGER_EXTENSION_NAME			"Trigger Extension"
56342b144cbSCharles Keepax #define SDCA_CTL_TRIGGER_READY_NAME			"Trigger Ready"
56442b144cbSCharles Keepax #define SDCA_CTL_HIST_CURRENTOWNER_NAME			"Hist Current Owner"
56542b144cbSCharles Keepax #define SDCA_CTL_HIST_MESSAGEOFFSET_NAME		"Hist Message Offset"
56642b144cbSCharles Keepax #define SDCA_CTL_HIST_MESSAGELENGTH_NAME		"Hist Message Length"
56742b144cbSCharles Keepax #define SDCA_CTL_DTODTX_CURRENTOWNER_NAME		"DTODTX Current Owner"
56842b144cbSCharles Keepax #define SDCA_CTL_DTODTX_MESSAGEOFFSET_NAME		"DTODTX Message Offset"
56942b144cbSCharles Keepax #define SDCA_CTL_DTODTX_MESSAGELENGTH_NAME		"DTODTX Message Length"
57042b144cbSCharles Keepax #define SDCA_CTL_DTODRX_CURRENTOWNER_NAME		"DTODRX Current Owner"
57142b144cbSCharles Keepax #define SDCA_CTL_DTODRX_MESSAGEOFFSET_NAME		"DTODRX Message Offset"
57242b144cbSCharles Keepax #define SDCA_CTL_DTODRX_MESSAGELENGTH_NAME		"DTODRX Message Length"
57342b144cbSCharles Keepax #define SDCA_CTL_PROTECTION_MODE_NAME			"Protection Mode"
57442b144cbSCharles Keepax #define SDCA_CTL_PROTECTION_STATUS_NAME			"Protection Status"
57542b144cbSCharles Keepax #define SDCA_CTL_OPAQUESETREQ_INDEX_NAME		"Opaqueset Req Index"
57642b144cbSCharles Keepax #define SDCA_CTL_DTODTX_CURRENTOWNER_NAME		"DTODTX Current Owner"
57742b144cbSCharles Keepax #define SDCA_CTL_DTODTX_MESSAGEOFFSET_NAME		"DTODTX Message Offset"
57842b144cbSCharles Keepax #define SDCA_CTL_DTODTX_MESSAGELENGTH_NAME		"DTODTX Message Length"
57942b144cbSCharles Keepax #define SDCA_CTL_DTODRX_CURRENTOWNER_NAME		"DTODRX Current Owner"
58042b144cbSCharles Keepax #define SDCA_CTL_DTODRX_MESSAGEOFFSET_NAME		"DTODRX Message Offset"
58142b144cbSCharles Keepax #define SDCA_CTL_DTODRX_MESSAGELENGTH_NAME		"DTODRX Message Length"
58242b144cbSCharles Keepax #define SDCA_CTL_POSTURENUMBER_NAME			"Posture Number"
58342b144cbSCharles Keepax #define SDCA_CTL_POSTUREEXTENSION_NAME			"Posture Extension"
58442b144cbSCharles Keepax #define SDCA_CTL_HORIZONTALBALANCE_NAME			"Horizontal Balance"
58542b144cbSCharles Keepax #define SDCA_CTL_VERTICALBALANCE_NAME			"Vertical Balance"
58642b144cbSCharles Keepax #define SDCA_CTL_TONE_DIVIDER_NAME			"Tone Divider"
58742b144cbSCharles Keepax #define SDCA_CTL_HIDTX_CURRENTOWNER_NAME		"HIDTX Current Owner"
58842b144cbSCharles Keepax #define SDCA_CTL_HIDTX_MESSAGEOFFSET_NAME		"HIDTX Message Offset"
58942b144cbSCharles Keepax #define SDCA_CTL_HIDTX_MESSAGELENGTH_NAME		"HIDTX Message Length"
59042b144cbSCharles Keepax #define SDCA_CTL_HIDRX_CURRENTOWNER_NAME		"HIDRX Current Owner"
59142b144cbSCharles Keepax #define SDCA_CTL_HIDRX_MESSAGEOFFSET_NAME		"HIDRX Message Offset"
59242b144cbSCharles Keepax #define SDCA_CTL_HIDRX_MESSAGELENGTH_NAME		"HIDRX Message Length"
59342b144cbSCharles Keepax #define SDCA_CTL_COMMIT_GROUP_MASK_NAME			"Commit Group Mask"
59442b144cbSCharles Keepax #define SDCA_CTL_FUNCTION_SDCA_VERSION_NAME		"Function SDCA Version"
59542b144cbSCharles Keepax #define SDCA_CTL_FUNCTION_TYPE_NAME			"Function Type"
59642b144cbSCharles Keepax #define SDCA_CTL_FUNCTION_MANUFACTURER_ID_NAME		"Function Manufacturer ID"
59742b144cbSCharles Keepax #define SDCA_CTL_FUNCTION_ID_NAME			"Function ID"
59842b144cbSCharles Keepax #define SDCA_CTL_FUNCTION_VERSION_NAME			"Function Version"
59942b144cbSCharles Keepax #define SDCA_CTL_FUNCTION_EXTENSION_ID_NAME		"Function Extension ID"
60042b144cbSCharles Keepax #define SDCA_CTL_FUNCTION_EXTENSION_VERSION_NAME	"Function Extension Version"
60142b144cbSCharles Keepax #define SDCA_CTL_FUNCTION_STATUS_NAME			"Function Status"
60242b144cbSCharles Keepax #define SDCA_CTL_FUNCTION_ACTION_NAME			"Function Action"
60342b144cbSCharles Keepax #define SDCA_CTL_DEVICE_MANUFACTURER_ID_NAME		"Device Manufacturer ID"
60442b144cbSCharles Keepax #define SDCA_CTL_DEVICE_PART_ID_NAME			"Device Part ID"
60542b144cbSCharles Keepax #define SDCA_CTL_DEVICE_VERSION_NAME			"Device Version"
60642b144cbSCharles Keepax #define SDCA_CTL_DEVICE_SDCA_VERSION_NAME		"Device SDCA Version"
60742b144cbSCharles Keepax 
60842b144cbSCharles Keepax /**
6092a4667f3SCharles Keepax  * enum sdca_control_datatype - SDCA Control Data Types
6102a4667f3SCharles Keepax  *
6112a4667f3SCharles Keepax  * Data Types as described in the SDCA specification v1.0 section
6122a4667f3SCharles Keepax  * 7.3.
6132a4667f3SCharles Keepax  */
6142a4667f3SCharles Keepax enum sdca_control_datatype {
6152a4667f3SCharles Keepax 	SDCA_CTL_DATATYPE_ONEBIT,
6162a4667f3SCharles Keepax 	SDCA_CTL_DATATYPE_INTEGER,
6172a4667f3SCharles Keepax 	SDCA_CTL_DATATYPE_SPEC_ENCODED_VALUE,
6182a4667f3SCharles Keepax 	SDCA_CTL_DATATYPE_BCD,
6192a4667f3SCharles Keepax 	SDCA_CTL_DATATYPE_Q7P8DB,
6202a4667f3SCharles Keepax 	SDCA_CTL_DATATYPE_BYTEINDEX,
6212a4667f3SCharles Keepax 	SDCA_CTL_DATATYPE_POSTURENUMBER,
6222a4667f3SCharles Keepax 	SDCA_CTL_DATATYPE_DP_INDEX,
6232a4667f3SCharles Keepax 	SDCA_CTL_DATATYPE_BITINDEX,
6242a4667f3SCharles Keepax 	SDCA_CTL_DATATYPE_BITMAP,
6252a4667f3SCharles Keepax 	SDCA_CTL_DATATYPE_GUID,
6262a4667f3SCharles Keepax 	SDCA_CTL_DATATYPE_IMPDEF,
6272a4667f3SCharles Keepax };
6282a4667f3SCharles Keepax 
6292a4667f3SCharles Keepax /**
63042b144cbSCharles Keepax  * enum sdca_access_mode - SDCA Control access mode
63142b144cbSCharles Keepax  *
63242b144cbSCharles Keepax  * Access modes as described in the SDCA specification v1.0 section
63342b144cbSCharles Keepax  * 7.1.8.2.
63442b144cbSCharles Keepax  */
63542b144cbSCharles Keepax enum sdca_access_mode {
63642b144cbSCharles Keepax 	SDCA_ACCESS_MODE_RW				= 0x0,
63742b144cbSCharles Keepax 	SDCA_ACCESS_MODE_DUAL				= 0x1,
63842b144cbSCharles Keepax 	SDCA_ACCESS_MODE_RW1C				= 0x2,
63942b144cbSCharles Keepax 	SDCA_ACCESS_MODE_RO				= 0x3,
64042b144cbSCharles Keepax 	SDCA_ACCESS_MODE_RW1S				= 0x4,
64142b144cbSCharles Keepax 	SDCA_ACCESS_MODE_DC				= 0x5,
64242b144cbSCharles Keepax };
64342b144cbSCharles Keepax 
64442b144cbSCharles Keepax /**
64542b144cbSCharles Keepax  * enum sdca_access_layer - SDCA Control access layer
64642b144cbSCharles Keepax  *
64742b144cbSCharles Keepax  * Access layers as described in the SDCA specification v1.0 section
64842b144cbSCharles Keepax  * 7.1.9.
64942b144cbSCharles Keepax  */
65042b144cbSCharles Keepax enum sdca_access_layer {
65142b144cbSCharles Keepax 	SDCA_ACCESS_LAYER_USER				= 1 << 0,
65242b144cbSCharles Keepax 	SDCA_ACCESS_LAYER_APPLICATION			= 1 << 1,
65342b144cbSCharles Keepax 	SDCA_ACCESS_LAYER_CLASS				= 1 << 2,
65442b144cbSCharles Keepax 	SDCA_ACCESS_LAYER_PLATFORM			= 1 << 3,
65542b144cbSCharles Keepax 	SDCA_ACCESS_LAYER_DEVICE			= 1 << 4,
65642b144cbSCharles Keepax 	SDCA_ACCESS_LAYER_EXTENSION			= 1 << 5,
65742b144cbSCharles Keepax };
65842b144cbSCharles Keepax 
65942b144cbSCharles Keepax /**
66064fb5af1SCharles Keepax  * struct sdca_control_range - SDCA Control range table
66164fb5af1SCharles Keepax  * @cols: Number of columns in the range table.
66264fb5af1SCharles Keepax  * @rows: Number of rows in the range table.
66364fb5af1SCharles Keepax  * @data: Array of values contained in the range table.
66464fb5af1SCharles Keepax  */
66564fb5af1SCharles Keepax struct sdca_control_range {
66664fb5af1SCharles Keepax 	unsigned int cols;
66764fb5af1SCharles Keepax 	unsigned int rows;
66864fb5af1SCharles Keepax 	u32 *data;
66964fb5af1SCharles Keepax };
67064fb5af1SCharles Keepax 
67164fb5af1SCharles Keepax /**
67242b144cbSCharles Keepax  * struct sdca_control - information for one SDCA Control
67342b144cbSCharles Keepax  * @label: Name for the Control, from SDCA Specification v1.0, section 7.1.7.
67442b144cbSCharles Keepax  * @sel: Identifier used for addressing.
67542b144cbSCharles Keepax  * @value: Holds the Control value for constants and defaults.
67642b144cbSCharles Keepax  * @nbits: Number of bits used in the Control.
67742b144cbSCharles Keepax  * @interrupt_position: SCDA interrupt line that will alert to changes on this
67842b144cbSCharles Keepax  * Control.
67942b144cbSCharles Keepax  * @cn_list: A bitmask showing the valid Control Numbers within this Control,
68042b144cbSCharles Keepax  * Control Numbers typically represent channels.
68164fb5af1SCharles Keepax  * @range: Buffer describing valid range of values for the Control.
6822a4667f3SCharles Keepax  * @type: Format of the data in the Control.
68342b144cbSCharles Keepax  * @mode: Access mode of the Control.
68442b144cbSCharles Keepax  * @layers: Bitmask of access layers of the Control.
68542b144cbSCharles Keepax  * @deferrable: Indicates if the access to the Control can be deferred.
68642b144cbSCharles Keepax  * @has_default: Indicates the Control has a default value to be written.
68742b144cbSCharles Keepax  * @has_fixed: Indicates the Control only supports a single value.
68842b144cbSCharles Keepax  */
68942b144cbSCharles Keepax struct sdca_control {
69042b144cbSCharles Keepax 	const char *label;
69142b144cbSCharles Keepax 	int sel;
69242b144cbSCharles Keepax 
69342b144cbSCharles Keepax 	int value;
69442b144cbSCharles Keepax 	int nbits;
69542b144cbSCharles Keepax 	int interrupt_position;
69642b144cbSCharles Keepax 	u64 cn_list;
69742b144cbSCharles Keepax 
69864fb5af1SCharles Keepax 	struct sdca_control_range range;
6992a4667f3SCharles Keepax 	enum sdca_control_datatype type;
70042b144cbSCharles Keepax 	enum sdca_access_mode mode;
70142b144cbSCharles Keepax 	u8 layers;
70242b144cbSCharles Keepax 
70342b144cbSCharles Keepax 	bool deferrable;
70442b144cbSCharles Keepax 	bool has_default;
70542b144cbSCharles Keepax 	bool has_fixed;
70642b144cbSCharles Keepax };
70742b144cbSCharles Keepax 
708996bf834SPierre-Louis Bossart /**
7095c93b20fSCharles Keepax  * enum sdca_terminal_type - SDCA Terminal Types
7105c93b20fSCharles Keepax  *
7115c93b20fSCharles Keepax  * Indicate what a Terminal Entity is used for, see in section 6.2.3
7125c93b20fSCharles Keepax  * of the SDCA v1.0 specification.
7135c93b20fSCharles Keepax  */
7145c93b20fSCharles Keepax enum sdca_terminal_type {
7155c93b20fSCharles Keepax 	/* Table 77 - Data Port*/
7165c93b20fSCharles Keepax 	SDCA_TERM_TYPE_GENERIC				= 0x101,
7175c93b20fSCharles Keepax 	SDCA_TERM_TYPE_ULTRASOUND			= 0x180,
7185c93b20fSCharles Keepax 	SDCA_TERM_TYPE_CAPTURE_DIRECT_PCM_MIC		= 0x181,
7195c93b20fSCharles Keepax 	SDCA_TERM_TYPE_RAW_PDM_MIC			= 0x182,
7205c93b20fSCharles Keepax 	SDCA_TERM_TYPE_SPEECH				= 0x183,
7215c93b20fSCharles Keepax 	SDCA_TERM_TYPE_VOICE				= 0x184,
7225c93b20fSCharles Keepax 	SDCA_TERM_TYPE_SECONDARY_PCM_MIC		= 0x185,
7235c93b20fSCharles Keepax 	SDCA_TERM_TYPE_ACOUSTIC_CONTEXT_AWARENESS	= 0x186,
7245c93b20fSCharles Keepax 	SDCA_TERM_TYPE_DTOD_STREAM			= 0x187,
7255c93b20fSCharles Keepax 	SDCA_TERM_TYPE_REFERENCE_STREAM			= 0x188,
7265c93b20fSCharles Keepax 	SDCA_TERM_TYPE_SENSE_CAPTURE			= 0x189,
7275c93b20fSCharles Keepax 	SDCA_TERM_TYPE_STREAMING_MIC			= 0x18A,
7285c93b20fSCharles Keepax 	SDCA_TERM_TYPE_OPTIMIZATION_STREAM		= 0x190,
7295c93b20fSCharles Keepax 	SDCA_TERM_TYPE_PDM_RENDER_STREAM		= 0x191,
7305c93b20fSCharles Keepax 	SDCA_TERM_TYPE_COMPANION_DATA			= 0x192,
7315c93b20fSCharles Keepax 	/* Table 78 - Transducer */
7325c93b20fSCharles Keepax 	SDCA_TERM_TYPE_MICROPHONE_TRANSDUCER		= 0x201,
7335c93b20fSCharles Keepax 	SDCA_TERM_TYPE_MICROPHONE_ARRAY_TRANSDUCER	= 0x205,
7345c93b20fSCharles Keepax 	SDCA_TERM_TYPE_PRIMARY_FULL_RANGE_SPEAKER	= 0x380,
7355c93b20fSCharles Keepax 	SDCA_TERM_TYPE_PRIMARY_LFE_SPEAKER		= 0x381,
7365c93b20fSCharles Keepax 	SDCA_TERM_TYPE_PRIMARY_TWEETER_SPEAKER		= 0x382,
7375c93b20fSCharles Keepax 	SDCA_TERM_TYPE_PRIMARY_ULTRASOUND_SPEAKER	= 0x383,
7385c93b20fSCharles Keepax 	SDCA_TERM_TYPE_SECONDARY_FULL_RANGE_SPEAKER	= 0x390,
7395c93b20fSCharles Keepax 	SDCA_TERM_TYPE_SECONDARY_LFE_SPEAKER		= 0x391,
7405c93b20fSCharles Keepax 	SDCA_TERM_TYPE_SECONDARY_TWEETER_SPEAKER	= 0x392,
7415c93b20fSCharles Keepax 	SDCA_TERM_TYPE_SECONDARY_ULTRASOUND_SPEAKER	= 0x393,
7425c93b20fSCharles Keepax 	SDCA_TERM_TYPE_TERTIARY_FULL_RANGE_SPEAKER	= 0x3A0,
7435c93b20fSCharles Keepax 	SDCA_TERM_TYPE_TERTIARY_LFE_SPEAKER		= 0x3A1,
7445c93b20fSCharles Keepax 	SDCA_TERM_TYPE_TERTIARY_TWEETER_SPEAKER		= 0x3A2,
7455c93b20fSCharles Keepax 	SDCA_TERM_TYPE_TERTIARY_ULTRASOUND_SPEAKER	= 0x3A3,
7465c93b20fSCharles Keepax 	SDCA_TERM_TYPE_SPDIF				= 0x605,
7475c93b20fSCharles Keepax 	SDCA_TERM_TYPE_NDAI_DISPLAY_AUDIO		= 0x610,
7485c93b20fSCharles Keepax 	SDCA_TERM_TYPE_NDAI_USB				= 0x612,
7495c93b20fSCharles Keepax 	SDCA_TERM_TYPE_NDAI_BLUETOOTH_MAIN		= 0x614,
7505c93b20fSCharles Keepax 	SDCA_TERM_TYPE_NDAI_BLUETOOTH_ALTERNATE		= 0x615,
7515c93b20fSCharles Keepax 	SDCA_TERM_TYPE_NDAI_BLUETOOTH_BOTH		= 0x616,
7525c93b20fSCharles Keepax 	SDCA_TERM_TYPE_LINEIN_STEREO			= 0x680,
7535c93b20fSCharles Keepax 	SDCA_TERM_TYPE_LINEIN_FRONT_LR			= 0x681,
7545c93b20fSCharles Keepax 	SDCA_TERM_TYPE_LINEIN_CENTER_LFE		= 0x682,
7555c93b20fSCharles Keepax 	SDCA_TERM_TYPE_LINEIN_SURROUND_LR		= 0x683,
7565c93b20fSCharles Keepax 	SDCA_TERM_TYPE_LINEIN_REAR_LR			= 0x684,
7575c93b20fSCharles Keepax 	SDCA_TERM_TYPE_LINEOUT_STEREO			= 0x690,
7585c93b20fSCharles Keepax 	SDCA_TERM_TYPE_LINEOUT_FRONT_LR			= 0x691,
7595c93b20fSCharles Keepax 	SDCA_TERM_TYPE_LINEOUT_CENTER_LFE		= 0x692,
7605c93b20fSCharles Keepax 	SDCA_TERM_TYPE_LINEOUT_SURROUND_LR		= 0x693,
7615c93b20fSCharles Keepax 	SDCA_TERM_TYPE_LINEOUT_REAR_LR			= 0x694,
7625c93b20fSCharles Keepax 	SDCA_TERM_TYPE_MIC_JACK				= 0x6A0,
7635c93b20fSCharles Keepax 	SDCA_TERM_TYPE_STEREO_JACK			= 0x6B0,
7645c93b20fSCharles Keepax 	SDCA_TERM_TYPE_FRONT_LR_JACK			= 0x6B1,
7655c93b20fSCharles Keepax 	SDCA_TERM_TYPE_CENTER_LFE_JACK			= 0x6B2,
7665c93b20fSCharles Keepax 	SDCA_TERM_TYPE_SURROUND_LR_JACK			= 0x6B3,
7675c93b20fSCharles Keepax 	SDCA_TERM_TYPE_REAR_LR_JACK			= 0x6B4,
7685c93b20fSCharles Keepax 	SDCA_TERM_TYPE_HEADPHONE_JACK			= 0x6C0,
7695c93b20fSCharles Keepax 	SDCA_TERM_TYPE_HEADSET_JACK			= 0x6D0,
7705c93b20fSCharles Keepax 	/* Table 79 - System */
7715c93b20fSCharles Keepax 	SDCA_TERM_TYPE_SENSE_DATA			= 0x280,
7725c93b20fSCharles Keepax 	SDCA_TERM_TYPE_PRIVACY_SIGNALING		= 0x741,
7735c93b20fSCharles Keepax 	SDCA_TERM_TYPE_PRIVACY_INDICATORS		= 0x747,
7745c93b20fSCharles Keepax };
7755c93b20fSCharles Keepax 
7765c93b20fSCharles Keepax /**
7775c93b20fSCharles Keepax  * enum sdca_connector_type - SDCA Connector Types
7785c93b20fSCharles Keepax  *
7795c93b20fSCharles Keepax  * Indicate the type of Connector that a Terminal Entity represents,
7805c93b20fSCharles Keepax  * see section 6.2.4 of the SDCA v1.0 specification.
7815c93b20fSCharles Keepax  */
7825c93b20fSCharles Keepax enum sdca_connector_type {
7835c93b20fSCharles Keepax 	SDCA_CONN_TYPE_UNKNOWN				= 0x00,
7845c93b20fSCharles Keepax 	SDCA_CONN_TYPE_2P5MM_JACK			= 0x01,
7855c93b20fSCharles Keepax 	SDCA_CONN_TYPE_3P5MM_JACK			= 0x02,
7865c93b20fSCharles Keepax 	SDCA_CONN_TYPE_QUARTER_INCH_JACK		= 0x03,
7875c93b20fSCharles Keepax 	SDCA_CONN_TYPE_XLR				= 0x05,
7885c93b20fSCharles Keepax 	SDCA_CONN_TYPE_SPDIF_OPTICAL			= 0x06,
7895c93b20fSCharles Keepax 	SDCA_CONN_TYPE_RCA				= 0x07,
7905c93b20fSCharles Keepax 	SDCA_CONN_TYPE_DIN				= 0x0E,
7915c93b20fSCharles Keepax 	SDCA_CONN_TYPE_MINI_DIN				= 0x0F,
7925c93b20fSCharles Keepax 	SDCA_CONN_TYPE_EIAJ_OPTICAL			= 0x13,
7935c93b20fSCharles Keepax 	SDCA_CONN_TYPE_HDMI				= 0x14,
7945c93b20fSCharles Keepax 	SDCA_CONN_TYPE_DISPLAYPORT			= 0x17,
7955c93b20fSCharles Keepax 	SDCA_CONN_TYPE_LIGHTNING			= 0x1B,
7965c93b20fSCharles Keepax 	SDCA_CONN_TYPE_USB_C				= 0x1E,
7975c93b20fSCharles Keepax 	SDCA_CONN_TYPE_OTHER				= 0xFF,
7985c93b20fSCharles Keepax };
7995c93b20fSCharles Keepax 
8005c93b20fSCharles Keepax /**
8015c93b20fSCharles Keepax  * struct sdca_entity_iot - information specific to Input/Output Entities
8025c93b20fSCharles Keepax  * @clock: Pointer to the Entity providing this Terminal's clock.
8035c93b20fSCharles Keepax  * @type: Usage of the Terminal Entity.
8045c93b20fSCharles Keepax  * @connector: Physical Connector of the Terminal Entity.
8055c93b20fSCharles Keepax  * @reference: Physical Jack number of the Terminal Entity.
8065c93b20fSCharles Keepax  * @num_transducer: Number of transducers attached to the Terminal Entity.
8075c93b20fSCharles Keepax  * @is_dataport: Boolean indicating if this Terminal represents a Dataport.
8085c93b20fSCharles Keepax  */
8095c93b20fSCharles Keepax struct sdca_entity_iot {
8105c93b20fSCharles Keepax 	struct sdca_entity *clock;
8115c93b20fSCharles Keepax 
8125c93b20fSCharles Keepax 	enum sdca_terminal_type type;
8135c93b20fSCharles Keepax 	enum sdca_connector_type connector;
8145c93b20fSCharles Keepax 	int reference;
8155c93b20fSCharles Keepax 	int num_transducer;
8165c93b20fSCharles Keepax 
8175c93b20fSCharles Keepax 	bool is_dataport;
8185c93b20fSCharles Keepax };
8195c93b20fSCharles Keepax 
8205c93b20fSCharles Keepax /**
821e80b8e5cSCharles Keepax  * enum sdca_clock_type - SDCA Clock Types
822e80b8e5cSCharles Keepax  *
823e80b8e5cSCharles Keepax  * Indicate the synchronicity of an Clock Entity, see section 6.4.1.3
824e80b8e5cSCharles Keepax  * of the SDCA v1.0 specification.
825e80b8e5cSCharles Keepax  */
826e80b8e5cSCharles Keepax enum sdca_clock_type {
827e80b8e5cSCharles Keepax 	SDCA_CLOCK_TYPE_EXTERNAL			= 0x00,
828e80b8e5cSCharles Keepax 	SDCA_CLOCK_TYPE_INTERNAL_ASYNC			= 0x01,
829e80b8e5cSCharles Keepax 	SDCA_CLOCK_TYPE_INTERNAL_SYNC			= 0x02,
830e80b8e5cSCharles Keepax 	SDCA_CLOCK_TYPE_INTERNAL_SOURCE_SYNC		= 0x03,
831e80b8e5cSCharles Keepax };
832e80b8e5cSCharles Keepax 
833e80b8e5cSCharles Keepax /**
834e80b8e5cSCharles Keepax  * struct sdca_entity_cs - information specific to Clock Source Entities
835e80b8e5cSCharles Keepax  * @type: Synchronicity of the Clock Source.
836e80b8e5cSCharles Keepax  * @max_delay: The maximum delay in microseconds before the clock is stable.
837e80b8e5cSCharles Keepax  */
838e80b8e5cSCharles Keepax struct sdca_entity_cs {
839e80b8e5cSCharles Keepax 	enum sdca_clock_type type;
840e80b8e5cSCharles Keepax 	unsigned int max_delay;
841e80b8e5cSCharles Keepax };
842e80b8e5cSCharles Keepax 
843e80b8e5cSCharles Keepax /**
8449da19588SCharles Keepax  * enum sdca_pde_power_state - SDCA Power States
8459da19588SCharles Keepax  *
8469da19588SCharles Keepax  * SDCA Power State values from SDCA specification v1.0 Section 7.12.4.
8479da19588SCharles Keepax  */
8489da19588SCharles Keepax enum sdca_pde_power_state {
8499da19588SCharles Keepax 	SDCA_PDE_PS0					= 0x0,
8509da19588SCharles Keepax 	SDCA_PDE_PS1					= 0x1,
8519da19588SCharles Keepax 	SDCA_PDE_PS2					= 0x2,
8529da19588SCharles Keepax 	SDCA_PDE_PS3					= 0x3,
8539da19588SCharles Keepax 	SDCA_PDE_PS4					= 0x4,
8549da19588SCharles Keepax };
8559da19588SCharles Keepax 
8569da19588SCharles Keepax /**
8579da19588SCharles Keepax  * struct sdca_pde_delay - describes the delay changing between 2 power states
8589da19588SCharles Keepax  * @from_ps: The power state being exited.
8599da19588SCharles Keepax  * @to_ps: The power state being entered.
8609da19588SCharles Keepax  * @us: The delay in microseconds switching between the two states.
8619da19588SCharles Keepax  */
8629da19588SCharles Keepax struct sdca_pde_delay {
8639da19588SCharles Keepax 	int from_ps;
8649da19588SCharles Keepax 	int to_ps;
8659da19588SCharles Keepax 	unsigned int us;
8669da19588SCharles Keepax };
8679da19588SCharles Keepax 
8689da19588SCharles Keepax /**
8699da19588SCharles Keepax  * struct sdca_entity_pde - information specific to Power Domain Entities
8709da19588SCharles Keepax  * @managed: Dynamically allocated array pointing to each Entity
8719da19588SCharles Keepax  * controlled by this PDE.
8729da19588SCharles Keepax  * @max_delay: Dynamically allocated array of delays for switching
8739da19588SCharles Keepax  * between power states.
8749da19588SCharles Keepax  * @num_managed: Number of Entities controlled by this PDE.
8759da19588SCharles Keepax  * @num_max_delay: Number of delays specified for state changes.
8769da19588SCharles Keepax  */
8779da19588SCharles Keepax struct sdca_entity_pde {
8789da19588SCharles Keepax 	struct sdca_entity **managed;
8799da19588SCharles Keepax 	struct sdca_pde_delay *max_delay;
8809da19588SCharles Keepax 	int num_managed;
8819da19588SCharles Keepax 	int num_max_delay;
8829da19588SCharles Keepax };
8839da19588SCharles Keepax 
8849da19588SCharles Keepax /**
885996bf834SPierre-Louis Bossart  * enum sdca_entity_type - SDCA Entity Type codes
8869ee6d50aSCharles Keepax  * @SDCA_ENTITY_TYPE_ENTITY_0: Entity 0, not actually from the
8879ee6d50aSCharles Keepax  * specification but useful internally as an Entity structure
8889ee6d50aSCharles Keepax  * is allocated for Entity 0, to hold Entity 0 controls.
889996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_IT: Input Terminal.
890996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_OT: Output Terminal.
891996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_MU: Mixer Unit.
892996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_SU: Selector Unit.
893996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_FU: Feature Unit.
894996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_XU: Extension Unit.
895996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_CS: Clock Source.
896996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_CX: Clock selector.
897996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_PDE: Power-Domain Entity.
898996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_GE: Group Entity.
899996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_SPE: Security & Privacy Entity.
900996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_CRU: Channel Remapping Unit.
901996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_UDMPU: Up-Down Mixer Processing Unit.
902996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_MFPU: Multi-Function Processing Unit.
903996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_SMPU: Smart Microphone Processing Unit.
904996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_SAPU: Smart Amp Processing Unit.
905996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_PPU: Posture Processing Unit.
906996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_TG: Tone Generator.
907996bf834SPierre-Louis Bossart  * @SDCA_ENTITY_TYPE_HIDE: Human Interface Device Entity.
908996bf834SPierre-Louis Bossart  *
909996bf834SPierre-Louis Bossart  * SDCA Entity Types from SDCA specification v1.0 Section 6.1.2
910996bf834SPierre-Louis Bossart  * all Entity Types not described are reserved.
911996bf834SPierre-Louis Bossart  */
912996bf834SPierre-Louis Bossart enum sdca_entity_type {
9139ee6d50aSCharles Keepax 	SDCA_ENTITY_TYPE_ENTITY_0			= 0x00,
914996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_IT				= 0x02,
915996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_OT				= 0x03,
916996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_MU				= 0x05,
917996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_SU				= 0x06,
918996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_FU				= 0x07,
919996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_XU				= 0x0A,
920996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_CS				= 0x0B,
921996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_CX				= 0x0C,
922996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_PDE				= 0x11,
923996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_GE				= 0x12,
924996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_SPE				= 0x13,
925996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_CRU				= 0x20,
926996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_UDMPU				= 0x21,
927996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_MFPU				= 0x22,
928996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_SMPU				= 0x23,
929996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_SAPU				= 0x24,
930996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_PPU				= 0x25,
931996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_TG				= 0x30,
932996bf834SPierre-Louis Bossart 	SDCA_ENTITY_TYPE_HIDE				= 0x31,
933996bf834SPierre-Louis Bossart };
934996bf834SPierre-Louis Bossart 
935996bf834SPierre-Louis Bossart /**
936*d1cd13f8SCharles Keepax  * struct sdca_ge_control - control entry in the affected controls list
937*d1cd13f8SCharles Keepax  * @id: Entity ID of the Control affected.
938*d1cd13f8SCharles Keepax  * @sel: Control Selector of the Control affected.
939*d1cd13f8SCharles Keepax  * @cn: Control Number of the Control affected.
940*d1cd13f8SCharles Keepax  * @val: Value written to Control for this Mode.
941*d1cd13f8SCharles Keepax  */
942*d1cd13f8SCharles Keepax struct sdca_ge_control {
943*d1cd13f8SCharles Keepax 	int id;
944*d1cd13f8SCharles Keepax 	int sel;
945*d1cd13f8SCharles Keepax 	int cn;
946*d1cd13f8SCharles Keepax 	int val;
947*d1cd13f8SCharles Keepax };
948*d1cd13f8SCharles Keepax 
949*d1cd13f8SCharles Keepax /**
950*d1cd13f8SCharles Keepax  * struct sdca_ge_mode - mode entry in the affected controls list
951*d1cd13f8SCharles Keepax  * @controls: Dynamically allocated array of controls written for this Mode.
952*d1cd13f8SCharles Keepax  * @num_controls: Number of controls written in this Mode.
953*d1cd13f8SCharles Keepax  * @val: GE Selector Mode value.
954*d1cd13f8SCharles Keepax  */
955*d1cd13f8SCharles Keepax struct sdca_ge_mode {
956*d1cd13f8SCharles Keepax 	struct sdca_ge_control *controls;
957*d1cd13f8SCharles Keepax 	int num_controls;
958*d1cd13f8SCharles Keepax 	int val;
959*d1cd13f8SCharles Keepax };
960*d1cd13f8SCharles Keepax 
961*d1cd13f8SCharles Keepax /**
962*d1cd13f8SCharles Keepax  * struct sdca_entity_ge - information specific to Group Entities
963*d1cd13f8SCharles Keepax  * @kctl: ALSA control pointer that can be used by linked Entities.
964*d1cd13f8SCharles Keepax  * @modes: Dynamically allocated array of Modes and the Controls written
965*d1cd13f8SCharles Keepax  * in each mode.
966*d1cd13f8SCharles Keepax  * @num_modes: Number of Modes.
967*d1cd13f8SCharles Keepax  */
968*d1cd13f8SCharles Keepax struct sdca_entity_ge {
969*d1cd13f8SCharles Keepax 	struct snd_kcontrol_new *kctl;
970*d1cd13f8SCharles Keepax 	struct sdca_ge_mode *modes;
971*d1cd13f8SCharles Keepax 	int num_modes;
972*d1cd13f8SCharles Keepax };
973*d1cd13f8SCharles Keepax 
974*d1cd13f8SCharles Keepax /**
975996bf834SPierre-Louis Bossart  * struct sdca_entity - information for one SDCA Entity
976996bf834SPierre-Louis Bossart  * @label: String such as "OT 12".
977996bf834SPierre-Louis Bossart  * @id: Identifier used for addressing.
978996bf834SPierre-Louis Bossart  * @type: Type code for the Entity.
979*d1cd13f8SCharles Keepax  * @group: Pointer to Group Entity controlling this one, NULL if N/A.
980996bf834SPierre-Louis Bossart  * @sources: Dynamically allocated array pointing to each input Entity
981996bf834SPierre-Louis Bossart  * connected to this Entity.
98242b144cbSCharles Keepax  * @controls: Dynamically allocated array of Controls.
983996bf834SPierre-Louis Bossart  * @num_sources: Number of sources for the Entity.
98442b144cbSCharles Keepax  * @num_controls: Number of Controls for the Entity.
9855c93b20fSCharles Keepax  * @iot: Input/Output Terminal specific Entity properties.
986e80b8e5cSCharles Keepax  * @cs: Clock Source specific Entity properties.
9879da19588SCharles Keepax  * @pde: Power Domain Entity specific Entity properties.
988*d1cd13f8SCharles Keepax  * @ge: Group Entity specific Entity properties.
989996bf834SPierre-Louis Bossart  */
990996bf834SPierre-Louis Bossart struct sdca_entity {
991996bf834SPierre-Louis Bossart 	const char *label;
992996bf834SPierre-Louis Bossart 	int id;
993996bf834SPierre-Louis Bossart 	enum sdca_entity_type type;
994996bf834SPierre-Louis Bossart 
995*d1cd13f8SCharles Keepax 	struct sdca_entity *group;
996996bf834SPierre-Louis Bossart 	struct sdca_entity **sources;
99742b144cbSCharles Keepax 	struct sdca_control *controls;
998996bf834SPierre-Louis Bossart 	int num_sources;
99942b144cbSCharles Keepax 	int num_controls;
10005c93b20fSCharles Keepax 	union {
10015c93b20fSCharles Keepax 		struct sdca_entity_iot iot;
1002e80b8e5cSCharles Keepax 		struct sdca_entity_cs cs;
10039da19588SCharles Keepax 		struct sdca_entity_pde pde;
1004*d1cd13f8SCharles Keepax 		struct sdca_entity_ge ge;
10055c93b20fSCharles Keepax 	};
1006996bf834SPierre-Louis Bossart };
1007996bf834SPierre-Louis Bossart 
1008996bf834SPierre-Louis Bossart /**
1009f87c2a27SCharles Keepax  * enum sdca_channel_purpose - SDCA Channel Purpose code
1010f87c2a27SCharles Keepax  *
1011f87c2a27SCharles Keepax  * Channel Purpose codes as described in the SDCA specification v1.0
1012f87c2a27SCharles Keepax  * section 11.4.3.
1013f87c2a27SCharles Keepax  */
1014f87c2a27SCharles Keepax enum sdca_channel_purpose {
1015f87c2a27SCharles Keepax 	/* Table 210 - Purpose */
1016f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_GENERIC_AUDIO			= 0x01,
1017f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_VOICE				= 0x02,
1018f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_SPEECH			= 0x03,
1019f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_AMBIENT			= 0x04,
1020f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_REFERENCE			= 0x05,
1021f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_ULTRASOUND			= 0x06,
1022f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_SENSE				= 0x08,
1023f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_SILENCE			= 0xFE,
1024f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_NON_AUDIO			= 0xFF,
1025f87c2a27SCharles Keepax 	/* Table 211 - Amp Sense */
1026f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_SENSE_V1			= 0x09,
1027f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_SENSE_V2			= 0x0A,
1028f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_SENSE_V12_INTERLEAVED		= 0x10,
1029f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_SENSE_V21_INTERLEAVED		= 0x11,
1030f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_SENSE_V12_PACKED		= 0x12,
1031f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_SENSE_V21_PACKED		= 0x13,
1032f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_SENSE_V1212_INTERLEAVED	= 0x14,
1033f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_SENSE_V2121_INTERLEAVED	= 0x15,
1034f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_SENSE_V1122_INTERLEAVED	= 0x16,
1035f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_SENSE_V2211_INTERLEAVED	= 0x17,
1036f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_SENSE_V1212_PACKED		= 0x18,
1037f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_SENSE_V2121_PACKED		= 0x19,
1038f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_SENSE_V1122_PACKED		= 0x1A,
1039f87c2a27SCharles Keepax 	SDCA_CHAN_PURPOSE_SENSE_V2211_PACKED		= 0x1B,
1040f87c2a27SCharles Keepax };
1041f87c2a27SCharles Keepax 
1042f87c2a27SCharles Keepax /**
1043f87c2a27SCharles Keepax  * enum sdca_channel_relationship - SDCA Channel Relationship code
1044f87c2a27SCharles Keepax  *
1045f87c2a27SCharles Keepax  * Channel Relationship codes as described in the SDCA specification
1046f87c2a27SCharles Keepax  * v1.0 section 11.4.2.
1047f87c2a27SCharles Keepax  */
1048f87c2a27SCharles Keepax enum sdca_channel_relationship {
1049f87c2a27SCharles Keepax 	/* Table 206 - Streaming */
1050f87c2a27SCharles Keepax 	SDCA_CHAN_REL_UNDEFINED				= 0x00,
1051f87c2a27SCharles Keepax 	SDCA_CHAN_REL_GENERIC_MONO			= 0x01,
1052f87c2a27SCharles Keepax 	SDCA_CHAN_REL_GENERIC_LEFT			= 0x02,
1053f87c2a27SCharles Keepax 	SDCA_CHAN_REL_GENERIC_RIGHT			= 0x03,
1054f87c2a27SCharles Keepax 	SDCA_CHAN_REL_GENERIC_TOP			= 0x48,
1055f87c2a27SCharles Keepax 	SDCA_CHAN_REL_GENERIC_BOTTOM			= 0x49,
1056f87c2a27SCharles Keepax 	SDCA_CHAN_REL_CAPTURE_DIRECT			= 0x4E,
1057f87c2a27SCharles Keepax 	SDCA_CHAN_REL_RENDER_DIRECT			= 0x4F,
1058f87c2a27SCharles Keepax 	SDCA_CHAN_REL_FRONT_LEFT			= 0x0B,
1059f87c2a27SCharles Keepax 	SDCA_CHAN_REL_FRONT_RIGHT			= 0x0C,
1060f87c2a27SCharles Keepax 	SDCA_CHAN_REL_FRONT_CENTER			= 0x0D,
1061f87c2a27SCharles Keepax 	SDCA_CHAN_REL_SIDE_LEFT				= 0x12,
1062f87c2a27SCharles Keepax 	SDCA_CHAN_REL_SIDE_RIGHT			= 0x13,
1063f87c2a27SCharles Keepax 	SDCA_CHAN_REL_BACK_LEFT				= 0x16,
1064f87c2a27SCharles Keepax 	SDCA_CHAN_REL_BACK_RIGHT			= 0x17,
1065f87c2a27SCharles Keepax 	SDCA_CHAN_REL_LOW_FREQUENCY_EFFECTS		= 0x43,
1066f87c2a27SCharles Keepax 	SDCA_CHAN_REL_SOUNDWIRE_MIC			= 0x55,
1067f87c2a27SCharles Keepax 	SDCA_CHAN_REL_SENSE_TRANSDUCER_1		= 0x58,
1068f87c2a27SCharles Keepax 	SDCA_CHAN_REL_SENSE_TRANSDUCER_2		= 0x59,
1069f87c2a27SCharles Keepax 	SDCA_CHAN_REL_SENSE_TRANSDUCER_12		= 0x5A,
1070f87c2a27SCharles Keepax 	SDCA_CHAN_REL_SENSE_TRANSDUCER_21		= 0x5B,
1071f87c2a27SCharles Keepax 	SDCA_CHAN_REL_ECHOREF_NONE			= 0x70,
1072f87c2a27SCharles Keepax 	SDCA_CHAN_REL_ECHOREF_1				= 0x71,
1073f87c2a27SCharles Keepax 	SDCA_CHAN_REL_ECHOREF_2				= 0x72,
1074f87c2a27SCharles Keepax 	SDCA_CHAN_REL_ECHOREF_3				= 0x73,
1075f87c2a27SCharles Keepax 	SDCA_CHAN_REL_ECHOREF_4				= 0x74,
1076f87c2a27SCharles Keepax 	SDCA_CHAN_REL_ECHOREF_ALL			= 0x75,
1077f87c2a27SCharles Keepax 	SDCA_CHAN_REL_ECHOREF_LFE_ALL			= 0x76,
1078f87c2a27SCharles Keepax 	/* Table 207 - Speaker */
1079f87c2a27SCharles Keepax 	SDCA_CHAN_REL_PRIMARY_TRANSDUCER		= 0x50,
1080f87c2a27SCharles Keepax 	SDCA_CHAN_REL_SECONDARY_TRANSDUCER		= 0x51,
1081f87c2a27SCharles Keepax 	SDCA_CHAN_REL_TERTIARY_TRANSDUCER		= 0x52,
1082f87c2a27SCharles Keepax 	SDCA_CHAN_REL_LOWER_LEFT_ALLTRANSDUCER		= 0x60,
1083f87c2a27SCharles Keepax 	SDCA_CHAN_REL_LOWER_RIGHT_ALLTRANSDUCER		= 0x61,
1084f87c2a27SCharles Keepax 	SDCA_CHAN_REL_UPPER_LEFT_ALLTRANSDUCER		= 0x62,
1085f87c2a27SCharles Keepax 	SDCA_CHAN_REL_UPPER_RIGHT_ALLTRANSDUCER		= 0x63,
1086f87c2a27SCharles Keepax 	SDCA_CHAN_REL_LOWER_LEFT_PRIMARY		= 0x64,
1087f87c2a27SCharles Keepax 	SDCA_CHAN_REL_LOWER_RIGHT_PRIMARY		= 0x65,
1088f87c2a27SCharles Keepax 	SDCA_CHAN_REL_UPPER_LEFT_PRIMARY		= 0x66,
1089f87c2a27SCharles Keepax 	SDCA_CHAN_REL_UPPER_RIGHT_PRIMARY		= 0x67,
1090f87c2a27SCharles Keepax 	SDCA_CHAN_REL_LOWER_LEFT_SECONDARY		= 0x68,
1091f87c2a27SCharles Keepax 	SDCA_CHAN_REL_LOWER_RIGHT_SECONDARY		= 0x69,
1092f87c2a27SCharles Keepax 	SDCA_CHAN_REL_UPPER_LEFT_SECONDARY		= 0x6A,
1093f87c2a27SCharles Keepax 	SDCA_CHAN_REL_UPPER_RIGHT_SECONDARY		= 0x6B,
1094f87c2a27SCharles Keepax 	SDCA_CHAN_REL_LOWER_LEFT_TERTIARY		= 0x6C,
1095f87c2a27SCharles Keepax 	SDCA_CHAN_REL_LOWER_RIGHT_TERTIARY		= 0x6D,
1096f87c2a27SCharles Keepax 	SDCA_CHAN_REL_UPPER_LEFT_TERTIARY		= 0x6E,
1097f87c2a27SCharles Keepax 	SDCA_CHAN_REL_UPPER_RIGHT_TERTIARY		= 0x6F,
1098f87c2a27SCharles Keepax 	SDCA_CHAN_REL_DERIVED_LOWER_LEFT_PRIMARY	= 0x94,
1099f87c2a27SCharles Keepax 	SDCA_CHAN_REL_DERIVED_LOWER_RIGHT_PRIMARY	= 0x95,
1100f87c2a27SCharles Keepax 	SDCA_CHAN_REL_DERIVED_UPPER_LEFT_PRIMARY	= 0x96,
1101f87c2a27SCharles Keepax 	SDCA_CHAN_REL_DERIVED_UPPER_RIGHT_PRIMARY	= 0x97,
1102f87c2a27SCharles Keepax 	SDCA_CHAN_REL_DERIVED_LOWER_LEFT_SECONDARY	= 0x98,
1103f87c2a27SCharles Keepax 	SDCA_CHAN_REL_DERIVED_LOWER_RIGHT_SECONDARY	= 0x99,
1104f87c2a27SCharles Keepax 	SDCA_CHAN_REL_DERIVED_UPPER_LEFT_SECONDARY	= 0x9A,
1105f87c2a27SCharles Keepax 	SDCA_CHAN_REL_DERIVED_UPPER_RIGHT_SECONDARY	= 0x9B,
1106f87c2a27SCharles Keepax 	SDCA_CHAN_REL_DERIVED_LOWER_LEFT_TERTIARY	= 0x9C,
1107f87c2a27SCharles Keepax 	SDCA_CHAN_REL_DERIVED_LOWER_RIGHT_TERTIARY	= 0x9D,
1108f87c2a27SCharles Keepax 	SDCA_CHAN_REL_DERIVED_UPPER_LEFT_TERTIARY	= 0x9E,
1109f87c2a27SCharles Keepax 	SDCA_CHAN_REL_DERIVED_UPPER_RIGHT_TERTIARY	= 0x9F,
1110f87c2a27SCharles Keepax 	SDCA_CHAN_REL_DERIVED_MONO_PRIMARY		= 0xA0,
1111f87c2a27SCharles Keepax 	SDCA_CHAN_REL_DERIVED_MONO_SECONDARY		= 0xAB,
1112f87c2a27SCharles Keepax 	SDCA_CHAN_REL_DERIVED_MONO_TERTIARY		= 0xAC,
1113f87c2a27SCharles Keepax 	/* Table 208 - Equipment */
1114f87c2a27SCharles Keepax 	SDCA_CHAN_REL_EQUIPMENT_LEFT			= 0x02,
1115f87c2a27SCharles Keepax 	SDCA_CHAN_REL_EQUIPMENT_RIGHT			= 0x03,
1116f87c2a27SCharles Keepax 	SDCA_CHAN_REL_EQUIPMENT_COMBINED		= 0x47,
1117f87c2a27SCharles Keepax 	SDCA_CHAN_REL_EQUIPMENT_TOP			= 0x48,
1118f87c2a27SCharles Keepax 	SDCA_CHAN_REL_EQUIPMENT_BOTTOM			= 0x49,
1119f87c2a27SCharles Keepax 	SDCA_CHAN_REL_EQUIPMENT_TOP_LEFT		= 0x4A,
1120f87c2a27SCharles Keepax 	SDCA_CHAN_REL_EQUIPMENT_BOTTOM_LEFT		= 0x4B,
1121f87c2a27SCharles Keepax 	SDCA_CHAN_REL_EQUIPMENT_TOP_RIGHT		= 0x4C,
1122f87c2a27SCharles Keepax 	SDCA_CHAN_REL_EQUIPMENT_BOTTOM_RIGHT		= 0x4D,
1123f87c2a27SCharles Keepax 	SDCA_CHAN_REL_EQUIPMENT_SILENCED_OUTPUT		= 0x57,
1124f87c2a27SCharles Keepax 	/* Table 209 - Other */
1125f87c2a27SCharles Keepax 	SDCA_CHAN_REL_ARRAY				= 0x04,
1126f87c2a27SCharles Keepax 	SDCA_CHAN_REL_MIC				= 0x53,
1127f87c2a27SCharles Keepax 	SDCA_CHAN_REL_RAW				= 0x54,
1128f87c2a27SCharles Keepax 	SDCA_CHAN_REL_SILENCED_MIC			= 0x56,
1129f87c2a27SCharles Keepax 	SDCA_CHAN_REL_MULTI_SOURCE_1			= 0x78,
1130f87c2a27SCharles Keepax 	SDCA_CHAN_REL_MULTI_SOURCE_2			= 0x79,
1131f87c2a27SCharles Keepax 	SDCA_CHAN_REL_MULTI_SOURCE_3			= 0x7A,
1132f87c2a27SCharles Keepax 	SDCA_CHAN_REL_MULTI_SOURCE_4			= 0x7B,
1133f87c2a27SCharles Keepax };
1134f87c2a27SCharles Keepax 
1135f87c2a27SCharles Keepax /**
1136f87c2a27SCharles Keepax  * struct sdca_channel - a single Channel with a Cluster
1137f87c2a27SCharles Keepax  * @id: Identifier used for addressing.
1138f87c2a27SCharles Keepax  * @purpose: Indicates the purpose of the Channel, usually to give
1139f87c2a27SCharles Keepax  * semantic meaning to the audio, eg. voice, ultrasound.
1140f87c2a27SCharles Keepax  * @relationship: Indicates the relationship of this Channel to others
1141f87c2a27SCharles Keepax  * in the Cluster, often used to identify the physical position of the
1142f87c2a27SCharles Keepax  * Channel eg. left.
1143f87c2a27SCharles Keepax  */
1144f87c2a27SCharles Keepax struct sdca_channel {
1145f87c2a27SCharles Keepax 	int id;
1146f87c2a27SCharles Keepax 	enum sdca_channel_purpose purpose;
1147f87c2a27SCharles Keepax 	enum sdca_channel_relationship relationship;
1148f87c2a27SCharles Keepax };
1149f87c2a27SCharles Keepax 
1150f87c2a27SCharles Keepax /**
1151f87c2a27SCharles Keepax  * struct sdca_cluster - information about an SDCA Channel Cluster
1152f87c2a27SCharles Keepax  * @id: Identifier used for addressing.
1153f87c2a27SCharles Keepax  * @num_channels: Number of Channels within this Cluster.
1154f87c2a27SCharles Keepax  * @channels: Dynamically allocated array of Channels.
1155f87c2a27SCharles Keepax  */
1156f87c2a27SCharles Keepax struct sdca_cluster {
1157f87c2a27SCharles Keepax 	int id;
1158f87c2a27SCharles Keepax 	int num_channels;
1159f87c2a27SCharles Keepax 	struct sdca_channel *channels;
1160f87c2a27SCharles Keepax };
1161f87c2a27SCharles Keepax 
1162f87c2a27SCharles Keepax /**
1163996bf834SPierre-Louis Bossart  * struct sdca_function_data - top-level information for one SDCA function
1164996bf834SPierre-Louis Bossart  * @desc: Pointer to short descriptor from initial parsing.
116519f6748aSPierre-Louis Bossart  * @init_table: Pointer to a table of initialization writes.
1166996bf834SPierre-Louis Bossart  * @entities: Dynamically allocated array of Entities.
1167f87c2a27SCharles Keepax  * @clusters: Dynamically allocated array of Channel Clusters.
116819f6748aSPierre-Louis Bossart  * @num_init_table: Number of initialization writes.
1169996bf834SPierre-Louis Bossart  * @num_entities: Number of Entities reported in this Function.
1170f87c2a27SCharles Keepax  * @num_clusters: Number of Channel Clusters reported in this Function.
1171996bf834SPierre-Louis Bossart  * @busy_max_delay: Maximum Function busy delay in microseconds, before an
1172996bf834SPierre-Louis Bossart  * error should be reported.
1173996bf834SPierre-Louis Bossart  */
1174996bf834SPierre-Louis Bossart struct sdca_function_data {
1175996bf834SPierre-Louis Bossart 	struct sdca_function_desc *desc;
1176996bf834SPierre-Louis Bossart 
117719f6748aSPierre-Louis Bossart 	struct sdca_init_write *init_table;
1178996bf834SPierre-Louis Bossart 	struct sdca_entity *entities;
1179f87c2a27SCharles Keepax 	struct sdca_cluster *clusters;
118019f6748aSPierre-Louis Bossart 	int num_init_table;
1181996bf834SPierre-Louis Bossart 	int num_entities;
1182f87c2a27SCharles Keepax 	int num_clusters;
1183996bf834SPierre-Louis Bossart 
1184996bf834SPierre-Louis Bossart 	unsigned int busy_max_delay;
1185996bf834SPierre-Louis Bossart };
1186996bf834SPierre-Louis Bossart 
sdca_range(struct sdca_control_range * range,unsigned int col,unsigned int row)11871bcbb88bSCharles Keepax static inline u32 sdca_range(struct sdca_control_range *range,
11881bcbb88bSCharles Keepax 			     unsigned int col, unsigned int row)
11891bcbb88bSCharles Keepax {
11901bcbb88bSCharles Keepax 	return range->data[(row * range->cols) + col];
11911bcbb88bSCharles Keepax }
11921bcbb88bSCharles Keepax 
sdca_range_search(struct sdca_control_range * range,int search_col,int value,int result_col)11931bcbb88bSCharles Keepax static inline u32 sdca_range_search(struct sdca_control_range *range,
11941bcbb88bSCharles Keepax 				    int search_col, int value, int result_col)
11951bcbb88bSCharles Keepax {
11961bcbb88bSCharles Keepax 	int i;
11971bcbb88bSCharles Keepax 
11981bcbb88bSCharles Keepax 	for (i = 0; i < range->rows; i++) {
11991bcbb88bSCharles Keepax 		if (sdca_range(range, search_col, i) == value)
12001bcbb88bSCharles Keepax 			return sdca_range(range, result_col, i);
12011bcbb88bSCharles Keepax 	}
12021bcbb88bSCharles Keepax 
12031bcbb88bSCharles Keepax 	return 0;
12041bcbb88bSCharles Keepax }
12051bcbb88bSCharles Keepax 
1206996bf834SPierre-Louis Bossart int sdca_parse_function(struct device *dev,
1207996bf834SPierre-Louis Bossart 			struct sdca_function_desc *desc,
1208996bf834SPierre-Louis Bossart 			struct sdca_function_data *function);
1209996bf834SPierre-Louis Bossart 
12103a513da1SPierre-Louis Bossart #endif
1211