Blob Blame History Raw
From c5d8e008032f3cd5f266d552732973a960b0bd4b Mon Sep 17 00:00:00 2001
From: "Geoffrey D. Bennett" <g@b4.vu>
Date: Mon, 21 Jun 2021 02:16:45 +0930
Subject: [PATCH] ALSA: usb-audio: scarlett2: Fix scarlett2_*_ctl_put() return values
Git-commit: c5d8e008032f3cd5f266d552732973a960b0bd4b
Patch-mainline: v5.14-rc1
References: git-fixes

Mixer control put callbacks should return 1 if the value is changed.
Fix the sw_hw, level, pad, and button controls accordingly.

Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Link: https://lore.kernel.org/r/20210620164645.GA9221@m.b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>

---
 sound/usb/mixer_scarlett_gen2.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/sound/usb/mixer_scarlett_gen2.c
+++ b/sound/usb/mixer_scarlett_gen2.c
@@ -1323,6 +1323,8 @@ static int scarlett2_sw_hw_enum_ctl_put(
 	/* Send SW/HW switch change to the device */
 	err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_SW_HW_SWITCH,
 				       index, val);
+	if (err == 0)
+		err = 1;
 
 unlock:
 	mutex_unlock(&private->data_mutex);
@@ -1383,6 +1385,8 @@ static int scarlett2_level_enum_ctl_put(
 	/* Send switch change to the device */
 	err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_LEVEL_SWITCH,
 				       index, val);
+	if (err == 0)
+		err = 1;
 
 unlock:
 	mutex_unlock(&private->data_mutex);
@@ -1433,6 +1437,8 @@ static int scarlett2_pad_ctl_put(struct
 	/* Send switch change to the device */
 	err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_PAD_SWITCH,
 				       index, val);
+	if (err == 0)
+		err = 1;
 
 unlock:
 	mutex_unlock(&private->data_mutex);
@@ -1488,6 +1494,8 @@ static int scarlett2_button_ctl_put(stru
 	/* Send switch change to the device */
 	err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_BUTTONS,
 				       index, val);
+	if (err == 0)
+		err = 1;
 
 unlock:
 	mutex_unlock(&private->data_mutex);