Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 150
ASoC/SoundWire: parse SDCA functions to filter the RT712-VB configuration#4995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
28417a7ec18579591b2de00ac11fa343d0ee997059b4e8ddaa037045File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ | ||
| /* | ||
| * The MIPI SDCA specification is available for public downloads at | ||
| * https://www.mipi.org/mipi-sdca-v1-0-download | ||
| * | ||
| * Copyright(c) 2024 Intel Corporation | ||
| */ | ||
| #ifndef __SDCA_H__ | ||
| #define __SDCA_H__ | ||
| struct sdw_slave; | ||
| /** | ||
| * 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 | ||
| * @sdca_function_mask: shortcut to list all SDCA functions with a bitmask | ||
| */ | ||
| struct sdca_device_data { | ||
| u32 interface_revision; | ||
| u32 function_mask; | ||
MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note to self: this function_mask assumed that there is only ONE type of function type per codec. The spec says otherwise, it's permitted to have multiple instances of the same function type, except for HID. That means we need an array of (ADR, function_type) pairs. | ||
| }; | ||
| enum sdca_quirk { | ||
| SDCA_QUIRKS_RT712_VB, | ||
| }; | ||
| #if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_SOC_SDCA) | ||
| void sdca_lookup_function_mask(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); | ||
| #else | ||
| static inline void sdca_lookup_function_mask(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; | ||
| } | ||
| #endif | ||
| #endif | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ | ||
| /* | ||
| * The MIPI SDCA specification is available for public downloads at | ||
| * https://www.mipi.org/mipi-sdca-v1-0-download | ||
| * | ||
| * Copyright(c) 2024 Intel Corporation | ||
| */ | ||
| #ifndef __SDCA_FUNCTION_H__ | ||
| #define __SDCA_FUNCTION_H__ | ||
| #define SDCA_MAX_FUNCTION_COUNT 8 | ||
| /* | ||
| * SDCA Function Types from SDCA specification v1.0a Section 5.1.2 | ||
| * all Function types not described are reserved | ||
| * Note that SIMPLE_AMP, SIMPLE_MIC and SIMPLE_JACK Function Types | ||
| * are NOT defined in SDCA 1.0a, but they were defined in earlier | ||
| * drafts and are planned for 1.1. | ||
| */ | ||
| enum sdca_function_type { | ||
| SDCA_FUNCTION_TYPE_SMART_AMP = 0x01, /* Amplifier with protection features */ | ||
| SDCA_FUNCTION_TYPE_SIMPLE_AMP = 0x02, /* subset of SmartAmp */ | ||
| SDCA_FUNCTION_TYPE_SMART_MIC = 0x03, /* Smart microphone with acoustic triggers */ | ||
| SDCA_FUNCTION_TYPE_SIMPLE_MIC = 0x04, /* subset of SmartMic */ | ||
| SDCA_FUNCTION_TYPE_SPEAKER_MIC = 0x05, /* Combination of SmartMic and SmartAmp */ | ||
| SDCA_FUNCTION_TYPE_UAJ = 0x06, /* 3.5mm Universal Audio jack */ | ||
| SDCA_FUNCTION_TYPE_RJ = 0x07, /* Retaskable jack */ | ||
| SDCA_FUNCTION_TYPE_SIMPLE_JACK = 0x08, /* Subset of UAJ */ | ||
| SDCA_FUNCTION_TYPE_HID = 0x0A, /* Human Interface Device, for e.g. buttons */ | ||
| SDCA_FUNCTION_TYPE_IMP_DEF = 0x1F, /* Implementation-defined function */ | ||
| }; | ||
| enum sdca_entity0_controls { | ||
| SDCA_CONTROL_ENTITY_0_COMMIT_GROUP_MASK = 0x01, | ||
| SDCA_CONTROL_ENTITY_0_INTSTAT_CLEAR = 0x02, | ||
| SDCA_CONTROL_ENTITY_0_INT_ENABLE = 0x03, | ||
| SDCA_CONTROL_ENTITY_0_FUNCTION_SDCA_VERSION = 0x04, | ||
| SDCA_CONTROL_ENTITY_0_FUNCTION_TOPOLOGY = 0x05, | ||
| SDCA_CONTROL_ENTITY_0_FUNCTION_MANUFACTURER_ID = 0x06, | ||
| SDCA_CONTROL_ENTITY_0_FUNCTION_ID = 0x07, | ||
| SDCA_CONTROL_ENTITY_0_FUNCTION_VERSION = 0x08 | ||
| }; | ||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -183,6 +183,10 @@ struct snd_soc_acpi_link_adr { | ||
| * ACPI ID alone is not sufficient, wrong or misleading | ||
| * @quirk_data: data used to uniquely identify a machine, usually a list of | ||
| * audio codecs whose presence if checked with ACPI | ||
| * @machine_check: pointer to quirk function. The functionality is similar to | ||
| * the use of @machine_quirk, except that the return value is a boolean: the intent | ||
| * is to skip a machine if the additional hardware/firmware verification invalidates | ||
| * the initial selection in the snd_soc_acpi_mach table. | ||
| * @pdata: intended for platform data or machine specific-ops. This structure | ||
| * is not constant since this field may be updated at run-time | ||
| * @sof_tplg_filename: Sound Open Firmware topology file name, if enabled | ||
| @@ -201,6 +205,7 @@ struct snd_soc_acpi_mach { | ||
| const char *board; | ||
| struct snd_soc_acpi_mach * (*machine_quirk)(void *arg); | ||
| const void *quirk_data; | ||
| bool (*machine_check)(void *arg); | ||
plbossart marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| void *pdata; | ||
| struct snd_soc_acpi_mach_params mach_params; | ||
| const char *sof_tplg_filename; | ||
| @@ -231,7 +236,6 @@ static inline bool snd_soc_acpi_sof_parent(struct device *dev) | ||
| bool snd_soc_acpi_sdw_link_slaves_found(struct device *dev, | ||
| const struct snd_soc_acpi_link_adr *link, | ||
| struct sdw_extended_slave_id *ids, | ||
| int num_slaves); | ||
| struct sdw_peripherals *peripherals); | ||
| #endif | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.