-
Notifications
You must be signed in to change notification settings - Fork 140
Fix runtime pm issue on volteer #2201
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
Changes from all commits
ca0d2fb
c4a8dc4
1427750
daedc46
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 |
|---|---|---|
|
|
@@ -9,18 +9,13 @@ | |
| #include <sound/soc.h> | ||
| #include <sound/soc-acpi.h> | ||
| #include "sof_sdw_common.h" | ||
| #include "sof_maxim_common.h" | ||
|
|
||
| static const struct snd_soc_dapm_widget mx8373_widgets[] = { | ||
| SND_SOC_DAPM_SPK("Left Spk", NULL), | ||
| SND_SOC_DAPM_SPK("Right Spk", NULL), | ||
| }; | ||
|
|
||
| static const struct snd_soc_dapm_route mx8373_map[] = { | ||
| /* Speakers */ | ||
| { "Left Spk", NULL, "mx8373-1 BE_OUT" }, | ||
| { "Right Spk", NULL, "mx8373-2 BE_OUT" }, | ||
| }; | ||
|
|
||
| static const struct snd_kcontrol_new mx8373_controls[] = { | ||
| SOC_DAPM_PIN_SWITCH("Left Spk"), | ||
| SOC_DAPM_PIN_SWITCH("Right Spk"), | ||
|
|
@@ -51,13 +46,19 @@ static int spk_init(struct snd_soc_pcm_runtime *rtd) | |
| return ret; | ||
| } | ||
|
|
||
| ret = snd_soc_dapm_add_routes(&card->dapm, mx8373_map, 2); | ||
| ret = snd_soc_dapm_add_routes(&card->dapm, max_98373_dapm_routes, 2); | ||
| if (ret) | ||
| dev_err(rtd->dev, "failed to add first SPK map: %d\n", ret); | ||
|
|
||
| return ret; | ||
| } | ||
|
|
||
| static const struct snd_soc_ops max_98373_sdw_ops = { | ||
| .startup = sdw_startup, | ||
| .trigger = max98373_trigger, | ||
|
Collaborator
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. where is this function defined? I don't see it in this file and this file doesn't seem to even include any max98373 headers?
Author
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. |
||
| .shutdown = sdw_shutdown, | ||
| }; | ||
|
|
||
| int sof_sdw_mx8373_init(const struct snd_soc_acpi_link_adr *link, | ||
| struct snd_soc_dai_link *dai_links, | ||
| struct sof_sdw_codec_info *info, | ||
|
|
@@ -67,5 +68,19 @@ int sof_sdw_mx8373_init(const struct snd_soc_acpi_link_adr *link, | |
| if (info->amp_num == 2) | ||
| dai_links->init = spk_init; | ||
|
|
||
| info->late_probe = true; | ||
|
Collaborator
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. do I understand it correctly, that you're modifying here a global static common struct? Are we sure no other driver will want to use it?
Author
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. we also increase info->amp_num in this function. It is only used by sof_sdw machine driver for it is a static struct define in sof_sdw.c
Collaborator
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. So what happens if you have several codecs of the same type?
Member
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. @lyakh can you clarify your question? we do have configurations with 2 amplifiers of the same type, not sure what you see as wrong or incorrect?
Collaborator
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. @plbossart @RanderWang I think I'm getting it slowly.
Author
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. yes, no race for sdw-sof is executed serially. We have one case on TGL: 1308 i2s + 711 sdw + HDMI. |
||
|
|
||
| dai_links->ops = &max_98373_sdw_ops; | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| int sof_sdw_mx8373_late_probe(struct snd_soc_card *card) | ||
| { | ||
| struct snd_soc_dapm_context *dapm = &card->dapm; | ||
|
|
||
| /* Disable Left and Right Spk pin after boot */ | ||
| snd_soc_dapm_disable_pin(dapm, "Left Spk"); | ||
| snd_soc_dapm_disable_pin(dapm, "Right Spk"); | ||
| return snd_soc_dapm_sync(dapm); | ||
| } | ||
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.
@RanderWang why do we need this book? Can we not simply check if the function pointer below is NULL?
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.
@ranj063 consider a case: a codec has late_probe function but it is not integrated in some platforms, so we don't need to invoke this function.