diff options
Diffstat (limited to 'include/sound/sdca.h')
| -rw-r--r-- | include/sound/sdca.h | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/include/sound/sdca.h b/include/sound/sdca.h index 7e138229e8f3..67ff3c88705d 100644 --- a/include/sound/sdca.h +++ b/include/sound/sdca.h @@ -9,54 +9,79 @@ #ifndef __SDCA_H__ #define __SDCA_H__ +#include <linux/types.h> +#include <linux/kconfig.h> + +struct acpi_table_swft; +struct fwnode_handle; struct sdw_slave; +struct sdca_dev; #define SDCA_MAX_FUNCTION_COUNT 8 /** - * sdca_device_desc - short descriptor for an SDCA Function - * @adr: ACPI address (used for SDCA register access) - * @type: Function topology type - * @name: human-readable string + * struct sdca_function_desc - short descriptor for an SDCA Function + * @node: firmware node for the Function. + * @func_dev: pointer to SDCA function device. + * @name: Human-readable string. + * @type: Function topology type. + * @adr: ACPI address (used for SDCA register access). */ struct sdca_function_desc { - u64 adr; - u32 type; + struct fwnode_handle *node; + struct sdca_dev *func_dev; const char *name; + u32 type; + u8 adr; }; /** - * sdca_device_data - structure containing all SDCA related information - * @sdca_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 + * 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. - * @sdca_func: array of function descriptors + * @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 sdca_func[SDCA_MAX_FUNCTION_COUNT]; + 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 |
