Commit 18a6be67 authored by Pawel Laszczak's avatar Pawel Laszczak Committed by Greg Kroah-Hartman
Browse files

usb: cdnsp: blocked some cdns3 specific code



host.c file has some parts of code that were introduced for CDNS3 driver
and should not be used with CDNSP driver.
This patch blocks using these parts of codes by CDNSP driver.
These elements include:
- xhci_plat_cdns3_xhci object
- cdns3 specific XECP_PORT_CAP_REG register
- cdns3 specific XECP_AUX_CTRL_REG1 register

cc: stable@vger.kernel.org
Fixes: 3d829045 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver")
Signed-off-by: default avatarPawel Laszczak <pawell@cadence.com>
Link: https://lore.kernel.org/r/20240206104018.48272-1-pawell@cadence.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d70c7a66
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -18,6 +18,11 @@
#include "../host/xhci.h"
#include "../host/xhci-plat.h"

/*
 * The XECP_PORT_CAP_REG and XECP_AUX_CTRL_REG1 exist only
 * in Cadence USB3 dual-role controller, so it can't be used
 * with Cadence CDNSP dual-role controller.
 */
#define XECP_PORT_CAP_REG	0x8000
#define XECP_AUX_CTRL_REG1	0x8120

@@ -57,6 +62,8 @@ static const struct xhci_plat_priv xhci_plat_cdns3_xhci = {
	.resume_quirk = xhci_cdns3_resume_quirk,
};

static const struct xhci_plat_priv xhci_plat_cdnsp_xhci;

static int __cdns_host_init(struct cdns *cdns)
{
	struct platform_device *xhci;
@@ -81,8 +88,13 @@ static int __cdns_host_init(struct cdns *cdns)
		goto err1;
	}

	if (cdns->version < CDNSP_CONTROLLER_V2)
		cdns->xhci_plat_data = kmemdup(&xhci_plat_cdns3_xhci,
				sizeof(struct xhci_plat_priv), GFP_KERNEL);
	else
		cdns->xhci_plat_data = kmemdup(&xhci_plat_cdnsp_xhci,
				sizeof(struct xhci_plat_priv), GFP_KERNEL);

	if (!cdns->xhci_plat_data) {
		ret = -ENOMEM;
		goto err1;