debugfs.c (98817a84ff1c755c347ac633ff017a623a631fad) debugfs.c (10623b879da3932be313ba142d56b9f3d1216e96)
1// SPDX-License-Identifier: GPL-2.0
2/**
3 * debugfs.c - DesignWare USB3 DRD Controller DebugFS file
4 *
1// SPDX-License-Identifier: GPL-2.0
2/**
3 * debugfs.c - DesignWare USB3 DRD Controller DebugFS file
4 *
5 * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com
5 * Copyright (C) 2010-2011 Texas Instruments Incorporated - https://www.ti.com
6 *
7 * Authors: Felipe Balbi <balbi@ti.com>,
8 * Sebastian Andrzej Siewior <bigeasy@linutronix.de>
9 */
10
11#include <linux/kernel.h>
12#include <linux/slab.h>
13#include <linux/ptrace.h>

--- 447 unchanged lines hidden (view full) ---

461 reg &= DWC3_DCTL_TSTCTRL_MASK;
462 reg >>= 1;
463 spin_unlock_irqrestore(&dwc->lock, flags);
464
465 switch (reg) {
466 case 0:
467 seq_printf(s, "no test\n");
468 break;
6 *
7 * Authors: Felipe Balbi <balbi@ti.com>,
8 * Sebastian Andrzej Siewior <bigeasy@linutronix.de>
9 */
10
11#include <linux/kernel.h>
12#include <linux/slab.h>
13#include <linux/ptrace.h>

--- 447 unchanged lines hidden (view full) ---

461 reg &= DWC3_DCTL_TSTCTRL_MASK;
462 reg >>= 1;
463 spin_unlock_irqrestore(&dwc->lock, flags);
464
465 switch (reg) {
466 case 0:
467 seq_printf(s, "no test\n");
468 break;
469 case TEST_J:
469 case USB_TEST_J:
470 seq_printf(s, "test_j\n");
471 break;
470 seq_printf(s, "test_j\n");
471 break;
472 case TEST_K:
472 case USB_TEST_K:
473 seq_printf(s, "test_k\n");
474 break;
473 seq_printf(s, "test_k\n");
474 break;
475 case TEST_SE0_NAK:
475 case USB_TEST_SE0_NAK:
476 seq_printf(s, "test_se0_nak\n");
477 break;
476 seq_printf(s, "test_se0_nak\n");
477 break;
478 case TEST_PACKET:
478 case USB_TEST_PACKET:
479 seq_printf(s, "test_packet\n");
480 break;
479 seq_printf(s, "test_packet\n");
480 break;
481 case TEST_FORCE_EN:
481 case USB_TEST_FORCE_ENABLE:
482 seq_printf(s, "test_force_enable\n");
483 break;
484 default:
485 seq_printf(s, "UNKNOWN %d\n", reg);
486 }
487
488 return 0;
489}

--- 11 unchanged lines hidden (view full) ---

501 unsigned long flags;
502 u32 testmode = 0;
503 char buf[32];
504
505 if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
506 return -EFAULT;
507
508 if (!strncmp(buf, "test_j", 6))
482 seq_printf(s, "test_force_enable\n");
483 break;
484 default:
485 seq_printf(s, "UNKNOWN %d\n", reg);
486 }
487
488 return 0;
489}

--- 11 unchanged lines hidden (view full) ---

501 unsigned long flags;
502 u32 testmode = 0;
503 char buf[32];
504
505 if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
506 return -EFAULT;
507
508 if (!strncmp(buf, "test_j", 6))
509 testmode = TEST_J;
509 testmode = USB_TEST_J;
510 else if (!strncmp(buf, "test_k", 6))
510 else if (!strncmp(buf, "test_k", 6))
511 testmode = TEST_K;
511 testmode = USB_TEST_K;
512 else if (!strncmp(buf, "test_se0_nak", 12))
512 else if (!strncmp(buf, "test_se0_nak", 12))
513 testmode = TEST_SE0_NAK;
513 testmode = USB_TEST_SE0_NAK;
514 else if (!strncmp(buf, "test_packet", 11))
514 else if (!strncmp(buf, "test_packet", 11))
515 testmode = TEST_PACKET;
515 testmode = USB_TEST_PACKET;
516 else if (!strncmp(buf, "test_force_enable", 17))
516 else if (!strncmp(buf, "test_force_enable", 17))
517 testmode = TEST_FORCE_EN;
517 testmode = USB_TEST_FORCE_ENABLE;
518 else
519 testmode = 0;
520
521 spin_lock_irqsave(&dwc->lock, flags);
522 dwc3_gadget_set_test_mode(dwc, testmode);
523 spin_unlock_irqrestore(&dwc->lock, flags);
524
525 return count;

--- 431 unchanged lines hidden ---
518 else
519 testmode = 0;
520
521 spin_lock_irqsave(&dwc->lock, flags);
522 dwc3_gadget_set_test_mode(dwc, testmode);
523 spin_unlock_irqrestore(&dwc->lock, flags);
524
525 return count;

--- 431 unchanged lines hidden ---