ASoC: Intel: board_helpers: support DAI link ID customization
authorBrent Lu <brent.lu@intel.com>
Mon, 25 Mar 2024 22:10:39 +0000 (17:10 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 25 Mar 2024 22:44:49 +0000 (22:44 +0000)
commitb020aff0ec6ec089bd3e07bd6b58623826752ff7
tree4b6042917f53a18eabea07669c2ee47a2b68c526
parent885dd75f41f9fff5b277bc6ab28ad798f98a37b4
ASoC: Intel: board_helpers: support DAI link ID customization

Add an new field link_id_overwrite to sof_card_private structure to
support machine drivers which DAI link ID is fixed number or
discontinue (i.e. no-codec boards). If this field is zero, DAI array
index will be used as link ID. Otherwise the value extracted from
link_id_overwrite will be used.

The field link_id_overwrite is supposed to be initialized by
SOF_LINK_IDS macro like following example.

ctx->link_id_overwrite = SOF_LINK_IDS(HEADPHONE_BE_ID,  \
      DMIC01_BE_ID,     \
      DMIC16K_BE_ID,    \
      IDISP_HDMI_BE_ID, \
      SPK_BE_ID,        \
      BT_OFFLOAD_BE_ID, \
      HDMI_IN_BE_ID)

An exception is that, if you use link_order_overwrite to overwrite
DAI link order, then you need to use the same order to build
link_id_overwrite variable as well.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240325221059.206042-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/sof_board_helpers.c
sound/soc/intel/boards/sof_board_helpers.h