Lines Matching refs:priv

98 	const struct udc_ambiq_data *priv = udc_get_private(dev);  in udc_ambiq_tx()  local
109 status = am_hal_usb_ep_xfer(priv->usb_handle, ep, NULL, 0); in udc_ambiq_tx()
111 status = am_hal_usb_ep_xfer(priv->usb_handle, ep, buf->data, buf->len); in udc_ambiq_tx()
125 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_rx() local
141 status = am_hal_usb_ep_xfer(priv->usb_handle, ep, buf->data, rx_size); in udc_ambiq_rx()
153 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_evt_callback() local
158 am_hal_usb_intr_usb_enable(priv->usb_handle, in udc_ambiq_evt_callback()
162 am_hal_usb_ep_init(priv->usb_handle, 0, 0, EP0_MPS); in udc_ambiq_evt_callback()
164 am_hal_usb_set_dev_speed(priv->usb_handle, priv->usb_speed); in udc_ambiq_evt_callback()
171 am_hal_usb_set_dev_state(priv->usb_handle, AM_HAL_USB_DEV_STATE_ACTIVE); in udc_ambiq_evt_callback()
181 am_hal_usb_set_dev_state(priv->usb_handle, AM_HAL_USB_DEV_STATE_SUSPENDED); in udc_ambiq_evt_callback()
194 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_ep0_setup_callback() local
199 if (priv->ctrl_pending_in_ack) { in udc_ambiq_ep0_setup_callback()
200 priv->ctrl_pending_setup = true; in udc_ambiq_ep0_setup_callback()
201 memcpy(priv->ctrl_pending_setup_buffer, usb_setup, 8); in udc_ambiq_ep0_setup_callback()
209 priv->ctrl_setup_recv_at_status_in = udc_ctrl_stage_is_status_in(dev); in udc_ambiq_ep0_setup_callback()
210 memcpy(priv->setup, usb_setup, sizeof(struct usb_setup_packet)); in udc_ambiq_ep0_setup_callback()
242 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_device_speed() local
243 am_hal_usb_dev_speed_e e_speed = am_hal_get_usb_dev_speed(priv->usb_handle); in udc_ambiq_device_speed()
255 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_ep_enqueue() local
263 if (ep_cfg->addr == USB_CONTROL_EP_IN && buf->len == 0 && priv->ctrl_pending_in_ack) { in udc_ambiq_ep_enqueue()
264 priv->ctrl_pending_in_ack = false; in udc_ambiq_ep_enqueue()
279 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_ep_dequeue() local
290 am_hal_usb_ep_state_reset(priv->usb_handle, ep_cfg->addr); in udc_ambiq_ep_dequeue()
300 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_ep_set_halt() local
304 am_hal_usb_ep_stall(priv->usb_handle, ep_cfg->addr); in udc_ambiq_ep_set_halt()
314 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_ep_clear_halt() local
318 am_hal_usb_ep_clear_stall(priv->usb_handle, ep_cfg->addr); in udc_ambiq_ep_clear_halt()
336 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_ep_enable() local
359 status = am_hal_usb_ep_init(priv->usb_handle, ep_cfg->addr, endpoint_type, ep_cfg->mps); in udc_ambiq_ep_enable()
372 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_ep_disable() local
375 am_hal_usb_ep_state_reset(priv->usb_handle, ep_cfg->addr); in udc_ambiq_ep_disable()
383 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_host_wakeup() local
385 am_hal_usb_start_remote_wakeup(priv->usb_handle); in udc_ambiq_host_wakeup()
392 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_set_address() local
395 am_hal_usb_set_addr(priv->usb_handle, addr); in udc_ambiq_set_address()
396 am_hal_usb_set_dev_state(priv->usb_handle, AM_HAL_USB_DEV_STATE_ADDRESSED); in udc_ambiq_set_address()
404 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_test_mode() local
428 am_hal_usb_enter_test_mode(priv->usb_handle); in udc_ambiq_test_mode()
429 am_hal_usb_test_mode(priv->usb_handle, am_usb_test_mode); in udc_ambiq_test_mode()
436 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_enable() local
439 am_hal_usb_attach(priv->usb_handle); in udc_ambiq_enable()
448 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_disable() local
457 am_hal_usb_detach(priv->usb_handle); in udc_ambiq_disable()
458 am_hal_usb_intr_usb_disable(priv->usb_handle, USB_CFG2_SOFE_Msk | USB_CFG2_ResumeE_Msk | in udc_ambiq_disable()
461 am_hal_usb_intr_usb_clear(priv->usb_handle); in udc_ambiq_disable()
463 am_hal_usb_ep_state_reset(priv->usb_handle, i); in udc_ambiq_disable()
464 am_hal_usb_ep_state_reset(priv->usb_handle, BIT(7) | i); in udc_ambiq_disable()
473 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_usb_isr() local
476 am_hal_usb_intr_status_get(priv->usb_handle, &int_status[0], &int_status[1], in udc_ambiq_usb_isr()
478 am_hal_usb_interrupt_service(priv->usb_handle, int_status[0], int_status[1], int_status[2]); in udc_ambiq_usb_isr()
519 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_init() local
524 if (am_hal_usb_initialize(0, (void *)&priv->usb_handle) != AM_HAL_STATUS_SUCCESS) { in udc_ambiq_init()
531 am_hal_usb_power_control(priv->usb_handle, AM_HAL_SYSCTRL_WAKE, false); in udc_ambiq_init()
544 am_hal_usb_set_dev_speed(priv->usb_handle, priv->usb_speed); in udc_ambiq_init()
546 am_hal_usb_intr_usb_enable(priv->usb_handle, USB_INTRUSB_Reset_Msk); in udc_ambiq_init()
564 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_shutdown() local
589 am_hal_usb_power_control(priv->usb_handle, AM_HAL_SYSCTRL_DEEPSLEEP, false); in udc_ambiq_shutdown()
591 am_hal_usb_deinitialize(priv->usb_handle); in udc_ambiq_shutdown()
592 priv->usb_handle = NULL; in udc_ambiq_shutdown()
609 struct udc_ambiq_data *priv = udc_get_private(dev); in ambiq_handle_evt_setup() local
619 net_buf_add_mem(buf, priv->setup, sizeof(priv->setup)); in ambiq_handle_evt_setup()
630 priv->ctrl_pending_in_ack = true; in ambiq_handle_evt_setup()
683 struct udc_ambiq_data *priv = udc_get_private(dev); in ambiq_handle_evt_din() local
722 if (priv->ctrl_setup_recv_at_status_in && (buf->len == 0)) { in ambiq_handle_evt_din()
723 priv->ctrl_setup_recv_at_status_in = false; in ambiq_handle_evt_din()
727 priv->ctrl_setup_recv_at_status_in = false; in ambiq_handle_evt_din()
744 if (udc_ambiq_rx_status_in_completed && priv->ctrl_pending_setup) { in ambiq_handle_evt_din()
745 priv->ctrl_pending_setup = false; in ambiq_handle_evt_din()
746 udc_ambiq_ep0_setup_callback(dev, priv->ctrl_pending_setup_buffer); in ambiq_handle_evt_din()
809 struct udc_ambiq_data *priv = udc_get_private(dev); in udc_ambiq_driver_init() local
817 priv->usb_speed = AM_HAL_USB_SPEED_FULL; in udc_ambiq_driver_init()
821 priv->usb_speed = AM_HAL_USB_SPEED_HIGH; in udc_ambiq_driver_init()
920 struct udc_ambiq_data *priv = udc_get_private(dev); \
922 am_hal_usb_register_dev_evt_callback(priv->usb_handle, \
924 am_hal_usb_register_ep0_setup_received_callback(priv->usb_handle, \
927 priv->usb_handle, udc_ambiq_ep_xfer_complete_callback_##n); \
936 struct udc_ambiq_data *priv = udc_get_private(dev); \
938 k_thread_create(&priv->thread_data, udc_ambiq_stack_##n, \
943 k_thread_name_set(&priv->thread_data, dev->name); \
978 .priv = &udc_priv_##n, \