Re: [RFC][PATCH 3/9] usb: otg: add OTG core

2015-03-19 Thread Li Jun
UM_OTG_FSM_TIMERS]; > + > + bool fsm_running; > + bool gadget_can_start; /* OTG FSM says gadget can start */ > + bool host_can_start;/* OTG FSM says host can start */ Do not understand above 2 *_can_start flags from the patch, which are set only when you reall

[PATCH v4 0/8] add HNP polling support for usb otg fsm

2015-03-18 Thread Li Jun
river to usb-otg-fsm.c to make it more generically, then HNP polling can be fully handled by otg fsm driver. - Add comments for host_request_flag in patch: usb: gadget: add host_requestf_flag in usb_gadget for OTG HNP Li Jun (8): usb: gadget: add hnp_polling_support and host_request_fl

[PATCH v4 3/8] usb: common: otg-fsm: add HNP polling support

2015-03-18 Thread Li Jun
Adds HNP polling timer when transits to host state, the OTG status request will be sent to peripheral after timeout, if host request flag is set, it will switch to peripheral state, otherwise it will repeat HNP polling every 1.5s and maintain the current session. Signed-off-by: Li Jun

[PATCH v4 5/8] usb: gadget: composite: handle otg status selector request from OTG host

2015-03-18 Thread Li Jun
If gadget with HNP polling support receives GetStatus request of otg status selector, it feedback to host with host request flag to indicate if it wants to take host role. Acked-by: Peter Chen Signed-off-by: Li Jun --- drivers/usb/gadget/composite.c | 25 + 1 file

[PATCH v4 1/8] usb: gadget: add hnp_polling_support and host_request_flag in usb_gadget

2015-03-18 Thread Li Jun
From: Li Jun Add 2 flags for USB OTG HNP polling, hnp_polling_support is to indicate if the gadget can support HNP polling, host_request_flag is used for gadget to store host request information from application, which can be used to respond to HNP polling from host. Acked-by: Peter Chen

[PATCH v4 8/8] Documentation: usb: chipidea: Update test procedure for HNP polling

2015-03-18 Thread Li Jun
From: Li Jun Update HNP test procedure as HNP polling is supported. Signed-off-by: Li Jun --- Documentation/usb/chipidea.txt | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Documentation/usb/chipidea.txt b/Documentation/usb/chipidea.txt index 3f848c1..ff965b2

[PATCH v4 4/8] usb: chipidea: udc: bypass otg status selector request handling to gadget driver

2015-03-18 Thread Li Jun
Since gadget driver will handle this request, so controller driver bypass it. Acked-by: Peter Chen Signed-off-by: Li Jun --- drivers/usb/chipidea/udc.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 4254792

[PATCH v4 2/8] usb: add OTG status selector definition for HNP polling

2015-03-18 Thread Li Jun
A host is required to use the GetStatus command, with wIndex set to the OTG status selector(F000H) to request the host request flag from the peripheral. Acked-by: Peter Chen Signed-off-by: Li Jun --- include/uapi/linux/usb/ch9.h |2 ++ 1 file changed, 2 insertions(+) diff --git a/include

[PATCH v4 6/8] usb: chipidea: otg: set host_request_flag for gadget

2015-03-18 Thread Li Jun
Set host_request_flag if the current peripheral wants to take host role via setting a_bus_req or b_bus_req by user application. Acked-by: Peter Chen Signed-off-by: Li Jun --- drivers/usb/chipidea/otg_fsm.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a

[PATCH v4 7/8] usb: chipidea: otg: enable HNP polling support for gadget

2015-03-18 Thread Li Jun
Enable HNP polling support for chipidea gadget when otg fsm init. Acked-by: Peter Chen Signed-off-by: Li Jun --- drivers/usb/chipidea/otg_fsm.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c index 2ec90dc..82b1e23 100644

Re: [PATCH v3 8/8] Documentation: usb: chipidea: Update test procedure for HNP polling

2015-03-18 Thread Li Jun
On Thu, Mar 19, 2015 at 08:00:35AM +0800, Peter Chen wrote: > On Wed, Mar 18, 2015 at 05:57:32PM +0800, Li Jun wrote: > > On Wed, Mar 18, 2015 at 01:54:40PM +0800, Peter Chen wrote: > > > On Tue, Mar 17, 2015 at 10:37:52PM +0800, Li Jun wrote: > > > > From: Li Jun &g

Re: [PATCH v3 8/8] Documentation: usb: chipidea: Update test procedure for HNP polling

2015-03-18 Thread Li Jun
On Wed, Mar 18, 2015 at 01:54:40PM +0800, Peter Chen wrote: > On Tue, Mar 17, 2015 at 10:37:52PM +0800, Li Jun wrote: > > From: Li Jun > > > > Update HNP test procedure as HNP polling is supported. > > > > Signed-off-by: Li Jun > > --- >

[PATCH v4 3/8] usb: common: otg-fsm: add HNP polling support

