-
Notifications
You must be signed in to change notification settings - Fork 140
Max98373 SDW review #2062
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
Max98373 SDW review #2062
Conversation
plbossart
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.
Looks quite good @naveen-manohar
The main issue is really the race conditions that can happen. The Slave CANNOT start any transactions before it is fully enumerated, so you have to rely on the complete/wait_for_completion mechanism that was added last year. If you don't things will break.
Also the pm_runtime part is largely incorrect or duplicated.
I would also try and avoid duplicating the core parts of the codec. See e.g. the Realtek examples, where they tried to reuse the same code. A lot of parts don't change when you only change the interface.
It's encouraging though, thanks for sharing. @bardliao and I can help for the pm_runtime stuff.
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.
Overall it looks good to me. Some changes needed.
|
Thank you All for the review and feedback, wrt max98373-sdw codec-driver, i will let @ryans-lee to address the feedback/queries, all others i shall re-check and update. |
ed70c4c to
e7b00e6
Compare
e7b00e6 to
54f461d
Compare
sound/soc/codecs/max98373-sdw.c
Outdated
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.
please, remove
224bfb6 to
a92cf97
Compare
lyakh
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.
there are still unanswered questions and unaddressed comments
a92cf97 to
eb0ca0c
Compare
|
@naveen-manohar There is a very high level of checkpatch warnings still: |
Apologies shall correct it.. i was concentrating only on the supporting files, missed the main codec driver check |
eb0ca0c to
d339891
Compare
Done.. Please help review. |
8ec9091 to
6e7a83f
Compare
b64c5ed to
43c9b16
Compare
RanderWang
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
Thank you for the review & support @RanderWang |
plbossart
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.
I only found a minor issue with num_of_ports. this is likely a copy-paste issue since the problem exists for other codecs, but let's fix it here.
Looks good otherwise, nice work @ryans-lee @naveen-manohar
43c9b16 to
af8efbb
Compare
plbossart
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.
I only have a couple of nit-picks, this should be submitted upstream now for additional reviews.
Thanks @naveen-manohar and @ryans-lee
af8efbb to
f2014e3
Compare
re-submitted the changes post verifying on-board, |
lyakh
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.
looks mostly good to me, just a couple of minor cosmetic clean-up comments
Changes since v13:
* cosmetic clean-up
Changes since v12:
* Removed obsolete code in set_tdm_slot function.
Changes since v11:
* Removed initial value of num_of_ports
Changes since v10:
* Removed redundant interrupt_callback in slave_ops
* Removed assigning slave_ops in probe function
Changes since v9:
* Added rx_mask, slot to configure TDM slot properly
Changes since v8:
* Removed duplicated parts with I2S driver.
* Support TDM
* Removed functions not needed.
* Minor cosmetic changes.
Changes since v7:
* addred return if sdw_stream is null in set_sdw_stream.
Changes since v6:
* Changed dpn type from SDW_DPN_SIMPLE to SDW_DPN_FULL to
configure DPN_HCtrl
Changes since v5:
* BDE and limiter default on
* Added missing pm_init_once flag set
Changes since v4:
* Added pm_init_once to do pm stuff once.
* Added return if SW RESET command is failed.
* ADded SET_RUNTIME_PM_OPS
* Removed all warning in checkpatch
* Modifed pm_runtime stuff
* Added GENMASK
* Removed interrupt callback function
Changes since v3:
* Added return after software reset failure
* Removed empty line in max98373_snd_probe
* Removed superfluous braces in max98373_clock_calculate
Changes since v2:
* Removed unused variables : tdm_mode, first_hw_init
* Replaced while loop by for loop to replace open-coded code
* Removed unnecessary condition check in max98373_io_init
* Removed unnecessary runtime pm control in max98373_io_init
* Added more amp initializtion code to max98373_io_init
* Removed unnecessary global shutdown on/off to avoid pop noise
* Added max98373_clock_calculate to calculate SWCLK
* snd_soc_register_component -> devm_snd_soc_register_component
Changes since v1:
* Modified GPL-v2.0 to GPL-v2.0-or-later
* Added soundwire registers to the header.
* Modified comments. Control registers->Control Port Registers
* removed duplication code for the pm control
* Added module_sdw_driver() instread of using module_init/exit
* Removed ret variable.
* Removed empty lines.
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Naveen Manohar <naveen.m@intel.com>
…oard Add max98373-sdw helper function, which configures 2x MAX98373 codecs to Link1. Changes since v2: * SPDX license with GPL-2.0-only as per PR#2028 Changes since v1: * Separated Makefile entry to avoid mixing of realtek and maxim * Corrected sof_sdw_max98373.c driver info comment style * Added quirk for volteer to indicate speaker number Signed-off-by: Naveen Manohar <naveen.m@intel.com>
…ire driver RT5682 is in Soundwire mode on Link0 & 2x MAX98373 on link1. Signed-off-by: Naveen Manohar <naveen.m@intel.com>
f2014e3 to
732b5cc
Compare
RanderWang
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.
Tested on TGL
|
@naveen-manohar @ryans-lee do you want us to send this to alsa-devel, along with the Reviewed-by tags we already have? Just checking, it's straightforward to do for me/Kai/Ranjani. Thanks! |
|
yes, please. I appreciate for your help. |
@plbossart please merge #2178. Thanks! |
As discussed in #2039 submitting Max98373-SDW codec and helper driver for review.