Re: [RFC/PATCH 2/4] merge hostpc reset in tdi_reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matthieu CASTET <matthieu.castet@xxxxxxxxxx> writes:

> Signed-off-by: Matthieu CASTET <matthieu.castet@xxxxxxxxxx>

Again, FWIW,

Reviewed-by: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>

> ---
>  drivers/usb/host/ehci-hcd.c |   22 ++++++++++++++--------
>  1 file changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> index 8cc2cf3..2149583 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -206,7 +206,10 @@ static int tdi_in_host_mode (struct ehci_hcd *ehci)
>  	u32 __iomem	*reg_ptr;
>  	u32		tmp;
>  
> -	reg_ptr = (u32 __iomem *)(((u8 __iomem *)ehci->regs) + USBMODE);
> +	if (ehci->has_hostpc)
> +		reg_ptr = (u32 __iomem *)(((u8 __iomem *)ehci->regs) + USBMODE_EX);
> +	else
> +		reg_ptr = (u32 __iomem *)(((u8 __iomem *)ehci->regs) + USBMODE);
>  	tmp = ehci_readl(ehci, reg_ptr);
>  	return (tmp & 3) == USBMODE_CM_HC;
>  }
> @@ -301,7 +304,10 @@ static void tdi_reset (struct ehci_hcd *ehci)
>  	u32 __iomem	*reg_ptr;
>  	u32		tmp;
>  
> -	reg_ptr = (u32 __iomem *)(((u8 __iomem *)ehci->regs) + USBMODE);
> +	if (ehci->has_hostpc)
> +		reg_ptr = (u32 __iomem *)(((u8 __iomem *)ehci->regs) + USBMODE_EX);
> +	else
> +		reg_ptr = (u32 __iomem *)(((u8 __iomem *)ehci->regs) + USBMODE);
>  	tmp = ehci_readl(ehci, reg_ptr);
>  	tmp |= USBMODE_CM_HC;
>  	/* The default byte access to MMR space is LE after
> @@ -310,6 +316,12 @@ static void tdi_reset (struct ehci_hcd *ehci)
>  	 */
>  	if (ehci_big_endian_mmio(ehci))
>  		tmp |= USBMODE_BE;
> +	if (ehci->has_hostpc) {
> +		tmp |= USBMODE_EX_VBPS;
> +		ehci_writel(ehci, TXFIFO_DEFAULT,
> +			(u32 __iomem *)(((u8 *)ehci->regs) + TXFILLTUNING));
> +	}
> +
>  	ehci_writel(ehci, tmp, reg_ptr);
>  }
>  
> @@ -332,12 +344,6 @@ static int ehci_reset (struct ehci_hcd *ehci)
>  	retval = handshake (ehci, &ehci->regs->command,
>  			    CMD_RESET, 0, 250 * 1000);
>  
> -	if (ehci->has_hostpc) {
> -		ehci_writel(ehci, USBMODE_EX_HC | USBMODE_EX_VBPS,
> -			(u32 __iomem *)(((u8 *)ehci->regs) + USBMODE_EX));
> -		ehci_writel(ehci, TXFIFO_DEFAULT,
> -			(u32 __iomem *)(((u8 *)ehci->regs) + TXFILLTUNING));
> -	}
>  	if (retval)
>  		return retval;
>  
> -- 
> 1.7.10
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux