-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC: Intel: sof_sdw: create BT dai link if bt_link_mask is set #5554
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
Conversation
| return -ENOMEM; | ||
|
|
||
| int 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.
nitpick: this seems like a superfluous change
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 moved int ret; to the beginning of the function and put all variables together. Personally, I prefer this style.
The bt_link_mask value is from NHLT. The BT dai link should be created if bt_link_mask is set. Besides, hda_machine_select() will look for the topology with BT BE. Suggested-by: Mac Chiang <mac.chiang@intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
| if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT) | ||
| port = (sof_sdw_quirk & SOF_BT_OFFLOAD_SSP_MASK) >> SOF_BT_OFFLOAD_SSP_SHIFT; | ||
| else | ||
| port = fls(mach->mach_params.bt_link_mask) - 1; |
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.
@bardliao , If bt_link_mask is reset to 0 because of incorrect settings, it may result in an invalid port value.
if (hweight_long(mach->mach_params.bt_link_mask) > 1) {
dev_warn(sdev->dev, "invalid BT link mask %#x found, reset the mask\n",
mach->mach_params.bt_link_mask);
mach->mach_params.bt_link_mask = 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.
Not sure how can it happen. create_bt_dailinks() is only called when sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT || mach_params->bt_link_mask. Shouldn't bt_link_mask always > 0 in the else case?
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.
Yes, in the else case. However, I see your point. The pre-condition has already excluded the 0 value. LGTM, just last question: the bt_link_mask method seems only available to modify the NHLT SSP assignment, right?
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.
bt_link_mask is usually from the NHLT SSP assignment, but we can use the bt_link_mask module parameter to overwrite it.
The bt_link_mask value is from NHLT. The BT dai link should be created if bt_link_mask is set. Besides, hda_machine_select() will look for the topology with BT BE.