Lines Matching refs:fhci
43 static void fhci_gpio_set_value(struct fhci_hcd *fhci, int gpio_nr, bool on) in fhci_gpio_set_value() argument
45 int gpio = fhci->gpios[gpio_nr]; in fhci_gpio_set_value()
46 bool alow = fhci->alow_gpios[gpio_nr]; in fhci_gpio_set_value()
55 void fhci_config_transceiver(struct fhci_hcd *fhci, in fhci_config_transceiver() argument
58 fhci_dbg(fhci, "-> %s: %d\n", __func__, status); in fhci_config_transceiver()
62 fhci_gpio_set_value(fhci, GPIO_POWER, false); in fhci_config_transceiver()
66 fhci_gpio_set_value(fhci, GPIO_POWER, true); in fhci_config_transceiver()
69 fhci_gpio_set_value(fhci, GPIO_SPEED, false); in fhci_config_transceiver()
72 fhci_gpio_set_value(fhci, GPIO_SPEED, true); in fhci_config_transceiver()
79 fhci_dbg(fhci, "<- %s: %d\n", __func__, status); in fhci_config_transceiver()
83 void fhci_port_disable(struct fhci_hcd *fhci) in fhci_port_disable() argument
85 struct fhci_usb *usb = (struct fhci_usb *)fhci->usb_lld; in fhci_port_disable()
88 fhci_dbg(fhci, "-> %s\n", __func__); in fhci_port_disable()
90 fhci_stop_sof_timer(fhci); in fhci_port_disable()
94 fhci_usb_disable_interrupt((struct fhci_usb *)fhci->usb_lld); in fhci_port_disable()
100 out_be16(&usb->fhci->regs->usb_usbmr, usb->saved_msk); in fhci_port_disable()
104 fhci_device_connected_interrupt(fhci); in fhci_port_disable()
107 fhci_usb_enable_interrupt((struct fhci_usb *)fhci->usb_lld); in fhci_port_disable()
109 fhci_dbg(fhci, "<- %s\n", __func__); in fhci_port_disable()
116 struct fhci_hcd *fhci = usb->fhci; in fhci_port_enable() local
118 fhci_dbg(fhci, "-> %s\n", __func__); in fhci_port_enable()
120 fhci_config_transceiver(fhci, usb->port_status); in fhci_port_enable()
124 fhci_start_sof_timer(fhci); in fhci_port_enable()
129 fhci_dbg(fhci, "<- %s\n", __func__); in fhci_port_enable()
132 void fhci_io_port_generate_reset(struct fhci_hcd *fhci) in fhci_io_port_generate_reset() argument
134 fhci_dbg(fhci, "-> %s\n", __func__); in fhci_io_port_generate_reset()
136 gpio_direction_output(fhci->gpios[GPIO_USBOE], 0); in fhci_io_port_generate_reset()
137 gpio_direction_output(fhci->gpios[GPIO_USBTP], 0); in fhci_io_port_generate_reset()
138 gpio_direction_output(fhci->gpios[GPIO_USBTN], 0); in fhci_io_port_generate_reset()
142 qe_pin_set_dedicated(fhci->pins[PIN_USBOE]); in fhci_io_port_generate_reset()
143 qe_pin_set_dedicated(fhci->pins[PIN_USBTP]); in fhci_io_port_generate_reset()
144 qe_pin_set_dedicated(fhci->pins[PIN_USBTN]); in fhci_io_port_generate_reset()
146 fhci_dbg(fhci, "<- %s\n", __func__); in fhci_io_port_generate_reset()
153 struct fhci_hcd *fhci = usb->fhci; in fhci_port_reset() local
157 fhci_dbg(fhci, "-> %s\n", __func__); in fhci_port_reset()
159 fhci_stop_sof_timer(fhci); in fhci_port_reset()
161 mode = in_8(&fhci->regs->usb_usmod); in fhci_port_reset()
162 out_8(&fhci->regs->usb_usmod, mode & (~USB_MODE_EN)); in fhci_port_reset()
165 mask = in_be16(&fhci->regs->usb_usbmr); in fhci_port_reset()
166 out_be16(&fhci->regs->usb_usbmr, mask & (~USB_E_IDLE_MASK)); in fhci_port_reset()
168 fhci_io_port_generate_reset(fhci); in fhci_port_reset()
171 out_be16(&fhci->regs->usb_usbmr, mask); in fhci_port_reset()
174 mode = in_8(&fhci->regs->usb_usmod); in fhci_port_reset()
175 out_8(&fhci->regs->usb_usmod, mode | USB_MODE_EN); in fhci_port_reset()
176 fhci_start_sof_timer(fhci); in fhci_port_reset()
178 fhci_dbg(fhci, "<- %s\n", __func__); in fhci_port_reset()
183 struct fhci_hcd *fhci = hcd_to_fhci(hcd); in fhci_hub_status_data() local
187 fhci_dbg(fhci, "-> %s\n", __func__); in fhci_hub_status_data()
189 spin_lock_irqsave(&fhci->lock, flags); in fhci_hub_status_data()
191 if (fhci->vroot_hub->port.wPortChange & (USB_PORT_STAT_C_CONNECTION | in fhci_hub_status_data()
196 fhci_dbg(fhci, "-- %s\n", __func__); in fhci_hub_status_data()
199 spin_unlock_irqrestore(&fhci->lock, flags); in fhci_hub_status_data()
201 fhci_dbg(fhci, "<- %s\n", __func__); in fhci_hub_status_data()
209 struct fhci_hcd *fhci = hcd_to_fhci(hcd); in fhci_hub_control() local
215 spin_lock_irqsave(&fhci->lock, flags); in fhci_hub_control()
217 fhci_dbg(fhci, "-> %s\n", __func__); in fhci_hub_control()
230 fhci->vroot_hub->feature &= (1 << wValue); in fhci_hub_control()
234 fhci->vroot_hub->port.wPortStatus &= in fhci_hub_control()
236 fhci_port_disable(fhci); in fhci_hub_control()
239 fhci->vroot_hub->port.wPortChange &= in fhci_hub_control()
243 fhci->vroot_hub->port.wPortStatus &= in fhci_hub_control()
245 fhci_stop_sof_timer(fhci); in fhci_hub_control()
248 fhci->vroot_hub->port.wPortChange &= in fhci_hub_control()
252 fhci->vroot_hub->port.wPortStatus &= in fhci_hub_control()
254 fhci_config_transceiver(fhci, FHCI_PORT_POWER_OFF); in fhci_hub_control()
257 fhci->vroot_hub->port.wPortChange &= in fhci_hub_control()
261 fhci->vroot_hub->port.wPortChange &= in fhci_hub_control()
265 fhci->vroot_hub->port.wPortChange &= in fhci_hub_control()
278 cpu_to_le16(fhci->vroot_hub->hub.wHubStatus); in fhci_hub_control()
280 cpu_to_le16(fhci->vroot_hub->hub.wHubChange); in fhci_hub_control()
285 cpu_to_le16(fhci->vroot_hub->port.wPortStatus); in fhci_hub_control()
287 cpu_to_le16(fhci->vroot_hub->port.wPortChange); in fhci_hub_control()
299 fhci->vroot_hub->feature |= (1 << wValue); in fhci_hub_control()
303 fhci->vroot_hub->port.wPortStatus |= in fhci_hub_control()
305 fhci_port_enable(fhci->usb_lld); in fhci_hub_control()
308 fhci->vroot_hub->port.wPortStatus |= in fhci_hub_control()
310 fhci_stop_sof_timer(fhci); in fhci_hub_control()
313 fhci->vroot_hub->port.wPortStatus |= in fhci_hub_control()
315 fhci_port_reset(fhci->usb_lld); in fhci_hub_control()
316 fhci->vroot_hub->port.wPortStatus |= in fhci_hub_control()
318 fhci->vroot_hub->port.wPortStatus &= in fhci_hub_control()
322 fhci->vroot_hub->port.wPortStatus |= in fhci_hub_control()
324 fhci_config_transceiver(fhci, FHCI_PORT_WAITING); in fhci_hub_control()
335 fhci_dbg(fhci, "<- %s\n", __func__); in fhci_hub_control()
337 spin_unlock_irqrestore(&fhci->lock, flags); in fhci_hub_control()