Re: [PATCH] [RFC] usb: dwc2: Run the core connect in dwc2_hcd_init()

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

 



Hi,

On 4/13/2020 6:31 PM, Marek Vasut wrote:
> On STM32MP1 without the STUSB1600 USB-C chip (i.e. with plain USB-OTG

Could you please provide GSNPSID, GHWCFG1-4 register values for STM32MP1.

> micro-B plug with ID and VBUS detection), the USB OTG port only works
> if a micro-B device (e.g. a USB stick) is plugged in first. Once this
> is done, both micro-B device and host (e.g. a PC via a USB A-to-microB
> cable) are correctly detected and recognized. If a USB host is plugged
> in first (e.g. a PC), then the PC does not detect the STM32MP1 at all.
> 
> By running the core connect code in dwc2_hcd_init(), both device and
> host are detected and the USB works as expected. However, it is not
> clear whether this is the correct solution.
> 
> Signed-off-by: Marek Vasut <marex@xxxxxxx>
> Cc: Amelie Delaunay <amelie.delaunay@xxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Cc: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
> Cc: Minas Harutyunyan <hminas@xxxxxxxxxxxx>
> To: linux-usb@xxxxxxxxxxxxxxx
> ---
>   drivers/usb/dwc2/hcd.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
> index b90f858af960..ead605efeb24 100644
> --- a/drivers/usb/dwc2/hcd.c
> +++ b/drivers/usb/dwc2/hcd.c
> @@ -5237,6 +5237,11 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg)
>   
>   	dwc2_enable_global_interrupts(hsotg);
>   
> +	dwc2_hsotg_core_init_disconnected(hsotg, false);
> +	/* Enable ACG feature in device mode,if supported */
> +	dwc2_enable_acg(hsotg);
> +	dwc2_hsotg_core_connect(hsotg);
> +
>   	return 0;
>   
>   error4:
> 

Thanks,
Minas




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

  Powered by Linux