]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: SDCA: Add missing function type names
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Fri, 20 Dec 2024 17:35:15 +0000 (17:35 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 24 Dec 2024 22:44:56 +0000 (22:44 +0000)
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 <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20241220173516.907406-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/sdca_function.h
sound/soc/sdca/sdca_functions.c

index 6943df0851a985e9b6dd201f399c01638ff5d10a..89e42db6d5919135861fef5cd9ba8ef99a26eaff 100644 (file)
@@ -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,
index a69fdb9c8b15b22a7e73b197544546a57da227eb..400763e056fa956e5a5e5bf5bc8a2b2cb26d4c0b 100644 (file)
@@ -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;