Lines Matching full:private

571 static void scarlett2_fill_request_header(struct scarlett2_mixer_data *private,  in scarlett2_fill_request_header()  argument
576 u16 seq = private->scarlett2_seq++; in scarlett2_fill_request_header()
590 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_usb() local
608 mutex_lock(&private->usb_mutex); in scarlett2_usb()
612 scarlett2_fill_request_header(private, req, cmd, req_size); in scarlett2_usb()
680 mutex_unlock(&private->usb_mutex); in scarlett2_usb()
700 struct scarlett2_mixer_data *private = in scarlett2_config_save_work() local
703 scarlett2_config_save(private->mixer); in scarlett2_config_save_work()
722 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_usb_set_config() local
725 cancel_delayed_work_sync(&private->work); in scarlett2_usb_set_config()
745 schedule_delayed_work(&private->work, msecs_to_jiffies(2000)); in scarlett2_usb_set_config()
788 * (values obtained from private->mix[])
793 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_usb_set_mix() local
794 const struct scarlett2_device_info *info = private->info; in scarlett2_usb_set_mix()
809 scarlett2_mixer_values[private->mix[j]] in scarlett2_usb_set_mix()
838 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_usb_set_mux() local
839 const struct scarlett2_device_info *info = private->info; in scarlett2_usb_set_mux()
890 ports, private->mux[j] in scarlett2_usb_set_mux()
894 /* skip private->mux[j] entries not output */ in scarlett2_usb_set_mux()
983 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_update_volumes() local
984 const struct scarlett2_ports *ports = private->info->ports; in scarlett2_update_volumes()
990 private->vol_updated = 0; in scarlett2_update_volumes()
996 private->master_vol = clamp( in scarlett2_update_volumes()
1001 if (private->vol_sw_hw_switch[i]) in scarlett2_update_volumes()
1002 private->vol[i] = private->master_vol; in scarlett2_update_volumes()
1005 for (i = 0; i < private->info->button_count; i++) in scarlett2_update_volumes()
1006 private->buttons[i] = !!volume_status.buttons[i]; in scarlett2_update_volumes()
1029 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_master_volume_ctl_get() local
1031 if (private->vol_updated) { in scarlett2_master_volume_ctl_get()
1032 mutex_lock(&private->data_mutex); in scarlett2_master_volume_ctl_get()
1034 mutex_unlock(&private->data_mutex); in scarlett2_master_volume_ctl_get()
1037 ucontrol->value.integer.value[0] = private->master_vol; in scarlett2_master_volume_ctl_get()
1046 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_volume_ctl_get() local
1049 if (private->vol_updated) { in scarlett2_volume_ctl_get()
1050 mutex_lock(&private->data_mutex); in scarlett2_volume_ctl_get()
1052 mutex_unlock(&private->data_mutex); in scarlett2_volume_ctl_get()
1055 ucontrol->value.integer.value[0] = private->vol[index]; in scarlett2_volume_ctl_get()
1064 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_volume_ctl_put() local
1068 mutex_lock(&private->data_mutex); in scarlett2_volume_ctl_put()
1070 oval = private->vol[index]; in scarlett2_volume_ctl_put()
1076 private->vol[index] = val; in scarlett2_volume_ctl_put()
1083 mutex_unlock(&private->data_mutex); in scarlett2_volume_ctl_put()
1130 struct scarlett2_mixer_data *private = elem->head.mixer->private_data; in scarlett2_sw_hw_enum_ctl_get() local
1133 private->vol_sw_hw_switch[elem->control]; in scarlett2_sw_hw_enum_ctl_get()
1142 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_sw_hw_enum_ctl_put() local
1147 mutex_lock(&private->data_mutex); in scarlett2_sw_hw_enum_ctl_put()
1149 oval = private->vol_sw_hw_switch[index]; in scarlett2_sw_hw_enum_ctl_put()
1155 private->vol_sw_hw_switch[index] = val; in scarlett2_sw_hw_enum_ctl_put()
1161 private->vol_ctls[index]->vd[0].access &= in scarlett2_sw_hw_enum_ctl_put()
1164 private->vol_ctls[index]->vd[0].access |= in scarlett2_sw_hw_enum_ctl_put()
1168 private->vol[index] = private->master_vol; in scarlett2_sw_hw_enum_ctl_put()
1173 index, private->master_vol - SCARLETT2_VOLUME_BIAS); in scarlett2_sw_hw_enum_ctl_put()
1179 &private->vol_ctls[index]->id); in scarlett2_sw_hw_enum_ctl_put()
1186 mutex_unlock(&private->data_mutex); in scarlett2_sw_hw_enum_ctl_put()
1214 struct scarlett2_mixer_data *private = elem->head.mixer->private_data; in scarlett2_level_enum_ctl_get() local
1217 private->level_switch[elem->control]; in scarlett2_level_enum_ctl_get()
1226 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_level_enum_ctl_put() local
1231 mutex_lock(&private->data_mutex); in scarlett2_level_enum_ctl_put()
1233 oval = private->level_switch[index]; in scarlett2_level_enum_ctl_put()
1239 private->level_switch[index] = val; in scarlett2_level_enum_ctl_put()
1246 mutex_unlock(&private->data_mutex); in scarlett2_level_enum_ctl_put()
1264 struct scarlett2_mixer_data *private = elem->head.mixer->private_data; in scarlett2_pad_ctl_get() local
1267 private->pad_switch[elem->control]; in scarlett2_pad_ctl_get()
1276 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_pad_ctl_put() local
1281 mutex_lock(&private->data_mutex); in scarlett2_pad_ctl_put()
1283 oval = private->pad_switch[index]; in scarlett2_pad_ctl_put()
1289 private->pad_switch[index] = val; in scarlett2_pad_ctl_put()
1296 mutex_unlock(&private->data_mutex); in scarlett2_pad_ctl_put()
1315 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_button_ctl_get() local
1317 if (private->vol_updated) { in scarlett2_button_ctl_get()
1318 mutex_lock(&private->data_mutex); in scarlett2_button_ctl_get()
1320 mutex_unlock(&private->data_mutex); in scarlett2_button_ctl_get()
1323 ucontrol->value.enumerated.item[0] = private->buttons[elem->control]; in scarlett2_button_ctl_get()
1332 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_button_ctl_put() local
1337 mutex_lock(&private->data_mutex); in scarlett2_button_ctl_put()
1339 oval = private->buttons[index]; in scarlett2_button_ctl_put()
1345 private->buttons[index] = val; in scarlett2_button_ctl_put()
1352 mutex_unlock(&private->data_mutex); in scarlett2_button_ctl_put()
1368 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_add_line_out_ctls() local
1369 const struct scarlett2_device_info *info = private->info; in scarlett2_add_line_out_ctls()
1381 0, 1, s, &private->master_vol_ctl); in scarlett2_add_line_out_ctls()
1400 i, 1, s, &private->vol_ctls[i]); in scarlett2_add_line_out_ctls()
1405 if (private->vol_sw_hw_switch[i]) in scarlett2_add_line_out_ctls()
1406 private->vol_ctls[i]->vd[0].access &= in scarlett2_add_line_out_ctls()
1423 for (i = 0; i < private->info->button_count; i++) { in scarlett2_add_line_out_ctls()
1426 &private->button_ctls[i]); in scarlett2_add_line_out_ctls()
1438 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_add_line_in_ctls() local
1439 const struct scarlett2_device_info *info = private->info; in scarlett2_add_line_in_ctls()
1483 struct scarlett2_mixer_data *private = elem->head.mixer->private_data; in scarlett2_mixer_ctl_get() local
1485 ucontrol->value.integer.value[0] = private->mix[elem->control]; in scarlett2_mixer_ctl_get()
1494 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_mixer_ctl_put() local
1495 const struct scarlett2_device_info *info = private->info; in scarlett2_mixer_ctl_put()
1499 mutex_lock(&private->data_mutex); in scarlett2_mixer_ctl_put()
1501 oval = private->mix[elem->control]; in scarlett2_mixer_ctl_put()
1509 private->mix[elem->control] = val; in scarlett2_mixer_ctl_put()
1515 mutex_unlock(&private->data_mutex); in scarlett2_mixer_ctl_put()
1539 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_add_mixer_ctls() local
1540 const struct scarlett2_ports *ports = private->info->ports; in scarlett2_add_mixer_ctls()
1569 struct scarlett2_mixer_data *private = elem->head.mixer->private_data; in scarlett2_mux_src_enum_ctl_info() local
1570 const struct scarlett2_ports *ports = private->info->ports; in scarlett2_mux_src_enum_ctl_info()
1572 int items = private->num_mux_srcs; in scarlett2_mux_src_enum_ctl_info()
1601 struct scarlett2_mixer_data *private = elem->head.mixer->private_data; in scarlett2_mux_src_enum_ctl_get() local
1603 ucontrol->value.enumerated.item[0] = private->mux[elem->control]; in scarlett2_mux_src_enum_ctl_get()
1612 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_mux_src_enum_ctl_put() local
1616 mutex_lock(&private->data_mutex); in scarlett2_mux_src_enum_ctl_put()
1618 oval = private->mux[index]; in scarlett2_mux_src_enum_ctl_put()
1620 0L, private->num_mux_srcs - 1L); in scarlett2_mux_src_enum_ctl_put()
1625 private->mux[index] = val; in scarlett2_mux_src_enum_ctl_put()
1631 mutex_unlock(&private->data_mutex); in scarlett2_mux_src_enum_ctl_put()
1645 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_add_mux_enums() local
1646 const struct scarlett2_ports *ports = private->info->ports; in scarlett2_add_mux_enums()
1724 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_private_free() local
1726 cancel_delayed_work_sync(&private->work); in scarlett2_private_free()
1727 kfree(private); in scarlett2_private_free()
1733 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_private_suspend() local
1735 if (cancel_delayed_work_sync(&private->work)) in scarlett2_private_suspend()
1736 scarlett2_config_save(private->mixer); in scarlett2_private_suspend()
1806 /* Initialise private data, routing, sequence number */
1810 struct scarlett2_mixer_data *private = in scarlett2_init_private() local
1813 if (!private) in scarlett2_init_private()
1816 mutex_init(&private->usb_mutex); in scarlett2_init_private()
1817 mutex_init(&private->data_mutex); in scarlett2_init_private()
1818 INIT_DELAYED_WORK(&private->work, scarlett2_config_save_work); in scarlett2_init_private()
1819 private->info = info; in scarlett2_init_private()
1820 private->num_mux_srcs = scarlett2_count_mux_srcs(info->ports); in scarlett2_init_private()
1821 private->scarlett2_seq = 0; in scarlett2_init_private()
1822 private->mixer = mixer; in scarlett2_init_private()
1823 mixer->private_data = private; in scarlett2_init_private()
1828 scarlett2_init_routing(private->mux, info->ports); in scarlett2_init_private()
1837 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_read_configs() local
1838 const struct scarlett2_device_info *info = private->info; in scarlett2_read_configs()
1856 private->level_switch[i] = level_switches[i]; in scarlett2_read_configs()
1868 private->pad_switch[i] = pad_switches[i]; in scarlett2_read_configs()
1875 private->master_vol = clamp( in scarlett2_read_configs()
1882 private->vol_sw_hw_switch[i] = in scarlett2_read_configs()
1886 volume = private->vol_sw_hw_switch[i] in scarlett2_read_configs()
1891 private->vol[i] = volume; in scarlett2_read_configs()
1895 private->buttons[i] = !!volume_status.buttons[i]; in scarlett2_read_configs()
1904 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_mixer_interrupt_vol_change() local
1905 const struct scarlett2_ports *ports = private->info->ports; in scarlett2_mixer_interrupt_vol_change()
1910 private->vol_updated = 1; in scarlett2_mixer_interrupt_vol_change()
1913 &private->master_vol_ctl->id); in scarlett2_mixer_interrupt_vol_change()
1916 if (!private->vol_sw_hw_switch[i]) in scarlett2_mixer_interrupt_vol_change()
1919 &private->vol_ctls[i]->id); in scarlett2_mixer_interrupt_vol_change()
1927 struct scarlett2_mixer_data *private = mixer->private_data; in scarlett2_mixer_interrupt_button_change() local
1930 private->vol_updated = 1; in scarlett2_mixer_interrupt_button_change()
1932 for (i = 0; i < private->info->button_count; i++) in scarlett2_mixer_interrupt_button_change()
1934 &private->button_ctls[i]->id); in scarlett2_mixer_interrupt_button_change()
2032 /* Initialise private data, routing, sequence number */ in snd_scarlett_gen2_controls_create()