mirror of
https://github.com/torvalds/linux.git
synced 2024-12-04 01:51:34 +00:00
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: Brent Lu <brent.lu@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20231127152654.28204-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
65b2df10a1
commit
93f74ebf3d
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user