Skip to content

Commit c1ed5eb

Browse files
charleskeepaxbroonie
authored andcommitted
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 <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20241220173516.907406-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent c36297b commit c1ed5eb

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

include/sound/sdca_function.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ enum sdca_function_type {
4242
#define SDCA_FUNCTION_TYPE_RJ_NAME "RJ"
4343
#define SDCA_FUNCTION_TYPE_SIMPLE_NAME "SimpleJack"
4444
#define SDCA_FUNCTION_TYPE_HID_NAME "HID"
45+
#define SDCA_FUNCTION_TYPE_IMP_DEF_NAME "ImplementationDefined"
4546

4647
enum sdca_entity0_controls {
4748
SDCA_CONTROL_ENTITY_0_COMMIT_GROUP_MASK = 0x01,

sound/soc/sdca/sdca_functions.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,20 @@ static int patch_sdca_function_type(struct device *dev,
7575
*function_name = SDCA_FUNCTION_TYPE_HID_NAME;
7676
break;
7777
case SDCA_FUNCTION_TYPE_SIMPLE_AMP:
78+
*function_name = SDCA_FUNCTION_TYPE_SIMPLE_AMP_NAME;
79+
break;
7880
case SDCA_FUNCTION_TYPE_SIMPLE_MIC:
81+
*function_name = SDCA_FUNCTION_TYPE_SIMPLE_MIC_NAME;
82+
break;
7983
case SDCA_FUNCTION_TYPE_SPEAKER_MIC:
84+
*function_name = SDCA_FUNCTION_TYPE_SPEAKER_MIC_NAME;
85+
break;
8086
case SDCA_FUNCTION_TYPE_RJ:
87+
*function_name = SDCA_FUNCTION_TYPE_RJ_NAME;
88+
break;
8189
case SDCA_FUNCTION_TYPE_IMP_DEF:
82-
dev_warn(dev, "unsupported SDCA function type %d\n", *function_type);
83-
return -EINVAL;
90+
*function_name = SDCA_FUNCTION_TYPE_IMP_DEF_NAME;
91+
break;
8492
default:
8593
dev_err(dev, "invalid SDCA function type %d\n", *function_type);
8694
return -EINVAL;

0 commit comments

Comments
 (0)