mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
USB/PHY patches for 4.15-rc1
Here is the big set of USB and PHY driver updates for 4.15-rc1. There is the usual amount of gadget and xhci driver updates, along with phy and chipidea enhancements. There's also a lot of SPDX tags and license boilerplate cleanups as well, which provide some churn in the diffstat. Other major thing is the typec code that moved out of staging and into the "real" part of the drivers/usb/ tree, which was nice to see happen. All of these have been in linux-next with no reported issues for a while. Signed-off-by: Greg Kroah-Hartman <[email protected]> -----BEGIN PGP SIGNATURE----- iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCWgm/Vw8cZ3JlZ0Brcm9h aC5jb20ACgkQMUfUDdst+yktXwCdGgpInfOEvOGFd83EPDL7a1ncyc4AoM5wI8yl 1CeLipqVIN3IsMMJptvb =zvDI -----END PGP SIGNATURE----- Merge tag 'usb-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB/PHY updates from Greg KH: "Here is the big set of USB and PHY driver updates for 4.15-rc1. There is the usual amount of gadget and xhci driver updates, along with phy and chipidea enhancements. There's also a lot of SPDX tags and license boilerplate cleanups as well, which provide some churn in the diffstat. Other major thing is the typec code that moved out of staging and into the "real" part of the drivers/usb/ tree, which was nice to see happen. All of these have been in linux-next with no reported issues for a while" * tag 'usb-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (263 commits) usb: gadget: f_fs: Fix use-after-free in ffs_free_inst USB: usbfs: compute urb->actual_length for isochronous usb: core: message: remember to reset 'ret' to 0 when necessary USB: typec: Remove remaining redundant license text USB: typec: add SPDX identifiers to some files USB: renesas_usbhs: rcar?.h: add SPDX tags USB: chipidea: ci_hdrc_tegra.c: add SPDX line USB: host: xhci-debugfs: add SPDX lines USB: add SPDX identifiers to all remaining Makefiles usb: host: isp1362-hcd: remove a couple of redundant assignments USB: adutux: remove redundant variable minor usb: core: add a new usb_get_ptm_status() helper usb: core: add a 'type' parameter to usb_get_status() usb: core: introduce a new usb_get_std_status() helper usb: core: rename usb_get_status() 'type' argument to 'recip' usb: core: add Status Type definitions USB: gadget: Remove redundant license text USB: gadget: function: Remove redundant license text USB: gadget: udc: Remove redundant license text USB: gadget: legacy: Remove redundant license text ...
This commit is contained in:
commit
894025f24b
764 changed files with 6609 additions and 9083 deletions
|
|
@ -77,11 +77,12 @@ config USB_PCI
|
|||
depends on PCI
|
||||
default y
|
||||
---help---
|
||||
A lot of embeded system SOC (e.g. freescale T2080) have both
|
||||
PCI and USB modules. But USB module is controlled by registers
|
||||
directly, it have no relationship with PCI module.
|
||||
Many embedded system SOCs (e.g. freescale T2080) have both
|
||||
PCI and USB modules with the USB module directly controlled by
|
||||
registers and having no relationship to the PCI module.
|
||||
|
||||
When say N here it will not build PCI related code in USB driver.
|
||||
If you have such a device you may say N here and PCI related code
|
||||
will not be built in the USB driver.
|
||||
|
||||
if USB
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/******************************************************************************
|
||||
* cxacru.c - driver for USB ADSL modems based on
|
||||
* Conexant AccessRunner chipset
|
||||
|
|
@ -6,21 +7,6 @@
|
|||
* Copyright (C) 2005 Duncan Sands, Roman Kagan (rkagan % mail ! ru)
|
||||
* Copyright (C) 2007 Simon Arlott
|
||||
* Copyright (C) 2009 Simon Arlott
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc., 59
|
||||
* Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
|
|
@ -424,6 +410,7 @@ static ssize_t cxacru_sysfs_store_adsl_state(struct device *dev,
|
|||
case CXPOLL_STOPPING:
|
||||
/* abort stop request */
|
||||
instance->poll_state = CXPOLL_POLLING;
|
||||
/* fall through */
|
||||
case CXPOLL_POLLING:
|
||||
case CXPOLL_SHUTDOWN:
|
||||
/* don't start polling */
|
||||
|
|
@ -570,10 +557,8 @@ static int cxacru_start_wait_urb(struct urb *urb, struct completion *done,
|
|||
{
|
||||
struct timer_list timer;
|
||||
|
||||
init_timer(&timer);
|
||||
setup_timer(&timer, cxacru_timeout_kill, (unsigned long)urb);
|
||||
timer.expires = jiffies + msecs_to_jiffies(CMD_TIMEOUT);
|
||||
timer.data = (unsigned long) urb;
|
||||
timer.function = cxacru_timeout_kill;
|
||||
add_timer(&timer);
|
||||
wait_for_completion(done);
|
||||
del_timer_sync(&timer);
|
||||
|
|
@ -797,6 +782,7 @@ static int cxacru_atm_start(struct usbatm_data *usbatm_instance,
|
|||
case CXPOLL_STOPPING:
|
||||
/* abort stop request */
|
||||
instance->poll_state = CXPOLL_POLLING;
|
||||
/* fall through */
|
||||
case CXPOLL_POLLING:
|
||||
case CXPOLL_SHUTDOWN:
|
||||
/* don't start polling */
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/******************************************************************************
|
||||
* speedtch.c - Alcatel SpeedTouch USB xDSL modem driver
|
||||
*
|
||||
|
|
@ -6,21 +7,6 @@
|
|||
* Copyright (C) 2004, David Woodhouse
|
||||
*
|
||||
* Based on "modem_run.c", copyright (C) 2001, Benoit Papillault
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc., 59
|
||||
* Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include <asm/page.h>
|
||||
|
|
@ -874,16 +860,13 @@ static int speedtch_bind(struct usbatm_data *usbatm,
|
|||
usbatm->flags |= (use_isoc ? UDSL_USE_ISOC : 0);
|
||||
|
||||
INIT_WORK(&instance->status_check_work, speedtch_check_status);
|
||||
init_timer(&instance->status_check_timer);
|
||||
|
||||
instance->status_check_timer.function = speedtch_status_poll;
|
||||
instance->status_check_timer.data = (unsigned long)instance;
|
||||
setup_timer(&instance->status_check_timer, speedtch_status_poll,
|
||||
(unsigned long)instance);
|
||||
instance->last_status = 0xff;
|
||||
instance->poll_delay = MIN_POLL_DELAY;
|
||||
|
||||
init_timer(&instance->resubmit_timer);
|
||||
instance->resubmit_timer.function = speedtch_resubmit_int;
|
||||
instance->resubmit_timer.data = (unsigned long)instance;
|
||||
setup_timer(&instance->resubmit_timer, speedtch_resubmit_int,
|
||||
(unsigned long)instance);
|
||||
|
||||
instance->int_urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*-
|
||||
* Copyright (c) 2003, 2004
|
||||
* Damien Bergamini <damien.bergamini@free.fr>. All rights reserved.
|
||||
|
|
|
|||
|
|
@ -1,24 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/******************************************************************************
|
||||
* usbatm.c - Generic USB xDSL driver core
|
||||
*
|
||||
* Copyright (C) 2001, Alcatel
|
||||
* Copyright (C) 2003, Duncan Sands, SolNegro, Josep Comas
|
||||
* Copyright (C) 2004, David Woodhouse, Roman Kagan
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc., 59
|
||||
* Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,24 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/******************************************************************************
|
||||
* usbatm.h - Generic USB xDSL driver core
|
||||
*
|
||||
* Copyright (C) 2001, Alcatel
|
||||
* Copyright (C) 2003, Duncan Sands, SolNegro, Josep Comas
|
||||
* Copyright (C) 2004, David Woodhouse
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc., 59
|
||||
* Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef _USBATM_H_
|
||||
|
|
|
|||
|
|
@ -1,22 +1,8 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/******************************************************************************
|
||||
* xusbatm.c - dumb usbatm-based driver for modems initialized in userspace
|
||||
*
|
||||
* Copyright (C) 2005 Duncan Sands, Roman Kagan (rkagan % mail ! ru)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc., 59
|
||||
* Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
#
|
||||
# Makefile for Cypress C67X00 USB Controller
|
||||
#
|
||||
|
|
|
|||
|
|
@ -1,24 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* c67x00-drv.c: Cypress C67X00 USB Common infrastructure
|
||||
*
|
||||
* Copyright (C) 2006-2008 Barco N.V.
|
||||
* Derived from the Cypress cy7c67200/300 ezusb linux driver and
|
||||
* based on multiple host controller drivers inside the linux kernel.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,24 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* c67x00-hcd.c: Cypress C67X00 USB Host Controller Driver
|
||||
*
|
||||
* Copyright (C) 2006-2008 Barco N.V.
|
||||
* Derived from the Cypress cy7c67200/300 ezusb linux driver and
|
||||
* based on multiple host controller drivers inside the linux kernel.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
|
|
|
|||
|
|
@ -1,24 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* c67x00-hcd.h: Cypress C67X00 USB HCD
|
||||
*
|
||||
* Copyright (C) 2006-2008 Barco N.V.
|
||||
* Derived from the Cypress cy7c67200/300 ezusb linux driver and
|
||||
* based on multiple host controller drivers inside the linux kernel.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef _USB_C67X00_HCD_H
|
||||
|
|
|
|||
|
|
@ -1,24 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* c67x00-ll-hpi.c: Cypress C67X00 USB Low level interface using HPI
|
||||
*
|
||||
* Copyright (C) 2006-2008 Barco N.V.
|
||||
* Derived from the Cypress cy7c67200/300 ezusb linux driver and
|
||||
* based on multiple host controller drivers inside the linux kernel.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
|
|
|
|||
|
|
@ -1,24 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* c67x00-sched.c: Cypress C67X00 USB Host Controller Driver - TD scheduling
|
||||
*
|
||||
* Copyright (C) 2006-2008 Barco N.V.
|
||||
* Derived from the Cypress cy7c67200/300 ezusb linux driver and
|
||||
* based on multiple host controller drivers inside the linux kernel.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <linux/kthread.h>
|
||||
|
|
@ -966,13 +952,11 @@ static void c67x00_handle_successful_td(struct c67x00_hcd *c67x00,
|
|||
static void c67x00_handle_isoc(struct c67x00_hcd *c67x00, struct c67x00_td *td)
|
||||
{
|
||||
struct urb *urb = td->urb;
|
||||
struct c67x00_urb_priv *urbp;
|
||||
int cnt;
|
||||
|
||||
if (!urb)
|
||||
return;
|
||||
|
||||
urbp = urb->hcpriv;
|
||||
cnt = td->privdata;
|
||||
|
||||
if (td->status & TD_ERROR_MASK)
|
||||
|
|
|
|||
|
|
@ -1,24 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* c67x00.h: Cypress C67X00 USB register and field definitions
|
||||
*
|
||||
* Copyright (C) 2006-2008 Barco N.V.
|
||||
* Derived from the Cypress cy7c67200/300 ezusb linux driver and
|
||||
* based on multiple host controller drivers inside the linux kernel.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef _USB_C67X00_H
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ config USB_CHIPIDEA
|
|||
Dual-role switch (ID, OTG FSM, sysfs), Host-only, and
|
||||
Peripheral-only.
|
||||
|
||||
When compiled dynamically, the module will be called ci-hdrc.ko.
|
||||
When compiled dynamically, the module will be called ci_hdrc.ko.
|
||||
|
||||
if USB_CHIPIDEA
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* bits.h - register bits of the ChipIdea USB IP core
|
||||
*
|
||||
* Copyright (C) 2008 Chipidea - MIPS Technologies, Inc. All rights reserved.
|
||||
*
|
||||
* Author: David Lopo
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __DRIVERS_USB_CHIPIDEA_BITS_H
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* ci.h - common structures, functions, and macros of the ChipIdea driver
|
||||
*
|
||||
* Copyright (C) 2008 Chipidea - MIPS Technologies, Inc. All rights reserved.
|
||||
*
|
||||
* Author: David Lopo
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __DRIVERS_USB_CHIPIDEA_CI_H
|
||||
|
|
|
|||
|
|
@ -1,14 +1,8 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright 2012 Freescale Semiconductor, Inc.
|
||||
* Copyright (C) 2012 Marek Vasut <marex@denx.de>
|
||||
* on behalf of DENX Software Engineering GmbH
|
||||
*
|
||||
* The code contained herein is licensed under the GNU General Public
|
||||
* License. You may obtain a copy of the GNU General Public License
|
||||
* Version 2 or later at the following locations:
|
||||
*
|
||||
* http://www.opensource.org/licenses/gpl-license.html
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright 2012 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* The code contained herein is licensed under the GNU General Public
|
||||
* License. You may obtain a copy of the GNU General Public License
|
||||
* Version 2 or later at the following locations:
|
||||
*
|
||||
* http://www.opensource.org/licenses/gpl-license.html
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
#ifndef __DRIVER_USB_CHIPIDEA_CI_HDRC_IMX_H
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
* only version 2 as published by the Free Software Foundation.
|
||||
*/
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright (c) 2010, Code Aurora Forum. All rights reserved. */
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* ci_hdrc_pci.c - MIPS USB IP core family device controller
|
||||
*
|
||||
* Copyright (C) 2008 Chipidea - MIPS Technologies, Inc. All rights reserved.
|
||||
*
|
||||
* Author: David Lopo
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright (c) 2016, NVIDIA Corporation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/clk.h>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright (C) 2014 Marvell Technology Group Ltd.
|
||||
*
|
||||
* Antoine Tenart <antoine.tenart@free-electrons.com>
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#include <linux/clk.h>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,8 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright (C) 2013 Daniel Tang <tangrs@tangrs.id.au>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Based off drivers/usb/chipidea/ci_hdrc_msm.c
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* core.c - ChipIdea USB IP core family device controller
|
||||
*
|
||||
* Copyright (C) 2008 Chipidea - MIPS Technologies, Inc. All rights reserved.
|
||||
*
|
||||
* Author: David Lopo
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,22 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* host.c - ChipIdea USB host controller driver
|
||||
*
|
||||
* Copyright (c) 2012 Intel Corporation
|
||||
*
|
||||
* Author: Alexander Shishkin
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* otg.c - ChipIdea USB IP core OTG driver
|
||||
*
|
||||
* Copyright (C) 2013 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* Author: Peter Chen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* Author: Peter Chen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __DRIVERS_USB_CHIPIDEA_OTG_H
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* otg_fsm.c - ChipIdea USB IP core OTG FSM driver
|
||||
*
|
||||
* Copyright (C) 2014 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* Author: Jun Li
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright (C) 2014 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* Author: Jun Li
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __DRIVERS_USB_CHIPIDEA_OTG_FSM_H
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* udc.c - ChipIdea UDC driver
|
||||
*
|
||||
* Copyright (C) 2008 Chipidea - MIPS Technologies, Inc. All rights reserved.
|
||||
*
|
||||
* Author: David Lopo
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/delay.h>
|
||||
|
|
@ -1526,6 +1523,10 @@ static int ci_udc_vbus_session(struct usb_gadget *_gadget, int is_active)
|
|||
gadget_ready = 1;
|
||||
spin_unlock_irqrestore(&ci->lock, flags);
|
||||
|
||||
if (ci->usb_phy)
|
||||
usb_phy_set_charger_state(ci->usb_phy, is_active ?
|
||||
USB_CHARGER_PRESENT : USB_CHARGER_ABSENT);
|
||||
|
||||
if (gadget_ready) {
|
||||
if (is_active) {
|
||||
pm_runtime_get_sync(&_gadget->dev);
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* udc.h - ChipIdea UDC structures
|
||||
*
|
||||
* Copyright (C) 2008 Chipidea - MIPS Technologies, Inc. All rights reserved.
|
||||
*
|
||||
* Author: David Lopo
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __DRIVERS_USB_CHIPIDEA_UDC_H
|
||||
|
|
|
|||
|
|
@ -1,14 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright (c) 2016 Linaro Ltd.
|
||||
*
|
||||
* This software is licensed under the terms of the GNU General Public
|
||||
* License version 2, as published by the Free Software Foundation, and
|
||||
* may be copied, distributed, and modified under those terms.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright 2012 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* The code contained herein is licensed under the GNU General Public
|
||||
* License. You may obtain a copy of the GNU General Public License
|
||||
* Version 2 or later at the following locations:
|
||||
*
|
||||
* http://www.opensource.org/licenses/gpl-license.html
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
#
|
||||
# Makefile for USB Class drivers
|
||||
# (one step up from the misc category)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* cdc-acm.c
|
||||
*
|
||||
|
|
@ -12,20 +13,6 @@
|
|||
* USB Abstract Control Model driver for USB modems and ISDN adapters
|
||||
*
|
||||
* Sponsored by SuSE
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#undef DEBUG
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* cdc-wdm.c
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* usblp.c
|
||||
*
|
||||
|
|
@ -31,22 +32,6 @@
|
|||
* none - Maintained in Linux kernel after v0.13
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/sched/signal.h>
|
||||
|
|
|
|||
|
|
@ -1,22 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/**
|
||||
* drivers/usb/class/usbtmc.c - USB Test & Measurement class driver
|
||||
*
|
||||
* Copyright (C) 2007 Stefan Kopp, Gechingen, Germany
|
||||
* Copyright (C) 2008 Novell, Inc.
|
||||
* Copyright (C) 2008 Greg Kroah-Hartman <gregkh@suse.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* The GNU General Public License is available at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
|
@ -1343,6 +1331,7 @@ static void usbtmc_interrupt(struct urb *urb)
|
|||
case -EOVERFLOW:
|
||||
dev_err(dev, "overflow with length %d, actual length is %d\n",
|
||||
data->iin_wMaxPacketSize, urb->actual_length);
|
||||
/* fall through */
|
||||
case -ECONNRESET:
|
||||
case -ENOENT:
|
||||
case -ESHUTDOWN:
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Provides code common for host and device side USB.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation, version 2.
|
||||
*
|
||||
* If either host side (ie. CONFIG_USB=y) or device side USB stack
|
||||
* (ie. CONFIG_USB_GADGET=y) is compiled in the kernel, this module is
|
||||
* compiled-in as well. Otherwise, if either of the two stacks is
|
||||
|
|
|
|||
|
|
@ -1,12 +1,8 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* LED Triggers for USB Activity
|
||||
*
|
||||
* Copyright 2014 Michal Sojka <sojka@merica.cz>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* ulpi.c - USB ULPI PHY bus
|
||||
*
|
||||
* Copyright (C) 2015 Intel Corporation
|
||||
*
|
||||
* Author: Heikki Krogerus <heikki.krogerus@linux.intel.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/ulpi/interface.h>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* OTG Finite State Machine from OTG spec
|
||||
*
|
||||
|
|
@ -5,20 +6,6 @@
|
|||
*
|
||||
* Author: Li Yang <LeoLi@freescale.com>
|
||||
* Jerry Huang <Chang-Ming.Huang@freescale.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* DMA memory management for framework level HCD code (hc_driver)
|
||||
*
|
||||
|
|
@ -5,7 +6,6 @@
|
|||
* and should work with all USB controllers, regardless of bus type.
|
||||
*
|
||||
* Released under the GPLv2 only.
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Released under the GPLv2 only.
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
|
||||
#include <linux/usb.h>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* devices.c
|
||||
* (C) Copyright 1999 Randy Dunlap.
|
||||
|
|
@ -5,20 +6,6 @@
|
|||
* (proc file per device)
|
||||
* (C) Copyright 1999 Deti Fliegl (new USB architecture)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*************************************************************
|
||||
*
|
||||
* <mountpoint>/devices contains USB topology, device, config, class,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
|
|
@ -5,20 +6,6 @@
|
|||
*
|
||||
* Copyright (C) 1999-2000 Thomas Sailer (sailer@ife.ee.ethz.ch)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* This file implements the usbfs/x/y files, where
|
||||
* x is the bus number and y the device number.
|
||||
*
|
||||
|
|
@ -1833,6 +1820,18 @@ static int proc_unlinkurb(struct usb_dev_state *ps, void __user *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void compute_isochronous_actual_length(struct urb *urb)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if (urb->number_of_packets > 0) {
|
||||
urb->actual_length = 0;
|
||||
for (i = 0; i < urb->number_of_packets; i++)
|
||||
urb->actual_length +=
|
||||
urb->iso_frame_desc[i].actual_length;
|
||||
}
|
||||
}
|
||||
|
||||
static int processcompl(struct async *as, void __user * __user *arg)
|
||||
{
|
||||
struct urb *urb = as->urb;
|
||||
|
|
@ -1840,6 +1839,7 @@ static int processcompl(struct async *as, void __user * __user *arg)
|
|||
void __user *addr = as->userurb;
|
||||
unsigned int i;
|
||||
|
||||
compute_isochronous_actual_length(urb);
|
||||
if (as->userbuffer && urb->actual_length) {
|
||||
if (copy_urb_data_to_user(as->userbuffer, urb))
|
||||
goto err_out;
|
||||
|
|
@ -2008,6 +2008,7 @@ static int processcompl_compat(struct async *as, void __user * __user *arg)
|
|||
void __user *addr = as->userurb;
|
||||
unsigned int i;
|
||||
|
||||
compute_isochronous_actual_length(urb);
|
||||
if (as->userbuffer && urb->actual_length) {
|
||||
if (copy_urb_data_to_user(as->userbuffer, urb))
|
||||
return -EFAULT;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* drivers/usb/driver.c - most of the driver model stuff for usb
|
||||
*
|
||||
|
|
@ -16,7 +17,6 @@
|
|||
* (C) Copyright Greg Kroah-Hartman 2002-2003
|
||||
*
|
||||
* Released under the GPLv2 only.
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*
|
||||
* NOTE! This is not actually a driver at all, rather this is
|
||||
* just a collection of helper routines that implement the
|
||||
|
|
@ -1340,8 +1340,8 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
|
|||
int err;
|
||||
u16 devstat;
|
||||
|
||||
err = usb_get_status(udev, USB_RECIP_DEVICE, 0,
|
||||
&devstat);
|
||||
err = usb_get_std_status(udev, USB_RECIP_DEVICE, 0,
|
||||
&devstat);
|
||||
if (err) {
|
||||
dev_err(&udev->dev,
|
||||
"Failed to suspend device, error %d\n",
|
||||
|
|
@ -1461,6 +1461,7 @@ static void choose_wakeup(struct usb_device *udev, pm_message_t msg)
|
|||
int usb_suspend(struct device *dev, pm_message_t msg)
|
||||
{
|
||||
struct usb_device *udev = to_usb_device(dev);
|
||||
int r;
|
||||
|
||||
unbind_no_pm_drivers_interfaces(udev);
|
||||
|
||||
|
|
@ -1469,7 +1470,14 @@ int usb_suspend(struct device *dev, pm_message_t msg)
|
|||
* so we may still need to unbind and rebind upon resume
|
||||
*/
|
||||
choose_wakeup(udev, msg);
|
||||
return usb_suspend_both(udev, msg);
|
||||
r = usb_suspend_both(udev, msg);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
if (udev->quirks & USB_QUIRK_DISCONNECT_SUSPEND)
|
||||
usb_port_disable(udev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* The device lock is held by the PM core */
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* drivers/usb/core/endpoint.c
|
||||
*
|
||||
|
|
@ -6,7 +7,6 @@
|
|||
* (C) Copyright 2006 Novell Inc.
|
||||
*
|
||||
* Released under the GPLv2 only.
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*
|
||||
* Endpoint sysfs stuff
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* drivers/usb/core/file.c
|
||||
*
|
||||
|
|
@ -14,7 +15,6 @@
|
|||
* (C) Copyright Greg Kroah-Hartman 2002-2003
|
||||
*
|
||||
* Released under the GPLv2 only.
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* drivers/usb/generic.c - generic driver for USB devices (not interfaces)
|
||||
*
|
||||
|
|
@ -16,7 +17,6 @@
|
|||
* (C) Copyright Greg Kroah-Hartman 2002-2003
|
||||
*
|
||||
* Released under the GPLv2 only.
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
|
||||
#include <linux/usb.h>
|
||||
|
|
|
|||
|
|
@ -1,19 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright David Brownell 2000-2002
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright Linus Torvalds 1999
|
||||
* (C) Copyright Johannes Erdfelt 1999-2001
|
||||
|
|
@ -6,20 +7,6 @@
|
|||
* (C) Copyright Deti Fliegl 1999
|
||||
* (C) Copyright Randy Dunlap 2000
|
||||
* (C) Copyright David Brownell 2000-2002
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <linux/bcd.h>
|
||||
|
|
@ -2558,9 +2545,7 @@ struct usb_hcd *__usb_create_hcd(const struct hc_driver *driver,
|
|||
hcd->self.bus_name = bus_name;
|
||||
hcd->self.uses_dma = (sysdev->dma_mask != NULL);
|
||||
|
||||
init_timer(&hcd->rh_timer);
|
||||
hcd->rh_timer.function = rh_timer_func;
|
||||
hcd->rh_timer.data = (unsigned long) hcd;
|
||||
setup_timer(&hcd->rh_timer, rh_timer_func, (unsigned long)hcd);
|
||||
#ifdef CONFIG_PM
|
||||
INIT_WORK(&hcd->wakeup_work, hcd_resume_work);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* USB hub driver.
|
||||
*
|
||||
|
|
@ -7,7 +8,6 @@
|
|||
* (C) Copyright 2001 Brad Hards (bhards@bigpond.net.au)
|
||||
*
|
||||
* Released under the GPLv2 only.
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
|
|
@ -1482,7 +1482,7 @@ static int hub_configure(struct usb_hub *hub,
|
|||
/* power budgeting mostly matters with bus-powered hubs,
|
||||
* and battery-powered root hubs (may provide just 8 mA).
|
||||
*/
|
||||
ret = usb_get_status(hdev, USB_RECIP_DEVICE, 0, &hubstatus);
|
||||
ret = usb_get_std_status(hdev, USB_RECIP_DEVICE, 0, &hubstatus);
|
||||
if (ret) {
|
||||
message = "can't get hub status";
|
||||
goto fail;
|
||||
|
|
@ -3279,7 +3279,7 @@ static int finish_port_resume(struct usb_device *udev)
|
|||
*/
|
||||
if (status == 0) {
|
||||
devstatus = 0;
|
||||
status = usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus);
|
||||
status = usb_get_std_status(udev, USB_RECIP_DEVICE, 0, &devstatus);
|
||||
|
||||
/* If a normal resume failed, try doing a reset-resume */
|
||||
if (status && !udev->reset_resume && udev->persist_enabled) {
|
||||
|
|
@ -3303,7 +3303,7 @@ static int finish_port_resume(struct usb_device *udev)
|
|||
if (devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP))
|
||||
status = usb_disable_remote_wakeup(udev);
|
||||
} else {
|
||||
status = usb_get_status(udev, USB_RECIP_INTERFACE, 0,
|
||||
status = usb_get_std_status(udev, USB_RECIP_INTERFACE, 0,
|
||||
&devstatus);
|
||||
if (!status && devstatus & (USB_INTRF_STAT_FUNC_RW_CAP
|
||||
| USB_INTRF_STAT_FUNC_RW))
|
||||
|
|
@ -4183,6 +4183,19 @@ static int hub_port_disable(struct usb_hub *hub, int port1, int set_state)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* usb_port_disable - disable a usb device's upstream port
|
||||
* @udev: device to disable
|
||||
* Context: @udev locked, must be able to sleep.
|
||||
*
|
||||
* Disables a USB device that isn't in active use.
|
||||
*/
|
||||
int usb_port_disable(struct usb_device *udev)
|
||||
{
|
||||
struct usb_hub *hub = usb_hub_to_struct_hub(udev->parent);
|
||||
|
||||
return hub_port_disable(hub, udev->portnum, 0);
|
||||
}
|
||||
|
||||
/* USB 2.0 spec, 7.1.7.3 / fig 7-29:
|
||||
*
|
||||
|
|
@ -4853,7 +4866,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
|
|||
&& udev->bus_mA <= unit_load) {
|
||||
u16 devstat;
|
||||
|
||||
status = usb_get_status(udev, USB_RECIP_DEVICE, 0,
|
||||
status = usb_get_std_status(udev, USB_RECIP_DEVICE, 0,
|
||||
&devstat);
|
||||
if (status) {
|
||||
dev_dbg(&udev->dev, "get status %d ?\n", status);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* usb hub driver head file
|
||||
*
|
||||
|
|
@ -8,15 +9,6 @@
|
|||
* Copyright (C) 2012 Intel Corp (tianyu.lan@intel.com)
|
||||
*
|
||||
* move struct usb_hub to this file.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*/
|
||||
|
||||
#include <linux/usb.h>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* USB port LED trigger
|
||||
*
|
||||
* Copyright (C) 2016 Rafał Miłecki <rafal@milecki.pl>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* message.c - synchronous message handling
|
||||
*
|
||||
* Released under the GPLv2 only.
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
|
||||
#include <linux/pci.h> /* for scatterlist macros */
|
||||
|
|
@ -918,7 +918,8 @@ int usb_get_device_descriptor(struct usb_device *dev, unsigned int size)
|
|||
/**
|
||||
* usb_get_status - issues a GET_STATUS call
|
||||
* @dev: the device whose status is being checked
|
||||
* @type: USB_RECIP_*; for device, interface, or endpoint
|
||||
* @recip: USB_RECIP_*; for device, interface, or endpoint
|
||||
* @type: USB_STATUS_TYPE_*; for standard or PTM status types
|
||||
* @target: zero (for device), else interface or endpoint number
|
||||
* @data: pointer to two bytes of bitmap data
|
||||
* Context: !in_interrupt ()
|
||||
|
|
@ -937,24 +938,58 @@ int usb_get_device_descriptor(struct usb_device *dev, unsigned int size)
|
|||
* Returns 0 and the status value in *@data (in host byte order) on success,
|
||||
* or else the status code from the underlying usb_control_msg() call.
|
||||
*/
|
||||
int usb_get_status(struct usb_device *dev, int type, int target, void *data)
|
||||
int usb_get_status(struct usb_device *dev, int recip, int type, int target,
|
||||
void *data)
|
||||
{
|
||||
int ret;
|
||||
__le16 *status = kmalloc(sizeof(*status), GFP_KERNEL);
|
||||
void *status;
|
||||
int length;
|
||||
|
||||
switch (type) {
|
||||
case USB_STATUS_TYPE_STANDARD:
|
||||
length = 2;
|
||||
break;
|
||||
case USB_STATUS_TYPE_PTM:
|
||||
if (recip != USB_RECIP_DEVICE)
|
||||
return -EINVAL;
|
||||
|
||||
length = 4;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
status = kmalloc(length, GFP_KERNEL);
|
||||
if (!status)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
|
||||
USB_REQ_GET_STATUS, USB_DIR_IN | type, 0, target, status,
|
||||
sizeof(*status), USB_CTRL_GET_TIMEOUT);
|
||||
USB_REQ_GET_STATUS, USB_DIR_IN | recip, USB_STATUS_TYPE_STANDARD,
|
||||
target, status, length, USB_CTRL_GET_TIMEOUT);
|
||||
|
||||
if (ret == 2) {
|
||||
*(u16 *) data = le16_to_cpu(*status);
|
||||
switch (ret) {
|
||||
case 4:
|
||||
if (type != USB_STATUS_TYPE_PTM) {
|
||||
ret = -EIO;
|
||||
break;
|
||||
}
|
||||
|
||||
*(u32 *) data = le32_to_cpu(*(__le32 *) status);
|
||||
ret = 0;
|
||||
} else if (ret >= 0) {
|
||||
break;
|
||||
case 2:
|
||||
if (type != USB_STATUS_TYPE_STANDARD) {
|
||||
ret = -EIO;
|
||||
break;
|
||||
}
|
||||
|
||||
*(u16 *) data = le16_to_cpu(*(__le16 *) status);
|
||||
ret = 0;
|
||||
break;
|
||||
default:
|
||||
ret = -EIO;
|
||||
}
|
||||
|
||||
kfree(status);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* All the USB notify logic
|
||||
*
|
||||
|
|
@ -7,7 +8,6 @@
|
|||
* but fixed up to not be so broken.
|
||||
*
|
||||
* Released under the GPLv2 only.
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +1,9 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* of.c The helpers for hcd device tree support
|
||||
*
|
||||
* Copyright (C) 2016 Freescale Semiconductor, Inc.
|
||||
* Author: Peter Chen <peter.chen@freescale.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <linux/of.h>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,8 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* drivers/usb/core/otg_whitelist.h
|
||||
*
|
||||
* Copyright (C) 2004 Texas Instruments
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,19 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* usb port device code
|
||||
*
|
||||
* Copyright (C) 2012 Intel Corp
|
||||
*
|
||||
* Author: Lan Tianyu <tianyu.lan@intel.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/slab.h>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,9 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* USB device quirk handling logic and table
|
||||
*
|
||||
* Copyright (c) 2007 Oliver Neukum
|
||||
* Copyright (c) 2007 Greg Kroah-Hartman <gregkh@suse.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 2.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/usb.h>
|
||||
|
|
@ -203,6 +198,12 @@ static const struct usb_device_id usb_quirk_list[] = {
|
|||
{ USB_DEVICE(0x10d6, 0x2200), .driver_info =
|
||||
USB_QUIRK_STRING_FETCH_255 },
|
||||
|
||||
/* Huawei 4G LTE module */
|
||||
{ USB_DEVICE(0x12d1, 0x15bb), .driver_info =
|
||||
USB_QUIRK_DISCONNECT_SUSPEND },
|
||||
{ USB_DEVICE(0x12d1, 0x15c3), .driver_info =
|
||||
USB_QUIRK_DISCONNECT_SUSPEND },
|
||||
|
||||
/* SKYMEDI USB_DRIVE */
|
||||
{ USB_DEVICE(0x1516, 0x8628), .driver_info = USB_QUIRK_RESET_RESUME },
|
||||
|
||||
|
|
@ -221,6 +222,9 @@ static const struct usb_device_id usb_quirk_list[] = {
|
|||
/* Corsair Strafe RGB */
|
||||
{ USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT },
|
||||
|
||||
/* Corsair K70 LUX */
|
||||
{ USB_DEVICE(0x1b1c, 0x1b36), .driver_info = USB_QUIRK_DELAY_INIT },
|
||||
|
||||
/* MIDI keyboard WORLDE MINI */
|
||||
{ USB_DEVICE(0x1c75, 0x0204), .driver_info =
|
||||
USB_QUIRK_CONFIG_INTF_STRINGS },
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* drivers/usb/core/sysfs.c
|
||||
*
|
||||
|
|
@ -8,7 +9,6 @@
|
|||
* All of the sysfs file attributes for usb devices and interfaces.
|
||||
*
|
||||
* Released under the GPLv2 only.
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -654,7 +654,8 @@ static int add_power_attributes(struct device *dev)
|
|||
if (udev->usb2_hw_lpm_capable == 1)
|
||||
rc = sysfs_merge_group(&dev->kobj,
|
||||
&usb2_hardware_lpm_attr_group);
|
||||
if (udev->speed == USB_SPEED_SUPER &&
|
||||
if ((udev->speed == USB_SPEED_SUPER ||
|
||||
udev->speed == USB_SPEED_SUPER_PLUS) &&
|
||||
udev->lpm_capable == 1)
|
||||
rc = sysfs_merge_group(&dev->kobj,
|
||||
&usb3_hardware_lpm_attr_group);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Released under the GPLv2 only.
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
@ -492,6 +492,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
|
|||
if ((urb->interval < 6)
|
||||
&& (xfertype == USB_ENDPOINT_XFER_INT))
|
||||
return -EINVAL;
|
||||
/* fall through */
|
||||
default:
|
||||
if (urb->interval <= 0)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,8 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* USB-ACPI glue code
|
||||
*
|
||||
* Copyright 2012 Red Hat <mjg@redhat.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 2.
|
||||
*
|
||||
*/
|
||||
#include <linux/module.h>
|
||||
#include <linux/usb.h>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* drivers/usb/core/usb.c
|
||||
*
|
||||
|
|
@ -13,7 +14,6 @@
|
|||
* (C) Copyright Greg Kroah-Hartman 2002-2003
|
||||
*
|
||||
* Released under the GPLv2 only.
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*
|
||||
* NOTE! This is not actually a driver at all, rather this is
|
||||
* just a collection of helper routines that implement the
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Released under the GPLv2 only.
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
|
||||
#include <linux/pm.h>
|
||||
|
|
@ -73,6 +73,7 @@ extern void usb_hub_cleanup(void);
|
|||
extern int usb_major_init(void);
|
||||
extern void usb_major_cleanup(void);
|
||||
extern int usb_device_supports_lpm(struct usb_device *udev);
|
||||
extern int usb_port_disable(struct usb_device *udev);
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* core.c - DesignWare HS OTG Controller common routines
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* core.h - DesignWare HS OTG Controller common declarations
|
||||
*
|
||||
|
|
@ -395,6 +396,9 @@ enum dwc2_ep0_state {
|
|||
* (default when phy_type is UTMI+ or ULPI)
|
||||
* 1 - 6 MHz
|
||||
* (default when phy_type is Full Speed)
|
||||
* @oc_disable: Flag to disable overcurrent condition.
|
||||
* 0 - Allow overcurrent condition to get detected
|
||||
* 1 - Disable overcurrent condtion to get detected
|
||||
* @ts_dline: Enable Term Select Dline pulsing
|
||||
* 0 - No (default)
|
||||
* 1 - Yes
|
||||
|
|
@ -492,6 +496,7 @@ struct dwc2_core_params {
|
|||
bool dma_desc_fs_enable;
|
||||
bool host_support_fs_ls_low_power;
|
||||
bool host_ls_low_power_phy_clk;
|
||||
bool oc_disable;
|
||||
|
||||
u8 host_channels;
|
||||
u16 host_rx_fifo_size;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* core_intr.c - DesignWare HS OTG Controller common interrupt handling
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,17 +1,9 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* debug.h - Designware USB2 DRD controller debug header
|
||||
*
|
||||
* Copyright (C) 2015 Intel Corporation
|
||||
* Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "core.h"
|
||||
|
|
|
|||
|
|
@ -1,17 +1,9 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* debugfs.c - Designware USB2 DRD controller debugfs
|
||||
*
|
||||
* Copyright (C) 2015 Intel Corporation
|
||||
* Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/spinlock.h>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* Copyright (c) 2011 Samsung Electronics Co., Ltd.
|
||||
* http://www.samsung.com
|
||||
|
|
@ -8,10 +9,6 @@
|
|||
* http://armlinux.simtec.co.uk/
|
||||
*
|
||||
* S3C USB2.0 High-speed / OtG driver
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
|
|
@ -3202,6 +3199,8 @@ void dwc2_hsotg_disconnect(struct dwc2_hsotg *hsotg)
|
|||
|
||||
call_gadget(hsotg, disconnect);
|
||||
hsotg->lx_state = DWC2_L3;
|
||||
|
||||
usb_gadget_set_state(&hsotg->gadget, USB_STATE_NOTATTACHED);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -4004,6 +4003,11 @@ static int dwc2_hsotg_ep_disable(struct usb_ep *ep)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (hsotg->op_state != OTG_STATE_B_PERIPHERAL) {
|
||||
dev_err(hsotg->dev, "%s: called in host mode?\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
epctrl_reg = dir_in ? DIEPCTL(index) : DOEPCTL(index);
|
||||
|
||||
spin_lock_irqsave(&hsotg->lock, flags);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* hcd.c - DesignWare HS OTG Controller host-mode routines
|
||||
*
|
||||
|
|
@ -213,6 +214,11 @@ static int dwc2_hs_phy_init(struct dwc2_hsotg *hsotg, bool select_phy)
|
|||
usbcfg &= ~(GUSBCFG_PHYIF16 | GUSBCFG_DDRSEL);
|
||||
if (hsotg->params.phy_ulpi_ddr)
|
||||
usbcfg |= GUSBCFG_DDRSEL;
|
||||
|
||||
/* Set external VBUS indicator as needed. */
|
||||
if (hsotg->params.oc_disable)
|
||||
usbcfg |= (GUSBCFG_ULPI_INT_VBUS_IND |
|
||||
GUSBCFG_INDICATORPASSTHROUGH);
|
||||
break;
|
||||
case DWC2_PHY_TYPE_PARAM_UTMI:
|
||||
/* UTMI+ interface */
|
||||
|
|
@ -3277,7 +3283,6 @@ static void dwc2_conn_id_status_change(struct work_struct *work)
|
|||
dwc2_core_init(hsotg, false);
|
||||
dwc2_enable_global_interrupts(hsotg);
|
||||
spin_lock_irqsave(&hsotg->lock, flags);
|
||||
dwc2_hsotg_disconnect(hsotg);
|
||||
dwc2_hsotg_core_init_disconnected(hsotg, false);
|
||||
spin_unlock_irqrestore(&hsotg->lock, flags);
|
||||
dwc2_hsotg_core_connect(hsotg);
|
||||
|
|
@ -3296,8 +3301,12 @@ host:
|
|||
if (count > 250)
|
||||
dev_err(hsotg->dev,
|
||||
"Connection id status change timed out\n");
|
||||
hsotg->op_state = OTG_STATE_A_HOST;
|
||||
|
||||
spin_lock_irqsave(&hsotg->lock, flags);
|
||||
dwc2_hsotg_disconnect(hsotg);
|
||||
spin_unlock_irqrestore(&hsotg->lock, flags);
|
||||
|
||||
hsotg->op_state = OTG_STATE_A_HOST;
|
||||
/* Initialize the Core for Host mode */
|
||||
dwc2_core_init(hsotg, false);
|
||||
dwc2_enable_global_interrupts(hsotg);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* hcd.h - DesignWare HS OTG Controller host-mode declarations
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* hcd_ddma.c - DesignWare HS OTG Controller descriptor DMA routines
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* hcd_intr.c - DesignWare HS OTG Controller host-mode interrupt handling
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* hcd_queue.c - DesignWare HS OTG Controller host queuing routines
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* hw.h - DesignWare HS OTG Controller hardware definitions
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) 2004-2016 Synopsys, Inc.
|
||||
*
|
||||
|
|
@ -136,6 +137,15 @@ static void dwc2_set_stm32f4x9_fsotg_params(struct dwc2_hsotg *hsotg)
|
|||
p->activate_stm_fs_transceiver = true;
|
||||
}
|
||||
|
||||
static void dwc2_set_stm32f7xx_hsotg_params(struct dwc2_hsotg *hsotg)
|
||||
{
|
||||
struct dwc2_core_params *p = &hsotg->params;
|
||||
|
||||
p->host_rx_fifo_size = 622;
|
||||
p->host_nperio_tx_fifo_size = 128;
|
||||
p->host_perio_tx_fifo_size = 256;
|
||||
}
|
||||
|
||||
const struct of_device_id dwc2_of_match_table[] = {
|
||||
{ .compatible = "brcm,bcm2835-usb", .data = dwc2_set_bcm_params },
|
||||
{ .compatible = "hisilicon,hi6220-usb", .data = dwc2_set_his_params },
|
||||
|
|
@ -154,6 +164,8 @@ const struct of_device_id dwc2_of_match_table[] = {
|
|||
{ .compatible = "st,stm32f4x9-fsotg",
|
||||
.data = dwc2_set_stm32f4x9_fsotg_params },
|
||||
{ .compatible = "st,stm32f4x9-hsotg" },
|
||||
{ .compatible = "st,stm32f7xx-hsotg",
|
||||
.data = dwc2_set_stm32f7xx_hsotg_params },
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, dwc2_of_match_table);
|
||||
|
|
@ -335,6 +347,9 @@ static void dwc2_get_device_properties(struct dwc2_hsotg *hsotg)
|
|||
num);
|
||||
}
|
||||
}
|
||||
|
||||
if (of_find_property(hsotg->dev->of_node, "disable-over-current", NULL))
|
||||
p->oc_disable = true;
|
||||
}
|
||||
|
||||
static void dwc2_check_param_otg_cap(struct dwc2_hsotg *hsotg)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* pci.c - DesignWare HS OTG Controller PCI driver
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* platform.c - DesignWare HS OTG Controller platform driver
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* core.c - DesignWare USB3 DRD Controller Core file
|
||||
*
|
||||
|
|
@ -5,18 +6,6 @@
|
|||
*
|
||||
* Authors: Felipe Balbi <balbi@ti.com>,
|
||||
* Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <linux/version.h>
|
||||
|
|
@ -156,9 +145,8 @@ static void __dwc3_set_mode(struct work_struct *work)
|
|||
} else {
|
||||
if (dwc->usb2_phy)
|
||||
otg_set_vbus(dwc->usb2_phy->otg, true);
|
||||
if (dwc->usb2_generic_phy)
|
||||
phy_set_mode(dwc->usb2_generic_phy, PHY_MODE_USB_HOST);
|
||||
|
||||
phy_set_mode(dwc->usb2_generic_phy, PHY_MODE_USB_HOST);
|
||||
phy_set_mode(dwc->usb3_generic_phy, PHY_MODE_USB_HOST);
|
||||
}
|
||||
break;
|
||||
case DWC3_GCTL_PRTCAP_DEVICE:
|
||||
|
|
@ -166,8 +154,8 @@ static void __dwc3_set_mode(struct work_struct *work)
|
|||
|
||||
if (dwc->usb2_phy)
|
||||
otg_set_vbus(dwc->usb2_phy->otg, false);
|
||||
if (dwc->usb2_generic_phy)
|
||||
phy_set_mode(dwc->usb2_generic_phy, PHY_MODE_USB_DEVICE);
|
||||
phy_set_mode(dwc->usb2_generic_phy, PHY_MODE_USB_DEVICE);
|
||||
phy_set_mode(dwc->usb3_generic_phy, PHY_MODE_USB_DEVICE);
|
||||
|
||||
ret = dwc3_gadget_init(dwc);
|
||||
if (ret)
|
||||
|
|
@ -927,12 +915,13 @@ static int dwc3_core_init_mode(struct dwc3 *dwc)
|
|||
|
||||
switch (dwc->dr_mode) {
|
||||
case USB_DR_MODE_PERIPHERAL:
|
||||
dwc->current_dr_role = DWC3_GCTL_PRTCAP_DEVICE;
|
||||
dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_DEVICE);
|
||||
|
||||
if (dwc->usb2_phy)
|
||||
otg_set_vbus(dwc->usb2_phy->otg, false);
|
||||
if (dwc->usb2_generic_phy)
|
||||
phy_set_mode(dwc->usb2_generic_phy, PHY_MODE_USB_DEVICE);
|
||||
phy_set_mode(dwc->usb2_generic_phy, PHY_MODE_USB_DEVICE);
|
||||
phy_set_mode(dwc->usb3_generic_phy, PHY_MODE_USB_DEVICE);
|
||||
|
||||
ret = dwc3_gadget_init(dwc);
|
||||
if (ret) {
|
||||
|
|
@ -942,12 +931,13 @@ static int dwc3_core_init_mode(struct dwc3 *dwc)
|
|||
}
|
||||
break;
|
||||
case USB_DR_MODE_HOST:
|
||||
dwc->current_dr_role = DWC3_GCTL_PRTCAP_HOST;
|
||||
dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_HOST);
|
||||
|
||||
if (dwc->usb2_phy)
|
||||
otg_set_vbus(dwc->usb2_phy->otg, true);
|
||||
if (dwc->usb2_generic_phy)
|
||||
phy_set_mode(dwc->usb2_generic_phy, PHY_MODE_USB_HOST);
|
||||
phy_set_mode(dwc->usb2_generic_phy, PHY_MODE_USB_HOST);
|
||||
phy_set_mode(dwc->usb3_generic_phy, PHY_MODE_USB_HOST);
|
||||
|
||||
ret = dwc3_host_init(dwc);
|
||||
if (ret) {
|
||||
|
|
@ -1293,21 +1283,19 @@ static int dwc3_suspend_common(struct dwc3 *dwc)
|
|||
{
|
||||
unsigned long flags;
|
||||
|
||||
switch (dwc->dr_mode) {
|
||||
case USB_DR_MODE_PERIPHERAL:
|
||||
case USB_DR_MODE_OTG:
|
||||
switch (dwc->current_dr_role) {
|
||||
case DWC3_GCTL_PRTCAP_DEVICE:
|
||||
spin_lock_irqsave(&dwc->lock, flags);
|
||||
dwc3_gadget_suspend(dwc);
|
||||
spin_unlock_irqrestore(&dwc->lock, flags);
|
||||
dwc3_core_exit(dwc);
|
||||
break;
|
||||
case USB_DR_MODE_HOST:
|
||||
case DWC3_GCTL_PRTCAP_HOST:
|
||||
default:
|
||||
/* do nothing */
|
||||
break;
|
||||
}
|
||||
|
||||
dwc3_core_exit(dwc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1316,18 +1304,17 @@ static int dwc3_resume_common(struct dwc3 *dwc)
|
|||
unsigned long flags;
|
||||
int ret;
|
||||
|
||||
ret = dwc3_core_init(dwc);
|
||||
if (ret)
|
||||
return ret;
|
||||
switch (dwc->current_dr_role) {
|
||||
case DWC3_GCTL_PRTCAP_DEVICE:
|
||||
ret = dwc3_core_init(dwc);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
switch (dwc->dr_mode) {
|
||||
case USB_DR_MODE_PERIPHERAL:
|
||||
case USB_DR_MODE_OTG:
|
||||
spin_lock_irqsave(&dwc->lock, flags);
|
||||
dwc3_gadget_resume(dwc);
|
||||
spin_unlock_irqrestore(&dwc->lock, flags);
|
||||
/* FALLTHROUGH */
|
||||
case USB_DR_MODE_HOST:
|
||||
break;
|
||||
case DWC3_GCTL_PRTCAP_HOST:
|
||||
default:
|
||||
/* do nothing */
|
||||
break;
|
||||
|
|
@ -1338,7 +1325,7 @@ static int dwc3_resume_common(struct dwc3 *dwc)
|
|||
|
||||
static int dwc3_runtime_checks(struct dwc3 *dwc)
|
||||
{
|
||||
switch (dwc->dr_mode) {
|
||||
switch (dwc->current_dr_role) {
|
||||
case USB_DR_MODE_PERIPHERAL:
|
||||
case USB_DR_MODE_OTG:
|
||||
if (dwc->connected)
|
||||
|
|
@ -1381,19 +1368,17 @@ static int dwc3_runtime_resume(struct device *dev)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
switch (dwc->dr_mode) {
|
||||
case USB_DR_MODE_PERIPHERAL:
|
||||
case USB_DR_MODE_OTG:
|
||||
switch (dwc->current_dr_role) {
|
||||
case DWC3_GCTL_PRTCAP_DEVICE:
|
||||
dwc3_gadget_process_pending_events(dwc);
|
||||
break;
|
||||
case USB_DR_MODE_HOST:
|
||||
case DWC3_GCTL_PRTCAP_HOST:
|
||||
default:
|
||||
/* do nothing */
|
||||
break;
|
||||
}
|
||||
|
||||
pm_runtime_mark_last_busy(dev);
|
||||
pm_runtime_put(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1402,13 +1387,12 @@ static int dwc3_runtime_idle(struct device *dev)
|
|||
{
|
||||
struct dwc3 *dwc = dev_get_drvdata(dev);
|
||||
|
||||
switch (dwc->dr_mode) {
|
||||
case USB_DR_MODE_PERIPHERAL:
|
||||
case USB_DR_MODE_OTG:
|
||||
switch (dwc->current_dr_role) {
|
||||
case DWC3_GCTL_PRTCAP_DEVICE:
|
||||
if (dwc3_runtime_checks(dwc))
|
||||
return -EBUSY;
|
||||
break;
|
||||
case USB_DR_MODE_HOST:
|
||||
case DWC3_GCTL_PRTCAP_HOST:
|
||||
default:
|
||||
/* do nothing */
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* core.h - DesignWare USB3 DRD Core Header
|
||||
*
|
||||
|
|
@ -5,15 +6,6 @@
|
|||
*
|
||||
* Authors: Felipe Balbi <balbi@ti.com>,
|
||||
* Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef __DRIVERS_USB_DWC3_CORE_H
|
||||
|
|
@ -529,6 +521,7 @@ struct dwc3_event_buffer {
|
|||
* @number: endpoint number (1 - 15)
|
||||
* @type: set to bmAttributes & USB_ENDPOINT_XFERTYPE_MASK
|
||||
* @resource_index: Resource transfer index
|
||||
* @frame_number: set to the frame number we want this transfer to start (ISOC)
|
||||
* @interval: the interval on which the ISOC transfer is started
|
||||
* @allocated_requests: number of requests allocated
|
||||
* @queued_requests: number of requests queued for transfer
|
||||
|
|
@ -581,6 +574,7 @@ struct dwc3_ep {
|
|||
u8 resource_index;
|
||||
u32 allocated_requests;
|
||||
u32 queued_requests;
|
||||
u32 frame_number;
|
||||
u32 interval;
|
||||
|
||||
char name[20];
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* debug.h - DesignWare USB3 DRD Controller Debug Header
|
||||
*
|
||||
|
|
@ -5,15 +6,6 @@
|
|||
*
|
||||
* Authors: Felipe Balbi <balbi@ti.com>,
|
||||
* Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef __DWC3_DEBUG_H
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* debugfs.c - DesignWare USB3 DRD Controller DebugFS file
|
||||
*
|
||||
|
|
@ -5,15 +6,6 @@
|
|||
*
|
||||
* Authors: Felipe Balbi <balbi@ti.com>,
|
||||
* Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
|
|
|
|||
|
|
@ -1,21 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* drd.c - DesignWare USB3 DRD Controller Dual-role support
|
||||
*
|
||||
* Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com
|
||||
*
|
||||
* Authors: Roger Quadros <rogerq@ti.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <linux/extcon.h>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* dwc3-exynos.c - Samsung EXYNOS DWC3 Specific Glue layer
|
||||
*
|
||||
|
|
@ -5,15 +6,6 @@
|
|||
* http://www.samsung.com
|
||||
*
|
||||
* Author: Anton Tikhomirov <av.tikhomirov@samsung.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
|
|||
|
|
@ -1,18 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* dwc3-keystone.c - Keystone Specific Glue layer
|
||||
*
|
||||
* Copyright (C) 2010-2013 Texas Instruments Incorporated - http://www.ti.com
|
||||
*
|
||||
* Author: WingMan Kwok <w-kwok2@ti.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* dwc3-of-simple.c - OF glue layer for simple integrations
|
||||
*
|
||||
|
|
@ -5,15 +6,6 @@
|
|||
*
|
||||
* Author: Felipe Balbi <balbi@ti.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This is a combination of the old dwc3-qcom.c by Ivan T. Ivanov
|
||||
* <iivanov@mm-sol.com> and the original patch adding support for Xilinx' SoC
|
||||
* by Subbaraya Sundeep Bhatta <subbaraya.sundeep.bhatta@xilinx.com>
|
||||
|
|
@ -28,11 +20,13 @@
|
|||
#include <linux/of.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/reset.h>
|
||||
|
||||
struct dwc3_of_simple {
|
||||
struct device *dev;
|
||||
struct clk **clks;
|
||||
int num_clocks;
|
||||
struct reset_control *resets;
|
||||
};
|
||||
|
||||
static int dwc3_of_simple_clk_init(struct dwc3_of_simple *simple, int count)
|
||||
|
|
@ -95,10 +89,21 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
|
|||
platform_set_drvdata(pdev, simple);
|
||||
simple->dev = dev;
|
||||
|
||||
simple->resets = of_reset_control_array_get_optional_exclusive(np);
|
||||
if (IS_ERR(simple->resets)) {
|
||||
ret = PTR_ERR(simple->resets);
|
||||
dev_err(dev, "failed to get device resets, err=%d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = reset_control_deassert(simple->resets);
|
||||
if (ret)
|
||||
goto err_resetc_put;
|
||||
|
||||
ret = dwc3_of_simple_clk_init(simple, of_count_phandle_with_args(np,
|
||||
"clocks", "#clock-cells"));
|
||||
if (ret)
|
||||
return ret;
|
||||
goto err_resetc_assert;
|
||||
|
||||
ret = of_platform_populate(np, NULL, NULL, dev);
|
||||
if (ret) {
|
||||
|
|
@ -107,7 +112,7 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
|
|||
clk_put(simple->clks[i]);
|
||||
}
|
||||
|
||||
return ret;
|
||||
goto err_resetc_assert;
|
||||
}
|
||||
|
||||
pm_runtime_set_active(dev);
|
||||
|
|
@ -115,6 +120,13 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
|
|||
pm_runtime_get_sync(dev);
|
||||
|
||||
return 0;
|
||||
|
||||
err_resetc_assert:
|
||||
reset_control_assert(simple->resets);
|
||||
|
||||
err_resetc_put:
|
||||
reset_control_put(simple->resets);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int dwc3_of_simple_remove(struct platform_device *pdev)
|
||||
|
|
@ -123,12 +135,15 @@ static int dwc3_of_simple_remove(struct platform_device *pdev)
|
|||
struct device *dev = &pdev->dev;
|
||||
int i;
|
||||
|
||||
of_platform_depopulate(dev);
|
||||
|
||||
for (i = 0; i < simple->num_clocks; i++) {
|
||||
clk_disable_unprepare(simple->clks[i]);
|
||||
clk_put(simple->clks[i]);
|
||||
}
|
||||
|
||||
of_platform_depopulate(dev);
|
||||
reset_control_assert(simple->resets);
|
||||
reset_control_put(simple->resets);
|
||||
|
||||
pm_runtime_put_sync(dev);
|
||||
pm_runtime_disable(dev);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* dwc3-omap.c - OMAP Specific Glue layer
|
||||
*
|
||||
|
|
@ -5,15 +6,6 @@
|
|||
*
|
||||
* Authors: Felipe Balbi <balbi@ti.com>,
|
||||
* Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* dwc3-pci.c - PCI Specific glue layer
|
||||
*
|
||||
|
|
@ -5,21 +6,13 @@
|
|||
*
|
||||
* Authors: Felipe Balbi <balbi@ti.com>,
|
||||
* Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
|
|
@ -61,6 +54,7 @@ struct dwc3_pci {
|
|||
guid_t guid;
|
||||
|
||||
unsigned int has_dsm_for_pm:1;
|
||||
struct work_struct wakeup_work;
|
||||
};
|
||||
|
||||
static const struct acpi_gpio_params reset_gpios = { 0, 0, false };
|
||||
|
|
@ -174,6 +168,22 @@ static int dwc3_pci_quirks(struct dwc3_pci *dwc)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void dwc3_pci_resume_work(struct work_struct *work)
|
||||
{
|
||||
struct dwc3_pci *dwc = container_of(work, struct dwc3_pci, wakeup_work);
|
||||
struct platform_device *dwc3 = dwc->dwc3;
|
||||
int ret;
|
||||
|
||||
ret = pm_runtime_get_sync(&dwc3->dev);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
pm_runtime_mark_last_busy(&dwc3->dev);
|
||||
pm_runtime_put_sync_autosuspend(&dwc3->dev);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int dwc3_pci_probe(struct pci_dev *pci,
|
||||
const struct pci_device_id *id)
|
||||
{
|
||||
|
|
@ -232,6 +242,9 @@ static int dwc3_pci_probe(struct pci_dev *pci,
|
|||
device_init_wakeup(dev, true);
|
||||
pci_set_drvdata(pci, dwc);
|
||||
pm_runtime_put(dev);
|
||||
#ifdef CONFIG_PM
|
||||
INIT_WORK(&dwc->wakeup_work, dwc3_pci_resume_work);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
err:
|
||||
|
|
@ -243,6 +256,9 @@ static void dwc3_pci_remove(struct pci_dev *pci)
|
|||
{
|
||||
struct dwc3_pci *dwc = pci_get_drvdata(pci);
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
cancel_work_sync(&dwc->wakeup_work);
|
||||
#endif
|
||||
device_init_wakeup(&pci->dev, false);
|
||||
pm_runtime_get(&pci->dev);
|
||||
platform_device_unregister(dwc->dwc3);
|
||||
|
|
@ -318,14 +334,15 @@ static int dwc3_pci_runtime_suspend(struct device *dev)
|
|||
static int dwc3_pci_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct dwc3_pci *dwc = dev_get_drvdata(dev);
|
||||
struct platform_device *dwc3 = dwc->dwc3;
|
||||
int ret;
|
||||
|
||||
ret = dwc3_pci_dsm(dwc, PCI_INTEL_BXT_STATE_D0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return pm_runtime_get(&dwc3->dev);
|
||||
queue_work(pm_wq, &dwc->wakeup_work);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/**
|
||||
* dwc3-st.c Support for dwc3 platform devices on ST Microelectronics platforms
|
||||
*
|
||||
|
|
@ -10,11 +11,6 @@
|
|||
* Contributors: Aymen Bouattay <aymen.bouattay@st.com>
|
||||
* Peter Griffin <peter.griffin@linaro.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Inspired by dwc3-omap.c and dwc3-exynos.c.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* ep0.c - DesignWare USB3 DRD Controller Endpoint 0 Handling
|
||||
*
|
||||
|
|
@ -5,15 +6,6 @@
|
|||
*
|
||||
* Authors: Felipe Balbi <balbi@ti.com>,
|
||||
* Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
|
|
@ -487,14 +479,10 @@ static int dwc3_ep0_handle_device(struct dwc3 *dwc,
|
|||
static int dwc3_ep0_handle_intf(struct dwc3 *dwc,
|
||||
struct usb_ctrlrequest *ctrl, int set)
|
||||
{
|
||||
enum usb_device_state state;
|
||||
u32 wValue;
|
||||
u32 wIndex;
|
||||
int ret = 0;
|
||||
|
||||
wValue = le16_to_cpu(ctrl->wValue);
|
||||
wIndex = le16_to_cpu(ctrl->wIndex);
|
||||
state = dwc->gadget.state;
|
||||
|
||||
switch (wValue) {
|
||||
case USB_INTRF_FUNC_SUSPEND:
|
||||
|
|
@ -517,14 +505,10 @@ static int dwc3_ep0_handle_endpoint(struct dwc3 *dwc,
|
|||
struct usb_ctrlrequest *ctrl, int set)
|
||||
{
|
||||
struct dwc3_ep *dep;
|
||||
enum usb_device_state state;
|
||||
u32 wValue;
|
||||
u32 wIndex;
|
||||
int ret;
|
||||
|
||||
wValue = le16_to_cpu(ctrl->wValue);
|
||||
wIndex = le16_to_cpu(ctrl->wIndex);
|
||||
state = dwc->gadget.state;
|
||||
|
||||
switch (wValue) {
|
||||
case USB_ENDPOINT_HALT:
|
||||
|
|
@ -551,10 +535,8 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc,
|
|||
{
|
||||
u32 recip;
|
||||
int ret;
|
||||
enum usb_device_state state;
|
||||
|
||||
recip = ctrl->bRequestType & USB_RECIP_MASK;
|
||||
state = dwc->gadget.state;
|
||||
|
||||
switch (recip) {
|
||||
case USB_RECIP_DEVICE:
|
||||
|
|
@ -712,12 +694,10 @@ static int dwc3_ep0_set_sel(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl)
|
|||
struct dwc3_ep *dep;
|
||||
enum usb_device_state state = dwc->gadget.state;
|
||||
u16 wLength;
|
||||
u16 wValue;
|
||||
|
||||
if (state == USB_STATE_DEFAULT)
|
||||
return -EINVAL;
|
||||
|
||||
wValue = le16_to_cpu(ctrl->wValue);
|
||||
wLength = le16_to_cpu(ctrl->wLength);
|
||||
|
||||
if (wLength != 6) {
|
||||
|
|
@ -842,9 +822,6 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
|
|||
struct usb_request *ur;
|
||||
struct dwc3_trb *trb;
|
||||
struct dwc3_ep *ep0;
|
||||
unsigned maxp;
|
||||
unsigned remaining_ur_length;
|
||||
void *buf;
|
||||
u32 transferred = 0;
|
||||
u32 status;
|
||||
u32 length;
|
||||
|
|
@ -871,11 +848,8 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
|
|||
}
|
||||
|
||||
ur = &r->request;
|
||||
buf = ur->buf;
|
||||
remaining_ur_length = ur->length;
|
||||
|
||||
length = trb->size & DWC3_TRB_SIZE_MASK;
|
||||
maxp = ep0->endpoint.maxpacket;
|
||||
transferred = ur->length - length;
|
||||
ur->actual += transferred;
|
||||
|
||||
|
|
@ -1001,7 +975,6 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
|
|||
} else if (IS_ALIGNED(req->request.length, dep->endpoint.maxpacket) &&
|
||||
req->request.length && req->request.zero) {
|
||||
u32 maxpacket;
|
||||
u32 rem;
|
||||
|
||||
ret = usb_gadget_map_request_by_dev(dwc->sysdev,
|
||||
&req->request, dep->number);
|
||||
|
|
@ -1009,7 +982,6 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
|
|||
return;
|
||||
|
||||
maxpacket = dep->endpoint.maxpacket;
|
||||
rem = req->request.length % maxpacket;
|
||||
|
||||
/* prepare normal TRB */
|
||||
dwc3_ep0_prepare_one_trb(dep, req->request.dma,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* gadget.c - DesignWare USB3 DRD Controller Gadget Framework Link
|
||||
*
|
||||
|
|
@ -5,15 +6,6 @@
|
|||
*
|
||||
* Authors: Felipe Balbi <balbi@ti.com>,
|
||||
* Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
|
|
@ -1151,9 +1143,6 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep)
|
|||
|
||||
BUILD_BUG_ON_NOT_POWER_OF_2(DWC3_TRB_NUM);
|
||||
|
||||
if (!dwc3_calc_trbs_left(dep))
|
||||
return;
|
||||
|
||||
/*
|
||||
* We can get in a situation where there's a request in the started list
|
||||
* but there weren't enough TRBs to fully kick it in the first time
|
||||
|
|
@ -1194,7 +1183,7 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep)
|
|||
}
|
||||
}
|
||||
|
||||
static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param)
|
||||
static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep)
|
||||
{
|
||||
struct dwc3_gadget_ep_cmd_params params;
|
||||
struct dwc3_request *req;
|
||||
|
|
@ -1202,6 +1191,9 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param)
|
|||
int ret;
|
||||
u32 cmd;
|
||||
|
||||
if (!dwc3_calc_trbs_left(dep))
|
||||
return 0;
|
||||
|
||||
starting = !(dep->flags & DWC3_EP_BUSY);
|
||||
|
||||
dwc3_prepare_trbs(dep);
|
||||
|
|
@ -1216,8 +1208,10 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param)
|
|||
if (starting) {
|
||||
params.param0 = upper_32_bits(req->trb_dma);
|
||||
params.param1 = lower_32_bits(req->trb_dma);
|
||||
cmd = DWC3_DEPCMD_STARTTRANSFER |
|
||||
DWC3_DEPCMD_PARAM(cmd_param);
|
||||
cmd = DWC3_DEPCMD_STARTTRANSFER;
|
||||
|
||||
if (usb_endpoint_xfer_isoc(dep->endpoint.desc))
|
||||
cmd |= DWC3_DEPCMD_PARAM(dep->frame_number);
|
||||
} else {
|
||||
cmd = DWC3_DEPCMD_UPDATETRANSFER |
|
||||
DWC3_DEPCMD_PARAM(dep->resource_index);
|
||||
|
|
@ -1258,8 +1252,6 @@ static int __dwc3_gadget_get_frame(struct dwc3 *dwc)
|
|||
static void __dwc3_gadget_start_isoc(struct dwc3 *dwc,
|
||||
struct dwc3_ep *dep, u32 cur_uf)
|
||||
{
|
||||
u32 uf;
|
||||
|
||||
if (list_empty(&dep->pending_list)) {
|
||||
dev_info(dwc->dev, "%s: ran out of requests\n",
|
||||
dep->name);
|
||||
|
|
@ -1271,9 +1263,8 @@ static void __dwc3_gadget_start_isoc(struct dwc3 *dwc,
|
|||
* Schedule the first trb for one interval in the future or at
|
||||
* least 4 microframes.
|
||||
*/
|
||||
uf = cur_uf + max_t(u32, 4, dep->interval);
|
||||
|
||||
__dwc3_gadget_kick_transfer(dep, uf);
|
||||
dep->frame_number = cur_uf + max_t(u32, 4, dep->interval);
|
||||
__dwc3_gadget_kick_transfer(dep);
|
||||
}
|
||||
|
||||
static void dwc3_gadget_start_isoc(struct dwc3 *dwc,
|
||||
|
|
@ -1290,7 +1281,6 @@ static void dwc3_gadget_start_isoc(struct dwc3 *dwc,
|
|||
static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
|
||||
{
|
||||
struct dwc3 *dwc = dep->dwc;
|
||||
int ret = 0;
|
||||
|
||||
if (!dep->endpoint.desc) {
|
||||
dev_err(dwc->dev, "%s: can't queue to disabled endpoint\n",
|
||||
|
|
@ -1337,24 +1327,14 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
|
|||
}
|
||||
|
||||
if ((dep->flags & DWC3_EP_BUSY) &&
|
||||
!(dep->flags & DWC3_EP_MISSED_ISOC)) {
|
||||
WARN_ON_ONCE(!dep->resource_index);
|
||||
ret = __dwc3_gadget_kick_transfer(dep,
|
||||
dep->resource_index);
|
||||
}
|
||||
!(dep->flags & DWC3_EP_MISSED_ISOC))
|
||||
goto out;
|
||||
|
||||
goto out;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!dwc3_calc_trbs_left(dep))
|
||||
return 0;
|
||||
|
||||
ret = __dwc3_gadget_kick_transfer(dep, 0);
|
||||
out:
|
||||
if (ret == -EBUSY)
|
||||
ret = 0;
|
||||
|
||||
return ret;
|
||||
return __dwc3_gadget_kick_transfer(dep);
|
||||
}
|
||||
|
||||
static int dwc3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request,
|
||||
|
|
@ -2347,7 +2327,7 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, struct dwc3_ep *dep,
|
|||
req->request.actual = length - req->remaining;
|
||||
|
||||
if ((req->request.actual < length) && req->num_pending_sgs)
|
||||
return __dwc3_gadget_kick_transfer(dep, 0);
|
||||
return __dwc3_gadget_kick_transfer(dep);
|
||||
|
||||
dwc3_gadget_giveback(dep, req, status);
|
||||
|
||||
|
|
@ -2440,13 +2420,8 @@ static void dwc3_endpoint_transfer_complete(struct dwc3 *dwc,
|
|||
if (!dep->endpoint.desc)
|
||||
return;
|
||||
|
||||
if (!usb_endpoint_xfer_isoc(dep->endpoint.desc)) {
|
||||
int ret;
|
||||
|
||||
ret = __dwc3_gadget_kick_transfer(dep, 0);
|
||||
if (!ret || ret == -EBUSY)
|
||||
return;
|
||||
}
|
||||
if (!usb_endpoint_xfer_isoc(dep->endpoint.desc))
|
||||
__dwc3_gadget_kick_transfer(dep);
|
||||
}
|
||||
|
||||
static void dwc3_endpoint_interrupt(struct dwc3 *dwc,
|
||||
|
|
@ -2487,15 +2462,10 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc,
|
|||
dwc3_endpoint_transfer_complete(dwc, dep, event);
|
||||
break;
|
||||
case DWC3_DEPEVT_XFERNOTREADY:
|
||||
if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) {
|
||||
if (usb_endpoint_xfer_isoc(dep->endpoint.desc))
|
||||
dwc3_gadget_start_isoc(dwc, dep, event);
|
||||
} else {
|
||||
int ret;
|
||||
|
||||
ret = __dwc3_gadget_kick_transfer(dep, 0);
|
||||
if (!ret || ret == -EBUSY)
|
||||
return;
|
||||
}
|
||||
else
|
||||
__dwc3_gadget_kick_transfer(dep);
|
||||
|
||||
break;
|
||||
case DWC3_DEPEVT_STREAMEVT:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* gadget.h - DesignWare USB3 DRD Gadget Header
|
||||
*
|
||||
|
|
@ -5,15 +6,6 @@
|
|||
*
|
||||
* Authors: Felipe Balbi <balbi@ti.com>,
|
||||
* Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef __DRIVERS_USB_DWC3_GADGET_H
|
||||
|
|
|
|||
|
|
@ -1,18 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* host.c - DesignWare USB3 DRD Controller Host Glue
|
||||
*
|
||||
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
|
||||
*
|
||||
* Authors: Felipe Balbi <balbi@ti.com>,
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* io.h - DesignWare USB3 DRD IO Header
|
||||
*
|
||||
|
|
@ -5,15 +6,6 @@
|
|||
*
|
||||
* Authors: Felipe Balbi <balbi@ti.com>,
|
||||
* Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef __DRIVERS_USB_DWC3_IO_H
|
||||
|
|
|
|||
|
|
@ -1,18 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* trace.c - DesignWare USB3 DRD Controller Trace Support
|
||||
*
|
||||
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com
|
||||
*
|
||||
* Author: Felipe Balbi <balbi@ti.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
|
|
|
|||
|
|
@ -1,18 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* trace.h - DesignWare USB3 DRD Controller Trace Support
|
||||
*
|
||||
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com
|
||||
*
|
||||
* Author: Felipe Balbi <balbi@ti.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 of
|
||||
* the License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#undef TRACE_SYSTEM
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue