#include <linux/slab.h>
#include <linux/usb.h>
#include <linux/moduleparam.h>
#include <sound/control.h>
#include <sound/tlv.h>
#include <sound/hwdep.h>
#include <uapi/sound/scarlett2.h>
#include "usbaudio.h"
#include "mixer.h"
#include "helper.h"
#include "mixer_scarlett2.h"
#define SCARLETT2_MSD_ENABLE …
#define SCARLETT2_DISABLE …
#define SCARLETT2_VOLUME_BIAS …
#define SCARLETT2_MAX_GAIN_VALUE …
#define SCARLETT2_MAX_BLUETOOTH_VOLUME …
#define SCARLETT2_MIXER_MIN_DB …
#define SCARLETT2_MIXER_BIAS …
#define SCARLETT2_MIXER_MAX_DB …
#define SCARLETT2_MIXER_MAX_VALUE …
#define SCARLETT2_MIXER_VALUE_COUNT …
static const u16 scarlett2_mixer_values[SCARLETT2_MIXER_VALUE_COUNT] = …;
#define SCARLETT2_ANALOGUE_MAX …
#define SCARLETT2_LEVEL_SWITCH_MAX …
#define SCARLETT2_PAD_SWITCH_MAX …
#define SCARLETT2_AIR_SWITCH_MAX …
#define SCARLETT2_DSP_SWITCH_MAX …
#define SCARLETT2_INPUT_MUTE_SWITCH_MAX …
#define SCARLETT2_PHANTOM_SWITCH_MAX …
#define SCARLETT2_INPUT_GAIN_MAX …
#define SCARLETT2_INPUT_MIX_MAX …
#define SCARLETT2_OUTPUT_MIX_MAX …
#define SCARLETT2_MIX_MAX …
#define SCARLETT2_MONITOR_MIX_MAX …
#define SCARLETT2_MUX_MAX …
#define SCARLETT2_MAX_SRCS …
#define SCARLETT2_MAX_METERS …
struct compressor_param { … };
static const struct compressor_param compressor_params[] = …;
#define SCARLETT2_COMPRESSOR_PARAM_COUNT …
#define SCARLETT2_COMPRESSOR_CTLS_MAX …
#define SCARLETT2_PRECOMP_FLT_CTLS_MAX …
#define SCARLETT2_PEQ_FLT_CTLS_MAX …
#define SCARLETT2_BIQUAD_COEFFS …
#define SCARLETT2_PRECOMP_FLT_VALUES_MAX …
#define SCARLETT2_PEQ_FLT_VALUES_MAX …
#define SCARLETT2_PEQ_FLT_SLOTS_MAX …
enum { … };
enum { … };
enum { … };
#define SCARLETT2_AG_TARGET_MIN …
enum { … };
enum { … };
static const char *const scarlett2_dim_mute_names[SCARLETT2_DIM_MUTE_COUNT] = …;
static const char *const scarlett2_autogain_status_gen4[] = …;
static const char *const scarlett2_autogain_status_vocaster[] = …;
enum { … };
struct scarlett2_notification { … };
static void scarlett2_notify_ack(struct usb_mixer_interface *mixer);
static void scarlett2_notify_sync(struct usb_mixer_interface *mixer);
static void scarlett2_notify_dim_mute(struct usb_mixer_interface *mixer);
static void scarlett2_notify_monitor(struct usb_mixer_interface *mixer);
static void scarlett2_notify_volume(struct usb_mixer_interface *mixer);
static void scarlett2_notify_input_level(struct usb_mixer_interface *mixer);
static void scarlett2_notify_input_pad(struct usb_mixer_interface *mixer);
static void scarlett2_notify_input_air(struct usb_mixer_interface *mixer);
static void scarlett2_notify_input_dsp(struct usb_mixer_interface *mixer);
static void scarlett2_notify_input_mute(struct usb_mixer_interface *mixer);
static void scarlett2_notify_input_phantom(struct usb_mixer_interface *mixer);
static void scarlett2_notify_input_other(struct usb_mixer_interface *mixer);
static void scarlett2_notify_input_select(struct usb_mixer_interface *mixer);
static void scarlett2_notify_input_gain(struct usb_mixer_interface *mixer);
static void scarlett2_notify_autogain(struct usb_mixer_interface *mixer);
static void scarlett2_notify_input_safe(struct usb_mixer_interface *mixer);
static void scarlett2_notify_monitor_other(struct usb_mixer_interface *mixer);
static void scarlett2_notify_direct_monitor(struct usb_mixer_interface *mixer);
static void scarlett2_notify_power_status(struct usb_mixer_interface *mixer);
static void scarlett2_notify_pcm_input_switch(
struct usb_mixer_interface *mixer);
static void scarlett2_notify_bluetooth(struct usb_mixer_interface *mixer);
static const struct scarlett2_notification scarlett2_notifications[] = …;
static const struct scarlett2_notification scarlett3a_notifications[] = …;
static const struct scarlett2_notification vocaster_notifications[] = …;
static const struct scarlett2_notification scarlett4_solo_notifications[] = …;
static const struct scarlett2_notification scarlett4_2i2_notifications[] = …;
static const struct scarlett2_notification scarlett4_4i4_notifications[] = …;
enum { … };
static const int scarlett2_ag_target_configs[] = …;
static const char *const scarlett2_ag_target_names[] = …;
struct scarlett2_config { … };
struct scarlett2_config_set { … };
static const DECLARE_TLV_DB_MINMAX(
db_scale_vocaster_gain, 0, 70 * 100
);
static const DECLARE_TLV_DB_MINMAX(
db_scale_gen4_gain, 0, 69 * 100
);
static const struct scarlett2_config_set scarlett2_config_set_gen2a = …;
static const struct scarlett2_config_set scarlett2_config_set_gen2b = …;
static const struct scarlett2_config_set scarlett2_config_set_gen3a = …;
static const struct scarlett2_config_set scarlett2_config_set_gen3b = …;
static const struct scarlett2_config_set scarlett2_config_set_gen3c = …;
static const struct scarlett2_config_set scarlett2_config_set_vocaster = …;
static const struct scarlett2_config_set scarlett2_config_set_gen4_solo = …;
static const struct scarlett2_config_set scarlett2_config_set_gen4_2i2 = …;
static const struct scarlett2_config_set scarlett2_config_set_gen4_4i4 = …;
static const struct scarlett2_config_set scarlett2_config_set_clarett = …;
struct scarlett2_port { … };
static const struct scarlett2_port scarlett2_ports[SCARLETT2_PORT_TYPE_COUNT] = …;
#define SCARLETT2_MUX_TABLES …
#define SCARLETT2_MAX_MUX_ENTRIES …
struct scarlett2_mux_entry { … };
#define SCARLETT2_MAX_METER_ENTRIES …
struct scarlett2_meter_entry { … };
struct scarlett2_device_info { … };
struct scarlett2_data { … };
static const struct scarlett2_device_info s6i6_gen2_info = …;
static const struct scarlett2_device_info s18i8_gen2_info = …;
static const struct scarlett2_device_info s18i20_gen2_info = …;
static const struct scarlett2_device_info solo_gen3_info = …;
static const struct scarlett2_device_info s2i2_gen3_info = …;
static const struct scarlett2_device_info s4i4_gen3_info = …;
static const struct scarlett2_device_info s8i6_gen3_info = …;
static const u8 scarlett2_spdif_s18i8_gen3_values[] = …;
static const char * const scarlett2_spdif_s18i8_gen3_texts[] = …;
static const struct scarlett2_device_info s18i8_gen3_info = …;
static const u8 scarlett2_spdif_s18i20_gen3_values[] = …;
static const char * const scarlett2_spdif_s18i20_gen3_texts[] = …;
static const struct scarlett2_device_info s18i20_gen3_info = …;
static const struct scarlett2_device_info vocaster_one_info = …;
static const struct scarlett2_device_info vocaster_two_info = …;
static const struct scarlett2_device_info solo_gen4_info = …;
static const struct scarlett2_device_info s2i2_gen4_info = …;
static const struct scarlett2_device_info s4i4_gen4_info = …;
static const struct scarlett2_device_info clarett_2pre_info = …;
static const u8 scarlett2_spdif_clarett_values[] = …;
static const char * const scarlett2_spdif_clarett_texts[] = …;
static const struct scarlett2_device_info clarett_4pre_info = …;
static const struct scarlett2_device_info clarett_8pre_info = …;
struct scarlett2_device_entry { … };
static const struct scarlett2_device_entry scarlett2_devices[] = …;
static int scarlett2_get_port_start_num(
const int port_count[][SCARLETT2_PORT_DIRNS],
int direction, int port_type)
{ … }
#define SCARLETT2_USB_CMD_INIT …
#define SCARLETT2_USB_CMD_REQ …
#define SCARLETT2_USB_CMD_RESP …
#define SCARLETT2_USB_INIT_1 …
#define SCARLETT2_USB_INIT_2 …
#define SCARLETT2_USB_REBOOT …
#define SCARLETT2_USB_GET_METER …
#define SCARLETT2_USB_GET_MIX …
#define SCARLETT2_USB_SET_MIX …
#define SCARLETT2_USB_GET_MUX …
#define SCARLETT2_USB_SET_MUX …
#define SCARLETT2_USB_INFO_FLASH …
#define SCARLETT2_USB_INFO_SEGMENT …
#define SCARLETT2_USB_ERASE_SEGMENT …
#define SCARLETT2_USB_GET_ERASE …
#define SCARLETT2_USB_WRITE_SEGMENT …
#define SCARLETT2_USB_READ_SEGMENT …
#define SCARLETT2_USB_GET_SYNC …
#define SCARLETT2_USB_GET_DATA …
#define SCARLETT2_USB_SET_DATA …
#define SCARLETT2_USB_DATA_CMD …
#define SCARLETT2_USB_CONFIG_SAVE …
#define SCARLETT2_USB_METER_LEVELS_GET_MAGIC …
#define SCARLETT2_FLASH_BLOCK_SIZE …
#define SCARLETT2_FLASH_RW_MAX …
#define SCARLETT2_SEGMENT_NUM_MIN …
#define SCARLETT2_SEGMENT_NUM_MAX …
#define SCARLETT2_SEGMENT_SETTINGS_NAME …
#define SCARLETT2_SEGMENT_FIRMWARE_NAME …
struct scarlett2_usb_packet { … };
static void scarlett2_fill_request_header(struct scarlett2_data *private,
struct scarlett2_usb_packet *req,
u32 cmd, u16 req_size)
{ … }
static int scarlett2_usb_tx(struct usb_device *dev, int interface,
void *buf, u16 size)
{ … }
static int scarlett2_usb_rx(struct usb_device *dev, int interface,
u32 usb_req, void *buf, u16 size)
{ … }
static int scarlett2_usb(
struct usb_mixer_interface *mixer, u32 cmd,
void *req_data, u16 req_size, void *resp_data, u16 resp_size)
{ … }
static int scarlett2_usb_get(
struct usb_mixer_interface *mixer,
int offset, void *buf, int size)
{ … }
static int scarlett2_has_config_item(
struct scarlett2_data *private, int config_item_num)
{ … }
static int scarlett2_usb_get_config(
struct usb_mixer_interface *mixer,
int config_item_num, int count, void *buf)
{ … }
static int scarlett2_usb_set_data(
struct usb_mixer_interface *mixer,
int offset, int size, int value)
{ … }
static int scarlett2_usb_set_data_buf(
struct usb_mixer_interface *mixer,
int offset, int size, int count, void *buf)
{ … }
static int scarlett2_usb_activate_config(
struct usb_mixer_interface *mixer, int activate)
{ … }
static int scarlett2_usb_set_config(
struct usb_mixer_interface *mixer,
int config_item_num, int index, int value)
{ … }
static int scarlett2_usb_set_config_buf(
struct usb_mixer_interface *mixer,
int config_item_num, int index, int count, void *buf)
{ … }
static void scarlett2_config_save(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_config_save_work(struct work_struct *work)
{ … }
static int scarlett2_usb_get_sync_status(
struct usb_mixer_interface *mixer,
u8 *sync)
{ … }
static int scarlett2_has_mixer(struct scarlett2_data *private)
{ … }
static int scarlett2_mixer_value_to_db(int value)
{ … }
static int scarlett2_usb_get_mix(struct usb_mixer_interface *mixer,
int mix_num)
{ … }
static int scarlett2_usb_set_mix(struct usb_mixer_interface *mixer,
int mix_num)
{ … }
static u32 scarlett2_mux_src_num_to_id(
const int port_count[][SCARLETT2_PORT_DIRNS], int num)
{ … }
static u32 scarlett2_mux_id_to_num(
const int port_count[][SCARLETT2_PORT_DIRNS], int direction, u32 id)
{ … }
static void scarlett2_usb_populate_mux(struct scarlett2_data *private,
u32 mux_entry)
{ … }
static void scarlett2_update_meter_level_map(struct scarlett2_data *private)
{ … }
static int scarlett2_usb_get_mux(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_usb_set_mux(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_usb_get_meter_levels(struct usb_mixer_interface *mixer,
u16 num_meters, u16 *levels)
{ … }
static uint8_t scarlett2_decode_muteable(uint8_t v)
{ … }
static int scarlett2_add_new_ctl(struct usb_mixer_interface *mixer,
const struct snd_kcontrol_new *ncontrol,
int index, int channels, const char *name,
struct snd_kcontrol **kctl_return)
{ … }
static int scarlett2_firmware_version_ctl_get(
struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_firmware_version_ctl_info(
struct snd_kcontrol *kctl,
struct snd_ctl_elem_info *uinfo)
{ … }
static const struct snd_kcontrol_new scarlett2_firmware_version_ctl = …;
static int scarlett2_add_firmware_version_ctl(
struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_min_firmware_version_ctl_get(
struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_min_firmware_version_ctl_info(
struct snd_kcontrol *kctl,
struct snd_ctl_elem_info *uinfo)
{ … }
static const struct snd_kcontrol_new scarlett2_min_firmware_version_ctl = …;
static int scarlett2_add_min_firmware_version_ctl(
struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_update_sync(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_sync_ctl_info(struct snd_kcontrol *kctl,
struct snd_ctl_elem_info *uinfo)
{ … }
static int scarlett2_sync_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_sync_ctl = …;
static int scarlett2_add_sync_ctl(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_check_input_phantom_updated(struct usb_mixer_interface *);
static int scarlett2_phantom_is_switching(struct scarlett2_data *, int);
static void scarlett2_set_ctl_access(struct snd_kcontrol *kctl, int val)
{ … }
static int scarlett2_autogain_is_running(struct scarlett2_data *private)
{ … }
static int scarlett2_update_autogain(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_autogain_update_access(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_autogain_notify_access(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_check_autogain_updated(
struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_check_put_during_autogain(
struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_autogain_switch_ctl_info(
struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo)
{ … }
static int scarlett2_autogain_switch_ctl_get(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_autogain_status_ctl_get(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_autogain_switch_ctl_put(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_autogain_status_ctl_info(
struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo)
{ … }
static const struct snd_kcontrol_new scarlett2_autogain_switch_ctl = …;
static const struct snd_kcontrol_new scarlett2_autogain_status_ctl = …;
static int scarlett2_ag_target_ctl_info(
struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo)
{ … }
static int scarlett2_ag_target_ctl_get(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_ag_target_ctl_put(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static const DECLARE_TLV_DB_MINMAX(
db_scale_ag_target, SCARLETT2_AG_TARGET_MIN * 100, 0
);
static const struct snd_kcontrol_new scarlett2_ag_target_ctl = …;
static int scarlett2_update_input_select(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_input_select_ctl_get(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_input_select_ctl_put(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_input_select_ctl_info(
struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo)
{ … }
static const struct snd_kcontrol_new scarlett2_input_select_ctl = …;
static int scarlett2_autogain_disables_ctl_info(struct snd_kcontrol *kctl,
struct snd_ctl_elem_info *uinfo)
{ … }
static int scarlett2_input_link_ctl_get(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_input_link_ctl_put(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_input_link_ctl = …;
static int scarlett2_update_input_gain(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_input_gain_ctl_info(struct snd_kcontrol *kctl,
struct snd_ctl_elem_info *uinfo)
{ … }
static int scarlett2_input_gain_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_input_gain_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_input_gain_ctl = …;
static int scarlett2_update_input_safe(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_safe_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_safe_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_safe_ctl = …;
static int scarlett2_update_pcm_input_switch(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_pcm_input_switch_ctl_get(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_pcm_input_switch_ctl_put(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_pcm_input_switch_ctl_info(
struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo)
{ … }
static const struct snd_kcontrol_new scarlett2_pcm_input_switch_ctl = …;
static int scarlett2_update_volumes(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_volume_ctl_info(struct snd_kcontrol *kctl,
struct snd_ctl_elem_info *uinfo)
{ … }
static int scarlett2_master_volume_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_headphone_volume_ctl_get(
struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int line_out_remap(struct scarlett2_data *private, int index)
{ … }
static int scarlett2_volume_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_volume_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const DECLARE_TLV_DB_MINMAX(
db_scale_scarlett2_volume, -SCARLETT2_VOLUME_BIAS * 100, 0
);
static const struct snd_kcontrol_new scarlett2_master_volume_ctl = …;
static const struct snd_kcontrol_new scarlett2_headphone_volume_ctl = …;
static const struct snd_kcontrol_new scarlett2_line_out_volume_ctl = …;
static int scarlett2_update_dim_mute(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_mute_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_mute_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_mute_ctl = …;
static void scarlett2_sw_hw_ctl_ro(struct scarlett2_data *private, int index)
{ … }
static void scarlett2_sw_hw_ctl_rw(struct scarlett2_data *private, int index)
{ … }
static int scarlett2_sw_hw_enum_ctl_info(struct snd_kcontrol *kctl,
struct snd_ctl_elem_info *uinfo)
{ … }
static int scarlett2_sw_hw_enum_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static void scarlett2_vol_ctl_set_writable(struct usb_mixer_interface *mixer,
int index, int value)
{ … }
static int scarlett2_sw_hw_change(struct usb_mixer_interface *mixer,
int ctl_index, int val)
{ … }
static int scarlett2_sw_hw_enum_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_sw_hw_enum_ctl = …;
static int scarlett2_update_input_level(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_level_enum_ctl_info(struct snd_kcontrol *kctl,
struct snd_ctl_elem_info *uinfo)
{ … }
static int scarlett2_level_enum_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_level_enum_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_level_enum_ctl = …;
static int scarlett2_update_input_pad(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_pad_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_pad_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_pad_ctl = …;
static int scarlett2_update_input_air(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_air_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_air_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_air_with_drive_ctl_info(
struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo)
{ … }
static const struct snd_kcontrol_new scarlett2_air_ctl[2] = …;
static int scarlett2_update_input_dsp(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_dsp_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_dsp_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_dsp_ctl = …;
static int scarlett2_update_compressor_values(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_compressor_ctl_get(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_compressor_ctl_put(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_compressor_ctl_info(
struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo)
{ … }
static const struct snd_kcontrol_new scarlett2_compressor_ctl = …;
static int scarlett2_precomp_flt_switch_ctl_get(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_peq_flt_switch_ctl_get(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_precomp_flt_switch_ctl_put(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_peq_flt_switch_ctl_put(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_precomp_flt_switch_ctl = …;
static const struct snd_kcontrol_new scarlett2_peq_flt_switch_ctl = …;
static int scarlett2_update_filter_values(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_precomp_flt_ctl_get(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_peq_flt_ctl_get(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_precomp_flt_ctl_put(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_peq_flt_ctl_put(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_flt_ctl_info(
struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo)
{ … }
static const struct snd_kcontrol_new scarlett2_precomp_flt_ctl = …;
static const struct snd_kcontrol_new scarlett2_peq_flt_ctl = …;
static int scarlett2_update_input_mute(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_input_mute_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_input_mute_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_input_mute_ctl = …;
static int scarlett2_update_input_phantom(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_phantom_is_switching(
struct scarlett2_data *private, int line_num)
{ … }
static void scarlett2_phantom_update_access(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_phantom_notify_access(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_check_input_phantom_updated(
struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_phantom_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_phantom_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_phantom_ctl = …;
static int scarlett2_phantom_persistence_ctl_get(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_phantom_persistence_ctl_put(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_phantom_persistence_ctl = …;
static int scarlett2_update_monitor_other(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_speaker_switch_enum_ctl_info(
struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo)
{ … }
static int scarlett2_speaker_switch_enum_ctl_get(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_speaker_switch_enable(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_speaker_switch_disable(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_speaker_switch_enum_ctl_put(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_speaker_switch_enum_ctl = …;
static int scarlett2_add_speaker_switch_ctl(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_talkback_enum_ctl_info(
struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo)
{ … }
static int scarlett2_talkback_enum_ctl_get(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_talkback_enum_ctl_put(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_talkback_enum_ctl = …;
static int scarlett2_talkback_map_ctl_get(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_talkback_map_ctl_put(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_talkback_map_ctl = …;
static int scarlett2_add_talkback_ctls(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_dim_mute_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_dim_mute_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_dim_mute_ctl = …;
static int scarlett2_add_line_out_ctls(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_add_dsp_ctls(struct usb_mixer_interface *mixer, int i)
{ … }
static int scarlett2_add_line_in_ctls(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_update_mix(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_mixer_ctl_info(struct snd_kcontrol *kctl,
struct snd_ctl_elem_info *uinfo)
{ … }
static int scarlett2_mixer_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_mixer_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const DECLARE_TLV_DB_MINMAX(
db_scale_scarlett2_mixer,
SCARLETT2_MIXER_MIN_DB * 100,
SCARLETT2_MIXER_MAX_DB * 100
);
static const struct snd_kcontrol_new scarlett2_mixer_ctl = …;
static int scarlett2_add_mixer_ctls(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_update_direct_monitor(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_update_monitor_mix(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_direct_monitor_ctl_get(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_direct_monitor_ctl_put(
struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_direct_monitor_stereo_enum_ctl_info(
struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo)
{ … }
static const struct snd_kcontrol_new scarlett2_direct_monitor_ctl[2] = …;
static int scarlett2_monitor_mix_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_monitor_mix_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_monitor_mix_ctl = …;
static int scarlett2_add_direct_monitor_ctls(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_mux_src_enum_ctl_info(struct snd_kcontrol *kctl,
struct snd_ctl_elem_info *uinfo)
{ … }
static int scarlett2_mux_src_enum_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_mux_src_enum_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_mux_src_enum_ctl = …;
static int scarlett2_add_mux_enums(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_meter_ctl_info(struct snd_kcontrol *kctl,
struct snd_ctl_elem_info *uinfo)
{ … }
static int scarlett2_meter_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_meter_ctl = …;
static int scarlett2_add_meter_ctl(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_msd_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_msd_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_msd_ctl = …;
static int scarlett2_add_msd_ctl(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_standalone_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_standalone_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_standalone_ctl = …;
static int scarlett2_add_standalone_ctl(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_update_power_status(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_power_status_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_power_status_ctl_info(
struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo)
{ … }
static const struct snd_kcontrol_new scarlett2_power_status_ctl = …;
static int scarlett2_add_power_status_ctl(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_update_bluetooth_volume(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_bluetooth_volume_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_bluetooth_volume_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_bluetooth_volume_ctl_info(
struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo)
{ … }
static const struct snd_kcontrol_new scarlett2_bluetooth_volume_ctl = …;
static int scarlett2_add_bluetooth_volume_ctl(
struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_update_spdif_mode(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_spdif_mode_ctl_info(struct snd_kcontrol *kctl,
struct snd_ctl_elem_info *uinfo)
{ … }
static int scarlett2_spdif_mode_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int scarlett2_spdif_mode_ctl_put(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new scarlett2_spdif_mode_ctl = …;
static int scarlett2_add_spdif_mode_ctl(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_sync(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_monitor(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_volume(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_dim_mute(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_input_level(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_input_pad(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_input_air(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_input_dsp(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_input_mute(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_input_phantom(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_input_other(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_input_select(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_input_gain(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_autogain(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_input_safe(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_monitor_other(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_direct_monitor(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_power_status(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_mux(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_pcm_input_switch(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_bluetooth(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify_ack(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_notify(struct urb *urb)
{ … }
static void scarlett2_private_free(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_private_suspend(struct usb_mixer_interface *mixer)
{ … }
static void scarlett2_count_io(struct scarlett2_data *private)
{ … }
static int scarlett2_find_fc_interface(struct usb_device *dev,
struct scarlett2_data *private)
{ … }
static int scarlett2_init_private(struct usb_mixer_interface *mixer,
const struct scarlett2_device_entry *entry)
{ … }
static int scarlett2_init_notify(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_usb_init(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_get_flash_segment_nums(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_read_configs(struct usb_mixer_interface *mixer)
{ … }
static const struct scarlett2_device_entry *get_scarlett2_device_entry(
struct usb_mixer_interface *mixer)
{ … }
static int snd_scarlett2_controls_create(
struct usb_mixer_interface *mixer,
const struct scarlett2_device_entry *entry)
{ … }
static void scarlett2_lock(struct scarlett2_data *private)
{ … }
static int scarlett2_get_erase_progress(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_wait_for_erase(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_reboot(struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_ioctl_select_flash_segment(
struct usb_mixer_interface *mixer,
unsigned long arg)
{ … }
static int scarlett2_ioctl_erase_flash_segment(
struct usb_mixer_interface *mixer)
{ … }
static int scarlett2_ioctl_get_erase_progress(
struct usb_mixer_interface *mixer,
unsigned long arg)
{ … }
static int scarlett2_hwdep_open(struct snd_hwdep *hw, struct file *file)
{ … }
static int scarlett2_hwdep_ioctl(struct snd_hwdep *hw, struct file *file,
unsigned int cmd, unsigned long arg)
{ … }
static long scarlett2_hwdep_read(struct snd_hwdep *hw,
char __user *buf,
long count, loff_t *offset)
{ … }
static long scarlett2_hwdep_write(struct snd_hwdep *hw,
const char __user *buf,
long count, loff_t *offset)
{ … }
static int scarlett2_hwdep_release(struct snd_hwdep *hw, struct file *file)
{ … }
static int scarlett2_hwdep_init(struct usb_mixer_interface *mixer)
{ … }
int snd_scarlett2_init(struct usb_mixer_interface *mixer)
{ … }