Commit 93f74ebf authored by Brent Lu's avatar Brent Lu Committed by Mark Brown

ASoC: Intel: ssp-common: get codec name function

Add a helper function to get codec name string from codec type enum
value.
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>
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20231127152654.28204-6-peter.ujfalusi@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 65b2df10
......@@ -96,6 +96,27 @@ enum sof_ssp_codec sof_ssp_detect_amp_type(struct device *dev)
}
EXPORT_SYMBOL_NS(sof_ssp_detect_amp_type, SND_SOC_INTEL_SOF_SSP_COMMON);
const char *sof_ssp_get_codec_name(enum sof_ssp_codec codec_type)
{
int i;
for (i = 0; i < ARRAY_SIZE(codecs); i++) {
if (codecs[i].codec_type != codec_type)
continue;
return codecs[i].name;
}
for (i = 0; i < ARRAY_SIZE(amps); i++) {
if (amps[i].codec_type != codec_type)
continue;
return amps[i].name;
}
return NULL;
}
EXPORT_SYMBOL_NS(sof_ssp_get_codec_name, SND_SOC_INTEL_SOF_SSP_COMMON);
MODULE_DESCRIPTION("ASoC Intel SOF Common Machine Driver Helpers");
MODULE_AUTHOR("Brent Lu <brent.lu@intel.com>");
MODULE_LICENSE("GPL");
......@@ -67,5 +67,6 @@ enum sof_ssp_codec {
enum sof_ssp_codec sof_ssp_detect_codec_type(struct device *dev);
enum sof_ssp_codec sof_ssp_detect_amp_type(struct device *dev);
const char *sof_ssp_get_codec_name(enum sof_ssp_codec codec_type);
#endif /* __SOF_SSP_COMMON_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