2015-03-18 Thread Li Jun
Adds HNP polling timer when transits to host state, the OTG status request will be sent to peripheral after timeout, if host request flag is set, it will switch to peripheral state, otherwise it will repeat HNP polling every 1.5s and maintain the current session. Signed-off-by: Li Jun Change

Re: [PATCH v3 5/8] usb: gadget: composite: handle otg status selector request from OTG host

2015-03-18 Thread Li Jun
On Wed, Mar 18, 2015 at 01:44:11PM +0800, Peter Chen wrote: > On Tue, Mar 17, 2015 at 10:37:49PM +0800, Li Jun wrote: > > If gadget with HNP polling support receives GetStatus request of otg status > > selector, it feedback to host with host request flag to indicate if it wants &

Re: [PATCH v3 3/8] usb: common: otg-fsm: add HNP polling support

2015-03-18 Thread Li Jun
On Wed, Mar 18, 2015 at 01:36:13PM +0800, Peter Chen wrote: > On Tue, Mar 17, 2015 at 10:37:47PM +0800, Li Jun wrote: > > Adds HNP polling timer when transits to host state, the OTG status request > > will be sent to peripheral after timeout, if host request flag is set, it > &g

[PATCH v3 2/8] usb: add OTG status selector definition for HNP polling

2015-03-17 Thread Li Jun
A host is required to use the GetStatus command, with wIndex set to the OTG status selector(F000H) to request the Host request flag from the peripheral. Signed-off-by: Li Jun --- include/uapi/linux/usb/ch9.h |2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/usb/ch9.h b

[PATCH v3 1/8] usb: gadget: add hnp_polling_support and host_request_flag in usb_gadget

2015-03-17 Thread Li Jun
From: Li Jun Add 2 flags for USB OTG HNP polling, hnp_polling_support is to indicate if the gadget can support HNP polling, host_request_flag is used for gadget to store host request information from application, which can be used to respond to HNP polling from host. Signed-off-by: Li Jun

[PATCH v3 8/8] Documentation: usb: chipidea: Update test procedure for HNP polling

2015-03-17 Thread Li Jun
From: Li Jun Update HNP test procedure as HNP polling is supported. Signed-off-by: Li Jun --- Documentation/usb/chipidea.txt |9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Documentation/usb/chipidea.txt b/Documentation/usb/chipidea.txt index 3f848c1..95d9170

[PATCH v3 7/8] usb: chipidea: otg: enable HNP polling support for gadget

2015-03-17 Thread Li Jun
Enable HNP polling support for chipidea gadget when otg fsm init. Signed-off-by: Li Jun --- drivers/usb/chipidea/otg_fsm.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c index 2ec90dc..82b1e23 100644 --- a/drivers/usb

[PATCH v3 0/8] add HNP polling support for usb otg fsm

2015-03-17 Thread Li Jun
polling timer from chipidea controller driver to usb-otg-fsm.c to make it more generically, then HNP polling can be fully handled by otg fsm driver. - Add comments for host_request_flag in patch: usb: gadget: add host_requestf_flag in usb_gadget for OTG HNP Li Jun (8): usb: gadget: add

[PATCH v3 5/8] usb: gadget: composite: handle otg status selector request from OTG host

2015-03-17 Thread Li Jun
If gadget with HNP polling support receives GetStatus request of otg status selector, it feedback to host with host request flag to indicate if it wants to take host role. Signed-off-by: Li Jun --- drivers/usb/gadget/composite.c | 25 + 1 file changed, 17 insertions

[PATCH v3 4/8] usb: chipidea: udc: bypass otg status selector request handling to gadget driver

2015-03-17 Thread Li Jun
Since gadget driver will handle this request, so controller driver bypass it. Signed-off-by: Li Jun --- drivers/usb/chipidea/udc.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 4254792..a65cdaf 100644 --- a

[PATCH v3 3/8] usb: common: otg-fsm: add HNP polling support

2015-03-17 Thread Li Jun
Adds HNP polling timer when transits to host state, the OTG status request will be sent to peripheral after timeout, if host request flag is set, it will switch to peripheral state, otherwise it will repeat HNP polling every 1.5s and maintain the current session. Signed-off-by: Li Jun

[PATCH v3 6/8] usb: chipidea: otg: set host_request_flag for gadget

2015-03-17 Thread Li Jun
Set host_request_flag if the current peripheral wants to take host role via changing a_bus_req or b_bus_req by user application. Signed-off-by: Li Jun --- drivers/usb/chipidea/otg_fsm.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/usb/chipidea

Re: [PATCH v2 2/5] usb: chipidea: udc: add OTG status request handling

2015-03-17 Thread Li Jun
On Tue, Mar 17, 2015 at 10:06:44AM +0800, Peter Chen wrote: > On Mon, Mar 16, 2015 at 12:21:53PM -0500, Felipe Balbi wrote: > > On Mon, Mar 16, 2015 at 05:34:43PM +0800, Li Jun wrote: > > > On Mon, Mar 16, 2015 at 05:03:17PM +0800, Peter Chen wrote: > > > > On Mon, Ma

Re: [PATCH v2 2/5] usb: chipidea: udc: add OTG status request handling

2015-03-16 Thread Li Jun
On Mon, Mar 16, 2015 at 05:03:17PM +0800, Peter Chen wrote: > On Mon, Mar 16, 2015 at 04:15:22PM +0800, Li Jun wrote: > > On Mon, Mar 16, 2015 at 09:44:30AM +0800, Peter Chen wrote: > > > On Fri, Mar 13, 2015 at 10:34:59AM -0500, Felipe Balbi wrote: > > > > On Fri, Ma

Re: [PATCH v2 2/5] usb: chipidea: udc: add OTG status request handling

2015-03-16 Thread Li Jun
On Mon, Mar 16, 2015 at 05:03:17PM +0800, Peter Chen wrote: > On Mon, Mar 16, 2015 at 04:15:22PM +0800, Li Jun wrote: > > On Mon, Mar 16, 2015 at 09:44:30AM +0800, Peter Chen wrote: > > > On Fri, Mar 13, 2015 at 10:34:59AM -0500, Felipe Balbi wrote: > > > > On Fri, Ma

Re: [PATCH v2 2/5] usb: chipidea: udc: add OTG status request handling

2015-03-16 Thread Li Jun
eet the recommended sequence in OTG and EH spec 2.0. So, either we add a new flag for it, or we just do this without flag check(allow an OTG device response to HNP polling with 0 even it actually does not support HNP polling, which is harmless from what I can see). Li Jun > -- > > Bes

Re: [PATCH v2 4/5] usb: common: otg-fsm: add HNP polling support

2015-03-13 Thread Li Jun
On Thu, Mar 12, 2015 at 11:06:28AM -0500, Felipe Balbi wrote: > On Thu, Mar 12, 2015 at 10:30:23AM +0800, Li Jun wrote: > > Adds HNP polling timer when transits to host state, the OTG status request > > will be sent to peripheral after timeout, if host request flag is set, it >

Re: [PATCH v2 2/5] usb: chipidea: udc: add OTG status request handling

2015-03-13 Thread Li Jun
On Fri, Mar 13, 2015 at 11:01:47AM +0800, Peter Chen wrote: > On Thu, Mar 12, 2015 at 10:30:21AM +0800, Li Jun wrote: > > From: Li Jun > > > > Peripheral answers OTG status selector request from host according to > > host_request_flag of gadget, length is 1. >

[PATCH v2 5/5] Documentation: usb: chipidea: Update test procedure for HNP polling

2015-03-11 Thread Li Jun
From: Li Jun Update HNP test procedure as HNP polling is supported. Signed-off-by: Li Jun --- Documentation/usb/chipidea.txt |9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Documentation/usb/chipidea.txt b/Documentation/usb/chipidea.txt index 3f848c1..95d9170

[PATCH v2 4/5] usb: common: otg-fsm: add HNP polling support

2015-03-11 Thread Li Jun
Adds HNP polling timer when transits to host state, the OTG status request will be sent to peripheral after timeout, if host request flag is set, it will switch to peripheral state, otherwise it will repeat HNP polling every 1.5s and maintain the current session. Signed-off-by: Li Jun

[PATCH v2 3/5] usb: chipidea: otg: set host_request_flag for gadget

2015-03-11 Thread Li Jun
Set host_request_flag if the current peripheral wants to take host role via changing a_bus_req or b_bus_req by user application. Signed-off-by: Li Jun --- drivers/usb/chipidea/otg_fsm.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/usb/chipidea

[PATCH v2 1/5] usb: gadget: add host_requestf_flag in usb_gadget for OTG HNP

2015-03-11 Thread Li Jun
From: Li Jun Adds host_request_flag for gadget to store host request information from application, which can be used to response to HNP polling from host. Signed-off-by: Li Jun --- include/linux/usb/gadget.h |3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/usb/gadget.h

[PATCH v2 2/5] usb: chipidea: udc: add OTG status request handling

2015-03-11 Thread Li Jun
From: Li Jun Peripheral answers OTG status selector request from host according to host_request_flag of gadget, length is 1. Signed-off-by: Li Jun --- drivers/usb/chipidea/udc.c | 28 +++- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/drivers/usb

[PATCH v2 0/5] add HNP polling support for usb otg fsm

2015-03-11 Thread Li Jun
host_request_flag in patch: usb: gadget: add host_requestf_flag in usb_gadget for OTG HNP Li Jun (5): usb: gadget: add host_requestf_flag in usb_gadget for OTG HNP usb: chipidea: udc: add OTG status request handling usb: chipidea: otg: set host_request_flag for gadget usb: common: otg-fsm: add HNP

Re: [PATCH 5/7] usb: chipidea: otg_fsm: add HNP polling support

2015-03-10 Thread Li Jun
On Tue, Mar 10, 2015 at 03:46:31PM -0500, Felipe Balbi wrote: > On Mon, Mar 09, 2015 at 10:09:21AM +0800, Li Jun wrote: > > From: Li Jun > > > > Add a dedicataed normal timer for HNP polling since it's cyclical, while > > in peripheral mode, change a/b_bus_r

Re: [PATCH 5/7] usb: chipidea: otg_fsm: add HNP polling support

2015-03-10 Thread Li Jun
On Mon, Mar 09, 2015 at 03:52:35PM +0800, Peter Chen wrote: > On Mon, Mar 09, 2015 at 10:09:21AM +0800, Li Jun wrote: > > From: Li Jun > > > > Add a dedicataed normal timer for HNP polling since it's cyclical, while > > in peripheral mode, change a/b_bus_req to b

[PATCH 3/7] usb: common: otg-fsm: add HNP polling implememtation

2015-03-08 Thread Li Jun
From: Li Jun OTG in host mode call this function to poll peripheral if it wants to be host role. Signed-off-by: Li Jun --- drivers/usb/common/usb-otg-fsm.c | 75 ++ include/linux/usb/otg-fsm.h | 10 + 2 files changed, 85 insertions(+) diff

[PATCH 4/7] usb: chipidea: udc: add OTG status request handling

2015-03-08 Thread Li Jun
From: Li Jun Peripheral answers OTG status selector request from host according to host_request_flag of gadget, length is 1. Signed-off-by: Li Jun --- drivers/usb/chipidea/udc.c | 28 +++- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/drivers/usb

[PATCH 0/7] add HNP polling support for chipidea usb otg fsm driver

2015-03-08 Thread Li Jun
determine whether it requires a role-swap and grant this at the earliest opportunity. Li Jun (7): usb: gadget: add host_requestf_flag in usb_gadget for OTG HNP usb: common: otg-fsm: start HNP polling timer in host state usb: common: otg-fsm: add HNP polling implememtation usb: chipidea: udc

[PATCH 7/7] Documentation: usb: chipidea: Update test procedure for HNP polling

2015-03-08 Thread Li Jun
From: Li Jun Update HNP test procedure as HNP polling is supported. Signed-off-by: Li Jun --- Documentation/usb/chipidea.txt |9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Documentation/usb/chipidea.txt b/Documentation/usb/chipidea.txt index 3f848c1..95d9170

[PATCH 6/7] usb: common: otg-fsm: clear host_request_flag when leaves peripheral state

2015-03-08 Thread Li Jun
From: Li Jun Cleare the flag after try to do role switch, no matter the role switch succeeds or not. Signed-off-by: Li Jun --- drivers/usb/common/usb-otg-fsm.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c index

[PATCH 5/7] usb: chipidea: otg_fsm: add HNP polling support

2015-03-08 Thread Li Jun
From: Li Jun Add a dedicataed normal timer for HNP polling since it's cyclical, while in peripheral mode, change a/b_bus_req to be 1 will make it response to host request flag with 1, then role switch will be started. Signed-off-by: Li Jun --- drivers/usb/chipidea/ci.h |

[PATCH 1/7] usb: gadget: add host_requestf_flag in usb_gadget for OTG HNP

2015-03-08 Thread Li Jun
From: Li Jun Adds host_request_flag for gadget to store host request information from application, which can be used to response to HNP polling from host. Signed-off-by: Li Jun --- include/linux/usb/gadget.h |1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/usb/gadget.h b

[PATCH 2/7] usb: common: otg-fsm: start HNP polling timer in host state

2015-03-08 Thread Li Jun
From: Li Jun Adds OTG HNP polling timer when otg fsm moves to host state. Signed-off-by: Li Jun --- drivers/usb/common/usb-otg-fsm.c |2 ++ include/linux/usb/otg-fsm.h |1 + 2 files changed, 3 insertions(+) diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb

[PATCH v3 1/1] usb: chipidea: use hrtimer for otg fsm timers

2015-03-01 Thread Li Jun
From: Li Jun Current otg fsm timers are using controller 1ms irq and count it, this patch is to replace it with hrtimer solution, use one hrtimer for all otg timers. Signed-off-by: Li Jun Change for v3: - clean up the definitions for original timer solution: ci_otg_fsm_timer and

[PATCH resend 2/2] usb: otg-fsm: move 2 otg fsm timers definition to otg_fsm_timer

2015-03-01 Thread Li Jun
From: Li Jun B_DATA_PLS(data-line pulse time) and B_SSEND_SRP(session end to SRP init) are also from OTG&EH 2.0 Specification and they are not chipidea specific. Signed-off-by: Li Jun diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c index 3014e2c..ba2cb91 10

[PATCH resend 1/2] usb: chipidea: otg: remove unnecessary B_SESS_VLD timer

2015-03-01 Thread Li Jun
From: Li Jun Since BSV irq is enabled for B-device all the time, so B_SESS_VLD timer is not required, and also no need to check BSV status when B_ASE0_BRST timer timeout. Signed-off-by: Li Jun diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c index e3cf5be..3014e2c

[PATCH v2 1/1] usb: chipidea: use hrtimer for otg fsm timers

2015-03-01 Thread Li Jun
From: Li Jun Current otg fsm timers are using controller 1ms irq and count it, this patch is to replace it with hrtimer solution, use one hrtimer for all otg timers. Signed-off-by: Li Jun Changes for v2: - change enabled_otg_timers to be enabled_otg_timer_bits. - Remove duplicated OTG 1MSIE

Re: [PATCH 3/3] usb: chipidea: use hrtimer for otg fsm timers

2015-02-27 Thread Li Jun
he code, I don't know the state is at A_IDLE, mind to change? > It's already under condition of A_IDLE as below: if (ci->fsm.otg->state == OTG_STATE_A_IDLE) { ... ... if () { ... ... } else { /* Enable data pulse irq */ ... } } That's a change to avoid to do it in timer out(VFALL) handler, so put it here (after otg fsm transit to A_IDLE and will no further state transitions). Li Jun > > Peter -- 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 3/3] usb: chipidea: use hrtimer for otg fsm timers

2015-02-26 Thread Li Jun
On Thu, Feb 26, 2015 at 07:25:56PM +0800, Peter Chen wrote: > On Mon, Feb 09, 2015 at 02:54:48PM +0800, Li Jun wrote: > > From: Li Jun > > > > Current otg fsm timers are using controller 1ms irq and count it, this patch > > is to replace it with hrtimer solution,

[PATCH v3 1/1] usb: chipidea: support runtime power management for otg fsm mode

2015-02-09 Thread Li Jun
From: Li Jun This patch adds runtime power management support for otg fsm mode, since A-device in a_idle state cannot detect data pulse irq after suspended, here enable wakeup by connection before suspend to make it can be resumed by DP; and handle wakeup from that state like SRP. Signed-off-by

[PATCH 1/2] usb: chipidea: do not update vbus_active when probe in otg fsm mode

2015-02-09 Thread Li Jun
From: Li Jun In otg fsm mode, vbus_active will be updated by otg fsm, this is to fix the system hang issue if load gadget driver with vbus turned on, because when binding gadget driver, if vbus_active is set, udc core will pull up DP by enable R/S bit but controller is already runtime suspended

[PATCH 0/2] Fix 2 otg fsm mode issues for chipidea usb driver

2015-02-09 Thread Li Jun
From: Li Jun Hi Peter, The 2 patches are to fix the problems I found in otg fsm mode. The 1st patch is to fix one system hang issue in otg fsm mode if runtime PM is enabled, but can not cover vbus glitch case you found on i.MX6SX. The 2nd patch is to stop the ci_udc_start also for otg A-device

[PATCH 2/2] usb: chipidea: udc: do not run udc directly when start udc in otg fsm mode

2015-02-09 Thread Li Jun
From: Li Jun For A-device, when load gadget driver, we should not run udc either as this will be controlled by otg fsm. Signed-off-by: Li Jun --- drivers/usb/chipidea/udc.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb

Re: [PATCH v2 1/1] usb: chipidea: support runtime power management for otg fsm mode

2015-02-09 Thread Li Jun
On Mon, Feb 09, 2015 at 03:22:17PM +0800, Peter Chen wrote: > On Mon, Feb 09, 2015 at 02:45:30PM +0800, Li Jun wrote: > > From: Li Jun > > > > This patch adds runtime power management support for otg fsm mode, since > > A-device in a_idle state cannot detect data puls

[PATCH v2 1/1] usb: chipidea: support runtime power management for otg fsm mode

2015-02-09 Thread Li Jun
From: Li Jun This patch adds runtime power management support for otg fsm mode, since A-device in a_idle state cannot detect data pulse irq after suspended, here enable wakeup by connection before suspend to make it can be resumed by DP; and handle wakeup from that state like SRP. Signed-off-by

[PATCH 3/3] usb: chipidea: use hrtimer for otg fsm timers

2015-02-09 Thread Li Jun
From: Li Jun Current otg fsm timers are using controller 1ms irq and count it, this patch is to replace it with hrtimer solution, use one hrtimer for all otg timers. Signed-off-by: Li Jun --- drivers/usb/chipidea/ci.h | 10 +- drivers/usb/chipidea/otg_fsm.c | 365

[PATCH 2/3] usb: otg-fsm: move 2 otg fsm timers definition to otg_fsm_timer

2015-02-09 Thread Li Jun
From: Li Jun B_DATA_PLS(data-line pulse time) and B_SSEND_SRP(session end to SRP init) are also from OTG&EH 2.0 Specification and they are not chipidea specific. Signed-off-by: Li Jun --- drivers/usb/chipidea/otg_fsm.c |8 drivers/usb/chipidea/otg_fsm.h |

[PATCH 1/3] usb: chipidea: otg: remove unnecessary B_SESS_VLD timer

2015-02-09 Thread Li Jun
From: Li Jun Since BSV irq is enabled for B-device all the time, so B_SESS_VLD timer is not required, and also no need to check BSV status when B_ASE0_BRST timer timeout. Signed-off-by: Li Jun --- drivers/usb/chipidea/otg_fsm.c | 31 +-- drivers/usb/chipidea

[PATCH 1/1] usb: chipidea: support runtime power management for otg fsm mode

2015-02-08 Thread Li Jun
From: Li Jun This patch adds runtime power management support for otg fsm mode, since A-device in a_idle state cannot detect data pulse irq after suspended, here enable wakeup by connection before suspend to make it can be resumed by DP; and handle wakeup from that state like SRP. Signed-off-by

Re: [PATCH] Revert "usb: gadget: composite: dequeue cdev->req before free it in composite_dev_cleanup"

2014-09-19 Thread Li Jun
ry to dequeue a request that has already > completed much more frequently than one which is pending. > > Cc: Li Jun > Signed-off-by: Felipe Balbi > --- > > Greg, can you still apply this for v3.17 final ? Please take it as a patch > directly so we avoid a pull request f

[PATCH] usb: gadget: composite: dequeue cdev->req before free its buffer

2014-08-28 Thread Li Jun
rdware can access the buffer's memory anytime before the request's complettion rountine runs, and usb_ep_dequeue always call the complettion rountine before it returns, so the best way is to dequeue the request before free its buffer. Suggested-by: Felipe Balbi Signed-off-by: Li Jun

Re: [PATCH] usb: gadget: composite: dequeue cdev->req before free its buffer

2014-08-28 Thread Li Jun
On Wed, Aug 27, 2014 at 01:56:36PM -0500, Felipe Balbi wrote: > Hi, > > On Mon, Aug 25, 2014 at 04:49:12PM +0800, Li Jun wrote: > > As Felipe suggested, dequeue the cdev->req before free its buffer. > > > > Suggested-by: Felipe Balbi > > Signed-off-by: Li

[PATCH] usb: gadget: composite: dequeue cdev->req before free its buffer

2014-08-25 Thread Li Jun
As Felipe suggested, dequeue the cdev->req before free its buffer. Suggested-by: Felipe Balbi Signed-off-by: Li Jun diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 6935a82..4514e73 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gad

[PATCH] usb: gadget: composite: dequeue cdev->req before free it in composite_dev_cleanup

2014-07-15 Thread Li Jun
This patch try to dequeue the cdev->req to guarantee the request is not queued before free it. Signed-off-by: Li Jun --- drivers/usb/gadget/composite.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index f801519..6935

Re: [PATCH 0/3] usb: common: otg-fsm: add HNP polling support for otg fsm

2014-07-02 Thread Li Jun
On Wed, Jul 02, 2014 at 11:49:07AM -0500, Felipe Balbi wrote: > On Mon, May 19, 2014 at 01:55:42PM +0800, Li Jun wrote: > > From: Li Jun > > > > Hi Felipe, > > > > This patchset adds otg HNP polling common part for otg fsm. > > awesome :-) How have you te

[PATCH v2 3/3] usb: chipidea: set host request flag via sys input

2014-05-28 Thread Li Jun
From: Li Jun This patch sets host request flag in sys input when a A device set a_bus_req or a B device set b_bus_req in peripheral role. Signed-off-by: Li Jun --- drivers/usb/chipidea/otg_fsm.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/usb

[PATCH v2 0/3] usb: chipidea: otg_fsm: add otg HNP polling support

2014-05-28 Thread Li Jun
From: Li Jun This patchset adds chipidea driver part of otg HNP polling support. Change since v1 for patch: usb: chipidea: udc: add OTG status request handling - Correct the OTG status request length to be 1 byte. Li Jun (3): usb: chipidea: udc: add OTG status request handling usb

[PATCH v2 1/3] usb: chipidea: udc: add OTG status request handling

2014-05-28 Thread Li Jun
From: Li Jun Peripheral answers OTG status selector request from host according to host request flag of gadget, length is 1. this flag may be set by application via kernel interface. Signed-off-by: Li Jun --- drivers/usb/chipidea/udc.c | 22 +- 1 file changed, 17

[PATCH v2 2/3] usb: chipidea: otg_fsm: add HNP polling support

2014-05-28 Thread Li Jun
From: Li Jun This patch adds HNP polling support for chipidea otg fsm driver, which adds a SW timer to send HNP polling request. Signed-off-by: Li Jun --- drivers/usb/chipidea/ci.h |2 ++ drivers/usb/chipidea/otg_fsm.c | 32 ++-- drivers/usb/chipidea

[PATCH v2 2/3] usb: common: otg-fsm: add HNP polling request sending funciton

2014-05-28 Thread Li Jun
From: Li Jun This patch adds OTG status selector request sending function, can be used to poll peripheral if it wants to be host after OTG port is in host state. Signed-off-by: Li Jun --- drivers/usb/common/usb-otg-fsm.c | 55 ++ include/linux/usb/otg

[PATCH v2 0/3] usb: common: otg-fsm: add HNP polling support for otg fsm

2014-05-28 Thread Li Jun
From: Li Jun This patchset adds otg HNP polling common part for otg fsm. Change since v1 for patch: usb: common: otg-fsm: add HNP polling request sending funciton - Use usb_control_msg to get OTG status, since the status length is 1 byte, which is different with all other existing usb status

[PATCH v2 3/3] usb: common: otg-fsm: add host_request_flag in usb_gadget

2014-05-28 Thread Li Jun
From: Li Jun This patch adds host_request_flag in usb_gadget to store host request from application, clear the flag when otg leaves host state. Signed-off-by: Li Jun --- drivers/usb/common/usb-otg-fsm.c |4 include/linux/usb/gadget.h |1 + 2 files changed, 5 insertions

[PATCH v2 1/3] usb: common: otg-fsm: start HNP polling timer in host state

2014-05-28 Thread Li Jun
From: Li Jun This patch starts HNP polling timer when otg is set to be a_host or b_host. Signed-off-by: Li Jun --- drivers/usb/common/usb-otg-fsm.c |2 ++ include/linux/usb/otg-fsm.h |1 + 2 files changed, 3 insertions(+) diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers

[PATCH 0/3] usb: chipidea: otg_fsm: add otg HNP polling support

2014-05-19 Thread Li Jun
From: Li Jun Hi Peter, This patchset adds chipidea driver part of otg HNP polling support. Li Jun (3): usb: chipidea: udc: add OTG status request handling. usb: chipidea: otg_fsm: add HNP polling support usb: chipidea: set host request flag via sys input drivers/usb/chipidea/ci.h

[PATCH 3/3] usb: chipidea: set host request flag via sys input

2014-05-19 Thread Li Jun
From: Li Jun This patch sets host request flag in sys input when a A device set a_bus_req or a B device set b_bus_req in peripheral role. Signed-off-by: Li Jun --- drivers/usb/chipidea/otg_fsm.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/usb

[PATCH 2/3] usb: chipidea: otg_fsm: add HNP polling support

2014-05-19 Thread Li Jun
From: Li Jun This patch adds HNP polling support for chipidea otg fsm driver, which adds a SW timer to send HNP polling request. Signed-off-by: Li Jun --- drivers/usb/chipidea/ci.h |2 ++ drivers/usb/chipidea/otg_fsm.c | 32 ++-- drivers/usb/chipidea

[PATCH v2] usb: chipidea: udc: add OTG status request handling.

2014-05-19 Thread Li Jun
: Li Jun --- drivers/usb/chipidea/udc.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index d683968..4564936 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -823,8 +823,16

[PATCH 2/3] usb: chipidea: otg_fsm: add HNP polling support

2014-05-19 Thread Li Jun
From: Li Jun This patch adds HNP polling support for chipidea otg fsm driver, which adds a SW timer to send HNP polling request. Signed-off-by: Li Jun --- drivers/usb/chipidea/ci.h |2 ++ drivers/usb/chipidea/otg_fsm.c | 32 ++-- drivers/usb/chipidea

[PATCH 1/3] usb: chipidea: udc: add OTG status request handling.

2014-05-19 Thread Li Jun
Peripheral answers OTG status selector request from host according to host request flag of gadget, this flag may be set by application via kernel interface. Signed-off-by: Li Jun --- drivers/usb/chipidea/udc.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a

[PATCH 0/3] usb: chipidea: otg_fsm: add otg HNP polling support

2014-05-19 Thread Li Jun
From: Li Jun Hi Peter, This patchset adds chipidea driver part of otg HNP polling support. Li Jun (3): usb: chipidea: udc: add OTG status request handling. usb: chipidea: otg_fsm: add HNP polling support usb: chipidea: set host request flag via sys input drivers/usb/chipidea/ci.h

[PATCH 3/3] usb: chipidea: set host request flag via sys input

2014-05-19 Thread Li Jun
From: Li Jun This patch sets host request flag in sys input when a A device set a_bus_req or a B device set b_bus_req in peripheral role. Signed-off-by: Li Jun --- drivers/usb/chipidea/otg_fsm.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/usb

[PATCH 2/3] usb: common: otg-fsm: add HNP polling request sending funciton

2014-05-19 Thread Li Jun
From: Li Jun This patch adds OTG status selector request sending function, can be called by HNP polling timer function after OTG port is in host state. Signed-off-by: Li Jun --- drivers/usb/common/usb-otg-fsm.c | 47 ++ include/linux/usb/otg-fsm.h

[PATCH 3/3] usb: common: otg-fsm: add host_request_flag in usb_gadget

2014-05-19 Thread Li Jun
From: Li Jun This patch adds host_request_flag in usb_gadget to store host request from application, clear the flag when otg leaves host state. Signed-off-by: Li Jun --- drivers/usb/common/usb-otg-fsm.c |4 include/linux/usb/gadget.h |1 + 2 files changed, 5 insertions

[PATCH 1/3] usb: common: otg-fsm: start HNP polling timer in host state

2014-05-19 Thread Li Jun
From: Li Jun This patch starts HNP polling timer when otg is set to be a_host or b_host. Signed-off-by: Li Jun --- drivers/usb/common/usb-otg-fsm.c |2 ++ include/linux/usb/otg-fsm.h |1 + 2 files changed, 3 insertions(+) diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers

[PATCH 0/3] usb: common: otg-fsm: add HNP polling support for otg fsm

2014-05-19 Thread Li Jun
From: Li Jun Hi Felipe, This patchset adds otg HNP polling common part for otg fsm. Li Jun (3): usb: common: otg-fsm: start HNP polling timer in host state usb: common: otg-fsm: add HNP polling request sending funciton usb: common: otg-fsm: add host_request_flag in usb_gadget drivers

