From 0b490046d8d7c035177ca4f5380f0c3275c4697d Mon Sep 17 00:00:00 2001 From: Pawel Laszczak Date: Mon, 7 Dec 2020 11:32:21 +0100 Subject: usb: cdns3: Refactoring names in reusable code Patch change the functions and objects names in reusable code. The reusable code includes core.c, core.h, drd.c and drd.h files. It also changes the names of all references to these functions and objects in other cdns3 files. There are a lot of changes, but all changes are very trivial. The reason of this patch is to avoid of mixing prefix cdns3 and cdnsp in in cdnsp driver what could introduce some confusion in understanding of cdnsp driver. This patch assumes to use three different prefixes in Cadence USB drivers: cdns: for common reusable code cdnsp: for names related only with cdnsp driver cdns3: for names related only with cdns3 driver Signed-off-by: Pawel Laszczak Tested-by: Aswath Govindraju Signed-off-by: Peter Chen --- drivers/usb/cdns3/host-export.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/usb/cdns3/host-export.h') diff --git a/drivers/usb/cdns3/host-export.h b/drivers/usb/cdns3/host-export.h index 26041718a086..744a4d4c4fb8 100644 --- a/drivers/usb/cdns3/host-export.h +++ b/drivers/usb/cdns3/host-export.h @@ -12,17 +12,17 @@ struct usb_hcd; #ifdef CONFIG_USB_CDNS3_HOST -int cdns3_host_init(struct cdns3 *cdns); +int cdns_host_init(struct cdns *cdns); int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd); #else -static inline int cdns3_host_init(struct cdns3 *cdns) +static inline int cdns_host_init(struct cdns *cdns) { return -ENXIO; } -static inline void cdns3_host_exit(struct cdns3 *cdns) { } +static inline void cdns_host_exit(struct cdns *cdns) { } static inline int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd) { return 0; -- cgit From 3d82904559f4f5a2622db1b21de3edf2eded7664 Mon Sep 17 00:00:00 2001 From: Pawel Laszczak Date: Mon, 7 Dec 2020 11:32:24 +0100 Subject: usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver This patch introduces the main part of Cadence USBSSP DRD driver to Linux kernel. To reduce the patch size a little bit, the header file gadget.h was intentionally added as separate patch. The Cadence USBSSP DRD Controller is a highly configurable IP Core which can be instantiated as Dual-Role Device (DRD), Peripheral Only and Host Only (XHCI)configurations. The current driver has been validated with FPGA platform. We have support for PCIe bus, which is used on FPGA prototyping. The host side of USBSS DRD controller is compliant with XHCI. The architecture for device side is almost the same as for host side, and most of the XHCI specification can be used to understand how this controller operates. Signed-off-by: Pawel Laszczak Signed-off-by: Peter Chen --- drivers/usb/cdns3/host-export.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/usb/cdns3/host-export.h') diff --git a/drivers/usb/cdns3/host-export.h b/drivers/usb/cdns3/host-export.h index 744a4d4c4fb8..087e1921e1f5 100644 --- a/drivers/usb/cdns3/host-export.h +++ b/drivers/usb/cdns3/host-export.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* - * Cadence USBSS DRD Driver - Host Export APIs + * Cadence USBSS and USBSSP DRD Driver - Host Export APIs * * Copyright (C) 2017-2018 NXP * @@ -9,8 +9,9 @@ #ifndef __LINUX_CDNS3_HOST_EXPORT #define __LINUX_CDNS3_HOST_EXPORT +#if IS_ENABLED(CONFIG_USB_CDNS_HOST) + struct usb_hcd; -#ifdef CONFIG_USB_CDNS3_HOST int cdns_host_init(struct cdns *cdns); int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd); @@ -28,6 +29,6 @@ static inline int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd) return 0; } -#endif /* CONFIG_USB_CDNS3_HOST */ +#endif /* USB_CDNS_HOST */ #endif /* __LINUX_CDNS3_HOST_EXPORT */ -- cgit From b13f020d0c9f03d8c6f63f06ac4cfea76a212afb Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Tue, 8 Dec 2020 11:55:47 -0800 Subject: usb: cdns3: fix warning when USB_CDNS_HOST is not set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix a build warning when USB_CDNS_HOST is not enabled: In file included from ../drivers/usb/cdns3/core.c:23:0: ../drivers/usb/cdns3/host-export.h:27:51: warning: ‘struct usb_hcd’ declared inside parameter list will not be visible outside of this definition or declaration static inline int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd) ^~~~~~~ Signed-off-by: Randy Dunlap Cc: Peter Chen Cc: Pawel Laszczak Cc: Roger Quadros Cc: linux-usb@vger.kernel.org Cc: Greg Kroah-Hartman Signed-off-by: Peter Chen --- drivers/usb/cdns3/host-export.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/usb/cdns3/host-export.h') diff --git a/drivers/usb/cdns3/host-export.h b/drivers/usb/cdns3/host-export.h index 087e1921e1f5..fb8541b8adbc 100644 --- a/drivers/usb/cdns3/host-export.h +++ b/drivers/usb/cdns3/host-export.h @@ -9,10 +9,10 @@ #ifndef __LINUX_CDNS3_HOST_EXPORT #define __LINUX_CDNS3_HOST_EXPORT -#if IS_ENABLED(CONFIG_USB_CDNS_HOST) - struct usb_hcd; +#if IS_ENABLED(CONFIG_USB_CDNS_HOST) + int cdns_host_init(struct cdns *cdns); int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd); -- cgit From 88171f67a2c15461d29942b0103d539f52367844 Mon Sep 17 00:00:00 2001 From: Pawel Laszczak Date: Fri, 11 Dec 2020 06:09:54 +0100 Subject: usb: cdns3: Removes xhci_cdns3_suspend_quirk from host-export.h Function xhci_cdns3_suspend_quirk is used only in host.c file. We can make it as static and removes it from host-export.h. Signed-off-by: Pawel Laszczak Acked-by: Roger Quadros Signed-off-by: Peter Chen --- drivers/usb/cdns3/host-export.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'drivers/usb/cdns3/host-export.h') diff --git a/drivers/usb/cdns3/host-export.h b/drivers/usb/cdns3/host-export.h index fb8541b8adbc..cf92173ecf00 100644 --- a/drivers/usb/cdns3/host-export.h +++ b/drivers/usb/cdns3/host-export.h @@ -9,12 +9,9 @@ #ifndef __LINUX_CDNS3_HOST_EXPORT #define __LINUX_CDNS3_HOST_EXPORT -struct usb_hcd; - #if IS_ENABLED(CONFIG_USB_CDNS_HOST) int cdns_host_init(struct cdns *cdns); -int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd); #else @@ -24,10 +21,6 @@ static inline int cdns_host_init(struct cdns *cdns) } static inline void cdns_host_exit(struct cdns *cdns) { } -static inline int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd) -{ - return 0; -} #endif /* USB_CDNS_HOST */ -- cgit