xref: /openbmc/linux/sound/soc/intel/boards/sof_sdw_rt715.c (revision 03ab8e6297acd1bc0eedaa050e2a1635c576fd11)
1e149ca29SPierre-Louis Bossart // SPDX-License-Identifier: GPL-2.0-only
252db12d1SPierre-Louis Bossart // Copyright (c) 2020 Intel Corporation
352db12d1SPierre-Louis Bossart 
452db12d1SPierre-Louis Bossart /*
552db12d1SPierre-Louis Bossart  *  sof_sdw_rt715 - Helpers to handle RT715 from generic machine driver
652db12d1SPierre-Louis Bossart  */
752db12d1SPierre-Louis Bossart 
852db12d1SPierre-Louis Bossart #include <linux/device.h>
952db12d1SPierre-Louis Bossart #include <linux/errno.h>
1052db12d1SPierre-Louis Bossart #include <sound/soc.h>
1152db12d1SPierre-Louis Bossart #include <sound/soc-acpi.h>
1252db12d1SPierre-Louis Bossart #include "sof_sdw_common.h"
1352db12d1SPierre-Louis Bossart 
rt715_rtd_init(struct snd_soc_pcm_runtime * rtd)1452db12d1SPierre-Louis Bossart static int rt715_rtd_init(struct snd_soc_pcm_runtime *rtd)
1552db12d1SPierre-Louis Bossart {
1652db12d1SPierre-Louis Bossart 	struct snd_soc_card *card = rtd->card;
1752db12d1SPierre-Louis Bossart 
1852db12d1SPierre-Louis Bossart 	card->components = devm_kasprintf(card->dev, GFP_KERNEL,
1952db12d1SPierre-Louis Bossart 					  "%s mic:rt715",
2052db12d1SPierre-Louis Bossart 					  card->components);
2152db12d1SPierre-Louis Bossart 	if (!card->components)
2252db12d1SPierre-Louis Bossart 		return -ENOMEM;
2352db12d1SPierre-Louis Bossart 
2452db12d1SPierre-Louis Bossart 	return 0;
2552db12d1SPierre-Louis Bossart }
2652db12d1SPierre-Louis Bossart 
sof_sdw_rt715_init(struct snd_soc_card * card,const struct snd_soc_acpi_link_adr * link,struct snd_soc_dai_link * dai_links,struct sof_sdw_codec_info * info,bool playback)27*cdf99c9aSPierre-Louis Bossart int sof_sdw_rt715_init(struct snd_soc_card *card,
28*cdf99c9aSPierre-Louis Bossart 		       const struct snd_soc_acpi_link_adr *link,
2952db12d1SPierre-Louis Bossart 		       struct snd_soc_dai_link *dai_links,
3052db12d1SPierre-Louis Bossart 		       struct sof_sdw_codec_info *info,
3152db12d1SPierre-Louis Bossart 		       bool playback)
3252db12d1SPierre-Louis Bossart {
3352db12d1SPierre-Louis Bossart 	dai_links->init = rt715_rtd_init;
3452db12d1SPierre-Louis Bossart 
3552db12d1SPierre-Louis Bossart 	return 0;
3652db12d1SPierre-Louis Bossart }
37