Lines Matching refs:gpriv
35 struct usbhsg_gpriv *gpriv; member
80 #define usbhsg_for_each_uep(pos, gpriv, i) \ argument
81 __usbhsg_for_each_uep(1, pos, gpriv, i)
83 #define usbhsg_for_each_uep_with_dcp(pos, gpriv, i) \ argument
84 __usbhsg_for_each_uep(0, pos, gpriv, i)
97 #define usbhsg_uep_to_gpriv(u) ((u)->gpriv)
100 #define usbhsg_is_dcp(u) ((u) == usbhsg_gpriv_to_dcp((u)->gpriv))
121 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in __usbhsg_queue_pop() local
123 struct device *dev = usbhsg_gpriv_to_dev(gpriv); in __usbhsg_queue_pop()
124 struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv); in __usbhsg_queue_pop()
139 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in usbhsg_queue_pop() local
140 struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv); in usbhsg_queue_pop()
166 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in usbhsg_queue_push() local
167 struct device *dev = usbhsg_gpriv_to_dev(gpriv); in usbhsg_queue_push()
220 struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv); in usbhsg_recip_handler_std_control_done() local
221 struct usbhsg_uep *dcp = usbhsg_gpriv_to_dcp(gpriv); in usbhsg_recip_handler_std_control_done()
233 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in usbhsg_recip_handler_std_clear_endpoint() local
236 if (!usbhsg_status_has(gpriv, USBHSG_STATUS_WEDGE)) { in usbhsg_recip_handler_std_clear_endpoint()
310 static void __usbhsg_recip_send_status(struct usbhsg_gpriv *gpriv, in __usbhsg_recip_send_status() argument
313 struct usbhsg_uep *dcp = usbhsg_gpriv_to_dcp(gpriv); in __usbhsg_recip_send_status()
315 struct device *dev = usbhsg_gpriv_to_dev(gpriv); in __usbhsg_recip_send_status()
351 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in usbhsg_recip_handler_std_get_device() local
354 if (usbhsg_status_has(gpriv, USBHSG_STATUS_SELF_POWERED)) in usbhsg_recip_handler_std_get_device()
357 __usbhsg_recip_send_status(gpriv, status); in usbhsg_recip_handler_std_get_device()
366 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in usbhsg_recip_handler_std_get_interface() local
369 __usbhsg_recip_send_status(gpriv, status); in usbhsg_recip_handler_std_get_interface()
378 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in usbhsg_recip_handler_std_get_endpoint() local
385 __usbhsg_recip_send_status(gpriv, status); in usbhsg_recip_handler_std_get_endpoint()
404 struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv); in usbhsg_recip_run_handle() local
405 struct device *dev = usbhsg_gpriv_to_dev(gpriv); in usbhsg_recip_run_handle()
415 uep = usbhsg_gpriv_to_nth_uep(gpriv, nth); in usbhsg_recip_run_handle()
457 struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv); in usbhsg_irq_dev_state() local
458 struct device *dev = usbhsg_gpriv_to_dev(gpriv); in usbhsg_irq_dev_state()
460 gpriv->gadget.speed = usbhs_bus_get_speed(priv); in usbhsg_irq_dev_state()
464 gpriv->gadget.speed); in usbhsg_irq_dev_state()
472 struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv); in usbhsg_irq_ctrl_stage() local
473 struct usbhsg_uep *dcp = usbhsg_gpriv_to_dcp(gpriv); in usbhsg_irq_ctrl_stage()
475 struct device *dev = usbhsg_gpriv_to_dev(gpriv); in usbhsg_irq_ctrl_stage()
536 ret = gpriv->driver->setup(&gpriv->gadget, &ctrl); in usbhsg_irq_ctrl_stage()
576 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in usbhsg_ep_enable() local
577 struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv); in usbhsg_ep_enable()
679 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in usbhsg_ep_queue() local
684 if (usbhsg_is_not_connected(gpriv) || in usbhsg_ep_queue()
685 unlikely(!gpriv->driver) || in usbhsg_ep_queue()
720 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in __usbhsg_ep_set_halt_wedge() local
721 struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv); in __usbhsg_ep_set_halt_wedge()
722 struct device *dev = usbhsg_gpriv_to_dev(gpriv); in __usbhsg_ep_set_halt_wedge()
739 usbhsg_status_set(gpriv, USBHSG_STATUS_WEDGE); in __usbhsg_ep_set_halt_wedge()
741 usbhsg_status_clr(gpriv, USBHSG_STATUS_WEDGE); in __usbhsg_ep_set_halt_wedge()
778 struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv); in usbhsg_can_pullup() local
780 return gpriv->driver && in usbhsg_can_pullup()
781 usbhsg_status_has(gpriv, USBHSG_STATUS_SOFT_CONNECT); in usbhsg_can_pullup()
797 struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv); in usbhsg_try_start() local
798 struct usbhsg_uep *dcp = usbhsg_gpriv_to_dcp(gpriv); in usbhsg_try_start()
807 usbhsg_status_set(gpriv, status); in usbhsg_try_start()
808 if (!(usbhsg_status_has(gpriv, USBHSG_STATUS_STARTED) && in usbhsg_try_start()
809 usbhsg_status_has(gpriv, USBHSG_STATUS_REGISTERD))) in usbhsg_try_start()
856 struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv); in usbhsg_try_stop() local
866 usbhsg_status_clr(gpriv, status); in usbhsg_try_stop()
867 if (!usbhsg_status_has(gpriv, USBHSG_STATUS_STARTED) && in usbhsg_try_stop()
868 !usbhsg_status_has(gpriv, USBHSG_STATUS_REGISTERD)) in usbhsg_try_stop()
887 gpriv->gadget.speed = USB_SPEED_UNKNOWN; in usbhsg_try_stop()
894 usbhsg_for_each_uep_with_dcp(uep, gpriv, i) in usbhsg_try_stop()
908 struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv); in usbhsm_phy_get_vbus() local
910 return gpriv->vbus_active; in usbhsm_phy_get_vbus()
931 struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget); in usbhsg_gadget_start() local
932 struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv); in usbhsg_gadget_start()
942 if (!IS_ERR_OR_NULL(gpriv->transceiver)) { in usbhsg_gadget_start()
943 ret = otg_set_peripheral(gpriv->transceiver->otg, in usbhsg_gadget_start()
944 &gpriv->gadget); in usbhsg_gadget_start()
947 gpriv->gadget.name); in usbhsg_gadget_start()
956 gpriv->driver = driver; in usbhsg_gadget_start()
963 struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget); in usbhsg_gadget_stop() local
964 struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv); in usbhsg_gadget_stop()
968 if (!IS_ERR_OR_NULL(gpriv->transceiver)) in usbhsg_gadget_stop()
969 otg_set_peripheral(gpriv->transceiver->otg, NULL); in usbhsg_gadget_stop()
971 gpriv->driver = NULL; in usbhsg_gadget_stop()
981 struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget); in usbhsg_get_frame() local
982 struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv); in usbhsg_get_frame()
989 struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget); in usbhsg_pullup() local
990 struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv); in usbhsg_pullup()
995 usbhsg_status_set(gpriv, USBHSG_STATUS_SOFT_CONNECT); in usbhsg_pullup()
997 usbhsg_status_clr(gpriv, USBHSG_STATUS_SOFT_CONNECT); in usbhsg_pullup()
1006 struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget); in usbhsg_set_selfpowered() local
1009 usbhsg_status_set(gpriv, USBHSG_STATUS_SELF_POWERED); in usbhsg_set_selfpowered()
1011 usbhsg_status_clr(gpriv, USBHSG_STATUS_SELF_POWERED); in usbhsg_set_selfpowered()
1020 struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget); in usbhsg_vbus_session() local
1021 struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv); in usbhsg_vbus_session()
1024 gpriv->vbus_active = !!is_active; in usbhsg_vbus_session()
1047 struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv); in usbhsg_stop() local
1050 if (gpriv->driver && in usbhsg_stop()
1051 gpriv->driver->disconnect) in usbhsg_stop()
1052 gpriv->driver->disconnect(&gpriv->gadget); in usbhsg_stop()
1059 struct usbhsg_gpriv *gpriv; in usbhs_mod_gadget_probe() local
1068 gpriv = kzalloc(sizeof(struct usbhsg_gpriv), GFP_KERNEL); in usbhs_mod_gadget_probe()
1069 if (!gpriv) in usbhs_mod_gadget_probe()
1078 gpriv->transceiver = usb_get_phy(USB_PHY_TYPE_UNDEFINED); in usbhs_mod_gadget_probe()
1080 !IS_ERR(gpriv->transceiver) ? "" : "no "); in usbhs_mod_gadget_probe()
1093 usbhs_mod_register(priv, &gpriv->mod, USBHS_GADGET); in usbhs_mod_gadget_probe()
1096 gpriv->mod.name = "gadget"; in usbhs_mod_gadget_probe()
1097 gpriv->mod.start = usbhsg_start; in usbhs_mod_gadget_probe()
1098 gpriv->mod.stop = usbhsg_stop; in usbhs_mod_gadget_probe()
1099 gpriv->uep = uep; in usbhs_mod_gadget_probe()
1100 gpriv->uep_size = pipe_size; in usbhs_mod_gadget_probe()
1101 usbhsg_status_init(gpriv); in usbhs_mod_gadget_probe()
1106 gpriv->gadget.dev.parent = dev; in usbhs_mod_gadget_probe()
1107 gpriv->gadget.name = "renesas_usbhs_udc"; in usbhs_mod_gadget_probe()
1108 gpriv->gadget.ops = &usbhsg_gadget_ops; in usbhs_mod_gadget_probe()
1109 gpriv->gadget.max_speed = USB_SPEED_HIGH; in usbhs_mod_gadget_probe()
1110 gpriv->gadget.quirk_avoids_skb_reserve = usbhs_get_dparam(priv, in usbhs_mod_gadget_probe()
1113 INIT_LIST_HEAD(&gpriv->gadget.ep_list); in usbhs_mod_gadget_probe()
1118 usbhsg_for_each_uep_with_dcp(uep, gpriv, i) { in usbhs_mod_gadget_probe()
1119 uep->gpriv = gpriv; in usbhs_mod_gadget_probe()
1130 gpriv->gadget.ep0 = &uep->ep; in usbhs_mod_gadget_probe()
1143 list_add_tail(&uep->ep.ep_list, &gpriv->gadget.ep_list); in usbhs_mod_gadget_probe()
1149 ret = usb_add_gadget_udc(dev, &gpriv->gadget); in usbhs_mod_gadget_probe()
1159 kfree(gpriv->uep); in usbhs_mod_gadget_probe()
1162 kfree(gpriv); in usbhs_mod_gadget_probe()
1169 struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv); in usbhs_mod_gadget_remove() local
1171 usb_del_gadget_udc(&gpriv->gadget); in usbhs_mod_gadget_remove()
1173 kfree(gpriv->uep); in usbhs_mod_gadget_remove()
1174 kfree(gpriv); in usbhs_mod_gadget_remove()