-
Notifications
You must be signed in to change notification settings - Fork 143
ASoC: soc_sdw_utils: skip aux device if it is not present #5697
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
base: topic/sof-dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -1391,14 +1391,71 @@ int asoc_sdw_init_simple_dai_link(struct device *dev, struct snd_soc_dai_link *d | |||||||
| } | ||||||||
| EXPORT_SYMBOL_NS(asoc_sdw_init_simple_dai_link, "SND_SOC_SDW_UTILS"); | ||||||||
|
|
||||||||
| /** | ||||||||
| * is_sdca_aux_dev_present - Check if an SDCA aux device is present on the SDW peripheral | ||||||||
| * @dev: Device pointer | ||||||||
| * @aux_codec_name: Aux codec name from the codec info (e.g. "snd_soc_sdca.HID.2") | ||||||||
| * @adr_link: ACPI link address | ||||||||
| * @adr_index: Index of the ACPI link address | ||||||||
| * | ||||||||
| * Return: 1 if the aux is present, 0 if the aux is not present, or negative error code. | ||||||||
| */ | ||||||||
| static int is_sdca_aux_dev_present(struct device *dev, | ||||||||
| const char *aux_codec_name, | ||||||||
| const struct snd_soc_acpi_link_adr *adr_link, | ||||||||
| int adr_index) | ||||||||
| { | ||||||||
| struct sdw_slave *slave; | ||||||||
| struct device *sdw_dev; | ||||||||
| const char *sdw_codec_name; | ||||||||
| int ret = 0; | ||||||||
| int i; | ||||||||
|
|
||||||||
| if (!aux_codec_name) | ||||||||
| return 0; | ||||||||
|
|
||||||||
| sdw_codec_name = _asoc_sdw_get_codec_name(dev, adr_link, adr_index); | ||||||||
| if (!sdw_codec_name) | ||||||||
| return -ENOMEM; | ||||||||
|
|
||||||||
| sdw_dev = bus_find_device_by_name(&sdw_bus_type, NULL, sdw_codec_name); | ||||||||
| if (!sdw_dev) { | ||||||||
| dev_err(dev, "codec %s not found\n", sdw_codec_name); | ||||||||
| return -EINVAL; | ||||||||
| } | ||||||||
|
Comment on lines
+1421
to
+1425
|
||||||||
|
|
||||||||
| slave = dev_to_sdw_dev(sdw_dev); | ||||||||
|
|
||||||||
| if (!slave->sdca_data.interface_revision) { | ||||||||
| dev_warn(dev, "No SDCA properties, assuming aux '%s' present\n", aux_codec_name); | ||||||||
|
||||||||
| dev_warn(dev, "No SDCA properties, assuming aux '%s' present\n", aux_codec_name); | |
| dev_warn(&slave->dev, "No SDCA properties, assuming aux '%s' present\n", | |
| aux_codec_name); |
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 example aux codec name here ("snd_soc_sdca.HID.2") doesn’t match how aux codec names are defined in this file (e.g. codec_info_list uses "snd_soc_sdca.HID"). Please update the example/description to reflect the actual expected format.