-
Notifications
You must be signed in to change notification settings - Fork 140
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
Conversation
dc306f5 to
7b12bc0
Compare
|
@shumingfan @bardliao here's an example of what we could do to filter the required topology. On a MTL device with RT713, I can detect the VA version. |
7b12bc0 to
5644b4b
Compare
|
@bardliao @shumingfan I can't figure out if the RT712 and RT713 are identical or not, and if they have the same number of endpoints. For now I get this error when I align RT712 and RT713... [ 144.018284] sof_sdw sof_sdw: 1 is too many endpoints for codec: 0x713 |
5644b4b to
667a5af
Compare
|
@shumingfan can you test this with RT712 VA and VB? The topologies required are generated with thesofproject/sof#9125 |
rt712 and rt713 are not identical. rt712 supports amp function while rt713 doesn't. |
sound/soc/sdca/sdca_device.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe >= 0x1000? As far as I know, the function type definition changed from sdca 0.6 to 1.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bardliao @shumingfan I could see this value in the ASL file:
Package (2) {"mipi-sdw-sdca-interface-revision", 0x0801}, // Integer: SDCA 0.8r01
Can I use it as an indicator for VB, or just keep the > 0x0604 that was used for VA?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart Yes, the SDCA version of VB should be version 0x0801 or above.
@plbossart I try to test RT712VA and VB on MTL RVP with different ASL files. |
ujfalusi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart, we should not lock SDCA to be only usable with ACPI, that sounds wrong.
I find some other parts confusing as well, probably documentation can help address those.
|
Of course we have a side effect with MTL AIOC having a bad DSDT Gah. what a mess. |
667a5af to
4e2d7f6
Compare
|
https://sof-ci.01.org/linuxpr/PR4995/build3008/devicetest/index.html?model=MTLP_SDW_AIOC&testcase=verify-kernel-boot-log is a case of bad configuration I am afraid on ba-mtlp-sdw-aioc-02: the device is detected as HDaudio and we use it for SoundWire tests?? @ssavati can you please double-check this device? This is clearly wrong: |
|
@plbossart I have checked the BIOS configuration and other settings , everything is fine. Same device without this PR works fine. I think there is regression in this PR. |
ujfalusi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart, It looks much cleaner, I have few suggestions around the acpi handling to make the code more generic.
include/sound/soc-acpi.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably it is going to be too much overload, but the functionality of this new callback is is_machine_match()
Thanks for checking @ssavati there was a one-line Kconfig change that caused the problem by completely disabling SoundWire with the default kconfig scripts. Fixed now on my side. |
|
New version with a cleaner parsing of the functions with the backwards-compatible re-ordering for early devices @shumingfan please re-check if I did something wrong, it's Friday afternoon and it's been a long week. Thanks! |
4e2d7f6 to
ff658f4
Compare
|
https://github.com/thesofproject/linux/actions/runs/9134952643/job/25121470472?pr=4995 |
e07bb4d to
00d3933
Compare
bardliao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ujfalusi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart, thank you for the updates, looks good with the exception of the mixed slave->dev / dev use for prints.
sound/soc/sdca/sdca_functions.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it needs to be dual license?
This structure is used to copy information from the 'sdw_slave' structures, it's better to create a flexible array of 'sdw_slave' pointers and directly access the information. This will also help access additional information stored in the 'sdw_slave' structure, such as an SDCA context. This patch does not add new functionality, it only modified how the information is retrieved. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add new module for SDCA (SoundWire Device Class for Audio) support. For now just add a parser to identify the SDCA revision and the function mask. Note that the SDCA definitions and related MIPI DisCo properties are defined only for ACPI platforms and extracted with _DSD helpers. There is currently no support for Device Tree in the specification, the 'depends on ACPI' reflects this design limitation. This might change in a future revision of the specification but for SDCA 1.0 ACPI is the only supported type of platform firmware. The SDCA library is defined with static inline fallbacks, which will allow for unconditional addition of SDCA support in common parts of the code. For more technical details, the SDCA specification is available for public downloads at https://www.mipi.org/mipi-sdca-v1-0-download Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Use SDCA helpers to get the information and store it. When platforms are not based on ACPI the helpers do absolutely nothing. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add a generic match function for quirks, chances are we are going to have lots of those... Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The existing machine_quirk() returns a pointer to a soc_acpi_mach structure. For SoundWire/SDCA support, we need a slightly different functionality where a quirk function either validates or NACKs an initial selection, based on additional firmware/DMI information. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add a filter to skip the RT172 VB configuration if a SmartMic Function is not found in the SDCA descriptors. If the ACPI information is incorrect this can only be quirked further with DMI information. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Use the existing machine_quirk() callback to select an alternate topology for RT712-VB devices. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
In theory the dailinks are created based on the number of endpoints reported in ACPI match tables, so it should harmless to add a new dailink: RT712 VA would not use it since it has only 2 endpoints. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
00d3933 to
a037045
Compare
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the definition of a function_mask was a bad idea...
| */ | ||
| struct sdca_device_data { | ||
| u32 interface_revision; | ||
| u32 function_mask; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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.
|
closing for now, WIP alternate solution with extensions for functions |
Somewhat convoluted code to skip machine driver entries that require RT712 VB hardware.