Lines Matching refs:fhci
39 static void fhci_gpio_set_value(struct fhci_hcd *fhci, int gpio_nr, bool on) in fhci_gpio_set_value() argument
41 int gpio = fhci->gpios[gpio_nr]; in fhci_gpio_set_value()
42 bool alow = fhci->alow_gpios[gpio_nr]; in fhci_gpio_set_value()
51 void fhci_config_transceiver(struct fhci_hcd *fhci, in fhci_config_transceiver() argument
54 fhci_dbg(fhci, "-> %s: %d\n", __func__, status); in fhci_config_transceiver()
58 fhci_gpio_set_value(fhci, GPIO_POWER, false); in fhci_config_transceiver()
62 fhci_gpio_set_value(fhci, GPIO_POWER, true); in fhci_config_transceiver()
65 fhci_gpio_set_value(fhci, GPIO_SPEED, false); in fhci_config_transceiver()
68 fhci_gpio_set_value(fhci, GPIO_SPEED, true); in fhci_config_transceiver()
75 fhci_dbg(fhci, "<- %s: %d\n", __func__, status); in fhci_config_transceiver()
79 void fhci_port_disable(struct fhci_hcd *fhci) in fhci_port_disable() argument
81 struct fhci_usb *usb = (struct fhci_usb *)fhci->usb_lld; in fhci_port_disable()
84 fhci_dbg(fhci, "-> %s\n", __func__); in fhci_port_disable()
86 fhci_stop_sof_timer(fhci); in fhci_port_disable()
90 fhci_usb_disable_interrupt((struct fhci_usb *)fhci->usb_lld); in fhci_port_disable()
96 out_be16(&usb->fhci->regs->usb_usbmr, usb->saved_msk); in fhci_port_disable()
100 fhci_device_connected_interrupt(fhci); in fhci_port_disable()
103 fhci_usb_enable_interrupt((struct fhci_usb *)fhci->usb_lld); in fhci_port_disable()
105 fhci_dbg(fhci, "<- %s\n", __func__); in fhci_port_disable()
112 struct fhci_hcd *fhci = usb->fhci; in fhci_port_enable() local
114 fhci_dbg(fhci, "-> %s\n", __func__); in fhci_port_enable()
116 fhci_config_transceiver(fhci, usb->port_status); in fhci_port_enable()
120 fhci_start_sof_timer(fhci); in fhci_port_enable()
125 fhci_dbg(fhci, "<- %s\n", __func__); in fhci_port_enable()
128 void fhci_io_port_generate_reset(struct fhci_hcd *fhci) in fhci_io_port_generate_reset() argument
130 fhci_dbg(fhci, "-> %s\n", __func__); in fhci_io_port_generate_reset()
132 gpio_direction_output(fhci->gpios[GPIO_USBOE], 0); in fhci_io_port_generate_reset()
133 gpio_direction_output(fhci->gpios[GPIO_USBTP], 0); in fhci_io_port_generate_reset()
134 gpio_direction_output(fhci->gpios[GPIO_USBTN], 0); in fhci_io_port_generate_reset()
138 qe_pin_set_dedicated(fhci->pins[PIN_USBOE]); in fhci_io_port_generate_reset()
139 qe_pin_set_dedicated(fhci->pins[PIN_USBTP]); in fhci_io_port_generate_reset()
140 qe_pin_set_dedicated(fhci->pins[PIN_USBTN]); in fhci_io_port_generate_reset()
142 fhci_dbg(fhci, "<- %s\n", __func__); in fhci_io_port_generate_reset()
149 struct fhci_hcd *fhci = usb->fhci; in fhci_port_reset() local
153 fhci_dbg(fhci, "-> %s\n", __func__); in fhci_port_reset()
155 fhci_stop_sof_timer(fhci); in fhci_port_reset()
157 mode = in_8(&fhci->regs->usb_usmod); in fhci_port_reset()
158 out_8(&fhci->regs->usb_usmod, mode & (~USB_MODE_EN)); in fhci_port_reset()
161 mask = in_be16(&fhci->regs->usb_usbmr); in fhci_port_reset()
162 out_be16(&fhci->regs->usb_usbmr, mask & (~USB_E_IDLE_MASK)); in fhci_port_reset()
164 fhci_io_port_generate_reset(fhci); in fhci_port_reset()
167 out_be16(&fhci->regs->usb_usbmr, mask); in fhci_port_reset()
170 mode = in_8(&fhci->regs->usb_usmod); in fhci_port_reset()
171 out_8(&fhci->regs->usb_usmod, mode | USB_MODE_EN); in fhci_port_reset()
172 fhci_start_sof_timer(fhci); in fhci_port_reset()
174 fhci_dbg(fhci, "<- %s\n", __func__); in fhci_port_reset()
179 struct fhci_hcd *fhci = hcd_to_fhci(hcd); in fhci_hub_status_data() local
183 fhci_dbg(fhci, "-> %s\n", __func__); in fhci_hub_status_data()
185 spin_lock_irqsave(&fhci->lock, flags); in fhci_hub_status_data()
187 if (fhci->vroot_hub->port.wPortChange & (USB_PORT_STAT_C_CONNECTION | in fhci_hub_status_data()
192 fhci_dbg(fhci, "-- %s\n", __func__); in fhci_hub_status_data()
195 spin_unlock_irqrestore(&fhci->lock, flags); in fhci_hub_status_data()
197 fhci_dbg(fhci, "<- %s\n", __func__); in fhci_hub_status_data()
205 struct fhci_hcd *fhci = hcd_to_fhci(hcd); in fhci_hub_control() local
211 spin_lock_irqsave(&fhci->lock, flags); in fhci_hub_control()
213 fhci_dbg(fhci, "-> %s\n", __func__); in fhci_hub_control()
226 fhci->vroot_hub->feature &= (1 << wValue); in fhci_hub_control()
230 fhci->vroot_hub->port.wPortStatus &= in fhci_hub_control()
232 fhci_port_disable(fhci); in fhci_hub_control()
235 fhci->vroot_hub->port.wPortChange &= in fhci_hub_control()
239 fhci->vroot_hub->port.wPortStatus &= in fhci_hub_control()
241 fhci_stop_sof_timer(fhci); in fhci_hub_control()
244 fhci->vroot_hub->port.wPortChange &= in fhci_hub_control()
248 fhci->vroot_hub->port.wPortStatus &= in fhci_hub_control()
250 fhci_config_transceiver(fhci, FHCI_PORT_POWER_OFF); in fhci_hub_control()
253 fhci->vroot_hub->port.wPortChange &= in fhci_hub_control()
257 fhci->vroot_hub->port.wPortChange &= in fhci_hub_control()
261 fhci->vroot_hub->port.wPortChange &= in fhci_hub_control()
274 cpu_to_le16(fhci->vroot_hub->hub.wHubStatus); in fhci_hub_control()
276 cpu_to_le16(fhci->vroot_hub->hub.wHubChange); in fhci_hub_control()
281 cpu_to_le16(fhci->vroot_hub->port.wPortStatus); in fhci_hub_control()
283 cpu_to_le16(fhci->vroot_hub->port.wPortChange); in fhci_hub_control()
295 fhci->vroot_hub->feature |= (1 << wValue); in fhci_hub_control()
299 fhci->vroot_hub->port.wPortStatus |= in fhci_hub_control()
301 fhci_port_enable(fhci->usb_lld); in fhci_hub_control()
304 fhci->vroot_hub->port.wPortStatus |= in fhci_hub_control()
306 fhci_stop_sof_timer(fhci); in fhci_hub_control()
309 fhci->vroot_hub->port.wPortStatus |= in fhci_hub_control()
311 fhci_port_reset(fhci->usb_lld); in fhci_hub_control()
312 fhci->vroot_hub->port.wPortStatus |= in fhci_hub_control()
314 fhci->vroot_hub->port.wPortStatus &= in fhci_hub_control()
318 fhci->vroot_hub->port.wPortStatus |= in fhci_hub_control()
320 fhci_config_transceiver(fhci, FHCI_PORT_WAITING); in fhci_hub_control()
331 fhci_dbg(fhci, "<- %s\n", __func__); in fhci_hub_control()
333 spin_unlock_irqrestore(&fhci->lock, flags); in fhci_hub_control()