Re: [PATCH 4/4] usb: chipidea: Prevent endless loop registering platform_devices when ci_hdrc_probe() fails.

2013-07-31 Thread Peter Chen
y create a new ci_hdrc platform_device > whose probing will likewise fail and trigger a new invocation of > ci_hdrc_imx_probe() ... ad nauseam. > Sorry, I can't understand how it happenes? -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "uns

Re: [PATCH 2/4] usb: chipidea: ci_hdrc_imx: remove an unsolicited module_put() call from ci_hdrc_imx_remove()

2013-08-01 Thread Peter Chen
On Thu, Aug 01, 2013 at 10:38:18AM +0200, Lothar Waßmann wrote: > Hi, > > Peter Chen writes: > > On Wed, Jul 31, 2013 at 04:21:14PM +0200, Lothar Waßmann wrote: > > > This prevents the USB PHY refcount to be decremented below zero upon > > > unloading the ci-hdr

Re: [PATCH 3/4] usb: chipidea: don't clobber return value of ci_role_start()

2013-08-01 Thread Peter Chen
On Thu, Aug 01, 2013 at 10:40:42AM +0200, Lothar Waßmann wrote: > Hi, > > Peter Chen writes: > > On Wed, Jul 31, 2013 at 04:21:15PM +0200, Lothar Waßmann wrote: > > > > > > Signed-off-by: Lothar Waßmann > > > --- > > > drivers/usb/chipidea/c

Re: [PATCH 4/4] usb: chipidea: Prevent endless loop registering platform_devices when ci_hdrc_probe() fails.

2013-08-01 Thread Peter Chen
On Thu, Aug 01, 2013 at 10:43:52AM +0200, Lothar Waßmann wrote: > Hi, > > Peter Chen writes: > > On Wed, Jul 31, 2013 at 04:21:16PM +0200, Lothar Waßmann wrote: > > > commit 40dcd0e introduced the following code to the ci_hdrc_probe() > > > function: > > &g

Re: USB Interrupt Transaction Scheduling

2013-08-01 Thread Peter Chen
); /* not RTOS friendly */ > > Maybe this udelay is impacting your performance? > > It seems that this should be rewritten to avoid the busy loop. > No, it is not related to this problem, this function is only called at device mode. All EHCI related is controlled by EHCI co

Re: USB Interrupt Transaction Scheduling

2013-08-01 Thread Peter Chen
re-run the tests with more rigor to confirm the results. I will post > the details. > > -Nate > -- > 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 ht

Re: [PATCH] usb: chipidea: udc: fix potential kernel panic

2013-08-01 Thread Peter Chen
goto destroy_eps; > } > } > -- > 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.kerne

[PATCH v14 01/12] usb: chipidea: move vbus regulator operation to core

2013-08-02 Thread Peter Chen
The vbus regulator is a common element for USB vbus operation, So, move it from glue layer to core. Tested-by: Marek Vasut Signed-off-by: Michael Grzeschik Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 26 ++ drivers/usb/chipidea/core.c

[PATCH v14 04/12] usb: chipidea: otg: Add otg file used to access otgsc

2013-08-02 Thread Peter Chen
This file is mainly used to access otgsc currently, it may add otg related things in the future. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/chipidea/Makefile |2 +- drivers/usb/chipidea/bits.h | 10 drivers/usb/chipidea/core.c |3 +- drivers/usb

[PATCH v14 05/12] usb: chipidea: Add role init and destory APIs

2013-08-02 Thread Peter Chen
- The role's init will be called at probe procedure. - The role's destory will be called at fail patch at probe and driver's removal. - The role's start/stop will be called when specific role has started. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/ch

[PATCH v14 06/12] usb: chipidea: add flag CI_HDRC_DUAL_ROLE_NOT_OTG

2013-08-02 Thread Peter Chen
ate if the controller is dual role, but not supports OTG. If this flag is not set, we follow the rule that if DCCPARAMS_DC and DCCPARAMS_HC are both 1 at CAP_DCCPARAMS, then this controller is otg capable. Signed-off-by: Peter Chen --- drivers/usb/chipidea/core

[PATCH v14 07/12] usb: chipidea: disable all interrupts and clear all interrupts status

2013-08-02 Thread Peter Chen
During the initialization, it needs to disable all interrupts enable bit as well as clear all interrupts status bits to avoid exceptional interrupt. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/chipidea/core.c | 11 ++- 1 files changed, 10 insertions(+), 1

[PATCH v14 03/12] usb: chipidea: udc: otg_set_peripheral is useless for some chipidea users

2013-08-02 Thread Peter Chen
It is useless at below cases: - If we implement both usb host and device at chipidea driver. - If we don't need phy->otg. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/chipidea/udc.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/dri

[PATCH v14 11/12] usb: chipidea: udc: misuse flag CI_HDRC_REGS_SHARED and CI_HDRC_PULLUP_ON_VBUS

2013-08-02 Thread Peter Chen
load one gadget module), the controller can run if vbus is on (CI_HDRC_PULLUP_ON_VBUS), it also does not relate to shared register. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/chipidea/udc.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drive

[PATCH v14 02/12] usb: chipidea: host: add vbus regulator control

2013-08-02 Thread Peter Chen
vbus; when the host role finishes, it closes vbus. We put vbus operation to host as host is the only vbus user, When we are at host mode, the vbus is on, when we are not at host mode, vbus should be off. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/chipidea/host.c | 23

[PATCH v14 09/12] usb: chipidea: add vbus interrupt handler

2013-08-02 Thread Peter Chen
We add vbus interrupt handler at ci_otg_work, it uses OTGSC_BSV(at otgsc) to know it is connect or disconnet event. Meanwhile, we introduce two flags id_event and b_sess_valid_event to indicate it is an id interrupt or a vbus interrupt. Tested-by: Marek Vasut Signed-off-by: Peter Chen

[PATCH v14 10/12] usb: chipidea: add wait vbus lower than OTGSC_BSV before role starts

2013-08-02 Thread Peter Chen
indicate some hardware problems like the vbus is still higher than OTGSC_BSV after we disconnect to host some time later (5000 milliseconds currently), which is obvious not correct. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci.h |3 +++ drivers/usb/chipidea

[PATCH v14 08/12] usb: chipidea: move otg relate things to otg file

2013-08-02 Thread Peter Chen
Move otg relate things to otg file. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/chipidea/core.c | 63 +-- drivers/usb/chipidea/otg.c | 57 +- drivers/usb/chipidea/otg.h |2 + 3 files

[PATCH v14 12/12] usb: chipidea: udc: .pullup is valid when vbus is on at CI_HDRC_PULLUP_ON_VBUS

2013-08-02 Thread Peter Chen
: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/chipidea/udc.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 45abf4d..b7ead5f 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c

[PATCH 1/3] usb: chipidea: udc: fix the oops when plugs in usb cable after rmmod gadget

2013-08-02 Thread Peter Chen
) from [<8000eac0>] (__irq_svc+0x40/0x54) Exception stack(0xbf8bbf60 to 0xbf8bbfa8) bf60: 000f 8001aea0 bf8ba000 80712a48 804f0040 bf80: 806d29e8 412fc09a bf8bbfb4 bf8bbfb8 bf8bbfa8 8000fbcc 8000fbd0 bfa0: 60000013 r7:bf8bbf94 r6: r5:6

[PATCH 0/3] Misc Chipidea Patch

2013-08-02 Thread Peter Chen
This patchset is based on my vbus/id patchset Peter Chen (3): usb: chipidea: udc: fix the oops when plugs in usb cable after rmmod gadget usb: chipidea: move platform related things to ci_get_platdata usb: host: delete chipidea dependency drivers/usb/chipidea/core.c | 21

[PATCH 3/3] usb: host: delete chipidea dependency

2013-08-02 Thread Peter Chen
Now, chipidea host has already depended on USB_EHCI_HCD Signed-off-by: Peter Chen --- drivers/usb/host/Kconfig |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index cf521d6..b548554 100644 --- a/drivers/usb/host

[PATCH 2/3] usb: chipidea: move platform related things to ci_get_platdata

2013-08-02 Thread Peter Chen
It will make probe cleaner, meanwhile, it fixes the problem http://marc.info/?l=linux-usb&m=137528143523296&w=2 described indirectly. Signed-off-by: Peter Chen --- drivers/usb/chipidea/core.c | 21 + 1 files changed, 9 insertions(+), 12 deletions(-) diff --git a

[PATCH v14 00/12] Add tested id switch and vbus connect detect support for Chipidea

2013-08-02 Thread Peter Chen
_imx: remove an unsolicited module_put() call from ci_hdrc_imx_remove() Peter Chen (1): usb: chipidea: fix the build error with randconfig - [Michael comments]: move vbus operation to core, and squash two vbus patches. [1/12], [2/12] - [Michael comments]: move out non vbus and non id related

[PATCH 1/1] usb: chipidea: refine the operation of creating register mapping

2013-08-04 Thread Peter Chen
- The old operation needs to call hw_alloc_regmap two times, and the first operation is only used to know if the controller is lpm supported, besides, there is a kfree before kzalloc, it is also tricky. - Fix the memory leak for ci->hw_bank.regmap when unload module. Signed-off-by: Peter C

Re: [PATCH 1/1] usb: chipidea: refine the operation of creating register mapping

2013-08-05 Thread Peter Chen
On Mon, Aug 05, 2013 at 10:05:56AM +0300, Alexander Shishkin wrote: > Peter Chen writes: > > > - The old operation needs to call hw_alloc_regmap two times, and > > the first operation is only used to know if the controller is > > lpm supported, besides, there is a kfr

[PATCH 1/1] usb: gadget: zero: Add flexible auto remote wakeup test method

2013-08-05 Thread Peter Chen
In order to increase test coverage, we can change the interval between two remote wakeups every time, and the interval can be any user defined value. This change will no affect current behavior if the user does not use two introduced module paramters. Signed-off-by: Peter Chen --- drivers/usb

Re: [PATCH v14 00/12] Add tested id switch and vbus connect detect support for Chipidea

