Re: [PATCH] usb: chipidea: udc: first start device on pullup

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

 



On Mon, Nov 11, 2013 at 12:39:30PM +0100, Michael Grzeschik wrote:
> Don't pullup the resistors on hw_device_state. The gadget framework has
> the prepared callback for this. This is necessary if we use gadgets
> which need to be enabled after an userspace application got prepared, or
> other delayed conditiions have passed.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx>
> ---
>  drivers/usb/chipidea/udc.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
> index b34c819..976153f 100644
> --- a/drivers/usb/chipidea/udc.c
> +++ b/drivers/usb/chipidea/udc.c
> @@ -84,10 +84,8 @@ static int hw_device_state(struct ci_hdrc *ci, u32 dma)
>  		/* interrupt, error, port change, reset, sleep/suspend */
>  		hw_write(ci, OP_USBINTR, ~0,
>  			     USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI);
> -		hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
>  	} else {
>  		hw_write(ci, OP_USBINTR, ~0, 0);
> -		hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
>  	}
>  	return 0;
>  }

Hi Michael, you submitted a similar patch before to fix uvc problem,
but you can't simply delete it, it will cause the udc can't work
if we load gadget first, then plug in the usb cable.

To fix it, it is better mark that gadget as defer_connect, and
introduce such condition at udc driver.

-- 

Best Regards,
Peter Chen

--
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