diff mbox series

[2/2] USB: host: ehci-atmel: Add support for HSIC phy

Message ID 20210910163842.1596407-3-cristian.birsan@microchip.com (mailing list archive)
State Accepted
Commit 6854ccc4688be88e5efd5b1f8300c4289baf0910
Headers show
Series USB: host: ehci-atmel: Enable HSIC port on SAMA5D2 | expand

Commit Message

Cristian Birsan Sept. 10, 2021, 4:38 p.m. UTC
From: Cristian Birsan <cristian.birsan@microchip.com>

Add support for USB Host High Speed Port HSIC phy.

Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
---
 drivers/usb/host/ehci-atmel.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Alan Stern Sept. 10, 2021, 8:49 p.m. UTC | #1
On Fri, Sep 10, 2021 at 07:38:42PM +0300, cristian.birsan@microchip.com wrote:
> From: Cristian Birsan <cristian.birsan@microchip.com>
> 
> Add support for USB Host High Speed Port HSIC phy.
> 
> Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
> ---

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

>  drivers/usb/host/ehci-atmel.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
> index e893467d659c..05d41fd65f25 100644
> --- a/drivers/usb/host/ehci-atmel.c
> +++ b/drivers/usb/host/ehci-atmel.c
> @@ -18,6 +18,8 @@
>  #include <linux/platform_device.h>
>  #include <linux/usb.h>
>  #include <linux/usb/hcd.h>
> +#include <linux/usb/phy.h>
> +#include <linux/usb/of.h>
>  
>  #include "ehci.h"
>  
> @@ -25,6 +27,9 @@
>  
>  static const char hcd_name[] = "ehci-atmel";
>  
> +#define EHCI_INSNREG(index)			((index) * 4 + 0x90)
> +#define EHCI_INSNREG08_HSIC_EN			BIT(2)
> +
>  /* interface and function clocks */
>  #define hcd_to_atmel_ehci_priv(h) \
>  	((struct atmel_ehci_priv *)hcd_to_ehci(h)->priv)
> @@ -154,6 +159,9 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev)
>  		goto fail_add_hcd;
>  	device_wakeup_enable(hcd->self.controller);
>  
> +	if (of_usb_get_phy_mode(pdev->dev.of_node) == USBPHY_INTERFACE_MODE_HSIC)
> +		writel(EHCI_INSNREG08_HSIC_EN, hcd->regs + EHCI_INSNREG(8));
> +
>  	return retval;
>  
>  fail_add_hcd:
> -- 
> 2.25.1
>
Alexander Dahl Sept. 13, 2021, 11:39 a.m. UTC | #2
Hello Christian,

Am Freitag, 10. September 2021, 18:38:42 CEST schrieb 
cristian.birsan@microchip.com:
> From: Cristian Birsan <cristian.birsan@microchip.com>
> 
> Add support for USB Host High Speed Port HSIC phy.
> 
> Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
> ---
>  drivers/usb/host/ehci-atmel.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
> index e893467d659c..05d41fd65f25 100644
> --- a/drivers/usb/host/ehci-atmel.c
> +++ b/drivers/usb/host/ehci-atmel.c
> @@ -18,6 +18,8 @@
>  #include <linux/platform_device.h>
>  #include <linux/usb.h>
>  #include <linux/usb/hcd.h>
> +#include <linux/usb/phy.h>
> +#include <linux/usb/of.h>
> 
>  #include "ehci.h"
> 
> @@ -25,6 +27,9 @@
> 
>  static const char hcd_name[] = "ehci-atmel";
> 
> +#define EHCI_INSNREG(index)			((index) * 4 + 0x90)
> +#define EHCI_INSNREG08_HSIC_EN			BIT(2)
> +
>  /* interface and function clocks */
>  #define hcd_to_atmel_ehci_priv(h) \
>  	((struct atmel_ehci_priv *)hcd_to_ehci(h)->priv)
> @@ -154,6 +159,9 @@ static int ehci_atmel_drv_probe(struct platform_device
> *pdev) goto fail_add_hcd;
>  	device_wakeup_enable(hcd->self.controller);
> 
> +	if (of_usb_get_phy_mode(pdev->dev.of_node) == USBPHY_INTERFACE_MODE_HSIC)
> +		writel(EHCI_INSNREG08_HSIC_EN, hcd->regs + EHCI_INSNREG(8));
> +
>  	return retval;
> 
>  fail_add_hcd:

Tested-by: Alexander Dahl <ada@thorsis.com>

Greets
Alex
diff mbox series

Patch

diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index e893467d659c..05d41fd65f25 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -18,6 +18,8 @@ 
 #include <linux/platform_device.h>
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
+#include <linux/usb/phy.h>
+#include <linux/usb/of.h>
 
 #include "ehci.h"
 
@@ -25,6 +27,9 @@ 
 
 static const char hcd_name[] = "ehci-atmel";
 
+#define EHCI_INSNREG(index)			((index) * 4 + 0x90)
+#define EHCI_INSNREG08_HSIC_EN			BIT(2)
+
 /* interface and function clocks */
 #define hcd_to_atmel_ehci_priv(h) \
 	((struct atmel_ehci_priv *)hcd_to_ehci(h)->priv)
@@ -154,6 +159,9 @@  static int ehci_atmel_drv_probe(struct platform_device *pdev)
 		goto fail_add_hcd;
 	device_wakeup_enable(hcd->self.controller);
 
+	if (of_usb_get_phy_mode(pdev->dev.of_node) == USBPHY_INTERFACE_MODE_HSIC)
+		writel(EHCI_INSNREG08_HSIC_EN, hcd->regs + EHCI_INSNREG(8));
+
 	return retval;
 
 fail_add_hcd: