/* Handler for feature unit mute control requests. 
This function handles feature unit mute control request. */
static int handle_fu_mute_req(struct usb_audio_dev_data *audio_dev_data, struct usb_setup_packet *setup, int32_t *len, uint8_t **data, struct usb_audio_fu_evt *evt, uint8_t device)
/* Handler for feature unit mute control requests. 
This function handles feature unit mute control request. */
static int handle_fu_mute_req(struct usb_audio_dev_data *audio_dev_data, struct usb_setup_packet *setup, int32_t *len, uint8_t **data, struct usb_audio_fu_evt *evt, uint8_t device)
{
	uint8_t ch = (setup->wValue) & 0xFF;
	uint8_t ch_cnt = audio_dev_data->ch_cnt[device];
	uint8_t *controls = audio_dev_data->controls[device];
	uint8_t *control_val = &controls[POS(MUTE, ch, ch_cnt)];
	if (usb_reqtype_is_to_device(setup)) {
		if (*len != LEN(1, MUTE)) {
			return -EINVAL;
		}
		if (setup->bRequest == USB_AUDIO_SET_CUR) {
			evt->val = control_val;
			evt->val_len = *len;
			memcpy(control_val, *data, *len);
			return 0;
		}
	} else {
		if (setup->bRequest == USB_AUDIO_GET_CUR) {
			*data = control_val;
			*len = LEN(1, MUTE);
			return 0;
		}
	}
	return -EINVAL;
}