Lines Matching refs:ci
26 struct ci_hdrc *ci = s->private; in ci_device_show() local
27 struct usb_gadget *gadget = &ci->gadget; in ci_device_show()
39 if (!ci->driver) in ci_device_show()
43 (ci->driver->function ? ci->driver->function : "")); in ci_device_show()
44 seq_printf(s, "gadget max speed = %d\n", ci->driver->max_speed); in ci_device_show()
66 struct ci_hdrc *ci = s->private; in ci_port_test_show() local
70 pm_runtime_get_sync(ci->dev); in ci_port_test_show()
71 spin_lock_irqsave(&ci->lock, flags); in ci_port_test_show()
72 mode = hw_port_test_get(ci); in ci_port_test_show()
73 spin_unlock_irqrestore(&ci->lock, flags); in ci_port_test_show()
74 pm_runtime_put_sync(ci->dev); in ci_port_test_show()
88 struct ci_hdrc *ci = s->private; in ci_port_test_write() local
104 pm_runtime_get_sync(ci->dev); in ci_port_test_write()
105 spin_lock_irqsave(&ci->lock, flags); in ci_port_test_write()
106 ret = hw_port_test_set(ci, mode); in ci_port_test_write()
107 spin_unlock_irqrestore(&ci->lock, flags); in ci_port_test_write()
108 pm_runtime_put_sync(ci->dev); in ci_port_test_write()
131 struct ci_hdrc *ci = s->private; in ci_qheads_show() local
135 if (ci->role != CI_ROLE_GADGET) { in ci_qheads_show()
140 spin_lock_irqsave(&ci->lock, flags); in ci_qheads_show()
141 for (i = 0; i < ci->hw_ep_max/2; i++) { in ci_qheads_show()
142 struct ci_hw_ep *hweprx = &ci->ci_hw_ep[i]; in ci_qheads_show()
144 &ci->ci_hw_ep[i + ci->hw_ep_max/2]; in ci_qheads_show()
152 spin_unlock_irqrestore(&ci->lock, flags); in ci_qheads_show()
174 struct ci_hdrc *ci = s->private; in ci_requests_show() local
181 if (ci->role != CI_ROLE_GADGET) { in ci_requests_show()
186 spin_lock_irqsave(&ci->lock, flags); in ci_requests_show()
187 for (i = 0; i < ci->hw_ep_max; i++) in ci_requests_show()
188 list_for_each(ptr, &ci->ci_hw_ep[i].qh.queue) { in ci_requests_show()
193 i % (ci->hw_ep_max / 2), in ci_requests_show()
195 ((i < ci->hw_ep_max/2) ? in ci_requests_show()
203 spin_unlock_irqrestore(&ci->lock, flags); in ci_requests_show()
222 struct ci_hdrc *ci = s->private; in ci_otg_show() local
225 if (!ci || !ci_otg_is_fsm_mode(ci)) in ci_otg_show()
228 fsm = &ci->fsm; in ci_otg_show()
232 usb_otg_state_string(ci->otg.state)); in ci_otg_show()
296 struct ci_hdrc *ci = s->private; in ci_role_show() local
298 seq_printf(s, "%s\n", ci_role(ci)->name); in ci_role_show()
307 struct ci_hdrc *ci = s->private; in ci_role_write() local
316 if (ci->roles[role] && in ci_role_write()
317 !strncmp(buf, ci->roles[role]->name, in ci_role_write()
318 strlen(ci->roles[role]->name))) in ci_role_write()
321 if (role == CI_ROLE_END || role == ci->role) in ci_role_write()
324 pm_runtime_get_sync(ci->dev); in ci_role_write()
325 disable_irq(ci->irq); in ci_role_write()
326 ci_role_stop(ci); in ci_role_write()
327 ret = ci_role_start(ci, role); in ci_role_write()
328 enable_irq(ci->irq); in ci_role_write()
329 pm_runtime_put_sync(ci->dev); in ci_role_write()
349 struct ci_hdrc *ci = s->private; in ci_registers_show() local
352 if (!ci || ci->in_lpm) in ci_registers_show()
356 tmp_reg = hw_read_intr_enable(ci); in ci_registers_show()
359 tmp_reg = hw_read_intr_status(ci); in ci_registers_show()
362 tmp_reg = hw_read(ci, OP_USBMODE, ~0); in ci_registers_show()
365 tmp_reg = hw_read(ci, OP_USBCMD, ~0); in ci_registers_show()
368 tmp_reg = hw_read(ci, OP_PORTSC, ~0); in ci_registers_show()
371 if (ci->is_otg) { in ci_registers_show()
372 tmp_reg = hw_read_otgsc(ci, ~0); in ci_registers_show()
397 int dbg_create_files(struct ci_hdrc *ci) in dbg_create_files() argument
401 ci->debugfs = debugfs_create_dir(dev_name(ci->dev), NULL); in dbg_create_files()
402 if (!ci->debugfs) in dbg_create_files()
405 dent = debugfs_create_file("device", S_IRUGO, ci->debugfs, ci, in dbg_create_files()
410 dent = debugfs_create_file("port_test", S_IRUGO | S_IWUSR, ci->debugfs, in dbg_create_files()
411 ci, &ci_port_test_fops); in dbg_create_files()
415 dent = debugfs_create_file("qheads", S_IRUGO, ci->debugfs, ci, in dbg_create_files()
420 dent = debugfs_create_file("requests", S_IRUGO, ci->debugfs, ci, in dbg_create_files()
425 if (ci_otg_is_fsm_mode(ci)) { in dbg_create_files()
426 dent = debugfs_create_file("otg", S_IRUGO, ci->debugfs, ci, in dbg_create_files()
432 dent = debugfs_create_file("role", S_IRUGO | S_IWUSR, ci->debugfs, ci, in dbg_create_files()
437 dent = debugfs_create_file("registers", S_IRUGO, ci->debugfs, ci, in dbg_create_files()
443 debugfs_remove_recursive(ci->debugfs); in dbg_create_files()
451 void dbg_remove_files(struct ci_hdrc *ci) in dbg_remove_files() argument
453 debugfs_remove_recursive(ci->debugfs); in dbg_remove_files()