Re: [PATCH v3 05/13] usb: chipidea: udc: driver update for OTG HNP.

2014-03-18 Thread Peter Chen
On Tue, Mar 18, 2014 at 10:36:17AM +0800, Peter Chen wrote:
 On Mon, Mar 17, 2014 at 01:43:05PM +0800, Li Jun wrote:
  On Wed, Mar 12, 2014 at 04:21:28PM +0800, Peter Chen wrote:
   On Wed, Mar 12, 2014 at 03:12:48PM +0800, Li Jun wrote:
On Wed, Mar 12, 2014 at 03:01:15PM +0800, Peter Chen wrote:
 On Thu, Feb 27, 2014 at 07:38:23AM +0800, Li Jun wrote:
  Add b_hnp_enable request handling and enable gadget-is_otg
  
  Signed-off-by: Li Jun b47...@freescale.com
  ---
   drivers/usb/chipidea/udc.c |   11 ++-
   1 file changed, 10 insertions(+), 1 deletion(-)
  
  diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
  index fe30dcc..602bbf3 100644
  --- a/drivers/usb/chipidea/udc.c
  +++ b/drivers/usb/chipidea/udc.c
  @@ -20,6 +20,7 @@
   #include linux/pm_runtime.h
   #include linux/usb/ch9.h
   #include linux/usb/gadget.h
  +#include linux/usb/otg-fsm.h
   #include linux/usb/chipidea.h
   
   #include ci.h
  @@ -1098,6 +1099,14 @@ __acquires(ci-lock)
  default:
  break;
  }
  +   break;
 
 This break is needed?
 

Yes, needed.
   
   Why, the case USB_DEVICE_TEST_MODE should alway break, isn't it?
   
  
  yes, I don't think the case USB_DEVICE_TEST_MODE should always fall through 
  to
  enable HNP here.
 
 The case USB_DEVICE_TEST_MODE will always break without your patch.
 

Have a look again, I was wrong, this fix is ok

Peter

 Peter
 
  

  +   case USB_DEVICE_B_HNP_ENABLE:
  +   if (gadget_is_otg(ci-gadget)) 
  {
  +   ci-gadget.b_hnp_enable 
  = 1;
  +   err = 
  isr_setup_status_phase(
  +   ci);
  +   }
  +   break;
  default:
  goto delegate;
  }
  @@ -1765,7 +1774,7 @@ static int udc_start(struct ci_hdrc *ci)
  ci-gadget.ops  = usb_gadget_ops;
  ci-gadget.speed= USB_SPEED_UNKNOWN;
  ci-gadget.max_speed= USB_SPEED_HIGH;
  -   ci-gadget.is_otg   = 0;
  +   ci-gadget.is_otg   = ci-is_otg ? 1 : 0;
  ci-gadget.name = ci-platdata-name;
   
  INIT_LIST_HEAD(ci-gadget.ep_list);
  -- 
  1.7.9.5
  
  
 
 -- 
 
 Best Regards,
 Peter Chen
 

   
   -- 
   
   Best Regards,
   Peter Chen
   
  
 
 -- 
 
 Best Regards,
 Peter Chen
 
 --
 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
 
 

-- 

Best Regards,
Peter Chen

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


Re: [PATCH v3 05/13] usb: chipidea: udc: driver update for OTG HNP.

2014-03-17 Thread Li Jun
On Wed, Mar 12, 2014 at 04:21:28PM +0800, Peter Chen wrote:
 On Wed, Mar 12, 2014 at 03:12:48PM +0800, Li Jun wrote:
  On Wed, Mar 12, 2014 at 03:01:15PM +0800, Peter Chen wrote:
   On Thu, Feb 27, 2014 at 07:38:23AM +0800, Li Jun wrote:
Add b_hnp_enable request handling and enable gadget-is_otg

Signed-off-by: Li Jun b47...@freescale.com
---
 drivers/usb/chipidea/udc.c |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index fe30dcc..602bbf3 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -20,6 +20,7 @@
 #include linux/pm_runtime.h
 #include linux/usb/ch9.h
 #include linux/usb/gadget.h
+#include linux/usb/otg-fsm.h
 #include linux/usb/chipidea.h
 
 #include ci.h
@@ -1098,6 +1099,14 @@ __acquires(ci-lock)
default:
break;
}
+   break;
   
   This break is needed?
   
  
  Yes, needed.
 
 Why, the case USB_DEVICE_TEST_MODE should alway break, isn't it?
 

yes, I don't think the case USB_DEVICE_TEST_MODE should always fall through to
enable HNP here.

  
+   case USB_DEVICE_B_HNP_ENABLE:
+   if (gadget_is_otg(ci-gadget)) 
{
+   ci-gadget.b_hnp_enable 
= 1;
+   err = 
isr_setup_status_phase(
+   ci);
+   }
+   break;
default:
goto delegate;
}
@@ -1765,7 +1774,7 @@ static int udc_start(struct ci_hdrc *ci)
ci-gadget.ops  = usb_gadget_ops;
ci-gadget.speed= USB_SPEED_UNKNOWN;
ci-gadget.max_speed= USB_SPEED_HIGH;
-   ci-gadget.is_otg   = 0;
+   ci-gadget.is_otg   = ci-is_otg ? 1 : 0;
ci-gadget.name = ci-platdata-name;
 
INIT_LIST_HEAD(ci-gadget.ep_list);
-- 
1.7.9.5


   
   -- 
   
   Best Regards,
   Peter Chen
   
  
 
 -- 
 
 Best Regards,
 Peter Chen
 

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


Re: [PATCH v3 05/13] usb: chipidea: udc: driver update for OTG HNP.

2014-03-17 Thread Peter Chen
On Mon, Mar 17, 2014 at 01:43:05PM +0800, Li Jun wrote:
 On Wed, Mar 12, 2014 at 04:21:28PM +0800, Peter Chen wrote:
  On Wed, Mar 12, 2014 at 03:12:48PM +0800, Li Jun wrote:
   On Wed, Mar 12, 2014 at 03:01:15PM +0800, Peter Chen wrote:
On Thu, Feb 27, 2014 at 07:38:23AM +0800, Li Jun wrote:
 Add b_hnp_enable request handling and enable gadget-is_otg
 
 Signed-off-by: Li Jun b47...@freescale.com
 ---
  drivers/usb/chipidea/udc.c |   11 ++-
  1 file changed, 10 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
 index fe30dcc..602bbf3 100644
 --- a/drivers/usb/chipidea/udc.c
 +++ b/drivers/usb/chipidea/udc.c
 @@ -20,6 +20,7 @@
  #include linux/pm_runtime.h
  #include linux/usb/ch9.h
  #include linux/usb/gadget.h
 +#include linux/usb/otg-fsm.h
  #include linux/usb/chipidea.h
  
  #include ci.h
 @@ -1098,6 +1099,14 @@ __acquires(ci-lock)
   default:
   break;
   }
 + break;

This break is needed?

   
   Yes, needed.
  
  Why, the case USB_DEVICE_TEST_MODE should alway break, isn't it?
  
 
 yes, I don't think the case USB_DEVICE_TEST_MODE should always fall through to
 enable HNP here.

The case USB_DEVICE_TEST_MODE will always break without your patch.

Peter

 
   
 + case USB_DEVICE_B_HNP_ENABLE:
 + if (gadget_is_otg(ci-gadget)) 
 {
 + ci-gadget.b_hnp_enable 
 = 1;
 + err = 
 isr_setup_status_phase(
 + ci);
 + }
 + break;
   default:
   goto delegate;
   }
 @@ -1765,7 +1774,7 @@ static int udc_start(struct ci_hdrc *ci)
   ci-gadget.ops  = usb_gadget_ops;
   ci-gadget.speed= USB_SPEED_UNKNOWN;
   ci-gadget.max_speed= USB_SPEED_HIGH;
 - ci-gadget.is_otg   = 0;
 + ci-gadget.is_otg   = ci-is_otg ? 1 : 0;
   ci-gadget.name = ci-platdata-name;
  
   INIT_LIST_HEAD(ci-gadget.ep_list);
 -- 
 1.7.9.5
 
 

-- 

Best Regards,
Peter Chen

   
  
  -- 
  
  Best Regards,
  Peter Chen
  
 

-- 

Best Regards,
Peter Chen

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


Re: [PATCH v3 05/13] usb: chipidea: udc: driver update for OTG HNP.

2014-03-12 Thread Peter Chen
On Thu, Feb 27, 2014 at 07:38:23AM +0800, Li Jun wrote:
 Add b_hnp_enable request handling and enable gadget-is_otg
 
 Signed-off-by: Li Jun b47...@freescale.com
 ---
  drivers/usb/chipidea/udc.c |   11 ++-
  1 file changed, 10 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
 index fe30dcc..602bbf3 100644
 --- a/drivers/usb/chipidea/udc.c
 +++ b/drivers/usb/chipidea/udc.c
 @@ -20,6 +20,7 @@
  #include linux/pm_runtime.h
  #include linux/usb/ch9.h
  #include linux/usb/gadget.h
 +#include linux/usb/otg-fsm.h
  #include linux/usb/chipidea.h
  
  #include ci.h
 @@ -1098,6 +1099,14 @@ __acquires(ci-lock)
   default:
   break;
   }
 + break;

This break is needed?

 + case USB_DEVICE_B_HNP_ENABLE:
 + if (gadget_is_otg(ci-gadget)) {
 + ci-gadget.b_hnp_enable = 1;
 + err = isr_setup_status_phase(
 + ci);
 + }
 + break;
   default:
   goto delegate;
   }
 @@ -1765,7 +1774,7 @@ static int udc_start(struct ci_hdrc *ci)
   ci-gadget.ops  = usb_gadget_ops;
   ci-gadget.speed= USB_SPEED_UNKNOWN;
   ci-gadget.max_speed= USB_SPEED_HIGH;
 - ci-gadget.is_otg   = 0;
 + ci-gadget.is_otg   = ci-is_otg ? 1 : 0;
   ci-gadget.name = ci-platdata-name;
  
   INIT_LIST_HEAD(ci-gadget.ep_list);
 -- 
 1.7.9.5
 
 

-- 

Best Regards,
Peter Chen

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


Re: [PATCH v3 05/13] usb: chipidea: udc: driver update for OTG HNP.

2014-03-12 Thread Li Jun
On Wed, Mar 12, 2014 at 03:01:15PM +0800, Peter Chen wrote:
 On Thu, Feb 27, 2014 at 07:38:23AM +0800, Li Jun wrote:
  Add b_hnp_enable request handling and enable gadget-is_otg
  
  Signed-off-by: Li Jun b47...@freescale.com
  ---
   drivers/usb/chipidea/udc.c |   11 ++-
   1 file changed, 10 insertions(+), 1 deletion(-)
  
  diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
  index fe30dcc..602bbf3 100644
  --- a/drivers/usb/chipidea/udc.c
  +++ b/drivers/usb/chipidea/udc.c
  @@ -20,6 +20,7 @@
   #include linux/pm_runtime.h
   #include linux/usb/ch9.h
   #include linux/usb/gadget.h
  +#include linux/usb/otg-fsm.h
   #include linux/usb/chipidea.h
   
   #include ci.h
  @@ -1098,6 +1099,14 @@ __acquires(ci-lock)
  default:
  break;
  }
  +   break;
 
 This break is needed?
 

Yes, needed.

  +   case USB_DEVICE_B_HNP_ENABLE:
  +   if (gadget_is_otg(ci-gadget)) {
  +   ci-gadget.b_hnp_enable = 1;
  +   err = isr_setup_status_phase(
  +   ci);
  +   }
  +   break;
  default:
  goto delegate;
  }
  @@ -1765,7 +1774,7 @@ static int udc_start(struct ci_hdrc *ci)
  ci-gadget.ops  = usb_gadget_ops;
  ci-gadget.speed= USB_SPEED_UNKNOWN;
  ci-gadget.max_speed= USB_SPEED_HIGH;
  -   ci-gadget.is_otg   = 0;
  +   ci-gadget.is_otg   = ci-is_otg ? 1 : 0;
  ci-gadget.name = ci-platdata-name;
   
  INIT_LIST_HEAD(ci-gadget.ep_list);
  -- 
  1.7.9.5
  
  
 
 -- 
 
 Best Regards,
 Peter Chen
 

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


Re: [PATCH v3 05/13] usb: chipidea: udc: driver update for OTG HNP.

2014-03-12 Thread Peter Chen
On Wed, Mar 12, 2014 at 03:12:48PM +0800, Li Jun wrote:
 On Wed, Mar 12, 2014 at 03:01:15PM +0800, Peter Chen wrote:
  On Thu, Feb 27, 2014 at 07:38:23AM +0800, Li Jun wrote:
   Add b_hnp_enable request handling and enable gadget-is_otg
   
   Signed-off-by: Li Jun b47...@freescale.com
   ---
drivers/usb/chipidea/udc.c |   11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
   
   diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
   index fe30dcc..602bbf3 100644
   --- a/drivers/usb/chipidea/udc.c
   +++ b/drivers/usb/chipidea/udc.c
   @@ -20,6 +20,7 @@
#include linux/pm_runtime.h
#include linux/usb/ch9.h
#include linux/usb/gadget.h
   +#include linux/usb/otg-fsm.h
#include linux/usb/chipidea.h

#include ci.h
   @@ -1098,6 +1099,14 @@ __acquires(ci-lock)
 default:
 break;
 }
   + break;
  
  This break is needed?
  
 
 Yes, needed.

Why, the case USB_DEVICE_TEST_MODE should alway break, isn't it?

 
   + case USB_DEVICE_B_HNP_ENABLE:
   + if (gadget_is_otg(ci-gadget)) {
   + ci-gadget.b_hnp_enable = 1;
   + err = isr_setup_status_phase(
   + ci);
   + }
   + break;
 default:
 goto delegate;
 }
   @@ -1765,7 +1774,7 @@ static int udc_start(struct ci_hdrc *ci)
 ci-gadget.ops  = usb_gadget_ops;
 ci-gadget.speed= USB_SPEED_UNKNOWN;
 ci-gadget.max_speed= USB_SPEED_HIGH;
   - ci-gadget.is_otg   = 0;
   + ci-gadget.is_otg   = ci-is_otg ? 1 : 0;
 ci-gadget.name = ci-platdata-name;

 INIT_LIST_HEAD(ci-gadget.ep_list);
   -- 
   1.7.9.5
   
   
  
  -- 
  
  Best Regards,
  Peter Chen
  
 

-- 

Best Regards,
Peter Chen

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


[PATCH v3 05/13] usb: chipidea: udc: driver update for OTG HNP.

2014-02-26 Thread Li Jun
Add b_hnp_enable request handling and enable gadget-is_otg

Signed-off-by: Li Jun b47...@freescale.com
---
 drivers/usb/chipidea/udc.c |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index fe30dcc..602bbf3 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -20,6 +20,7 @@
 #include linux/pm_runtime.h
 #include linux/usb/ch9.h
 #include linux/usb/gadget.h
+#include linux/usb/otg-fsm.h
 #include linux/usb/chipidea.h
 
 #include ci.h
@@ -1098,6 +1099,14 @@ __acquires(ci-lock)
default:
break;
}
+   break;
+   case USB_DEVICE_B_HNP_ENABLE:
+   if (gadget_is_otg(ci-gadget)) {
+   ci-gadget.b_hnp_enable = 1;
+   err = isr_setup_status_phase(
+   ci);
+   }
+   break;
default:
goto delegate;
}
@@ -1765,7 +1774,7 @@ static int udc_start(struct ci_hdrc *ci)
ci-gadget.ops  = usb_gadget_ops;
ci-gadget.speed= USB_SPEED_UNKNOWN;
ci-gadget.max_speed= USB_SPEED_HIGH;
-   ci-gadget.is_otg   = 0;
+   ci-gadget.is_otg   = ci-is_otg ? 1 : 0;
ci-gadget.name = ci-platdata-name;
 
INIT_LIST_HEAD(ci-gadget.ep_list);
-- 
1.7.9.5


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