Lines Matching refs:fhci

24 #include "fhci.h"
39 static void fhci_gpio_set_value(struct fhci_hcd *fhci, int gpio_nr, bool on)
41 struct gpio_desc *gpiod = fhci->gpiods[gpio_nr];
50 void fhci_config_transceiver(struct fhci_hcd *fhci,
53 fhci_dbg(fhci, "-> %s: %d\n", __func__, status);
57 fhci_gpio_set_value(fhci, GPIO_POWER, false);
61 fhci_gpio_set_value(fhci, GPIO_POWER, true);
64 fhci_gpio_set_value(fhci, GPIO_SPEED, false);
67 fhci_gpio_set_value(fhci, GPIO_SPEED, true);
74 fhci_dbg(fhci, "<- %s: %d\n", __func__, status);
78 void fhci_port_disable(struct fhci_hcd *fhci)
80 struct fhci_usb *usb = (struct fhci_usb *)fhci->usb_lld;
83 fhci_dbg(fhci, "-> %s\n", __func__);
85 fhci_stop_sof_timer(fhci);
89 fhci_usb_disable_interrupt((struct fhci_usb *)fhci->usb_lld);
95 out_be16(&usb->fhci->regs->usb_usbmr, usb->saved_msk);
99 fhci_device_connected_interrupt(fhci);
102 fhci_usb_enable_interrupt((struct fhci_usb *)fhci->usb_lld);
104 fhci_dbg(fhci, "<- %s\n", __func__);
111 struct fhci_hcd *fhci = usb->fhci;
113 fhci_dbg(fhci, "-> %s\n", __func__);
115 fhci_config_transceiver(fhci, usb->port_status);
119 fhci_start_sof_timer(fhci);
124 fhci_dbg(fhci, "<- %s\n", __func__);
127 void fhci_io_port_generate_reset(struct fhci_hcd *fhci)
129 fhci_dbg(fhci, "-> %s\n", __func__);
131 gpiod_direction_output(fhci->gpiods[GPIO_USBOE], 0);
132 gpiod_direction_output(fhci->gpiods[GPIO_USBTP], 0);
133 gpiod_direction_output(fhci->gpiods[GPIO_USBTN], 0);
137 qe_pin_set_dedicated(fhci->pins[PIN_USBOE]);
138 qe_pin_set_dedicated(fhci->pins[PIN_USBTP]);
139 qe_pin_set_dedicated(fhci->pins[PIN_USBTN]);
141 fhci_dbg(fhci, "<- %s\n", __func__);
148 struct fhci_hcd *fhci = usb->fhci;
152 fhci_dbg(fhci, "-> %s\n", __func__);
154 fhci_stop_sof_timer(fhci);
156 mode = in_8(&fhci->regs->usb_usmod);
157 out_8(&fhci->regs->usb_usmod, mode & (~USB_MODE_EN));
160 mask = in_be16(&fhci->regs->usb_usbmr);
161 out_be16(&fhci->regs->usb_usbmr, mask & (~USB_E_IDLE_MASK));
163 fhci_io_port_generate_reset(fhci);
166 out_be16(&fhci->regs->usb_usbmr, mask);
169 mode = in_8(&fhci->regs->usb_usmod);
170 out_8(&fhci->regs->usb_usmod, mode | USB_MODE_EN);
171 fhci_start_sof_timer(fhci);
173 fhci_dbg(fhci, "<- %s\n", __func__);
178 struct fhci_hcd *fhci = hcd_to_fhci(hcd);
182 fhci_dbg(fhci, "-> %s\n", __func__);
184 spin_lock_irqsave(&fhci->lock, flags);
186 if (fhci->vroot_hub->port.wPortChange & (USB_PORT_STAT_C_CONNECTION |
191 fhci_dbg(fhci, "-- %s\n", __func__);
194 spin_unlock_irqrestore(&fhci->lock, flags);
196 fhci_dbg(fhci, "<- %s\n", __func__);
204 struct fhci_hcd *fhci = hcd_to_fhci(hcd);
210 spin_lock_irqsave(&fhci->lock, flags);
212 fhci_dbg(fhci, "-> %s\n", __func__);
225 fhci->vroot_hub->feature &= (1 << wValue);
229 fhci->vroot_hub->port.wPortStatus &=
231 fhci_port_disable(fhci);
234 fhci->vroot_hub->port.wPortChange &=
238 fhci->vroot_hub->port.wPortStatus &=
240 fhci_stop_sof_timer(fhci);
243 fhci->vroot_hub->port.wPortChange &=
247 fhci->vroot_hub->port.wPortStatus &=
249 fhci_config_transceiver(fhci, FHCI_PORT_POWER_OFF);
252 fhci->vroot_hub->port.wPortChange &=
256 fhci->vroot_hub->port.wPortChange &=
260 fhci->vroot_hub->port.wPortChange &=
273 cpu_to_le16(fhci->vroot_hub->hub.wHubStatus);
275 cpu_to_le16(fhci->vroot_hub->hub.wHubChange);
280 cpu_to_le16(fhci->vroot_hub->port.wPortStatus);
282 cpu_to_le16(fhci->vroot_hub->port.wPortChange);
294 fhci->vroot_hub->feature |= (1 << wValue);
298 fhci->vroot_hub->port.wPortStatus |=
300 fhci_port_enable(fhci->usb_lld);
303 fhci->vroot_hub->port.wPortStatus |=
305 fhci_stop_sof_timer(fhci);
308 fhci->vroot_hub->port.wPortStatus |=
310 fhci_port_reset(fhci->usb_lld);
311 fhci->vroot_hub->port.wPortStatus |=
313 fhci->vroot_hub->port.wPortStatus &=
317 fhci->vroot_hub->port.wPortStatus |=
319 fhci_config_transceiver(fhci, FHCI_PORT_WAITING);
330 fhci_dbg(fhci, "<- %s\n", __func__);
332 spin_unlock_irqrestore(&fhci->lock, flags);