Re: [PATCH V2] usb/dwc3: Send DEPCFG with "Config Action: Modify" after conndone

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

 



Hi,

On Tue, Aug 07, 2012 at 09:33:42AM +0530, Pratyush Anand wrote:
> From: Pratyush ANAND <pratyush.anand@xxxxxx>
> 
> For core 1.94A and latter, specification says to issue DEPCFG with
> "Config Action: Modify" for physical endpoint 0/1.
> 
> Signed-off-by: Pratyush Anand <pratyush.anand@xxxxxx>
> ---
>  drivers/usb/dwc3/gadget.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 0ead4cd..e582a10 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -442,8 +442,12 @@ static int dwc3_gadget_set_ep_config(struct dwc3 *dwc, struct dwc3_ep *dep,
>  		| DWC3_DEPCFG_MAX_PACKET_SIZE(usb_endpoint_maxp(desc))
>  		| DWC3_DEPCFG_BURST_SIZE(dep->endpoint.maxburst);
>  
> -	if (ignore)
> -		params.param0 |= DWC3_DEPCFG_IGN_SEQ_NUM;
> +	if (ignore) {
> +		if (dwc->revision < DWC3_REVISION_194A)
> +			params.param0 |= DWC3_DEPCFG_IGN_SEQ_NUM;
> +		else
> +			params.param0 |= DWC3_DEPCFG_ACTION_MODIFY;
> +	}

This can be done, indeed. But the modify action is backwards compatible
with ignore sequence number, so I wonder if this patch alone, as it is,
is valid or not.

Without adding support for Hibernation feature, which would make use
of the Get Endpoint Configuration command, and thus supporting
Initialize and Restore endpoint configuration actions, I don't see the
need for this patch.

If you want to work on Hibernation and add proper support for those
other two actions, that's great. But just make sure you check if the
version you're running actually supports hibernation.

Anyway, the driver as it is today, will work fine with all versions of
the core WRT endpoint initialization.

-- 
balbi

Attachment: signature.asc
Description: Digital signature


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

  Powered by Linux