-
Notifications
You must be signed in to change notification settings - Fork 349
ipc: add DAI_HW_FREE IPC command #4262
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
So that we can stop ssp clock in dai_reset. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> (cherry picked from commit 7feb456)
There is an STREAM_PCM_FREE IPC command which is sent to a SOF pipeline in trigger stop. Here we add an new DAI_HW_FREE command which will be sent to SOF DAI component. The command is sent from BE DAI link so codec driver has chance to run code in the mute_stream() callback before the DAI_HW_FREE IPC command is sent. Signed-off-by: Brent Lu <brent.lu@intel.com>
We will enable/disable ssp clock in the ops. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> (cherry picked from commit 3ffe417)
|
Although this is backwards compatible, this needs to follow ABI change process: |
| //return ipc_comp_set_value(header, COMP_CMD_LOOPBACK); | ||
| return -EINVAL; | ||
| case SOF_IPC_DAI_HW_FREE: | ||
| return ipc_msg_dai_hw_free(header); |
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.
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.
For two reasons, first the PCM_FREE is 'usually' sent in trigger stop now. Second, we need to send something in BE DAI's hw_free instead of FE DAI or the SOF will still stop the bclk too early.
DROP:
sof's trigger()
=> send STREAM_TRIG_STOP
=> send STREAM_PCM_FREE
HW_FREE:
sof's hw_free() (FE)
=> too early, codec could do nothing
codec's mute_stream()
=> codec could handle it's PLL here
sof's hw_free() (BE)
=> send DAI_HW_FREE to SOF to stop bclk
codec's hw_free()
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.
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.
got the issue now @brentlu
IMO we can still use the existed _IPC_STREAM_PCM_FREE but change the point of sending it, e.g. send it later, at the point where we want the clocks to be freed.
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.
It seems weird for me to move it from FE to BE DAI Link since this command deals with PCM pipe...
|
@brentlu lets get input from @plbossart here as this is probably more complex for the kernel than the FW. |
|
I don't understand any of this @brentlu @lgirdwood @keyonjie a) "the PCM_FREE is 'usually' sent in trigger stop now." Why is this the case? This seems like a major bug to me. |
Sorry I forgot to mention kernel PR is this one: |
|
we are not adding extra ipc command now. |
This PR is for discussion in #4219 to solver the hw_free issue, see comment #4219 (comment)