Lines Matching full:private

2290 static void scarlett2_fill_request_header(struct scarlett2_data *private,  in scarlett2_fill_request_header()  argument
2295 u16 seq = private->scarlett2_seq++; in scarlett2_fill_request_header()
2327 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb() local
2346 mutex_lock(&private->usb_mutex); in scarlett2_usb()
2350 scarlett2_fill_request_header(private, req, cmd, req_size); in scarlett2_usb()
2355 err = scarlett2_usb_tx(dev, private->bInterfaceNumber, in scarlett2_usb()
2362 private->series_name, cmd, err); in scarlett2_usb()
2367 if (!wait_for_completion_timeout(&private->cmd_done, in scarlett2_usb()
2372 private->series_name, cmd); in scarlett2_usb()
2380 err = scarlett2_usb_rx(dev, private->bInterfaceNumber, in scarlett2_usb()
2400 private->series_name, cmd, err, resp_buf_size); in scarlett2_usb()
2419 private->series_name, in scarlett2_usb()
2433 mutex_unlock(&private->usb_mutex); in scarlett2_usb()
2460 struct scarlett2_data *private, int config_item_num) in scarlett2_has_config_item() argument
2462 return !!private->config_set->items[config_item_num].offset; in scarlett2_has_config_item()
2470 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_get_config() local
2472 &private->config_set->items[config_item_num]; in scarlett2_usb_get_config()
2527 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_data() local
2537 return scarlett2_usb(private->mixer, SCARLETT2_USB_SET_DATA, in scarlett2_usb_set_data()
2550 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_data_buf() local
2582 err = scarlett2_usb(private->mixer, SCARLETT2_USB_SET_DATA, in scarlett2_usb_set_data_buf()
2610 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_config() local
2611 const struct scarlett2_config_set *config_set = private->config_set; in scarlett2_usb_set_config()
2650 cancel_delayed_work_sync(&private->work); in scarlett2_usb_set_config()
2698 schedule_delayed_work(&private->work, msecs_to_jiffies(2000)); in scarlett2_usb_set_config()
2710 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_config_buf() local
2711 const struct scarlett2_config_set *config_set = private->config_set; in scarlett2_usb_set_config_buf()
2757 struct scarlett2_data *private = in scarlett2_config_save_work() local
2760 scarlett2_config_save(private->mixer); in scarlett2_config_save_work()
2781 static int scarlett2_has_mixer(struct scarlett2_data *private) in scarlett2_has_mixer() argument
2783 return !!private->info->mux_assignment[0][0].count; in scarlett2_has_mixer()
2800 * and put the values into private->mix[]
2805 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_get_mix() local
2807 int num_mixer_in = private->num_mix_in; in scarlett2_usb_get_mix()
2827 private->mix[j] = scarlett2_mixer_value_to_db( in scarlett2_usb_get_mix()
2834 * (values obtained from private->mix[])
2839 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_mix() local
2847 int num_mixer_in = private->num_mix_in; in scarlett2_usb_set_mix()
2853 scarlett2_mixer_values[private->mix[j]] in scarlett2_usb_set_mix()
2901 /* Convert one mux entry from the interface and load into private->mux[] */
2902 static void scarlett2_usb_populate_mux(struct scarlett2_data *private, in scarlett2_usb_populate_mux() argument
2905 const struct scarlett2_device_info *info = private->info; in scarlett2_usb_populate_mux()
2915 if (dst_idx >= private->num_mux_dsts) { in scarlett2_usb_populate_mux()
2916 usb_audio_err(private->mixer->chip, in scarlett2_usb_populate_mux()
2918 mux_entry, dst_idx, private->num_mux_dsts); in scarlett2_usb_populate_mux()
2927 if (src_idx >= private->num_mux_srcs) { in scarlett2_usb_populate_mux()
2928 usb_audio_err(private->mixer->chip, in scarlett2_usb_populate_mux()
2930 mux_entry, src_idx, private->num_mux_srcs); in scarlett2_usb_populate_mux()
2934 private->mux[dst_idx] = src_idx; in scarlett2_usb_populate_mux()
2955 static void scarlett2_update_meter_level_map(struct scarlett2_data *private) in scarlett2_update_meter_level_map() argument
2957 const struct scarlett2_device_info *info = private->info; in scarlett2_update_meter_level_map()
2986 mux_idx < private->num_line_out in scarlett2_update_meter_level_map()
2995 int mux_src = private->mux[mux_idx]; in scarlett2_update_meter_level_map()
3001 private->meter_level_map[map_mux_idx] = in scarlett2_update_meter_level_map()
3007 /* Send USB message to get mux inputs and then populate private->mux[] */
3010 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_get_mux() local
3011 int count = private->num_mux_dsts; in scarlett2_usb_get_mux()
3021 private->mux_updated = 0; in scarlett2_usb_get_mux()
3033 scarlett2_usb_populate_mux(private, le32_to_cpu(data[i])); in scarlett2_usb_get_mux()
3035 scarlett2_update_meter_level_map(private); in scarlett2_usb_get_mux()
3043 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_mux() local
3044 const struct scarlett2_device_info *info = private->info; in scarlett2_usb_set_mux()
3089 port_count, private->mux[mux_idx++]); in scarlett2_usb_set_mux()
3103 scarlett2_update_meter_level_map(private); in scarlett2_usb_set_mux()
3196 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_firmware_version_ctl_get() local
3198 ucontrol->value.integer.value[0] = private->firmware_version; in scarlett2_firmware_version_ctl_get()
3235 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_min_firmware_version_ctl_get() local
3237 ucontrol->value.integer.value[0] = private->info->min_firmware_version; in scarlett2_min_firmware_version_ctl_get()
3274 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_sync() local
3276 private->sync_updated = 0; in scarlett2_update_sync()
3277 return scarlett2_usb_get_sync_status(mixer, &private->sync); in scarlett2_update_sync()
3294 struct scarlett2_data *private = mixer->private_data; in scarlett2_sync_ctl_get() local
3297 mutex_lock(&private->data_mutex); in scarlett2_sync_ctl_get()
3299 if (private->hwdep_in_use) { in scarlett2_sync_ctl_get()
3304 if (private->sync_updated) { in scarlett2_sync_ctl_get()
3309 ucontrol->value.enumerated.item[0] = private->sync; in scarlett2_sync_ctl_get()
3312 mutex_unlock(&private->data_mutex); in scarlett2_sync_ctl_get()
3326 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_sync_ctl() local
3329 if (!scarlett2_has_mixer(private)) in scarlett2_add_sync_ctl()
3333 0, 1, "Sync Status", &private->sync_ctl); in scarlett2_add_sync_ctl()
3354 static int scarlett2_autogain_is_running(struct scarlett2_data *private) in scarlett2_autogain_is_running() argument
3359 for (i = 0; i < private->info->gain_input_count; i++) in scarlett2_autogain_is_running()
3360 if (!private->autogain_status[i]) in scarlett2_autogain_is_running()
3368 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_autogain() local
3369 const struct scarlett2_device_info *info = private->info; in scarlett2_update_autogain()
3374 private->autogain_updated = 0; in scarlett2_update_autogain()
3381 info->gain_input_count, private->autogain_switch); in scarlett2_update_autogain()
3401 if (private->autogain_switch[i]) in scarlett2_update_autogain()
3402 private->autogain_status[i] = 0; in scarlett2_update_autogain()
3404 private->num_autogain_status_texts - 1) in scarlett2_update_autogain()
3405 private->autogain_status[i] = in scarlett2_update_autogain()
3408 private->autogain_status[i] = in scarlett2_update_autogain()
3409 private->num_autogain_status_texts - 1; in scarlett2_update_autogain()
3413 if (scarlett2_has_config_item(private, in scarlett2_update_autogain()
3424 private->ag_targets[i] = -ag_target_values[i]; in scarlett2_update_autogain()
3432 struct scarlett2_data *private = mixer->private_data; in scarlett2_autogain_update_access() local
3433 const struct scarlett2_device_info *info = private->info; in scarlett2_autogain_update_access()
3434 int val = !scarlett2_autogain_is_running(private); in scarlett2_autogain_update_access()
3437 if (scarlett2_has_config_item(private, in scarlett2_autogain_update_access()
3439 scarlett2_set_ctl_access(private->input_select_ctl, val); in scarlett2_autogain_update_access()
3440 if (scarlett2_has_config_item(private, in scarlett2_autogain_update_access()
3443 scarlett2_set_ctl_access(private->input_link_ctls[i], in scarlett2_autogain_update_access()
3446 scarlett2_set_ctl_access(private->input_gain_ctls[i], val); in scarlett2_autogain_update_access()
3448 scarlett2_set_ctl_access(private->safe_ctls[i], val); in scarlett2_autogain_update_access()
3450 scarlett2_set_ctl_access(private->level_ctls[i], val); in scarlett2_autogain_update_access()
3452 scarlett2_set_ctl_access(private->air_ctls[i], val); in scarlett2_autogain_update_access()
3454 scarlett2_set_ctl_access(private->input_mute_ctls[i], val); in scarlett2_autogain_update_access()
3456 scarlett2_set_ctl_access(private->phantom_ctls[i], val); in scarlett2_autogain_update_access()
3458 scarlett2_set_ctl_access(private->dsp_ctls[i], val); in scarlett2_autogain_update_access()
3461 if (scarlett2_has_config_item(private, in scarlett2_autogain_update_access()
3464 private->ag_target_ctls[i], val); in scarlett2_autogain_update_access()
3473 struct scarlett2_data *private = mixer->private_data; in scarlett2_autogain_notify_access() local
3474 const struct scarlett2_device_info *info = private->info; in scarlett2_autogain_notify_access()
3477 if (scarlett2_has_config_item(private, in scarlett2_autogain_notify_access()
3480 &private->input_select_ctl->id); in scarlett2_autogain_notify_access()
3481 if (scarlett2_has_config_item(private, in scarlett2_autogain_notify_access()
3485 &private->input_link_ctls[i]->id); in scarlett2_autogain_notify_access()
3488 &private->input_gain_ctls[i]->id); in scarlett2_autogain_notify_access()
3491 &private->safe_ctls[i]->id); in scarlett2_autogain_notify_access()
3494 &private->level_ctls[i]->id); in scarlett2_autogain_notify_access()
3497 &private->air_ctls[i]->id); in scarlett2_autogain_notify_access()
3500 &private->dsp_ctls[i]->id); in scarlett2_autogain_notify_access()
3503 &private->input_mute_ctls[i]->id); in scarlett2_autogain_notify_access()
3506 &private->phantom_ctls[i]->id); in scarlett2_autogain_notify_access()
3509 if (scarlett2_has_config_item(private, in scarlett2_autogain_notify_access()
3512 &private->ag_target_ctls[i]->id); in scarlett2_autogain_notify_access()
3521 struct scarlett2_data *private = mixer->private_data; in scarlett2_check_autogain_updated() local
3524 if (!private->autogain_updated) in scarlett2_check_autogain_updated()
3560 struct scarlett2_data *private = mixer->private_data; in scarlett2_autogain_switch_ctl_info() local
3563 mutex_lock(&private->data_mutex); in scarlett2_autogain_switch_ctl_info()
3572 mutex_unlock(&private->data_mutex); in scarlett2_autogain_switch_ctl_info()
3581 struct scarlett2_data *private = mixer->private_data; in scarlett2_autogain_switch_ctl_get() local
3584 mutex_lock(&private->data_mutex); in scarlett2_autogain_switch_ctl_get()
3586 if (private->hwdep_in_use) { in scarlett2_autogain_switch_ctl_get()
3596 private->autogain_switch[elem->control]; in scarlett2_autogain_switch_ctl_get()
3599 mutex_unlock(&private->data_mutex); in scarlett2_autogain_switch_ctl_get()
3608 struct scarlett2_data *private = mixer->private_data; in scarlett2_autogain_status_ctl_get() local
3611 mutex_lock(&private->data_mutex); in scarlett2_autogain_status_ctl_get()
3613 if (private->hwdep_in_use) { in scarlett2_autogain_status_ctl_get()
3623 private->autogain_status[elem->control]; in scarlett2_autogain_status_ctl_get()
3626 mutex_unlock(&private->data_mutex); in scarlett2_autogain_status_ctl_get()
3635 struct scarlett2_data *private = mixer->private_data; in scarlett2_autogain_switch_ctl_put() local
3640 mutex_lock(&private->data_mutex); in scarlett2_autogain_switch_ctl_put()
3642 if (private->hwdep_in_use) { in scarlett2_autogain_switch_ctl_put()
3651 if (scarlett2_phantom_is_switching(private, index)) { in scarlett2_autogain_switch_ctl_put()
3656 oval = private->autogain_switch[index]; in scarlett2_autogain_switch_ctl_put()
3662 private->autogain_switch[index] = val; in scarlett2_autogain_switch_ctl_put()
3674 mutex_unlock(&private->data_mutex); in scarlett2_autogain_switch_ctl_put()
3682 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_autogain_status_ctl_info() local
3686 private->num_autogain_status_texts, in scarlett2_autogain_status_ctl_info()
3687 private->config_set->autogain_status_texts); in scarlett2_autogain_status_ctl_info()
3713 struct scarlett2_data *private = mixer->private_data; in scarlett2_ag_target_ctl_info() local
3716 mutex_lock(&private->data_mutex); in scarlett2_ag_target_ctl_info()
3718 if (private->hwdep_in_use) { in scarlett2_ag_target_ctl_info()
3734 mutex_unlock(&private->data_mutex); in scarlett2_ag_target_ctl_info()
3743 struct scarlett2_data *private = mixer->private_data; in scarlett2_ag_target_ctl_get() local
3746 mutex_lock(&private->data_mutex); in scarlett2_ag_target_ctl_get()
3748 if (private->hwdep_in_use) { in scarlett2_ag_target_ctl_get()
3753 if (private->autogain_updated) { in scarlett2_ag_target_ctl_get()
3759 ucontrol->value.integer.value[0] = private->ag_targets[elem->control]; in scarlett2_ag_target_ctl_get()
3762 mutex_unlock(&private->data_mutex); in scarlett2_ag_target_ctl_get()
3771 struct scarlett2_data *private = mixer->private_data; in scarlett2_ag_target_ctl_put() local
3776 mutex_lock(&private->data_mutex); in scarlett2_ag_target_ctl_put()
3778 if (private->hwdep_in_use) { in scarlett2_ag_target_ctl_put()
3787 oval = private->ag_targets[index]; in scarlett2_ag_target_ctl_put()
3794 private->ag_targets[index] = val; in scarlett2_ag_target_ctl_put()
3803 mutex_unlock(&private->data_mutex); in scarlett2_ag_target_ctl_put()
3826 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_select() local
3827 const struct scarlett2_device_info *info = private->info; in scarlett2_update_input_select()
3831 private->input_select_updated = 0; in scarlett2_update_input_select()
3833 if (!scarlett2_has_config_item(private, in scarlett2_update_input_select()
3840 1, &private->input_select_switch); in scarlett2_update_input_select()
3846 link_count, private->input_link_switch); in scarlett2_update_input_select()
3851 if (private->input_link_switch[0]) in scarlett2_update_input_select()
3852 private->input_select_switch = 0; in scarlett2_update_input_select()
3862 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_select_ctl_get() local
3865 mutex_lock(&private->data_mutex); in scarlett2_input_select_ctl_get()
3867 if (private->hwdep_in_use) { in scarlett2_input_select_ctl_get()
3872 if (private->input_select_updated) { in scarlett2_input_select_ctl_get()
3877 ucontrol->value.enumerated.item[0] = private->input_select_switch; in scarlett2_input_select_ctl_get()
3880 mutex_unlock(&private->data_mutex); in scarlett2_input_select_ctl_get()
3889 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_select_ctl_put() local
3892 int max_val = private->input_link_switch[0] ? 0 : 1; in scarlett2_input_select_ctl_put()
3894 mutex_lock(&private->data_mutex); in scarlett2_input_select_ctl_put()
3896 if (private->hwdep_in_use) { in scarlett2_input_select_ctl_put()
3905 oval = private->input_select_switch; in scarlett2_input_select_ctl_put()
3916 private->input_select_switch = val; in scarlett2_input_select_ctl_put()
3919 if (!private->input_link_switch[0]) in scarlett2_input_select_ctl_put()
3927 mutex_unlock(&private->data_mutex); in scarlett2_input_select_ctl_put()
3936 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_select_ctl_info() local
3938 int inputs = private->info->gain_input_count; in scarlett2_input_select_ctl_info()
3946 mutex_lock(&private->data_mutex); in scarlett2_input_select_ctl_info()
3948 if (private->hwdep_in_use) { in scarlett2_input_select_ctl_info()
3961 if (private->input_link_switch[i / 2]) { in scarlett2_input_select_ctl_info()
3975 mutex_unlock(&private->data_mutex); in scarlett2_input_select_ctl_info()
4002 struct scarlett2_data *private = mixer->private_data; in scarlett2_autogain_disables_ctl_info() local
4005 mutex_lock(&private->data_mutex); in scarlett2_autogain_disables_ctl_info()
4007 if (private->hwdep_in_use) { in scarlett2_autogain_disables_ctl_info()
4019 mutex_unlock(&private->data_mutex); in scarlett2_autogain_disables_ctl_info()
4028 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_link_ctl_get() local
4031 mutex_lock(&private->data_mutex); in scarlett2_input_link_ctl_get()
4033 if (private->hwdep_in_use) { in scarlett2_input_link_ctl_get()
4038 if (private->input_select_updated) { in scarlett2_input_link_ctl_get()
4044 private->input_link_switch[elem->control]; in scarlett2_input_link_ctl_get()
4047 mutex_unlock(&private->data_mutex); in scarlett2_input_link_ctl_get()
4056 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_link_ctl_put() local
4061 mutex_lock(&private->data_mutex); in scarlett2_input_link_ctl_put()
4063 if (private->hwdep_in_use) { in scarlett2_input_link_ctl_put()
4072 oval = private->input_link_switch[index]; in scarlett2_input_link_ctl_put()
4078 private->input_link_switch[index] = val; in scarlett2_input_link_ctl_put()
4083 &private->input_select_ctl->id); in scarlett2_input_link_ctl_put()
4084 private->input_select_updated = 1; in scarlett2_input_link_ctl_put()
4096 mutex_unlock(&private->data_mutex); in scarlett2_input_link_ctl_put()
4112 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_gain() local
4113 const struct scarlett2_device_info *info = private->info; in scarlett2_update_input_gain()
4115 private->input_gain_updated = 0; in scarlett2_update_input_gain()
4122 info->gain_input_count, private->gain); in scarlett2_update_input_gain()
4130 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_gain_ctl_info() local
4133 mutex_lock(&private->data_mutex); in scarlett2_input_gain_ctl_info()
4135 if (private->hwdep_in_use) { in scarlett2_input_gain_ctl_info()
4151 mutex_unlock(&private->data_mutex); in scarlett2_input_gain_ctl_info()
4160 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_gain_ctl_get() local
4163 mutex_lock(&private->data_mutex); in scarlett2_input_gain_ctl_get()
4165 if (private->hwdep_in_use) { in scarlett2_input_gain_ctl_get()
4170 if (private->input_gain_updated) { in scarlett2_input_gain_ctl_get()
4176 private->gain[elem->control]; in scarlett2_input_gain_ctl_get()
4179 mutex_unlock(&private->data_mutex); in scarlett2_input_gain_ctl_get()
4188 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_gain_ctl_put() local
4193 mutex_lock(&private->data_mutex); in scarlett2_input_gain_ctl_put()
4195 if (private->hwdep_in_use) { in scarlett2_input_gain_ctl_put()
4204 oval = private->gain[index]; in scarlett2_input_gain_ctl_put()
4210 private->gain[index] = val; in scarlett2_input_gain_ctl_put()
4219 mutex_unlock(&private->data_mutex); in scarlett2_input_gain_ctl_put()
4238 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_safe() local
4239 const struct scarlett2_device_info *info = private->info; in scarlett2_update_input_safe()
4241 private->input_safe_updated = 0; in scarlett2_update_input_safe()
4248 info->safe_input_count, private->safe_switch); in scarlett2_update_input_safe()
4256 struct scarlett2_data *private = mixer->private_data; in scarlett2_safe_ctl_get() local
4259 mutex_lock(&private->data_mutex); in scarlett2_safe_ctl_get()
4261 if (private->hwdep_in_use) { in scarlett2_safe_ctl_get()
4266 if (private->input_safe_updated) { in scarlett2_safe_ctl_get()
4272 private->safe_switch[elem->control]; in scarlett2_safe_ctl_get()
4275 mutex_unlock(&private->data_mutex); in scarlett2_safe_ctl_get()
4284 struct scarlett2_data *private = mixer->private_data; in scarlett2_safe_ctl_put() local
4289 mutex_lock(&private->data_mutex); in scarlett2_safe_ctl_put()
4291 if (private->hwdep_in_use) { in scarlett2_safe_ctl_put()
4300 oval = private->safe_switch[index]; in scarlett2_safe_ctl_put()
4306 private->safe_switch[index] = val; in scarlett2_safe_ctl_put()
4315 mutex_unlock(&private->data_mutex); in scarlett2_safe_ctl_put()
4331 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_pcm_input_switch() local
4334 private->pcm_input_switch_updated = 0; in scarlett2_update_pcm_input_switch()
4338 1, &private->pcm_input_switch); in scarlett2_update_pcm_input_switch()
4350 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_pcm_input_switch_ctl_get() local
4353 mutex_lock(&private->data_mutex); in scarlett2_pcm_input_switch_ctl_get()
4355 if (private->pcm_input_switch_updated) { in scarlett2_pcm_input_switch_ctl_get()
4360 ucontrol->value.enumerated.item[0] = private->pcm_input_switch; in scarlett2_pcm_input_switch_ctl_get()
4363 mutex_unlock(&private->data_mutex); in scarlett2_pcm_input_switch_ctl_get()
4372 struct scarlett2_data *private = mixer->private_data; in scarlett2_pcm_input_switch_ctl_put() local
4376 mutex_lock(&private->data_mutex); in scarlett2_pcm_input_switch_ctl_put()
4378 if (private->hwdep_in_use) { in scarlett2_pcm_input_switch_ctl_put()
4383 oval = private->pcm_input_switch; in scarlett2_pcm_input_switch_ctl_put()
4389 private->pcm_input_switch = val; in scarlett2_pcm_input_switch_ctl_put()
4399 mutex_unlock(&private->data_mutex); in scarlett2_pcm_input_switch_ctl_put()
4429 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_volumes() local
4433 private->vol_updated = 0; in scarlett2_update_volumes()
4435 if (scarlett2_has_config_item(private, in scarlett2_update_volumes()
4443 private->master_vol = clamp(vol + SCARLETT2_VOLUME_BIAS, in scarlett2_update_volumes()
4446 if (scarlett2_has_config_item(private, in scarlett2_update_volumes()
4448 for (i = 0; i < private->num_line_out; i++) in scarlett2_update_volumes()
4449 if (private->vol_sw_hw_switch[i]) in scarlett2_update_volumes()
4450 private->vol[i] = private->master_vol; in scarlett2_update_volumes()
4453 if (scarlett2_has_config_item(private, in scarlett2_update_volumes()
4461 private->headphone_vol = clamp(vol + SCARLETT2_VOLUME_BIAS, in scarlett2_update_volumes()
4486 struct scarlett2_data *private = mixer->private_data; in scarlett2_master_volume_ctl_get() local
4489 mutex_lock(&private->data_mutex); in scarlett2_master_volume_ctl_get()
4491 if (private->hwdep_in_use) { in scarlett2_master_volume_ctl_get()
4496 if (private->vol_updated) { in scarlett2_master_volume_ctl_get()
4501 ucontrol->value.integer.value[0] = private->master_vol; in scarlett2_master_volume_ctl_get()
4504 mutex_unlock(&private->data_mutex); in scarlett2_master_volume_ctl_get()
4514 struct scarlett2_data *private = mixer->private_data; in scarlett2_headphone_volume_ctl_get() local
4517 mutex_lock(&private->data_mutex); in scarlett2_headphone_volume_ctl_get()
4519 if (private->hwdep_in_use) { in scarlett2_headphone_volume_ctl_get()
4524 if (private->vol_updated) { in scarlett2_headphone_volume_ctl_get()
4529 ucontrol->value.integer.value[0] = private->headphone_vol; in scarlett2_headphone_volume_ctl_get()
4532 mutex_unlock(&private->data_mutex); in scarlett2_headphone_volume_ctl_get()
4536 static int line_out_remap(struct scarlett2_data *private, int index) in line_out_remap() argument
4538 const struct scarlett2_device_info *info = private->info; in line_out_remap()
4543 if (index >= private->num_line_out) in line_out_remap()
4554 struct scarlett2_data *private = mixer->private_data; in scarlett2_volume_ctl_get() local
4555 int index = line_out_remap(private, elem->control); in scarlett2_volume_ctl_get()
4558 mutex_lock(&private->data_mutex); in scarlett2_volume_ctl_get()
4560 if (private->hwdep_in_use) { in scarlett2_volume_ctl_get()
4565 if (private->vol_updated) { in scarlett2_volume_ctl_get()
4570 ucontrol->value.integer.value[0] = private->vol[index]; in scarlett2_volume_ctl_get()
4573 mutex_unlock(&private->data_mutex); in scarlett2_volume_ctl_get()
4582 struct scarlett2_data *private = mixer->private_data; in scarlett2_volume_ctl_put() local
4583 int index = line_out_remap(private, elem->control); in scarlett2_volume_ctl_put()
4586 mutex_lock(&private->data_mutex); in scarlett2_volume_ctl_put()
4588 if (private->hwdep_in_use) { in scarlett2_volume_ctl_put()
4593 oval = private->vol[index]; in scarlett2_volume_ctl_put()
4599 private->vol[index] = val; in scarlett2_volume_ctl_put()
4606 mutex_unlock(&private->data_mutex); in scarlett2_volume_ctl_put()
4652 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_dim_mute() local
4656 private->dim_mute_updated = 0; in scarlett2_update_dim_mute()
4658 if (!scarlett2_has_config_item(private, SCARLETT2_CONFIG_SW_HW_SWITCH)) in scarlett2_update_dim_mute()
4663 SCARLETT2_DIM_MUTE_COUNT, private->dim_mute); in scarlett2_update_dim_mute()
4668 private->dim_mute[i] = !!private->dim_mute[i]; in scarlett2_update_dim_mute()
4670 mute = private->dim_mute[SCARLETT2_BUTTON_MUTE]; in scarlett2_update_dim_mute()
4672 for (i = 0; i < private->num_line_out; i++) in scarlett2_update_dim_mute()
4673 if (private->vol_sw_hw_switch[i]) in scarlett2_update_dim_mute()
4674 private->mute_switch[i] = mute; in scarlett2_update_dim_mute()
4684 struct scarlett2_data *private = mixer->private_data; in scarlett2_mute_ctl_get() local
4685 int index = line_out_remap(private, elem->control); in scarlett2_mute_ctl_get()
4688 mutex_lock(&private->data_mutex); in scarlett2_mute_ctl_get()
4690 if (private->hwdep_in_use) { in scarlett2_mute_ctl_get()
4695 if (private->dim_mute_updated) { in scarlett2_mute_ctl_get()
4700 ucontrol->value.integer.value[0] = private->mute_switch[index]; in scarlett2_mute_ctl_get()
4703 mutex_unlock(&private->data_mutex); in scarlett2_mute_ctl_get()
4712 struct scarlett2_data *private = mixer->private_data; in scarlett2_mute_ctl_put() local
4713 int index = line_out_remap(private, elem->control); in scarlett2_mute_ctl_put()
4716 mutex_lock(&private->data_mutex); in scarlett2_mute_ctl_put()
4718 if (private->hwdep_in_use) { in scarlett2_mute_ctl_put()
4723 oval = private->mute_switch[index]; in scarlett2_mute_ctl_put()
4729 private->mute_switch[index] = val; in scarlett2_mute_ctl_put()
4738 mutex_unlock(&private->data_mutex); in scarlett2_mute_ctl_put()
4752 static void scarlett2_sw_hw_ctl_ro(struct scarlett2_data *private, int index) in scarlett2_sw_hw_ctl_ro() argument
4754 private->sw_hw_ctls[index]->vd[0].access &= in scarlett2_sw_hw_ctl_ro()
4758 static void scarlett2_sw_hw_ctl_rw(struct scarlett2_data *private, int index) in scarlett2_sw_hw_ctl_rw() argument
4760 private->sw_hw_ctls[index]->vd[0].access |= in scarlett2_sw_hw_ctl_rw()
4778 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_sw_hw_enum_ctl_get() local
4779 int index = line_out_remap(private, elem->control); in scarlett2_sw_hw_enum_ctl_get()
4781 ucontrol->value.enumerated.item[0] = private->vol_sw_hw_switch[index]; in scarlett2_sw_hw_enum_ctl_get()
4788 struct scarlett2_data *private = mixer->private_data; in scarlett2_vol_ctl_set_writable() local
4793 private->vol_ctls[index]->vd[0].access |= in scarlett2_vol_ctl_set_writable()
4795 private->mute_ctls[index]->vd[0].access |= in scarlett2_vol_ctl_set_writable()
4798 private->vol_ctls[index]->vd[0].access &= in scarlett2_vol_ctl_set_writable()
4800 private->mute_ctls[index]->vd[0].access &= in scarlett2_vol_ctl_set_writable()
4807 &private->vol_ctls[index]->id); in scarlett2_vol_ctl_set_writable()
4810 &private->mute_ctls[index]->id); in scarlett2_vol_ctl_set_writable()
4816 struct scarlett2_data *private = mixer->private_data; in scarlett2_sw_hw_change() local
4817 int index = line_out_remap(private, ctl_index); in scarlett2_sw_hw_change()
4820 private->vol_sw_hw_switch[index] = val; in scarlett2_sw_hw_change()
4828 private->vol[index] = private->master_vol; in scarlett2_sw_hw_change()
4829 private->mute_switch[index] = private->dim_mute[SCARLETT2_BUTTON_MUTE]; in scarlett2_sw_hw_change()
4834 index, private->master_vol - SCARLETT2_VOLUME_BIAS); in scarlett2_sw_hw_change()
4841 index, private->dim_mute[SCARLETT2_BUTTON_MUTE]); in scarlett2_sw_hw_change()
4855 struct scarlett2_data *private = mixer->private_data; in scarlett2_sw_hw_enum_ctl_put() local
4857 int index = line_out_remap(private, ctl_index); in scarlett2_sw_hw_enum_ctl_put()
4860 mutex_lock(&private->data_mutex); in scarlett2_sw_hw_enum_ctl_put()
4862 if (private->hwdep_in_use) { in scarlett2_sw_hw_enum_ctl_put()
4867 oval = private->vol_sw_hw_switch[index]; in scarlett2_sw_hw_enum_ctl_put()
4878 mutex_unlock(&private->data_mutex); in scarlett2_sw_hw_enum_ctl_put()
4894 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_level() local
4895 const struct scarlett2_device_info *info = private->info; in scarlett2_update_input_level()
4897 private->input_level_updated = 0; in scarlett2_update_input_level()
4905 private->level_switch); in scarlett2_update_input_level()
4916 struct scarlett2_data *private = mixer->private_data; in scarlett2_level_enum_ctl_info() local
4919 mutex_lock(&private->data_mutex); in scarlett2_level_enum_ctl_info()
4921 if (private->hwdep_in_use) { in scarlett2_level_enum_ctl_info()
4933 mutex_unlock(&private->data_mutex); in scarlett2_level_enum_ctl_info()
4942 struct scarlett2_data *private = mixer->private_data; in scarlett2_level_enum_ctl_get() local
4943 const struct scarlett2_device_info *info = private->info; in scarlett2_level_enum_ctl_get()
4948 mutex_lock(&private->data_mutex); in scarlett2_level_enum_ctl_get()
4950 if (private->hwdep_in_use) { in scarlett2_level_enum_ctl_get()
4955 if (private->input_level_updated) { in scarlett2_level_enum_ctl_get()
4961 private->level_switch[index]); in scarlett2_level_enum_ctl_get()
4964 mutex_unlock(&private->data_mutex); in scarlett2_level_enum_ctl_get()
4973 struct scarlett2_data *private = mixer->private_data; in scarlett2_level_enum_ctl_put() local
4974 const struct scarlett2_device_info *info = private->info; in scarlett2_level_enum_ctl_put()
4979 mutex_lock(&private->data_mutex); in scarlett2_level_enum_ctl_put()
4981 if (private->hwdep_in_use) { in scarlett2_level_enum_ctl_put()
4990 oval = private->level_switch[index]; in scarlett2_level_enum_ctl_put()
4996 private->level_switch[index] = val; in scarlett2_level_enum_ctl_put()
4999 if (private->config_set->items[SCARLETT2_CONFIG_LEVEL_SWITCH].mute) in scarlett2_level_enum_ctl_put()
5009 mutex_unlock(&private->data_mutex); in scarlett2_level_enum_ctl_put()
5025 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_pad() local
5026 const struct scarlett2_device_info *info = private->info; in scarlett2_update_input_pad()
5028 private->input_pad_updated = 0; in scarlett2_update_input_pad()
5035 info->pad_input_count, private->pad_switch); in scarlett2_update_input_pad()
5043 struct scarlett2_data *private = mixer->private_data; in scarlett2_pad_ctl_get() local
5046 mutex_lock(&private->data_mutex); in scarlett2_pad_ctl_get()
5048 if (private->hwdep_in_use) { in scarlett2_pad_ctl_get()
5053 if (private->input_pad_updated) { in scarlett2_pad_ctl_get()
5059 private->pad_switch[elem->control]; in scarlett2_pad_ctl_get()
5062 mutex_unlock(&private->data_mutex); in scarlett2_pad_ctl_get()
5071 struct scarlett2_data *private = mixer->private_data; in scarlett2_pad_ctl_put() local
5076 mutex_lock(&private->data_mutex); in scarlett2_pad_ctl_put()
5078 if (private->hwdep_in_use) { in scarlett2_pad_ctl_put()
5083 oval = private->pad_switch[index]; in scarlett2_pad_ctl_put()
5089 private->pad_switch[index] = val; in scarlett2_pad_ctl_put()
5098 mutex_unlock(&private->data_mutex); in scarlett2_pad_ctl_put()
5114 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_air() local
5115 const struct scarlett2_device_info *info = private->info; in scarlett2_update_input_air()
5117 private->input_air_updated = 0; in scarlett2_update_input_air()
5124 info->air_input_count, private->air_switch); in scarlett2_update_input_air()
5132 struct scarlett2_data *private = mixer->private_data; in scarlett2_air_ctl_get() local
5135 mutex_lock(&private->data_mutex); in scarlett2_air_ctl_get()
5137 if (private->hwdep_in_use) { in scarlett2_air_ctl_get()
5142 if (private->input_air_updated) { in scarlett2_air_ctl_get()
5147 ucontrol->value.integer.value[0] = private->air_switch[elem->control]; in scarlett2_air_ctl_get()
5150 mutex_unlock(&private->data_mutex); in scarlett2_air_ctl_get()
5159 struct scarlett2_data *private = mixer->private_data; in scarlett2_air_ctl_put() local
5164 mutex_lock(&private->data_mutex); in scarlett2_air_ctl_put()
5166 if (private->hwdep_in_use) { in scarlett2_air_ctl_put()
5175 oval = private->air_switch[index]; in scarlett2_air_ctl_put()
5181 private->air_switch[index] = val; in scarlett2_air_ctl_put()
5190 mutex_unlock(&private->data_mutex); in scarlett2_air_ctl_put()
5202 struct scarlett2_data *private = mixer->private_data; in scarlett2_air_with_drive_ctl_info() local
5205 mutex_lock(&private->data_mutex); in scarlett2_air_with_drive_ctl_info()
5207 if (private->hwdep_in_use) { in scarlett2_air_with_drive_ctl_info()
5219 mutex_unlock(&private->data_mutex); in scarlett2_air_with_drive_ctl_info()
5244 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_dsp() local
5245 const struct scarlett2_device_info *info = private->info; in scarlett2_update_input_dsp()
5247 private->input_dsp_updated = 0; in scarlett2_update_input_dsp()
5254 info->dsp_input_count, private->dsp_switch); in scarlett2_update_input_dsp()
5262 struct scarlett2_data *private = mixer->private_data; in scarlett2_dsp_ctl_get() local
5265 mutex_lock(&private->data_mutex); in scarlett2_dsp_ctl_get()
5267 if (private->hwdep_in_use) { in scarlett2_dsp_ctl_get()
5272 if (private->input_dsp_updated) { in scarlett2_dsp_ctl_get()
5277 ucontrol->value.integer.value[0] = private->dsp_switch[elem->control]; in scarlett2_dsp_ctl_get()
5280 mutex_unlock(&private->data_mutex); in scarlett2_dsp_ctl_get()
5289 struct scarlett2_data *private = mixer->private_data; in scarlett2_dsp_ctl_put() local
5294 mutex_lock(&private->data_mutex); in scarlett2_dsp_ctl_put()
5296 if (private->hwdep_in_use) { in scarlett2_dsp_ctl_put()
5305 oval = private->dsp_switch[index]; in scarlett2_dsp_ctl_put()
5311 private->dsp_switch[index] = val; in scarlett2_dsp_ctl_put()
5320 mutex_unlock(&private->data_mutex); in scarlett2_dsp_ctl_put()
5336 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_compressor_values() local
5337 const struct scarlett2_device_info *info = private->info; in scarlett2_update_compressor_values()
5346 private->compressor_values); in scarlett2_update_compressor_values()
5356 int val = private->compressor_values[idx]; in scarlett2_update_compressor_values()
5360 private->compressor_values[idx] = val; in scarlett2_update_compressor_values()
5371 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_compressor_ctl_get() local
5374 private->compressor_values[elem->control]; in scarlett2_compressor_ctl_get()
5383 struct scarlett2_data *private = mixer->private_data; in scarlett2_compressor_ctl_put() local
5391 mutex_lock(&private->data_mutex); in scarlett2_compressor_ctl_put()
5393 if (private->hwdep_in_use) { in scarlett2_compressor_ctl_put()
5402 oval = private->compressor_values[index]; in scarlett2_compressor_ctl_put()
5407 private->compressor_values[index] = val; in scarlett2_compressor_ctl_put()
5420 mixer, private->config_set->param_buf_addr + 1, 1, channel); in scarlett2_compressor_ctl_put()
5433 mutex_unlock(&private->data_mutex); in scarlett2_compressor_ctl_put()
5465 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_precomp_flt_switch_ctl_get() local
5467 ucontrol->value.integer.value[0] = private->precomp_flt_switch[elem->control]; in scarlett2_precomp_flt_switch_ctl_get()
5476 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_peq_flt_switch_ctl_get() local
5479 private->peq_flt_switch[elem->control]; in scarlett2_peq_flt_switch_ctl_get()
5489 struct scarlett2_data *private = mixer->private_data; in scarlett2_precomp_flt_switch_ctl_put() local
5492 mutex_lock(&private->data_mutex); in scarlett2_precomp_flt_switch_ctl_put()
5494 if (private->hwdep_in_use) { in scarlett2_precomp_flt_switch_ctl_put()
5499 oval = private->precomp_flt_switch[elem->control]; in scarlett2_precomp_flt_switch_ctl_put()
5505 private->precomp_flt_switch[elem->control] = val; in scarlett2_precomp_flt_switch_ctl_put()
5515 mutex_unlock(&private->data_mutex); in scarlett2_precomp_flt_switch_ctl_put()
5524 struct scarlett2_data *private = mixer->private_data; in scarlett2_peq_flt_switch_ctl_put() local
5527 mutex_lock(&private->data_mutex); in scarlett2_peq_flt_switch_ctl_put()
5529 if (private->hwdep_in_use) { in scarlett2_peq_flt_switch_ctl_put()
5534 oval = private->peq_flt_switch[elem->control]; in scarlett2_peq_flt_switch_ctl_put()
5540 private->peq_flt_switch[elem->control] = val; in scarlett2_peq_flt_switch_ctl_put()
5550 mutex_unlock(&private->data_mutex); in scarlett2_peq_flt_switch_ctl_put()
5572 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_filter_values() local
5573 const struct scarlett2_device_info *info = private->info; in scarlett2_update_filter_values()
5585 info->dsp_input_count, private->precomp_flt_switch); in scarlett2_update_filter_values()
5592 private->peq_flt_switch); in scarlett2_update_filter_values()
5602 private->precomp_flt_values); in scarlett2_update_filter_values()
5627 private->peq_flt_values[dst_idx] = in scarlett2_update_filter_values()
5638 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_precomp_flt_ctl_get() local
5645 private->precomp_flt_values[idx]; in scarlett2_precomp_flt_ctl_get()
5654 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_peq_flt_ctl_get() local
5661 private->peq_flt_values[idx]; in scarlett2_peq_flt_ctl_get()
5671 struct scarlett2_data *private = mixer->private_data; in scarlett2_precomp_flt_ctl_put() local
5676 mutex_lock(&private->data_mutex); in scarlett2_precomp_flt_ctl_put()
5678 if (private->hwdep_in_use) { in scarlett2_precomp_flt_ctl_put()
5689 oval = private->precomp_flt_values[index + i]; in scarlett2_precomp_flt_ctl_put()
5700 private->precomp_flt_values[index + i] = in scarlett2_precomp_flt_ctl_put()
5705 mixer, private->config_set->param_buf_addr, 1, index); in scarlett2_precomp_flt_ctl_put()
5712 &private->precomp_flt_values[index]); in scarlett2_precomp_flt_ctl_put()
5718 mutex_unlock(&private->data_mutex); in scarlett2_precomp_flt_ctl_put()
5727 struct scarlett2_data *private = mixer->private_data; in scarlett2_peq_flt_ctl_put() local
5728 const struct scarlett2_device_info *info = private->info; in scarlett2_peq_flt_ctl_put()
5739 mutex_lock(&private->data_mutex); in scarlett2_peq_flt_ctl_put()
5741 if (private->hwdep_in_use) { in scarlett2_peq_flt_ctl_put()
5752 oval = private->peq_flt_values[src_index + i]; in scarlett2_peq_flt_ctl_put()
5763 private->peq_flt_values[src_index + i] = in scarlett2_peq_flt_ctl_put()
5768 mixer, private->config_set->param_buf_addr, 1, dst_index); in scarlett2_peq_flt_ctl_put()
5775 &private->peq_flt_values[src_index]); in scarlett2_peq_flt_ctl_put()
5781 mutex_unlock(&private->data_mutex); in scarlett2_peq_flt_ctl_put()
5816 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_mute() local
5817 const struct scarlett2_device_info *info = private->info; in scarlett2_update_input_mute()
5819 private->input_mute_updated = 0; in scarlett2_update_input_mute()
5826 info->mute_input_count, private->input_mute_switch); in scarlett2_update_input_mute()
5834 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_mute_ctl_get() local
5837 mutex_lock(&private->data_mutex); in scarlett2_input_mute_ctl_get()
5839 if (private->hwdep_in_use) { in scarlett2_input_mute_ctl_get()
5844 if (private->input_mute_updated) { in scarlett2_input_mute_ctl_get()
5850 private->input_mute_switch[elem->control]; in scarlett2_input_mute_ctl_get()
5853 mutex_unlock(&private->data_mutex); in scarlett2_input_mute_ctl_get()
5862 struct scarlett2_data *private = mixer->private_data; in scarlett2_input_mute_ctl_put() local
5867 mutex_lock(&private->data_mutex); in scarlett2_input_mute_ctl_put()
5869 if (private->hwdep_in_use) { in scarlett2_input_mute_ctl_put()
5878 oval = private->input_mute_switch[index]; in scarlett2_input_mute_ctl_put()
5884 private->input_mute_switch[index] = val; in scarlett2_input_mute_ctl_put()
5894 mutex_unlock(&private->data_mutex); in scarlett2_input_mute_ctl_put()
5910 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_phantom() local
5911 const struct scarlett2_device_info *info = private->info; in scarlett2_update_input_phantom()
5914 private->input_phantom_updated = 0; in scarlett2_update_input_phantom()
5921 info->phantom_count, private->phantom_switch); in scarlett2_update_input_phantom()
5925 if (scarlett2_has_config_item(private, in scarlett2_update_input_phantom()
5929 1, &private->phantom_persistence); in scarlett2_update_input_phantom()
5939 struct scarlett2_data *private, int line_num) in scarlett2_phantom_is_switching() argument
5941 const struct scarlett2_device_info *info = private->info; in scarlett2_phantom_is_switching()
5944 return !!(private->phantom_switch[index] & 0x02); in scarlett2_phantom_is_switching()
5950 struct scarlett2_data *private = mixer->private_data; in scarlett2_phantom_update_access() local
5951 const struct scarlett2_device_info *info = private->info; in scarlett2_phantom_update_access()
5956 int val = !scarlett2_phantom_is_switching(private, i); in scarlett2_phantom_update_access()
5958 scarlett2_set_ctl_access(private->autogain_ctls[i], val); in scarlett2_phantom_update_access()
5968 struct scarlett2_data *private = mixer->private_data; in scarlett2_phantom_notify_access() local
5969 const struct scarlett2_device_info *info = private->info; in scarlett2_phantom_notify_access()
5974 &private->autogain_ctls[i]->id); in scarlett2_phantom_notify_access()
5983 struct scarlett2_data *private = mixer->private_data; in scarlett2_check_input_phantom_updated() local
5986 if (!private->input_phantom_updated) in scarlett2_check_input_phantom_updated()
6003 struct scarlett2_data *private = mixer->private_data; in scarlett2_phantom_ctl_get() local
6006 mutex_lock(&private->data_mutex); in scarlett2_phantom_ctl_get()
6008 if (private->hwdep_in_use) { in scarlett2_phantom_ctl_get()
6018 private->phantom_switch[elem->control]); in scarlett2_phantom_ctl_get()
6021 mutex_unlock(&private->data_mutex); in scarlett2_phantom_ctl_get()
6030 struct scarlett2_data *private = mixer->private_data; in scarlett2_phantom_ctl_put() local
6031 const struct scarlett2_device_info *info = private->info; in scarlett2_phantom_ctl_put()
6036 mutex_lock(&private->data_mutex); in scarlett2_phantom_ctl_put()
6038 if (private->hwdep_in_use) { in scarlett2_phantom_ctl_put()
6047 oval = private->phantom_switch[index]; in scarlett2_phantom_ctl_put()
6053 private->phantom_switch[index] = val; in scarlett2_phantom_ctl_put()
6056 if (private->config_set->items[SCARLETT2_CONFIG_PHANTOM_SWITCH].mute) in scarlett2_phantom_ctl_put()
6069 mutex_unlock(&private->data_mutex); in scarlett2_phantom_ctl_put()
6087 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_phantom_persistence_ctl_get() local
6089 ucontrol->value.integer.value[0] = private->phantom_persistence; in scarlett2_phantom_persistence_ctl_get()
6098 struct scarlett2_data *private = mixer->private_data; in scarlett2_phantom_persistence_ctl_put() local
6103 mutex_lock(&private->data_mutex); in scarlett2_phantom_persistence_ctl_put()
6105 if (private->hwdep_in_use) { in scarlett2_phantom_persistence_ctl_put()
6110 oval = private->phantom_persistence; in scarlett2_phantom_persistence_ctl_put()
6116 private->phantom_persistence = val; in scarlett2_phantom_persistence_ctl_put()
6125 mutex_unlock(&private->data_mutex); in scarlett2_phantom_persistence_ctl_put()
6141 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_monitor_other() local
6142 const struct scarlett2_device_info *info = private->info; in scarlett2_update_monitor_other()
6155 private->monitor_other_updated = 0; in scarlett2_update_monitor_other()
6176 private->speaker_switching_switch = 0; in scarlett2_update_monitor_other()
6178 private->speaker_switching_switch = monitor_other_switch[0] + 1; in scarlett2_update_monitor_other()
6185 private->talkback_switch = 0; in scarlett2_update_monitor_other()
6187 private->talkback_switch = monitor_other_switch[1] + 1; in scarlett2_update_monitor_other()
6194 for (i = 0; i < private->num_mix_out; i++, bitmap >>= 1) in scarlett2_update_monitor_other()
6195 private->talkback_map[i] = bitmap & 1; in scarlett2_update_monitor_other()
6216 struct scarlett2_data *private = mixer->private_data; in scarlett2_speaker_switch_enum_ctl_get() local
6219 mutex_lock(&private->data_mutex); in scarlett2_speaker_switch_enum_ctl_get()
6221 if (private->hwdep_in_use) { in scarlett2_speaker_switch_enum_ctl_get()
6226 if (private->monitor_other_updated) { in scarlett2_speaker_switch_enum_ctl_get()
6231 ucontrol->value.enumerated.item[0] = private->speaker_switching_switch; in scarlett2_speaker_switch_enum_ctl_get()
6234 mutex_unlock(&private->data_mutex); in scarlett2_speaker_switch_enum_ctl_get()
6244 struct scarlett2_data *private = mixer->private_data; in scarlett2_speaker_switch_enable() local
6248 int index = line_out_remap(private, i); in scarlett2_speaker_switch_enable()
6251 if (!private->vol_sw_hw_switch[index]) { in scarlett2_speaker_switch_enable()
6252 err = scarlett2_sw_hw_change(private->mixer, i, 1); in scarlett2_speaker_switch_enable()
6258 scarlett2_sw_hw_ctl_ro(private, i); in scarlett2_speaker_switch_enable()
6262 &private->sw_hw_ctls[i]->id); in scarlett2_speaker_switch_enable()
6268 private->speaker_switching_switched = 1; in scarlett2_speaker_switch_enable()
6279 struct scarlett2_data *private = mixer->private_data; in scarlett2_speaker_switch_disable() local
6284 scarlett2_sw_hw_ctl_rw(private, i); in scarlett2_speaker_switch_disable()
6286 &private->sw_hw_ctls[i]->id); in scarlett2_speaker_switch_disable()
6292 private->speaker_switching_switched = 1; in scarlett2_speaker_switch_disable()
6300 struct scarlett2_data *private = mixer->private_data; in scarlett2_speaker_switch_enum_ctl_put() local
6304 mutex_lock(&private->data_mutex); in scarlett2_speaker_switch_enum_ctl_put()
6306 if (private->hwdep_in_use) { in scarlett2_speaker_switch_enum_ctl_put()
6311 oval = private->speaker_switching_switch; in scarlett2_speaker_switch_enum_ctl_put()
6317 private->speaker_switching_switch = val; in scarlett2_speaker_switch_enum_ctl_put()
6343 mutex_unlock(&private->data_mutex); in scarlett2_speaker_switch_enum_ctl_put()
6357 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_speaker_switch_ctl() local
6358 const struct scarlett2_device_info *info = private->info; in scarlett2_add_speaker_switch_ctl()
6366 &private->speaker_switching_ctl); in scarlett2_add_speaker_switch_ctl()
6386 struct scarlett2_data *private = mixer->private_data; in scarlett2_talkback_enum_ctl_get() local
6389 mutex_lock(&private->data_mutex); in scarlett2_talkback_enum_ctl_get()
6391 if (private->hwdep_in_use) { in scarlett2_talkback_enum_ctl_get()
6396 if (private->monitor_other_updated) { in scarlett2_talkback_enum_ctl_get()
6401 ucontrol->value.enumerated.item[0] = private->talkback_switch; in scarlett2_talkback_enum_ctl_get()
6404 mutex_unlock(&private->data_mutex); in scarlett2_talkback_enum_ctl_get()
6413 struct scarlett2_data *private = mixer->private_data; in scarlett2_talkback_enum_ctl_put() local
6417 mutex_lock(&private->data_mutex); in scarlett2_talkback_enum_ctl_put()
6419 if (private->hwdep_in_use) { in scarlett2_talkback_enum_ctl_put()
6424 oval = private->talkback_switch; in scarlett2_talkback_enum_ctl_put()
6430 private->talkback_switch = val; in scarlett2_talkback_enum_ctl_put()
6447 mutex_unlock(&private->data_mutex); in scarlett2_talkback_enum_ctl_put()
6464 struct scarlett2_data *private = mixer->private_data; in scarlett2_talkback_map_ctl_get() local
6467 ucontrol->value.integer.value[0] = private->talkback_map[index]; in scarlett2_talkback_map_ctl_get()
6477 struct scarlett2_data *private = mixer->private_data; in scarlett2_talkback_map_ctl_put() local
6482 mutex_lock(&private->data_mutex); in scarlett2_talkback_map_ctl_put()
6484 if (private->hwdep_in_use) { in scarlett2_talkback_map_ctl_put()
6489 oval = private->talkback_map[index]; in scarlett2_talkback_map_ctl_put()
6495 private->talkback_map[index] = val; in scarlett2_talkback_map_ctl_put()
6497 for (i = 0; i < private->num_mix_out; i++) in scarlett2_talkback_map_ctl_put()
6498 bitmap |= private->talkback_map[i] << i; in scarlett2_talkback_map_ctl_put()
6507 mutex_unlock(&private->data_mutex); in scarlett2_talkback_map_ctl_put()
6521 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_talkback_ctls() local
6522 const struct scarlett2_device_info *info = private->info; in scarlett2_add_talkback_ctls()
6532 &private->talkback_ctl); in scarlett2_add_talkback_ctls()
6536 for (i = 0; i < private->num_mix_out; i++) { in scarlett2_add_talkback_ctls()
6555 struct scarlett2_data *private = mixer->private_data; in scarlett2_dim_mute_ctl_get() local
6558 mutex_lock(&private->data_mutex); in scarlett2_dim_mute_ctl_get()
6560 if (private->hwdep_in_use) { in scarlett2_dim_mute_ctl_get()
6565 if (private->dim_mute_updated) { in scarlett2_dim_mute_ctl_get()
6570 ucontrol->value.integer.value[0] = private->dim_mute[elem->control]; in scarlett2_dim_mute_ctl_get()
6573 mutex_unlock(&private->data_mutex); in scarlett2_dim_mute_ctl_get()
6582 struct scarlett2_data *private = mixer->private_data; in scarlett2_dim_mute_ctl_put() local
6586 mutex_lock(&private->data_mutex); in scarlett2_dim_mute_ctl_put()
6588 if (private->hwdep_in_use) { in scarlett2_dim_mute_ctl_put()
6593 oval = private->dim_mute[index]; in scarlett2_dim_mute_ctl_put()
6599 private->dim_mute[index] = val; in scarlett2_dim_mute_ctl_put()
6608 for (i = 0; i < private->num_line_out; i++) { in scarlett2_dim_mute_ctl_put()
6609 int line_index = line_out_remap(private, i); in scarlett2_dim_mute_ctl_put()
6611 if (private->vol_sw_hw_switch[line_index]) { in scarlett2_dim_mute_ctl_put()
6612 private->mute_switch[line_index] = val; in scarlett2_dim_mute_ctl_put()
6615 &private->mute_ctls[i]->id); in scarlett2_dim_mute_ctl_put()
6620 mutex_unlock(&private->data_mutex); in scarlett2_dim_mute_ctl_put()
6636 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_line_out_ctls() local
6637 const struct scarlett2_device_info *info = private->info; in scarlett2_add_line_out_ctls()
6642 if (scarlett2_has_config_item(private, in scarlett2_add_line_out_ctls()
6647 0, 1, s, &private->master_vol_ctl); in scarlett2_add_line_out_ctls()
6653 if (scarlett2_has_config_item(private, in scarlett2_add_line_out_ctls()
6659 &private->headphone_vol_ctl); in scarlett2_add_line_out_ctls()
6667 if (!scarlett2_has_config_item(private, in scarlett2_add_line_out_ctls()
6672 for (i = 0; i < private->num_line_out; i++) { in scarlett2_add_line_out_ctls()
6673 int index = line_out_remap(private, i); in scarlett2_add_line_out_ctls()
6686 i, 1, s, &private->vol_ctls[i]); in scarlett2_add_line_out_ctls()
6697 &private->mute_ctls[i]); in scarlett2_add_line_out_ctls()
6702 if (scarlett2_has_config_item(private, in scarlett2_add_line_out_ctls()
6708 if (private->vol_sw_hw_switch[index]) in scarlett2_add_line_out_ctls()
6717 &private->sw_hw_ctls[i]); in scarlett2_add_line_out_ctls()
6724 if (private->speaker_switching_switch && i < 4) in scarlett2_add_line_out_ctls()
6725 scarlett2_sw_hw_ctl_ro(private, i); in scarlett2_add_line_out_ctls()
6730 if (scarlett2_has_config_item(private, SCARLETT2_CONFIG_DIM_MUTE)) in scarlett2_add_line_out_ctls()
6735 &private->dim_mute_ctls[i]); in scarlett2_add_line_out_ctls()
6747 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_dsp_ctls() local
6748 const struct scarlett2_device_info *info = private->info; in scarlett2_add_dsp_ctls()
6764 1, s, &private->compressor_ctls[idx]); in scarlett2_add_dsp_ctls()
6773 i, 1, s, &private->precomp_flt_switch_ctls[i]); in scarlett2_add_dsp_ctls()
6780 i, 1, s, &private->peq_flt_switch_ctls[i]); in scarlett2_add_dsp_ctls()
6790 1, s, &private->precomp_flt_switch_ctls[j]); in scarlett2_add_dsp_ctls()
6800 1, s, &private->peq_flt_switch_ctls[j]); in scarlett2_add_dsp_ctls()
6810 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_line_in_ctls() local
6811 const struct scarlett2_device_info *info = private->info; in scarlett2_add_line_in_ctls()
6822 i, 1, s, &private->level_ctls[i]); in scarlett2_add_line_in_ctls()
6831 i, 1, s, &private->pad_ctls[i]); in scarlett2_add_line_in_ctls()
6842 i, 1, s, &private->air_ctls[i]); in scarlett2_add_line_in_ctls()
6851 i, 1, s, &private->dsp_ctls[i]); in scarlett2_add_line_in_ctls()
6865 i, 1, s, &private->input_mute_ctls[i]); in scarlett2_add_line_in_ctls()
6878 i, 1, s, &private->phantom_ctls[i]); in scarlett2_add_line_in_ctls()
6891 i, 1, s, &private->phantom_ctls[i]); in scarlett2_add_line_in_ctls()
6897 scarlett2_has_config_item(private, in scarlett2_add_line_in_ctls()
6907 if (scarlett2_has_config_item(private, in scarlett2_add_line_in_ctls()
6912 &private->input_select_ctl); in scarlett2_add_line_in_ctls()
6917 if (scarlett2_has_config_item(private, in scarlett2_add_line_in_ctls()
6925 i, 1, s, &private->input_link_ctls[i]); in scarlett2_add_line_in_ctls()
6937 i, 1, s, &private->input_gain_ctls[i]); in scarlett2_add_line_in_ctls()
6940 private->input_gain_ctls[i]->tlv.p = in scarlett2_add_line_in_ctls()
6941 private->config_set->input_gain_tlv; in scarlett2_add_line_in_ctls()
6947 i, 1, s, &private->autogain_ctls[i]); in scarlett2_add_line_in_ctls()
6955 i, 1, s, &private->autogain_status_ctls[i]); in scarlett2_add_line_in_ctls()
6960 if (scarlett2_has_config_item(private, in scarlett2_add_line_in_ctls()
6967 i, 1, s, &private->ag_target_ctls[i]); in scarlett2_add_line_in_ctls()
6978 i, 1, s, &private->safe_ctls[i]); in scarlett2_add_line_in_ctls()
6984 if (scarlett2_has_config_item(private, in scarlett2_add_line_in_ctls()
6989 &private->pcm_input_switch_ctl); in scarlett2_add_line_in_ctls()
7001 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_mix() local
7004 private->mix_updated = 0; in scarlett2_update_mix()
7006 for (i = 0; i < private->num_mix_out; i++) { in scarlett2_update_mix()
7033 struct scarlett2_data *private = mixer->private_data; in scarlett2_mixer_ctl_get() local
7036 mutex_lock(&private->data_mutex); in scarlett2_mixer_ctl_get()
7038 if (private->hwdep_in_use) { in scarlett2_mixer_ctl_get()
7043 if (private->mix_updated) { in scarlett2_mixer_ctl_get()
7048 ucontrol->value.integer.value[0] = private->mix[elem->control]; in scarlett2_mixer_ctl_get()
7051 mutex_unlock(&private->data_mutex); in scarlett2_mixer_ctl_get()
7060 struct scarlett2_data *private = mixer->private_data; in scarlett2_mixer_ctl_put() local
7064 mutex_lock(&private->data_mutex); in scarlett2_mixer_ctl_put()
7066 if (private->hwdep_in_use) { in scarlett2_mixer_ctl_put()
7071 oval = private->mix[index]; in scarlett2_mixer_ctl_put()
7074 mix_num = index / private->num_mix_in; in scarlett2_mixer_ctl_put()
7079 private->mix[index] = val; in scarlett2_mixer_ctl_put()
7085 mutex_unlock(&private->data_mutex); in scarlett2_mixer_ctl_put()
7109 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_mixer_ctls() local
7114 for (i = 0, index = 0; i < private->num_mix_out; i++) in scarlett2_add_mixer_ctls()
7115 for (j = 0; j < private->num_mix_in; j++, index++) { in scarlett2_add_mixer_ctls()
7121 &private->mix_ctls[index]); in scarlett2_add_mixer_ctls()
7133 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_direct_monitor() local
7135 private->direct_monitor_updated = 0; in scarlett2_update_direct_monitor()
7137 if (!private->info->direct_monitor) in scarlett2_update_direct_monitor()
7142 1, &private->direct_monitor_switch); in scarlett2_update_direct_monitor()
7147 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_monitor_mix() local
7151 if (!private->num_monitor_mix_ctls) in scarlett2_update_monitor_mix()
7156 private->num_monitor_mix_ctls, mix_values); in scarlett2_update_monitor_mix()
7160 for (i = 0; i < private->num_monitor_mix_ctls; i++) in scarlett2_update_monitor_mix()
7161 private->monitor_mix[i] = scarlett2_mixer_value_to_db( in scarlett2_update_monitor_mix()
7172 struct scarlett2_data *private = mixer->private_data; in scarlett2_direct_monitor_ctl_get() local
7175 mutex_lock(&private->data_mutex); in scarlett2_direct_monitor_ctl_get()
7177 if (private->hwdep_in_use) { in scarlett2_direct_monitor_ctl_get()
7182 if (private->direct_monitor_updated) { in scarlett2_direct_monitor_ctl_get()
7187 ucontrol->value.enumerated.item[0] = private->direct_monitor_switch; in scarlett2_direct_monitor_ctl_get()
7190 mutex_unlock(&private->data_mutex); in scarlett2_direct_monitor_ctl_get()
7199 struct scarlett2_data *private = mixer->private_data; in scarlett2_direct_monitor_ctl_put() local
7204 mutex_lock(&private->data_mutex); in scarlett2_direct_monitor_ctl_put()
7206 if (private->hwdep_in_use) { in scarlett2_direct_monitor_ctl_put()
7211 oval = private->direct_monitor_switch; in scarlett2_direct_monitor_ctl_put()
7217 private->direct_monitor_switch = val; in scarlett2_direct_monitor_ctl_put()
7226 mutex_unlock(&private->data_mutex); in scarlett2_direct_monitor_ctl_put()
7264 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_monitor_mix_ctl_get() local
7266 ucontrol->value.integer.value[0] = private->monitor_mix[elem->control]; in scarlett2_monitor_mix_ctl_get()
7276 struct scarlett2_data *private = mixer->private_data; in scarlett2_monitor_mix_ctl_put() local
7280 mutex_lock(&private->data_mutex); in scarlett2_monitor_mix_ctl_put()
7282 if (private->hwdep_in_use) { in scarlett2_monitor_mix_ctl_put()
7287 oval = private->monitor_mix[index]; in scarlett2_monitor_mix_ctl_put()
7294 private->monitor_mix[index] = val; in scarlett2_monitor_mix_ctl_put()
7302 mutex_unlock(&private->data_mutex); in scarlett2_monitor_mix_ctl_put()
7320 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_direct_monitor_ctls() local
7321 const struct scarlett2_device_info *info = private->info; in scarlett2_add_direct_monitor_ctls()
7334 0, 1, s, &private->direct_monitor_ctl); in scarlett2_add_direct_monitor_ctls()
7338 if (!private->num_monitor_mix_ctls) in scarlett2_add_direct_monitor_ctls()
7358 for (k = 0; k < private->num_mix_in; k++, index++) { in scarlett2_add_direct_monitor_ctls()
7381 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_mux_src_enum_ctl_info() local
7382 const struct scarlett2_device_info *info = private->info; in scarlett2_mux_src_enum_ctl_info()
7385 int items = private->num_mux_srcs; in scarlett2_mux_src_enum_ctl_info()
7403 item >= private->num_mix_out) in scarlett2_mux_src_enum_ctl_info()
7406 item - private->num_mix_out + 1); in scarlett2_mux_src_enum_ctl_info()
7425 struct scarlett2_data *private = mixer->private_data; in scarlett2_mux_src_enum_ctl_get() local
7426 int index = line_out_remap(private, elem->control); in scarlett2_mux_src_enum_ctl_get()
7429 mutex_lock(&private->data_mutex); in scarlett2_mux_src_enum_ctl_get()
7431 if (private->hwdep_in_use) { in scarlett2_mux_src_enum_ctl_get()
7436 if (private->mux_updated) { in scarlett2_mux_src_enum_ctl_get()
7441 ucontrol->value.enumerated.item[0] = private->mux[index]; in scarlett2_mux_src_enum_ctl_get()
7444 mutex_unlock(&private->data_mutex); in scarlett2_mux_src_enum_ctl_get()
7453 struct scarlett2_data *private = mixer->private_data; in scarlett2_mux_src_enum_ctl_put() local
7454 int index = line_out_remap(private, elem->control); in scarlett2_mux_src_enum_ctl_put()
7457 mutex_lock(&private->data_mutex); in scarlett2_mux_src_enum_ctl_put()
7459 if (private->hwdep_in_use) { in scarlett2_mux_src_enum_ctl_put()
7464 oval = private->mux[index]; in scarlett2_mux_src_enum_ctl_put()
7466 private->num_mux_srcs - 1U); in scarlett2_mux_src_enum_ctl_put()
7471 private->mux[index] = val; in scarlett2_mux_src_enum_ctl_put()
7477 mutex_unlock(&private->data_mutex); in scarlett2_mux_src_enum_ctl_put()
7491 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_mux_enums() local
7492 const struct scarlett2_device_info *info = private->info; in scarlett2_add_mux_enums()
7510 channel >= private->num_mix_in) { in scarlett2_add_mux_enums()
7511 channel_num -= private->num_mix_in; in scarlett2_add_mux_enums()
7521 &private->mux_ctls[i]); in scarlett2_add_mux_enums()
7550 struct scarlett2_data *private = mixer->private_data; in scarlett2_meter_ctl_get() local
7551 u8 *meter_level_map = private->meter_level_map; in scarlett2_meter_ctl_get()
7555 mutex_lock(&private->data_mutex); in scarlett2_meter_ctl_get()
7557 if (private->hwdep_in_use) { in scarlett2_meter_ctl_get()
7581 mutex_unlock(&private->data_mutex); in scarlett2_meter_ctl_get()
7596 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_meter_ctl() local
7599 if (!scarlett2_has_mixer(private)) in scarlett2_add_meter_ctl()
7603 0, private->num_mux_dsts, in scarlett2_add_meter_ctl()
7613 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_msd_ctl_get() local
7615 ucontrol->value.integer.value[0] = private->msd_switch; in scarlett2_msd_ctl_get()
7624 struct scarlett2_data *private = mixer->private_data; in scarlett2_msd_ctl_put() local
7628 mutex_lock(&private->data_mutex); in scarlett2_msd_ctl_put()
7630 if (private->hwdep_in_use) { in scarlett2_msd_ctl_put()
7635 oval = private->msd_switch; in scarlett2_msd_ctl_put()
7641 private->msd_switch = val; in scarlett2_msd_ctl_put()
7650 mutex_unlock(&private->data_mutex); in scarlett2_msd_ctl_put()
7664 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_msd_ctl() local
7666 if (!scarlett2_has_config_item(private, SCARLETT2_CONFIG_MSD_SWITCH)) in scarlett2_add_msd_ctl()
7670 if (!private->msd_switch && !(mixer->chip->setup & SCARLETT2_MSD_ENABLE)) in scarlett2_add_msd_ctl()
7684 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_standalone_ctl_get() local
7686 ucontrol->value.integer.value[0] = private->standalone_switch; in scarlett2_standalone_ctl_get()
7695 struct scarlett2_data *private = mixer->private_data; in scarlett2_standalone_ctl_put() local
7699 mutex_lock(&private->data_mutex); in scarlett2_standalone_ctl_put()
7701 if (private->hwdep_in_use) { in scarlett2_standalone_ctl_put()
7706 oval = private->standalone_switch; in scarlett2_standalone_ctl_put()
7712 private->standalone_switch = val; in scarlett2_standalone_ctl_put()
7722 mutex_unlock(&private->data_mutex); in scarlett2_standalone_ctl_put()
7736 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_standalone_ctl() local
7738 if (!scarlett2_has_config_item(private, in scarlett2_add_standalone_ctl()
7751 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_power_status() local
7755 private->power_status_updated = 0; in scarlett2_update_power_status()
7768 private->power_status = SCARLETT2_POWER_STATUS_FAIL; in scarlett2_update_power_status()
7770 private->power_status = SCARLETT2_POWER_STATUS_EXT; in scarlett2_update_power_status()
7772 private->power_status = SCARLETT2_POWER_STATUS_BUS; in scarlett2_update_power_status()
7782 struct scarlett2_data *private = mixer->private_data; in scarlett2_power_status_ctl_get() local
7785 mutex_lock(&private->data_mutex); in scarlett2_power_status_ctl_get()
7787 if (private->power_status_updated) { in scarlett2_power_status_ctl_get()
7792 ucontrol->value.integer.value[0] = private->power_status; in scarlett2_power_status_ctl_get()
7795 mutex_unlock(&private->data_mutex); in scarlett2_power_status_ctl_get()
7819 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_power_status_ctl() local
7821 if (!scarlett2_has_config_item(private, in scarlett2_add_power_status_ctl()
7828 &private->power_status_ctl); in scarlett2_add_power_status_ctl()
7835 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_bluetooth_volume() local
7838 private->bluetooth_updated = 0; in scarlett2_update_bluetooth_volume()
7840 if (!private->info->has_bluetooth) in scarlett2_update_bluetooth_volume()
7845 1, &private->bluetooth_volume); in scarlett2_update_bluetooth_volume()
7857 struct scarlett2_data *private = mixer->private_data; in scarlett2_bluetooth_volume_ctl_get() local
7860 mutex_lock(&private->data_mutex); in scarlett2_bluetooth_volume_ctl_get()
7862 if (private->hwdep_in_use) { in scarlett2_bluetooth_volume_ctl_get()
7867 if (private->bluetooth_updated) { in scarlett2_bluetooth_volume_ctl_get()
7872 ucontrol->value.integer.value[0] = private->bluetooth_volume; in scarlett2_bluetooth_volume_ctl_get()
7875 mutex_unlock(&private->data_mutex); in scarlett2_bluetooth_volume_ctl_get()
7884 struct scarlett2_data *private = mixer->private_data; in scarlett2_bluetooth_volume_ctl_put() local
7887 mutex_lock(&private->data_mutex); in scarlett2_bluetooth_volume_ctl_put()
7889 if (private->hwdep_in_use) { in scarlett2_bluetooth_volume_ctl_put()
7894 oval = private->bluetooth_volume; in scarlett2_bluetooth_volume_ctl_put()
7901 private->bluetooth_volume = val; in scarlett2_bluetooth_volume_ctl_put()
7909 mutex_unlock(&private->data_mutex); in scarlett2_bluetooth_volume_ctl_put()
7935 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_bluetooth_volume_ctl() local
7937 if (!private->info->has_bluetooth) in scarlett2_add_bluetooth_volume_ctl()
7943 &private->bluetooth_volume_ctl); in scarlett2_add_bluetooth_volume_ctl()
7950 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_spdif_mode() local
7953 const u8 *mode_values = private->info->spdif_mode_values; in scarlett2_update_spdif_mode()
7955 if (!private->info->spdif_mode_control_name) in scarlett2_update_spdif_mode()
7963 private->spdif_mode = 0; in scarlett2_update_spdif_mode()
7967 private->spdif_mode = i; in scarlett2_update_spdif_mode()
7978 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_spdif_mode_ctl_info() local
7979 const char * const *mode_texts = private->info->spdif_mode_texts; in scarlett2_spdif_mode_ctl_info()
7986 private->info->spdif_mode_texts); in scarlett2_spdif_mode_ctl_info()
7993 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_spdif_mode_ctl_get() local
7995 ucontrol->value.enumerated.item[0] = private->spdif_mode; in scarlett2_spdif_mode_ctl_get()
8004 struct scarlett2_data *private = mixer->private_data; in scarlett2_spdif_mode_ctl_put() local
8008 mutex_lock(&private->data_mutex); in scarlett2_spdif_mode_ctl_put()
8010 oval = private->spdif_mode; in scarlett2_spdif_mode_ctl_put()
8019 if (private->info->spdif_mode_values[i] == 0xff) { in scarlett2_spdif_mode_ctl_put()
8027 private->spdif_mode = val; in scarlett2_spdif_mode_ctl_put()
8031 private->info->spdif_mode_values[val]); in scarlett2_spdif_mode_ctl_put()
8036 mutex_unlock(&private->data_mutex); in scarlett2_spdif_mode_ctl_put()
8050 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_spdif_mode_ctl() local
8052 if (!private->info->spdif_mode_control_name) in scarlett2_add_spdif_mode_ctl()
8057 private->info->spdif_mode_control_name, in scarlett2_add_spdif_mode_ctl()
8066 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_sync() local
8068 private->sync_updated = 1; in scarlett2_notify_sync()
8071 &private->sync_ctl->id); in scarlett2_notify_sync()
8078 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_monitor() local
8081 if (!scarlett2_has_config_item(private, SCARLETT2_CONFIG_SW_HW_SWITCH)) in scarlett2_notify_monitor()
8084 private->vol_updated = 1; in scarlett2_notify_monitor()
8087 &private->master_vol_ctl->id); in scarlett2_notify_monitor()
8089 for (i = 0; i < private->num_line_out; i++) in scarlett2_notify_monitor()
8090 if (private->vol_sw_hw_switch[line_out_remap(private, i)]) in scarlett2_notify_monitor()
8092 &private->vol_ctls[i]->id); in scarlett2_notify_monitor()
8098 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_volume() local
8100 private->vol_updated = 1; in scarlett2_notify_volume()
8103 &private->master_vol_ctl->id); in scarlett2_notify_volume()
8105 &private->headphone_vol_ctl->id); in scarlett2_notify_volume()
8112 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_dim_mute() local
8115 if (!scarlett2_has_config_item(private, SCARLETT2_CONFIG_SW_HW_SWITCH)) in scarlett2_notify_dim_mute()
8118 private->dim_mute_updated = 1; in scarlett2_notify_dim_mute()
8122 &private->dim_mute_ctls[i]->id); in scarlett2_notify_dim_mute()
8124 for (i = 0; i < private->num_line_out; i++) in scarlett2_notify_dim_mute()
8125 if (private->vol_sw_hw_switch[line_out_remap(private, i)]) in scarlett2_notify_dim_mute()
8127 &private->mute_ctls[i]->id); in scarlett2_notify_dim_mute()
8134 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_level() local
8135 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_input_level()
8138 private->input_level_updated = 1; in scarlett2_notify_input_level()
8142 &private->level_ctls[i]->id); in scarlett2_notify_input_level()
8149 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_pad() local
8150 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_input_pad()
8153 private->input_pad_updated = 1; in scarlett2_notify_input_pad()
8157 &private->pad_ctls[i]->id); in scarlett2_notify_input_pad()
8164 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_air() local
8165 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_input_air()
8168 private->input_air_updated = 1; in scarlett2_notify_input_air()
8172 &private->air_ctls[i]->id); in scarlett2_notify_input_air()
8179 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_dsp() local
8180 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_input_dsp()
8183 private->input_dsp_updated = 1; in scarlett2_notify_input_dsp()
8187 &private->dsp_ctls[i]->id); in scarlett2_notify_input_dsp()
8194 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_mute() local
8195 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_input_mute()
8198 private->input_mute_updated = 1; in scarlett2_notify_input_mute()
8202 &private->input_mute_ctls[i]->id); in scarlett2_notify_input_mute()
8209 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_phantom() local
8210 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_input_phantom()
8213 private->input_phantom_updated = 1; in scarlett2_notify_input_phantom()
8217 &private->phantom_ctls[i]->id); in scarlett2_notify_input_phantom()
8235 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_select() local
8236 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_input_select()
8239 if (!scarlett2_has_config_item(private, in scarlett2_notify_input_select()
8243 private->input_select_updated = 1; in scarlett2_notify_input_select()
8247 &private->input_select_ctl->id); in scarlett2_notify_input_select()
8251 &private->input_link_ctls[i]->id); in scarlett2_notify_input_select()
8258 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_gain() local
8259 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_input_gain()
8265 private->input_gain_updated = 1; in scarlett2_notify_input_gain()
8269 &private->input_gain_ctls[i]->id); in scarlett2_notify_input_gain()
8276 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_autogain() local
8277 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_autogain()
8283 private->autogain_updated = 1; in scarlett2_notify_autogain()
8287 &private->autogain_ctls[i]->id); in scarlett2_notify_autogain()
8289 &private->autogain_status_ctls[i]->id); in scarlett2_notify_autogain()
8293 if (scarlett2_has_config_item(private, in scarlett2_notify_autogain()
8296 &private->ag_target_ctls[i]->id); in scarlett2_notify_autogain()
8305 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_safe() local
8306 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_input_safe()
8312 private->input_safe_updated = 1; in scarlett2_notify_input_safe()
8316 &private->safe_ctls[i]->id); in scarlett2_notify_input_safe()
8323 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_monitor_other() local
8324 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_monitor_other()
8326 private->monitor_other_updated = 1; in scarlett2_notify_monitor_other()
8330 &private->speaker_switching_ctl->id); in scarlett2_notify_monitor_other()
8334 &private->talkback_ctl->id); in scarlett2_notify_monitor_other()
8339 if (private->speaker_switching_switched) { in scarlett2_notify_monitor_other()
8344 private->speaker_switching_switched = 0; in scarlett2_notify_monitor_other()
8345 private->mux_updated = 1; in scarlett2_notify_monitor_other()
8347 for (i = 0; i < private->num_mux_dsts; i++) in scarlett2_notify_monitor_other()
8349 &private->mux_ctls[i]->id); in scarlett2_notify_monitor_other()
8357 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_direct_monitor() local
8358 int count = private->num_mix_in * private->num_mix_out; in scarlett2_notify_direct_monitor()
8361 private->direct_monitor_updated = 1; in scarlett2_notify_direct_monitor()
8364 &private->direct_monitor_ctl->id); in scarlett2_notify_direct_monitor()
8366 if (!scarlett2_has_mixer(private)) in scarlett2_notify_direct_monitor()
8369 private->mix_updated = 1; in scarlett2_notify_direct_monitor()
8374 &private->mix_ctls[i]->id); in scarlett2_notify_direct_monitor()
8381 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_power_status() local
8383 private->power_status_updated = 1; in scarlett2_notify_power_status()
8386 &private->power_status_ctl->id); in scarlett2_notify_power_status()
8393 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_mux() local
8396 private->mux_updated = 1; in scarlett2_notify_mux()
8398 for (i = 0; i < private->num_mux_dsts; i++) in scarlett2_notify_mux()
8400 &private->mux_ctls[i]->id); in scarlett2_notify_mux()
8407 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_pcm_input_switch() local
8409 private->pcm_input_switch_updated = 1; in scarlett2_notify_pcm_input_switch()
8412 &private->pcm_input_switch_ctl->id); in scarlett2_notify_pcm_input_switch()
8421 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_bluetooth() local
8423 if (!private->info->has_bluetooth) in scarlett2_notify_bluetooth()
8426 private->bluetooth_updated = 1; in scarlett2_notify_bluetooth()
8429 &private->bluetooth_volume_ctl->id); in scarlett2_notify_bluetooth()
8437 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_ack() local
8440 if (private->running) in scarlett2_notify_ack()
8441 complete(&private->cmd_done); in scarlett2_notify_ack()
8451 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify() local
8453 private->config_set->notifications; in scarlett2_notify()
8463 if (private->running < 2) in scarlett2_notify()
8487 complete(&private->cmd_done); in scarlett2_notify()
8495 struct scarlett2_data *private = mixer->private_data; in scarlett2_private_free() local
8497 cancel_delayed_work_sync(&private->work); in scarlett2_private_free()
8498 kfree(private); in scarlett2_private_free()
8504 struct scarlett2_data *private = mixer->private_data; in scarlett2_private_suspend() local
8506 if (cancel_delayed_work_sync(&private->work)) in scarlett2_private_suspend()
8507 scarlett2_config_save(private->mixer); in scarlett2_private_suspend()
8512 static void scarlett2_count_io(struct scarlett2_data *private) in scarlett2_count_io() argument
8514 const struct scarlett2_device_info *info = private->info; in scarlett2_count_io()
8527 private->num_mux_srcs = srcs; in scarlett2_count_io()
8528 private->num_mux_dsts = dsts; in scarlett2_count_io()
8534 private->num_mix_in = in scarlett2_count_io()
8538 private->num_mix_out = in scarlett2_count_io()
8543 private->num_line_out = in scarlett2_count_io()
8547 private->num_monitor_mix_ctls = in scarlett2_count_io()
8548 info->direct_monitor * 2 * private->num_mix_in; in scarlett2_count_io()
8556 private->num_autogain_status_texts = i; in scarlett2_count_io()
8563 * in private
8566 struct scarlett2_data *private) in scarlett2_find_fc_interface() argument
8581 private->bInterfaceNumber = desc->bInterfaceNumber; in scarlett2_find_fc_interface()
8582 private->bEndpointAddress = epd->bEndpointAddress & in scarlett2_find_fc_interface()
8584 private->wMaxPacketSize = le16_to_cpu(epd->wMaxPacketSize); in scarlett2_find_fc_interface()
8585 private->bInterval = epd->bInterval; in scarlett2_find_fc_interface()
8592 /* Initialise private data */
8596 struct scarlett2_data *private = in scarlett2_init_private() local
8599 if (!private) in scarlett2_init_private()
8602 mutex_init(&private->usb_mutex); in scarlett2_init_private()
8603 mutex_init(&private->data_mutex); in scarlett2_init_private()
8604 INIT_DELAYED_WORK(&private->work, scarlett2_config_save_work); in scarlett2_init_private()
8606 mixer->private_data = private; in scarlett2_init_private()
8610 private->info = entry->info; in scarlett2_init_private()
8611 private->config_set = entry->info->config_set; in scarlett2_init_private()
8612 private->series_name = entry->series_name; in scarlett2_init_private()
8613 scarlett2_count_io(private); in scarlett2_init_private()
8614 private->scarlett2_seq = 0; 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()
8624 struct scarlett2_data *private = mixer->private_data; in scarlett2_init_notify() local
8625 unsigned int pipe = usb_rcvintpipe(dev, private->bEndpointAddress); in scarlett2_init_notify()
8641 transfer_buffer = kmalloc(private->wMaxPacketSize, GFP_KERNEL); in scarlett2_init_notify()
8646 transfer_buffer, private->wMaxPacketSize, in scarlett2_init_notify()
8647 scarlett2_notify, mixer, private->bInterval); in scarlett2_init_notify()
8649 init_completion(&private->cmd_done); in scarlett2_init_notify()
8658 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_init() local
8667 err = scarlett2_usb_rx(dev, private->bInterfaceNumber, in scarlett2_usb_init()
8689 private->running = 1; in scarlett2_usb_init()
8692 private->scarlett2_seq = 1; in scarlett2_usb_init()
8698 private->scarlett2_seq = 1; in scarlett2_usb_init()
8706 private->firmware_version = le32_to_cpu(*(__le32 *)(step2_buf + 8)); in scarlett2_usb_init()
8709 private->firmware_version); in scarlett2_usb_init()
8715 * segments and put them in the private data
8719 struct scarlett2_data *private = mixer->private_data; in scarlett2_get_flash_segment_nums() local
8773 private->flash_segment_nums[flash_segment_id] = i; in scarlett2_get_flash_segment_nums()
8774 private->flash_segment_blocks[flash_segment_id] = in scarlett2_get_flash_segment_nums()
8782 if (!private->flash_segment_nums[SCARLETT2_SEGMENT_ID_SETTINGS]) { in scarlett2_get_flash_segment_nums()
8788 if (!private->flash_segment_nums[SCARLETT2_SEGMENT_ID_FIRMWARE]) { in scarlett2_get_flash_segment_nums()
8801 struct scarlett2_data *private = mixer->private_data; in scarlett2_read_configs() local
8802 const struct scarlett2_device_info *info = private->info; in scarlett2_read_configs()
8805 if (scarlett2_has_config_item(private, SCARLETT2_CONFIG_MSD_SWITCH)) { in scarlett2_read_configs()
8808 1, &private->msd_switch); in scarlett2_read_configs()
8813 if (private->firmware_version < info->min_firmware_version) { in scarlett2_read_configs()
8817 private->series_name, in scarlett2_read_configs()
8818 private->firmware_version, in scarlett2_read_configs()
8824 if (private->msd_switch) in scarlett2_read_configs()
8864 if (!scarlett2_has_mixer(private)) in scarlett2_read_configs()
8875 if (scarlett2_has_config_item(private, in scarlett2_read_configs()
8879 1, &private->standalone_switch); in scarlett2_read_configs()
8884 if (scarlett2_has_config_item(private, in scarlett2_read_configs()
8895 if (scarlett2_has_config_item(private, in scarlett2_read_configs()
8902 private->num_line_out, &sw_vol); in scarlett2_read_configs()
8906 for (i = 0; i < private->num_line_out; i++) in scarlett2_read_configs()
8907 private->vol[i] = clamp( in scarlett2_read_configs()
8914 private->num_line_out, &private->mute_switch); in scarlett2_read_configs()
8918 for (i = 0; i < private->num_line_out; i++) in scarlett2_read_configs()
8919 private->mute_switch[i] = in scarlett2_read_configs()
8920 !!private->mute_switch[i]; in scarlett2_read_configs()
8923 if (scarlett2_has_config_item(private, in scarlett2_read_configs()
8927 private->num_line_out, in scarlett2_read_configs()
8928 &private->vol_sw_hw_switch); in scarlett2_read_configs()
8932 for (i = 0; i < private->num_line_out; i++) in scarlett2_read_configs()
8933 private->vol_sw_hw_switch[i] = in scarlett2_read_configs()
8934 !!private->vol_sw_hw_switch[i]; in scarlett2_read_configs()
8962 if (scarlett2_has_config_item(private, in scarlett2_read_configs()
9002 struct scarlett2_data *private; in snd_scarlett2_controls_create() local
9005 /* Initialise private data */ in snd_scarlett2_controls_create()
9010 private = mixer->private_data; in snd_scarlett2_controls_create()
9045 if (private->msd_switch || in snd_scarlett2_controls_create()
9046 private->firmware_version < private->info->min_firmware_version) in snd_scarlett2_controls_create()
9117 if (private->info->gain_input_count) { in snd_scarlett2_controls_create()
9123 private->running = 2; in snd_scarlett2_controls_create()
9130 /* Set private->hwdep_in_use; prevents access to the ALSA controls
9133 static void scarlett2_lock(struct scarlett2_data *private) in scarlett2_lock() argument
9135 mutex_lock(&private->data_mutex); in scarlett2_lock()
9136 private->hwdep_in_use = 1; in scarlett2_lock()
9137 mutex_unlock(&private->data_mutex); in scarlett2_lock()
9143 struct scarlett2_data *private = mixer->private_data; in scarlett2_get_erase_progress() local
9152 segment_id = private->selected_flash_segment_id; in scarlett2_get_erase_progress()
9153 segment_num = private->flash_segment_nums[segment_id]; in scarlett2_get_erase_progress()
9199 struct scarlett2_data *private = mixer->private_data; in scarlett2_reboot() local
9201 if (private->flash_write_state == in scarlett2_reboot()
9217 struct scarlett2_data *private = mixer->private_data; in scarlett2_ioctl_select_flash_segment() local
9227 segment_num = private->flash_segment_nums[segment_id]; in scarlett2_ioctl_select_flash_segment()
9237 if (private->flash_write_state == SCARLETT2_FLASH_WRITE_STATE_ERASING) { in scarlett2_ioctl_select_flash_segment()
9245 private->selected_flash_segment_id = segment_id; in scarlett2_ioctl_select_flash_segment()
9246 private->flash_write_state = SCARLETT2_FLASH_WRITE_STATE_SELECTED; in scarlett2_ioctl_select_flash_segment()
9255 struct scarlett2_data *private = mixer->private_data; in scarlett2_ioctl_erase_flash_segment() local
9263 if (private->flash_write_state != SCARLETT2_FLASH_WRITE_STATE_SELECTED) in scarlett2_ioctl_erase_flash_segment()
9266 segment_id = private->selected_flash_segment_id; in scarlett2_ioctl_erase_flash_segment()
9267 segment_num = private->flash_segment_nums[segment_id]; in scarlett2_ioctl_erase_flash_segment()
9276 scarlett2_lock(private); in scarlett2_ioctl_erase_flash_segment()
9289 private->flash_write_state = SCARLETT2_FLASH_WRITE_STATE_ERASING; in scarlett2_ioctl_erase_flash_segment()
9299 struct scarlett2_data *private = mixer->private_data; in scarlett2_ioctl_get_erase_progress() local
9310 if (private->flash_write_state != SCARLETT2_FLASH_WRITE_STATE_ERASING) in scarlett2_ioctl_get_erase_progress()
9313 segment_id = private->selected_flash_segment_id; in scarlett2_ioctl_get_erase_progress()
9314 segment_num = private->flash_segment_nums[segment_id]; in scarlett2_ioctl_get_erase_progress()
9331 progress.num_blocks = private->flash_segment_blocks[segment_id]; in scarlett2_ioctl_get_erase_progress()
9340 private->flash_write_state = SCARLETT2_FLASH_WRITE_STATE_WRITE; in scarlett2_ioctl_get_erase_progress()
9348 struct scarlett2_data *private = mixer->private_data; in scarlett2_hwdep_open() local
9351 if (private->flash_write_state == in scarlett2_hwdep_open()
9360 private->flash_write_state = SCARLETT2_FLASH_WRITE_STATE_IDLE; in scarlett2_hwdep_open()
9398 struct scarlett2_data *private = mixer->private_data; in scarlett2_hwdep_read() local
9412 if (private->flash_write_state != SCARLETT2_FLASH_WRITE_STATE_SELECTED) in scarlett2_hwdep_read()
9416 segment_id = private->selected_flash_segment_id; in scarlett2_hwdep_read()
9420 segment_num = private->flash_segment_nums[segment_id]; in scarlett2_hwdep_read()
9430 flash_size = private->flash_segment_blocks[segment_id] * in scarlett2_hwdep_read()
9476 struct scarlett2_data *private = mixer->private_data; in scarlett2_hwdep_write() local
9493 if (private->flash_write_state == in scarlett2_hwdep_write()
9498 private->flash_write_state = SCARLETT2_FLASH_WRITE_STATE_WRITE; in scarlett2_hwdep_write()
9501 } else if (private->flash_write_state != in scarlett2_hwdep_write()
9507 segment_id = private->selected_flash_segment_id; in scarlett2_hwdep_write()
9511 segment_num = private->flash_segment_nums[segment_id]; in scarlett2_hwdep_write()
9517 flash_size = private->flash_segment_blocks[segment_id] * in scarlett2_hwdep_write()
9561 struct scarlett2_data *private = mixer->private_data; in scarlett2_hwdep_release() local
9566 if (private && in scarlett2_hwdep_release()
9567 private->hwdep_in_use && in scarlett2_hwdep_release()
9568 private->flash_write_state != SCARLETT2_FLASH_WRITE_STATE_ERASING) in scarlett2_hwdep_release()
9569 private->flash_write_state = SCARLETT2_FLASH_WRITE_STATE_IDLE; in scarlett2_hwdep_release()