All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org
Cc: John Youn <John.Youn@synopsys.com>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Pavan Kondeti <quic_pkondeti@quicinc.com>
Subject: [RFC PATCH 3/4] usb: dwc3: core: Share global register access with xhci driver
Date: Fri, 03 Jun 2022 19:48:22 -0700	[thread overview]
Message-ID: <c940dbc673f7937453257cf5af961dd73b216ba0.1654310542.git.Thinh.Nguyen@synopsys.com> (raw)
In-Reply-To: <cover.1654310542.git.Thinh.Nguyen@synopsys.com>

When the dwc3 driver create a xhci platform device and pass its control
to the xhci driver, allow it to also have access to dwc3 global
registers. The xhci-snps needs access to the global register parameters
to handle some quirks.

Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
---
 drivers/usb/dwc3/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index e027c0420dc3..b19b7b540182 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1697,7 +1697,7 @@ static int dwc3_probe(struct platform_device *pdev)
 
 	dwc->xhci_resources[0].start = res->start;
 	dwc->xhci_resources[0].end = dwc->xhci_resources[0].start +
-					DWC3_XHCI_REGS_END;
+					DWC3_GLOBALS_REGS_END;
 	dwc->xhci_resources[0].flags = res->flags;
 	dwc->xhci_resources[0].name = res->name;
 
@@ -1708,7 +1708,7 @@ static int dwc3_probe(struct platform_device *pdev)
 	dwc_res = *res;
 	dwc_res.start += DWC3_GLOBALS_REGS_START;
 
-	regs = devm_ioremap_resource(dev, &dwc_res);
+	regs = devm_ioremap(dev, dwc_res.start, resource_size(&dwc_res));
 	if (IS_ERR(regs))
 		return PTR_ERR(regs);
 
-- 
2.28.0


  parent reply	other threads:[~2022-06-04  2:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-04  2:48 [RFC PATCH 0/4] usb: xhci: Introduce xhci-snps Thinh Nguyen
2022-06-04  2:48 ` [RFC PATCH 1/4] dt-bindings: usb: usb-xhci: Add xhci-snps-quirks Thinh Nguyen
2022-06-09 17:48   ` Rob Herring
2022-06-09 18:11     ` Thinh Nguyen
2022-06-10 16:52       ` Rob Herring
2022-06-10 17:45         ` Thinh Nguyen
2022-06-04  2:48 ` [RFC PATCH 2/4] usb: dwc3: host: Always set xhci-snps-quirks Thinh Nguyen
2022-06-04  2:48 ` Thinh Nguyen [this message]
2022-06-04  2:48 ` [RFC PATCH 4/4] usb: xhci: Introduce Synopsys glue extension for DWC_usb3x Thinh Nguyen
2022-06-06  9:11   ` Pavan Kondeti
2022-06-06 18:28     ` Thinh Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c940dbc673f7937453257cf5af961dd73b216ba0.1654310542.git.Thinh.Nguyen@synopsys.com \
    --to=thinh.nguyen@synopsys.com \
    --cc=John.Youn@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=quic_pkondeti@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.