Skip to content

Conversation

@brentlu
Copy link

@brentlu brentlu commented Apr 30, 2021

It's a series to:

  1. Add a machine driver, sof_cs42l42, to support Cirrus Logic CS42L42 + Maxim MAX98357A on GLK devices.
  2. Move MAX98357A support to a common module, sof_maxim_common
  3. Code refactory to sof_rt5682 and sof_cs42l42 to use sof_maxim_common to support Maxim MAX98357A

@brentlu
Copy link
Author

brentlu commented Apr 30, 2021

The topology is here: thesofproject/sof#4121

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.

Thanks @brentlu it's quite good but see below a couple of suggested improvements to remove copy-paste and improve code.

I think you are missing the sound/soc/intel/common/soc-acpi..glk-match.c, this would be needed to load the machine driver.

Move max98357a code to this common module so it could be shared
between multiple SOF machine drivers.

Signed-off-by: Brent Lu <brent.lu@intel.com>
@brentlu brentlu force-pushed the cs42l42 branch 2 times, most recently from 4d62b0e to ba0d2dd Compare May 3, 2021 05:28
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.

some minor cosmetic improvement suggestions

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.

thanks @brentlu, nice work.

@plbossart
Copy link
Member

I had to manually approve @brentlu so let's wait until we see the GitHub Actions results + another approved to merge

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 have to take my approval back after looking at the topology.
It's simpler if we have first the SSP links added, then dmic and HDMI last. The topology changes [1] can be simplified a lot by using the same order as for DA7219.

[1] thesofproject/sof@ef0ebaf#diff-ef984278da4b010127ccd588daa6d53c55bff7a852c2ef42f7b39a82d4bd3951R195

@brentlu
Copy link
Author

brentlu commented May 3, 2021

Adjust the DAI Link sequence in sof_card_dai_links_create() function to follow the order: SPK, HEADPHONE, DMIC, HDMI

@plbossart
Copy link
Member

restarting SOF CI tests since we are missing the configuration for the new machine driver

@plbossart
Copy link
Member

SOFCI TEST

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.

@brentlu I added the missing config and CI reports errors with make W=1 and also checkpatch.pl --strict has quite a few warnings. Nothing critical but let's make this PR shiny for upstream. Thanks!

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.

Looks quite good to me, just some minor comments.

@brentlu
Copy link
Author

brentlu commented May 4, 2021

warnings from checkpatch are fixed

@brentlu
Copy link
Author

brentlu commented May 4, 2021

False alarm?


Commit 429ffb620dcd ("ASoC: Intel: add sof-cs42l42 machine driver")

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#74:
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 570 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

Commit 429ffb620dcd ("ASoC: Intel: add sof-cs42l42 machine driver") has style problems, please review.

@brentlu
Copy link
Author

brentlu commented May 4, 2021

@plbossart If there is no concern, I'd like to send the patches to alsa-dev due to the tight schedule. Is it ok?

@plbossart
Copy link
Member

False alarm?

Commit 429ffb6 ("ASoC: Intel: add sof-cs42l42 machine driver")

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#74:
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 570 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

Commit 429ffb6 ("ASoC: Intel: add sof-cs42l42 machine driver") has style problems, please review.

yes, that's normal and not a problem.

@plbossart
Copy link
Member

@plbossart If there is no concern, I'd like to send the patches to alsa-dev due to the tight schedule. Is it ok?

let me check with Mark Brown, there's a missing dependency upstream, some previous patches were not applied, and if you send the patches they will not apply directly. thanks!

@plbossart
Copy link
Member

plbossart commented May 4, 2021

still a make W=1 issue @brentlu . You can fix this in your setup by running 'make sound/soc/codecs/ W=1' (the last / matters). Thanks!

@plbossart
Copy link
Member

plbossart commented May 4, 2021

@plbossart If there is no concern, I'd like to send the patches to alsa-dev due to the tight schedule. Is it ok?

let me check with Mark Brown, there's a missing dependency upstream, some previous patches were not applied, and if you send the patches they will not apply directly. thanks!

ok, so I need to resend the previous series which was partly missed for some reason, and I'll include your PR on top once all the warnings are removed. Does this work for you @brentlu? Thanks!

@brentlu
Copy link
Author

brentlu commented May 5, 2021

The warning is from the codec header file which we don't need it. I've removed it from machine driver and send a mail to Cirrus team to fix it.

@brentlu
Copy link
Author

brentlu commented May 5, 2021

Thanks. I think it's the best option.

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.

sorry, one more fix needed, the code was inspired by an earlier version of sof-rt5682 but the .nonatomic property is not needed.

brentlu added 2 commits May 5, 2021 23:32
The machine driver is a generic machine driver for SOF with cs42l42
I2C codec. It currently supports Maxim MAX98357A speker amp on GLK
but is extensible for other apms and platforms.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Refactor the machine driver by using the common code in maxim-common
module to support max98357a.

Signed-off-by: Brent Lu <brent.lu@intel.com>
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.

let's merge, thanks @brentlu

@plbossart
Copy link
Member

I'll use my superpowers to merge and avoid more delays

@plbossart plbossart merged commit eaa4677 into thesofproject:topic/sof-dev May 5, 2021
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.

4 participants