ASoC: Intel: sof_sdw: create BT dai link if bt_link_mask is set#5554
ASoC: Intel: sof_sdw: create BT dai link if bt_link_mask is set#5554bardliao merged 1 commit intothesofproject:topic/sof-devfrom
Conversation
| return -ENOMEM; | ||
|
|
||
| int ret; | ||
|
|
There was a problem hiding this comment.
nitpick: this seems like a superfluous change
There was a problem hiding this comment.
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.
@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.
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.
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.
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.