RE: [RFC PATCH v2 02/15] usb:cdns3: Device side header file.

2018-11-29 Thread PETER CHEN
> + > +/* > + * USBSS-DEV register interface. > + * This corresponds to the USBSS Device Controller Interface */ > +/** > + * struct xhci_cap_regs - xHCI Host Controller Capability Registers. struct cdns3_usb_regs - device controller registers > +struct cdns3_device; > + > +struct

RE: [PATCH] ARM: dts: imx: Add dummy PHYs for HSIC-only USB controllers

2018-11-21 Thread PETER CHEN
> > On Thu, Oct 18, 2018 at 09:45:04AM +0200, Frieder Schrempf wrote: > > Some SOCs in the i.MX6 family have a USB host controller that is only > > capable of the HSIC interface and has no on-board PHY. > > > > To be able to use these controllers, we need to add "usb-nop-xceiv" > > dummy PHYs.

RE: [PATCH resend] usb: chipidea: Don't select EXTCON

2018-04-24 Thread Peter Chen
> > > > > > The patch doesn't remove extcon support from chipidea driver. > > > I just want to not select EXTCON unconditionally, but let the users > > > choose. If the users need extcon, they could enable EXTCON > > > themselves > > > > > > I just searched all the dts in arch/arm/boot/dts and >

RE: [PATCH resend] usb: chipidea: Don't select EXTCON

2018-04-20 Thread Peter Chen
> > > > Sorry to reply late, are you really care 2KB code side? Since many > > users use EXTCON to handle vbus and id, it is hard just delete it. I > > could accept patch for your specific platforms, like: > > > > + select EXTCON if !ARCH_ > > The patch doesn't remove extcon support from

RE: [PATCH v2] usb: chipidea: Hook into mux framework to toggle usb switch

2018-04-20 Thread Peter Chen
> >> @@ -3,6 +3,8 @@ config USB_CHIPIDEA > >>depends on ((USB_EHCI_HCD && USB_GADGET) || (USB_EHCI_HCD && > >> !USB_GADGET) || (!USB_EHCI_HCD && USB_GADGET)) && HAS_DMA > >>select EXTCON > >>select RESET_CONTROLLER > >> + select MULTIPLEXER > >> + select MUX_GPIO > > > > The above

RE: [PATCH v2] usb: chipidea: Hook into mux framework to toggle usb switch

2018-04-19 Thread Peter Chen
> --- a/drivers/usb/chipidea/Kconfig > +++ b/drivers/usb/chipidea/Kconfig > @@ -3,6 +3,8 @@ config USB_CHIPIDEA > depends on ((USB_EHCI_HCD && USB_GADGET) || (USB_EHCI_HCD > && !USB_GADGET) || (!USB_EHCI_HCD && USB_GADGET)) && HAS_DMA > select EXTCON > select RESET_CONTROLLER

RE: [PATCH resend] usb: chipidea: Don't select EXTCON

2018-04-19 Thread Peter Chen
> drivers/usb/chipidea/Kconfig | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/usb/chipidea/Kconfig b/drivers/usb/chipidea/Kconfig index > 785f0ed037f7..97509172d536 100644 > --- a/drivers/usb/chipidea/Kconfig > +++ b/drivers/usb/chipidea/Kconfig > @@ -1,7 +1,6 @@ > config

Re: [PATCH 2/2] usb: chipidea: imx: Fix ULPI on imx53

2018-02-06 Thread Peter Chen
On Tue, Feb 06, 2018 at 04:50:41PM +0100, Sebastian Reichel wrote: > Hi Peter, > > On Mon, Jan 29, 2018 at 11:33:15AM +0800, Peter Chen wrote: > > On Wed, Jan 24, 2018 at 06:14:39PM +0100, Sebastian Reichel wrote: > > > Traditionally, PORTSC should be set befor

Re: [PATCH 2/2] usb: chipidea: imx: Fix ULPI on imx53

2018-01-29 Thread Peter Chen
pm_runtime_put_noidle(>dev); > } > ci_hdrc_remove_device(data->ci_pdev); > + if (data->override_phy_control) > + usb_phy_shutdown(data->phy); > imx_disable_unprepare_clks(>dev); > Sebastian, I have a question, do you have any USB or generic PHY drivers for ULPI bus, any power controls are needed for your ULPI peripheral? -- Best Regards, Peter Chen

Re: [PATCH 2/2] usb: chipidea: imx: Fix ULPI on imx53

2018-01-25 Thread Peter Chen
pm_runtime_put_noidle(>dev); > } > ci_hdrc_remove_device(data->ci_pdev); > + if (data->override_phy_control) > + usb_phy_shutdown(data->phy); > imx_disable_unprepare_clks(>dev); > > return 0; > -- Applied both, thanks. -- Best Regards, Peter Chen

RE: [PATCH v1] usb: chipidea: tegra: Use aligned DMA on Tegra30

2017-12-20 Thread Peter Chen
> On Tue, Dec 19, 2017 at 05:58:07AM +0300, Dmitry Osipenko wrote: > > USB Ethernet gadget now works on Tegra30. > > > > Signed-off-by: Dmitry Osipenko > > --- > > drivers/usb/chipidea/ci_hdrc_tegra.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > Acked-by:

Re: [PATCH] USB: chipidea: msm: fix ulpi-node lookup

2017-12-12 Thread Peter Chen
On Tue, Dec 12, 2017 at 01:59:29PM +0100, Johan Hovold wrote: > On Tue, Dec 12, 2017 at 11:08:17AM +0800, Peter Chen wrote: > > On Mon, Nov 13, 2017 at 11:12:58AM +0100, Johan Hovold wrote: > > > Fix child-node lookup during probe, which ended up searching the whole > > &

Re: [PATCH] USB: chipidea: msm: fix ulpi-node lookup

2017-12-11 Thread Peter Chen
chipidea/ci_hdrc_msm.c > @@ -247,7 +247,7 @@ static int ci_hdrc_msm_probe(struct platform_device *pdev) > if (ret) > goto err_mux; > > - ulpi_node = of_find_node_by_name(of_node_get(pdev->dev.of_node), > "ulpi"); > + ulpi_node = of_get_child_by_name(pdev->dev.of_node, "ulpi"); Stephen, would you comment on it? I am afraid I can't find the benefit for this change. -- Best Regards, Peter Chen

Re: [PATCH v1 2/2] usb: chipidea: tegra: Select Tegra's PHY in Kconfig

2017-12-11 Thread Peter Chen
to enforce Tegra PHY to be compiled as built-in if > one > of ehci-tegra or chipidea drivers is built-in and the other is compiled as a > module. You may not bind controller driver with PHY driver in Kconfig, we need to make sure the controller driver has no build error if the PHY driver is not select. And if the PHY driver is not loaded, the controller driver should return -EPROBE_DEFER for it. -- Best Regards, Peter Chen

Re: [PATCH v16 2/7] power: add power sequence library

2017-07-20 Thread Peter Chen
On Wed, Jul 19, 2017 at 01:34:11PM +0200, Rafael J. Wysocki wrote: > On Wednesday, July 19, 2017 10:56:00 AM Peter Chen wrote: > > On Tue, Jul 18, 2017 at 07:06:05PM +0200, Rafael J. Wysocki wrote: > > > On Tue, Jul 18, 2017 at 6:29 AM, Peter Chen <hzpeterc...@gmail.com> wr

Re: [PATCH v16 2/7] power: add power sequence library

2017-07-18 Thread Peter Chen
On Tue, Jul 18, 2017 at 07:06:05PM +0200, Rafael J. Wysocki wrote: > On Tue, Jul 18, 2017 at 6:29 AM, Peter Chen <hzpeterc...@gmail.com> wrote: > > On Mon, Jul 17, 2017 at 03:39:07PM +0200, Rafael J. Wysocki wrote: > >> > Sorry, I should describe more. >

Re: [PATCH v2 2/3] usb: chipidea: Hook into mux framework to toggle usb switch

2017-07-18 Thread Peter Chen
On Tue, Jul 18, 2017 at 06:47:02PM -0700, Stephen Boyd wrote: > Quoting Peter Chen (2017-07-17 21:41:11) > > On Fri, Jul 14, 2017 at 02:40:04PM -0700, Stephen Boyd wrote: > > > > > > @@ -175,6 +176,10 @@ static int host_start(struct ci_hdrc *ci) > > >

Re: [PATCH] usb: chipidea: msm: ci_hdrc_msm_probe() missing of_node_get()

2017-07-18 Thread Peter Chen
(pdev->dev.of_node, "ulpi"); > + ulpi_node = of_find_node_by_name(of_node_get(pdev->dev.of_node), > "ulpi"); > if (ulpi_node) { > phy_node = of_get_next_available_child(ulpi_node, NULL); > ci->hsic = of_device_is_compatible(phy_node, > "qcom,usb-hsic-phy"); > -- Applied, thanks. -- Best Regards, Peter Chen

Re: [PATCH v2 2/3] usb: chipidea: Hook into mux framework to toggle usb switch

2017-07-17 Thread Peter Chen
struct ci_hdrc_cableid_extcon; > + struct mux_control *usb_switch; > u32 phy_clkgate_delay_us; > }; > > -- > 2.10.0.297.gf6727b0 > > > ___ > linux-arm-kernel mailing list > linux-arm-ker...@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel -- Best Regards, Peter Chen

Re: [PATCH v16 2/7] power: add power sequence library

2017-07-17 Thread Peter Chen
in the DT, find the node matching it > and read the power resuources information from there to populate the device's > power state structure. From that point on you can simply use the interface I > suggested. > Just like I said above, without initial power-up, the device can't be discovered by the bus. -- Best Regards, Peter Chen

Re: [PATCH v16 2/7] power: add power sequence library

2017-07-09 Thread Peter Chen
On Sat, Jul 08, 2017 at 02:14:56PM +0200, Rafael J. Wysocki wrote: > On Saturday, July 08, 2017 01:51:15 PM Peter Chen wrote: > > On Fri, Jul 07, 2017 at 03:03:06PM +0200, Rafael J. Wysocki wrote: > > > On Friday, July 07, 2017 04:01:07 PM Peter Chen wrote: > > > >

Re: [PATCH v16 2/7] power: add power sequence library

2017-07-07 Thread Peter Chen
On Fri, Jul 07, 2017 at 03:03:06PM +0200, Rafael J. Wysocki wrote: > On Friday, July 07, 2017 04:01:07 PM Peter Chen wrote: > > On Fri, Jul 07, 2017 at 03:13:48AM +0200, Rafael J. Wysocki wrote: > > > > > > > > - Can I write new code for it

Re: [PATCH v16 2/7] power: add power sequence library

2017-07-07 Thread Peter Chen
d out by an > > > additional layer of code to avoid imposing platform dependencies on > > > controller drivers. > > > > > > Further, what if there are "power sequences" for the host controllers > > > themselves? Who's expected to operate those "power sequences" then? > > > > See above. > > Let me rephrase. Assume that your host controller is a platform device and > it is not "on" when the SoC comes up. It has to be turned "on" via a "power > sequence". Who's expected to do that for it? > We can use power domain for it, doesn't need "power sequence" in this series introduces. -- Best Regards, Peter Chen

Re: [PATCH v16 2/7] power: add power sequence library

2017-07-05 Thread Peter Chen
On Wed, Jul 05, 2017 at 02:44:56AM +0200, Rafael J. Wysocki wrote: > On Wednesday, June 21, 2017 02:42:03 PM Peter Chen wrote: > > We have an well-known problem that the device needs to do some power > > sequence before it can be recognized by related host, the typical > > ex

[PATCH v16 3/7] binding-doc: usb: usb-device: add optional properties for power sequence

2017-06-21 Thread Peter Chen
Add optional properties for power sequence. Signed-off-by: Peter Chen <peter.c...@nxp.com> Acked-by: Rob Herring <r...@kernel.org> --- Documentation/devicetree/bindings/usb/usb-device.txt | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentatio

[PATCH v16 7/7] ARM: dts: imx6q-evi: Fix onboard hub reset line

2017-06-21 Thread Peter Chen
layton <stillcompil...@gmail.com> Signed-off-by: Peter Chen <peter.c...@nxp.com> --- arch/arm/boot/dts/imx6q-evi.dts | 25 +++-- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/arch/arm/boot/dts/imx6q-evi.dts b/arch/arm/boot/dts/imx6q-evi.dts index fd222

[PATCH v16 5/7] ARM: dts: imx6qdl: Enable usb node children with

2017-06-21 Thread Peter Chen
From: Joshua Clayton <stillcompil...@gmail.com> Give usb nodes #address and #size attributes, so that a child node representing a permanently connected device such as an onboard hub may be addressed with a attribute Signed-off-by: Joshua Clayton <stillcompil...@gmail.com> Signed-o

[PATCH v16 6/7] ARM: dts: imx6qdl-udoo.dtsi: fix onboard USB HUB property

2017-06-21 Thread Peter Chen
The current dts describes USB HUB's property at USB controller's entry, it is improper. The USB HUB should be the child node under USB controller, and power sequence properties are under it. Besides, using gpio pinctrl setting for USB2415's reset pin. Signed-off-by: Peter Chen <peter.c...@nxp.

[PATCH v16 4/7] usb: core: add power sequence handling for USB devices

2017-06-21 Thread Peter Chen
-off-by: Peter Chen <peter.c...@nxp.com> Tested-by Joshua Clayton <stillcompil...@gmail.com> Tested-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> Reviewed-by: Vaibhav Hiremath <hvaibhav.li...@gmail.com> Acked-by: Alan Stern <st...@rowland.harvard.edu> --- drivers/

[PATCH v16 1/7] binding-doc: power: pwrseq-generic: add binding doc for generic power sequence library

2017-06-21 Thread Peter Chen
Add binding doc for generic power sequence library. Signed-off-by: Peter Chen <peter.c...@nxp.com> Acked-by: Philipp Zabel <p.za...@pengutronix.de> Acked-by: Rob Herring <r...@kernel.org> --- .../bindings/power/pwrseq/pwrseq-generic.txt | 53 ++

[PATCH v16 2/7] power: add power sequence library

2017-06-21 Thread Peter Chen
instead (eg, USB hub driver). For new power sequence library, it needs to add its compatible string and allocation function at pwrseq_match_table_list, then the pwrseq core will match it with DT's, and choose this library at runtime. Signed-off-by: Peter Chen <peter.c...@nxp.com> Tested-by: Ma

[PATCH v16 0/7] power: add power sequence library

2017-06-21 Thread Peter Chen
6q-evi: Fix onboard hub reset line Peter Chen (5): binding-doc: power: pwrseq-generic: add binding doc for generic power sequence library power: add power sequence library binding-doc: usb: usb-device: add optional properties for power sequence usb: core: add power sequence handling for

Re: [PATCH v15 2/7] power: add power sequence library

2017-06-19 Thread Peter Chen
ry to be used. Then, pwrseq_XX_alloc_instance() will be called, > on demand and which tries to fetch the resources (clocks, gpios etc). > If any of those attempts fetching a resource fails, its corresponding > error code should be propagated to the caller - including > -EPROBE_DEFER. > > Regarding the "always compile all pwrseq libraries"; no we don't need > to do that. Instead we only need a to have a stub function for > pwrseq_XX_alloc_instance, in case its corresponding Kconfig option is > unset. That stub, should of course return an error code. > I will have a updated version for your suggestion, thanks. -- Best Regards, Peter Chen

Re: [PATCH v15 2/7] power: add power sequence library

2017-06-19 Thread Peter Chen
On Mon, Jun 19, 2017 at 10:09:58AM +0200, Ulf Hansson wrote: > On 15 June 2017 at 12:06, Peter Chen <hzpeterc...@gmail.com> wrote: > > On Thu, Jun 15, 2017 at 11:35:20AM +0200, Ulf Hansson wrote: > >> On 15 June 2017 at 11:11, Peter Chen <hzpeterc...@gmail.com> wrot

Re: [PATCH v15 2/7] power: add power sequence library

2017-06-18 Thread Peter Chen
On Thu, Jun 15, 2017 at 06:06:04PM +0800, Peter Chen wrote: > On Thu, Jun 15, 2017 at 11:35:20AM +0200, Ulf Hansson wrote: > > On 15 June 2017 at 11:11, Peter Chen <hzpeterc...@gmail.com> wrote: > > > On Thu, Jun 15, 2017 at 10:11:45AM +0200, Ulf Hansson wrote: >

Re: [PATCH v15 2/7] power: add power sequence library

2017-06-15 Thread Peter Chen
On Thu, Jun 15, 2017 at 11:35:20AM +0200, Ulf Hansson wrote: > On 15 June 2017 at 11:11, Peter Chen <hzpeterc...@gmail.com> wrote: > > On Thu, Jun 15, 2017 at 10:11:45AM +0200, Ulf Hansson wrote: > >> > Yes, you are right. This is the limitation for this po

Re: [PATCH v15 2/7] power: add power sequence library

2017-06-15 Thread Peter Chen
ail, won't it? > > > > Yes, you are right, thanks for pointing that, I will add mutex_lock for > > of_pwrseq_on. > > Another option is to entirely skip to two step approach. > > In other words, make the library to cope with multiple users via the > same registered library instance. > No, the pwrseq instance stores dtb information (clock, gpio, etc), it needs to be per device. -- Best Regards, Peter Chen

Re: [PATCH v15 2/7] power: add power sequence library

2017-06-15 Thread Peter Chen
On Wed, Jun 14, 2017 at 10:53:29AM +0200, Ulf Hansson wrote: > On 14 June 2017 at 03:53, Peter Chen <hzpeterc...@gmail.com> wrote: > > On Tue, Jun 13, 2017 at 12:24:42PM +0200, Ulf Hansson wrote: > >> [...] > >> > >> > + > >> > +/** > &g

Re: [PATCH v15 2/7] power: add power sequence library

2017-06-13 Thread Peter Chen
ances needs to be registered an > early boot level, to be safe. To me, that seems like poor design > choice. > > Otherwise I think this looks okay to me. > -- Best Regards, Peter Chen

[PATCH v15 2/7] power: add power sequence library

2017-06-12 Thread Peter Chen
instead (eg, USB hub driver). For new power sequence library, it can add its compatible string to pwrseq_of_match_table, then the pwrseq core will match it with DT's, and choose this library at runtime. Signed-off-by: Peter Chen <peter.c...@nxp.com> Tested-by: Maciej S. Szmigi

[PATCH v15 4/7] usb: core: add power sequence handling for USB devices

2017-06-12 Thread Peter Chen
-off-by: Peter Chen <peter.c...@nxp.com> Tested-by Joshua Clayton <stillcompil...@gmail.com> Tested-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> Reviewed-by: Vaibhav Hiremath <hvaibhav.li...@gmail.com> Acked-by: Alan Stern <st...@rowland.harvard.edu> --- drivers/

[PATCH v15 5/7] ARM: dts: imx6qdl: Enable usb node children with

2017-06-12 Thread Peter Chen
From: Joshua Clayton <stillcompil...@gmail.com> Give usb nodes #address and #size attributes, so that a child node representing a permanently connected device such as an onboard hub may be addressed with a attribute Signed-off-by: Joshua Clayton <stillcompil...@gmail.com> Signed-o

[PATCH v15 7/7] ARM: dts: imx6q-evi: Fix onboard hub reset line

2017-06-12 Thread Peter Chen
layton <stillcompil...@gmail.com> Signed-off-by: Peter Chen <peter.c...@nxp.com> --- arch/arm/boot/dts/imx6q-evi.dts | 25 +++-- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/arch/arm/boot/dts/imx6q-evi.dts b/arch/arm/boot/dts/imx6q-evi.dts index fd222

[PATCH v15 6/7] ARM: dts: imx6qdl-udoo.dtsi: fix onboard USB HUB property

2017-06-12 Thread Peter Chen
The current dts describes USB HUB's property at USB controller's entry, it is improper. The USB HUB should be the child node under USB controller, and power sequence properties are under it. Besides, using gpio pinctrl setting for USB2415's reset pin. Signed-off-by: Peter Chen <peter.c...@nxp.

[PATCH v15 1/7] binding-doc: power: pwrseq-generic: add binding doc for generic power sequence library

2017-06-12 Thread Peter Chen
Add binding doc for generic power sequence library. Signed-off-by: Peter Chen <peter.c...@nxp.com> Acked-by: Philipp Zabel <p.za...@pengutronix.de> Acked-by: Rob Herring <r...@kernel.org> --- .../bindings/power/pwrseq/pwrseq-generic.txt | 48 ++

[PATCH v15 3/7] binding-doc: usb: usb-device: add optional properties for power sequence

2017-06-12 Thread Peter Chen
Add optional properties for power sequence. Signed-off-by: Peter Chen <peter.c...@nxp.com> Acked-by: Rob Herring <r...@kernel.org> --- Documentation/devicetree/bindings/usb/usb-device.txt | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentatio

[PATCH v15 0/7] power: add power sequence library

2017-06-12 Thread Peter Chen
msg142815.html [4] http://www.spinics.net/lists/linux-usb/msg152375.html Joshua Clayton (2): ARM: dts: imx6qdl: Enable usb node children with ARM: dts: imx6q-evi: Fix onboard hub reset line Peter Chen (5): binding-doc: power: pwrseq-generic: add binding doc for generic power sequence lib

RE: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-06-11 Thread Peter Chen
> >Can you confirm that ULPI phys works with IMX6? > >It seems that IMX53 and IMX6 use the same chipidea controller and should have >the >same behaviour. So I wonder if the issue I encounter can be a SOC issue. > Fabien, all imx6 series uses UTMI PHYs, so I am afraid I can't verify it. Peter

RE: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-06-09 Thread Peter Chen
> >I have a look at your patches >(http://www.spinics.net/lists/linux-usb/msg157134.html) >and I wonder if power sequence is applicable only on hub node? No, power sequence can be used for any devices which needs to carry out power on before probe. > hub are probed too >late (after

Re: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-06-06 Thread Peter Chen
On Tue, Jun 06, 2017 at 07:36:10PM +0200, Fabien Lahoudere wrote: > Hi Peter, > > On Tue, 2017-06-06 at 09:55 +0800, Peter Chen wrote: > > On Mon, Jun 05, 2017 at 11:52:26AM +0200, Fabien Lahoudere wrote: > > > On Mon, 2017-06-05 at 17:43 +0800, Peter Chen wrote: >

Re: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-06-05 Thread Peter Chen
On Mon, Jun 05, 2017 at 11:52:26AM +0200, Fabien Lahoudere wrote: > On Mon, 2017-06-05 at 17:43 +0800, Peter Chen wrote: > > On Mon, Jun 05, 2017 at 10:57:00AM +0200, Fabien Lahoudere wrote: > > > On Fri, 2017-06-02 at 15:00 -0700, Stephen Boyd wrote: > > > > On

Re: [PATCH v14 4/7] usb: core: add power sequence handling for USB devices

2017-06-05 Thread Peter Chen
On Mon, Jun 05, 2017 at 10:16:34AM -0400, Alan Stern wrote: > On Mon, 5 Jun 2017, Peter Chen wrote: > > > On Thu, May 18, 2017 at 08:49:00AM +0800, Peter Chen wrote: > > > Some hard-wired USB devices need to do power sequence to let the > > > device work normally, t

Re: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-06-05 Thread Peter Chen
y_init(struct ci_hdrc *ci) >   return ret; >   hw_phymode_configure(ci); >   break; > - case USBPHY_INTERFACE_MODE_ULPI: >   case USBPHY_INTERFACE_MODE_SERIAL: >   hw_phymode_configure(ci); >   ret = _ci_usb_phy_init(ci); > --  Currently, the hw_phymode_configure is called twice for ULPI PHY, the two execution are between _ci_usb_phy_init, would you test which one causes hang? If the second causes hang, you can make a patch for hw_phymode_configure that if the required PORTSC_PTS is the same the value in register, do noop. -- Best Regards, Peter Chen

Re: [PATCH v14 4/7] usb: core: add power sequence handling for USB devices

2017-06-05 Thread Peter Chen
On Thu, May 18, 2017 at 08:49:00AM +0800, Peter Chen wrote: > Some hard-wired USB devices need to do power sequence to let the > device work normally, the typical power sequence like: enable USB > PHY clock, toggle reset pin, etc. But current Linux USB driver > lacks of such code to d

Re: [PATCH v14 2/7] power: add power sequence library

2017-06-05 Thread Peter Chen
On Thu, May 18, 2017 at 08:48:58AM +0800, Peter Chen wrote: > We have an well-known problem that the device needs to do some power > sequence before it can be recognized by related host, the typical > example like hard-wired mmc devices and usb devices. > > This power s

Re: [PATCH 5/7] USB: of: fix root-hub device-tree node handling

2017-06-04 Thread Peter Chen
et_of_node_from_dev(>dev, bus->sysdev); > dev_set_name(>dev, "usb%d", bus->busnum); > root_hub = 1; > } else { > -- > 2.13.0 I am OK with it, but I suggest adding it for new rc1 since it is based on the 1st patch which is a bug-fix. If this one is really needed for stable tree in future, you can cherry-pick it. -- Best Regards, Peter Chen

Re: [PATCH 1/7] USB: core: fix device node leak

2017-06-04 Thread Peter Chen
; Fixes: 69bec7259853 ("USB: core: let USB device know device node") > Cc: stable <sta...@vger.kernel.org> # v4.6 > Cc: Peter Chen <peter.c...@nxp.com> > Signed-off-by: Johan Hovold <jo...@kernel.org> > --- > drivers/usb/core/usb.c | 2 ++ > 1 file

Re: [PATCH] usb: chipidea: debug: check before accessing ci_role

2017-05-18 Thread Peter Chen
u trigger this issue? Do you mind sending another patch to fix the same issue for ci_role_show at core.c? -- Best Regards, Peter Chen

Re: [PATCH] usb: chipidea: debug: check before accessing ci_role

2017-05-18 Thread Peter Chen
> { > struct ci_hdrc *ci = s->private; > > - seq_printf(s, "%s\n", ci_role(ci)->name); > + if (ci->role != CI_ROLE_END) > + seq_printf(s, "%s\n", ci_role(ci)->name); > > return 0; > } I will queue it, and cc stable -- Best Regards, Peter Chen

[PATCH v14 4/7] usb: core: add power sequence handling for USB devices

2017-05-17 Thread Peter Chen
-off-by: Peter Chen <peter.c...@nxp.com> Tested-by Joshua Clayton <stillcompil...@gmail.com> Tested-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> Reviewed-by: Vaibhav Hiremath <hvaibhav.li...@gmail.com> --- drivers/usb/Kconfig| 1 + dri

[PATCH v14 7/7] ARM: dts: imx6q-evi: Fix onboard hub reset line

2017-05-17 Thread Peter Chen
layton <stillcompil...@gmail.com> Signed-off-by: Peter Chen <peter.c...@nxp.com> --- arch/arm/boot/dts/imx6q-evi.dts | 25 +++-- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/arch/arm/boot/dts/imx6q-evi.dts b/arch/arm/boot/dts/imx6q-evi.dts index fd222

[PATCH v14 6/7] ARM: dts: imx6qdl-udoo.dtsi: fix onboard USB HUB property

2017-05-17 Thread Peter Chen
The current dts describes USB HUB's property at USB controller's entry, it is improper. The USB HUB should be the child node under USB controller, and power sequence properties are under it. Besides, using gpio pinctrl setting for USB2415's reset pin. Signed-off-by: Peter Chen <peter.c...@nxp.

[PATCH v14 5/7] ARM: dts: imx6qdl: Enable usb node children with

2017-05-17 Thread Peter Chen
From: Joshua Clayton <stillcompil...@gmail.com> Give usb nodes #address and #size attributes, so that a child node representing a permanently connected device such as an onboard hub may be addressed with a attribute Signed-off-by: Joshua Clayton <stillcompil...@gmail.com> Signed-o

[PATCH v14 1/7] binding-doc: power: pwrseq-generic: add binding doc for generic power sequence library

2017-05-17 Thread Peter Chen
Add binding doc for generic power sequence library. Signed-off-by: Peter Chen <peter.c...@nxp.com> Acked-by: Philipp Zabel <p.za...@pengutronix.de> Acked-by: Rob Herring <r...@kernel.org> --- .../bindings/power/pwrseq/pwrseq-generic.txt | 48 ++

[PATCH v14 2/7] power: add power sequence library

2017-05-17 Thread Peter Chen
instead (eg, USB hub driver). For new power sequence library, it can add its compatible string to pwrseq_of_match_table, then the pwrseq core will match it with DT's, and choose this library at runtime. Signed-off-by: Peter Chen <peter.c...@nxp.com> Tested-by: Maciej S. Szmigi

[PATCH v14 3/7] binding-doc: usb: usb-device: add optional properties for power sequence

2017-05-17 Thread Peter Chen
Add optional properties for power sequence. Signed-off-by: Peter Chen <peter.c...@nxp.com> Acked-by: Rob Herring <r...@kernel.org> --- Documentation/devicetree/bindings/usb/usb-device.txt | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentatio

[PATCH v14 0/7] power: add power sequence library

2017-05-17 Thread Peter Chen
142815.html [4] http://www.spinics.net/lists/linux-usb/msg152375.html Joshua Clayton (2): ARM: dts: imx6qdl: Enable usb node children with ARM: dts: imx6q-evi: Fix onboard hub reset line Peter Chen (5): binding-doc: power: pwrseq-generic: add binding doc for generic power sequence library power

Re: [PATCH v13 00/12] power: add power sequence library

2017-05-16 Thread Peter Chen
On Tue, May 16, 2017 at 07:28:55PM +0200, Krzysztof Kozlowski wrote: > On Wed, Feb 15, 2017 at 09:38:09AM +0800, Peter Chen wrote: > > On Tue, Feb 14, 2017 at 12:21:48PM +0200, Roger Quadros wrote: > > > Peter, > > > > > > On 11/02/17 03:

Re: [PATCH] usb: chipidea: imx: Do not access CLKONOFF on i.MX51

2017-05-08 Thread Peter Chen
,7 @@ static const struct of_device_id usbmisc_imx_dt_ids[] = { > }, > { > .compatible = "fsl,imx51-usbmisc", > - .data = _usbmisc_ops, > + .data = _usbmisc_ops, > }, > { > .compatible = "fsl,imx53-usbmisc", Thanks for fixing it. I prefer using is_imx53_usbmisc stands for if it is imx53 usbmisc at usbmisc_imx53_init to fix it, you can prefer to: drivers/usb/phy/phy-mxs-usb.c. -- Best Regards, Peter Chen

RE: [PATCH] ARM: dts: imx6sx-sdb: Remove cpufreq OPP override

2017-04-26 Thread Peter Chen
> >The board file for imx6sx-dbg overrides cpufreq operating points to use higher >voltages. This is done because the board has a shared rail for VDD_ARM_IN and >VDD_SOC_IN and when using LDO bypass the shared voltage needs to be a value >suitable for both ARM and SOC. > >This was introduced in:

Re: [PATCH] usb: chipidea: udc: fix NULL pointer dereference if udc_start failed

2017-04-26 Thread Peter Chen
On Wed, Apr 26, 2017 at 04:25:26PM +0800, Jisheng Zhang wrote: > On Tue, 25 Apr 2017 17:21:59 +0200 > Stefan Wahren <stefan.wah...@i2se.com> wrote: > > > Am 25.04.2017 um 11:20 schrieb Peter Chen: > > > > > >>>> diff --git a/drivers

Re: [PATCH] usb: chipidea: properly handle host or gadget initialization failure

2017-04-26 Thread Peter Chen
ret); - goto stop; + goto deinit_gadget; } } @@ -1075,7 +1075,7 @@ static int ci_hdrc_probe(struct platform_device *pdev) remove_debug: dbg_remove_files(ci); stop: - if (ci->is_otg) + if (ci->is_otg && ci->roles[CI_ROLE_GADGET]) ci_hdrc_otg_destroy(ci); deinit_gadget: ci_hdrc_gadget_destroy(ci); -- Best Regards, Peter Chen

RE: [PATCH] usb: chipidea: udc: fix NULL pointer dereference if udc_start failed

2017-04-25 Thread Peter Chen
>> > diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c >> > index f88e9157fad0..60a786c87c06 100644 >> > --- a/drivers/usb/chipidea/udc.c >> > +++ b/drivers/usb/chipidea/udc.c >> > @@ -1984,6 +1984,7 @@ static void udc_id_switch_for_host(struct >> > ci_hdrc *ci) int

Re: [PATCH] usb: chipidea: udc: fix NULL pointer dereference if udc_start failed

2017-04-25 Thread Peter Chen
gt;roles[CI_ROLE_GADGET] = rdrv; > > - return udc_start(ci); > + ret = udc_start(ci); > + if (!ret) > + ci->roles[CI_ROLE_GADGET] = rdrv; > + > + return ret; > } > -- Thanks for fixing it. In fact, we'd better return failure if ret && ret != -ENXIO at probe, it stands for initialization for host or gadget has failed. -- Best Regards, Peter Chen

Re: [PATCH] usb: chipidea: Fix missing resume call after suspend

2017-04-25 Thread Peter Chen
On Mon, Apr 24, 2017 at 01:25:21PM +, Bernhard Walle wrote: > Hi, > > > Peter Chen <peter.c...@nxp.com> hat am 24. April 2017 um 05:51 geschrieben: > > > > > The current code logic is: > > - When the resume is received from host, the ci->dirver->r

Re: [PATCH] usb: chipidea: Fix missing resume call after suspend

2017-04-23 Thread Peter Chen
sume doesn't need to be called. There is a patch to fix clear suspended even the ci->driver->resume is NULL at v4.12-rc1. usb: chipidea: udc: update gadget state after bus resume -- Best Regards, Peter Chen

Re: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-04-20 Thread Peter Chen
itialization path. > > A new compatible string "smsc,usb3315" is used to decide which > initialization path to use. > Hi Peter, This is an ULPI PHY, so it is not suitable using generic USB PHY. Taking a look of drivers/phy/phy-qcom-usb-hs.c, you may have some clues.

Re: [PATCH] usb: gadget: remove redundant self assignment

2017-04-17 Thread Peter Chen
adget/udc/core.c > +++ b/drivers/usb/gadget/udc/core.c > @@ -139,10 +139,8 @@ int usb_ep_disable(struct usb_ep *ep) > goto out; > > ret = ep->ops->disable(ep); > - if (ret) { > - ret = ret; > + if (ret) > goto out; >

Re: [PATCH] chipidea: Fix issue in reconnecing gadget without insmod/rmmod

2017-04-14 Thread Peter Chen
isconnected. > > > > You don't need to use above two methods together, I suggest using the > > 2nd method since OTG FSM is hard to maintain due to no mandatory use > > case for it. > > > > -- > > > > Best Regards, > > Peter Chen > > T

Re: [PATCH] chipidea: Fix issue in reconnecing gadget without insmod/rmmod

2017-04-12 Thread Peter Chen
, and using sysfs entries under /sys/bus/platform/devices/ci_hdrc.0/inputs but you may need to patch code to keep vbus always on for A-device, it is not compliance with OTG spec. - Using role interface under debugfs (I move it under sysfs for v4.12). But you need to patch the code and let the A-device switch back to host after iAP is disconnected. You don't need to use above two methods together, I suggest using the 2nd method since OTG FSM is hard to maintain due to no mandatory use case for it. -- Best Regards, Peter Chen

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-08 Thread Peter Chen
On Wed, Mar 08, 2017 at 06:44:47AM -0800, Guenter Roeck wrote: > On 03/07/2017 10:50 PM, Peter Chen wrote: > > > >>>>You mean type-C trigger an ACPI event, and this ACPI event can notify > >>>>related USB controller driver doing role switch? > >&

RE: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-07 Thread Peter Chen
>>> You mean type-C trigger an ACPI event, and this ACPI event can notify >>> related USB controller driver doing role switch? >> >> No (firmware programs the dual-role hw/registers), but never mind. >> That could be the case. >> >>> If it is correct, there is a notifier between type-C and USB

RE: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-07 Thread Peter Chen
> >On Mon, Mar 06, 2017 at 09:15:51AM +0800, Peter Chen wrote: >> > > What interface you use when you receive this event to handle >> > > dual-role switch? I am wonder if a common dual-role class is >> > > needed, then we can have a common user uti

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-05 Thread Peter Chen
On Fri, Mar 03, 2017 at 06:36:50AM -0800, Guenter Roeck wrote: > On 03/02/2017 08:52 PM, Peter Chen wrote: > >On Thu, Mar 02, 2017 at 08:29:07PM -0800, Guenter Roeck wrote: > >>On 03/02/2017 07:35 PM, Peter Chen wrote: > >>>On Tue, Feb 21, 2017 at 05:24:04P

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-05 Thread Peter Chen
On Fri, Mar 03, 2017 at 04:31:33PM +0200, Heikki Krogerus wrote: > Hi Peter, > > On Fri, Mar 03, 2017 at 11:35:29AM +0800, Peter Chen wrote: > > On Tue, Feb 21, 2017 at 05:24:04PM +0300, Heikki Krogerus wrote: > > > +/* --- */ &g

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-03 Thread Peter Chen
ole Maybe we can enhance Roger's drd framework [1] to fulfill that. [1] https://lwn.net/Articles/682531/ -- Best Regards, Peter Chen

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-03 Thread Peter Chen
On Thu, Mar 02, 2017 at 08:29:07PM -0800, Guenter Roeck wrote: > On 03/02/2017 07:35 PM, Peter Chen wrote: > >On Tue, Feb 21, 2017 at 05:24:04PM +0300, Heikki Krogerus wrote: > >>+/* --- */ > >>+/* Driver callb

Re: [LKP] [usb] bea5b158ff WARNING: CPU: 0 PID: 25 at drivers/usb/core/urb.c:338 usb_submit_urb

2017-02-27 Thread Peter Chen
On Tue, Feb 28, 2017 at 12:32:55PM +0800, Ye Xiaolong wrote: > On 02/28, Ye Xiaolong wrote: > >On 02/27, Peter Chen wrote: > >>On Sun, Feb 26, 2017 at 06:19:59PM +0800, Fengguang Wu wrote: > >>> [Sorry, resend to correct Felipe's email address] > >>> >

Re: [usb] bea5b158ff WARNING: CPU: 0 PID: 25 at drivers/usb/core/urb.c:338 usb_submit_urb

2017-02-27 Thread Peter Chen
On Sun, Feb 26, 2017 at 06:19:59PM +0800, Fengguang Wu wrote: > [Sorry, resend to correct Felipe's email address] > > Greetings, > > This debug patch possibly discloses some USB/I2C bugs. Since the USB > warning shows up earlier in dmesg, it might also be the root cause of > the I2C bug. The

Re: [PATCH v2 4/4] usb: dwc3: Workaround for super-speed host on dra7 in dual-role mode

2017-02-23 Thread Peter Chen
dwc->edev = extcon_get_edev_by_phandle(dev, 0); > > Don't we want separate edev's for vbus and id ? > One can have separate pins connected to them and in that case > we can't get the events out of one pin only. > Current extcon-usb-gpio driver supports id and vbus at the same time, that means there are two optional gpios under one extcon node. -- Best Regards, Peter Chen

Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA configuration

2017-02-15 Thread Peter Chen
rm device for xhci on the fly and set the DT > >>> properties. > >>> > >> > >> By readying code, the dwc3 calls dwc3_get_properties to set > >> dwc->usb3_lpm_capable, and at dwc3/host.c, it sets property > >> "usb3-lpm-capable" according to this flag, why not let common > >> code xhci-plat.c to get this property from sysdev which is DT > >> nodes for dwc3? > >> > > > > Felipe, any comments? > > Won't work. We have quirk flags which are based on DWC3's revision which > is not accessible by xhci-plat. Also, we can't call > device_add_property() because it's not really *adding*. It's *setting*, > meaning that we would loose all other properties. > Sorry, I am not clear by reading the code, here we just discuss "usb3-lpm-capable" property from DT or other firmwares. -- Best Regards, Peter Chen

Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA configuration

2017-02-15 Thread Peter Chen
On Wed, Feb 15, 2017 at 10:18:03AM +0200, Roger Quadros wrote: > Peter, > > On 15/02/17 03:35, Peter Chen wrote: > > On Tue, Feb 14, 2017 at 01:58:40PM +0100, Arnd Bergmann wrote: > >> On Tue, Feb 14, 2017 at 1:26 PM, Roger Quadros <rog...@ti.com> wrote: > >

Re: [PATCH v13 00/12] power: add power sequence library

2017-02-14 Thread Peter Chen
On Tue, Feb 14, 2017 at 12:21:48PM +0200, Roger Quadros wrote: > Peter, > > On 11/02/17 03:27, Peter Chen wrote: > > Hi all, > > > > This is a follow-up for my last power sequence framework patch set [1]. > > According to Rob Herring and Ulf Hansson's comments[2]

Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA configuration

2017-02-14 Thread Peter Chen
_capable"? Why not using "usb3-lpm-capable" at firmware directly? Peter > > Hmm, ideally we would only have properties on one of the two, since we > refer to the sysdev for the properties regarding DMA and PHY among other > things, but I guess that's not an option here, since we can't call > platform_device_add_properties() on a dwc_pci device and have to > use the xhci pdev instead. > > Arnd > -- Best Regards, Peter Chen

RE: [PATCH v7 5/5] usb: doc: add document for USB3 debug port usage

2017-02-13 Thread Peter Chen
> >On 02/14/2017 11:45 AM, Peter Chen wrote: >> On Tue, Feb 14, 2017 at 10:27 AM, Lu Baolu <baolu...@linux.intel.com> wrote: >> >>> Add Documentation/usb/usb3-debug-port.rst. This document includes the >>> user guide for USB3 debug port. >>&g

Re: [PATCH] usb: misc: usbtest: remove redundant check on retval < 0

2017-02-13 Thread Peter Chen
/* usb2.0 but not high-speed capable; fine */ > } else if (retval != sizeof(struct usb_qualifier_descriptor)) { Reviewed-by: Peter Chen <peter.c...@nxp.com> -- Best Regards, Peter Chen

[PATCH 1/1] extcon: ext-usb-gpio: do not enable USB as wakeup source by default

2017-02-13 Thread Peter Chen
Whether the USB port as a wakeup source should be determined by user, but not enabled by default. Signed-off-by: Peter Chen <peter.c...@nxp.com> --- drivers/extcon/extcon-usb-gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/extcon/extcon-usb-gpio.c b/d

[PATCH v13 07/12] usb: ehci: use bus->sysdev for DMA configuration

2017-02-10 Thread Peter Chen
Set the dma for ehci from sysdev. The sysdev is pointing to device that is known to the system firmware or hardware. Cc: Arnd Bergmann <a...@arndb.de> Cc: Sriram Dash <sriram.d...@nxp.com> Signed-off-by: Peter Chen <peter.c...@nxp.com> Acked-by: Alan Stern <st...@rowland.harv

[PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA configuration

2017-02-10 Thread Peter Chen
From: Arnd Bergmann For xhci-hcd platform device, all the DMA parameters are not configured properly, notably dma ops for dwc3 devices. So, set the dma for xhci from sysdev. sysdev is pointing to device that is known to the system firmware or hardware. Cc: Baolin Wang

[PATCH v13 10/12] ARM: dts: imx6qdl: Enable usb node children with

2017-02-10 Thread Peter Chen
From: Joshua Clayton <stillcompil...@gmail.com> Give usb nodes #address and #size attributes, so that a child node representing a permanently connected device such as an onboard hub may be addressed with a attribute Signed-off-by: Joshua Clayton <stillcompil...@gmail.com> Signed-o

  1   2   3   4   5   6   7   8   9   10   >