Lines Matching full:private
1240 static void scarlett2_fill_request_header(struct scarlett2_data *private, in scarlett2_fill_request_header() argument
1245 u16 seq = private->scarlett2_seq++; in scarlett2_fill_request_header()
1277 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb() local
1296 mutex_lock(&private->usb_mutex); in scarlett2_usb()
1300 scarlett2_fill_request_header(private, req, cmd, req_size); in scarlett2_usb()
1305 err = scarlett2_usb_tx(dev, private->bInterfaceNumber, in scarlett2_usb()
1312 private->series_name, cmd, err); in scarlett2_usb()
1319 err = scarlett2_usb_rx(dev, private->bInterfaceNumber, in scarlett2_usb()
1329 private->series_name, cmd, err, resp_buf_size); in scarlett2_usb()
1348 private->series_name, in scarlett2_usb()
1362 mutex_unlock(&private->usb_mutex); in scarlett2_usb()
1390 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_get_config() local
1391 const struct scarlett2_device_info *info = private->info; in scarlett2_usb_get_config()
1441 struct scarlett2_data *private = in scarlett2_config_save_work() local
1444 scarlett2_config_save(private->mixer); in scarlett2_config_save_work()
1452 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_config() local
1453 const struct scarlett2_device_info *info = private->info; in scarlett2_usb_set_config()
1466 cancel_delayed_work_sync(&private->work); in scarlett2_usb_set_config()
1515 schedule_delayed_work(&private->work, msecs_to_jiffies(2000)); in scarlett2_usb_set_config()
1547 * and put the values into private->mix[]
1552 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_get_mix() local
1553 const struct scarlett2_device_info *info = private->info; in scarlett2_usb_get_mix()
1583 private->mix[j] = k; in scarlett2_usb_get_mix()
1590 * (values obtained from private->mix[])
1595 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_mix() local
1596 const struct scarlett2_device_info *info = private->info; in scarlett2_usb_set_mix()
1611 scarlett2_mixer_values[private->mix[j]] in scarlett2_usb_set_mix()
1659 /* Convert one mux entry from the interface and load into private->mux[] */
1660 static void scarlett2_usb_populate_mux(struct scarlett2_data *private, in scarlett2_usb_populate_mux() argument
1663 const struct scarlett2_device_info *info = private->info; in scarlett2_usb_populate_mux()
1673 if (dst_idx >= private->num_mux_dsts) { in scarlett2_usb_populate_mux()
1674 usb_audio_err(private->mixer->chip, in scarlett2_usb_populate_mux()
1676 mux_entry, dst_idx, private->num_mux_dsts); in scarlett2_usb_populate_mux()
1685 if (src_idx >= private->num_mux_srcs) { in scarlett2_usb_populate_mux()
1686 usb_audio_err(private->mixer->chip, in scarlett2_usb_populate_mux()
1688 mux_entry, src_idx, private->num_mux_srcs); in scarlett2_usb_populate_mux()
1692 private->mux[dst_idx] = src_idx; in scarlett2_usb_populate_mux()
1695 /* Send USB message to get mux inputs and then populate private->mux[] */
1698 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_get_mux() local
1699 int count = private->num_mux_dsts; in scarlett2_usb_get_mux()
1709 private->mux_updated = 0; in scarlett2_usb_get_mux()
1721 scarlett2_usb_populate_mux(private, le32_to_cpu(data[i])); in scarlett2_usb_get_mux()
1729 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_mux() local
1730 const struct scarlett2_device_info *info = private->info; in scarlett2_usb_set_mux()
1775 port_count, private->mux[mux_idx++]); in scarlett2_usb_set_mux()
1871 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_sync() local
1873 private->sync_updated = 0; in scarlett2_update_sync()
1874 return scarlett2_usb_get_sync_status(mixer, &private->sync); in scarlett2_update_sync()
1891 struct scarlett2_data *private = mixer->private_data; in scarlett2_sync_ctl_get() local
1894 mutex_lock(&private->data_mutex); in scarlett2_sync_ctl_get()
1896 if (private->sync_updated) { in scarlett2_sync_ctl_get()
1901 ucontrol->value.enumerated.item[0] = private->sync; in scarlett2_sync_ctl_get()
1904 mutex_unlock(&private->data_mutex); in scarlett2_sync_ctl_get()
1918 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_sync_ctl() local
1921 if (private->info->config_set == SCARLETT2_CONFIG_SET_NO_MIXER) in scarlett2_add_sync_ctl()
1925 0, 1, "Sync Status", &private->sync_ctl); in scarlett2_add_sync_ctl()
1935 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_volumes() local
1936 const struct scarlett2_device_info *info = private->info; in scarlett2_update_volumes()
1944 private->vol_updated = 0; in scarlett2_update_volumes()
1950 private->master_vol = clamp( in scarlett2_update_volumes()
1956 private->dim_mute[i] = !!volume_status.dim_mute[i]; in scarlett2_update_volumes()
1958 mute = private->dim_mute[SCARLETT2_BUTTON_MUTE]; in scarlett2_update_volumes()
1961 if (private->vol_sw_hw_switch[i]) { in scarlett2_update_volumes()
1962 private->vol[i] = private->master_vol; in scarlett2_update_volumes()
1963 private->mute_switch[i] = mute; in scarlett2_update_volumes()
1987 struct scarlett2_data *private = mixer->private_data; in scarlett2_master_volume_ctl_get() local
1990 mutex_lock(&private->data_mutex); in scarlett2_master_volume_ctl_get()
1992 if (private->vol_updated) { in scarlett2_master_volume_ctl_get()
1997 ucontrol->value.integer.value[0] = private->master_vol; in scarlett2_master_volume_ctl_get()
2000 mutex_unlock(&private->data_mutex); in scarlett2_master_volume_ctl_get()
2004 static int line_out_remap(struct scarlett2_data *private, int index) in line_out_remap() argument
2006 const struct scarlett2_device_info *info = private->info; in line_out_remap()
2025 struct scarlett2_data *private = mixer->private_data; in scarlett2_volume_ctl_get() local
2026 int index = line_out_remap(private, elem->control); in scarlett2_volume_ctl_get()
2029 mutex_lock(&private->data_mutex); in scarlett2_volume_ctl_get()
2031 if (private->vol_updated) { in scarlett2_volume_ctl_get()
2036 ucontrol->value.integer.value[0] = private->vol[index]; in scarlett2_volume_ctl_get()
2039 mutex_unlock(&private->data_mutex); in scarlett2_volume_ctl_get()
2048 struct scarlett2_data *private = mixer->private_data; in scarlett2_volume_ctl_put() local
2049 int index = line_out_remap(private, elem->control); in scarlett2_volume_ctl_put()
2052 mutex_lock(&private->data_mutex); in scarlett2_volume_ctl_put()
2054 oval = private->vol[index]; in scarlett2_volume_ctl_put()
2060 private->vol[index] = val; in scarlett2_volume_ctl_put()
2067 mutex_unlock(&private->data_mutex); in scarlett2_volume_ctl_put()
2105 struct scarlett2_data *private = mixer->private_data; in scarlett2_mute_ctl_get() local
2106 int index = line_out_remap(private, elem->control); in scarlett2_mute_ctl_get()
2109 mutex_lock(&private->data_mutex); in scarlett2_mute_ctl_get()
2111 if (private->vol_updated) { in scarlett2_mute_ctl_get()
2116 ucontrol->value.integer.value[0] = private->mute_switch[index]; in scarlett2_mute_ctl_get()
2119 mutex_unlock(&private->data_mutex); in scarlett2_mute_ctl_get()
2128 struct scarlett2_data *private = mixer->private_data; in scarlett2_mute_ctl_put() local
2129 int index = line_out_remap(private, elem->control); in scarlett2_mute_ctl_put()
2132 mutex_lock(&private->data_mutex); in scarlett2_mute_ctl_put()
2134 oval = private->mute_switch[index]; in scarlett2_mute_ctl_put()
2140 private->mute_switch[index] = val; in scarlett2_mute_ctl_put()
2149 mutex_unlock(&private->data_mutex); in scarlett2_mute_ctl_put()
2163 static void scarlett2_sw_hw_ctl_ro(struct scarlett2_data *private, int index) in scarlett2_sw_hw_ctl_ro() argument
2165 private->sw_hw_ctls[index]->vd[0].access &= in scarlett2_sw_hw_ctl_ro()
2169 static void scarlett2_sw_hw_ctl_rw(struct scarlett2_data *private, int index) in scarlett2_sw_hw_ctl_rw() argument
2171 private->sw_hw_ctls[index]->vd[0].access |= in scarlett2_sw_hw_ctl_rw()
2189 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_sw_hw_enum_ctl_get() local
2190 int index = line_out_remap(private, elem->control); in scarlett2_sw_hw_enum_ctl_get()
2192 ucontrol->value.enumerated.item[0] = private->vol_sw_hw_switch[index]; in scarlett2_sw_hw_enum_ctl_get()
2199 struct scarlett2_data *private = mixer->private_data; in scarlett2_vol_ctl_set_writable() local
2204 private->vol_ctls[index]->vd[0].access |= in scarlett2_vol_ctl_set_writable()
2206 private->mute_ctls[index]->vd[0].access |= in scarlett2_vol_ctl_set_writable()
2209 private->vol_ctls[index]->vd[0].access &= in scarlett2_vol_ctl_set_writable()
2211 private->mute_ctls[index]->vd[0].access &= in scarlett2_vol_ctl_set_writable()
2218 &private->vol_ctls[index]->id); in scarlett2_vol_ctl_set_writable()
2221 &private->mute_ctls[index]->id); in scarlett2_vol_ctl_set_writable()
2227 struct scarlett2_data *private = mixer->private_data; in scarlett2_sw_hw_change() local
2228 int index = line_out_remap(private, ctl_index); in scarlett2_sw_hw_change()
2231 private->vol_sw_hw_switch[index] = val; in scarlett2_sw_hw_change()
2239 private->vol[index] = private->master_vol; in scarlett2_sw_hw_change()
2240 private->mute_switch[index] = private->dim_mute[SCARLETT2_BUTTON_MUTE]; in scarlett2_sw_hw_change()
2245 index, private->master_vol - SCARLETT2_VOLUME_BIAS); in scarlett2_sw_hw_change()
2252 index, private->dim_mute[SCARLETT2_BUTTON_MUTE]); in scarlett2_sw_hw_change()
2266 struct scarlett2_data *private = mixer->private_data; in scarlett2_sw_hw_enum_ctl_put() local
2268 int index = line_out_remap(private, ctl_index); in scarlett2_sw_hw_enum_ctl_put()
2271 mutex_lock(&private->data_mutex); in scarlett2_sw_hw_enum_ctl_put()
2273 oval = private->vol_sw_hw_switch[index]; in scarlett2_sw_hw_enum_ctl_put()
2284 mutex_unlock(&private->data_mutex); in scarlett2_sw_hw_enum_ctl_put()
2300 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_other() local
2301 const struct scarlett2_device_info *info = private->info; in scarlett2_update_input_other()
2303 private->input_other_updated = 0; in scarlett2_update_input_other()
2309 private->level_switch); in scarlett2_update_input_other()
2317 info->pad_input_count, private->pad_switch); in scarlett2_update_input_other()
2325 info->air_input_count, private->air_switch); in scarlett2_update_input_other()
2333 info->phantom_count, private->phantom_switch); in scarlett2_update_input_other()
2339 1, &private->phantom_persistence); in scarlett2_update_input_other()
2362 struct scarlett2_data *private = mixer->private_data; in scarlett2_level_enum_ctl_get() local
2363 const struct scarlett2_device_info *info = private->info; in scarlett2_level_enum_ctl_get()
2368 mutex_lock(&private->data_mutex); in scarlett2_level_enum_ctl_get()
2370 if (private->input_other_updated) { in scarlett2_level_enum_ctl_get()
2375 ucontrol->value.enumerated.item[0] = private->level_switch[index]; in scarlett2_level_enum_ctl_get()
2378 mutex_unlock(&private->data_mutex); in scarlett2_level_enum_ctl_get()
2387 struct scarlett2_data *private = mixer->private_data; in scarlett2_level_enum_ctl_put() local
2388 const struct scarlett2_device_info *info = private->info; in scarlett2_level_enum_ctl_put()
2393 mutex_lock(&private->data_mutex); in scarlett2_level_enum_ctl_put()
2395 oval = private->level_switch[index]; in scarlett2_level_enum_ctl_put()
2401 private->level_switch[index] = val; in scarlett2_level_enum_ctl_put()
2410 mutex_unlock(&private->data_mutex); in scarlett2_level_enum_ctl_put()
2429 struct scarlett2_data *private = mixer->private_data; in scarlett2_pad_ctl_get() local
2432 mutex_lock(&private->data_mutex); in scarlett2_pad_ctl_get()
2434 if (private->input_other_updated) { in scarlett2_pad_ctl_get()
2440 private->pad_switch[elem->control]; in scarlett2_pad_ctl_get()
2443 mutex_unlock(&private->data_mutex); in scarlett2_pad_ctl_get()
2452 struct scarlett2_data *private = mixer->private_data; in scarlett2_pad_ctl_put() local
2457 mutex_lock(&private->data_mutex); in scarlett2_pad_ctl_put()
2459 oval = private->pad_switch[index]; in scarlett2_pad_ctl_put()
2465 private->pad_switch[index] = val; in scarlett2_pad_ctl_put()
2474 mutex_unlock(&private->data_mutex); in scarlett2_pad_ctl_put()
2493 struct scarlett2_data *private = mixer->private_data; in scarlett2_air_ctl_get() local
2496 mutex_lock(&private->data_mutex); in scarlett2_air_ctl_get()
2498 if (private->input_other_updated) { in scarlett2_air_ctl_get()
2503 ucontrol->value.integer.value[0] = private->air_switch[elem->control]; in scarlett2_air_ctl_get()
2506 mutex_unlock(&private->data_mutex); in scarlett2_air_ctl_get()
2515 struct scarlett2_data *private = mixer->private_data; in scarlett2_air_ctl_put() local
2520 mutex_lock(&private->data_mutex); in scarlett2_air_ctl_put()
2522 oval = private->air_switch[index]; in scarlett2_air_ctl_put()
2528 private->air_switch[index] = val; in scarlett2_air_ctl_put()
2537 mutex_unlock(&private->data_mutex); in scarlett2_air_ctl_put()
2556 struct scarlett2_data *private = mixer->private_data; in scarlett2_phantom_ctl_get() local
2559 mutex_lock(&private->data_mutex); in scarlett2_phantom_ctl_get()
2561 if (private->input_other_updated) { in scarlett2_phantom_ctl_get()
2567 private->phantom_switch[elem->control]; in scarlett2_phantom_ctl_get()
2570 mutex_unlock(&private->data_mutex); in scarlett2_phantom_ctl_get()
2579 struct scarlett2_data *private = mixer->private_data; in scarlett2_phantom_ctl_put() local
2584 mutex_lock(&private->data_mutex); in scarlett2_phantom_ctl_put()
2586 oval = private->phantom_switch[index]; in scarlett2_phantom_ctl_put()
2592 private->phantom_switch[index] = val; in scarlett2_phantom_ctl_put()
2601 mutex_unlock(&private->data_mutex); in scarlett2_phantom_ctl_put()
2619 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_phantom_persistence_ctl_get() local
2621 ucontrol->value.integer.value[0] = private->phantom_persistence; in scarlett2_phantom_persistence_ctl_get()
2630 struct scarlett2_data *private = mixer->private_data; in scarlett2_phantom_persistence_ctl_put() local
2635 mutex_lock(&private->data_mutex); in scarlett2_phantom_persistence_ctl_put()
2637 oval = private->phantom_persistence; in scarlett2_phantom_persistence_ctl_put()
2643 private->phantom_persistence = val; in scarlett2_phantom_persistence_ctl_put()
2652 mutex_unlock(&private->data_mutex); in scarlett2_phantom_persistence_ctl_put()
2668 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_monitor_other() local
2669 const struct scarlett2_device_info *info = private->info; in scarlett2_update_monitor_other()
2682 private->monitor_other_updated = 0; in scarlett2_update_monitor_other()
2687 1, &private->direct_monitor_switch); in scarlett2_update_monitor_other()
2708 private->speaker_switching_switch = 0; in scarlett2_update_monitor_other()
2710 private->speaker_switching_switch = monitor_other_switch[0] + 1; in scarlett2_update_monitor_other()
2721 private->talkback_switch = 0; in scarlett2_update_monitor_other()
2723 private->talkback_switch = monitor_other_switch[1] + 1; in scarlett2_update_monitor_other()
2731 private->talkback_map[i] = bitmap & 1; in scarlett2_update_monitor_other()
2742 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_direct_monitor_ctl_get() local
2745 mutex_lock(&private->data_mutex); in scarlett2_direct_monitor_ctl_get()
2747 if (private->monitor_other_updated) { in scarlett2_direct_monitor_ctl_get()
2752 ucontrol->value.enumerated.item[0] = private->direct_monitor_switch; in scarlett2_direct_monitor_ctl_get()
2755 mutex_unlock(&private->data_mutex); in scarlett2_direct_monitor_ctl_get()
2764 struct scarlett2_data *private = mixer->private_data; in scarlett2_direct_monitor_ctl_put() local
2769 mutex_lock(&private->data_mutex); in scarlett2_direct_monitor_ctl_put()
2771 oval = private->direct_monitor_switch; in scarlett2_direct_monitor_ctl_put()
2777 private->direct_monitor_switch = val; in scarlett2_direct_monitor_ctl_put()
2786 mutex_unlock(&private->data_mutex); in scarlett2_direct_monitor_ctl_put()
2822 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_direct_monitor_ctl() local
2823 const struct scarlett2_device_info *info = private->info; in scarlett2_add_direct_monitor_ctl()
2835 0, 1, s, &private->direct_monitor_ctl); in scarlett2_add_direct_monitor_ctl()
2855 struct scarlett2_data *private = mixer->private_data; in scarlett2_speaker_switch_enum_ctl_get() local
2858 mutex_lock(&private->data_mutex); in scarlett2_speaker_switch_enum_ctl_get()
2860 if (private->monitor_other_updated) { in scarlett2_speaker_switch_enum_ctl_get()
2865 ucontrol->value.enumerated.item[0] = private->speaker_switching_switch; in scarlett2_speaker_switch_enum_ctl_get()
2868 mutex_unlock(&private->data_mutex); in scarlett2_speaker_switch_enum_ctl_get()
2878 struct scarlett2_data *private = mixer->private_data; in scarlett2_speaker_switch_enable() local
2882 int index = line_out_remap(private, i); in scarlett2_speaker_switch_enable()
2885 if (!private->vol_sw_hw_switch[index]) { in scarlett2_speaker_switch_enable()
2886 err = scarlett2_sw_hw_change(private->mixer, i, 1); in scarlett2_speaker_switch_enable()
2892 scarlett2_sw_hw_ctl_ro(private, i); in scarlett2_speaker_switch_enable()
2896 &private->sw_hw_ctls[i]->id); in scarlett2_speaker_switch_enable()
2902 private->speaker_switching_switched = 1; in scarlett2_speaker_switch_enable()
2913 struct scarlett2_data *private = mixer->private_data; in scarlett2_speaker_switch_disable() local
2918 scarlett2_sw_hw_ctl_rw(private, i); in scarlett2_speaker_switch_disable()
2920 &private->sw_hw_ctls[i]->id); in scarlett2_speaker_switch_disable()
2926 private->speaker_switching_switched = 1; in scarlett2_speaker_switch_disable()
2934 struct scarlett2_data *private = mixer->private_data; in scarlett2_speaker_switch_enum_ctl_put() local
2938 mutex_lock(&private->data_mutex); in scarlett2_speaker_switch_enum_ctl_put()
2940 oval = private->speaker_switching_switch; in scarlett2_speaker_switch_enum_ctl_put()
2946 private->speaker_switching_switch = val; in scarlett2_speaker_switch_enum_ctl_put()
2972 mutex_unlock(&private->data_mutex); in scarlett2_speaker_switch_enum_ctl_put()
2987 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_speaker_switch_ctl() local
2988 const struct scarlett2_device_info *info = private->info; in scarlett2_add_speaker_switch_ctl()
2996 &private->speaker_switching_ctl); in scarlett2_add_speaker_switch_ctl()
3016 struct scarlett2_data *private = mixer->private_data; in scarlett2_talkback_enum_ctl_get() local
3019 mutex_lock(&private->data_mutex); in scarlett2_talkback_enum_ctl_get()
3021 if (private->monitor_other_updated) { in scarlett2_talkback_enum_ctl_get()
3026 ucontrol->value.enumerated.item[0] = private->talkback_switch; in scarlett2_talkback_enum_ctl_get()
3029 mutex_unlock(&private->data_mutex); in scarlett2_talkback_enum_ctl_get()
3038 struct scarlett2_data *private = mixer->private_data; in scarlett2_talkback_enum_ctl_put() local
3042 mutex_lock(&private->data_mutex); in scarlett2_talkback_enum_ctl_put()
3044 oval = private->talkback_switch; in scarlett2_talkback_enum_ctl_put()
3050 private->talkback_switch = val; in scarlett2_talkback_enum_ctl_put()
3067 mutex_unlock(&private->data_mutex); in scarlett2_talkback_enum_ctl_put()
3084 struct scarlett2_data *private = mixer->private_data; in scarlett2_talkback_map_ctl_get() local
3087 ucontrol->value.integer.value[0] = private->talkback_map[index]; in scarlett2_talkback_map_ctl_get()
3097 struct scarlett2_data *private = mixer->private_data; in scarlett2_talkback_map_ctl_put() local
3099 private->info->port_count; in scarlett2_talkback_map_ctl_put()
3106 mutex_lock(&private->data_mutex); in scarlett2_talkback_map_ctl_put()
3108 oval = private->talkback_map[index]; in scarlett2_talkback_map_ctl_put()
3114 private->talkback_map[index] = val; in scarlett2_talkback_map_ctl_put()
3117 bitmap |= private->talkback_map[i] << i; in scarlett2_talkback_map_ctl_put()
3126 mutex_unlock(&private->data_mutex); in scarlett2_talkback_map_ctl_put()
3141 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_talkback_ctls() local
3142 const struct scarlett2_device_info *info = private->info; in scarlett2_add_talkback_ctls()
3154 &private->talkback_ctl); in scarlett2_add_talkback_ctls()
3177 struct scarlett2_data *private = mixer->private_data; in scarlett2_dim_mute_ctl_get() local
3180 mutex_lock(&private->data_mutex); in scarlett2_dim_mute_ctl_get()
3182 if (private->vol_updated) { in scarlett2_dim_mute_ctl_get()
3187 ucontrol->value.integer.value[0] = private->dim_mute[elem->control]; in scarlett2_dim_mute_ctl_get()
3190 mutex_unlock(&private->data_mutex); in scarlett2_dim_mute_ctl_get()
3199 struct scarlett2_data *private = mixer->private_data; in scarlett2_dim_mute_ctl_put() local
3200 const struct scarlett2_device_info *info = private->info; in scarlett2_dim_mute_ctl_put()
3208 mutex_lock(&private->data_mutex); in scarlett2_dim_mute_ctl_put()
3210 oval = private->dim_mute[index]; in scarlett2_dim_mute_ctl_put()
3216 private->dim_mute[index] = val; in scarlett2_dim_mute_ctl_put()
3226 int line_index = line_out_remap(private, i); in scarlett2_dim_mute_ctl_put()
3228 if (private->vol_sw_hw_switch[line_index]) { in scarlett2_dim_mute_ctl_put()
3229 private->mute_switch[line_index] = val; in scarlett2_dim_mute_ctl_put()
3232 &private->mute_ctls[i]->id); in scarlett2_dim_mute_ctl_put()
3237 mutex_unlock(&private->data_mutex); in scarlett2_dim_mute_ctl_put()
3253 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_line_out_ctls() local
3254 const struct scarlett2_device_info *info = private->info; in scarlett2_add_line_out_ctls()
3266 0, 1, s, &private->master_vol_ctl); in scarlett2_add_line_out_ctls()
3273 int index = line_out_remap(private, i); in scarlett2_add_line_out_ctls()
3286 i, 1, s, &private->vol_ctls[i]); in scarlett2_add_line_out_ctls()
3297 &private->mute_ctls[i]); in scarlett2_add_line_out_ctls()
3304 if (private->vol_sw_hw_switch[index]) in scarlett2_add_line_out_ctls()
3315 &private->sw_hw_ctls[i]); in scarlett2_add_line_out_ctls()
3322 if (private->speaker_switching_switch && i < 4) in scarlett2_add_line_out_ctls()
3323 scarlett2_sw_hw_ctl_ro(private, i); in scarlett2_add_line_out_ctls()
3333 &private->dim_mute_ctls[i]); in scarlett2_add_line_out_ctls()
3345 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_line_in_ctls() local
3346 const struct scarlett2_device_info *info = private->info; in scarlett2_add_line_in_ctls()
3357 i, 1, s, &private->level_ctls[i]); in scarlett2_add_line_in_ctls()
3366 i, 1, s, &private->pad_ctls[i]); in scarlett2_add_line_in_ctls()
3375 i, 1, s, &private->air_ctls[i]); in scarlett2_add_line_in_ctls()
3387 i, 1, s, &private->phantom_ctls[i]); in scarlett2_add_line_in_ctls()
3400 i, 1, s, &private->phantom_ctls[i]); in scarlett2_add_line_in_ctls()
3435 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_mixer_ctl_get() local
3437 ucontrol->value.integer.value[0] = private->mix[elem->control]; in scarlett2_mixer_ctl_get()
3446 struct scarlett2_data *private = mixer->private_data; in scarlett2_mixer_ctl_put() local
3447 const struct scarlett2_device_info *info = private->info; in scarlett2_mixer_ctl_put()
3452 mutex_lock(&private->data_mutex); in scarlett2_mixer_ctl_put()
3454 oval = private->mix[index]; in scarlett2_mixer_ctl_put()
3463 private->mix[index] = val; in scarlett2_mixer_ctl_put()
3469 mutex_unlock(&private->data_mutex); in scarlett2_mixer_ctl_put()
3493 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_mixer_ctls() local
3494 const struct scarlett2_device_info *info = private->info; in scarlett2_add_mixer_ctls()
3525 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_mux_src_enum_ctl_info() local
3526 const struct scarlett2_device_info *info = private->info; in scarlett2_mux_src_enum_ctl_info()
3529 int items = private->num_mux_srcs; in scarlett2_mux_src_enum_ctl_info()
3561 struct scarlett2_data *private = mixer->private_data; in scarlett2_mux_src_enum_ctl_get() local
3562 int index = line_out_remap(private, elem->control); in scarlett2_mux_src_enum_ctl_get()
3565 mutex_lock(&private->data_mutex); in scarlett2_mux_src_enum_ctl_get()
3567 if (private->mux_updated) { in scarlett2_mux_src_enum_ctl_get()
3572 ucontrol->value.enumerated.item[0] = private->mux[index]; in scarlett2_mux_src_enum_ctl_get()
3575 mutex_unlock(&private->data_mutex); in scarlett2_mux_src_enum_ctl_get()
3584 struct scarlett2_data *private = mixer->private_data; in scarlett2_mux_src_enum_ctl_put() local
3585 int index = line_out_remap(private, elem->control); in scarlett2_mux_src_enum_ctl_put()
3588 mutex_lock(&private->data_mutex); in scarlett2_mux_src_enum_ctl_put()
3590 oval = private->mux[index]; in scarlett2_mux_src_enum_ctl_put()
3592 private->num_mux_srcs - 1U); in scarlett2_mux_src_enum_ctl_put()
3597 private->mux[index] = val; in scarlett2_mux_src_enum_ctl_put()
3603 mutex_unlock(&private->data_mutex); in scarlett2_mux_src_enum_ctl_put()
3617 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_mux_enums() local
3618 const struct scarlett2_device_info *info = private->info; in scarlett2_add_mux_enums()
3639 &private->mux_ctls[i]); in scarlett2_add_mux_enums()
3691 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_meter_ctl() local
3694 if (private->info->config_set == SCARLETT2_CONFIG_SET_NO_MIXER) in scarlett2_add_meter_ctl()
3698 0, private->num_mux_dsts, in scarlett2_add_meter_ctl()
3708 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_msd_ctl_get() local
3710 ucontrol->value.integer.value[0] = private->msd_switch; in scarlett2_msd_ctl_get()
3719 struct scarlett2_data *private = mixer->private_data; in scarlett2_msd_ctl_put() local
3723 mutex_lock(&private->data_mutex); in scarlett2_msd_ctl_put()
3725 oval = private->msd_switch; in scarlett2_msd_ctl_put()
3731 private->msd_switch = val; in scarlett2_msd_ctl_put()
3740 mutex_unlock(&private->data_mutex); in scarlett2_msd_ctl_put()
3754 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_msd_ctl() local
3755 const struct scarlett2_device_info *info = private->info; in scarlett2_add_msd_ctl()
3761 if (!private->msd_switch && !(mixer->chip->setup & SCARLETT2_MSD_ENABLE)) in scarlett2_add_msd_ctl()
3775 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_standalone_ctl_get() local
3777 ucontrol->value.integer.value[0] = private->standalone_switch; in scarlett2_standalone_ctl_get()
3786 struct scarlett2_data *private = mixer->private_data; in scarlett2_standalone_ctl_put() local
3790 mutex_lock(&private->data_mutex); in scarlett2_standalone_ctl_put()
3792 oval = private->standalone_switch; in scarlett2_standalone_ctl_put()
3798 private->standalone_switch = val; in scarlett2_standalone_ctl_put()
3808 mutex_unlock(&private->data_mutex); in scarlett2_standalone_ctl_put()
3822 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_standalone_ctl() local
3824 if (private->info->config_set == SCARLETT2_CONFIG_SET_NO_MIXER) in scarlett2_add_standalone_ctl()
3836 struct scarlett2_data *private = mixer->private_data; in scarlett2_private_free() local
3838 cancel_delayed_work_sync(&private->work); in scarlett2_private_free()
3839 kfree(private); in scarlett2_private_free()
3845 struct scarlett2_data *private = mixer->private_data; in scarlett2_private_suspend() local
3847 if (cancel_delayed_work_sync(&private->work)) in scarlett2_private_suspend()
3848 scarlett2_config_save(private->mixer); in scarlett2_private_suspend()
3853 static void scarlett2_count_mux_io(struct scarlett2_data *private) in scarlett2_count_mux_io() argument
3855 const struct scarlett2_device_info *info = private->info; in scarlett2_count_mux_io()
3866 private->num_mux_srcs = srcs; in scarlett2_count_mux_io()
3867 private->num_mux_dsts = dsts; in scarlett2_count_mux_io()
3873 * in private
3876 struct scarlett2_data *private) in scarlett2_find_fc_interface() argument
3891 private->bInterfaceNumber = desc->bInterfaceNumber; in scarlett2_find_fc_interface()
3892 private->bEndpointAddress = epd->bEndpointAddress & in scarlett2_find_fc_interface()
3894 private->wMaxPacketSize = le16_to_cpu(epd->wMaxPacketSize); in scarlett2_find_fc_interface()
3895 private->bInterval = epd->bInterval; in scarlett2_find_fc_interface()
3902 /* Initialise private data */
3906 struct scarlett2_data *private = in scarlett2_init_private() local
3909 if (!private) in scarlett2_init_private()
3912 mutex_init(&private->usb_mutex); in scarlett2_init_private()
3913 mutex_init(&private->data_mutex); in scarlett2_init_private()
3914 INIT_DELAYED_WORK(&private->work, scarlett2_config_save_work); in scarlett2_init_private()
3916 mixer->private_data = private; in scarlett2_init_private()
3920 private->info = entry->info; in scarlett2_init_private()
3921 private->series_name = entry->series_name; in scarlett2_init_private()
3922 scarlett2_count_mux_io(private); in scarlett2_init_private()
3923 private->scarlett2_seq = 0; in scarlett2_init_private()
3924 private->mixer = mixer; in scarlett2_init_private()
3926 return scarlett2_find_fc_interface(mixer->chip->dev, private); in scarlett2_init_private()
3933 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_init() local
3941 err = scarlett2_usb_rx(dev, private->bInterfaceNumber, in scarlett2_usb_init()
3947 private->scarlett2_seq = 1; in scarlett2_usb_init()
3953 private->scarlett2_seq = 1; in scarlett2_usb_init()
3960 struct scarlett2_data *private = mixer->private_data; in scarlett2_read_configs() local
3961 const struct scarlett2_device_info *info = private->info; in scarlett2_read_configs()
3973 1, &private->msd_switch); in scarlett2_read_configs()
3978 if (private->msd_switch) in scarlett2_read_configs()
3996 1, &private->standalone_switch); in scarlett2_read_configs()
4010 private->dim_mute[i] = !!volume_status.dim_mute[i]; in scarlett2_read_configs()
4012 private->master_vol = clamp( in scarlett2_read_configs()
4019 private->vol_sw_hw_switch[i] = in scarlett2_read_configs()
4023 volume = private->vol_sw_hw_switch[i] in scarlett2_read_configs()
4028 private->vol[i] = volume; in scarlett2_read_configs()
4030 mute = private->vol_sw_hw_switch[i] in scarlett2_read_configs()
4031 ? private->dim_mute[SCARLETT2_BUTTON_MUTE] in scarlett2_read_configs()
4033 private->mute_switch[i] = mute; in scarlett2_read_configs()
4049 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_sync() local
4051 private->sync_updated = 1; in scarlett2_notify_sync()
4054 &private->sync_ctl->id); in scarlett2_notify_sync()
4062 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_monitor() local
4063 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_monitor()
4073 private->vol_updated = 1; in scarlett2_notify_monitor()
4076 &private->master_vol_ctl->id); in scarlett2_notify_monitor()
4079 if (private->vol_sw_hw_switch[line_out_remap(private, i)]) in scarlett2_notify_monitor()
4081 &private->vol_ctls[i]->id); in scarlett2_notify_monitor()
4089 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_dim_mute() local
4090 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_dim_mute()
4096 private->vol_updated = 1; in scarlett2_notify_dim_mute()
4103 &private->dim_mute_ctls[i]->id); in scarlett2_notify_dim_mute()
4106 if (private->vol_sw_hw_switch[line_out_remap(private, i)]) in scarlett2_notify_dim_mute()
4108 &private->mute_ctls[i]->id); in scarlett2_notify_dim_mute()
4116 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_other() local
4117 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_input_other()
4120 private->input_other_updated = 1; in scarlett2_notify_input_other()
4124 &private->level_ctls[i]->id); in scarlett2_notify_input_other()
4127 &private->pad_ctls[i]->id); in scarlett2_notify_input_other()
4130 &private->air_ctls[i]->id); in scarlett2_notify_input_other()
4133 &private->phantom_ctls[i]->id); in scarlett2_notify_input_other()
4143 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_monitor_other() local
4144 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_monitor_other()
4146 private->monitor_other_updated = 1; in scarlett2_notify_monitor_other()
4150 &private->direct_monitor_ctl->id); in scarlett2_notify_monitor_other()
4156 &private->speaker_switching_ctl->id); in scarlett2_notify_monitor_other()
4160 &private->talkback_ctl->id); in scarlett2_notify_monitor_other()
4165 if (private->speaker_switching_switched) { in scarlett2_notify_monitor_other()
4170 private->speaker_switching_switched = 0; in scarlett2_notify_monitor_other()
4171 private->mux_updated = 1; in scarlett2_notify_monitor_other()
4173 for (i = 0; i < private->num_mux_dsts; i++) in scarlett2_notify_monitor_other()
4175 &private->mux_ctls[i]->id); in scarlett2_notify_monitor_other()
4214 struct scarlett2_data *private = mixer->private_data; in scarlett2_init_notify() local
4215 unsigned int pipe = usb_rcvintpipe(dev, private->bEndpointAddress); in scarlett2_init_notify()
4231 transfer_buffer = kmalloc(private->wMaxPacketSize, GFP_KERNEL); in scarlett2_init_notify()
4236 transfer_buffer, private->wMaxPacketSize, in scarlett2_init_notify()
4237 scarlett2_notify, mixer, private->bInterval); in scarlett2_init_notify()
4262 /* Initialise private data */ in snd_scarlett2_controls_create()