forked from torvalds/linux
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
SoundWire: intel: cleanups/fixes before code reorganization #3835
Merged
bardliao
merged 11 commits into
thesofproject:topic/sof-dev
from
plbossart:sdw/cleanups-before-split
Aug 30, 2022
Merged
SoundWire: intel: cleanups/fixes before code reorganization #3835
bardliao
merged 11 commits into
thesofproject:topic/sof-dev
from
plbossart:sdw/cleanups-before-split
Aug 30, 2022
Conversation
This file contains 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
The call to intel_register_dai() may fail because of memory allocation issues or problems reported by the ASoC core. In all cases, when a error is thrown the component is not registered, it's invalid to unregister it. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
We already use devm_ for memory allocation but not for component/DAI registration. The resource management can be based on devm_ in all cases. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
These two steps can and should be done before starting up the clock and the bus operation. This is a first step before re-grouping functionality in well-defined callbacks. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Start regrouping functionality in high-level functions. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Simplify signature before further code reshuffling. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Move code around before additional simplification. No functionality change. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
We can directly call intel_link_power_up and do power_up+shim_init in the same function. This simplifies the code with a better symmetry between power_up and power_down operations. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
We can assign the right callback directly in the ops structure. No functionality change. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add new helper before code partitioning in order to avoid direct read from specific register. No functionality change. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
plbossart
requested review from
RanderWang,
shumingfan,
oder-chiou,
jack-cy-yu and
ryans-lee
as code owners
August 25, 2022 09:29
aiChaoSONG
changed the title
SoundWire; intel: cleanups/fixes before code reorganization
SoundWire: intel: cleanups/fixes before code reorganization
Aug 26, 2022
RanderWang
reviewed
Aug 26, 2022
bardliao
reviewed
Aug 26, 2022
bardliao
reviewed
Aug 26, 2022
There are 3 different sequences to start the bus, let's move the functionality to helpers. There should be no functionality change, except in error cases where the flow is improved with more consistent disabling of interrupts and powering down. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
We have three nearly identical sequences to stop the clock, let's introduce a helper to reuse the same code. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
plbossart
force-pushed
the
sdw/cleanups-before-split
branch
from
August 26, 2022 08:57
d001c44
to
3ae8f3f
Compare
SOFCI TEST |
bardliao
approved these changes
Aug 29, 2022
RanderWang
approved these changes
Aug 30, 2022
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.
This is a really big cleanup to introduce well defined helpers, prior to a larger code reorganization.
This is relatively invasive to needs to be reviewed carefully, specifically on error flows.