Skip to content

Conversation

@naveen-manohar
Copy link

As discussed in #2039 submitting Max98373-SDW codec and helper driver for review.

Copy link
Member

@plbossart plbossart left a 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.

Copy link
Collaborator

@bardliao bardliao left a 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.

@naveen-manohar
Copy link
Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, remove

@naveen-manohar naveen-manohar force-pushed the max98373-sdw_review branch 2 times, most recently from 224bfb6 to a92cf97 Compare May 8, 2020 12:13
@naveen-manohar naveen-manohar requested a review from lyakh May 8, 2020 12:15
Copy link
Collaborator

@lyakh lyakh left a 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

@kv2019i
Copy link
Collaborator

kv2019i commented May 11, 2020

@naveen-manohar There is a very high level of checkpatch warnings still:
https://travis-ci.org/github/thesofproject/linux/jobs/685699044

@naveen-manohar
Copy link
Author

@naveen-manohar There is a very high level of checkpatch warnings still:
https://travis-ci.org/github/thesofproject/linux/jobs/685699044

Apologies shall correct it.. i was concentrating only on the supporting files, missed the main codec driver check

@naveen-manohar
Copy link
Author

@naveen-manohar There is a very high level of checkpatch warnings still:
https://travis-ci.org/github/thesofproject/linux/jobs/685699044

Apologies shall correct it.. i was concentrating only on the supporting files, missed the main codec driver check

Done.. Please help review.

@naveen-manohar naveen-manohar requested a review from lyakh May 13, 2020 03:57
@naveen-manohar naveen-manohar force-pushed the max98373-sdw_review branch 2 times, most recently from 8ec9091 to 6e7a83f Compare May 17, 2020 16:56
RanderWang
RanderWang previously approved these changes May 21, 2020
Copy link

@RanderWang RanderWang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@naveen-manohar
Copy link
Author

LGTM

Thank you for the review & support @RanderWang

Copy link
Member

@plbossart plbossart left a 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

plbossart
plbossart previously approved these changes May 22, 2020
Copy link
Member

@plbossart plbossart left a 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

@naveen-manohar
Copy link
Author

I only have a couple of nit-picks, this should be submitted upstream now for additional reviews.
Thanks @naveen-manohar and @ryans-lee

re-submitted the changes post verifying on-board,
Many Thanks @plbossart for the review & support.
Please help us moving this to upstream.

@naveen-manohar naveen-manohar requested a review from plbossart May 23, 2020 01:57
Copy link
Collaborator

@lyakh lyakh left a 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

Ryan Lee and others added 3 commits May 26, 2020 06:40
    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>
@naveen-manohar naveen-manohar requested a review from lyakh May 26, 2020 07:34
Copy link

@RanderWang RanderWang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on TGL

@plbossart
Copy link
Member

@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!

@ryans-lee
Copy link

yes, please. I appreciate for your help.

@RanderWang
Copy link

@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!

@plbossart please merge #2178. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants