diff mbox series

[v2,13/32] pci: usb: Drop DM_PCI from ohci

Message ID 20210802005446.2267075-14-sjg@chromium.org
State Accepted
Delegated to: Tom Rini
Headers show
Series pci: Drop all pre-driver model code | expand

Commit Message

Simon Glass Aug. 2, 2021, 12:54 a.m. UTC
Now that DM_PCI is always enabled we don't need to check it. Drop this
old condition and update the comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 drivers/usb/host/ohci-hcd.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

Comments

Tom Rini Aug. 5, 2021, 11:44 p.m. UTC | #1
On Sun, Aug 01, 2021 at 06:54:26PM -0600, Simon Glass wrote:

> Now that DM_PCI is always enabled we don't need to check it. Drop this
> old condition and update the comment.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
> (no changes since v1)
> 
>  drivers/usb/host/ohci-hcd.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
> index c62d8feecce..7fa84f8bbe4 100644
> --- a/drivers/usb/host/ohci-hcd.c
> +++ b/drivers/usb/host/ohci-hcd.c
> @@ -52,13 +52,6 @@
>  #include <asm/arch/hardware.h>	/* needed for AT91_USB_HOST_BASE */
>  #endif
>  
> -#if defined(CONFIG_CPU_ARM920T) || \
> -	defined(CONFIG_PCI_OHCI) || \
> -	defined(CONFIG_DM_PCI) || \
> -	defined(CONFIG_SYS_OHCI_USE_NPS)
> -# define OHCI_USE_NPS		/* force NoPowerSwitching mode */
> -#endif
> -
>  #undef OHCI_VERBOSE_DEBUG	/* not always helpful */
>  #undef DEBUG
>  #undef SHOW_INFO
> @@ -1885,12 +1878,14 @@ static int hc_start(ohci_t *ohci)
>  	mask = OHCI_INTR_RHSC | OHCI_INTR_UE | OHCI_INTR_WDH | OHCI_INTR_SO;
>  	ohci_writel(mask, &ohci->regs->intrenable);
>  
> -#ifdef	OHCI_USE_NPS
> -	/* required for AMD-756 and some Mac platforms */
> +	/*
> +	 * required for AMD-756 and some Mac platforms
> +	 * Note: this is always enabled at present, since driver model is used
> +	 * for PCI
> +	 */
>  	ohci_writel((roothub_a(ohci) | RH_A_NPS) & ~RH_A_PSM,
>  		&ohci->regs->roothub.a);
>  	ohci_writel(RH_HS_LPSC, &ohci->regs->roothub.status);
> -#endif	/* OHCI_USE_NPS */
>  
>  	/* connect the virtual root hub */
>  	ohci->rh.devnum = 0;

This is slightly wrong.  We have non-PCI OHCI users, so the check needs
to change from CONFIG_DM_PCI to CONFIG_PCI.  I'll fix this up.
Tom Rini Aug. 6, 2021, 9:21 p.m. UTC | #2
On Sun, Aug 01, 2021 at 06:54:26PM -0600, Simon Glass wrote:

> Now that DM_PCI is always enabled we don't need to check it. Drop this
> old condition and update the comment.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

With the fix I noted, applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index c62d8feecce..7fa84f8bbe4 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -52,13 +52,6 @@ 
 #include <asm/arch/hardware.h>	/* needed for AT91_USB_HOST_BASE */
 #endif
 
-#if defined(CONFIG_CPU_ARM920T) || \
-	defined(CONFIG_PCI_OHCI) || \
-	defined(CONFIG_DM_PCI) || \
-	defined(CONFIG_SYS_OHCI_USE_NPS)
-# define OHCI_USE_NPS		/* force NoPowerSwitching mode */
-#endif
-
 #undef OHCI_VERBOSE_DEBUG	/* not always helpful */
 #undef DEBUG
 #undef SHOW_INFO
@@ -1885,12 +1878,14 @@  static int hc_start(ohci_t *ohci)
 	mask = OHCI_INTR_RHSC | OHCI_INTR_UE | OHCI_INTR_WDH | OHCI_INTR_SO;
 	ohci_writel(mask, &ohci->regs->intrenable);
 
-#ifdef	OHCI_USE_NPS
-	/* required for AMD-756 and some Mac platforms */
+	/*
+	 * required for AMD-756 and some Mac platforms
+	 * Note: this is always enabled at present, since driver model is used
+	 * for PCI
+	 */
 	ohci_writel((roothub_a(ohci) | RH_A_NPS) & ~RH_A_PSM,
 		&ohci->regs->roothub.a);
 	ohci_writel(RH_HS_LPSC, &ohci->regs->roothub.status);
-#endif	/* OHCI_USE_NPS */
 
 	/* connect the virtual root hub */
 	ohci->rh.devnum = 0;