gadget.c (98817a84ff1c755c347ac633ff017a623a631fad) | gadget.c (10623b879da3932be313ba142d56b9f3d1216e96) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * gadget.c - DesignWare USB3 DRD Controller Gadget Framework Link 4 * | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * gadget.c - DesignWare USB3 DRD Controller Gadget Framework Link 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/delay.h> 13#include <linux/slab.h> --- 27 unchanged lines hidden (view full) --- 41int dwc3_gadget_set_test_mode(struct dwc3 *dwc, int mode) 42{ 43 u32 reg; 44 45 reg = dwc3_readl(dwc->regs, DWC3_DCTL); 46 reg &= ~DWC3_DCTL_TSTCTRL_MASK; 47 48 switch (mode) { | 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/delay.h> 13#include <linux/slab.h> --- 27 unchanged lines hidden (view full) --- 41int dwc3_gadget_set_test_mode(struct dwc3 *dwc, int mode) 42{ 43 u32 reg; 44 45 reg = dwc3_readl(dwc->regs, DWC3_DCTL); 46 reg &= ~DWC3_DCTL_TSTCTRL_MASK; 47 48 switch (mode) { |
49 case TEST_J: 50 case TEST_K: 51 case TEST_SE0_NAK: 52 case TEST_PACKET: 53 case TEST_FORCE_EN: | 49 case USB_TEST_J: 50 case USB_TEST_K: 51 case USB_TEST_SE0_NAK: 52 case USB_TEST_PACKET: 53 case USB_TEST_FORCE_ENABLE: |
54 reg |= mode << 1; 55 break; 56 default: 57 return -EINVAL; 58 } 59 60 dwc3_gadget_dctl_write_safe(dwc, reg); 61 --- 3698 unchanged lines hidden --- | 54 reg |= mode << 1; 55 break; 56 default: 57 return -EINVAL; 58 } 59 60 dwc3_gadget_dctl_write_safe(dwc, reg); 61 --- 3698 unchanged lines hidden --- |