Lines Matching refs:audio_dev_data

263 				struct usb_audio_dev_data *audio_dev_data,  in get_feature_unit()  argument
269 ((uint8_t *)audio_dev_data->desc_hdr + in get_feature_unit()
270 audio_dev_data->desc_hdr->bLength + in get_feature_unit()
352 struct usb_audio_dev_data *audio_dev_data; in audio_cb_usb_status() local
362 audio_dev_data = CONTAINER_OF(dev_data, struct usb_audio_dev_data, in audio_cb_usb_status()
367 audio_dc_sof(cfg, audio_dev_data); in audio_cb_usb_status()
394 static bool is_entity_valid(struct usb_audio_dev_data *audio_dev_data, in is_entity_valid() argument
400 header = audio_dev_data->desc_hdr; in is_entity_valid()
439 struct usb_audio_dev_data *audio_dev_data; in get_audio_dev_data_by_entity() local
442 audio_dev_data = CONTAINER_OF(dev_data, in get_audio_dev_data_by_entity()
446 if (is_entity_valid(audio_dev_data, entity)) { in get_audio_dev_data_by_entity()
447 return audio_dev_data; in get_audio_dev_data_by_entity()
466 static bool is_interface_valid(struct usb_audio_dev_data *audio_dev_data, in is_interface_valid() argument
471 header = audio_dev_data->desc_hdr; in is_interface_valid()
498 struct usb_audio_dev_data *audio_dev_data; in get_audio_dev_data_by_iface() local
501 audio_dev_data = CONTAINER_OF(dev_data, in get_audio_dev_data_by_iface()
505 if (is_interface_valid(audio_dev_data, interface)) { in get_audio_dev_data_by_iface()
506 return audio_dev_data; in get_audio_dev_data_by_iface()
527 static int handle_fu_mute_req(struct usb_audio_dev_data *audio_dev_data, in handle_fu_mute_req() argument
534 uint8_t ch_cnt = audio_dev_data->ch_cnt[device]; in handle_fu_mute_req()
535 uint8_t *controls = audio_dev_data->controls[device]; in handle_fu_mute_req()
562 static int handle_fu_volume_req(struct usb_audio_dev_data *audio_dev_data, in handle_fu_volume_req() argument
567 uint8_t ch_cnt = audio_dev_data->ch_cnt[device]; in handle_fu_volume_req()
568 uint8_t *controls = audio_dev_data->controls[device]; in handle_fu_volume_req()
581 if (!IN_RANGE(target_vol, audio_dev_data->volumes.volume_min, in handle_fu_volume_req()
582 audio_dev_data->volumes.volume_max)) { in handle_fu_volume_req()
586 if (target_vol % audio_dev_data->volumes.volume_res != 0) { in handle_fu_volume_req()
588 audio_dev_data->volumes.volume_res); in handle_fu_volume_req()
603 *len = sizeof(audio_dev_data->volumes.volume_min); in handle_fu_volume_req()
604 temp_vol = sys_cpu_to_le16(audio_dev_data->volumes.volume_min); in handle_fu_volume_req()
608 *len = sizeof(audio_dev_data->volumes.volume_max); in handle_fu_volume_req()
609 temp_vol = sys_cpu_to_le16(audio_dev_data->volumes.volume_max); in handle_fu_volume_req()
613 *len = sizeof(audio_dev_data->volumes.volume_res); in handle_fu_volume_req()
614 temp_vol = sys_cpu_to_le16(audio_dev_data->volumes.volume_res); in handle_fu_volume_req()
637 static int handle_feature_unit_req(struct usb_audio_dev_data *audio_dev_data, in handle_feature_unit_req() argument
651 fu = get_feature_unit(audio_dev_data, &device, fu_id); in handle_feature_unit_req()
654 ch_cnt = audio_dev_data->ch_cnt[device]; in handle_feature_unit_req()
669 ret = handle_fu_mute_req(audio_dev_data, pSetup, in handle_feature_unit_req()
673 ret = handle_fu_volume_req(audio_dev_data, pSetup, in handle_feature_unit_req()
685 if (audio_dev_data->ops && audio_dev_data->ops->feature_update_cb) { in handle_feature_unit_req()
691 audio_dev_data->ops->feature_update_cb( in handle_feature_unit_req()
692 audio_dev_data->common.dev, &evt); in handle_feature_unit_req()
716 struct usb_audio_dev_data *audio_dev_data; in handle_interface_req() local
734 audio_dev_data = get_audio_dev_data_by_entity(&entity); in handle_interface_req()
736 if (audio_dev_data == NULL) { in handle_interface_req()
743 return handle_feature_unit_req(audio_dev_data, in handle_interface_req()
772 struct usb_audio_dev_data *audio_dev_data; in audio_custom_handler() local
783 audio_dev_data = get_audio_dev_data_by_iface(iface); in audio_custom_handler()
784 if (audio_dev_data == NULL) { in audio_custom_handler()
792 header = audio_dev_data->desc_hdr; in audio_custom_handler()
820 audio_dev_data->tx_enable = pSetup->wValue; in audio_custom_handler()
822 audio_dev_data->rx_enable = pSetup->wValue; in audio_custom_handler()
864 struct usb_audio_dev_data *audio_dev_data; in audio_write_cb() local
868 audio_dev_data = dev_data->dev->data; in audio_write_cb()
871 size, ep, audio_dev_data); in audio_write_cb()
877 if (audio_dev_data->ops && audio_dev_data->ops->data_written_cb) { in audio_write_cb()
878 audio_dev_data->ops->data_written_cb(dev_data->dev, in audio_write_cb()
889 struct usb_audio_dev_data *audio_dev_data = dev->data; in usb_audio_send() local
899 if (!audio_dev_data->tx_enable) { in usb_audio_send()
918 struct usb_audio_dev_data *audio_dev_data = dev->data; in usb_audio_get_in_frame_size() local
920 return audio_dev_data->in_frame_size; in usb_audio_get_in_frame_size()
926 struct usb_audio_dev_data *audio_dev_data; in audio_receive_cb() local
939 audio_dev_data = CONTAINER_OF(common, struct usb_audio_dev_data, in audio_receive_cb()
945 if (!audio_dev_data->rx_enable) { in audio_receive_cb()
952 if (audio_dev_data->ops && audio_dev_data->ops->data_received_cb) { in audio_receive_cb()
953 buffer = net_buf_alloc(audio_dev_data->pool, K_NO_WAIT); in audio_receive_cb()
971 audio_dev_data->ops->data_received_cb(common->dev, in audio_receive_cb()
980 struct usb_audio_dev_data *audio_dev_data = dev->data; in usb_audio_register() local
988 audio_dev_data->ops = ops; in usb_audio_register()
989 audio_dev_data->common.dev = dev; in usb_audio_register()
990 audio_dev_data->rx_enable = false; in usb_audio_register()
991 audio_dev_data->tx_enable = false; in usb_audio_register()
992 audio_dev_data->desc_hdr = header; in usb_audio_register()
994 sys_slist_append(&usb_audio_data_devlist, &audio_dev_data->common.node); in usb_audio_register()
997 dev, audio_dev_data, dev->config, in usb_audio_register()