Re: i.MX6 USB OTG support is broken on linux-next

2014-05-12 Thread Li Jun
ot wanting more here, this dual role functionality actually is not the part of "CONFIG_USB_OTG"; What USB_OTG + USB_OTG_FSM does is *specific* for HNP and SRP, it's based on OTG spec and will *not* work well with a normal usb device, that's the reason behind in disable USB_OTG,

Re: i.MX6 USB OTG support is broken on linux-next

2014-05-10 Thread Li Jun
bool "Rely on OTG Targeted Peripherals List" > depends on USB_OTG || EXPERT > - default y if USB_OTG > help > If you say Y here, the "otg_whitelist.h" file will be used as a > product whitelist, so USB peripherals not listed there will be > > Shawn As Peter suggested, do not enable OTG_FSM in defconfig since there are very few HNP&SRP capable device in market. With OTG_FSM enabled, even USB_OTG_WHITELIST is not selected, the OTG port still can't work the same as before if you connect a normal usb device to it. Li Jun -- 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 v12 10/12] usb: chipidea: debug: add debug file for OTG variables

2014-04-21 Thread Li Jun
From: Li Jun This patch adds a debug file for OTG vairables show. Signed-off-by: Li Jun --- drivers/usb/chipidea/debug.c | 84 ++ 1 file changed, 84 insertions(+) diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c index 5b890c1

[PATCH v12 02/12] usb: chipidea: usb OTG fsm initialization.

2014-04-21 Thread Li Jun
This patch adds OTG fsm related initialization when do otg init, add a seperate file for OTG fsm related utilities. Signed-off-by: Li Jun --- drivers/usb/chipidea/Makefile |1 + drivers/usb/chipidea/ci.h | 17 +++ drivers/usb/chipidea/otg.c |4 +++ drivers/usb

[PATCH v12 08/12] usb: chipidea: OTG HNP and SRP fsm implementation.

2014-04-21 Thread Li Jun
From: Li Jun USB OTG interrupt handling and fsm transitions according to USB OTG and EH 2.0. Signed-off-by: Li Jun --- drivers/usb/chipidea/core.c| 24 +++- drivers/usb/chipidea/otg.c |9 +- drivers/usb/chipidea/otg_fsm.c | 243 drivers

[PATCH v12 01/12] usb: phy: otg-fsm: export symbol of otg_statemachine

2014-04-21 Thread Li Jun
From: Li Jun This patch exports symbol of otg_statemachine for kernel module can use it. Signed-off-by: Li Jun --- drivers/usb/phy/phy-fsm-usb.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/phy/phy-fsm-usb.c b/drivers/usb/phy/phy-fsm-usb.c index c47e5a6..a62d8c8 100644

[PATCH v12 04/12] usb: chipidea: host: init otg port number.

2014-04-21 Thread Li Jun
Init otg_port number of otg capable host to be 1 at host start. Signed-off-by: Li Jun --- drivers/usb/chipidea/host.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c index ffb4168..a93d950 100644 --- a

[PATCH v12 05/12] usb: chipidea: udc: driver update for OTG HNP.

2014-04-21 Thread Li Jun
Add b_hnp_enable request handling and enable gadget->is_otg Acked-by: Peter Chen Signed-off-by: Li Jun --- 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 f58857d..cba7

[PATCH v12 07/12] usb: chipidea: OTG fsm timers initialization.

2014-04-21 Thread Li Jun
From: Li Jun This patch adds OTG fsm timers initialization, which use controller's 1ms interrupt as timeout counter, also adds some local timers which are not in otg_fsm_timer list. Signed-off-by: Li Jun --- drivers/usb/chipidea/bits.h|1 + drivers/usb/chipidea/otg_fsm.c |

[PATCH v12 09/12] usb: chipidea: add sys inputs for OTG fsm input.

2014-04-21 Thread Li Jun
From: Li Jun This patch adds sys input to control and show OTG fsm inputs by application, user can do host and preipheral role switch by change these inputs. Signed-off-by: Li Jun --- drivers/usb/chipidea/otg.c |2 + drivers/usb/chipidea/otg_fsm.c | 173

[PATCH v12 03/12] usb: chipidea: host: vbus control change for OTG HNP.

2014-04-21 Thread Li Jun
Leave vbus on/off hanlded by OTG fsm if in OTG mode. Signed-off-by: Li Jun --- drivers/usb/chipidea/host.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c index a8ac6c1..ffb4168 100644 --- a/drivers/usb

[PATCH v12 12/12] Documentation: usb: add chipidea.txt for how to demo usb OTG HNP and SRP

2014-04-21 Thread Li Jun
From: Li Jun This patch adds a file chipidea.txt for how to demo chipidea usb OTG HNP and SRP functions via sysfs input files, any other possible information should be documented for chipidea usb driver in future can be added into this file. Signed-off-by: Li Jun --- Documentation/usb

<    1   2   3   4   5   6   7   8   >