Skip to content
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

DA7219 machine driver update #4542

Merged
merged 4 commits into from
Sep 8, 2023

Conversation

brentlu
Copy link

@brentlu brentlu commented Aug 24, 2023

  1. In preparation for ADL board support, I refactor the machine driver to use maxim-common module and remove redundant code. No functional change here and driver is tested on JSL board with MAX98360A amplifier.
  2. Add adl_mx98360_da7219 board config to support DA7219 on ADL boards; tested on ADL-N chromebook

@brentlu brentlu added Chrome Related to Chrome integration JSL Jasper Lake platform issues ADL Applies to Alder Lake platform labels Aug 24, 2023
bardliao
bardliao previously approved these changes Aug 24, 2023
plbossart
plbossart previously approved these changes Aug 24, 2023
@brentlu
Copy link
Author

brentlu commented Aug 28, 2023

Could we merge this PR? Thanks.

@plbossart
Copy link
Member

Can you revisit the checkpatch warnings @brentlu?

WARNING: struct snd_soc_ops should normally be const
#159: FILE: sound/soc/intel/boards/sof_da7219.c:194:
+static struct snd_soc_ops max98373_ops = {

CHECK: braces {} should be used on all arms of this statement
#259: FILE: sound/soc/intel/boards/sof_da7219.c:368:
+	if (sof_da7219_quirk & SOF_MAX98360A_SPEAKER_AMP_PRESENT)
[...]
+	else if (sof_da7219_quirk & SOF_MAX98373_SPEAKER_AMP_PRESENT) {
[...]

@brentlu brentlu dismissed stale reviews from plbossart and bardliao via d014017 August 29, 2023 02:29
@brentlu brentlu force-pushed the da7219-update branch 2 times, most recently from 1c225ea to 02588d3 Compare August 29, 2023 02:29
@brentlu
Copy link
Author

brentlu commented Aug 29, 2023

  1. add const to max98373_ops
  2. remove global variable 'headset'
  3. add one commit for adl_mx98360_da7219 board; tested on ADL-N chromebook with topology topology1: adl-max98360a-da7219: support DA7219 headphone codec sof#8103

@brentlu
Copy link
Author

brentlu commented Aug 29, 2023

  1. fix the warning about brace

@brentlu
Copy link
Author

brentlu commented Aug 29, 2023

rebase to see if it could pass the build 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.

I think this can be improved a bit @brentlu

It's not all bad but you are doing things differently to the other recent PRs so the code is a bit inconsistent in the directions.

sound/soc/intel/boards/Kconfig Show resolved Hide resolved
sound/soc/intel/boards/sof_da7219.c Outdated Show resolved Hide resolved
* frequency of MCLK to 12.288 or 24.576MHz on topology side.
*/
if (board_quirk & SOF_DA7219_PLL_BYPASS)
ctx->pll_bypass = 1;
Copy link
Member

Choose a reason for hiding this comment

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

why is this needed? What not just test the MCLK and automatically bypass the PLL if it's 12.228 or a multiple?

Copy link
Author

Choose a reason for hiding this comment

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

oh I can do it in codec init. let me upload a new version.

@brentlu brentlu force-pushed the da7219-update branch 2 times, most recently from 14f5f49 to 979be74 Compare August 29, 2023 16:44
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.

only nit-picks from me...

depends on SND_HDA_CODEC_HDMI && SND_SOC_SOF_HDA_AUDIO_CODEC
select SND_SOC_INTEL_HDA_DSP_COMMON
depends on ((SND_HDA_CODEC_HDMI && SND_SOC_SOF_HDA_AUDIO_CODEC) &&\
(MFD_INTEL_LPSS || COMPILE_TEST))
Copy link
Member

Choose a reason for hiding this comment

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

i would keep the initial code

Copy link
Author

Choose a reason for hiding this comment

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

fixed

select SND_SOC_MAX98373_I2C
select SND_SOC_DMIC
select SND_SOC_INTEL_HDA_DSP_COMMON
Copy link
Member

Choose a reason for hiding this comment

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

this is already in the initial code,

Copy link
Author

Choose a reason for hiding this comment

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

restored

sound/soc/intel/boards/sof_da7219.c Outdated Show resolved Hide resolved
bardliao
bardliao previously approved these changes Aug 30, 2023
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.

lost on the last patch, sorry

sound/soc/intel/boards/sof_da7219.c Show resolved Hide resolved
},
{
.name = "adl_mx98360_da7219",
.driver_data = (kernel_ulong_t)(SOF_MAX98360A_SPEAKER_AMP_PRESENT),
.driver_data = (kernel_ulong_t)(0),
Copy link
Member

Choose a reason for hiding this comment

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

so do we need this quirk at all then?

Copy link
Author

Choose a reason for hiding this comment

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

No quirk is needed for this board config now.

Copy link
Member

Choose a reason for hiding this comment

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

what happens if we just don't add .driver_data and add a comment to that effect?

Copy link
Author

@brentlu brentlu Sep 5, 2023

Choose a reason for hiding this comment

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

	unsigned long board_quirk = 0;
...
	if (pdev->id_entry && pdev->id_entry->driver_data)
		board_quirk = (unsigned long)pdev->id_entry->driver_data;

Since driver_data is zero (NULL), board_quirk will be the init value 0. It's working good on my ADL board.

@brentlu
Copy link
Author

brentlu commented Aug 30, 2023

The last patch just remove two quirks flags of amplifier type from board configs. No functional change there.

@brentlu brentlu force-pushed the da7219-update branch 3 times, most recently from a25c47b to 4845f07 Compare August 31, 2023 01:30
plbossart
plbossart previously approved these changes Sep 6, 2023
@plbossart plbossart requested a review from bardliao September 6, 2023 13:04
bardliao
bardliao previously approved these changes Sep 7, 2023
@plbossart
Copy link
Member

rebase needed @brentlu

@brentlu brentlu dismissed stale reviews from bardliao and plbossart via db3eca8 September 7, 2023 13:17
@brentlu
Copy link
Author

brentlu commented Sep 7, 2023

conflict in acpi enumeration table, resolved

@plbossart plbossart requested a review from bardliao September 7, 2023 17:16
@plbossart
Copy link
Member

@bardliao I'll let you merge this.

Rename the driver file and kernel option to be consistent with other
SOF machine drivers.

Signed-off-by: Brent Lu <[email protected]>
Use maxim-common module to handle speaker amp DAI link registration.
No functional change in this commit.

Signed-off-by: Brent Lu <[email protected]>
This configuration supports ADL boards which implement DA7219 on SSP0
and MAX98360A on SSP1. DA7219 uses PLL bypass mode to avoid WCLK
locking problem. To use this mode, MCLK frequency must be 12.288 or
24.576MHz.

Signed-off-by: Brent Lu <[email protected]>
Use ssp-common module to detect codec and amplifier type in driver
probe function and remove all quirks about amplifier type.

Signed-off-by: Brent Lu <[email protected]>
@bardliao bardliao merged commit 72c81dd into thesofproject:topic/sof-dev Sep 8, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADL Applies to Alder Lake platform Chrome Related to Chrome integration JSL Jasper Lake platform issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants