xref: /linux/include/sound/sdca_function.h (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
2 /*
3  * The MIPI SDCA specification is available for public downloads at
4  * https://www.mipi.org/mipi-sdca-v1-0-download
5  *
6  * Copyright(c) 2024 Intel Corporation
7  */
8 
9 #ifndef __SDCA_FUNCTION_H__
10 #define __SDCA_FUNCTION_H__
11 
12 /*
13  * SDCA Function Types from SDCA specification v1.0a Section 5.1.2
14  * all Function types not described are reserved
15  * Note that SIMPLE_AMP, SIMPLE_MIC and SIMPLE_JACK Function Types
16  * are NOT defined in SDCA 1.0a, but they were defined in earlier
17  * drafts and are planned for 1.1.
18  */
19 
20 enum sdca_function_type {
21 	SDCA_FUNCTION_TYPE_SMART_AMP	= 0x01,	/* Amplifier with protection features */
22 	SDCA_FUNCTION_TYPE_SIMPLE_AMP	= 0x02,	/* subset of SmartAmp */
23 	SDCA_FUNCTION_TYPE_SMART_MIC	= 0x03,	/* Smart microphone with acoustic triggers */
24 	SDCA_FUNCTION_TYPE_SIMPLE_MIC	= 0x04,	/* subset of SmartMic */
25 	SDCA_FUNCTION_TYPE_SPEAKER_MIC	= 0x05,	/* Combination of SmartMic and SmartAmp */
26 	SDCA_FUNCTION_TYPE_UAJ		= 0x06,	/* 3.5mm Universal Audio jack */
27 	SDCA_FUNCTION_TYPE_RJ		= 0x07,	/* Retaskable jack */
28 	SDCA_FUNCTION_TYPE_SIMPLE_JACK	= 0x08,	/* Subset of UAJ */
29 	SDCA_FUNCTION_TYPE_HID		= 0x0A,	/* Human Interface Device, for e.g. buttons */
30 	SDCA_FUNCTION_TYPE_IMP_DEF	= 0x1F,	/* Implementation-defined function */
31 };
32 
33 /* Human-readable names used for kernel logs and Function device registration/bind */
34 #define	SDCA_FUNCTION_TYPE_SMART_AMP_NAME	"SmartAmp"
35 #define	SDCA_FUNCTION_TYPE_SIMPLE_AMP_NAME	"SimpleAmp"
36 #define	SDCA_FUNCTION_TYPE_SMART_MIC_NAME	"SmartMic"
37 #define	SDCA_FUNCTION_TYPE_SIMPLE_MIC_NAME	"SimpleMic"
38 #define	SDCA_FUNCTION_TYPE_SPEAKER_MIC_NAME	"SpeakerMic"
39 #define	SDCA_FUNCTION_TYPE_UAJ_NAME		"UAJ"
40 #define	SDCA_FUNCTION_TYPE_RJ_NAME		"RJ"
41 #define	SDCA_FUNCTION_TYPE_SIMPLE_NAME		"SimpleJack"
42 #define	SDCA_FUNCTION_TYPE_HID_NAME		"HID"
43 
44 enum sdca_entity0_controls {
45 	SDCA_CONTROL_ENTITY_0_COMMIT_GROUP_MASK		= 0x01,
46 	SDCA_CONTROL_ENTITY_0_INTSTAT_CLEAR		= 0x02,
47 	SDCA_CONTROL_ENTITY_0_INT_ENABLE		= 0x03,
48 	SDCA_CONTROL_ENTITY_0_FUNCTION_SDCA_VERSION	= 0x04,
49 	SDCA_CONTROL_ENTITY_0_FUNCTION_TOPOLOGY		= 0x05,
50 	SDCA_CONTROL_ENTITY_0_FUNCTION_MANUFACTURER_ID	= 0x06,
51 	SDCA_CONTROL_ENTITY_0_FUNCTION_ID		= 0x07,
52 	SDCA_CONTROL_ENTITY_0_FUNCTION_VERSION		= 0x08
53 };
54 
55 #endif
56