Lines Matching refs:dwc
282 struct dwc3 *dwc = s->private; in dwc3_host_lsp() local
288 dbc_enabled = !!(dwc->hwparams.hwparams1 & DWC3_GHWPARAMS1_ENDBC); in dwc3_host_lsp()
290 sel = dwc->dbg_lsp_select; in dwc3_host_lsp()
298 dwc3_writel(dwc->regs, DWC3_GDBGLSPMUX, reg); in dwc3_host_lsp()
299 val = dwc3_readl(dwc->regs, DWC3_GDBGLSP); in dwc3_host_lsp()
304 dwc3_writel(dwc->regs, DWC3_GDBGLSPMUX, reg); in dwc3_host_lsp()
305 val = dwc3_readl(dwc->regs, DWC3_GDBGLSP); in dwc3_host_lsp()
312 struct dwc3 *dwc = s->private; in dwc3_gadget_lsp() local
318 dwc3_writel(dwc->regs, DWC3_GDBGLSPMUX, reg); in dwc3_gadget_lsp()
319 reg = dwc3_readl(dwc->regs, DWC3_GDBGLSP); in dwc3_gadget_lsp()
326 struct dwc3 *dwc = s->private; in dwc3_lsp_show() local
331 spin_lock_irqsave(&dwc->lock, flags); in dwc3_lsp_show()
332 reg = dwc3_readl(dwc->regs, DWC3_GSTS); in dwc3_lsp_show()
346 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_lsp_show()
360 struct dwc3 *dwc = s->private; in dwc3_lsp_write() local
373 spin_lock_irqsave(&dwc->lock, flags); in dwc3_lsp_write()
374 dwc->dbg_lsp_select = sel; in dwc3_lsp_write()
375 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_lsp_write()
390 struct dwc3 *dwc = s->private; in dwc3_mode_show() local
394 spin_lock_irqsave(&dwc->lock, flags); in dwc3_mode_show()
395 reg = dwc3_readl(dwc->regs, DWC3_GCTL); in dwc3_mode_show()
396 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_mode_show()
424 struct dwc3 *dwc = s->private; in dwc3_mode_write() local
431 if (dwc->dr_mode != USB_DR_MODE_OTG) in dwc3_mode_write()
443 dwc3_set_mode(dwc, mode); in dwc3_mode_write()
458 struct dwc3 *dwc = s->private; in dwc3_testmode_show() local
462 spin_lock_irqsave(&dwc->lock, flags); in dwc3_testmode_show()
463 reg = dwc3_readl(dwc->regs, DWC3_DCTL); in dwc3_testmode_show()
466 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_testmode_show()
503 struct dwc3 *dwc = s->private; in dwc3_testmode_write() local
524 spin_lock_irqsave(&dwc->lock, flags); in dwc3_testmode_write()
525 dwc3_gadget_set_test_mode(dwc, testmode); in dwc3_testmode_write()
526 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_testmode_write()
541 struct dwc3 *dwc = s->private; in dwc3_link_state_show() local
547 spin_lock_irqsave(&dwc->lock, flags); in dwc3_link_state_show()
548 reg = dwc3_readl(dwc->regs, DWC3_GSTS); in dwc3_link_state_show()
551 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_link_state_show()
555 reg = dwc3_readl(dwc->regs, DWC3_DSTS); in dwc3_link_state_show()
562 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_link_state_show()
576 struct dwc3 *dwc = s->private; in dwc3_link_state_write() local
601 spin_lock_irqsave(&dwc->lock, flags); in dwc3_link_state_write()
602 reg = dwc3_readl(dwc->regs, DWC3_GSTS); in dwc3_link_state_write()
604 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_link_state_write()
608 reg = dwc3_readl(dwc->regs, DWC3_DSTS); in dwc3_link_state_write()
613 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_link_state_write()
617 dwc3_gadget_set_link_state(dwc, state); in dwc3_link_state_write()
618 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_link_state_write()
639 struct dwc3 *dwc = dep->dwc; in dwc3_tx_fifo_size_show() local
644 spin_lock_irqsave(&dwc->lock, flags); in dwc3_tx_fifo_size_show()
648 mdwidth = dwc3_mdwidth(dwc); in dwc3_tx_fifo_size_show()
653 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_tx_fifo_size_show()
661 struct dwc3 *dwc = dep->dwc; in dwc3_rx_fifo_size_show() local
666 spin_lock_irqsave(&dwc->lock, flags); in dwc3_rx_fifo_size_show()
670 mdwidth = dwc3_mdwidth(dwc); in dwc3_rx_fifo_size_show()
675 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_rx_fifo_size_show()
683 struct dwc3 *dwc = dep->dwc; in dwc3_tx_request_queue_show() local
687 spin_lock_irqsave(&dwc->lock, flags); in dwc3_tx_request_queue_show()
690 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_tx_request_queue_show()
698 struct dwc3 *dwc = dep->dwc; in dwc3_rx_request_queue_show() local
702 spin_lock_irqsave(&dwc->lock, flags); in dwc3_rx_request_queue_show()
705 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_rx_request_queue_show()
713 struct dwc3 *dwc = dep->dwc; in dwc3_rx_info_queue_show() local
717 spin_lock_irqsave(&dwc->lock, flags); in dwc3_rx_info_queue_show()
720 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_rx_info_queue_show()
728 struct dwc3 *dwc = dep->dwc; in dwc3_descriptor_fetch_queue_show() local
732 spin_lock_irqsave(&dwc->lock, flags); in dwc3_descriptor_fetch_queue_show()
735 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_descriptor_fetch_queue_show()
743 struct dwc3 *dwc = dep->dwc; in dwc3_event_queue_show() local
747 spin_lock_irqsave(&dwc->lock, flags); in dwc3_event_queue_show()
750 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_event_queue_show()
758 struct dwc3 *dwc = dep->dwc; in dwc3_transfer_type_show() local
761 spin_lock_irqsave(&dwc->lock, flags); in dwc3_transfer_type_show()
785 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_transfer_type_show()
793 struct dwc3 *dwc = dep->dwc; in dwc3_trb_ring_show() local
797 spin_lock_irqsave(&dwc->lock, flags); in dwc3_trb_ring_show()
823 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_trb_ring_show()
831 struct dwc3 *dwc = dep->dwc; in dwc3_ep_info_register_show() local
838 spin_lock_irqsave(&dwc->lock, flags); in dwc3_ep_info_register_show()
840 dwc3_writel(dwc->regs, DWC3_GDBGLSPMUX, reg); in dwc3_ep_info_register_show()
842 lower_32_bits = dwc3_readl(dwc->regs, DWC3_GDBGEPINFO0); in dwc3_ep_info_register_show()
843 upper_32_bits = dwc3_readl(dwc->regs, DWC3_GDBGEPINFO1); in dwc3_ep_info_register_show()
847 spin_unlock_irqrestore(&dwc->lock, flags); in dwc3_ep_info_register_show()
894 root = debugfs_lookup(dev_name(dep->dwc->dev), usb_debug_root); in dwc3_debugfs_create_endpoint_dir()
899 void dwc3_debugfs_init(struct dwc3 *dwc) in dwc3_debugfs_init() argument
903 dwc->regset = kzalloc(sizeof(*dwc->regset), GFP_KERNEL); in dwc3_debugfs_init()
904 if (!dwc->regset) in dwc3_debugfs_init()
907 dwc->dbg_lsp_select = DWC3_LSP_MUX_UNSELECTED; in dwc3_debugfs_init()
909 dwc->regset->regs = dwc3_regs; in dwc3_debugfs_init()
910 dwc->regset->nregs = ARRAY_SIZE(dwc3_regs); in dwc3_debugfs_init()
911 dwc->regset->base = dwc->regs - DWC3_GLOBALS_REGS_START; in dwc3_debugfs_init()
913 root = debugfs_create_dir(dev_name(dwc->dev), usb_debug_root); in dwc3_debugfs_init()
914 debugfs_create_regset32("regdump", 0444, root, dwc->regset); in dwc3_debugfs_init()
915 debugfs_create_file("lsp_dump", 0644, root, dwc, &dwc3_lsp_fops); in dwc3_debugfs_init()
918 debugfs_create_file("mode", 0644, root, dwc, in dwc3_debugfs_init()
923 debugfs_create_file("testmode", 0644, root, dwc, in dwc3_debugfs_init()
925 debugfs_create_file("link_state", 0644, root, dwc, in dwc3_debugfs_init()
930 void dwc3_debugfs_exit(struct dwc3 *dwc) in dwc3_debugfs_exit() argument
932 debugfs_remove(debugfs_lookup(dev_name(dwc->dev), usb_debug_root)); in dwc3_debugfs_exit()
933 kfree(dwc->regset); in dwc3_debugfs_exit()