Skip to contentSkip to conversation

More minor SDCA bug fixes

PATCH In review Charles Keepax 2 participants 5 messages Aug 20, 2025 – Sep 4, 2025

Subsystems (3)
lore
Share & tools
lore

Charles Keepax

author maintainer
#0 lore raw

cover More minor SDCA bug fixes

Just some minor SDCA bug fixes and some minor structure reordering to improve the padding.

Thanks,
Charles

Charles Keepax (3):
ASoC: SDCA: Fix return value in sdca_regmap_mbq_size()
ASoC: SDCA: Fix return value in detected_mode_handler()
ASoC: SDCA: Reorder members of hide struct to remove holes

 include/sound/sdca_function.h    | 21 ++++++++++++---------
 sound/soc/sdca/sdca_interrupts.c |  2 +-
 sound/soc/sdca/sdca_regmap.c     |  2 +-
 3 files changed, 14 insertions(+), 11 deletions(-)
Signature · 1 line
2.47.2
author maintainer
#1 lore raw

PATCH 1/3 ASoC: SDCA: Fix return value in sdca_regmap_mbq_size()

The MBQ size function returns an integer representing the size of a Control. Currently if the Control is not found the function will return false which makes little sense. Correct this typo to return -EINVAL.

Fixes e3f7caf74b79 ("ASoC: SDCA: Add generic regmap SDCA helpers")
---
 sound/soc/sdca/sdca_regmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sdca/sdca_regmap.c +1 -1
index 5cb3048ea8cf..72f893e00ff5 100644
@@ -196,7 +196,7 @@ int sdca_regmap_mbq_size(struct sdca_function_data *function, unsigned int reg)
 
 	control = function_find_control(function, reg);
 	if (!control)
-		return false;
+		return -EINVAL;
 
 	return clamp_val(control->nbits / BITS_PER_BYTE, sizeof(u8), sizeof(u32));
 }
Signature · 1 line
2.47.2
author maintainer
#2 lore raw

PATCH 2/3 ASoC: SDCA: Fix return value in detected_mode_handler()

In reply to Charles Keepax

The detected mode IRQ handler should return an irqreturn_t not a regular error code. Correct the return value in detected_mode_handler().

Fixes b9ab3b618241 ("ASoC: SDCA: Add some initial IRQ handlers")
---
 sound/soc/sdca/sdca_interrupts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sdca/sdca_interrupts.c +1 -1
index 8018773ee426..79bf3042f57d 100644
@@ -155,7 +155,7 @@ static irqreturn_t detected_mode_handler(int irq, void *data)
 							   SDCA_CTL_SELECTED_MODE_NAME);
 
 		if (!name)
-			return -ENOMEM;
+			return IRQ_NONE;
 
 		kctl = snd_soc_component_get_kcontrol(component, name);
 		if (!kctl) {
Signature · 1 line
2.47.2
author maintainer
#3 lore raw

PATCH 3/3 ASoC: SDCA: Reorder members of hide struct to remove holes

In reply to Charles Keepax

Remove some padding holes in the sdca_entity_hide struct by reordering the members.

---
 include/sound/sdca_function.h | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
include/sound/sdca_function.h +12 -9
index 06ec126cdcc3..ea68856e4c8c 100644
@@ -1063,27 +1063,30 @@ struct sdca_entity_ge {
 /**
  * struct sdca_entity_hide - information specific to HIDE Entities
  * @hid: HID device structure
- * @hidtx_ids: HIDTx Report ID
  * @num_hidtx_ids: number of HIDTx Report ID
- * @hidrx_ids: HIDRx Report ID
  * @num_hidrx_ids: number of HIDRx Report ID
- * @hide_reside_function_num: indicating which Audio Function Numbers within this Device
- * @max_delay: the maximum time in microseconds allowed for the Device to change the ownership from Device to Host
- * @af_number_list: which Audio Function Numbers within this Device are sending/receiving the messages in this HIDE
- * @hid_desc: HID descriptor for the HIDE Entity
+ * @hidtx_ids: HIDTx Report ID
+ * @hidrx_ids: HIDRx Report ID
+ * @af_number_list: which Audio Function Numbers within this Device are
+ * sending/receiving the messages in this HIDE
+ * @hide_reside_function_num: indicating which Audio Function Numbers
+ * within this Device
+ * @max_delay: the maximum time in microseconds allowed for the Device
+ * to change the ownership from Device to Host
  * @hid_report_desc: HID Report Descriptor for the HIDE Entity
+ * @hid_desc: HID descriptor for the HIDE Entity
  */
 struct sdca_entity_hide {
 	struct hid_device *hid;
 	unsigned int *hidtx_ids;
-	int num_hidtx_ids;
 	unsigned int *hidrx_ids;
+	int num_hidtx_ids;
 	int num_hidrx_ids;
+	unsigned int af_number_list[SDCA_MAX_FUNCTION_COUNT];
 	unsigned int hide_reside_function_num;
 	unsigned int max_delay;
-	unsigned int af_number_list[SDCA_MAX_FUNCTION_COUNT];
-	struct hid_descriptor hid_desc;
 	unsigned char *hid_report_desc;
+	struct hid_descriptor hid_desc;
 };
 
 /**
Signature · 1 line
2.47.2
maintainer
#4 lore raw
In reply to Charles Keepax
Quoted 6 lines · Charles Keepax

Just some minor SDCA bug fixes and some minor structure reordering to improve the padding.

Thanks,
Charles

Quoted 6 lines

Charles Keepax (3):
ASoC: SDCA: Fix return value in sdca_regmap_mbq_size()
ASoC: SDCA: Fix return value in detected_mode_handler()
ASoC: SDCA: Reorder members of hide struct to remove holes

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/3] ASoC: SDCA: Fix return value in sdca_regmap_mbq_size()

      commit: f81e63047600d023cbfda372b6de8f2821ff6839
[2/3] ASoC: SDCA: Fix return value in detected_mode_handler()
      commit: 16c912ec34edc4d7daecde58e40d480858830a12
[3/3] ASoC: SDCA: Reorder members of hide struct to remove holes
      commit: ec630c2c8ce215dd365b8c3644f004f645714a0f

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark