Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2217994/?format=api
{ "id": 2217994, "url": "http://patchwork.ozlabs.org/api/patches/2217994/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260331-device_only-v1-1-00378b80365c@cadence.com/", "project": { "id": 28, "url": "http://patchwork.ozlabs.org/api/projects/28/?format=api", "name": "Linux PCI development", "link_name": "linux-pci", "list_id": "linux-pci.vger.kernel.org", "list_email": "linux-pci@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260331-device_only-v1-1-00378b80365c@cadence.com>", "list_archive_url": null, "date": "2026-03-31T08:19:11", "name": "usb: cdnsp: Add support for device-only configuration", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "9145b1611bea61de82d3c0b7fa9a322da0f52894", "submitter": { "id": 93017, "url": "http://patchwork.ozlabs.org/api/people/93017/?format=api", "name": "Pawel Laszczak via B4 Relay", "email": "devnull+pawell.cadence.com@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260331-device_only-v1-1-00378b80365c@cadence.com/mbox/", "series": [ { "id": 498141, "url": "http://patchwork.ozlabs.org/api/series/498141/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=498141", "date": "2026-03-31T08:19:11", "name": "usb: cdnsp: Add support for device-only configuration", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498141/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2217994/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2217994/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-pci+bounces-51532-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-pci@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=FCzoos7K;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-51532-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"FCzoos7K\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4flLS65gF1z1y1q\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 19:11:50 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 39A12300D15C\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 08:05:16 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id C59CA3D88E5;\n\tTue, 31 Mar 2026 08:05:14 +0000 (UTC)", "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id E8E1E3D75AA;\n\tTue, 31 Mar 2026 08:05:13 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPS id 1CB97C19423;\n\tTue, 31 Mar 2026 08:05:13 +0000 (UTC)", "from aws-us-west-2-korg-lkml-1.web.codeaurora.org\n (localhost.localdomain [127.0.0.1])\n\tby smtp.lore.kernel.org (Postfix) with ESMTP id 13D05FF60DC;\n\tTue, 31 Mar 2026 08:05:13 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774944314; cv=none;\n b=VswY97TFjK4VZ0PfoupWD8+bTJlbajB8hNsMzvrbwvIoO1xTeG9WINvuqIAe35LhFCWP5SFd1iNrIKB75RzjbdsKrXZ1HU3iIF8DLeOBWDqHGLXEGO0t1jGeABL9YposlRj27+JGVIiYM0L26UhUhKqVTPHBBz4ekLZ6kqH7Oio=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774944314; c=relaxed/simple;\n\tbh=0cZvuCg3q6ttJ602GNWrFjr3BNZ7oOzIO1zMeJHR2W8=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc;\n b=iS6x/bebf/Xm+lub9F/4dXiNFtOco4Ti78SSylHQGBzjcy94dJCzrRfh/PMG2hfNaNIVpE0rpHHVaAPSGwb4mo1JIdK4vGjTuyz9QW2RduBIIeJIfZr+ifyrvw1aFujCYYWIOFMGz62tng7s+JXN7Ukw3Zhi9fnTo6glXkerNGE=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=FCzoos7K; arc=none smtp.client-ip=10.30.226.201", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1774944313;\n\tbh=0cZvuCg3q6ttJ602GNWrFjr3BNZ7oOzIO1zMeJHR2W8=;\n\th=From:Date:Subject:To:Cc:Reply-To:From;\n\tb=FCzoos7KwR2XiL6eV7xsgFdw8oOSiCpWHBmuW1sxFNsvg0qrafmh0rt9lZtDq/fa2\n\t IsS5q/zO5sWxkh2t+2gdXTFGs82j27RKcoEIk4Snsf+XEvUNPWY+FSvLsAztVNGXEP\n\t KzSsPIQgY6EOAe5LxkBZrTxTqTU9QhA/IqzH1qfIxZh65CEfIshDXVlUV+xpNUG6Yy\n\t RQ9Vosstm9TlaYsGRD+YT63j0BuU0rC1KYPh0ND+N3Kd9alLt2kAVHXoXClRT2dimO\n\t cJ2wsDRGVGunc7HRiRCg+UTWwkJp8NGn5LTM568oLfVZVOJBE991pj4OO+HpMQfklz\n\t 2BR7qDR71sfRw==", "From": "Pawel Laszczak via B4 Relay <devnull+pawell.cadence.com@kernel.org>", "Date": "Tue, 31 Mar 2026 10:19:11 +0200", "Subject": "[PATCH] usb: cdnsp: Add support for device-only configuration", "Precedence": "bulk", "X-Mailing-List": "linux-pci@vger.kernel.org", "List-Id": "<linux-pci.vger.kernel.org>", "List-Subscribe": "<mailto:linux-pci+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-pci+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "7bit", "Message-Id": "<20260331-device_only-v1-1-00378b80365c@cadence.com>", "X-B4-Tracking": "v=1; b=H4sIAH6Dy2kC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE\n vPSU3UzU4B8JSMDIzMDY2ND3RSgouTU+Py8nEpdQ0ujFFNjSxNjgyRTJaCOgqLUtMwKsGnRsbW\n 1APSz3sJdAAAA", "To": "Peter Chen <peter.chen@kernel.org>, Roger Quadros <rogerq@kernel.org>,\n Greg Kroah-Hartman <gregkh@linuxfoundation.org>,\n Bjorn Helgaas <bhelgaas@google.com>", "Cc": "linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,\n linux-pci@vger.kernel.org, pawell@cadence.com", "X-Mailer": "b4 0.13.0", "X-Developer-Signature": "v=1; a=ed25519-sha256; t=1774945165; l=10845;\n i=pawell@cadence.com; h=from:subject:message-id;\n bh=6OIqgxMFmEPIY1lz/0pWr94nNNQg9qsP83S9iKkdml4=;\n b=8R1w9k86i+MQEe4egtg5LnSARTaFCOOp61gbJ9RI8d9XrRsdnLCiD5tODDOFppJOfxsFkr/OC\n hIy6gF7zdCQBM3Z9P1d1h1yhRoXys4k3MpQglaU8kiFRfJw6AsyS/wq", "X-Developer-Key": "i=pawell@cadence.com; a=ed25519;\n pk=EUPBvLO9CDg7j6defeDl2iqi+z5Ivqu4Z46aiqe7dYc=", "X-Endpoint-Received": "by B4 Relay for pawell@cadence.com/default with\n auth_id=707", "X-Original-From": "Pawel Laszczak <pawell@cadence.com>", "Reply-To": "pawell@cadence.com" }, "content": "From: Pawel Laszczak <pawell@cadence.com>\n\nThis patch introduces support for operating the Cadence USBSSP (cdnsp)\ncontroller in a peripheral-only mode, bypassing the Dual-Role Device (DRD)\nlogic.\n\nThe change in BAR indexing (from BAR 2 to BAR 1) is a direct\nconsequence of switching from 64-bit to 32-bit addressing in the\nPeripheral-only configuration.\n\nTested on PCI platform with Device-only configuration. Platform-side\nchanges are included to support the PCI glue layer's property injection.\n\nSigned-off-by: Pawel Laszczak <pawell@cadence.com>\n---\nNOTE: This patch depends on Peter Chen's series \"usb: cdns3: Add \nUSBSSP platform driver support\", which was recently accepted by \nGreg into the usb-testing branch (commit 6076388ca1ed).\n---\n drivers/usb/cdns3/cdns3-plat.c | 24 ++++++++++++---------\n drivers/usb/cdns3/cdnsp-pci.c | 47 ++++++++++++++++++++++++++++++++++--------\n drivers/usb/cdns3/core.c | 3 ++-\n drivers/usb/cdns3/core.h | 5 ++++-\n drivers/usb/cdns3/drd.c | 16 ++++++++++++--\n include/linux/pci_ids.h | 1 +\n 6 files changed, 73 insertions(+), 23 deletions(-)\n\n\n---\nbase-commit: 5196f2c98340297e1fdd36555285e991ceddf776\nchange-id: 20260331-device_only-192d539430b5\n\nBest regards,", "diff": "diff --git a/drivers/usb/cdns3/cdns3-plat.c b/drivers/usb/cdns3/cdns3-plat.c\nindex 71c612e27b73..33746e672cda 100644\n--- a/drivers/usb/cdns3/cdns3-plat.c\n+++ b/drivers/usb/cdns3/cdns3-plat.c\n@@ -75,6 +75,7 @@ static int cdns3_plat_probe(struct platform_device *pdev)\n \tif (cdns->pdata && cdns->pdata->override_apb_timeout)\n \t\tcdns->override_apb_timeout = cdns->pdata->override_apb_timeout;\n \n+\tcdns->no_drd = device_property_read_bool(dev, \"no_drd\");\n \tplatform_set_drvdata(pdev, cdns);\n \n \tret = platform_get_irq_byname(pdev, \"host\");\n@@ -107,21 +108,23 @@ static int cdns3_plat_probe(struct platform_device *pdev)\n \n \tcdns->dev_regs\t= regs;\n \n-\tcdns->otg_irq = platform_get_irq_byname(pdev, \"otg\");\n-\tif (cdns->otg_irq < 0)\n-\t\treturn dev_err_probe(dev, cdns->otg_irq,\n-\t\t\t\t \"Failed to get otg IRQ\\n\");\n+\tif (!cdns->no_drd) {\n+\t\tcdns->otg_irq = platform_get_irq_byname(pdev, \"otg\");\n+\t\tif (cdns->otg_irq < 0)\n+\t\t\treturn dev_err_probe(dev, cdns->otg_irq,\n+\t\t\t\t\t \"Failed to get otg IRQ\\n\");\n \n-\tres = platform_get_resource_byname(pdev, IORESOURCE_MEM, \"otg\");\n-\tif (!res) {\n-\t\tdev_err(dev, \"couldn't get otg resource\\n\");\n-\t\treturn -ENXIO;\n+\t\tres = platform_get_resource_byname(pdev, IORESOURCE_MEM, \"otg\");\n+\t\tif (!res) {\n+\t\t\tdev_err(dev, \"couldn't get otg resource\\n\");\n+\t\t\treturn -ENXIO;\n+\t\t}\n+\n+\t\tcdns->otg_res = *res;\n \t}\n \n \tcdns->phyrst_a_enable = device_property_read_bool(dev, \"cdns,phyrst-a-enable\");\n \n-\tcdns->otg_res = *res;\n-\n \tcdns->wakeup_irq = platform_get_irq_byname_optional(pdev, \"wakeup\");\n \tif (cdns->wakeup_irq == -EPROBE_DEFER)\n \t\treturn cdns->wakeup_irq;\n@@ -158,6 +161,7 @@ static int cdns3_plat_probe(struct platform_device *pdev)\n \t\tgoto err_cdns_init;\n \n \tcdns->gadget_init = cdns3_plat_gadget_init;\n+\n \tret = cdns_core_init_role(cdns);\n \tif (ret)\n \t\tgoto err_cdns_init;\ndiff --git a/drivers/usb/cdns3/cdnsp-pci.c b/drivers/usb/cdns3/cdnsp-pci.c\nindex 432007cfe695..e20c59ceb8a4 100644\n--- a/drivers/usb/cdns3/cdnsp-pci.c\n+++ b/drivers/usb/cdns3/cdnsp-pci.c\n@@ -19,6 +19,7 @@\n \n struct cdnsp_wrap {\n \tstruct platform_device *plat_dev;\n+\tstruct property_entry prop[3];\n \tstruct resource dev_res[6];\n \tint devfn;\n };\n@@ -29,10 +30,15 @@ struct cdnsp_wrap {\n #define RES_HOST_ID\t\t3\n #define RES_DEV_ID\t\t4\n #define RES_DRD_ID\t\t5\n-\n+/* DRD PCI configuration - 64-bit addressing */\n+/* First PCI function */\n #define PCI_BAR_HOST\t\t0\n-#define PCI_BAR_OTG\t\t0\n #define PCI_BAR_DEV\t\t2\n+/* Second PCI function */\n+#define PCI_BAR_OTG\t\t0\n+/* Device only PCI configuration - 32-bit addressing */\n+/* First PCI function */\n+#define PCI_BAR_ONLY_DEV\t1\n \n #define PCI_DEV_FN_HOST_DEVICE\t0\n #define PCI_DEV_FN_OTG\t\t1\n@@ -65,6 +71,7 @@ static int cdnsp_pci_probe(struct pci_dev *pdev,\n \tstruct cdnsp_wrap *wrap;\n \tstruct resource *res;\n \tstruct pci_dev *func;\n+\tbool no_drd = false;\n \tint ret = 0;\n \n \t/*\n@@ -75,11 +82,14 @@ static int cdnsp_pci_probe(struct pci_dev *pdev,\n \t\t pdev->devfn != PCI_DEV_FN_OTG))\n \t\treturn -EINVAL;\n \n+\tif (pdev->device == PCI_DEVICE_ID_CDNS_UDC_USBSSP)\n+\t\tno_drd = true;\n+\n \tfunc = cdnsp_get_second_fun(pdev);\n-\tif (!func)\n+\tif (!func && !no_drd)\n \t\treturn -EINVAL;\n \n-\tif (func->class == PCI_CLASS_SERIAL_USB_XHCI ||\n+\tif ((func && func->class == PCI_CLASS_SERIAL_USB_XHCI) ||\n \t pdev->class == PCI_CLASS_SERIAL_USB_XHCI) {\n \t\tret = -EINVAL;\n \t\tgoto put_pci;\n@@ -93,7 +103,7 @@ static int cdnsp_pci_probe(struct pci_dev *pdev,\n \n \tpci_set_master(pdev);\n \n-\tif (pci_is_enabled(func)) {\n+\tif (func && pci_is_enabled(func)) {\n \t\twrap = pci_get_drvdata(func);\n \t} else {\n \t\twrap = kzalloc_obj(*wrap);\n@@ -106,10 +116,13 @@ static int cdnsp_pci_probe(struct pci_dev *pdev,\n \tres = wrap->dev_res;\n \n \tif (pdev->devfn == PCI_DEV_FN_HOST_DEVICE) {\n+\t\tint bar_dev = no_drd ? PCI_BAR_ONLY_DEV : PCI_BAR_DEV;\n+\n \t\t/* Function 0: host(BAR_0) + device(BAR_2). */\n \t\tdev_dbg(&pdev->dev, \"Initialize Device resources\\n\");\n-\t\tres[RES_DEV_ID].start = pci_resource_start(pdev, PCI_BAR_DEV);\n-\t\tres[RES_DEV_ID].end = pci_resource_end(pdev, PCI_BAR_DEV);\n+\n+\t\tres[RES_DEV_ID].start = pci_resource_start(pdev, bar_dev);\n+\t\tres[RES_DEV_ID].end = pci_resource_end(pdev, bar_dev);\n \t\tres[RES_DEV_ID].name = \"dev\";\n \t\tres[RES_DEV_ID].flags = IORESOURCE_MEM;\n \t\tdev_dbg(&pdev->dev, \"USBSSP-DEV physical base addr: %pa\\n\",\n@@ -145,9 +158,20 @@ static int cdnsp_pci_probe(struct pci_dev *pdev,\n \t\twrap->dev_res[RES_IRQ_OTG_ID].flags = IORESOURCE_IRQ;\n \t}\n \n-\tif (pci_is_enabled(func)) {\n+\tif (no_drd || pci_is_enabled(func)) {\n+\t\tu8 idx = 0;\n+\n \t\t/* set up platform device info */\n \t\tpdata.override_apb_timeout = CHICKEN_APB_TIMEOUT_VALUE;\n+\t\tif (no_drd) {\n+\t\t\twrap->prop[idx++] = PROPERTY_ENTRY_STRING(\"dr_mode\", \"peripheral\");\n+\t\t\twrap->prop[idx++] = PROPERTY_ENTRY_BOOL(\"no_drd\");\n+\t\t} else {\n+\t\t\twrap->prop[idx++] = PROPERTY_ENTRY_STRING(\"dr_mode\", \"otg\");\n+\t\t\twrap->prop[idx++] = PROPERTY_ENTRY_BOOL(\"usb-role-switch\");\n+\t\t}\n+\n+\t\twrap->prop[idx] = (struct property_entry){ };\n \t\tmemset(&plat_info, 0, sizeof(plat_info));\n \t\tplat_info.parent = &pdev->dev;\n \t\tplat_info.fwnode = pdev->dev.fwnode;\n@@ -158,6 +182,7 @@ static int cdnsp_pci_probe(struct pci_dev *pdev,\n \t\tplat_info.dma_mask = pdev->dma_mask;\n \t\tplat_info.data = &pdata;\n \t\tplat_info.size_data = sizeof(pdata);\n+\t\tplat_info.properties = wrap->prop;\n \t\twrap->devfn = pdev->devfn;\n \t\t/* register platform device */\n \t\twrap->plat_dev = platform_device_register_full(&plat_info);\n@@ -185,13 +210,17 @@ static void cdnsp_pci_remove(struct pci_dev *pdev)\n \tif (wrap->devfn == pdev->devfn)\n \t\tplatform_device_unregister(wrap->plat_dev);\n \n-\tif (!pci_is_enabled(func))\n+\tif (!func || !pci_is_enabled(func))\n \t\tkfree(wrap);\n \n \tpci_dev_put(func);\n }\n \n static const struct pci_device_id cdnsp_pci_ids[] = {\n+\t{ PCI_DEVICE(PCI_VENDOR_ID_CDNS, PCI_DEVICE_ID_CDNS_UDC_USBSSP),\n+\t .class = PCI_CLASS_SERIAL_USB_DEVICE },\n+\t{ PCI_DEVICE(PCI_VENDOR_ID_CDNS, PCI_DEVICE_ID_CDNS_UDC_USBSSP),\n+\t .class = PCI_CLASS_SERIAL_USB_CDNS },\n \t{ PCI_DEVICE(PCI_VENDOR_ID_CDNS, PCI_DEVICE_ID_CDNS_USBSSP),\n \t .class = PCI_CLASS_SERIAL_USB_DEVICE },\n \t{ PCI_DEVICE(PCI_VENDOR_ID_CDNS, PCI_DEVICE_ID_CDNS_USBSSP),\ndiff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c\nindex 10f00b6c3c83..72f7acba6258 100644\n--- a/drivers/usb/cdns3/core.c\n+++ b/drivers/usb/cdns3/core.c\n@@ -71,7 +71,8 @@ static void cdns_role_stop(struct cdns *cdns)\n static void cdns_exit_roles(struct cdns *cdns)\n {\n \tcdns_role_stop(cdns);\n-\tcdns_drd_exit(cdns);\n+\tif (!cdns->no_drd)\n+\t\tcdns_drd_exit(cdns);\n }\n \n /**\ndiff --git a/drivers/usb/cdns3/core.h b/drivers/usb/cdns3/core.h\nindex dc8c4137de15..6abe231f4559 100644\n--- a/drivers/usb/cdns3/core.h\n+++ b/drivers/usb/cdns3/core.h\n@@ -80,9 +80,11 @@ struct cdns3_platform_data {\n * @pdata: platform data from glue layer\n * @lock: spinlock structure\n * @xhci_plat_data: xhci private data structure pointer\n+ * @gadget_init: pointer to gadget initialization function\n * @override_apb_timeout: hold value of APB timeout. For value 0 the default\n * value in CHICKEN_BITS_3 will be preserved.\n- * @gadget_init: pointer to gadget initialization function\n+ * @no_drd: DRD register block is inaccessible - driver handles only\n+ * device mode.\n */\n struct cdns {\n \tstruct device\t\t\t*dev;\n@@ -122,6 +124,7 @@ struct cdns {\n \tstruct xhci_plat_priv\t\t*xhci_plat_data;\n \tint (*gadget_init)(struct cdns *cdns);\n \tu32 override_apb_timeout;\n+\tbool\t\t\t\tno_drd;\n };\n \n int cdns_hw_role_switch(struct cdns *cdns);\ndiff --git a/drivers/usb/cdns3/drd.c b/drivers/usb/cdns3/drd.c\nindex 84fb38a5723a..38f3051c2188 100644\n--- a/drivers/usb/cdns3/drd.c\n+++ b/drivers/usb/cdns3/drd.c\n@@ -107,7 +107,7 @@ void cdns_clear_vbus(struct cdns *cdns)\n {\n \tu32 reg;\n \n-\tif (cdns->version != CDNSP_CONTROLLER_V2)\n+\tif (cdns->version != CDNSP_CONTROLLER_V2 || cdns->no_drd)\n \t\treturn;\n \n \treg = readl(&cdns->otg_cdnsp_regs->override);\n@@ -120,7 +120,7 @@ void cdns_set_vbus(struct cdns *cdns)\n {\n \tu32 reg;\n \n-\tif (cdns->version != CDNSP_CONTROLLER_V2)\n+\tif (cdns->version != CDNSP_CONTROLLER_V2 || cdns->no_drd)\n \t\treturn;\n \n \treg = readl(&cdns->otg_cdnsp_regs->override);\n@@ -234,6 +234,9 @@ int cdns_drd_gadget_on(struct cdns *cdns)\n \tu32 ready_bit;\n \tint ret, val;\n \n+\tif (cdns->no_drd)\n+\t\treturn 0;\n+\n \t/* switch OTG core */\n \twritel(OTGCMD_DEV_BUS_REQ | reg, &cdns->otg_regs->cmd);\n \n@@ -265,6 +268,9 @@ void cdns_drd_gadget_off(struct cdns *cdns)\n {\n \tu32 val;\n \n+\tif (cdns->no_drd)\n+\t\treturn;\n+\n \t/*\n \t * Driver should wait at least 10us after disabling Device\n \t * before turning-off Device (DEV_BUS_DROP).\n@@ -392,6 +398,12 @@ int cdns_drd_init(struct cdns *cdns)\n \tu32 state, reg;\n \tint ret;\n \n+\tif (cdns->no_drd) {\n+\t\tcdns->version = CDNSP_CONTROLLER_V2;\n+\t\tcdns->dr_mode = USB_DR_MODE_PERIPHERAL;\n+\t\treturn 0;\n+\t}\n+\n \tregs = devm_ioremap_resource(cdns->dev, &cdns->otg_res);\n \tif (IS_ERR(regs))\n \t\treturn PTR_ERR(regs);\ndiff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h\nindex 406abf629be2..a931fb201402 100644\n--- a/include/linux/pci_ids.h\n+++ b/include/linux/pci_ids.h\n@@ -2424,6 +2424,7 @@\n #define PCI_DEVICE_ID_CDNS_USBSS\t0x0100\n #define PCI_DEVICE_ID_CDNS_USB\t\t0x0120\n #define PCI_DEVICE_ID_CDNS_USBSSP\t0x0200\n+#define PCI_DEVICE_ID_CDNS_UDC_USBSSP\t0x0400\n \n #define PCI_VENDOR_ID_ARECA\t\t0x17d3\n #define PCI_DEVICE_ID_ARECA_1110\t0x1110\n", "prefixes": [] }