2013-08-06 Thread Peter Chen
On Fri, Aug 02, 2013 at 04:33:53PM +0800, Peter Chen wrote: > This patchset adds tested otg id switch function and vbus connect > and disconnect detection for chipidea driver. And fix kinds of > bugs found at chipidea drivers after enabling id and vbus detection. > > This patch a

Re: [PATCH] USB: global suspend and remote wakeup don't mix

2013-08-06 Thread Peter Chen
o wake > up from S3. But with some hubs, if you use global suspend then > pressing a key does not wake up the system. > For end user, the keyboard connects to roothub directly and connects to intermediate hub (then connects to roothub) may not be different, since the hub may solder

[PATCH v2 1/1] usb: gadget: zero: Add flexible auto remote wakeup test method

2013-08-06 Thread Peter Chen
In order to increase test coverage, we can change the interval between two remote wakeups every time, and the interval can be any user defined value. This change will no affect current behavior if the user does not use two introduced module paramters. Signed-off-by: Peter Chen --- Changes for

[PATCH 1/1] usb: chipidea: imx: include usbmisc_imx.c in ci_hdrc_imx.c

2013-08-07 Thread Peter Chen
2&w=2 Besides, we update dts and binding doc for at this commit Signed-off-by: Peter Chen --- .../devicetree/bindings/usb/ci13xxx-imx.txt| 10 +- .../devicetree/bindings/usb/usbmisc-imx.txt| 14 -- arch/arm/boot/dts/imx23.dtsi |1 + arch/arm/b

Re: [PATCH 1/1] usb: chipidea: imx: include usbmisc_imx.c in ci_hdrc_imx.c

2013-08-07 Thread Peter Chen
On Wed, Aug 07, 2013 at 10:15:22AM +0200, Sascha Hauer wrote: > On Wed, Aug 07, 2013 at 01:34:37PM +0800, Peter Chen wrote: > > At former design, both ci_hdrc_imx and usbmisc_imx are individual > > module, ci_hdrc_imx is glue layer for imx usb driver. usbmisc_imx > > handl

Re: [PATCH 1/1] usb: chipidea: imx: include usbmisc_imx.c in ci_hdrc_imx.c

2013-08-07 Thread Peter Chen
gt; Yes, it is not a good practice, but I want to keep ci_hdrc_imx.c > > as clean as possible. The SoC related implementation will be more > > and more in the future after we add more USB functions. > > Just because you want to have the binary code in a single module doesn

Re: [PATCH 1/1] usb: chipidea: imx: include usbmisc_imx.c in ci_hdrc_imx.c

2013-08-07 Thread Peter Chen
On Wed, Aug 07, 2013 at 11:11:10AM +0200, Sascha Hauer wrote: > On Wed, Aug 07, 2013 at 01:34:37PM +0800, Peter Chen wrote: > > - > > - reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET; > > - > > - if (usbdev->evdo) { > > - spin_lock_irqsave(&

Re: [PATCH 1/1] usb: chipidea: imx: include usbmisc_imx.c in ci_hdrc_imx.c

2013-08-07 Thread Peter Chen
make this much > > > easier to read. > > > > You mean delete "reg" entry at usbmisc dts, and using noncore phandle > > at usbmisc_imx.c as the first patch, then, convert driver as separate > > file. > > I mean: create a patch which converts the usb

Re: [PATCH 1/1] usb: chipidea: imx: include usbmisc_imx.c in ci_hdrc_imx.c

2013-08-07 Thread Peter Chen
On Wed, Aug 07, 2013 at 12:06:42PM +0200, Sascha Hauer wrote: > On Wed, Aug 07, 2013 at 01:34:37PM +0800, Peter Chen wrote: > > diff --git a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt > > b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt > > index b4

Re: [PATCH 1/1] usb: chipidea: imx: include usbmisc_imx.c in ci_hdrc_imx.c

2013-08-07 Thread Peter Chen
On Wed, Aug 07, 2013 at 02:28:20PM +0200, Michael Grzeschik wrote: > Hi Peter, > > On Wed, Aug 07, 2013 at 05:24:45PM +0800, Peter Chen wrote: > > On Wed, Aug 07, 2013 at 12:05:07PM +0200, Sascha Hauer wrote: > > > > > > > > We need to know contr

[PATCH 1/1] usb: chipidea: imx: delete the dead code

2013-08-08 Thread Peter Chen
Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index b886998..30fdc2f 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b

[PATCH v2 1/5] usb: chipidea: imx: rename the DT doc name

2013-08-08 Thread Peter Chen
To reflect source file name change Signed-off-by: Peter Chen --- .../devicetree/bindings/usb/ci13xxx-imx.txt| 31 .../devicetree/bindings/usb/ci_hdrc_imx.txt| 31 Documentation/devicetree/bindings/usb/mxs-phy.txt | 13

[PATCH v2 2/5] usb: chipidea: usbmisc_imx: Using regmap to access register

2013-08-08 Thread Peter Chen
Signed-off-by: Peter Chen --- drivers/usb/chipidea/usbmisc_imx.c | 71 +--- 1 files changed, 34 insertions(+), 37 deletions(-) diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c index ac5a461..545efbf 100644 --- a/drivers/usb

[PATCH v2 0/5] usb: chipidea: delete usbmisc_imx

2013-08-08 Thread Peter Chen
, and the other patches will use the new file name, so I hope they can be queued together. Peter Chen (5): usb: chipidea: imx: rename the DT doc name usb: chipidea: usbmisc_imx: Using regmap to access register usb: chipidea: imx: build ci_hdrc_imx.c and usbmisc_imx.c together arm: dts: imx

[PATCH v2 3/5] usb: chipidea: imx: build ci_hdrc_imx.c and usbmisc_imx.c together

2013-08-08 Thread Peter Chen
Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 113 +++--- drivers/usb/chipidea/ci_hdrc_imx.h | 28 +++--- drivers/usb/chipidea/usbmisc_imx.c | 186 +++- drivers/usb/chipidea/usbmisc_imx.h | 14 +++ 4 files changed, 98 inser

[PATCH v2 4/5] arm: dts: imx: add aliases for usb

2013-08-08 Thread Peter Chen
At imx usb driver, it needs to know the controller id to access register. Signed-off-by: Peter Chen --- arch/arm/boot/dts/imx23.dtsi |1 + arch/arm/boot/dts/imx28.dtsi |2 ++ arch/arm/boot/dts/imx51.dtsi |4 arch/arm/boot/dts/imx53.dtsi |4 arch/arm/boot/dts

[PATCH v2 5/5] arm: dts: imx: Delete usbmisc_imx

2013-08-08 Thread Peter Chen
g doc from usbmisc_imx as well. Signed-off-by: Peter Chen --- .../devicetree/bindings/usb/ci_hdrc_imx.txt| 12 .../devicetree/bindings/usb/usbmisc-imx.txt| 14 -- arch/arm/boot/dts/imx25.dtsi | 14 +- arch/arm/boo

Re: [PATCH v2 5/5] arm: dts: imx: Delete usbmisc_imx

2013-08-08 Thread Peter Chen
On Thu, Aug 08, 2013 at 12:38:59PM +0200, Sascha Hauer wrote: > On Thu, Aug 08, 2013 at 03:33:01PM +0800, Peter Chen wrote: > > Since ci_hdrc_imx and usbmisc_imx has relationship between each other, > > they can't be existed as two modules. We change the code, and make > &

Re: [PATCH v2 5/5] arm: dts: imx: Delete usbmisc_imx

2013-08-09 Thread Peter Chen
On Fri, Aug 09, 2013 at 08:20:45AM +0200, Sascha Hauer wrote: > On Thu, Aug 08, 2013 at 06:19:43PM +0800, Peter Chen wrote: > > > > - compatible = "fsl,imx25-usbmisc"; > > > > - clocks = <

Re: [PATCH 2/2] USB: chipidea: i.MX: simplify usbmisc

2013-08-09 Thread Peter Chen
ci_hdrc_imx_probe(struct platform_device *pdev) > return -ENOENT; > } > > + data->usbmisc_data = usbmisc_get_init_data(&pdev->dev); > + if (IS_ERR(data->usbmisc_data)) > + return PTR_ERR(data->usbmisc_data); > + You need to consider mx23/mx28 case which doesn't have usbmisc. Your version can fix current loadable module problem, and it is also easy to add new ops in future. After fixing mx23/mx28 case, we can use your version. -- 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 v14 06/12] usb: chipidea: add flag CI_HDRC_DUAL_ROLE_NOT_OTG

2013-08-09 Thread Peter Chen
On Fri, Aug 09, 2013 at 03:55:56PM +0300, Alexander Shishkin wrote: > Peter Chen writes: > > > Since we need otgsc to know vbus's status at some chipidea > > controllers even it is peripheral-only mode. Besides, some > > SoCs (eg, AR9331 SoC) don't have otgsc

Re: [PATCH v14 04/12] usb: chipidea: otg: Add otg file used to access otgsc

2013-08-09 Thread Peter Chen
On Fri, Aug 09, 2013 at 04:00:13PM +0300, Alexander Shishkin wrote: > Peter Chen writes: > > > This file is mainly used to access otgsc currently, it may > > add otg related things in the future. > > > > Tested-by: Marek Vasut > > Signed-off-by: Peter Che

Re: [PATCH v14 11/12] usb: chipidea: udc: misuse flag CI_HDRC_REGS_SHARED and CI_HDRC_PULLUP_ON_VBUS

2013-08-09 Thread Peter Chen
On Fri, Aug 09, 2013 at 04:23:11PM +0300, Alexander Shishkin wrote: > Peter Chen writes: > > > CI_HDRC_REGS_SHARED stands for the controller registers is shared > > with other USB drivers, if all USB drivers are at chipidea/, it doesn't > > needed to set. > >

Re: [PATCH v14 11/12] usb: chipidea: udc: misuse flag CI_HDRC_REGS_SHARED and CI_HDRC_PULLUP_ON_VBUS

2013-08-09 Thread Peter Chen
On Fri, Aug 09, 2013 at 07:46:00PM +0800, Peter Chen wrote: > On Fri, Aug 09, 2013 at 04:23:11PM +0300, Alexander Shishkin wrote: > > Peter Chen writes: > > > > > CI_HDRC_REGS_SHARED stands for the controller registers is shared > > > with other USB drivers, i

Re: [PATCH] usb: chipidea: enable to build host support as module

2013-08-11 Thread Peter Chen
depends on USB_EHCI_HCD=y || (USB_CHIPIDEA=m && USB_EHCI_HCD=m) > select USB_EHCI_ROOT_HUB_TT > help Hi Luka, Lothar has already posted a solution for it. http://marc.info/?l=linux-usb&m=137533651927159&w=2 -- Best Regards, Peter Chen -- To unsubscribe from this l

[PATCH v15 02/13] usb: chipidea: host: add vbus regulator control

2013-08-11 Thread Peter Chen
vbus; when the host role finishes, it closes vbus. We put vbus operation to host as host is the only vbus user, When we are at host mode, the vbus is on, when we are not at host mode, vbus should be off. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/chipidea/host.c | 23

[PATCH v15 01/13] usb: chipidea: move vbus regulator operation to core

2013-08-11 Thread Peter Chen
The vbus regulator is a common element for USB vbus operation, So, move it from glue layer to core. Tested-by: Marek Vasut Signed-off-by: Michael Grzeschik Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 26 ++ drivers/usb/chipidea/core.c

[PATCH v15 00/13] Add tested id switch and vbus connect detect support for Chipidea

2013-08-11 Thread Peter Chen
into probe chipidea: Remove previous MODULE_ALIAS Lothar Wabmann (3): usb: chipidea: improve kconfig 2.0 usb: chipidea: don't clobber return value of ci_role_start() usb: chipidea: ci_hdrc_imx: remove an unsolicited module_put() call from ci_hdrc_imx_remove() Peter Chen (1): usb: ch

[PATCH v15 10/13] usb: chipidea: add wait vbus lower than OTGSC_BSV before role starts

2013-08-11 Thread Peter Chen
indicate some hardware problems like the vbus is still higher than OTGSC_BSV after we disconnect to host some time later (5000 milliseconds currently), which is obvious not correct. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci.h |3 +++ drivers/usb/chipidea

[PATCH v15 11/13] usb: chipidea: udc: misuse flag CI_HDRC_REGS_SHARED and CI_HDRC_PULLUP_ON_VBUS

2013-08-11 Thread Peter Chen
load one gadget module), the controller can run if vbus is on (CI_HDRC_PULLUP_ON_VBUS), it also does not relate to shared register. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/chipidea/udc.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drive

[PATCH v15 04/13] usb: chipidea: otg: Add otg file used to access otgsc

2013-08-11 Thread Peter Chen
This file is mainly used to access otgsc currently, it may add otg related things in the future. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/chipidea/Makefile |2 +- drivers/usb/chipidea/bits.h | 10 ++ drivers/usb/chipidea/core.c |3 ++- drivers/usb

[PATCH v15 05/13] usb: chipidea: Add role init and destroy APIs

2013-08-11 Thread Peter Chen
- The role's init will be called at probe procedure. - The role's destroy will be called at fail patch at probe and driver's removal. - The role's start/stop will be called when specific role has started. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/ch

[PATCH v15 12/13] usb: chipidea: retire flag CI_HDRC_PULLUP_ON_VBUS

2013-08-11 Thread Peter Chen
Currently, the controller only runs when the ci->vbus_active is true. So the flag CI_HDRC_PULLUP_ON_VBUS is useless no longer. If the user doesn't have otgsc, he/she needs to change ci_handle_vbus_change to update ci->vbus_active. Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci

[PATCH v15 06/13] usb: chipidea: add flag CI_HDRC_DUAL_ROLE_NOT_OTG

2013-08-11 Thread Peter Chen
ate if the controller is dual role, but not supports OTG. If this flag is not set, we follow the rule that if DCCPARAMS_DC and DCCPARAMS_HC are both 1 at CAP_DCCPARAMS, then this controller is otg capable. Signed-off-by: Peter Chen --- drivers/usb/chipidea/core

[PATCH v15 08/13] usb: chipidea: move otg related things to otg file

2013-08-11 Thread Peter Chen
Move otg related things to otg file. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/chipidea/core.c | 63 +-- drivers/usb/chipidea/otg.c | 57 +- drivers/usb/chipidea/otg.h |2 + 3 files

[PATCH v15 03/13] usb: chipidea: udc: otg_set_peripheral is useless for some chipidea users

2013-08-11 Thread Peter Chen
It is useless at below cases: - If we implement both usb host and device at chipidea driver. - If we don't need phy->otg. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/chipidea/udc.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/dri

[PATCH v15 09/13] usb: chipidea: add vbus interrupt handler

2013-08-11 Thread Peter Chen
We add vbus interrupt handler at ci_otg_work, it uses OTGSC_BSV(at otgsc) to know it is connect or disconnet event. Meanwhile, we introduce two flags id_event and b_sess_valid_event to indicate it is an id interrupt or a vbus interrupt. Tested-by: Marek Vasut Signed-off-by: Peter Chen

[PATCH v15 07/13] usb: chipidea: disable all interrupts and clear all interrupts status

