mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] usb: dwc3: am62: Use HZ_PER_KHZ
@ 2025-02-17 14:45 Sascha Hauer
  2025-02-17 14:45 ` [PATCH 2/2] usb: dwc3: am62: set mode valid bit before probing children Sascha Hauer
  2025-02-18 14:05 ` [PATCH 1/2] usb: dwc3: am62: Use HZ_PER_KHZ Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Sascha Hauer @ 2025-02-17 14:45 UTC (permalink / raw)
  To: Barebox List

Use HZ_PER_KHZ to make intention clear and drop now unnecessary comment.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/dwc3/dwc3-am62.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
index fd7f5e54d2..7dac8981fb 100644
--- a/drivers/usb/dwc3/dwc3-am62.c
+++ b/drivers/usb/dwc3/dwc3-am62.c
@@ -203,7 +203,7 @@ static int dwc3_ti_probe(struct device *dev)
 
 	/* Calculate the rate code */
 	rate = clk_get_rate(am62->usb2_refclk);
-	rate /= 1000;	// To KHz
+	rate /= HZ_PER_KHZ;
 	for (i = 0; i < ARRAY_SIZE(dwc3_ti_rate_table); i++) {
 		if (dwc3_ti_rate_table[i] == rate)
 			break;
-- 
2.39.5




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] usb: dwc3: am62: set mode valid bit before probing children
  2025-02-17 14:45 [PATCH 1/2] usb: dwc3: am62: Use HZ_PER_KHZ Sascha Hauer
@ 2025-02-17 14:45 ` Sascha Hauer
  2025-02-18 14:05 ` [PATCH 1/2] usb: dwc3: am62: Use HZ_PER_KHZ Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2025-02-17 14:45 UTC (permalink / raw)
  To: Barebox List

We should fully configure the desired register settings before calling
of_platform_populate() to make sure they actually have an effect.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/dwc3/dwc3-am62.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
index 7dac8981fb..848549fbf6 100644
--- a/drivers/usb/dwc3/dwc3-am62.c
+++ b/drivers/usb/dwc3/dwc3-am62.c
@@ -240,17 +240,17 @@ static int dwc3_ti_probe(struct device *dev)
 
 	clk_prepare_enable(am62->usb2_refclk);
 
+	/* Set mode valid bit to indicate role is valid */
+	reg = dwc3_ti_readl(am62, USBSS_MODE_CONTROL);
+	reg |= USBSS_MODE_VALID;
+	dwc3_ti_writel(am62, USBSS_MODE_CONTROL, reg);
+
 	ret = of_platform_populate(node, NULL, dev);
 	if (ret) {
 		dev_err_probe(dev, ret, "failed to create dwc3 core\n");
 		goto err_pm_disable;
 	}
 
-	/* Set mode valid bit to indicate role is valid */
-	reg = dwc3_ti_readl(am62, USBSS_MODE_CONTROL);
-	reg |= USBSS_MODE_VALID;
-	dwc3_ti_writel(am62, USBSS_MODE_CONTROL, reg);
-
 	return 0;
 
 err_pm_disable:
-- 
2.39.5




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] usb: dwc3: am62: Use HZ_PER_KHZ
  2025-02-17 14:45 [PATCH 1/2] usb: dwc3: am62: Use HZ_PER_KHZ Sascha Hauer
  2025-02-17 14:45 ` [PATCH 2/2] usb: dwc3: am62: set mode valid bit before probing children Sascha Hauer
@ 2025-02-18 14:05 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2025-02-18 14:05 UTC (permalink / raw)
  To: Barebox List, Sascha Hauer


On Mon, 17 Feb 2025 15:45:42 +0100, Sascha Hauer wrote:
> Use HZ_PER_KHZ to make intention clear and drop now unnecessary comment.
> 
> 

Applied, thanks!

[1/2] usb: dwc3: am62: Use HZ_PER_KHZ
      https://git.pengutronix.de/cgit/barebox/commit/?id=5dd32e5531b5 (link may not be stable)
[2/2] usb: dwc3: am62: set mode valid bit before probing children
      https://git.pengutronix.de/cgit/barebox/commit/?id=a2e46da015a4 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-18 14:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-17 14:45 [PATCH 1/2] usb: dwc3: am62: Use HZ_PER_KHZ Sascha Hauer
2025-02-17 14:45 ` [PATCH 2/2] usb: dwc3: am62: set mode valid bit before probing children Sascha Hauer
2025-02-18 14:05 ` [PATCH 1/2] usb: dwc3: am62: Use HZ_PER_KHZ Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox