-
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
Fix runtime pm issue on volteer #2201
Conversation
|
@ClarexZhou can you help to validate it ? thanks |
Verified. Runtime PM is fixed on 373 in SDW mode. Also no side effect on 373 in I2S mode. |
|
|
||
| static const struct snd_soc_ops max_98373_sdw_ops = { | ||
| .startup = sdw_startup, | ||
| .trigger = max98373_trigger, |
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.
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?
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.
| if (info->amp_num == 2) | ||
| dai_links->init = spk_init; | ||
|
|
||
| info->late_probe = true; |
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.
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?
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.
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
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.
So what happens if you have several codecs of the same type?
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.
@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?
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 @RanderWang I think I'm getting it slowly. codec_info_list is a global array of objects - one per device type. Each of these objects is shared by all instances of that respective device - both for reading and writing. That's also how .amp_num is used. And there's no locking because (so far) those fields are changed from .init() and it's called for each device instance successively so no race is possible. This seems to be ok so far, but is a bit... strange. Can we also have codecs of different types mixed on a system? Would we then have to count them separately or together?
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.
yes, no race for sdw-sof is executed serially. We have one case on TGL: 1308 i2s + 711 sdw + HDMI.
|
@RanderWang I finally got what you are trying to do by reading a6c4e1a. However, I am not sure if it is a right solution. "Left Spk" and "Right Spk" are SND_SOC_DAPM_SPK which is supposed to be controlled by DAPM. Maybe what we really need is to enable/disable "VMON", "IMON", and "FBMON". |
|
SOFCI TEST |
34194af to
daedc46
Compare
This patch unify the codec prefix name to share code between I2S & sdw mode of max98373. Signed-off-by: randerwang <rander.wang@linux.intel.com>
Port patch: ASoC: Intel: Boards: tgl_max98373: add dai_trigger function to sdw platform to fix runtime pm issue. Signed-off-by: randerwang <rander.wang@linux.intel.com>
Disable Left and Right Spk pin after boot so that sof can get suspended. Please check patch: ASoC: Intel: Boards: tgl_max98373: add dai_trigger function Signed-off-by: randerwang <rander.wang@linux.intel.com>
Idle_bias_on is used to decide bias on/off in standby state by dapm. When Idle_bias_on is set to one, dapm will keep max98373 active at idle time. Max98373 is doing nothing in this state, so remove idle_bias_on setting to let max98373 get suspended when it is idle. Signed-off-by: randerwang <rander.wang@linux.intel.com> Reviewed-by : Ryan Lee <ryans.lee@maximintegrated.com>
these widgets are only controlled by codec driver, not by machine driver |
|
ICL-HDA was failed but it is not caused by this PR which only affects sdw platform |
That's a good point. Thanks. |
| struct sof_sdw_codec_info *info, | ||
| bool playback); | ||
|
|
||
| bool late_probe; |
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.
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 only way to revoke my "request for change" seems to me by approving the PR... I'll wait for more approvals from people more knowledgeable about SDW than myself, then I'll change my review to an "approval" too.
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 and it moves to a good direction that it is better to use the same code cross interfaces.
This PR ports patch #2123 to fix runtime pm issue.
And also remove idle_bias_on in codec driver to let codec be able to suspend
fixes #2053