Commit f7c015ad authored by Brent Lu's avatar Brent Lu Committed by Mark Brown

ASoC: Intel: board_helpers: support HDMI-In link initialization

Add a helper function for machine drivers to initialize HDMI-In DAI
link.
Signed-off-by: default avatarBrent Lu <brent.lu@intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarBalamurugan C <balamurugan.c@intel.com>
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20231127152654.28204-23-peter.ujfalusi@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9fadbf3f
......@@ -333,6 +333,48 @@ int sof_intel_board_set_bt_link(struct device *dev,
}
EXPORT_SYMBOL_NS(sof_intel_board_set_bt_link, SND_SOC_INTEL_SOF_BOARD_HELPERS);
int sof_intel_board_set_hdmi_in_link(struct device *dev,
struct snd_soc_dai_link *link, int be_id,
int ssp_hdmi)
{
struct snd_soc_dai_link_component *cpus;
dev_dbg(dev, "link %d: hdmi-in, ssp %d\n", be_id, ssp_hdmi);
/* link name */
link->name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-HDMI", ssp_hdmi);
if (!link->name)
return -ENOMEM;
/* cpus */
cpus = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link_component),
GFP_KERNEL);
if (!cpus)
return -ENOMEM;
cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", ssp_hdmi);
if (!cpus->dai_name)
return -ENOMEM;
link->cpus = cpus;
link->num_cpus = 1;
/* codecs */
link->codecs = &snd_soc_dummy_dlc;
link->num_codecs = 1;
/* platforms */
link->platforms = platform_component;
link->num_platforms = ARRAY_SIZE(platform_component);
link->id = be_id;
link->no_pcm = 1;
link->dpcm_capture = 1;
return 0;
}
EXPORT_SYMBOL_NS(sof_intel_board_set_hdmi_in_link, SND_SOC_INTEL_SOF_BOARD_HELPERS);
MODULE_DESCRIPTION("ASoC Intel SOF Machine Driver Board Helpers");
MODULE_AUTHOR("Brent Lu <brent.lu@intel.com>");
MODULE_LICENSE("GPL");
......
......@@ -33,6 +33,7 @@ struct sof_rt5682_private {
* @ssp_codec: ssp port number of headphone BE link
* @ssp_amp: ssp port number of speaker BE link
* @ssp_bt: ssp port number of BT offload BE link
* @ssp_mask_hdmi_in: ssp port mask of HDMI-IN BE link
* @bt_offload_present: true to create BT offload BE link
* @rt5682: private data for rt5682 machine driver
*/
......@@ -49,6 +50,7 @@ struct sof_card_private {
int ssp_codec;
int ssp_amp;
int ssp_bt;
unsigned long ssp_mask_hdmi_in;
bool bt_offload_present;
......@@ -79,5 +81,8 @@ int sof_intel_board_set_ssp_amp_link(struct device *dev,
int sof_intel_board_set_bt_link(struct device *dev,
struct snd_soc_dai_link *link, int be_id,
int ssp_bt);
int sof_intel_board_set_hdmi_in_link(struct device *dev,
struct snd_soc_dai_link *link, int be_id,
int ssp_hdmi);
#endif /* __SOF_INTEL_BOARD_HELPERS_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment