include/sound/sdca.h

Source file repositories/reference/linux-study-clean/include/sound/sdca.h

File Facts

System
Linux kernel
Corpus path
include/sound/sdca.h
Extension
.h
Size
2549 bytes
Lines
92
Domain
Driver Families
Bucket
include/sound
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct sdca_function_desc {
	struct fwnode_handle *node;
	struct sdca_dev *func_dev;
	const char *name;
	u32 type;
	u8 adr;

	bool duplicate;
};

/**
 * struct sdca_device_data - structure containing all SDCA related information
 * @interface_revision: Value read from _DSD property, mainly to check
 * for changes between silicon versions.
 * @num_functions: Total number of supported SDCA functions. Invalid/unsupported
 * functions will be skipped.
 * @function: Array of function descriptors.
 * @swft: Pointer to the SWFT table, if available.
 */
struct sdca_device_data {
	u32 interface_revision;
	int num_functions;
	struct sdca_function_desc function[SDCA_MAX_FUNCTION_COUNT];
	struct acpi_table_swft *swft;
};

enum sdca_quirk {
	SDCA_QUIRKS_RT712_VB,
	SDCA_QUIRKS_SKIP_FUNC_TYPE_PATCHING,
};

#if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_SOC_SDCA)

void sdca_lookup_functions(struct sdw_slave *slave);
void sdca_lookup_swft(struct sdw_slave *slave);
void sdca_lookup_interface_revision(struct sdw_slave *slave);
bool sdca_device_quirk_match(struct sdw_slave *slave, enum sdca_quirk quirk);
int sdca_dev_register_functions(struct sdw_slave *slave);
void sdca_dev_unregister_functions(struct sdw_slave *slave);

#else

static inline void sdca_lookup_functions(struct sdw_slave *slave) {}
static inline void sdca_lookup_swft(struct sdw_slave *slave) {}
static inline void sdca_lookup_interface_revision(struct sdw_slave *slave) {}
static inline bool sdca_device_quirk_match(struct sdw_slave *slave, enum sdca_quirk quirk)
{
	return false;
}

static inline int sdca_dev_register_functions(struct sdw_slave *slave)
{
	return 0;
}

static inline void sdca_dev_unregister_functions(struct sdw_slave *slave) {}

#endif

#endif

Annotation

Implementation Notes