Lines Matching refs:mixer

405 	void (*func)(struct usb_mixer_interface *mixer);
408 static void scarlett2_notify_ack(struct usb_mixer_interface *mixer);
409 static void scarlett2_notify_sync(struct usb_mixer_interface *mixer);
410 static void scarlett2_notify_dim_mute(struct usb_mixer_interface *mixer);
411 static void scarlett2_notify_monitor(struct usb_mixer_interface *mixer);
412 static void scarlett2_notify_volume(struct usb_mixer_interface *mixer);
413 static void scarlett2_notify_input_level(struct usb_mixer_interface *mixer);
414 static void scarlett2_notify_input_pad(struct usb_mixer_interface *mixer);
415 static void scarlett2_notify_input_air(struct usb_mixer_interface *mixer);
416 static void scarlett2_notify_input_dsp(struct usb_mixer_interface *mixer);
417 static void scarlett2_notify_input_mute(struct usb_mixer_interface *mixer);
418 static void scarlett2_notify_input_phantom(struct usb_mixer_interface *mixer);
419 static void scarlett2_notify_input_other(struct usb_mixer_interface *mixer);
420 static void scarlett2_notify_input_select(struct usb_mixer_interface *mixer);
421 static void scarlett2_notify_input_gain(struct usb_mixer_interface *mixer);
422 static void scarlett2_notify_autogain(struct usb_mixer_interface *mixer);
423 static void scarlett2_notify_input_safe(struct usb_mixer_interface *mixer);
424 static void scarlett2_notify_monitor_other(struct usb_mixer_interface *mixer);
425 static void scarlett2_notify_direct_monitor(struct usb_mixer_interface *mixer);
426 static void scarlett2_notify_power_status(struct usb_mixer_interface *mixer);
428 struct usb_mixer_interface *mixer);
429 static void scarlett2_notify_bluetooth(struct usb_mixer_interface *mixer);
1188 struct usb_mixer_interface *mixer; member
2324 struct usb_mixer_interface *mixer, u32 cmd, in scarlett2_usb() argument
2327 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb()
2328 struct usb_device *dev = mixer->chip->dev; in scarlett2_usb()
2360 mixer->chip, in scarlett2_usb()
2370 mixer->chip, in scarlett2_usb()
2398 mixer->chip, in scarlett2_usb()
2415 mixer->chip, in scarlett2_usb()
2442 struct usb_mixer_interface *mixer, in scarlett2_usb_get() argument
2452 return scarlett2_usb(mixer, SCARLETT2_USB_GET_DATA, in scarlett2_usb_get()
2467 struct usb_mixer_interface *mixer, in scarlett2_usb_get_config() argument
2470 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_get_config()
2489 err = scarlett2_usb_get(mixer, config_item->offset, buf, size); in scarlett2_usb_get_config()
2507 err = scarlett2_usb_get(mixer, config_item->offset, &value, 1); in scarlett2_usb_get_config()
2524 struct usb_mixer_interface *mixer, in scarlett2_usb_set_data() argument
2527 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_data()
2537 return scarlett2_usb(private->mixer, SCARLETT2_USB_SET_DATA, in scarlett2_usb_set_data()
2547 struct usb_mixer_interface *mixer, in scarlett2_usb_set_data_buf() argument
2550 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_data_buf()
2582 err = scarlett2_usb(private->mixer, SCARLETT2_USB_SET_DATA, in scarlett2_usb_set_data_buf()
2596 struct usb_mixer_interface *mixer, int activate) in scarlett2_usb_activate_config() argument
2601 return scarlett2_usb(mixer, SCARLETT2_USB_DATA_CMD, in scarlett2_usb_activate_config()
2607 struct usb_mixer_interface *mixer, in scarlett2_usb_set_config() argument
2610 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_config()
2630 mixer, config_set->param_buf_addr + 1, 1, index); in scarlett2_usb_set_config()
2636 mixer, config_set->param_buf_addr, 1, value); in scarlett2_usb_set_config()
2642 mixer, config_item->activate); in scarlett2_usb_set_config()
2668 err = scarlett2_usb_get(mixer, offset, &tmp, 1); in scarlett2_usb_set_config()
2681 err = scarlett2_usb_set_data(mixer, offset, size, value); in scarlett2_usb_set_config()
2686 err = scarlett2_usb_activate_config(mixer, config_item->activate); in scarlett2_usb_set_config()
2707 struct usb_mixer_interface *mixer, in scarlett2_usb_set_config_buf() argument
2710 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_config_buf()
2736 err = scarlett2_usb_set_data_buf(mixer, offset, size, count, buf); in scarlett2_usb_set_config_buf()
2741 return scarlett2_usb_activate_config(mixer, config_item->activate); in scarlett2_usb_set_config_buf()
2745 static void scarlett2_config_save(struct usb_mixer_interface *mixer) in scarlett2_config_save() argument
2749 err = scarlett2_usb_activate_config(mixer, SCARLETT2_USB_CONFIG_SAVE); in scarlett2_config_save()
2751 usb_audio_err(mixer->chip, "config save failed: %d\n", err); in scarlett2_config_save()
2760 scarlett2_config_save(private->mixer); in scarlett2_config_save_work()
2765 struct usb_mixer_interface *mixer, in scarlett2_usb_get_sync_status() argument
2771 err = scarlett2_usb(mixer, SCARLETT2_USB_GET_SYNC, in scarlett2_usb_get_sync_status()
2802 static int scarlett2_usb_get_mix(struct usb_mixer_interface *mixer, in scarlett2_usb_get_mix() argument
2805 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_get_mix()
2820 err = scarlett2_usb(mixer, SCARLETT2_USB_GET_MIX, in scarlett2_usb_get_mix()
2836 static int scarlett2_usb_set_mix(struct usb_mixer_interface *mixer, in scarlett2_usb_set_mix() argument
2839 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_mix()
2856 return scarlett2_usb(mixer, SCARLETT2_USB_SET_MIX, in scarlett2_usb_set_mix()
2916 usb_audio_err(private->mixer->chip, in scarlett2_usb_populate_mux()
2928 usb_audio_err(private->mixer->chip, in scarlett2_usb_populate_mux()
3008 static int scarlett2_usb_get_mux(struct usb_mixer_interface *mixer) in scarlett2_usb_get_mux() argument
3010 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_get_mux()
3026 err = scarlett2_usb(mixer, SCARLETT2_USB_GET_MUX, in scarlett2_usb_get_mux()
3041 static int scarlett2_usb_set_mux(struct usb_mixer_interface *mixer) in scarlett2_usb_set_mux() argument
3043 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_mux()
3096 err = scarlett2_usb(mixer, SCARLETT2_USB_SET_MUX, in scarlett2_usb_set_mux()
3109 static int scarlett2_usb_get_meter_levels(struct usb_mixer_interface *mixer, in scarlett2_usb_get_meter_levels() argument
3123 err = scarlett2_usb(mixer, SCARLETT2_USB_GET_METER, in scarlett2_usb_get_meter_levels()
3147 static int scarlett2_add_new_ctl(struct usb_mixer_interface *mixer, in scarlett2_add_new_ctl() argument
3164 elem->head.mixer = mixer; in scarlett2_add_new_ctl()
3196 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_firmware_version_ctl_get()
3222 struct usb_mixer_interface *mixer) in scarlett2_add_firmware_version_ctl() argument
3224 return scarlett2_add_new_ctl(mixer, &scarlett2_firmware_version_ctl, in scarlett2_add_firmware_version_ctl()
3235 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_min_firmware_version_ctl_get()
3261 struct usb_mixer_interface *mixer) in scarlett2_add_min_firmware_version_ctl() argument
3263 return scarlett2_add_new_ctl(mixer, &scarlett2_min_firmware_version_ctl, in scarlett2_add_min_firmware_version_ctl()
3272 static int scarlett2_update_sync(struct usb_mixer_interface *mixer) in scarlett2_update_sync() argument
3274 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_sync()
3277 return scarlett2_usb_get_sync_status(mixer, &private->sync); in scarlett2_update_sync()
3293 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_sync_ctl_get() local
3294 struct scarlett2_data *private = mixer->private_data; in scarlett2_sync_ctl_get()
3305 err = scarlett2_update_sync(mixer); in scarlett2_sync_ctl_get()
3324 static int scarlett2_add_sync_ctl(struct usb_mixer_interface *mixer) in scarlett2_add_sync_ctl() argument
3326 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_sync_ctl()
3332 return scarlett2_add_new_ctl(mixer, &scarlett2_sync_ctl, in scarlett2_add_sync_ctl()
3366 static int scarlett2_update_autogain(struct usb_mixer_interface *mixer) in scarlett2_update_autogain() argument
3368 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_autogain()
3380 mixer, SCARLETT2_CONFIG_AUTOGAIN_SWITCH, in scarlett2_update_autogain()
3385 mixer, SCARLETT2_CONFIG_AUTOGAIN_STATUS, in scarlett2_update_autogain()
3416 mixer, scarlett2_ag_target_configs[i], in scarlett2_update_autogain()
3430 static void scarlett2_autogain_update_access(struct usb_mixer_interface *mixer) in scarlett2_autogain_update_access() argument
3432 struct scarlett2_data *private = mixer->private_data; in scarlett2_autogain_update_access()
3470 static void scarlett2_autogain_notify_access(struct usb_mixer_interface *mixer) in scarlett2_autogain_notify_access() argument
3472 struct snd_card *card = mixer->chip->card; in scarlett2_autogain_notify_access()
3473 struct scarlett2_data *private = mixer->private_data; in scarlett2_autogain_notify_access()
3519 struct usb_mixer_interface *mixer) in scarlett2_check_autogain_updated() argument
3521 struct scarlett2_data *private = mixer->private_data; in scarlett2_check_autogain_updated()
3527 err = scarlett2_update_autogain(mixer); in scarlett2_check_autogain_updated()
3531 scarlett2_autogain_update_access(mixer); in scarlett2_check_autogain_updated()
3542 struct usb_mixer_interface *mixer) in scarlett2_check_put_during_autogain() argument
3544 int err = scarlett2_check_autogain_updated(mixer); in scarlett2_check_put_during_autogain()
3549 if (scarlett2_autogain_is_running(mixer->private_data)) in scarlett2_check_put_during_autogain()
3559 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_autogain_switch_ctl_info() local
3560 struct scarlett2_data *private = mixer->private_data; in scarlett2_autogain_switch_ctl_info()
3565 err = scarlett2_check_input_phantom_updated(mixer); in scarlett2_autogain_switch_ctl_info()
3580 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_autogain_switch_ctl_get() local
3581 struct scarlett2_data *private = mixer->private_data; in scarlett2_autogain_switch_ctl_get()
3591 err = scarlett2_check_autogain_updated(mixer); in scarlett2_autogain_switch_ctl_get()
3607 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_autogain_status_ctl_get() local
3608 struct scarlett2_data *private = mixer->private_data; in scarlett2_autogain_status_ctl_get()
3618 err = scarlett2_check_autogain_updated(mixer); in scarlett2_autogain_status_ctl_get()
3634 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_autogain_switch_ctl_put() local
3635 struct scarlett2_data *private = mixer->private_data; in scarlett2_autogain_switch_ctl_put()
3647 err = scarlett2_check_input_phantom_updated(mixer); in scarlett2_autogain_switch_ctl_put()
3666 mixer, SCARLETT2_CONFIG_AUTOGAIN_SWITCH, index, val); in scarlett2_autogain_switch_ctl_put()
3670 scarlett2_autogain_update_access(mixer); in scarlett2_autogain_switch_ctl_put()
3671 scarlett2_autogain_notify_access(mixer); in scarlett2_autogain_switch_ctl_put()
3682 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_autogain_status_ctl_info()
3712 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_ag_target_ctl_info() local
3713 struct scarlett2_data *private = mixer->private_data; in scarlett2_ag_target_ctl_info()
3723 err = scarlett2_check_autogain_updated(mixer); in scarlett2_ag_target_ctl_info()
3742 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_ag_target_ctl_get() local
3743 struct scarlett2_data *private = mixer->private_data; in scarlett2_ag_target_ctl_get()
3754 err = scarlett2_update_autogain(mixer); in scarlett2_ag_target_ctl_get()
3770 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_ag_target_ctl_put() local
3771 struct scarlett2_data *private = mixer->private_data; in scarlett2_ag_target_ctl_put()
3783 err = scarlett2_check_put_during_autogain(mixer); in scarlett2_ag_target_ctl_put()
3798 mixer, scarlett2_ag_target_configs[index], 1, -val); in scarlett2_ag_target_ctl_put()
3824 static int scarlett2_update_input_select(struct usb_mixer_interface *mixer) in scarlett2_update_input_select() argument
3826 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_select()
3839 mixer, SCARLETT2_CONFIG_INPUT_SELECT_SWITCH, in scarlett2_update_input_select()
3845 mixer, SCARLETT2_CONFIG_INPUT_LINK_SWITCH, in scarlett2_update_input_select()
3861 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_input_select_ctl_get() local
3862 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_select_ctl_get()
3873 err = scarlett2_update_input_select(mixer); in scarlett2_input_select_ctl_get()
3888 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_input_select_ctl_put() local
3889 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_select_ctl_put()
3901 err = scarlett2_check_put_during_autogain(mixer); in scarlett2_input_select_ctl_put()
3921 mixer, SCARLETT2_CONFIG_INPUT_SELECT_SWITCH, in scarlett2_input_select_ctl_put()
3935 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_input_select_ctl_info() local
3936 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_select_ctl_info()
3953 err = scarlett2_check_autogain_updated(mixer); in scarlett2_input_select_ctl_info()
4001 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_autogain_disables_ctl_info() local
4002 struct scarlett2_data *private = mixer->private_data; in scarlett2_autogain_disables_ctl_info()
4012 err = scarlett2_check_autogain_updated(mixer); in scarlett2_autogain_disables_ctl_info()
4027 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_input_link_ctl_get() local
4028 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_link_ctl_get()
4039 err = scarlett2_update_input_select(mixer); in scarlett2_input_link_ctl_get()
4055 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_input_link_ctl_put() local
4056 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_link_ctl_put()
4068 err = scarlett2_check_put_during_autogain(mixer); in scarlett2_input_link_ctl_put()
4081 snd_ctl_notify(mixer->chip->card, in scarlett2_input_link_ctl_put()
4091 mixer, SCARLETT2_CONFIG_INPUT_LINK_SWITCH, index + 1, val); in scarlett2_input_link_ctl_put()
4110 static int scarlett2_update_input_gain(struct usb_mixer_interface *mixer) in scarlett2_update_input_gain() argument
4112 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_gain()
4121 mixer, SCARLETT2_CONFIG_INPUT_GAIN, in scarlett2_update_input_gain()
4129 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_input_gain_ctl_info() local
4130 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_gain_ctl_info()
4140 err = scarlett2_check_autogain_updated(mixer); in scarlett2_input_gain_ctl_info()
4159 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_input_gain_ctl_get() local
4160 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_gain_ctl_get()
4171 err = scarlett2_update_input_gain(mixer); in scarlett2_input_gain_ctl_get()
4187 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_input_gain_ctl_put() local
4188 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_gain_ctl_put()
4200 err = scarlett2_check_put_during_autogain(mixer); in scarlett2_input_gain_ctl_put()
4213 err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_INPUT_GAIN, in scarlett2_input_gain_ctl_put()
4236 static int scarlett2_update_input_safe(struct usb_mixer_interface *mixer) in scarlett2_update_input_safe() argument
4238 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_safe()
4247 mixer, SCARLETT2_CONFIG_SAFE_SWITCH, in scarlett2_update_input_safe()
4255 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_safe_ctl_get() local
4256 struct scarlett2_data *private = mixer->private_data; in scarlett2_safe_ctl_get()
4267 err = scarlett2_update_input_safe(mixer); in scarlett2_safe_ctl_get()
4283 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_safe_ctl_put() local
4284 struct scarlett2_data *private = mixer->private_data; in scarlett2_safe_ctl_put()
4296 err = scarlett2_check_put_during_autogain(mixer); in scarlett2_safe_ctl_put()
4309 err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_SAFE_SWITCH, in scarlett2_safe_ctl_put()
4329 static int scarlett2_update_pcm_input_switch(struct usb_mixer_interface *mixer) in scarlett2_update_pcm_input_switch() argument
4331 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_pcm_input_switch()
4337 mixer, SCARLETT2_CONFIG_PCM_INPUT_SWITCH, in scarlett2_update_pcm_input_switch()
4349 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_pcm_input_switch_ctl_get() local
4350 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_pcm_input_switch_ctl_get()
4356 err = scarlett2_update_pcm_input_switch(mixer); in scarlett2_pcm_input_switch_ctl_get()
4371 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_pcm_input_switch_ctl_put() local
4372 struct scarlett2_data *private = mixer->private_data; in scarlett2_pcm_input_switch_ctl_put()
4393 mixer, SCARLETT2_CONFIG_PCM_INPUT_SWITCH, in scarlett2_pcm_input_switch_ctl_put()
4427 static int scarlett2_update_volumes(struct usb_mixer_interface *mixer) in scarlett2_update_volumes() argument
4429 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_volumes()
4438 mixer, SCARLETT2_CONFIG_MASTER_VOLUME, in scarlett2_update_volumes()
4456 mixer, SCARLETT2_CONFIG_HEADPHONE_VOLUME, in scarlett2_update_volumes()
4485 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_master_volume_ctl_get() local
4486 struct scarlett2_data *private = mixer->private_data; in scarlett2_master_volume_ctl_get()
4497 err = scarlett2_update_volumes(mixer); in scarlett2_master_volume_ctl_get()
4513 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_headphone_volume_ctl_get() local
4514 struct scarlett2_data *private = mixer->private_data; in scarlett2_headphone_volume_ctl_get()
4525 err = scarlett2_update_volumes(mixer); in scarlett2_headphone_volume_ctl_get()
4553 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_volume_ctl_get() local
4554 struct scarlett2_data *private = mixer->private_data; in scarlett2_volume_ctl_get()
4566 err = scarlett2_update_volumes(mixer); in scarlett2_volume_ctl_get()
4581 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_volume_ctl_put() local
4582 struct scarlett2_data *private = mixer->private_data; in scarlett2_volume_ctl_put()
4600 err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_LINE_OUT_VOLUME, in scarlett2_volume_ctl_put()
4650 static int scarlett2_update_dim_mute(struct usb_mixer_interface *mixer) in scarlett2_update_dim_mute() argument
4652 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_dim_mute()
4662 mixer, SCARLETT2_CONFIG_DIM_MUTE, in scarlett2_update_dim_mute()
4683 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_mute_ctl_get() local
4684 struct scarlett2_data *private = mixer->private_data; in scarlett2_mute_ctl_get()
4696 err = scarlett2_update_dim_mute(mixer); in scarlett2_mute_ctl_get()
4711 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_mute_ctl_put() local
4712 struct scarlett2_data *private = mixer->private_data; in scarlett2_mute_ctl_put()
4732 err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_MUTE_SWITCH, in scarlett2_mute_ctl_put()
4778 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_sw_hw_enum_ctl_get()
4785 static void scarlett2_vol_ctl_set_writable(struct usb_mixer_interface *mixer, in scarlett2_vol_ctl_set_writable() argument
4788 struct scarlett2_data *private = mixer->private_data; in scarlett2_vol_ctl_set_writable()
4789 struct snd_card *card = mixer->chip->card; in scarlett2_vol_ctl_set_writable()
4813 static int scarlett2_sw_hw_change(struct usb_mixer_interface *mixer, in scarlett2_sw_hw_change() argument
4816 struct scarlett2_data *private = mixer->private_data; in scarlett2_sw_hw_change()
4825 scarlett2_vol_ctl_set_writable(mixer, ctl_index, !val); in scarlett2_sw_hw_change()
4833 mixer, SCARLETT2_CONFIG_LINE_OUT_VOLUME, in scarlett2_sw_hw_change()
4840 mixer, SCARLETT2_CONFIG_MUTE_SWITCH, in scarlett2_sw_hw_change()
4846 return scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_SW_HW_SWITCH, in scarlett2_sw_hw_change()
4854 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_sw_hw_enum_ctl_put() local
4855 struct scarlett2_data *private = mixer->private_data; in scarlett2_sw_hw_enum_ctl_put()
4873 err = scarlett2_sw_hw_change(mixer, ctl_index, val); in scarlett2_sw_hw_enum_ctl_put()
4892 static int scarlett2_update_input_level(struct usb_mixer_interface *mixer) in scarlett2_update_input_level() argument
4894 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_level()
4903 mixer, SCARLETT2_CONFIG_LEVEL_SWITCH, in scarlett2_update_input_level()
4915 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_level_enum_ctl_info() local
4916 struct scarlett2_data *private = mixer->private_data; in scarlett2_level_enum_ctl_info()
4926 err = scarlett2_check_autogain_updated(mixer); in scarlett2_level_enum_ctl_info()
4941 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_level_enum_ctl_get() local
4942 struct scarlett2_data *private = mixer->private_data; in scarlett2_level_enum_ctl_get()
4956 err = scarlett2_update_input_level(mixer); in scarlett2_level_enum_ctl_get()
4972 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_level_enum_ctl_put() local
4973 struct scarlett2_data *private = mixer->private_data; in scarlett2_level_enum_ctl_put()
4986 err = scarlett2_check_put_during_autogain(mixer); in scarlett2_level_enum_ctl_put()
5003 err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_LEVEL_SWITCH, in scarlett2_level_enum_ctl_put()
5023 static int scarlett2_update_input_pad(struct usb_mixer_interface *mixer) in scarlett2_update_input_pad() argument
5025 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_pad()
5034 mixer, SCARLETT2_CONFIG_PAD_SWITCH, in scarlett2_update_input_pad()
5042 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_pad_ctl_get() local
5043 struct scarlett2_data *private = mixer->private_data; in scarlett2_pad_ctl_get()
5054 err = scarlett2_update_input_pad(mixer); in scarlett2_pad_ctl_get()
5070 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_pad_ctl_put() local
5071 struct scarlett2_data *private = mixer->private_data; in scarlett2_pad_ctl_put()
5092 err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_PAD_SWITCH, in scarlett2_pad_ctl_put()
5112 static int scarlett2_update_input_air(struct usb_mixer_interface *mixer) in scarlett2_update_input_air() argument
5114 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_air()
5123 mixer, SCARLETT2_CONFIG_AIR_SWITCH, in scarlett2_update_input_air()
5131 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_air_ctl_get() local
5132 struct scarlett2_data *private = mixer->private_data; in scarlett2_air_ctl_get()
5143 err = scarlett2_update_input_air(mixer); in scarlett2_air_ctl_get()
5158 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_air_ctl_put() local
5159 struct scarlett2_data *private = mixer->private_data; in scarlett2_air_ctl_put()
5171 err = scarlett2_check_put_during_autogain(mixer); in scarlett2_air_ctl_put()
5184 err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_AIR_SWITCH, in scarlett2_air_ctl_put()
5201 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_air_with_drive_ctl_info() local
5202 struct scarlett2_data *private = mixer->private_data; in scarlett2_air_with_drive_ctl_info()
5212 err = scarlett2_check_autogain_updated(mixer); in scarlett2_air_with_drive_ctl_info()
5242 static int scarlett2_update_input_dsp(struct usb_mixer_interface *mixer) in scarlett2_update_input_dsp() argument
5244 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_dsp()
5253 mixer, SCARLETT2_CONFIG_DSP_SWITCH, in scarlett2_update_input_dsp()
5261 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_dsp_ctl_get() local
5262 struct scarlett2_data *private = mixer->private_data; in scarlett2_dsp_ctl_get()
5273 err = scarlett2_update_input_dsp(mixer); in scarlett2_dsp_ctl_get()
5288 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_dsp_ctl_put() local
5289 struct scarlett2_data *private = mixer->private_data; in scarlett2_dsp_ctl_put()
5301 err = scarlett2_check_put_during_autogain(mixer); in scarlett2_dsp_ctl_put()
5314 err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_DSP_SWITCH, in scarlett2_dsp_ctl_put()
5334 static int scarlett2_update_compressor_values(struct usb_mixer_interface *mixer) in scarlett2_update_compressor_values() argument
5336 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_compressor_values()
5344 mixer, SCARLETT2_CONFIG_COMPRESSOR_PARAMS, in scarlett2_update_compressor_values()
5371 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_compressor_ctl_get()
5382 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_compressor_ctl_put() local
5383 struct scarlett2_data *private = mixer->private_data; in scarlett2_compressor_ctl_put()
5398 err = scarlett2_check_put_during_autogain(mixer); in scarlett2_compressor_ctl_put()
5420 mixer, private->config_set->param_buf_addr + 1, 1, channel); in scarlett2_compressor_ctl_put()
5425 mixer, SCARLETT2_CONFIG_COMPRESSOR_PARAMS, index, scaled_val); in scarlett2_compressor_ctl_put()
5465 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_precomp_flt_switch_ctl_get()
5476 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_peq_flt_switch_ctl_get()
5488 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_precomp_flt_switch_ctl_put() local
5489 struct scarlett2_data *private = mixer->private_data; in scarlett2_precomp_flt_switch_ctl_put()
5509 mixer, SCARLETT2_CONFIG_PRECOMP_FLT_SWITCH, in scarlett2_precomp_flt_switch_ctl_put()
5523 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_peq_flt_switch_ctl_put() local
5524 struct scarlett2_data *private = mixer->private_data; in scarlett2_peq_flt_switch_ctl_put()
5544 mixer, SCARLETT2_CONFIG_PEQ_FLT_SWITCH, in scarlett2_peq_flt_switch_ctl_put()
5570 static int scarlett2_update_filter_values(struct usb_mixer_interface *mixer) in scarlett2_update_filter_values() argument
5572 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_filter_values()
5584 mixer, SCARLETT2_CONFIG_PRECOMP_FLT_SWITCH, in scarlett2_update_filter_values()
5590 mixer, SCARLETT2_CONFIG_PEQ_FLT_SWITCH, in scarlett2_update_filter_values()
5598 mixer, SCARLETT2_CONFIG_PRECOMP_FLT_PARAMS, in scarlett2_update_filter_values()
5611 mixer, SCARLETT2_CONFIG_PEQ_FLT_PARAMS, in scarlett2_update_filter_values()
5638 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_precomp_flt_ctl_get()
5654 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_peq_flt_ctl_get()
5670 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_precomp_flt_ctl_put() local
5671 struct scarlett2_data *private = mixer->private_data; in scarlett2_precomp_flt_ctl_put()
5683 err = scarlett2_check_put_during_autogain(mixer); in scarlett2_precomp_flt_ctl_put()
5705 mixer, private->config_set->param_buf_addr, 1, index); in scarlett2_precomp_flt_ctl_put()
5710 mixer, SCARLETT2_CONFIG_PRECOMP_FLT_PARAMS, in scarlett2_precomp_flt_ctl_put()
5726 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_peq_flt_ctl_put() local
5727 struct scarlett2_data *private = mixer->private_data; in scarlett2_peq_flt_ctl_put()
5746 err = scarlett2_check_put_during_autogain(mixer); in scarlett2_peq_flt_ctl_put()
5768 mixer, private->config_set->param_buf_addr, 1, dst_index); in scarlett2_peq_flt_ctl_put()
5773 mixer, SCARLETT2_CONFIG_PEQ_FLT_PARAMS, in scarlett2_peq_flt_ctl_put()
5814 static int scarlett2_update_input_mute(struct usb_mixer_interface *mixer) in scarlett2_update_input_mute() argument
5816 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_mute()
5825 mixer, SCARLETT2_CONFIG_INPUT_MUTE_SWITCH, in scarlett2_update_input_mute()
5833 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_input_mute_ctl_get() local
5834 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_mute_ctl_get()
5845 err = scarlett2_update_input_mute(mixer); in scarlett2_input_mute_ctl_get()
5861 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_input_mute_ctl_put() local
5862 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_mute_ctl_put()
5874 err = scarlett2_check_put_during_autogain(mixer); in scarlett2_input_mute_ctl_put()
5888 mixer, SCARLETT2_CONFIG_INPUT_MUTE_SWITCH, in scarlett2_input_mute_ctl_put()
5908 static int scarlett2_update_input_phantom(struct usb_mixer_interface *mixer) in scarlett2_update_input_phantom() argument
5910 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_phantom()
5920 mixer, SCARLETT2_CONFIG_PHANTOM_SWITCH, in scarlett2_update_input_phantom()
5928 mixer, SCARLETT2_CONFIG_PHANTOM_PERSISTENCE, in scarlett2_update_input_phantom()
5948 static void scarlett2_phantom_update_access(struct usb_mixer_interface *mixer) in scarlett2_phantom_update_access() argument
5950 struct scarlett2_data *private = mixer->private_data; in scarlett2_phantom_update_access()
5965 static void scarlett2_phantom_notify_access(struct usb_mixer_interface *mixer) in scarlett2_phantom_notify_access() argument
5967 struct snd_card *card = mixer->chip->card; in scarlett2_phantom_notify_access()
5968 struct scarlett2_data *private = mixer->private_data; in scarlett2_phantom_notify_access()
5981 struct usb_mixer_interface *mixer) in scarlett2_check_input_phantom_updated() argument
5983 struct scarlett2_data *private = mixer->private_data; in scarlett2_check_input_phantom_updated()
5989 err = scarlett2_update_input_phantom(mixer); in scarlett2_check_input_phantom_updated()
5993 scarlett2_phantom_update_access(mixer); in scarlett2_check_input_phantom_updated()
6002 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_phantom_ctl_get() local
6003 struct scarlett2_data *private = mixer->private_data; in scarlett2_phantom_ctl_get()
6013 err = scarlett2_check_input_phantom_updated(mixer); in scarlett2_phantom_ctl_get()
6029 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_phantom_ctl_put() local
6030 struct scarlett2_data *private = mixer->private_data; in scarlett2_phantom_ctl_put()
6043 err = scarlett2_check_put_during_autogain(mixer); in scarlett2_phantom_ctl_put()
6060 err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_PHANTOM_SWITCH, in scarlett2_phantom_ctl_put()
6065 scarlett2_phantom_update_access(mixer); in scarlett2_phantom_ctl_put()
6066 scarlett2_phantom_notify_access(mixer); in scarlett2_phantom_ctl_put()
6087 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_phantom_persistence_ctl_get()
6097 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_phantom_persistence_ctl_put() local
6098 struct scarlett2_data *private = mixer->private_data; in scarlett2_phantom_persistence_ctl_put()
6120 mixer, SCARLETT2_CONFIG_PHANTOM_PERSISTENCE, index, val); in scarlett2_phantom_persistence_ctl_put()
6139 static int scarlett2_update_monitor_other(struct usb_mixer_interface *mixer) in scarlett2_update_monitor_other() argument
6141 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_monitor_other()
6164 mixer, SCARLETT2_CONFIG_MONITOR_OTHER_ENABLE, in scarlett2_update_monitor_other()
6170 mixer, SCARLETT2_CONFIG_MONITOR_OTHER_SWITCH, in scarlett2_update_monitor_other()
6189 err = scarlett2_usb_get_config(mixer, in scarlett2_update_monitor_other()
6215 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_speaker_switch_enum_ctl_get() local
6216 struct scarlett2_data *private = mixer->private_data; in scarlett2_speaker_switch_enum_ctl_get()
6227 err = scarlett2_update_monitor_other(mixer); in scarlett2_speaker_switch_enum_ctl_get()
6241 static int scarlett2_speaker_switch_enable(struct usb_mixer_interface *mixer) in scarlett2_speaker_switch_enable() argument
6243 struct snd_card *card = mixer->chip->card; in scarlett2_speaker_switch_enable()
6244 struct scarlett2_data *private = mixer->private_data; in scarlett2_speaker_switch_enable()
6252 err = scarlett2_sw_hw_change(private->mixer, i, 1); in scarlett2_speaker_switch_enable()
6276 static void scarlett2_speaker_switch_disable(struct usb_mixer_interface *mixer) in scarlett2_speaker_switch_disable() argument
6278 struct snd_card *card = mixer->chip->card; in scarlett2_speaker_switch_disable()
6279 struct scarlett2_data *private = mixer->private_data; in scarlett2_speaker_switch_disable()
6299 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_speaker_switch_enum_ctl_put() local
6300 struct scarlett2_data *private = mixer->private_data; in scarlett2_speaker_switch_enum_ctl_put()
6321 mixer, SCARLETT2_CONFIG_MONITOR_OTHER_ENABLE, in scarlett2_speaker_switch_enum_ctl_put()
6328 mixer, SCARLETT2_CONFIG_MONITOR_OTHER_SWITCH, in scarlett2_speaker_switch_enum_ctl_put()
6335 err = scarlett2_speaker_switch_enable(mixer); in scarlett2_speaker_switch_enum_ctl_put()
6337 scarlett2_speaker_switch_disable(mixer); in scarlett2_speaker_switch_enum_ctl_put()
6355 static int scarlett2_add_speaker_switch_ctl(struct usb_mixer_interface *mixer) in scarlett2_add_speaker_switch_ctl() argument
6357 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_speaker_switch_ctl()
6364 mixer, &scarlett2_speaker_switch_enum_ctl, in scarlett2_add_speaker_switch_ctl()
6385 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_talkback_enum_ctl_get() local
6386 struct scarlett2_data *private = mixer->private_data; in scarlett2_talkback_enum_ctl_get()
6397 err = scarlett2_update_monitor_other(mixer); in scarlett2_talkback_enum_ctl_get()
6412 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_talkback_enum_ctl_put() local
6413 struct scarlett2_data *private = mixer->private_data; in scarlett2_talkback_enum_ctl_put()
6434 mixer, SCARLETT2_CONFIG_MONITOR_OTHER_ENABLE, in scarlett2_talkback_enum_ctl_put()
6441 mixer, SCARLETT2_CONFIG_MONITOR_OTHER_SWITCH, in scarlett2_talkback_enum_ctl_put()
6463 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_talkback_map_ctl_get() local
6464 struct scarlett2_data *private = mixer->private_data; in scarlett2_talkback_map_ctl_get()
6476 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_talkback_map_ctl_put() local
6477 struct scarlett2_data *private = mixer->private_data; in scarlett2_talkback_map_ctl_put()
6501 err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_TALKBACK_MAP, in scarlett2_talkback_map_ctl_put()
6519 static int scarlett2_add_talkback_ctls(struct usb_mixer_interface *mixer) in scarlett2_add_talkback_ctls() argument
6521 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_talkback_ctls()
6530 mixer, &scarlett2_talkback_enum_ctl, in scarlett2_add_talkback_ctls()
6539 err = scarlett2_add_new_ctl(mixer, &scarlett2_talkback_map_ctl, in scarlett2_add_talkback_ctls()
6554 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_dim_mute_ctl_get() local
6555 struct scarlett2_data *private = mixer->private_data; in scarlett2_dim_mute_ctl_get()
6566 err = scarlett2_update_dim_mute(mixer); in scarlett2_dim_mute_ctl_get()
6581 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_dim_mute_ctl_put() local
6582 struct scarlett2_data *private = mixer->private_data; in scarlett2_dim_mute_ctl_put()
6602 err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_DIM_MUTE, in scarlett2_dim_mute_ctl_put()
6613 snd_ctl_notify(mixer->chip->card, in scarlett2_dim_mute_ctl_put()
6634 static int scarlett2_add_line_out_ctls(struct usb_mixer_interface *mixer) in scarlett2_add_line_out_ctls() argument
6636 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_line_out_ctls()
6645 err = scarlett2_add_new_ctl(mixer, in scarlett2_add_line_out_ctls()
6656 err = scarlett2_add_new_ctl(mixer, in scarlett2_add_line_out_ctls()
6684 err = scarlett2_add_new_ctl(mixer, in scarlett2_add_line_out_ctls()
6694 err = scarlett2_add_new_ctl(mixer, in scarlett2_add_line_out_ctls()
6709 scarlett2_vol_ctl_set_writable(mixer, i, 0); in scarlett2_add_line_out_ctls()
6714 err = scarlett2_add_new_ctl(mixer, in scarlett2_add_line_out_ctls()
6733 mixer, &scarlett2_dim_mute_ctl, in scarlett2_add_line_out_ctls()
6745 static int scarlett2_add_dsp_ctls(struct usb_mixer_interface *mixer, int i) in scarlett2_add_dsp_ctls() argument
6747 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_dsp_ctls()
6762 mixer, &scarlett2_compressor_ctl, in scarlett2_add_dsp_ctls()
6772 mixer, &scarlett2_precomp_flt_switch_ctl, in scarlett2_add_dsp_ctls()
6779 mixer, &scarlett2_peq_flt_switch_ctl, in scarlett2_add_dsp_ctls()
6788 mixer, &scarlett2_precomp_flt_ctl, in scarlett2_add_dsp_ctls()
6798 mixer, &scarlett2_peq_flt_ctl, in scarlett2_add_dsp_ctls()
6808 static int scarlett2_add_line_in_ctls(struct usb_mixer_interface *mixer) in scarlett2_add_line_in_ctls() argument
6810 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_line_in_ctls()
6821 err = scarlett2_add_new_ctl(mixer, &scarlett2_level_enum_ctl, in scarlett2_add_line_in_ctls()
6830 err = scarlett2_add_new_ctl(mixer, &scarlett2_pad_ctl, in scarlett2_add_line_in_ctls()
6841 mixer, &scarlett2_air_ctl[info->air_option], in scarlett2_add_line_in_ctls()
6850 err = scarlett2_add_new_ctl(mixer, &scarlett2_dsp_ctl, in scarlett2_add_line_in_ctls()
6855 err = scarlett2_add_dsp_ctls(mixer, i); in scarlett2_add_line_in_ctls()
6864 mixer, &scarlett2_input_mute_ctl, in scarlett2_add_line_in_ctls()
6877 mixer, &scarlett2_phantom_ctl, in scarlett2_add_line_in_ctls()
6890 mixer, &scarlett2_phantom_ctl, in scarlett2_add_line_in_ctls()
6900 mixer, &scarlett2_phantom_persistence_ctl, 0, 1, in scarlett2_add_line_in_ctls()
6910 mixer, &scarlett2_input_select_ctl, 0, 1, in scarlett2_add_line_in_ctls()
6924 mixer, &scarlett2_input_link_ctl, in scarlett2_add_line_in_ctls()
6936 mixer, &scarlett2_input_gain_ctl, in scarlett2_add_line_in_ctls()
6946 mixer, &scarlett2_autogain_switch_ctl, in scarlett2_add_line_in_ctls()
6954 mixer, &scarlett2_autogain_status_ctl, in scarlett2_add_line_in_ctls()
6966 mixer, &scarlett2_ag_target_ctl, in scarlett2_add_line_in_ctls()
6977 mixer, &scarlett2_safe_ctl, in scarlett2_add_line_in_ctls()
6987 mixer, &scarlett2_pcm_input_switch_ctl, 0, 1, in scarlett2_add_line_in_ctls()
6999 static int scarlett2_update_mix(struct usb_mixer_interface *mixer) in scarlett2_update_mix() argument
7001 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_mix()
7007 err = scarlett2_usb_get_mix(mixer, i); in scarlett2_update_mix()
7032 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_mixer_ctl_get() local
7033 struct scarlett2_data *private = mixer->private_data; in scarlett2_mixer_ctl_get()
7044 err = scarlett2_update_mix(mixer); in scarlett2_mixer_ctl_get()
7059 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_mixer_ctl_put() local
7060 struct scarlett2_data *private = mixer->private_data; in scarlett2_mixer_ctl_put()
7080 err = scarlett2_usb_set_mix(mixer, mix_num); in scarlett2_mixer_ctl_put()
7107 static int scarlett2_add_mixer_ctls(struct usb_mixer_interface *mixer) in scarlett2_add_mixer_ctls() argument
7109 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_mixer_ctls()
7119 err = scarlett2_add_new_ctl(mixer, &scarlett2_mixer_ctl, in scarlett2_add_mixer_ctls()
7131 static int scarlett2_update_direct_monitor(struct usb_mixer_interface *mixer) in scarlett2_update_direct_monitor() argument
7133 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_direct_monitor()
7141 mixer, SCARLETT2_CONFIG_DIRECT_MONITOR, in scarlett2_update_direct_monitor()
7145 static int scarlett2_update_monitor_mix(struct usb_mixer_interface *mixer) in scarlett2_update_monitor_mix() argument
7147 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_monitor_mix()
7155 mixer, SCARLETT2_CONFIG_DIRECT_MONITOR_GAIN, in scarlett2_update_monitor_mix()
7171 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_direct_monitor_ctl_get() local
7172 struct scarlett2_data *private = mixer->private_data; in scarlett2_direct_monitor_ctl_get()
7183 err = scarlett2_update_direct_monitor(mixer); in scarlett2_direct_monitor_ctl_get()
7198 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_direct_monitor_ctl_put() local
7199 struct scarlett2_data *private = mixer->private_data; in scarlett2_direct_monitor_ctl_put()
7221 mixer, SCARLETT2_CONFIG_DIRECT_MONITOR, index, val); in scarlett2_direct_monitor_ctl_put()
7264 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_monitor_mix_ctl_get()
7275 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_monitor_mix_ctl_put() local
7276 struct scarlett2_data *private = mixer->private_data; in scarlett2_monitor_mix_ctl_put()
7296 mixer, SCARLETT2_CONFIG_DIRECT_MONITOR_GAIN, in scarlett2_monitor_mix_ctl_put()
7318 static int scarlett2_add_direct_monitor_ctls(struct usb_mixer_interface *mixer) in scarlett2_add_direct_monitor_ctls() argument
7320 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_direct_monitor_ctls()
7333 mixer, &scarlett2_direct_monitor_ctl[info->direct_monitor - 1], in scarlett2_add_direct_monitor_ctls()
7365 mixer, &scarlett2_monitor_mix_ctl, in scarlett2_add_direct_monitor_ctls()
7381 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_mux_src_enum_ctl_info()
7424 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_mux_src_enum_ctl_get() local
7425 struct scarlett2_data *private = mixer->private_data; in scarlett2_mux_src_enum_ctl_get()
7437 err = scarlett2_usb_get_mux(mixer); in scarlett2_mux_src_enum_ctl_get()
7452 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_mux_src_enum_ctl_put() local
7453 struct scarlett2_data *private = mixer->private_data; in scarlett2_mux_src_enum_ctl_put()
7472 err = scarlett2_usb_set_mux(mixer); in scarlett2_mux_src_enum_ctl_put()
7489 static int scarlett2_add_mux_enums(struct usb_mixer_interface *mixer) in scarlett2_add_mux_enums() argument
7491 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_mux_enums()
7518 err = scarlett2_add_new_ctl(mixer, in scarlett2_add_mux_enums()
7549 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_meter_ctl_get() local
7550 struct scarlett2_data *private = mixer->private_data; in scarlett2_meter_ctl_get()
7562 err = scarlett2_usb_get_meter_levels(mixer, elem->channels, in scarlett2_meter_ctl_get()
7594 static int scarlett2_add_meter_ctl(struct usb_mixer_interface *mixer) in scarlett2_add_meter_ctl() argument
7596 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_meter_ctl()
7602 return scarlett2_add_new_ctl(mixer, &scarlett2_meter_ctl, in scarlett2_add_meter_ctl()
7613 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_msd_ctl_get()
7623 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_msd_ctl_put() local
7624 struct scarlett2_data *private = mixer->private_data; in scarlett2_msd_ctl_put()
7644 err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_MSD_SWITCH, in scarlett2_msd_ctl_put()
7662 static int scarlett2_add_msd_ctl(struct usb_mixer_interface *mixer) in scarlett2_add_msd_ctl() argument
7664 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_msd_ctl()
7670 if (!private->msd_switch && !(mixer->chip->setup & SCARLETT2_MSD_ENABLE)) in scarlett2_add_msd_ctl()
7674 return scarlett2_add_new_ctl(mixer, &scarlett2_msd_ctl, in scarlett2_add_msd_ctl()
7684 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_standalone_ctl_get()
7694 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_standalone_ctl_put() local
7695 struct scarlett2_data *private = mixer->private_data; in scarlett2_standalone_ctl_put()
7715 err = scarlett2_usb_set_config(mixer, in scarlett2_standalone_ctl_put()
7734 static int scarlett2_add_standalone_ctl(struct usb_mixer_interface *mixer) in scarlett2_add_standalone_ctl() argument
7736 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_standalone_ctl()
7743 return scarlett2_add_new_ctl(mixer, &scarlett2_standalone_ctl, in scarlett2_add_standalone_ctl()
7749 static int scarlett2_update_power_status(struct usb_mixer_interface *mixer) in scarlett2_update_power_status() argument
7751 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_power_status()
7757 err = scarlett2_usb_get_config(mixer, SCARLETT2_CONFIG_POWER_EXT, in scarlett2_update_power_status()
7762 err = scarlett2_usb_get_config(mixer, SCARLETT2_CONFIG_POWER_LOW, in scarlett2_update_power_status()
7781 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_power_status_ctl_get() local
7782 struct scarlett2_data *private = mixer->private_data; in scarlett2_power_status_ctl_get()
7788 err = scarlett2_update_power_status(mixer); in scarlett2_power_status_ctl_get()
7817 static int scarlett2_add_power_status_ctl(struct usb_mixer_interface *mixer) in scarlett2_add_power_status_ctl() argument
7819 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_power_status_ctl()
7826 return scarlett2_add_new_ctl(mixer, &scarlett2_power_status_ctl, in scarlett2_add_power_status_ctl()
7833 static int scarlett2_update_bluetooth_volume(struct usb_mixer_interface *mixer) in scarlett2_update_bluetooth_volume() argument
7835 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_bluetooth_volume()
7843 err = scarlett2_usb_get_config(mixer, in scarlett2_update_bluetooth_volume()
7856 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_bluetooth_volume_ctl_get() local
7857 struct scarlett2_data *private = mixer->private_data; in scarlett2_bluetooth_volume_ctl_get()
7868 err = scarlett2_update_bluetooth_volume(mixer); in scarlett2_bluetooth_volume_ctl_get()
7883 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_bluetooth_volume_ctl_put() local
7884 struct scarlett2_data *private = mixer->private_data; in scarlett2_bluetooth_volume_ctl_put()
7902 err = scarlett2_usb_set_config(mixer, in scarlett2_bluetooth_volume_ctl_put()
7933 struct usb_mixer_interface *mixer) in scarlett2_add_bluetooth_volume_ctl() argument
7935 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_bluetooth_volume_ctl()
7941 return scarlett2_add_new_ctl(mixer, &scarlett2_bluetooth_volume_ctl, in scarlett2_add_bluetooth_volume_ctl()
7948 static int scarlett2_update_spdif_mode(struct usb_mixer_interface *mixer) in scarlett2_update_spdif_mode() argument
7950 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_spdif_mode()
7958 err = scarlett2_usb_get_config(mixer, SCARLETT2_CONFIG_SPDIF_MODE, in scarlett2_update_spdif_mode()
7978 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_spdif_mode_ctl_info()
7993 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_spdif_mode_ctl_get()
8003 struct usb_mixer_interface *mixer = elem->head.mixer; in scarlett2_spdif_mode_ctl_put() local
8004 struct scarlett2_data *private = mixer->private_data; in scarlett2_spdif_mode_ctl_put()
8030 mixer, SCARLETT2_CONFIG_SPDIF_MODE, 0, in scarlett2_spdif_mode_ctl_put()
8048 static int scarlett2_add_spdif_mode_ctl(struct usb_mixer_interface *mixer) in scarlett2_add_spdif_mode_ctl() argument
8050 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_spdif_mode_ctl()
8055 return scarlett2_add_new_ctl(mixer, &scarlett2_spdif_mode_ctl, in scarlett2_add_spdif_mode_ctl()
8064 static void scarlett2_notify_sync(struct usb_mixer_interface *mixer) in scarlett2_notify_sync() argument
8066 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_sync()
8070 snd_ctl_notify(mixer->chip->card, SNDRV_CTL_EVENT_MASK_VALUE, in scarlett2_notify_sync()
8075 static void scarlett2_notify_monitor(struct usb_mixer_interface *mixer) in scarlett2_notify_monitor() argument
8077 struct snd_card *card = mixer->chip->card; in scarlett2_notify_monitor()
8078 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_monitor()
8086 snd_ctl_notify(mixer->chip->card, SNDRV_CTL_EVENT_MASK_VALUE, in scarlett2_notify_monitor()
8096 static void scarlett2_notify_volume(struct usb_mixer_interface *mixer) in scarlett2_notify_volume() argument
8098 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_volume()
8102 snd_ctl_notify(mixer->chip->card, SNDRV_CTL_EVENT_MASK_VALUE, in scarlett2_notify_volume()
8104 snd_ctl_notify(mixer->chip->card, SNDRV_CTL_EVENT_MASK_VALUE, in scarlett2_notify_volume()
8109 static void scarlett2_notify_dim_mute(struct usb_mixer_interface *mixer) in scarlett2_notify_dim_mute() argument
8111 struct snd_card *card = mixer->chip->card; in scarlett2_notify_dim_mute()
8112 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_dim_mute()
8131 static void scarlett2_notify_input_level(struct usb_mixer_interface *mixer) in scarlett2_notify_input_level() argument
8133 struct snd_card *card = mixer->chip->card; in scarlett2_notify_input_level()
8134 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_level()
8146 static void scarlett2_notify_input_pad(struct usb_mixer_interface *mixer) in scarlett2_notify_input_pad() argument
8148 struct snd_card *card = mixer->chip->card; in scarlett2_notify_input_pad()
8149 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_pad()
8161 static void scarlett2_notify_input_air(struct usb_mixer_interface *mixer) in scarlett2_notify_input_air() argument
8163 struct snd_card *card = mixer->chip->card; in scarlett2_notify_input_air()
8164 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_air()
8176 static void scarlett2_notify_input_dsp(struct usb_mixer_interface *mixer) in scarlett2_notify_input_dsp() argument
8178 struct snd_card *card = mixer->chip->card; in scarlett2_notify_input_dsp()
8179 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_dsp()
8191 static void scarlett2_notify_input_mute(struct usb_mixer_interface *mixer) in scarlett2_notify_input_mute() argument
8193 struct snd_card *card = mixer->chip->card; in scarlett2_notify_input_mute()
8194 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_mute()
8206 static void scarlett2_notify_input_phantom(struct usb_mixer_interface *mixer) in scarlett2_notify_input_phantom() argument
8208 struct snd_card *card = mixer->chip->card; in scarlett2_notify_input_phantom()
8209 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_phantom()
8219 scarlett2_phantom_notify_access(mixer); in scarlett2_notify_input_phantom()
8223 static void scarlett2_notify_input_other(struct usb_mixer_interface *mixer) in scarlett2_notify_input_other() argument
8225 scarlett2_notify_input_level(mixer); in scarlett2_notify_input_other()
8226 scarlett2_notify_input_pad(mixer); in scarlett2_notify_input_other()
8227 scarlett2_notify_input_air(mixer); in scarlett2_notify_input_other()
8228 scarlett2_notify_input_phantom(mixer); in scarlett2_notify_input_other()
8232 static void scarlett2_notify_input_select(struct usb_mixer_interface *mixer) in scarlett2_notify_input_select() argument
8234 struct snd_card *card = mixer->chip->card; in scarlett2_notify_input_select()
8235 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_select()
8255 static void scarlett2_notify_input_gain(struct usb_mixer_interface *mixer) in scarlett2_notify_input_gain() argument
8257 struct snd_card *card = mixer->chip->card; in scarlett2_notify_input_gain()
8258 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_gain()
8273 static void scarlett2_notify_autogain(struct usb_mixer_interface *mixer) in scarlett2_notify_autogain() argument
8275 struct snd_card *card = mixer->chip->card; in scarlett2_notify_autogain()
8276 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_autogain()
8298 scarlett2_autogain_notify_access(mixer); in scarlett2_notify_autogain()
8302 static void scarlett2_notify_input_safe(struct usb_mixer_interface *mixer) in scarlett2_notify_input_safe() argument
8304 struct snd_card *card = mixer->chip->card; in scarlett2_notify_input_safe()
8305 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_safe()
8320 static void scarlett2_notify_monitor_other(struct usb_mixer_interface *mixer) in scarlett2_notify_monitor_other() argument
8322 struct snd_card *card = mixer->chip->card; in scarlett2_notify_monitor_other()
8323 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_monitor_other()
8342 scarlett2_notify_dim_mute(mixer); in scarlett2_notify_monitor_other()
8354 static void scarlett2_notify_direct_monitor(struct usb_mixer_interface *mixer) in scarlett2_notify_direct_monitor() argument
8356 struct snd_card *card = mixer->chip->card; in scarlett2_notify_direct_monitor()
8357 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_direct_monitor()
8378 static void scarlett2_notify_power_status(struct usb_mixer_interface *mixer) in scarlett2_notify_power_status() argument
8380 struct snd_card *card = mixer->chip->card; in scarlett2_notify_power_status()
8381 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_power_status()
8390 static void scarlett2_notify_mux(struct usb_mixer_interface *mixer) in scarlett2_notify_mux() argument
8392 struct snd_card *card = mixer->chip->card; in scarlett2_notify_mux()
8393 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_mux()
8404 static void scarlett2_notify_pcm_input_switch(struct usb_mixer_interface *mixer) in scarlett2_notify_pcm_input_switch() argument
8406 struct snd_card *card = mixer->chip->card; in scarlett2_notify_pcm_input_switch()
8407 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_pcm_input_switch()
8414 scarlett2_notify_mux(mixer); in scarlett2_notify_pcm_input_switch()
8418 static void scarlett2_notify_bluetooth(struct usb_mixer_interface *mixer) in scarlett2_notify_bluetooth() argument
8420 struct snd_card *card = mixer->chip->card; in scarlett2_notify_bluetooth()
8421 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_bluetooth()
8435 static void scarlett2_notify_ack(struct usb_mixer_interface *mixer) in scarlett2_notify_ack() argument
8437 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_ack()
8447 struct usb_mixer_interface *mixer = urb->context; in scarlett2_notify() local
8451 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify()
8470 notifications->func(mixer); in scarlett2_notify()
8476 usb_audio_warn(mixer->chip, in scarlett2_notify()
8484 urb->dev = mixer->chip->dev; in scarlett2_notify()
8493 static void scarlett2_private_free(struct usb_mixer_interface *mixer) in scarlett2_private_free() argument
8495 struct scarlett2_data *private = mixer->private_data; in scarlett2_private_free()
8499 mixer->private_data = NULL; in scarlett2_private_free()
8502 static void scarlett2_private_suspend(struct usb_mixer_interface *mixer) in scarlett2_private_suspend() argument
8504 struct scarlett2_data *private = mixer->private_data; in scarlett2_private_suspend()
8507 scarlett2_config_save(private->mixer); in scarlett2_private_suspend()
8593 static int scarlett2_init_private(struct usb_mixer_interface *mixer, in scarlett2_init_private() argument
8606 mixer->private_data = private; in scarlett2_init_private()
8607 mixer->private_free = scarlett2_private_free; in scarlett2_init_private()
8608 mixer->private_suspend = scarlett2_private_suspend; in scarlett2_init_private()
8615 private->mixer = mixer; in scarlett2_init_private()
8617 return scarlett2_find_fc_interface(mixer->chip->dev, private); in scarlett2_init_private()
8621 static int scarlett2_init_notify(struct usb_mixer_interface *mixer) in scarlett2_init_notify() argument
8623 struct usb_device *dev = mixer->chip->dev; in scarlett2_init_notify()
8624 struct scarlett2_data *private = mixer->private_data; in scarlett2_init_notify()
8628 if (mixer->urb) { in scarlett2_init_notify()
8629 usb_audio_err(mixer->chip, in scarlett2_init_notify()
8637 mixer->urb = usb_alloc_urb(0, GFP_KERNEL); in scarlett2_init_notify()
8638 if (!mixer->urb) in scarlett2_init_notify()
8645 usb_fill_int_urb(mixer->urb, dev, pipe, in scarlett2_init_notify()
8647 scarlett2_notify, mixer, private->bInterval); in scarlett2_init_notify()
8651 return usb_submit_urb(mixer->urb, GFP_KERNEL); in scarlett2_init_notify()
8655 static int scarlett2_usb_init(struct usb_mixer_interface *mixer) in scarlett2_usb_init() argument
8657 struct usb_device *dev = mixer->chip->dev; in scarlett2_usb_init()
8658 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_init()
8679 err = scarlett2_init_notify(mixer); in scarlett2_usb_init()
8693 err = scarlett2_usb(mixer, SCARLETT2_USB_INIT_1, NULL, 0, NULL, 0); in scarlett2_usb_init()
8699 err = scarlett2_usb(mixer, SCARLETT2_USB_INIT_2, in scarlett2_usb_init()
8707 usb_audio_info(mixer->chip, in scarlett2_usb_init()
8717 static int scarlett2_get_flash_segment_nums(struct usb_mixer_interface *mixer) in scarlett2_get_flash_segment_nums() argument
8719 struct scarlett2_data *private = mixer->private_data; in scarlett2_get_flash_segment_nums()
8734 err = scarlett2_usb(mixer, SCARLETT2_USB_INFO_FLASH, in scarlett2_get_flash_segment_nums()
8745 usb_audio_err(mixer->chip, in scarlett2_get_flash_segment_nums()
8754 err = scarlett2_usb(mixer, SCARLETT2_USB_INFO_SEGMENT, in scarlett2_get_flash_segment_nums()
8758 usb_audio_err(mixer->chip, in scarlett2_get_flash_segment_nums()
8783 usb_audio_err(mixer->chip, in scarlett2_get_flash_segment_nums()
8789 usb_audio_err(mixer->chip, in scarlett2_get_flash_segment_nums()
8799 static int scarlett2_read_configs(struct usb_mixer_interface *mixer) in scarlett2_read_configs() argument
8801 struct scarlett2_data *private = mixer->private_data; in scarlett2_read_configs()
8807 mixer, SCARLETT2_CONFIG_MSD_SWITCH, in scarlett2_read_configs()
8814 usb_audio_err(mixer->chip, in scarlett2_read_configs()
8827 err = scarlett2_update_input_level(mixer); in scarlett2_read_configs()
8831 err = scarlett2_update_input_pad(mixer); in scarlett2_read_configs()
8835 err = scarlett2_update_input_air(mixer); in scarlett2_read_configs()
8839 err = scarlett2_update_input_dsp(mixer); in scarlett2_read_configs()
8843 err = scarlett2_update_compressor_values(mixer); in scarlett2_read_configs()
8847 err = scarlett2_update_filter_values(mixer); in scarlett2_read_configs()
8851 err = scarlett2_update_input_mute(mixer); in scarlett2_read_configs()
8855 err = scarlett2_update_input_phantom(mixer); in scarlett2_read_configs()
8859 err = scarlett2_update_direct_monitor(mixer); in scarlett2_read_configs()
8867 err = scarlett2_update_monitor_mix(mixer); in scarlett2_read_configs()
8871 err = scarlett2_update_monitor_other(mixer); in scarlett2_read_configs()
8878 mixer, SCARLETT2_CONFIG_STANDALONE_SWITCH, in scarlett2_read_configs()
8886 err = scarlett2_update_power_status(mixer); in scarlett2_read_configs()
8891 err = scarlett2_update_sync(mixer); in scarlett2_read_configs()
8901 mixer, SCARLETT2_CONFIG_LINE_OUT_VOLUME, in scarlett2_read_configs()
8913 mixer, SCARLETT2_CONFIG_MUTE_SWITCH, in scarlett2_read_configs()
8926 mixer, SCARLETT2_CONFIG_SW_HW_SWITCH, in scarlett2_read_configs()
8938 err = scarlett2_update_volumes(mixer); in scarlett2_read_configs()
8942 err = scarlett2_update_dim_mute(mixer); in scarlett2_read_configs()
8946 err = scarlett2_update_input_select(mixer); in scarlett2_read_configs()
8950 err = scarlett2_update_input_gain(mixer); in scarlett2_read_configs()
8954 err = scarlett2_update_autogain(mixer); in scarlett2_read_configs()
8958 err = scarlett2_update_input_safe(mixer); in scarlett2_read_configs()
8964 err = scarlett2_update_pcm_input_switch(mixer); in scarlett2_read_configs()
8969 err = scarlett2_update_bluetooth_volume(mixer); in scarlett2_read_configs()
8973 err = scarlett2_update_spdif_mode(mixer); in scarlett2_read_configs()
8977 err = scarlett2_update_mix(mixer); in scarlett2_read_configs()
8981 return scarlett2_usb_get_mux(mixer); in scarlett2_read_configs()
8985 struct usb_mixer_interface *mixer) in get_scarlett2_device_entry() argument
8990 while (entry->usb_id && entry->usb_id != mixer->chip->usb_id) in get_scarlett2_device_entry()
8999 struct usb_mixer_interface *mixer, in snd_scarlett2_controls_create() argument
9006 err = scarlett2_init_private(mixer, entry); in snd_scarlett2_controls_create()
9010 private = mixer->private_data; in snd_scarlett2_controls_create()
9013 err = scarlett2_usb_init(mixer); in snd_scarlett2_controls_create()
9018 err = scarlett2_get_flash_segment_nums(mixer); in snd_scarlett2_controls_create()
9023 err = scarlett2_add_firmware_version_ctl(mixer); in snd_scarlett2_controls_create()
9028 err = scarlett2_add_min_firmware_version_ctl(mixer); in snd_scarlett2_controls_create()
9033 err = scarlett2_read_configs(mixer); in snd_scarlett2_controls_create()
9038 err = scarlett2_add_msd_ctl(mixer); in snd_scarlett2_controls_create()
9050 err = scarlett2_add_line_out_ctls(mixer); in snd_scarlett2_controls_create()
9055 err = scarlett2_add_line_in_ctls(mixer); in snd_scarlett2_controls_create()
9060 err = scarlett2_add_mux_enums(mixer); in snd_scarlett2_controls_create()
9065 err = scarlett2_add_mixer_ctls(mixer); in snd_scarlett2_controls_create()
9070 err = scarlett2_add_meter_ctl(mixer); in snd_scarlett2_controls_create()
9075 err = scarlett2_add_sync_ctl(mixer); in snd_scarlett2_controls_create()
9080 err = scarlett2_add_direct_monitor_ctls(mixer); in snd_scarlett2_controls_create()
9085 err = scarlett2_add_speaker_switch_ctl(mixer); in snd_scarlett2_controls_create()
9090 err = scarlett2_add_talkback_ctls(mixer); in snd_scarlett2_controls_create()
9095 err = scarlett2_add_standalone_ctl(mixer); in snd_scarlett2_controls_create()
9100 err = scarlett2_add_power_status_ctl(mixer); in snd_scarlett2_controls_create()
9105 err = scarlett2_add_bluetooth_volume_ctl(mixer); in snd_scarlett2_controls_create()
9110 err = scarlett2_add_spdif_mode_ctl(mixer); in snd_scarlett2_controls_create()
9118 scarlett2_autogain_update_access(mixer); in snd_scarlett2_controls_create()
9119 scarlett2_phantom_update_access(mixer); in snd_scarlett2_controls_create()
9141 static int scarlett2_get_erase_progress(struct usb_mixer_interface *mixer) in scarlett2_get_erase_progress() argument
9143 struct scarlett2_data *private = mixer->private_data; in scarlett2_get_erase_progress()
9163 err = scarlett2_usb(mixer, SCARLETT2_USB_GET_ERASE, in scarlett2_get_erase_progress()
9176 static int scarlett2_wait_for_erase(struct usb_mixer_interface *mixer) in scarlett2_wait_for_erase() argument
9181 err = scarlett2_get_erase_progress(mixer); in scarlett2_wait_for_erase()
9197 static int scarlett2_reboot(struct usb_mixer_interface *mixer) in scarlett2_reboot() argument
9199 struct scarlett2_data *private = mixer->private_data; in scarlett2_reboot()
9203 int err = scarlett2_wait_for_erase(mixer); in scarlett2_reboot()
9209 return scarlett2_usb(mixer, SCARLETT2_USB_REBOOT, NULL, 0, NULL, 0); in scarlett2_reboot()
9214 struct usb_mixer_interface *mixer, in scarlett2_ioctl_select_flash_segment() argument
9217 struct scarlett2_data *private = mixer->private_data; in scarlett2_ioctl_select_flash_segment()
9230 usb_audio_err(mixer->chip, in scarlett2_ioctl_select_flash_segment()
9238 int err = scarlett2_wait_for_erase(mixer); in scarlett2_ioctl_select_flash_segment()
9253 struct usb_mixer_interface *mixer) in scarlett2_ioctl_erase_flash_segment() argument
9255 struct scarlett2_data *private = mixer->private_data; in scarlett2_ioctl_erase_flash_segment()
9282 err = scarlett2_usb(mixer, SCARLETT2_USB_ERASE_SEGMENT, in scarlett2_ioctl_erase_flash_segment()
9296 struct usb_mixer_interface *mixer, in scarlett2_ioctl_get_erase_progress() argument
9299 struct scarlett2_data *private = mixer->private_data; in scarlett2_ioctl_get_erase_progress()
9324 err = scarlett2_usb(mixer, SCARLETT2_USB_GET_ERASE, in scarlett2_ioctl_get_erase_progress()
9347 struct usb_mixer_interface *mixer = hw->private_data; in scarlett2_hwdep_open() local
9348 struct scarlett2_data *private = mixer->private_data; in scarlett2_hwdep_open()
9353 int err = scarlett2_wait_for_erase(mixer); in scarlett2_hwdep_open()
9368 struct usb_mixer_interface *mixer = hw->private_data; in scarlett2_hwdep_ioctl() local
9377 return scarlett2_reboot(mixer); in scarlett2_hwdep_ioctl()
9380 return scarlett2_ioctl_select_flash_segment(mixer, arg); in scarlett2_hwdep_ioctl()
9383 return scarlett2_ioctl_erase_flash_segment(mixer); in scarlett2_hwdep_ioctl()
9386 return scarlett2_ioctl_get_erase_progress(mixer, arg); in scarlett2_hwdep_ioctl()
9397 struct usb_mixer_interface *mixer = hw->private_data; in scarlett2_hwdep_read() local
9398 struct scarlett2_data *private = mixer->private_data; in scarlett2_hwdep_read()
9452 err = scarlett2_usb(mixer, SCARLETT2_USB_READ_SEGMENT, in scarlett2_hwdep_read()
9475 struct usb_mixer_interface *mixer = hw->private_data; in scarlett2_hwdep_write() local
9476 struct scarlett2_data *private = mixer->private_data; in scarlett2_hwdep_write()
9495 err = scarlett2_wait_for_erase(mixer); in scarlett2_hwdep_write()
9545 err = scarlett2_usb(mixer, SCARLETT2_USB_WRITE_SEGMENT, in scarlett2_hwdep_write()
9560 struct usb_mixer_interface *mixer = hw->private_data; in scarlett2_hwdep_release() local
9561 struct scarlett2_data *private = mixer->private_data; in scarlett2_hwdep_release()
9574 static int scarlett2_hwdep_init(struct usb_mixer_interface *mixer) in scarlett2_hwdep_init() argument
9579 err = snd_hwdep_new(mixer->chip->card, "Focusrite Control", 0, &hw); in scarlett2_hwdep_init()
9583 hw->private_data = mixer; in scarlett2_hwdep_init()
9594 int snd_scarlett2_init(struct usb_mixer_interface *mixer) in snd_scarlett2_init() argument
9596 struct snd_usb_audio *chip = mixer->chip; in snd_scarlett2_init()
9601 if (!mixer->protocol) in snd_scarlett2_init()
9605 entry = get_scarlett2_device_entry(mixer); in snd_scarlett2_init()
9607 usb_audio_err(mixer->chip, in snd_scarlett2_init()
9634 err = snd_scarlett2_controls_create(mixer, entry); in snd_scarlett2_init()
9636 usb_audio_err(mixer->chip, in snd_scarlett2_init()
9643 err = scarlett2_hwdep_init(mixer); in snd_scarlett2_init()
9645 usb_audio_err(mixer->chip, in snd_scarlett2_init()