/* Send mute change to the device */
err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_MUTE_SWITCH,
index, val);
+ if (err == 0)
+ err = 1;
unlock:
mutex_unlock(&private->data_mutex);
/* Send switch change to the device */
err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_AIR_SWITCH,
index, val);
+ if (err == 0)
+ err = 1;
unlock:
mutex_unlock(&private->data_mutex);
/* Send switch change to the device */
err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_PHANTOM_SWITCH,
index, val);
+ if (err == 0)
+ err = 1;
unlock:
mutex_unlock(&private->data_mutex);
/* Send switch change to the device */
err = scarlett2_usb_set_config(
mixer, SCARLETT2_CONFIG_PHANTOM_PERSISTENCE, index, val);
+ if (err == 0)
+ err = 1;
unlock:
mutex_unlock(&private->data_mutex);
/* Send switch change to the device */
err = scarlett2_usb_set_config(
mixer, SCARLETT2_CONFIG_DIRECT_MONITOR, index, val);
+ if (err == 0)
+ err = 1;
unlock:
mutex_unlock(&private->data_mutex);
/* when speaker switching gets enabled, switch the main/alt speakers
* to HW volume and disable those controls
*/
-static void scarlett2_speaker_switch_enable(struct usb_mixer_interface *mixer)
+static int scarlett2_speaker_switch_enable(struct usb_mixer_interface *mixer)
{
struct snd_card *card = mixer->chip->card;
struct scarlett2_data *private = mixer->private_data;
- int i;
+ int i, err;
for (i = 0; i < 4; i++) {
int index = line_out_remap(private, i);
/* switch the main/alt speakers to HW volume */
- if (!private->vol_sw_hw_switch[index])
- scarlett2_sw_hw_change(private->mixer, i, 1);
+ if (!private->vol_sw_hw_switch[index]) {
+ err = scarlett2_sw_hw_change(private->mixer, i, 1);
+ if (err < 0)
+ return err;
+ }
/* disable the line out SW/HW switch */
scarlett2_sw_hw_ctl_ro(private, i);
* configuration
*/
private->speaker_switching_switched = 1;
+
+ return 0;
}
/* when speaker switching gets disabled, reenable the hw/sw controls
/* update controls if speaker switching gets enabled or disabled */
if (!oval && val)
- scarlett2_speaker_switch_enable(mixer);
+ err = scarlett2_speaker_switch_enable(mixer);
else if (oval && !val)
scarlett2_speaker_switch_disable(mixer);
+ if (err == 0)
+ err = 1;
+
unlock:
mutex_unlock(&private->data_mutex);
return err;
err = scarlett2_usb_set_config(
mixer, SCARLETT2_CONFIG_MONITOR_OTHER_SWITCH,
1, val == 2);
- if (err < 0)
- goto unlock;
+ if (err == 0)
+ err = 1;
unlock:
mutex_unlock(&private->data_mutex);
/* Send updated bitmap to the device */
err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_TALKBACK_MAP,
0, bitmap);
- if (err < 0)
- goto unlock;
+ if (err == 0)
+ err = 1;
unlock:
mutex_unlock(&private->data_mutex);
/* Send switch change to the device */
err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_MSD_SWITCH,
0, val);
+ if (err == 0)
+ err = 1;
unlock:
mutex_unlock(&private->data_mutex);