• Home
  • Raw
  • Download

Lines Matching refs:private

1025 static void scarlett2_fill_request_header(struct scarlett2_data *private,  in scarlett2_fill_request_header()  argument
1030 u16 seq = private->scarlett2_seq++; in scarlett2_fill_request_header()
1062 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb() local
1081 mutex_lock(&private->usb_mutex); in scarlett2_usb()
1085 scarlett2_fill_request_header(private, req, cmd, req_size); in scarlett2_usb()
1090 err = scarlett2_usb_tx(dev, private->bInterfaceNumber, in scarlett2_usb()
1104 err = scarlett2_usb_rx(dev, private->bInterfaceNumber, in scarlett2_usb()
1147 mutex_unlock(&private->usb_mutex); in scarlett2_usb()
1175 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_get_config() local
1176 const struct scarlett2_device_info *info = private->info; in scarlett2_usb_get_config()
1226 struct scarlett2_data *private = in scarlett2_config_save_work() local
1229 scarlett2_config_save(private->mixer); in scarlett2_config_save_work()
1237 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_config() local
1238 const struct scarlett2_device_info *info = private->info; in scarlett2_usb_set_config()
1251 cancel_delayed_work_sync(&private->work); in scarlett2_usb_set_config()
1300 schedule_delayed_work(&private->work, msecs_to_jiffies(2000)); in scarlett2_usb_set_config()
1337 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_get_mix() local
1338 const struct scarlett2_device_info *info = private->info; in scarlett2_usb_get_mix()
1368 private->mix[j] = k; in scarlett2_usb_get_mix()
1380 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_mix() local
1381 const struct scarlett2_device_info *info = private->info; in scarlett2_usb_set_mix()
1396 scarlett2_mixer_values[private->mix[j]] in scarlett2_usb_set_mix()
1445 static void scarlett2_usb_populate_mux(struct scarlett2_data *private, in scarlett2_usb_populate_mux() argument
1448 const struct scarlett2_device_info *info = private->info; in scarlett2_usb_populate_mux()
1458 if (dst_idx >= private->num_mux_dsts) { in scarlett2_usb_populate_mux()
1459 usb_audio_err(private->mixer->chip, in scarlett2_usb_populate_mux()
1461 mux_entry, dst_idx, private->num_mux_dsts); in scarlett2_usb_populate_mux()
1470 if (src_idx >= private->num_mux_srcs) { in scarlett2_usb_populate_mux()
1471 usb_audio_err(private->mixer->chip, in scarlett2_usb_populate_mux()
1473 mux_entry, src_idx, private->num_mux_srcs); in scarlett2_usb_populate_mux()
1477 private->mux[dst_idx] = src_idx; in scarlett2_usb_populate_mux()
1483 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_get_mux() local
1484 int count = private->num_mux_dsts; in scarlett2_usb_get_mux()
1494 private->mux_updated = 0; in scarlett2_usb_get_mux()
1506 scarlett2_usb_populate_mux(private, le32_to_cpu(data[i])); in scarlett2_usb_get_mux()
1514 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_set_mux() local
1515 const struct scarlett2_device_info *info = private->info; in scarlett2_usb_set_mux()
1560 port_count, private->mux[mux_idx++]); in scarlett2_usb_set_mux()
1656 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_sync() local
1658 private->sync_updated = 0; in scarlett2_update_sync()
1659 return scarlett2_usb_get_sync_status(mixer, &private->sync); in scarlett2_update_sync()
1676 struct scarlett2_data *private = mixer->private_data; in scarlett2_sync_ctl_get() local
1679 mutex_lock(&private->data_mutex); in scarlett2_sync_ctl_get()
1681 if (private->sync_updated) { in scarlett2_sync_ctl_get()
1686 ucontrol->value.enumerated.item[0] = private->sync; in scarlett2_sync_ctl_get()
1689 mutex_unlock(&private->data_mutex); in scarlett2_sync_ctl_get()
1703 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_sync_ctl() local
1706 if (!private->info->has_mixer) in scarlett2_add_sync_ctl()
1710 0, 1, "Sync Status", &private->sync_ctl); in scarlett2_add_sync_ctl()
1720 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_volumes() local
1721 const struct scarlett2_device_info *info = private->info; in scarlett2_update_volumes()
1729 private->vol_updated = 0; in scarlett2_update_volumes()
1735 private->master_vol = clamp( in scarlett2_update_volumes()
1741 private->dim_mute[i] = !!volume_status.dim_mute[i]; in scarlett2_update_volumes()
1743 mute = private->dim_mute[SCARLETT2_BUTTON_MUTE]; in scarlett2_update_volumes()
1746 if (private->vol_sw_hw_switch[i]) { in scarlett2_update_volumes()
1747 private->vol[i] = private->master_vol; in scarlett2_update_volumes()
1748 private->mute_switch[i] = mute; in scarlett2_update_volumes()
1772 struct scarlett2_data *private = mixer->private_data; in scarlett2_master_volume_ctl_get() local
1775 mutex_lock(&private->data_mutex); in scarlett2_master_volume_ctl_get()
1777 if (private->vol_updated) { in scarlett2_master_volume_ctl_get()
1782 ucontrol->value.integer.value[0] = private->master_vol; in scarlett2_master_volume_ctl_get()
1785 mutex_unlock(&private->data_mutex); in scarlett2_master_volume_ctl_get()
1789 static int line_out_remap(struct scarlett2_data *private, int index) in line_out_remap() argument
1791 const struct scarlett2_device_info *info = private->info; in line_out_remap()
1810 struct scarlett2_data *private = mixer->private_data; in scarlett2_volume_ctl_get() local
1811 int index = line_out_remap(private, elem->control); in scarlett2_volume_ctl_get()
1814 mutex_lock(&private->data_mutex); in scarlett2_volume_ctl_get()
1816 if (private->vol_updated) { in scarlett2_volume_ctl_get()
1821 ucontrol->value.integer.value[0] = private->vol[index]; in scarlett2_volume_ctl_get()
1824 mutex_unlock(&private->data_mutex); in scarlett2_volume_ctl_get()
1833 struct scarlett2_data *private = mixer->private_data; in scarlett2_volume_ctl_put() local
1834 int index = line_out_remap(private, elem->control); in scarlett2_volume_ctl_put()
1837 mutex_lock(&private->data_mutex); in scarlett2_volume_ctl_put()
1839 oval = private->vol[index]; in scarlett2_volume_ctl_put()
1845 private->vol[index] = val; in scarlett2_volume_ctl_put()
1852 mutex_unlock(&private->data_mutex); in scarlett2_volume_ctl_put()
1890 struct scarlett2_data *private = mixer->private_data; in scarlett2_mute_ctl_get() local
1891 int index = line_out_remap(private, elem->control); in scarlett2_mute_ctl_get()
1894 mutex_lock(&private->data_mutex); in scarlett2_mute_ctl_get()
1896 if (private->vol_updated) { in scarlett2_mute_ctl_get()
1901 ucontrol->value.integer.value[0] = private->mute_switch[index]; in scarlett2_mute_ctl_get()
1904 mutex_unlock(&private->data_mutex); in scarlett2_mute_ctl_get()
1913 struct scarlett2_data *private = mixer->private_data; in scarlett2_mute_ctl_put() local
1914 int index = line_out_remap(private, elem->control); in scarlett2_mute_ctl_put()
1917 mutex_lock(&private->data_mutex); in scarlett2_mute_ctl_put()
1919 oval = private->mute_switch[index]; in scarlett2_mute_ctl_put()
1925 private->mute_switch[index] = val; in scarlett2_mute_ctl_put()
1934 mutex_unlock(&private->data_mutex); in scarlett2_mute_ctl_put()
1948 static void scarlett2_sw_hw_ctl_ro(struct scarlett2_data *private, int index) in scarlett2_sw_hw_ctl_ro() argument
1950 private->sw_hw_ctls[index]->vd[0].access &= in scarlett2_sw_hw_ctl_ro()
1954 static void scarlett2_sw_hw_ctl_rw(struct scarlett2_data *private, int index) in scarlett2_sw_hw_ctl_rw() argument
1956 private->sw_hw_ctls[index]->vd[0].access |= in scarlett2_sw_hw_ctl_rw()
1974 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_sw_hw_enum_ctl_get() local
1975 int index = line_out_remap(private, elem->control); in scarlett2_sw_hw_enum_ctl_get()
1977 ucontrol->value.enumerated.item[0] = private->vol_sw_hw_switch[index]; in scarlett2_sw_hw_enum_ctl_get()
1984 struct scarlett2_data *private = mixer->private_data; in scarlett2_vol_ctl_set_writable() local
1989 private->vol_ctls[index]->vd[0].access |= in scarlett2_vol_ctl_set_writable()
1991 private->mute_ctls[index]->vd[0].access |= in scarlett2_vol_ctl_set_writable()
1994 private->vol_ctls[index]->vd[0].access &= in scarlett2_vol_ctl_set_writable()
1996 private->mute_ctls[index]->vd[0].access &= in scarlett2_vol_ctl_set_writable()
2003 &private->vol_ctls[index]->id); in scarlett2_vol_ctl_set_writable()
2006 &private->mute_ctls[index]->id); in scarlett2_vol_ctl_set_writable()
2012 struct scarlett2_data *private = mixer->private_data; in scarlett2_sw_hw_change() local
2013 int index = line_out_remap(private, ctl_index); in scarlett2_sw_hw_change()
2016 private->vol_sw_hw_switch[index] = val; in scarlett2_sw_hw_change()
2024 private->vol[index] = private->master_vol; in scarlett2_sw_hw_change()
2025 private->mute_switch[index] = private->dim_mute[SCARLETT2_BUTTON_MUTE]; in scarlett2_sw_hw_change()
2030 index, private->master_vol - SCARLETT2_VOLUME_BIAS); in scarlett2_sw_hw_change()
2037 index, private->dim_mute[SCARLETT2_BUTTON_MUTE]); in scarlett2_sw_hw_change()
2051 struct scarlett2_data *private = mixer->private_data; in scarlett2_sw_hw_enum_ctl_put() local
2053 int index = line_out_remap(private, ctl_index); in scarlett2_sw_hw_enum_ctl_put()
2056 mutex_lock(&private->data_mutex); in scarlett2_sw_hw_enum_ctl_put()
2058 oval = private->vol_sw_hw_switch[index]; in scarlett2_sw_hw_enum_ctl_put()
2069 mutex_unlock(&private->data_mutex); in scarlett2_sw_hw_enum_ctl_put()
2085 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_input_other() local
2086 const struct scarlett2_device_info *info = private->info; in scarlett2_update_input_other()
2088 private->input_other_updated = 0; in scarlett2_update_input_other()
2094 private->level_switch); in scarlett2_update_input_other()
2102 info->pad_input_count, private->pad_switch); in scarlett2_update_input_other()
2110 info->air_input_count, private->air_switch); in scarlett2_update_input_other()
2118 info->phantom_count, private->phantom_switch); in scarlett2_update_input_other()
2124 1, &private->phantom_persistence); in scarlett2_update_input_other()
2147 struct scarlett2_data *private = mixer->private_data; in scarlett2_level_enum_ctl_get() local
2148 const struct scarlett2_device_info *info = private->info; in scarlett2_level_enum_ctl_get()
2153 mutex_lock(&private->data_mutex); in scarlett2_level_enum_ctl_get()
2155 if (private->input_other_updated) { in scarlett2_level_enum_ctl_get()
2160 ucontrol->value.enumerated.item[0] = private->level_switch[index]; in scarlett2_level_enum_ctl_get()
2163 mutex_unlock(&private->data_mutex); in scarlett2_level_enum_ctl_get()
2172 struct scarlett2_data *private = mixer->private_data; in scarlett2_level_enum_ctl_put() local
2173 const struct scarlett2_device_info *info = private->info; in scarlett2_level_enum_ctl_put()
2178 mutex_lock(&private->data_mutex); in scarlett2_level_enum_ctl_put()
2180 oval = private->level_switch[index]; in scarlett2_level_enum_ctl_put()
2186 private->level_switch[index] = val; in scarlett2_level_enum_ctl_put()
2195 mutex_unlock(&private->data_mutex); in scarlett2_level_enum_ctl_put()
2214 struct scarlett2_data *private = mixer->private_data; in scarlett2_pad_ctl_get() local
2217 mutex_lock(&private->data_mutex); in scarlett2_pad_ctl_get()
2219 if (private->input_other_updated) { in scarlett2_pad_ctl_get()
2225 private->pad_switch[elem->control]; in scarlett2_pad_ctl_get()
2228 mutex_unlock(&private->data_mutex); in scarlett2_pad_ctl_get()
2237 struct scarlett2_data *private = mixer->private_data; in scarlett2_pad_ctl_put() local
2242 mutex_lock(&private->data_mutex); in scarlett2_pad_ctl_put()
2244 oval = private->pad_switch[index]; in scarlett2_pad_ctl_put()
2250 private->pad_switch[index] = val; in scarlett2_pad_ctl_put()
2259 mutex_unlock(&private->data_mutex); in scarlett2_pad_ctl_put()
2278 struct scarlett2_data *private = mixer->private_data; in scarlett2_air_ctl_get() local
2281 mutex_lock(&private->data_mutex); in scarlett2_air_ctl_get()
2283 if (private->input_other_updated) { in scarlett2_air_ctl_get()
2288 ucontrol->value.integer.value[0] = private->air_switch[elem->control]; in scarlett2_air_ctl_get()
2291 mutex_unlock(&private->data_mutex); in scarlett2_air_ctl_get()
2300 struct scarlett2_data *private = mixer->private_data; in scarlett2_air_ctl_put() local
2305 mutex_lock(&private->data_mutex); in scarlett2_air_ctl_put()
2307 oval = private->air_switch[index]; in scarlett2_air_ctl_put()
2313 private->air_switch[index] = val; in scarlett2_air_ctl_put()
2322 mutex_unlock(&private->data_mutex); in scarlett2_air_ctl_put()
2341 struct scarlett2_data *private = mixer->private_data; in scarlett2_phantom_ctl_get() local
2344 mutex_lock(&private->data_mutex); in scarlett2_phantom_ctl_get()
2346 if (private->input_other_updated) { in scarlett2_phantom_ctl_get()
2352 private->phantom_switch[elem->control]; in scarlett2_phantom_ctl_get()
2355 mutex_unlock(&private->data_mutex); in scarlett2_phantom_ctl_get()
2364 struct scarlett2_data *private = mixer->private_data; in scarlett2_phantom_ctl_put() local
2369 mutex_lock(&private->data_mutex); in scarlett2_phantom_ctl_put()
2371 oval = private->phantom_switch[index]; in scarlett2_phantom_ctl_put()
2377 private->phantom_switch[index] = val; in scarlett2_phantom_ctl_put()
2386 mutex_unlock(&private->data_mutex); in scarlett2_phantom_ctl_put()
2404 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_phantom_persistence_ctl_get() local
2406 ucontrol->value.integer.value[0] = private->phantom_persistence; in scarlett2_phantom_persistence_ctl_get()
2415 struct scarlett2_data *private = mixer->private_data; in scarlett2_phantom_persistence_ctl_put() local
2420 mutex_lock(&private->data_mutex); in scarlett2_phantom_persistence_ctl_put()
2422 oval = private->phantom_persistence; in scarlett2_phantom_persistence_ctl_put()
2428 private->phantom_persistence = val; in scarlett2_phantom_persistence_ctl_put()
2437 mutex_unlock(&private->data_mutex); in scarlett2_phantom_persistence_ctl_put()
2453 struct scarlett2_data *private = mixer->private_data; in scarlett2_update_monitor_other() local
2454 const struct scarlett2_device_info *info = private->info; in scarlett2_update_monitor_other()
2467 private->monitor_other_updated = 0; in scarlett2_update_monitor_other()
2472 1, &private->direct_monitor_switch); in scarlett2_update_monitor_other()
2493 private->speaker_switching_switch = 0; in scarlett2_update_monitor_other()
2495 private->speaker_switching_switch = monitor_other_switch[0] + 1; in scarlett2_update_monitor_other()
2506 private->talkback_switch = 0; in scarlett2_update_monitor_other()
2508 private->talkback_switch = monitor_other_switch[1] + 1; in scarlett2_update_monitor_other()
2516 private->talkback_map[i] = bitmap & 1; in scarlett2_update_monitor_other()
2527 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_direct_monitor_ctl_get() local
2530 mutex_lock(&private->data_mutex); in scarlett2_direct_monitor_ctl_get()
2532 if (private->monitor_other_updated) { in scarlett2_direct_monitor_ctl_get()
2537 ucontrol->value.enumerated.item[0] = private->direct_monitor_switch; in scarlett2_direct_monitor_ctl_get()
2540 mutex_unlock(&private->data_mutex); in scarlett2_direct_monitor_ctl_get()
2549 struct scarlett2_data *private = mixer->private_data; in scarlett2_direct_monitor_ctl_put() local
2554 mutex_lock(&private->data_mutex); in scarlett2_direct_monitor_ctl_put()
2556 oval = private->direct_monitor_switch; in scarlett2_direct_monitor_ctl_put()
2562 private->direct_monitor_switch = val; in scarlett2_direct_monitor_ctl_put()
2571 mutex_unlock(&private->data_mutex); in scarlett2_direct_monitor_ctl_put()
2607 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_direct_monitor_ctl() local
2608 const struct scarlett2_device_info *info = private->info; in scarlett2_add_direct_monitor_ctl()
2620 0, 1, s, &private->direct_monitor_ctl); in scarlett2_add_direct_monitor_ctl()
2640 struct scarlett2_data *private = mixer->private_data; in scarlett2_speaker_switch_enum_ctl_get() local
2643 mutex_lock(&private->data_mutex); in scarlett2_speaker_switch_enum_ctl_get()
2645 if (private->monitor_other_updated) { in scarlett2_speaker_switch_enum_ctl_get()
2650 ucontrol->value.enumerated.item[0] = private->speaker_switching_switch; in scarlett2_speaker_switch_enum_ctl_get()
2653 mutex_unlock(&private->data_mutex); in scarlett2_speaker_switch_enum_ctl_get()
2663 struct scarlett2_data *private = mixer->private_data; in scarlett2_speaker_switch_enable() local
2667 int index = line_out_remap(private, i); in scarlett2_speaker_switch_enable()
2670 if (!private->vol_sw_hw_switch[index]) { in scarlett2_speaker_switch_enable()
2671 err = scarlett2_sw_hw_change(private->mixer, i, 1); in scarlett2_speaker_switch_enable()
2677 scarlett2_sw_hw_ctl_ro(private, i); in scarlett2_speaker_switch_enable()
2681 &private->sw_hw_ctls[i]->id); in scarlett2_speaker_switch_enable()
2687 private->speaker_switching_switched = 1; in scarlett2_speaker_switch_enable()
2698 struct scarlett2_data *private = mixer->private_data; in scarlett2_speaker_switch_disable() local
2703 scarlett2_sw_hw_ctl_rw(private, i); in scarlett2_speaker_switch_disable()
2705 &private->sw_hw_ctls[i]->id); in scarlett2_speaker_switch_disable()
2711 private->speaker_switching_switched = 1; in scarlett2_speaker_switch_disable()
2719 struct scarlett2_data *private = mixer->private_data; in scarlett2_speaker_switch_enum_ctl_put() local
2723 mutex_lock(&private->data_mutex); in scarlett2_speaker_switch_enum_ctl_put()
2725 oval = private->speaker_switching_switch; in scarlett2_speaker_switch_enum_ctl_put()
2731 private->speaker_switching_switch = val; in scarlett2_speaker_switch_enum_ctl_put()
2757 mutex_unlock(&private->data_mutex); in scarlett2_speaker_switch_enum_ctl_put()
2772 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_speaker_switch_ctl() local
2773 const struct scarlett2_device_info *info = private->info; in scarlett2_add_speaker_switch_ctl()
2781 &private->speaker_switching_ctl); in scarlett2_add_speaker_switch_ctl()
2801 struct scarlett2_data *private = mixer->private_data; in scarlett2_talkback_enum_ctl_get() local
2804 mutex_lock(&private->data_mutex); in scarlett2_talkback_enum_ctl_get()
2806 if (private->monitor_other_updated) { in scarlett2_talkback_enum_ctl_get()
2811 ucontrol->value.enumerated.item[0] = private->talkback_switch; in scarlett2_talkback_enum_ctl_get()
2814 mutex_unlock(&private->data_mutex); in scarlett2_talkback_enum_ctl_get()
2823 struct scarlett2_data *private = mixer->private_data; in scarlett2_talkback_enum_ctl_put() local
2827 mutex_lock(&private->data_mutex); in scarlett2_talkback_enum_ctl_put()
2829 oval = private->talkback_switch; in scarlett2_talkback_enum_ctl_put()
2835 private->talkback_switch = val; in scarlett2_talkback_enum_ctl_put()
2852 mutex_unlock(&private->data_mutex); in scarlett2_talkback_enum_ctl_put()
2869 struct scarlett2_data *private = mixer->private_data; in scarlett2_talkback_map_ctl_get() local
2872 ucontrol->value.integer.value[0] = private->talkback_map[index]; in scarlett2_talkback_map_ctl_get()
2882 struct scarlett2_data *private = mixer->private_data; in scarlett2_talkback_map_ctl_put() local
2884 private->info->port_count; in scarlett2_talkback_map_ctl_put()
2891 mutex_lock(&private->data_mutex); in scarlett2_talkback_map_ctl_put()
2893 oval = private->talkback_map[index]; in scarlett2_talkback_map_ctl_put()
2899 private->talkback_map[index] = val; in scarlett2_talkback_map_ctl_put()
2902 bitmap |= private->talkback_map[i] << i; in scarlett2_talkback_map_ctl_put()
2911 mutex_unlock(&private->data_mutex); in scarlett2_talkback_map_ctl_put()
2926 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_talkback_ctls() local
2927 const struct scarlett2_device_info *info = private->info; in scarlett2_add_talkback_ctls()
2939 &private->talkback_ctl); in scarlett2_add_talkback_ctls()
2962 struct scarlett2_data *private = mixer->private_data; in scarlett2_dim_mute_ctl_get() local
2965 mutex_lock(&private->data_mutex); in scarlett2_dim_mute_ctl_get()
2967 if (private->vol_updated) { in scarlett2_dim_mute_ctl_get()
2972 ucontrol->value.integer.value[0] = private->dim_mute[elem->control]; in scarlett2_dim_mute_ctl_get()
2975 mutex_unlock(&private->data_mutex); in scarlett2_dim_mute_ctl_get()
2984 struct scarlett2_data *private = mixer->private_data; in scarlett2_dim_mute_ctl_put() local
2985 const struct scarlett2_device_info *info = private->info; in scarlett2_dim_mute_ctl_put()
2993 mutex_lock(&private->data_mutex); in scarlett2_dim_mute_ctl_put()
2995 oval = private->dim_mute[index]; in scarlett2_dim_mute_ctl_put()
3001 private->dim_mute[index] = val; in scarlett2_dim_mute_ctl_put()
3011 int line_index = line_out_remap(private, i); in scarlett2_dim_mute_ctl_put()
3013 if (private->vol_sw_hw_switch[line_index]) { in scarlett2_dim_mute_ctl_put()
3014 private->mute_switch[line_index] = val; in scarlett2_dim_mute_ctl_put()
3017 &private->mute_ctls[i]->id); in scarlett2_dim_mute_ctl_put()
3022 mutex_unlock(&private->data_mutex); in scarlett2_dim_mute_ctl_put()
3038 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_line_out_ctls() local
3039 const struct scarlett2_device_info *info = private->info; in scarlett2_add_line_out_ctls()
3051 0, 1, s, &private->master_vol_ctl); in scarlett2_add_line_out_ctls()
3058 int index = line_out_remap(private, i); in scarlett2_add_line_out_ctls()
3071 i, 1, s, &private->vol_ctls[i]); in scarlett2_add_line_out_ctls()
3082 &private->mute_ctls[i]); in scarlett2_add_line_out_ctls()
3089 if (private->vol_sw_hw_switch[index]) in scarlett2_add_line_out_ctls()
3100 &private->sw_hw_ctls[i]); in scarlett2_add_line_out_ctls()
3107 if (private->speaker_switching_switch && i < 4) in scarlett2_add_line_out_ctls()
3108 scarlett2_sw_hw_ctl_ro(private, i); in scarlett2_add_line_out_ctls()
3118 &private->dim_mute_ctls[i]); in scarlett2_add_line_out_ctls()
3130 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_line_in_ctls() local
3131 const struct scarlett2_device_info *info = private->info; in scarlett2_add_line_in_ctls()
3142 i, 1, s, &private->level_ctls[i]); in scarlett2_add_line_in_ctls()
3151 i, 1, s, &private->pad_ctls[i]); in scarlett2_add_line_in_ctls()
3160 i, 1, s, &private->air_ctls[i]); in scarlett2_add_line_in_ctls()
3172 i, 1, s, &private->phantom_ctls[i]); in scarlett2_add_line_in_ctls()
3185 i, 1, s, &private->phantom_ctls[i]); in scarlett2_add_line_in_ctls()
3220 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_mixer_ctl_get() local
3222 ucontrol->value.integer.value[0] = private->mix[elem->control]; in scarlett2_mixer_ctl_get()
3231 struct scarlett2_data *private = mixer->private_data; in scarlett2_mixer_ctl_put() local
3232 const struct scarlett2_device_info *info = private->info; in scarlett2_mixer_ctl_put()
3237 mutex_lock(&private->data_mutex); in scarlett2_mixer_ctl_put()
3239 oval = private->mix[index]; in scarlett2_mixer_ctl_put()
3248 private->mix[index] = val; in scarlett2_mixer_ctl_put()
3254 mutex_unlock(&private->data_mutex); in scarlett2_mixer_ctl_put()
3278 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_mixer_ctls() local
3279 const struct scarlett2_device_info *info = private->info; in scarlett2_add_mixer_ctls()
3310 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_mux_src_enum_ctl_info() local
3311 const struct scarlett2_device_info *info = private->info; in scarlett2_mux_src_enum_ctl_info()
3314 int items = private->num_mux_srcs; in scarlett2_mux_src_enum_ctl_info()
3346 struct scarlett2_data *private = mixer->private_data; in scarlett2_mux_src_enum_ctl_get() local
3347 int index = line_out_remap(private, elem->control); in scarlett2_mux_src_enum_ctl_get()
3350 mutex_lock(&private->data_mutex); in scarlett2_mux_src_enum_ctl_get()
3352 if (private->mux_updated) { in scarlett2_mux_src_enum_ctl_get()
3357 ucontrol->value.enumerated.item[0] = private->mux[index]; in scarlett2_mux_src_enum_ctl_get()
3360 mutex_unlock(&private->data_mutex); in scarlett2_mux_src_enum_ctl_get()
3369 struct scarlett2_data *private = mixer->private_data; in scarlett2_mux_src_enum_ctl_put() local
3370 int index = line_out_remap(private, elem->control); in scarlett2_mux_src_enum_ctl_put()
3373 mutex_lock(&private->data_mutex); in scarlett2_mux_src_enum_ctl_put()
3375 oval = private->mux[index]; in scarlett2_mux_src_enum_ctl_put()
3377 private->num_mux_srcs - 1U); in scarlett2_mux_src_enum_ctl_put()
3382 private->mux[index] = val; in scarlett2_mux_src_enum_ctl_put()
3388 mutex_unlock(&private->data_mutex); in scarlett2_mux_src_enum_ctl_put()
3402 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_mux_enums() local
3403 const struct scarlett2_device_info *info = private->info; in scarlett2_add_mux_enums()
3424 &private->mux_ctls[i]); in scarlett2_add_mux_enums()
3476 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_meter_ctl() local
3479 if (!private->info->has_mixer) in scarlett2_add_meter_ctl()
3483 0, private->num_mux_dsts, in scarlett2_add_meter_ctl()
3493 struct scarlett2_data *private = elem->head.mixer->private_data; in scarlett2_msd_ctl_get() local
3495 ucontrol->value.integer.value[0] = private->msd_switch; in scarlett2_msd_ctl_get()
3504 struct scarlett2_data *private = mixer->private_data; in scarlett2_msd_ctl_put() local
3508 mutex_lock(&private->data_mutex); in scarlett2_msd_ctl_put()
3510 oval = private->msd_switch; in scarlett2_msd_ctl_put()
3516 private->msd_switch = val; in scarlett2_msd_ctl_put()
3525 mutex_unlock(&private->data_mutex); in scarlett2_msd_ctl_put()
3539 struct scarlett2_data *private = mixer->private_data; in scarlett2_add_msd_ctl() local
3540 const struct scarlett2_device_info *info = private->info; in scarlett2_add_msd_ctl()
3546 if (!private->msd_switch && !(mixer->chip->setup & SCARLETT2_MSD_ENABLE)) in scarlett2_add_msd_ctl()
3558 struct scarlett2_data *private = mixer->private_data; in scarlett2_private_free() local
3560 cancel_delayed_work_sync(&private->work); in scarlett2_private_free()
3561 kfree(private); in scarlett2_private_free()
3567 struct scarlett2_data *private = mixer->private_data; in scarlett2_private_suspend() local
3569 if (cancel_delayed_work_sync(&private->work)) in scarlett2_private_suspend()
3570 scarlett2_config_save(private->mixer); in scarlett2_private_suspend()
3575 static void scarlett2_count_mux_io(struct scarlett2_data *private) in scarlett2_count_mux_io() argument
3577 const struct scarlett2_device_info *info = private->info; in scarlett2_count_mux_io()
3588 private->num_mux_srcs = srcs; in scarlett2_count_mux_io()
3589 private->num_mux_dsts = dsts; in scarlett2_count_mux_io()
3598 struct scarlett2_data *private) in scarlett2_find_fc_interface() argument
3613 private->bInterfaceNumber = desc->bInterfaceNumber; in scarlett2_find_fc_interface()
3614 private->bEndpointAddress = epd->bEndpointAddress & in scarlett2_find_fc_interface()
3616 private->wMaxPacketSize = le16_to_cpu(epd->wMaxPacketSize); in scarlett2_find_fc_interface()
3617 private->bInterval = epd->bInterval; in scarlett2_find_fc_interface()
3628 struct scarlett2_data *private = in scarlett2_init_private() local
3631 if (!private) in scarlett2_init_private()
3634 mutex_init(&private->usb_mutex); in scarlett2_init_private()
3635 mutex_init(&private->data_mutex); in scarlett2_init_private()
3636 INIT_DELAYED_WORK(&private->work, scarlett2_config_save_work); in scarlett2_init_private()
3638 mixer->private_data = private; in scarlett2_init_private()
3642 private->info = info; in scarlett2_init_private()
3643 scarlett2_count_mux_io(private); in scarlett2_init_private()
3644 private->scarlett2_seq = 0; in scarlett2_init_private()
3645 private->mixer = mixer; in scarlett2_init_private()
3647 return scarlett2_find_fc_interface(mixer->chip->dev, private); in scarlett2_init_private()
3654 struct scarlett2_data *private = mixer->private_data; in scarlett2_usb_init() local
3662 err = scarlett2_usb_rx(dev, private->bInterfaceNumber, in scarlett2_usb_init()
3668 private->scarlett2_seq = 1; in scarlett2_usb_init()
3674 private->scarlett2_seq = 1; in scarlett2_usb_init()
3681 struct scarlett2_data *private = mixer->private_data; in scarlett2_read_configs() local
3682 const struct scarlett2_device_info *info = private->info; in scarlett2_read_configs()
3694 1, &private->msd_switch); in scarlett2_read_configs()
3699 if (private->msd_switch) in scarlett2_read_configs()
3725 private->dim_mute[i] = !!volume_status.dim_mute[i]; in scarlett2_read_configs()
3727 private->master_vol = clamp( in scarlett2_read_configs()
3734 private->vol_sw_hw_switch[i] = in scarlett2_read_configs()
3738 volume = private->vol_sw_hw_switch[i] in scarlett2_read_configs()
3743 private->vol[i] = volume; in scarlett2_read_configs()
3745 mute = private->vol_sw_hw_switch[i] in scarlett2_read_configs()
3746 ? private->dim_mute[SCARLETT2_BUTTON_MUTE] in scarlett2_read_configs()
3748 private->mute_switch[i] = mute; in scarlett2_read_configs()
3764 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_sync() local
3766 private->sync_updated = 1; in scarlett2_notify_sync()
3769 &private->sync_ctl->id); in scarlett2_notify_sync()
3777 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_monitor() local
3778 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_monitor()
3788 private->vol_updated = 1; in scarlett2_notify_monitor()
3791 &private->master_vol_ctl->id); in scarlett2_notify_monitor()
3794 if (private->vol_sw_hw_switch[line_out_remap(private, i)]) in scarlett2_notify_monitor()
3796 &private->vol_ctls[i]->id); in scarlett2_notify_monitor()
3804 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_dim_mute() local
3805 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_dim_mute()
3811 private->vol_updated = 1; in scarlett2_notify_dim_mute()
3818 &private->dim_mute_ctls[i]->id); in scarlett2_notify_dim_mute()
3821 if (private->vol_sw_hw_switch[line_out_remap(private, i)]) in scarlett2_notify_dim_mute()
3823 &private->mute_ctls[i]->id); in scarlett2_notify_dim_mute()
3831 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_input_other() local
3832 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_input_other()
3835 private->input_other_updated = 1; in scarlett2_notify_input_other()
3839 &private->level_ctls[i]->id); in scarlett2_notify_input_other()
3842 &private->pad_ctls[i]->id); in scarlett2_notify_input_other()
3845 &private->air_ctls[i]->id); in scarlett2_notify_input_other()
3848 &private->phantom_ctls[i]->id); in scarlett2_notify_input_other()
3858 struct scarlett2_data *private = mixer->private_data; in scarlett2_notify_monitor_other() local
3859 const struct scarlett2_device_info *info = private->info; in scarlett2_notify_monitor_other()
3861 private->monitor_other_updated = 1; in scarlett2_notify_monitor_other()
3865 &private->direct_monitor_ctl->id); in scarlett2_notify_monitor_other()
3871 &private->speaker_switching_ctl->id); in scarlett2_notify_monitor_other()
3875 &private->talkback_ctl->id); in scarlett2_notify_monitor_other()
3880 if (private->speaker_switching_switched) { in scarlett2_notify_monitor_other()
3885 private->speaker_switching_switched = 0; in scarlett2_notify_monitor_other()
3886 private->mux_updated = 1; in scarlett2_notify_monitor_other()
3888 for (i = 0; i < private->num_mux_dsts; i++) in scarlett2_notify_monitor_other()
3890 &private->mux_ctls[i]->id); in scarlett2_notify_monitor_other()
3929 struct scarlett2_data *private = mixer->private_data; in scarlett2_init_notify() local
3930 unsigned int pipe = usb_rcvintpipe(dev, private->bEndpointAddress); in scarlett2_init_notify()
3946 transfer_buffer = kmalloc(private->wMaxPacketSize, GFP_KERNEL); in scarlett2_init_notify()
3951 transfer_buffer, private->wMaxPacketSize, in scarlett2_init_notify()
3952 scarlett2_notify, mixer, private->bInterval); in scarlett2_init_notify()