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()
55 struct ci_hdrc *ci = s->private; in ci_port_test_show() local
59 pm_runtime_get_sync(ci->dev); in ci_port_test_show()
60 spin_lock_irqsave(&ci->lock, flags); in ci_port_test_show()
61 mode = hw_port_test_get(ci); in ci_port_test_show()
62 spin_unlock_irqrestore(&ci->lock, flags); in ci_port_test_show()
63 pm_runtime_put_sync(ci->dev); in ci_port_test_show()
77 struct ci_hdrc *ci = s->private; in ci_port_test_write() local
96 pm_runtime_get_sync(ci->dev); in ci_port_test_write()
97 spin_lock_irqsave(&ci->lock, flags); in ci_port_test_write()
98 ret = hw_port_test_set(ci, mode); in ci_port_test_write()
99 spin_unlock_irqrestore(&ci->lock, flags); in ci_port_test_write()
100 pm_runtime_put_sync(ci->dev); in ci_port_test_write()
123 struct ci_hdrc *ci = s->private; in ci_qheads_show() local
127 if (ci->role != CI_ROLE_GADGET) { in ci_qheads_show()
132 spin_lock_irqsave(&ci->lock, flags); in ci_qheads_show()
133 for (i = 0; i < ci->hw_ep_max/2; i++) { in ci_qheads_show()
134 struct ci_hw_ep *hweprx = &ci->ci_hw_ep[i]; in ci_qheads_show()
136 &ci->ci_hw_ep[i + ci->hw_ep_max/2]; in ci_qheads_show()
144 spin_unlock_irqrestore(&ci->lock, flags); in ci_qheads_show()
155 struct ci_hdrc *ci = s->private; in ci_requests_show() local
161 if (ci->role != CI_ROLE_GADGET) { in ci_requests_show()
166 spin_lock_irqsave(&ci->lock, flags); in ci_requests_show()
167 for (i = 0; i < ci->hw_ep_max; i++) in ci_requests_show()
168 list_for_each_entry(req, &ci->ci_hw_ep[i].qh.queue, queue) { in ci_requests_show()
171 i % (ci->hw_ep_max / 2), in ci_requests_show()
173 ((i < ci->hw_ep_max/2) ? in ci_requests_show()
181 spin_unlock_irqrestore(&ci->lock, flags); in ci_requests_show()
189 struct ci_hdrc *ci = s->private; in ci_otg_show() local
192 if (!ci || !ci_otg_is_fsm_mode(ci)) in ci_otg_show()
195 fsm = &ci->fsm; in ci_otg_show()
199 usb_otg_state_string(ci->otg.state)); in ci_otg_show()
252 struct ci_hdrc *ci = s->private; in ci_role_show() local
254 if (ci->role != CI_ROLE_END) in ci_role_show()
255 seq_printf(s, "%s\n", ci_role(ci)->name); in ci_role_show()
264 struct ci_hdrc *ci = s->private; in ci_role_write() local
273 if (ci->roles[role] && in ci_role_write()
274 !strncmp(buf, ci->roles[role]->name, in ci_role_write()
275 strlen(ci->roles[role]->name))) in ci_role_write()
278 if (role == CI_ROLE_END || role == ci->role) in ci_role_write()
281 pm_runtime_get_sync(ci->dev); in ci_role_write()
282 disable_irq(ci->irq); in ci_role_write()
283 ci_role_stop(ci); in ci_role_write()
284 ret = ci_role_start(ci, role); in ci_role_write()
285 enable_irq(ci->irq); in ci_role_write()
286 pm_runtime_put_sync(ci->dev); in ci_role_write()
306 struct ci_hdrc *ci = s->private; in ci_registers_show() local
309 if (!ci || ci->in_lpm) in ci_registers_show()
313 tmp_reg = hw_read_intr_enable(ci); in ci_registers_show()
316 tmp_reg = hw_read_intr_status(ci); in ci_registers_show()
319 tmp_reg = hw_read(ci, OP_USBMODE, ~0); in ci_registers_show()
322 tmp_reg = hw_read(ci, OP_USBCMD, ~0); in ci_registers_show()
325 tmp_reg = hw_read(ci, OP_PORTSC, ~0); in ci_registers_show()
328 if (ci->is_otg) { in ci_registers_show()
329 tmp_reg = hw_read_otgsc(ci, ~0); in ci_registers_show()
343 void dbg_create_files(struct ci_hdrc *ci) in dbg_create_files() argument
345 ci->debugfs = debugfs_create_dir(dev_name(ci->dev), NULL); in dbg_create_files()
347 debugfs_create_file("device", S_IRUGO, ci->debugfs, ci, in dbg_create_files()
349 debugfs_create_file("port_test", S_IRUGO | S_IWUSR, ci->debugfs, ci, in dbg_create_files()
351 debugfs_create_file("qheads", S_IRUGO, ci->debugfs, ci, in dbg_create_files()
353 debugfs_create_file("requests", S_IRUGO, ci->debugfs, ci, in dbg_create_files()
356 if (ci_otg_is_fsm_mode(ci)) { in dbg_create_files()
357 debugfs_create_file("otg", S_IRUGO, ci->debugfs, ci, in dbg_create_files()
361 debugfs_create_file("role", S_IRUGO | S_IWUSR, ci->debugfs, ci, in dbg_create_files()
363 debugfs_create_file("registers", S_IRUGO, ci->debugfs, ci, in dbg_create_files()
371 void dbg_remove_files(struct ci_hdrc *ci) in dbg_remove_files() argument
373 debugfs_remove_recursive(ci->debugfs); in dbg_remove_files()