Lines Matching refs:ci

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