Lines Matching refs:ahcd

71 	struct admhcd	*ahcd = hcd_to_admhcd(hcd);
77 spin_lock_irqsave(&ahcd->lock, flags);
82 status = admhc_read_rhdesc(ahcd);
87 if (ahcd->num_ports > 7) {
93 for (i = 0; i < ahcd->num_ports; i++) {
94 status = admhc_read_portstatus(ahcd, i);
109 if (admhc_root_hub_state_changes(ahcd, changed,
116 spin_unlock_irqrestore(&ahcd->lock, flags);
123 static int admhc_get_hub_descriptor(struct admhcd *ahcd, char *buf)
126 u32 rh = admhc_read_rhdesc(ahcd);
133 desc->bNbrPorts = ahcd->num_ports;
134 temp = 1 + (ahcd->num_ports / 8);
147 desc->wHubCharacteristics = (__force __u16)cpu_to_hc16(ahcd, temp);
156 static int admhc_get_hub_status(struct admhcd *ahcd, char *buf)
159 u32 t = admhc_read_rhdesc(ahcd);
170 hs->wHubStatus = (__force __u16)cpu_to_hc16(ahcd, status);
171 hs->wHubChange = (__force __u16)cpu_to_hc16(ahcd, change);
176 static int admhc_get_port_status(struct admhcd *ahcd, unsigned port, char *buf)
179 u32 t = admhc_read_portstatus(ahcd, port);
198 ps->wPortStatus = (__force __u16)cpu_to_hc16(ahcd, status);
199 ps->wPortChange = (__force __u16)cpu_to_hc16(ahcd, change);
210 struct admhcd *ahcd = hcd_to_admhcd(hcd);
218 status = admhc_read_portstatus(ahcd, port);
223 admhc_write_portstatus(ahcd, port, ADMHC_PS_PRS);
227 static void start_hnp(struct admhcd *ahcd);
256 static inline int admhc_port_reset(struct admhcd *ahcd, unsigned port)
260 admhc_vdbg(ahcd, "reset port%d\n", port);
261 t = admhc_read_portstatus(ahcd, port);
265 admhc_write_portstatus(ahcd, port, ADMHC_PS_SPR);
267 admhc_write_portstatus(ahcd, port, (ADMHC_PS_SPE | ADMHC_PS_CSC));
273 static inline int admhc_port_enable(struct admhcd *ahcd, unsigned port)
277 admhc_vdbg(ahcd, "enable port%d\n", port);
278 t = admhc_read_portstatus(ahcd, port);
282 admhc_write_portstatus(ahcd, port, ADMHC_PS_SPE);
287 static inline int admhc_port_disable(struct admhcd *ahcd, unsigned port)
291 admhc_vdbg(ahcd, "disable port%d\n", port);
292 t = admhc_read_portstatus(ahcd, port);
296 admhc_write_portstatus(ahcd, port, ADMHC_PS_CPE);
301 static inline int admhc_port_write(struct admhcd *ahcd, unsigned port,
305 dbg_port_write(ahcd, "write", port, val);
307 admhc_write_portstatus(ahcd, port, val);
315 struct admhcd *ahcd = hcd_to_admhcd(hcd);
316 int ports = ahcd->num_ports;
327 admhc_writel(ahcd, ADMHC_RH_OCIC,
328 &ahcd->regs->roothub.status);
343 ret = admhc_port_disable(ahcd, wIndex);
346 ret = admhc_port_write(ahcd, wIndex, ADMHC_PS_CPS);
349 ret = admhc_port_write(ahcd, wIndex, ADMHC_PS_CPP);
352 ret = admhc_port_write(ahcd, wIndex, ADMHC_PS_CSC);
355 ret = admhc_port_write(ahcd, wIndex, ADMHC_PS_PESC);
358 ret = admhc_port_write(ahcd, wIndex, ADMHC_PS_PSSC);
361 ret = admhc_port_write(ahcd, wIndex, ADMHC_PS_OCIC);
364 ret = admhc_port_write(ahcd, wIndex, ADMHC_PS_PRSC);
371 ret = admhc_get_hub_descriptor(ahcd, buf);
374 ret = admhc_get_hub_status(ahcd, buf);
381 ret = admhc_get_port_status(ahcd, wIndex, buf);
400 ret = admhc_port_enable(ahcd, wIndex);
403 ret = admhc_port_reset(ahcd, wIndex);
409 start_hnp(ahcd);
412 ret = admhc_port_write(ahcd, wIndex, ADMHC_PS_SPS);
415 ret = admhc_port_write(ahcd, wIndex, ADMHC_PS_SPP);