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

2012-08-07 Thread Felipe Balbi
Hi,

On Tue, Aug 07, 2012 at 09:33:42AM +0530, Pratyush Anand wrote:
 From: Pratyush ANAND pratyush.an...@st.com
 
 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.an...@st.com
 ---
  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


signature.asc
Description: Digital signature


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

2012-08-06 Thread Pratyush Anand
From: Pratyush ANAND pratyush.an...@st.com

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.an...@st.com
---
 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;
+   }
 
params.param1 = DWC3_DEPCFG_XFER_COMPLETE_EN
| DWC3_DEPCFG_XFER_NOT_READY_EN;
-- 
1.7.5.4

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html