2013-08-11 Thread Peter Chen
During the initialization, it needs to disable all interrupts enable bit as well as clear all interrupts status bits to avoid exceptional interrupt. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/chipidea/core.c | 11 ++- 1 files changed, 10 insertions(+), 1

[PATCH v15 13/13] usb: chipidea: udc: .pullup is valid only when vbus is there

2013-08-11 Thread Peter Chen
For chipidea, the IP must know vbus before the controller begins to run. So the .pullup should only be called when the vbus is there. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- drivers/usb/chipidea/udc.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a

Re: [PATCH 1/2] USB: chipidea: i.MX: remove unused define

2013-08-12 Thread Peter Chen
rm_get_drvdata(pdev)) > - This one has already submitted by me, and queued by alex. -- 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 2/2] USB: chipidea: i.MX: simplify usbmisc

2013-08-12 Thread Peter Chen
isc->lock, flags); > } > > @@ -160,6 +136,26 @@ static const struct usbmisc_ops imx6q_usbmisc_ops = { > .init = usbmisc_imx6q_init, > }; > > +int imx_usbmisc_init(struct imx_usbmisc_data *data) > +{ > + if (!usbmisc) > + return -EPROBE_DEFER; > + if (!usbmisc->ops->init) > + return 0; > + return usbmisc->ops->init(data); > +} > +EXPORT_SYMBOL_GPL(imx_usbmisc_init); > + > +int imx_usbmisc_init_post(struct imx_usbmisc_data *data) > +{ > + if (!usbmisc) > + return -EPROBE_DEFER; > + if (!usbmisc->ops->post) > + return 0; > + return usbmisc->ops->post(data); > +} > +EXPORT_SYMBOL_GPL(imx_usbmisc_init_post); > + > static const struct of_device_id usbmisc_imx_dt_ids[] = { > { > .compatible = "fsl,imx25-usbmisc", > @@ -216,19 +212,12 @@ static int usbmisc_imx_probe(struct platform_device > *pdev) > of_match_device(usbmisc_imx_dt_ids, &pdev->dev); > data->ops = (const struct usbmisc_ops *)tmp_dev->data; > usbmisc = data; > - ret = usbmisc_set_ops(data->ops); > - if (ret) { > - usbmisc = NULL; > - clk_disable_unprepare(data->clk); > - return ret; > - } > > return 0; > } > > static int usbmisc_imx_remove(struct platform_device *pdev) > { > - usbmisc_unset_ops(usbmisc->ops); > clk_disable_unprepare(usbmisc->clk); > usbmisc = NULL; > return 0; > -- > 1.8.4.rc1 > Acked-by: 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] dwc3: dwc3-pci: Use SIMPLE_DEV_PM_OPS

2013-08-13 Thread Peter Chen
27,7 @@ static struct pci_driver dwc3_pci_driver = { > .probe = dwc3_pci_probe, > .remove = dwc3_pci_remove, > .driver = { > - .pm = DEV_PM_OPS, > + .pm = &dwc3_pci_dev_pm_ops, > }, >

Re: [PATCH] dwc3: dwc3-pci: Use SIMPLE_DEV_PM_OPS

2013-08-13 Thread Peter Chen
On Tue, Aug 13, 2013 at 8:59 PM, Fabio Estevam wrote: > On Tue, Aug 13, 2013 at 3:59 AM, Peter Chen wrote: > >> It seems .pm is not NULL if CONFIG_PM_SLEEP is not defined >> which is not the same with former code. > > With SIMPLE_DEV_PM_OPS macro we don't nee

Re: [PATCH] dwc3: dwc3-pci: Use SIMPLE_DEV_PM_OPS

2013-08-13 Thread Peter Chen
On Tue, Aug 13, 2013 at 10:23 PM, Fabio Estevam wrote: > On Tue, Aug 13, 2013 at 11:05 AM, Peter Chen wrote: > >> But what I see is the &dwc3_pci_dev_pm_ops is not NULL if CONFIG_PM_SLEEP >> is not defined. > > The point of this macro is that we do not need to provid

Re: [PATCH v15 00/13] Add tested id switch and vbus connect detect support for Chipidea

2013-08-13 Thread Peter Chen
On Mon, Aug 12, 2013 at 09:22:46AM +0800, Peter Chen wrote: > This patchset adds tested otg id switch function and vbus connect > and disconnect detection for chipidea driver. And fix kinds of > bugs found at chipidea drivers after enabling id and vbus detection. > > This patch a

Re: [patch] usb: chipidea: fix a NULL dereference on error

2013-08-16 Thread Peter Chen
gt;platdata->reg_vbus) > + regulator_disable(ci->platdata->reg_vbus); > > put_hcd: > usb_put_hcd(hcd); > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majord...@vger.kernel.org > M

Re: [PATCH 4/4] usb: chipidea: USB_CHIPIDEA should depend on HAS_DMA

2013-08-18 Thread Peter Chen
> controller based on ChipIdea silicon IP. Currently, only the I can't understand why the DMA can't be changed to fix this instead of changing every driver? -- 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] chipidea: ci_hdrc_imx: Fix MODULE_ALIAS()

