linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] USB: EHCI: ehci-mv: make HSIC work
@ 2019-12-21  6:50 Lubomir Rintel
  2019-12-21  6:50 ` [PATCH v2 1/3] USB: EHCI: ehci-mv: add HSIC support Lubomir Rintel
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Lubomir Rintel @ 2019-12-21  6:50 UTC (permalink / raw)
  To: Alan Stern; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel

please have a look at the three patches chained to this message. They
are independent of each other and can be applied iny any order.

My main objective was to make HSIC work on MMP3. The PHY patch is
loosely related to that (there's no MMP3 HSIC PHY driver, but the NOP
is sufficient). The last one is a cosmetic thing.

Compared to first submission, the patches are now submitted as series
and the wording of the third one's commit message has been changed.

Thank you,
Lubo



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

* [PATCH v2 1/3] USB: EHCI: ehci-mv: add HSIC support
  2019-12-21  6:50 [PATCH v2 0/3] USB: EHCI: ehci-mv: make HSIC work Lubomir Rintel
@ 2019-12-21  6:50 ` Lubomir Rintel
  2019-12-21  6:50 ` [PATCH v2 2/3] USB: EHCI: ehci-mv: make the PHY optional Lubomir Rintel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Lubomir Rintel @ 2019-12-21  6:50 UTC (permalink / raw)
  To: Alan Stern; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, Lubomir Rintel

Some special dance is needed to initialize the HSIC port.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
 drivers/usb/host/ehci-mv.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index 66ec1fdf9fe7d..21eb32baf9380 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -11,6 +11,7 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/usb/otg.h>
+#include <linux/usb/of.h>
 #include <linux/platform_data/mv_usb.h>
 #include <linux/io.h>
 
@@ -67,6 +68,8 @@ static int mv_ehci_reset(struct usb_hcd *hcd)
 {
 	struct device *dev = hcd->self.controller;
 	struct ehci_hcd_mv *ehci_mv = hcd_to_ehci_hcd_mv(hcd);
+	struct ehci_hcd *ehci = hcd_to_ehci(hcd);
+	u32 status;
 	int retval;
 
 	if (ehci_mv == NULL) {
@@ -80,6 +83,14 @@ static int mv_ehci_reset(struct usb_hcd *hcd)
 	if (retval)
 		dev_err(dev, "ehci_setup failed %d\n", retval);
 
+	if (of_usb_get_phy_mode(dev->of_node) == USBPHY_INTERFACE_MODE_HSIC) {
+		status = ehci_readl(ehci, &ehci->regs->port_status[0]);
+		status |= PORT_TEST_FORCE;
+		ehci_writel(ehci, status, &ehci->regs->port_status[0]);
+		status &= ~PORT_TEST_FORCE;
+		ehci_writel(ehci, status, &ehci->regs->port_status[0]);
+	}
+
 	return retval;
 }
 
-- 
2.24.1


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

* [PATCH v2 2/3] USB: EHCI: ehci-mv: make the PHY optional
  2019-12-21  6:50 [PATCH v2 0/3] USB: EHCI: ehci-mv: make HSIC work Lubomir Rintel
  2019-12-21  6:50 ` [PATCH v2 1/3] USB: EHCI: ehci-mv: add HSIC support Lubomir Rintel
