Add SDCA widgets, routes and controls#5358
Closed
charleskeepax wants to merge 9 commits intothesofproject:topic/sof-devfrom
Closed
Add SDCA widgets, routes and controls#5358charleskeepax wants to merge 9 commits intothesofproject:topic/sof-devfrom
charleskeepax wants to merge 9 commits intothesofproject:topic/sof-devfrom
Conversation
Slightly neaten up the initilization write code to overlay a struct rather than shifting the pointer along manually. This also removes the Sparse warning: sound/soc/sdca/sdca_functions.c:233:36: warning: cast to restricted __le32 Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Implementation defined controls will not be present in the large list of know controls for SDCA. The driver should not return an error for these, because it is perfectly legal to have implementation defined controls. Update the handling to instead generate a generic name. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
SDCA Controls come in a variety of data formats, to simplify later parsing work out this data type as the control is parsed and stash it for later use. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
SDCA Ranges are two dimensional arrays of data associated with controls, add a helper to provide an x,y access mechanism to the data and a helper to locate a specific value inside a range. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Add support for parsing the Group Entity properties from DisCo/ACPI. Group Entities allow controls of several other Entities, typically Selector Units, from a single control. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Use the previously parsed DisCo information from ACPI to create DAPM widgets and routes representing a SDCA Function. A top level helper sdca_asoc_populate_component() is exported that counts and allocates everything, however, the intermediate counting and population functions are also exported should end drivers require some custom handling that isn't provided by the top level helper. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Use the previously parsed DisCo information from ACPI to create the ALSA controls required by an SDCA Function. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Use the previously parsed DisCo information from ACPI to create the DAI drivers required to connect an SDCA Function into an ASoC soundcard. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Add helper function to extract the hardware port number from the DataPort Selector Controls. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
ranj063
reviewed
Mar 11, 2025
|
|
||
| group->modes = devm_kcalloc(dev, group->num_modes, sizeof(*group->modes), | ||
| GFP_KERNEL); | ||
| if (!group->modes) |
Collaborator
There was a problem hiding this comment.
do we need to free affected_list here?
| mode->controls = devm_kcalloc(dev, mode->num_controls, | ||
| sizeof(*mode->controls), GFP_KERNEL); | ||
| if (!mode->controls) | ||
| return -ENOMEM; |
| return 0; | ||
|
|
||
| bad_list: | ||
| dev_err(dev, "%s: malformed affected controls list\n", entity->label); |
Author
There was a problem hiding this comment.
ah yes good spots thank you I will get those fixed up.
bardliao
reviewed
Mar 12, 2025
| "mipi-sdca-ge-selectedmode-controls-affected", | ||
| affected_list, num_affected); | ||
|
|
||
| group->num_modes = *affected_list; |
Collaborator
There was a problem hiding this comment.
Should it be group->num_modes = num_affected;?
Author
There was a problem hiding this comment.
No that is correct as is, although perhaps slightly confusing, num_affected contains the number of values in affected_list, but the number of modes is the first value in that list.
Author
|
Mostly the review has moved to upstream now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Still a bit of a work in progress but pushing as running a bit late and want you guys to see where we are at with things. This adds support with a few rough edges for automatically generating all the DAPM routes, DAIs, widgets and ALSA controls based on the SDCA DisCo information.