2013-08-19 Thread Peter Chen
> MODULE_LICENSE("GPL v2"); > MODULE_DESCRIPTION("CI HDRC i.MX USB binding"); > MODULE_AUTHOR("Marek Vasut "); > -- > 1.8.1.2 > Acked-by: 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: USB gadget on mx6

2013-08-20 Thread Peter Chen
t; > However, I am not able to get USB ether to work. Hi Fabio, I have tried today's linux-next (Linux version 3.11.0-rc6-next-20130820+) The USB ether can be enumerated (I can't try usb-ethernet due to I use server's nfs), both default dts and dr_mode = "peripheral

Re: USB gadget on mx6

2013-08-20 Thread Peter Chen
On Wed, Aug 21, 2013 at 12:26:33AM -0300, Fabio Estevam wrote: > Hi Peter, > > On Tue, Aug 20, 2013 at 8:46 PM, Peter Chen wrote: > > On Mon, Aug 19, 2013 at 03:05:28PM -0300, Fabio Estevam wrote: > > > Hi Fabio, > > > > I have tried today's linux-nex

[PATCH 2/5] usb: chipidea: udc: Consolidate the calling of ci->driver->disconnect

2013-08-23 Thread Peter Chen
The udc-core will call gadget's driver->disconnect, so we should avoid calling gadget's disconnect again at ci_udc_stop in case the gadget's unbind free some structs which is still used at gadget's disconnect. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- dri

[PATCH 3/5] usb: chipidea: udc: fix the oops when plugs in usb cable after rmmod gadget

2013-08-23 Thread Peter Chen
dc86c [<805aa524>] (rest_init+0x0/0x80) from [<8077c860>] (start_kernel+0x2d8/0x334) [<8077c588>] (start_kernel+0x0/0x334) from [<10008074>] (0x10008074) Code: e59031e0 e51b203c e24b1034 e2820058 (e5933010) ---[ end trace f874b2c5533c04bc ]--- Kernel panic - not syncing: Fat

[PATCH 0/5] Chipidea Misc patchset

2013-08-23 Thread Peter Chen
Hi Alex, Below are un-queued chipidea patches, some of them were reviewd. Peter Chen (5): usb: host: delete chipidea dependency usb: chipidea: udc: Consolidate the calling of ci->driver->disconnect usb: chipidea: udc: fix the oops when plugs in usb cable after rmmod gadget

[PATCH 1/5] usb: host: delete chipidea dependency

2013-08-23 Thread Peter Chen
Now, chipidea host has already depended on USB_EHCI_HCD Acked-by: Alan Stern Signed-off-by: Peter Chen --- drivers/usb/host/Kconfig |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 344d5e2..61466c5 100644

[PATCH 4/5] usb: chipidea: Fix memleak for ci->hw_bank.regmap when driver removal

2013-08-23 Thread Peter Chen
It needs to free ci->hw_bank.regmap explicitly since it is not managed resource. Signed-off-by: Peter Chen --- drivers/usb/chipidea/core.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 9462640..2376

[PATCH 5/5] usb: chipidea: move more platform related things to ci_get_platdata

2013-08-23 Thread Peter Chen
Like vbus, the dr_mode and phy_mode are also got from glue layer's platform data or device node. Signed-off-by: Peter Chen --- drivers/usb/chipidea/core.c | 19 +-- 1 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/usb/chipidea/core.c b/driver

Re: [PATCH v2 1/1] usb: gadget: zero: Add flexible auto remote wakeup test method

2013-08-23 Thread Peter Chen
On Wed, Aug 07, 2013 at 05:18:13AM +0800, Peter Chen wrote: > In order to increase test coverage, we can change the interval between > two remote wakeups every time, and the interval can be any user defined > value. This change will no affect current behavior if the user does not

Re: [PATCH v15 00/13] Add tested id switch and vbus connect detect support for Chipidea

2013-08-26 Thread Peter Chen
On Mon, Aug 26, 2013 at 06:24:48PM +0200, Hector Palacios wrote: > Dear Peter, > > On 08/12/2013 03:22 AM, Peter Chen wrote: > >This patchset adds tested otg id switch function and vbus connect > >and disconnect detection for chipidea driver. And fix kinds of > >bug

[PATCH v2 4/5] usb: chipidea: Fix memleak for ci->hw_bank.regmap when driver removal

2013-08-27 Thread Peter Chen
It needs to free ci->hw_bank.regmap explicitly since it is not managed resource. Signed-off-by: Peter Chen --- drivers/usb/chipidea/core.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 9462640..2376

[PATCH v2 2/5] usb: chipidea: udc: Consolidate the calling of ci->driver->disconnect

2013-08-27 Thread Peter Chen
The udc-core will call gadget's driver->disconnect, so we should avoid calling gadget's disconnect again at ci_udc_stop in case the gadget's unbind free some structs which is still used at gadget's disconnect. Tested-by: Marek Vasut Signed-off-by: Peter Chen --- dri

[PATCH v2 0/5] Chipidea Misc patchset

2013-08-27 Thread Peter Chen
Changed for v2: - Fixed the build error for patch 5/5 Below are un-queued chipidea patches, some of them were reviewed. Peter Chen (5): usb: host: delete chipidea dependency usb: chipidea: udc: Consolidate the calling of ci->driver->disconnect usb: chipidea: udc: fix the oops when pl

