From: Charles Keepax Date: Fri, 20 Dec 2024 17:35:15 +0000 (+0000) Subject: ASoC: SDCA: Add missing function type names X-Git-Tag: v6.14-rc1~111^2~7^2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1ed5eb13f39b0058670bc2b1e251a040c306868;p=thirdparty%2Fkernel%2Flinux.git ASoC: SDCA: Add missing function type names It is not helpful to error out on some SDCA function types, we might as well report the correct name and let the driver core simply not bind a driver to those functions for which the code lacks support. Also given no functions currently have support, it seems odd to select some as unsupported. Signed-off-by: Charles Keepax Link: https://patch.msgid.link/20241220173516.907406-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown --- diff --git a/include/sound/sdca_function.h b/include/sound/sdca_function.h index 6943df0851a98..89e42db6d5919 100644 --- a/include/sound/sdca_function.h +++ b/include/sound/sdca_function.h @@ -42,6 +42,7 @@ enum sdca_function_type { #define SDCA_FUNCTION_TYPE_RJ_NAME "RJ" #define SDCA_FUNCTION_TYPE_SIMPLE_NAME "SimpleJack" #define SDCA_FUNCTION_TYPE_HID_NAME "HID" +#define SDCA_FUNCTION_TYPE_IMP_DEF_NAME "ImplementationDefined" enum sdca_entity0_controls { SDCA_CONTROL_ENTITY_0_COMMIT_GROUP_MASK = 0x01, diff --git a/sound/soc/sdca/sdca_functions.c b/sound/soc/sdca/sdca_functions.c index a69fdb9c8b15b..400763e056fa9 100644 --- a/sound/soc/sdca/sdca_functions.c +++ b/sound/soc/sdca/sdca_functions.c @@ -75,12 +75,20 @@ skip_early_draft_order: *function_name = SDCA_FUNCTION_TYPE_HID_NAME; break; case SDCA_FUNCTION_TYPE_SIMPLE_AMP: + *function_name = SDCA_FUNCTION_TYPE_SIMPLE_AMP_NAME; + break; case SDCA_FUNCTION_TYPE_SIMPLE_MIC: + *function_name = SDCA_FUNCTION_TYPE_SIMPLE_MIC_NAME; + break; case SDCA_FUNCTION_TYPE_SPEAKER_MIC: + *function_name = SDCA_FUNCTION_TYPE_SPEAKER_MIC_NAME; + break; case SDCA_FUNCTION_TYPE_RJ: + *function_name = SDCA_FUNCTION_TYPE_RJ_NAME; + break; case SDCA_FUNCTION_TYPE_IMP_DEF: - dev_warn(dev, "unsupported SDCA function type %d\n", *function_type); - return -EINVAL; + *function_name = SDCA_FUNCTION_TYPE_IMP_DEF_NAME; + break; default: dev_err(dev, "invalid SDCA function type %d\n", *function_type); return -EINVAL;