Lines Matching refs:priv

77 	struct udc_stm32_data *priv = hpcd2data(hpcd);  in HAL_PCD_ResetCallback()  local
78 const struct device *dev = priv->dev; in HAL_PCD_ResetCallback()
85 HAL_PCD_EP_Open(&priv->pcd, USB_CONTROL_EP_OUT, cfg->ep0_mps, in HAL_PCD_ResetCallback()
91 HAL_PCD_EP_Open(&priv->pcd, USB_CONTROL_EP_IN, cfg->ep0_mps, in HAL_PCD_ResetCallback()
95 udc_submit_event(priv->dev, UDC_EVT_RESET, 0); in HAL_PCD_ResetCallback()
100 struct udc_stm32_data *priv = hpcd2data(hpcd); in HAL_PCD_ConnectCallback() local
102 udc_submit_event(priv->dev, UDC_EVT_VBUS_READY, 0); in HAL_PCD_ConnectCallback()
107 struct udc_stm32_data *priv = hpcd2data(hpcd); in HAL_PCD_DisconnectCallback() local
109 udc_submit_event(priv->dev, UDC_EVT_VBUS_REMOVED, 0); in HAL_PCD_DisconnectCallback()
114 struct udc_stm32_data *priv = hpcd2data(hpcd); in HAL_PCD_SuspendCallback() local
116 udc_set_suspended(priv->dev, true); in HAL_PCD_SuspendCallback()
117 udc_submit_event(priv->dev, UDC_EVT_SUSPEND, 0); in HAL_PCD_SuspendCallback()
122 struct udc_stm32_data *priv = hpcd2data(hpcd); in HAL_PCD_ResumeCallback() local
124 udc_set_suspended(priv->dev, false); in HAL_PCD_ResumeCallback()
125 udc_submit_event(priv->dev, UDC_EVT_RESUME, 0); in HAL_PCD_ResumeCallback()
130 struct udc_stm32_data *priv = udc_get_private(dev); in usbd_ctrl_feed_dout() local
141 HAL_PCD_EP_Receive(&priv->pcd, cfg->addr, buf->data, buf->size); in usbd_ctrl_feed_dout()
148 struct udc_stm32_data *priv = hpcd2data(hpcd); in HAL_PCD_SetupStageCallback() local
149 struct usb_setup_packet *setup = (void *)priv->pcd.Setup; in HAL_PCD_SetupStageCallback()
150 const struct device *dev = priv->dev; in HAL_PCD_SetupStageCallback()
174 HAL_PCD_SetAddress(&priv->pcd, setup->wValue); in HAL_PCD_SetupStageCallback()
192 struct udc_stm32_data *priv = hpcd2data(hpcd); in HAL_PCD_SOFCallback() local
194 udc_submit_event(priv->dev, UDC_EVT_SOF, 0); in HAL_PCD_SOFCallback()
200 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_tx() local
221 status = HAL_PCD_EP_Transmit(&priv->pcd, ep, data, len); in udc_stm32_tx()
242 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_rx() local
251 status = HAL_PCD_EP_Receive(&priv->pcd, ep, buf->data, buf->size); in udc_stm32_rx()
265 struct udc_stm32_data *priv = hpcd2data(hpcd); in HAL_PCD_DataOutStageCallback() local
266 const struct device *dev = priv->dev; in HAL_PCD_DataOutStageCallback()
305 struct udc_stm32_data *priv = hpcd2data(hpcd); in HAL_PCD_DataInStageCallback() local
306 const struct device *dev = priv->dev; in HAL_PCD_DataInStageCallback()
323 HAL_PCD_EP_Transmit(&priv->pcd, ep, buf->data, len); in HAL_PCD_DataInStageCallback()
333 HAL_PCD_EP_Transmit(&priv->pcd, ep, buf->data, 0); in HAL_PCD_DataInStageCallback()
381 const struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_irq() local
384 HAL_PCD_IRQHandler((PCD_HandleTypeDef *)&priv->pcd); in udc_stm32_irq()
389 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_init() local
392 if (priv->clk_enable && priv->clk_enable()) { in udc_stm32_init()
397 priv->pcd_prepare(dev); in udc_stm32_init()
399 status = HAL_PCD_Init(&priv->pcd); in udc_stm32_init()
405 HAL_PCD_Stop(&priv->pcd); in udc_stm32_init()
413 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_mem_init() local
416 priv->occupied_mem = cfg->pma_offset; in udc_stm32_mem_init()
423 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_ep_mem_config() local
430 priv->occupied_mem -= size; in udc_stm32_ep_mem_config()
434 if (priv->occupied_mem + size >= cfg->dram_size) { in udc_stm32_ep_mem_config()
440 HAL_PCDEx_PMAConfig(&priv->pcd, ep->addr, PCD_SNG_BUF, in udc_stm32_ep_mem_config()
441 priv->occupied_mem); in udc_stm32_ep_mem_config()
443 priv->occupied_mem += size; in udc_stm32_ep_mem_config()
450 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_mem_init() local
466 HAL_PCDEx_SetRxFiFo(&priv->pcd, words); in udc_stm32_mem_init()
467 priv->occupied_mem = words * 4; in udc_stm32_mem_init()
470 HAL_PCDEx_SetTxFiFo(&priv->pcd, 0, cfg->ep0_mps / 4); in udc_stm32_mem_init()
471 priv->occupied_mem += cfg->ep0_mps; in udc_stm32_mem_init()
475 HAL_PCDEx_SetTxFiFo(&priv->pcd, i, 0); in udc_stm32_mem_init()
483 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_ep_mem_config() local
495 if (priv->occupied_mem >= (words * 4)) { in udc_stm32_ep_mem_config()
496 priv->occupied_mem -= (words * 4); in udc_stm32_ep_mem_config()
498 HAL_PCDEx_SetTxFiFo(&priv->pcd, USB_EP_GET_IDX(ep->addr), 0); in udc_stm32_ep_mem_config()
502 if (cfg->dram_size - priv->occupied_mem < words * 4) { in udc_stm32_ep_mem_config()
507 HAL_PCDEx_SetTxFiFo(&priv->pcd, USB_EP_GET_IDX(ep->addr), words); in udc_stm32_ep_mem_config()
509 priv->occupied_mem += words * 4; in udc_stm32_ep_mem_config()
517 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_enable() local
526 status = HAL_PCD_Start(&priv->pcd); in udc_stm32_enable()
546 irq_enable(priv->irq); in udc_stm32_enable()
553 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_disable() local
568 status = HAL_PCD_Stop(&priv->pcd); in udc_stm32_disable()
579 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_shutdown() local
582 status = HAL_PCD_DeInit(&priv->pcd); in udc_stm32_shutdown()
588 if (priv->clk_disable && priv->clk_disable()) { in udc_stm32_shutdown()
593 if (irq_is_enabled(priv->irq)) { in udc_stm32_shutdown()
594 irq_disable(priv->irq); in udc_stm32_shutdown()
602 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_set_address() local
607 status = HAL_PCD_SetAddress(&priv->pcd, addr); in udc_stm32_set_address()
619 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_host_wakeup() local
622 status = HAL_PCD_ActivateRemoteWakeup(&priv->pcd); in udc_stm32_host_wakeup()
631 status = HAL_PCD_DeActivateRemoteWakeup(&priv->pcd); in udc_stm32_host_wakeup()
642 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_ep_enable() local
671 status = HAL_PCD_EP_Open(&priv->pcd, ep_cfg->addr, in udc_stm32_ep_enable()
685 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_ep_disable() local
690 status = HAL_PCD_EP_Close(&priv->pcd, ep->addr); in udc_stm32_ep_disable()
703 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_ep_set_halt() local
708 status = HAL_PCD_EP_SetStall(&priv->pcd, cfg->addr); in udc_stm32_ep_set_halt()
721 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_ep_clear_halt() local
726 status = HAL_PCD_EP_ClrStall(&priv->pcd, cfg->addr); in udc_stm32_ep_clear_halt()
739 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_ep_flush() local
744 status = HAL_PCD_EP_Flush(&priv->pcd, cfg->addr); in udc_stm32_ep_flush()
795 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_device_speed() local
798 if (priv->pcd.Init.speed == USBD_HS_SPEED) { in udc_stm32_device_speed()
803 if (priv->pcd.Init.speed == USBD_FS_SPEED) { in udc_stm32_device_speed()
869 .priv = &udc0_priv,
924 struct udc_stm32_data *priv = udc_get_private(dev); in priv_pcd_prepare() local
927 memset(&priv->pcd, 0, sizeof(priv->pcd)); in priv_pcd_prepare()
930 priv->pcd.Init.dev_endpoints = cfg->num_endpoints; in priv_pcd_prepare()
931 priv->pcd.Init.ep0_mps = cfg->ep0_mps; in priv_pcd_prepare()
932 priv->pcd.Init.speed = PCD_SPEED_FULL; in priv_pcd_prepare()
936 priv->pcd.Instance = USB; in priv_pcd_prepare()
938 priv->pcd.Instance = USB_DRD_FS; in priv_pcd_prepare()
940 priv->pcd.Init.speed = usb_dc_stm32_get_maximum_speed(); in priv_pcd_prepare()
942 priv->pcd.Instance = USB_OTG_HS; in priv_pcd_prepare()
944 priv->pcd.Instance = USB_OTG_FS; in priv_pcd_prepare()
949 priv->pcd.Init.phy_itface = USB_OTG_HS_EMBEDDED_PHY; in priv_pcd_prepare()
951 priv->pcd.Init.phy_itface = USB_OTG_ULPI_PHY; in priv_pcd_prepare()
953 priv->pcd.Init.phy_itface = PCD_PHY_EMBEDDED; in priv_pcd_prepare()
1121 struct udc_stm32_data *priv = udc_get_private(dev); in udc_stm32_driver_init0() local
1170 priv->dev = dev; in udc_stm32_driver_init0()
1171 priv->irq = UDC_STM32_IRQ; in udc_stm32_driver_init0()
1172 priv->clk_enable = priv_clock_enable; in udc_stm32_driver_init0()
1173 priv->clk_disable = priv_clock_disable; in udc_stm32_driver_init0()
1174 priv->pcd_prepare = priv_pcd_prepare; in udc_stm32_driver_init0()