Lines Matching refs:ci

42 	struct ci_hdrc *ci = dev_get_drvdata(dev);  in ehci_ci_portpower()  local
65 if (ci->platdata->flags & CI_HDRC_PHY_VBUS_CONTROL) { in ehci_ci_portpower()
67 usb_phy_vbus_on(ci->usb_phy); in ehci_ci_portpower()
69 usb_phy_vbus_off(ci->usb_phy); in ehci_ci_portpower()
72 if (enable && (ci->platdata->phy_mode == USBPHY_INTERFACE_MODE_HSIC)) { in ehci_ci_portpower()
77 hw_port_test_set(ci, 5); in ehci_ci_portpower()
78 hw_port_test_set(ci, 0); in ehci_ci_portpower()
86 struct ci_hdrc *ci = dev_get_drvdata(dev); in ehci_ci_reset() local
96 if (ci->platdata->notify_event) { in ehci_ci_reset()
97 ret = ci->platdata->notify_event(ci, in ehci_ci_reset()
103 ci_platform_configure(ci); in ehci_ci_reset()
114 static irqreturn_t host_irq(struct ci_hdrc *ci) in host_irq() argument
116 return usb_hcd_irq(ci->irq, ci->hcd); in host_irq()
119 static int host_start(struct ci_hdrc *ci) in host_start() argument
129 hcd = __usb_create_hcd(&ci_ehci_hc_driver, ci->dev->parent, in host_start()
130 ci->dev, dev_name(ci->dev), NULL); in host_start()
134 dev_set_drvdata(ci->dev, ci); in host_start()
135 hcd->rsrc_start = ci->hw_bank.phys; in host_start()
136 hcd->rsrc_len = ci->hw_bank.size; in host_start()
137 hcd->regs = ci->hw_bank.abs; in host_start()
140 hcd->power_budget = ci->platdata->power_budget; in host_start()
141 hcd->tpl_support = ci->platdata->tpl_support; in host_start()
142 if (ci->phy || ci->usb_phy) { in host_start()
144 if (ci->usb_phy) in host_start()
145 hcd->usb_phy = ci->usb_phy; in host_start()
149 ehci->caps = ci->hw_bank.cap; in host_start()
150 ehci->has_hostpc = ci->hw_bank.lpm; in host_start()
151 ehci->has_tdi_phy_lpm = ci->hw_bank.lpm; in host_start()
152 ehci->imx28_write_fix = ci->imx28_write_fix; in host_start()
153 ehci->has_ci_pec_bug = ci->has_portsc_pec_bug; in host_start()
158 if (ci->platdata->reg_vbus && !ci_otg_is_fsm_mode(ci)) { in host_start()
159 if (ci->platdata->flags & CI_HDRC_TURN_VBUS_EARLY_ON) { in host_start()
160 ret = regulator_enable(ci->platdata->reg_vbus); in host_start()
162 dev_err(ci->dev, in host_start()
168 priv->reg_vbus = ci->platdata->reg_vbus; in host_start()
172 if (ci->platdata->pins_host) in host_start()
173 pinctrl_select_state(ci->platdata->pctl, in host_start()
174 ci->platdata->pins_host); in host_start()
176 ci->hcd = hcd; in host_start()
180 ci->hcd = NULL; in host_start()
183 struct usb_otg *otg = &ci->otg; in host_start()
185 if (ci_otg_is_fsm_mode(ci)) { in host_start()
190 if (ci->platdata->notify_event && in host_start()
191 (ci->platdata->flags & CI_HDRC_IMX_IS_HSIC)) in host_start()
192 ci->platdata->notify_event in host_start()
193 (ci, CI_HDRC_IMX_HSIC_ACTIVE_EVENT); in host_start()
199 if (ci->platdata->reg_vbus && !ci_otg_is_fsm_mode(ci) && in host_start()
200 (ci->platdata->flags & CI_HDRC_TURN_VBUS_EARLY_ON)) in host_start()
201 regulator_disable(ci->platdata->reg_vbus); in host_start()
208 static void host_stop(struct ci_hdrc *ci) in host_stop() argument
210 struct usb_hcd *hcd = ci->hcd; in host_stop()
213 if (ci->platdata->notify_event) in host_stop()
214 ci->platdata->notify_event(ci, in host_stop()
217 ci->role = CI_ROLE_END; in host_stop()
218 synchronize_irq(ci->irq); in host_stop()
220 if (ci->platdata->reg_vbus && !ci_otg_is_fsm_mode(ci) && in host_stop()
221 (ci->platdata->flags & CI_HDRC_TURN_VBUS_EARLY_ON)) in host_stop()
222 regulator_disable(ci->platdata->reg_vbus); in host_stop()
224 ci->hcd = NULL; in host_stop()
225 ci->otg.host = NULL; in host_stop()
227 if (ci->platdata->pins_host && ci->platdata->pins_default) in host_stop()
228 pinctrl_select_state(ci->platdata->pctl, in host_stop()
229 ci->platdata->pins_default); in host_stop()
233 void ci_hdrc_host_destroy(struct ci_hdrc *ci) in ci_hdrc_host_destroy() argument
235 if (ci->role == CI_ROLE_HOST && ci->hcd) in ci_hdrc_host_destroy()
236 host_stop(ci); in ci_hdrc_host_destroy()
257 struct ci_hdrc *ci = dev_get_drvdata(dev); in ci_ehci_hub_control() local
265 if (ci->platdata->hub_control) { in ci_ehci_hub_control()
266 retval = ci->platdata->hub_control(ci, typeReq, wValue, wIndex, in ci_ehci_hub_control()
296 if (ci->platdata->flags & CI_HDRC_IMX_IS_HSIC) { in ci_ehci_hub_control()
297 if (ci->platdata->notify_event) in ci_ehci_hub_control()
298 ci->platdata->notify_event(ci, in ci_ehci_hub_control()
333 struct ci_hdrc *ci = dev_get_drvdata(dev); in ci_ehci_bus_suspend() local
369 if (ci->platdata->flags & CI_HDRC_IMX_IS_HSIC) { in ci_ehci_bus_suspend()
456 static void ci_hdrc_host_suspend(struct ci_hdrc *ci) in ci_hdrc_host_suspend() argument
458 ehci_suspend(ci->hcd, device_may_wakeup(ci->dev)); in ci_hdrc_host_suspend()
461 static void ci_hdrc_host_resume(struct ci_hdrc *ci, bool power_lost) in ci_hdrc_host_resume() argument
463 ehci_resume(ci->hcd, power_lost); in ci_hdrc_host_resume()
467 int ci_hdrc_host_init(struct ci_hdrc *ci) in ci_hdrc_host_init() argument
471 if (!hw_read(ci, CAP_DCCPARAMS, DCCPARAMS_HC)) in ci_hdrc_host_init()
474 rdrv = devm_kzalloc(ci->dev, sizeof(struct ci_role_driver), GFP_KERNEL); in ci_hdrc_host_init()
486 ci->roles[CI_ROLE_HOST] = rdrv; in ci_hdrc_host_init()
488 if (ci->platdata->flags & CI_HDRC_REQUIRES_ALIGNED_DMA) { in ci_hdrc_host_init()