From: Michael Grzeschik <m.grzeschik@pengutronix.de>
To: Peter Chen <peter.chen@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Michael Grzeschik <m.grzeschik@pengutronix.de>
Subject: [PATCH] usb: chipidea: move ci_ulpi_init after the phy initialization
Date: Tue, 02 Apr 2024 08:23:43 +0200 [thread overview]
Message-ID: <20240328-chipidea-phy-misc-v1-1-907d9de5d4df@pengutronix.de> (raw)
The function ci_usb_phy_init is already handling the
hw_phymode_configure path which is also only possible after we have
a valid phy. So we move the ci_ulpi_init after the phy initialization
to be really sure to be able to communicate with the ulpi phy.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
drivers/usb/chipidea/core.c | 8 ++++----
drivers/usb/chipidea/ulpi.c | 5 -----
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 835bf2428dc6e..bada13f704b62 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -1084,10 +1084,6 @@ static int ci_hdrc_probe(struct platform_device *pdev)
return -ENODEV;
}
- ret = ci_ulpi_init(ci);
- if (ret)
- return ret;
-
if (ci->platdata->phy) {
ci->phy = ci->platdata->phy;
} else if (ci->platdata->usb_phy) {
@@ -1142,6 +1138,10 @@ static int ci_hdrc_probe(struct platform_device *pdev)
goto ulpi_exit;
}
+ ret = ci_ulpi_init(ci);
+ if (ret)
+ return ret;
+
ci->hw_bank.phys = res->start;
ci->irq = platform_get_irq(pdev, 0);
diff --git a/drivers/usb/chipidea/ulpi.c b/drivers/usb/chipidea/ulpi.c
index dfec07e8ae1d2..89fb51e2c3ded 100644
--- a/drivers/usb/chipidea/ulpi.c
+++ b/drivers/usb/chipidea/ulpi.c
@@ -68,11 +68,6 @@ int ci_ulpi_init(struct ci_hdrc *ci)
if (ci->platdata->phy_mode != USBPHY_INTERFACE_MODE_ULPI)
return 0;
- /*
- * Set PORTSC correctly so we can read/write ULPI registers for
- * identification purposes
- */
- hw_phymode_configure(ci);
ci->ulpi_ops.read = ci_ulpi_read;
ci->ulpi_ops.write = ci_ulpi_write;
---
base-commit: 5bab5dc780c9ed0c69fc2f828015532acf4a7848
change-id: 20240328-chipidea-phy-misc-b3f2bc814784
Best regards,
--
Michael Grzeschik <m.grzeschik@pengutronix.de>
next reply other threads:[~2024-04-02 6:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-02 6:23 Michael Grzeschik [this message]
2024-04-07 1:19 ` [PATCH] usb: chipidea: move ci_ulpi_init after the phy initialization Peter Chen
[not found] ` <CGME20240425194033eucas1p2c1e98d1c55c970e246087e2dab180e84@eucas1p2.samsung.com>
2024-04-25 19:40 ` Marek Szyprowski
-- strict thread matches above, loose matches on Subject: below --
2024-05-16 21:11 Wouter Franken
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=20240328-chipidea-phy-misc-v1-1-907d9de5d4df@pengutronix.de \
--to=m.grzeschik@pengutronix.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=peter.chen@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).