[PATCH v2 5/5] usb: chipidea: move more platform related things to ci_get_platdata

2013-08-27 Thread Peter Chen
Like vbus, the dr_mode and phy_mode are also got from glue layer's platform data or device node. Signed-off-by: Peter Chen --- drivers/usb/chipidea/core.c | 19 +-- 1 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/usb/chipidea/core.c b/driver

[PATCH v2 3/5] usb: chipidea: udc: fix the oops when plugs in usb cable after rmmod gadget

2013-08-27 Thread Peter Chen
dc86c [<805aa524>] (rest_init+0x0/0x80) from [<8077c860>] (start_kernel+0x2d8/0x334) [<8077c588>] (start_kernel+0x0/0x334) from [<10008074>] (0x10008074) Code: e59031e0 e51b203c e24b1034 e2820058 (e5933010) ---[ end trace f874b2c5533c04bc ]--- Kernel panic - not syncing: Fat

[PATCH v2 1/5] usb: host: delete chipidea dependency

2013-08-27 Thread Peter Chen
Now, chipidea host has already depended on USB_EHCI_HCD Acked-by: Alan Stern Signed-off-by: Peter Chen --- drivers/usb/host/Kconfig |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 344d5e2..61466c5 100644

Re: [PATCH v2 0/5] Chipidea Misc patchset

2013-08-29 Thread Peter Chen
On Thu, Aug 29, 2013 at 10:53:50AM +0300, Alexander Shishkin wrote: > Peter Chen writes: > > > Changed for v2: > > - Fixed the build error for patch 5/5 > > > > Below are un-queued chipidea patches, some of them were reviewed. > > I'd like to send 1/5, 3

[PATCH 2/2] usb: chipidea: imx: add USB suspend/resume API for system PM

2013-09-03 Thread Peter Chen
Add suspend/resume API for system suspend/resume procedure. Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 72 +++- 1 files changed, 71 insertions(+), 1 deletions(-) diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea

[PATCH 1/2] usb: chipidea: add ci_hdrc_enter_lpm API

2013-09-03 Thread Peter Chen
It is used to let the PHY enters low power mode at controller suspend routine. Signed-off-by: Peter Chen --- drivers/usb/chipidea/bits.h |1 + drivers/usb/chipidea/core.c | 14 ++ include/linux/usb/chipidea.h |1 + 3 files changed, 16 insertions(+), 0 deletions(-) diff

Re: [PATCH 2/2] usb: chipidea: imx: add USB suspend/resume API for system PM

2013-09-03 Thread Peter Chen
On Tue, Sep 03, 2013 at 08:25:43AM -0300, Fabio Estevam wrote: > On Tue, Sep 3, 2013 at 6:26 AM, Peter Chen wrote: > > > +static const struct dev_pm_ops ci_hdrc_imx_pm_ops = { > > + SET_SYSTEM_SLEEP_PM_OPS(ci_hdrc_imx_suspend, ci_hdrc_imx_resume) > > Wh

Re: [PATCH 2/2] usb: chipidea: imx: add USB suspend/resume API for system PM

2013-09-03 Thread Peter Chen
On Tue, Sep 03, 2013 at 11:45:44PM -0300, Fabio Estevam wrote: > On Tue, Sep 3, 2013 at 10:16 PM, Peter Chen wrote: > > On Tue, Sep 03, 2013 at 08:25:43AM -0300, Fabio Estevam wrote: > >> On Tue, Sep 3, 2013 at 6:26 AM, Peter Chen > >> wrote: > >> &g

[PATCH 3/5] usb: chipidea: imx: Add usb_phy_shutdown at probe's error path

2013-09-09 Thread Peter Chen
If not, the PHY will be active even the controller is not in use. We find this issue due to the PHY's clock refcount is not correct due to -EPROBE_DEFER return after phy's init. Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c |7 +-- 1 files changed, 5 insert

[PATCH 2/2] usb: phy-mxs: Add auto clock and power setting

2013-09-09 Thread Peter Chen
With the auto setting, the PHY's clock and power can be recovered correctly from low power mode, it is ganranteed by IC logic. Besides, we enable the IC fixes for this PHY at mx6 platform. Signed-off-by: Peter Chen --- drivers/usb/phy/phy-mxs-usb.c | 30 ++--

[PATCH 1/2] usb: mxs-phy: Add platform judgement code

2013-09-09 Thread Peter Chen
The mxs-phy has three versions, each version has some differences among PHY operation. the 1st version is for mx23/mx28 SoC, The 2nd version is for mx6q and mx6dl, the 3rd version is for mx6sl and later mx6 platform. Signed-off-by: Peter Chen --- drivers/usb/phy/phy-mxs-usb.c | 64

[RESEND PATCH v2 1/1] usb: gadget: zero: Add flexible auto remote wakeup test method

2013-09-09 Thread Peter Chen
In order to increase test coverage, we can change the interval between two remote wakeups every time, and the interval can be any user defined value. This change will no affect current behavior if the user does not use two introduced module paramters. Signed-off-by: Peter Chen --- Changes for

<    1   2   3   4   5   6   7   8   9   10   >