-
Notifications
You must be signed in to change notification settings - Fork 133
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
Conversation
brentlu
commented
Aug 14, 2024
- Add HDA link support to board helper module.
- Modify skl_hda_dsp_generic driver to create dai link array with board helper module.
3dbbdb0
to
ae551c1
Compare
@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; |
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.
Should we set ctx->hda_codec_present
by HDA_EXT_CODEC(codec_mask)?
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.
It's done in machine driver since we didn't pass codec_mask to board helper module.
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.
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?
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.
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; |
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.
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
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.
done
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.
omg, how did I done this??? and why it compiled in the first place...
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.
@brentlu, can you add the Cc: [email protected] as well to make sure it is backported to stable.
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.
Err...not sure how to do it...
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.
You just need to add a line above the Fixes tag in the commit message:
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.
done. Thanks~
7e8dfd5
to
09f7f05
Compare
unsigned long board_quirk = 0; | ||
int ssp_bt; | ||
|
||
if (mach_params->codec_mask & EXT_CODEC_MASK) |
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.
We can reuse HDA_EXT_CODEC(mach_params->codec_mask)
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.
done
a4c2299
to
eea26b9
Compare
card->name = "hda-dsp"; | ||
card->owner = THIS_MODULE; | ||
card->fully_routed = true; | ||
card->late_probe = skl_hda_card_late_probe; |
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.
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; |
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.
@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]>"); |
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.
Probably mention this in the comment message if it is really needed?
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.
removed
#define BT_OFFLOAD_BE_ID 8 | ||
|
||
#define HDA_LINK_ORDER SOF_LINK_ORDER(SOF_LINK_IDISP_HDMI, \ | ||
SOF_LINK_HDA, \ |
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.
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.
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.
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]>"); |
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.
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.
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 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; |
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.
You just need to add a line above the Fixes tag in the commit message:
return ret; | ||
} | ||
|
||
return 0; |
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.
You can simplify the code by:
if (ret)
dev_err(rtd->dev, "fail to add hda routes, ret %d\n", ret);
return ret;
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.
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]>
SOFCI TEST |