@ 2019-12-21  6:50 ` Lubomir Rintel
  2019-12-21  6:50 ` [PATCH v2 3/3] USB: EHCI: ehci-mv: drop pxa_ehci_type and some device IDs Lubomir Rintel
  2019-12-21 15:27 ` [PATCH v2 0/3] USB: EHCI: ehci-mv: make HSIC work Alan Stern
  3 siblings, 0 replies; 5+ messages in thread
From: Lubomir Rintel @ 2019-12-21  6:50 UTC (permalink / raw)
  To: Alan Stern; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, Lubomir Rintel

We may be using a NOP transceiver and those are treated specially by the
USB core and return -ENODEV with devm_phy_get().

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
 drivers/usb/host/ehci-mv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index 21eb32baf9380..c8717f06cd8cb 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -127,7 +127,7 @@ static int mv_ehci_probe(struct platform_device *pdev)
 		ehci_mv->set_vbus = pdata->set_vbus;
 	}
 
-	ehci_mv->phy = devm_phy_get(&pdev->dev, "usb");
+	ehci_mv->phy = devm_phy_optional_get(&pdev->dev, "usb");
 	if (IS_ERR(ehci_mv->phy)) {
 		retval = PTR_ERR(ehci_mv->phy);
 		if (retval != -EPROBE_DEFER)
-- 
2.24.1


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

* [PATCH v2 3/3] USB: EHCI: ehci-mv: drop pxa_ehci_type and some device IDs
  2019-12-21  6:50 [PATCH v2 0/3] USB: EHCI: ehci-mv: make HSIC work Lubomir Rintel
  2019-12-21  6:50 ` [PATCH v2 1/3] USB: EHCI: ehci-mv: add HSIC support Lubomir Rintel
  2019-12-21  6:50 ` [PATCH v2 2/3] USB: EHCI: ehci-mv: make the PHY optional Lubomir Rintel
@ 2019-12-21  6:50 ` Lubomir Rintel
  2019-12-21 15:27 ` [PATCH v2 0/3] USB: EHCI: ehci-mv: make HSIC work Alan Stern
  3 siblings, 0 replies; 5+ messages in thread
From: Lubomir Rintel @ 2019-12-21  6:50 UTC (permalink / raw)
  To: Alan Stern; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, Lubomir Rintel

This is merely a cleanup. None of these is used anywhere.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>

---
Changes since v1:
- Changed the wording a bit

 drivers/usb/host/ehci-mv.c           | 6 ++----
 include/linux/platform_data/mv_usb.h | 8 --------
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index c8717f06cd8cb..91602e3492084 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -257,10 +257,8 @@ static int mv_ehci_remove(struct platform_device *pdev)
 MODULE_ALIAS("mv-ehci");
 
 static const struct platform_device_id ehci_id_table[] = {
-	{"pxa-u2oehci", PXA_U2OEHCI},
-	{"pxa-sph", PXA_SPH},
-	{"mmp3-hsic", MMP3_HSIC},
-	{"mmp3-fsic", MMP3_FSIC},
+	{"pxa-u2oehci", 0},
+	{"pxa-sph", 0},
 	{},
 };
 
diff --git a/include/linux/platform_data/mv_usb.h b/include/linux/platform_data/mv_usb.h
index 5376b6d799d5d..20d239c02bf3a 100644
--- a/include/linux/platform_data/mv_usb.h
+++ b/include/linux/platform_data/mv_usb.h
@@ -6,14 +6,6 @@
 #ifndef __MV_PLATFORM_USB_H
 #define __MV_PLATFORM_USB_H
 
-enum pxa_ehci_type {
-	EHCI_UNDEFINED = 0,
-	PXA_U2OEHCI,	/* pxa 168, 9xx */
-	PXA_SPH,	/* pxa 168, 9xx SPH */
-	MMP3_HSIC,	/* mmp3 hsic */
-	MMP3_FSIC,	/* mmp3 fsic */
-};
-
 enum {
 	MV_USB_MODE_OTG,
 	MV_USB_MODE_HOST,
-- 
2.24.1


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

* Re: [PATCH v2 0/3] USB: EHCI: ehci-mv: make HSIC work
  2019-12-21  6:50 [PATCH v2 0/3] USB: EHCI: ehci-mv: make HSIC work Lubomir Rintel
                   ` (2 preceding siblings ...)
  2019-12-21  6:50 ` [PATCH v2 3/3] USB: EHCI: ehci-mv: drop pxa_ehci_type and some device IDs Lubomir Rintel
@ 2019-12-21 15:27 ` Alan Stern
  3 siblings, 0 replies; 5+ messages in thread
From: Alan Stern @ 2019-12-21 15:27 UTC (permalink / raw)
  To: Lubomir Rintel; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel

On Sat, 21 Dec 2019, Lubomir Rintel wrote:

> please have a look at the three patches chained to this message. They
> are independent of each other and can be applied iny any order.
> 
> My main objective was to make HSIC work on MMP3. The PHY patch is
> loosely related to that (there's no MMP3 HSIC PHY driver, but the NOP
> is sufficient). The last one is a cosmetic thing.
> 
> Compared to first submission, the patches are now submitted as series
> and the wording of the third one's commit message has been changed.

All three patches are okay with me.

Acked-by: Alan Stern <stern@rowland.harvard.edu>

Alan Stern


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

end of thread, other threads:[~2019-12-21 15:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-21  6:50 [PATCH v2 0/3] USB: EHCI: ehci-mv: make HSIC work Lubomir Rintel
2019-12-21  6:50 ` [PATCH v2 1/3] USB: EHCI: ehci-mv: add HSIC support Lubomir Rintel
2019-12-21  6:50 ` [PATCH v2 2/3] USB: EHCI: ehci-mv: make the PHY optional Lubomir Rintel
2019-12-21  6:50 ` [PATCH v2 3/3] USB: EHCI: ehci-mv: drop pxa_ehci_type and some device IDs Lubomir Rintel
2019-12-21 15:27 ` [PATCH v2 0/3] USB: EHCI: ehci-mv: make HSIC work Alan Stern

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 NNTP newsgroup(s).