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

board_helper: support HDA link #5144

Merged
merged 3 commits into from
Aug 30, 2024

Conversation

brentlu
Copy link

@brentlu brentlu commented Aug 14, 2024

  1. Add HDA link support to board helper module.
  2. Modify skl_hda_dsp_generic driver to create dai link array with board helper module.

@plbossart
Copy link
Member

@bardliao i'll let you review/merge

@@ -624,6 +778,9 @@ sof_intel_board_get_ctx(struct device *dev, unsigned long board_quirk)
SOF_SSP_PORT_BT_OFFLOAD_SHIFT;
}

if (board_quirk & SOF_HDA_CODEC_PRESENT)
ctx->hda_codec_present = true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we set ctx->hda_codec_present by HDA_EXT_CODEC(codec_mask)?

Copy link
Author

Choose a reason for hiding this comment

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

It's done in machine driver since we didn't pass codec_mask to board helper module.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's done in machine driver since we didn't pass codec_mask to board helper module.

Can we set ctx->hda_codec_present in machine driver? Just like ctx->hdmi.idisp_codec = true; I am thinking is SOF_HDA_CODEC_PRESENT really needed?

Copy link
Author

Choose a reason for hiding this comment

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

sure, we could remove that flag.

card->name = "hda-dsp";
card->owner = THIS_MODULE;
card->fully_routed = true;
card->late_probe = skl_hda_card_late_probe;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, we need to add Fixes: 33e59e50ee76 ("ASoC: Intel: skl_hda_dsp_generic: Allocate snd_soc_card dynamically") in the commit message, and it is better to put the commit in the first commit. @ujfalusi FYI

Copy link
Author

Choose a reason for hiding this comment

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

done

Copy link
Collaborator

Choose a reason for hiding this comment

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

omg, how did I done this??? and why it compiled in the first place...

Copy link
Collaborator

Choose a reason for hiding this comment

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

@brentlu, can you add the Cc: [email protected] as well to make sure it is backported to stable.

Copy link
Author

Choose a reason for hiding this comment

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

Err...not sure how to do it...

Copy link
Collaborator

Choose a reason for hiding this comment

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

You just need to add a line above the Fixes tag in the commit message:

Copy link
Author

Choose a reason for hiding this comment

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

done. Thanks~

@brentlu brentlu force-pushed the hda-mach-4 branch 2 times, most recently from 7e8dfd5 to 09f7f05 Compare August 15, 2024 02:50
unsigned long board_quirk = 0;
int ssp_bt;

if (mach_params->codec_mask & EXT_CODEC_MASK)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can reuse HDA_EXT_CODEC(mach_params->codec_mask)

Copy link
Author

Choose a reason for hiding this comment

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

done

@brentlu brentlu force-pushed the hda-mach-4 branch 2 times, most recently from a4c2299 to eea26b9 Compare August 19, 2024 02:29
bardliao
bardliao previously approved these changes Aug 19, 2024
bardliao
bardliao previously approved these changes Aug 26, 2024
card->name = "hda-dsp";
card->owner = THIS_MODULE;
card->fully_routed = true;
card->late_probe = skl_hda_card_late_probe;
Copy link
Collaborator

Choose a reason for hiding this comment

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

omg, how did I done this??? and why it compiled in the first place...

card->name = "hda-dsp";
card->owner = THIS_MODULE;
card->fully_routed = true;
card->late_probe = skl_hda_card_late_probe;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@brentlu, can you add the Cc: [email protected] as well to make sure it is backported to stable.

@@ -278,6 +162,7 @@ module_platform_driver(skl_hda_audio)
/* Module information */
MODULE_DESCRIPTION("SKL/KBL/BXT/APL HDA Generic Machine driver");
MODULE_AUTHOR("Rakesh Ughreja <[email protected]>");
MODULE_AUTHOR("Brent Lu <[email protected]>");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably mention this in the comment message if it is really needed?

Copy link
Author

Choose a reason for hiding this comment

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

removed

#define BT_OFFLOAD_BE_ID 8

#define HDA_LINK_ORDER SOF_LINK_ORDER(SOF_LINK_IDISP_HDMI, \
SOF_LINK_HDA, \
Copy link
Collaborator

Choose a reason for hiding this comment

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

it is interesting that checkpatch is not complaining, but it would look better if the lines are aligned, or follow the other files and use 1 less TAB.

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@@ -278,6 +162,7 @@ module_platform_driver(skl_hda_audio)
/* Module information */
MODULE_DESCRIPTION("SKL/KBL/BXT/APL HDA Generic Machine driver");
MODULE_AUTHOR("Rakesh Ughreja <[email protected]>");
MODULE_AUTHOR("Brent Lu <[email protected]>");
Copy link
Member

Choose a reason for hiding this comment

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

My take is that references to 'author' should be avoided, be it in a file header or module description. If I added this to all the files I touched I would be the author of pretty much everything in SOF. same for Ranjani, Peter, Kai, Bard. The commit tamper-proof Signed-off-by is enough to give you credit for your work.

Copy link
Author

Choose a reason for hiding this comment

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

I just thought it is kinda mechanism that you could get notification when someone submit a patch to alsa-dev about it. I'll remove it from machine drivers if I got a chance.

card->name = "hda-dsp";
card->owner = THIS_MODULE;
card->fully_routed = true;
card->late_probe = skl_hda_card_late_probe;
Copy link
Collaborator

Choose a reason for hiding this comment

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

You just need to add a line above the Fixes tag in the commit message:

return ret;
}

return 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can simplify the code by:

	if (ret)
		dev_err(rtd->dev, "fail to add hda routes, ret %d\n", ret);

	return ret;

Copy link
Author

Choose a reason for hiding this comment

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

done

Use semicolon to complete an expression instead of comma for following
build error.

sound/soc/intel/boards/skl_hda_dsp_generic.c:108:2: error: expected expression
        dev_dbg(&pdev->dev, "board_quirk = %lx\n", board_quirk);

Cc: [email protected]
Fixes: 33e59e5 ("ASoC: Intel: skl_hda_dsp_generic: Allocate snd_soc_card dynamically")
Signed-off-by: Brent Lu <[email protected]>
Add a helper function for machine drivers to initialize HDA external
codec DAI link.

Signed-off-by: Brent Lu <[email protected]>
Use intel_board module to create DAI link array for Intel iDisp HDMI,
HDA external codec, DMIC01, DMIC16K, and BT audio offload DAI BE links.

Signed-off-by: Brent Lu <[email protected]>
@bardliao
Copy link
Collaborator

SOFCI TEST

@bardliao bardliao merged commit 58b3797 into thesofproject:topic/sof-dev Aug 30, 2024
11 of 14 checks passed
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