* [PATCH 0/4] usb: chipidea: msm: Clean and fix glue layer driver @ 2013-11-11 13:35 Ivan T. Ivanov [not found] ` <1384176937-1658-1-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> ` (3 more replies) 0 siblings, 4 replies; 27+ messages in thread From: Ivan T. Ivanov @ 2013-11-11 13:35 UTC (permalink / raw) To: alexander.shishkin Cc: gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel, Ivan T. Ivanov From: "Ivan T. Ivanov" <iivanov@mm-sol.com> Hi, This series intend to fixup driver, which was broken for a while. It is used to create peripheral role device, which in coordination with phy-usb-msm driver (still some cleanups pending) will provide again USB2.0 gadget support for MSM targets. Generated on to top of usb-3.13-rc1. Regards, Ivan Ivan T. Ivanov (4): usb: chipidea: msm: Add device tree binding information usb: chipidea: msm: Add device tree support usb: chipidea: msm: Initialize offset of the capability registers usb: chipidea: msm: Use USB PHY API to control PHY state .../devicetree/bindings/usb/msm-hsusb.txt | 16 ++++++++++ drivers/usb/chipidea/ci_hdrc_msm.c | 33 +++++++++++++++----- 2 files changed, 41 insertions(+), 8 deletions(-) -- 1.7.9.5 ^ permalink raw reply [flat|nested] 27+ messages in thread
[parent not found: <1384176937-1658-1-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>]
* [PATCH 1/4] usb: chipidea: msm: Add device tree binding information 2013-11-11 13:35 [PATCH 0/4] usb: chipidea: msm: Clean and fix glue layer driver Ivan T. Ivanov @ 2013-11-11 13:35 ` Ivan T. Ivanov 2013-11-11 13:35 ` [PATCH 3/4] usb: chipidea: msm: Initialize offset of the capability registers Ivan T. Ivanov ` (2 subsequent siblings) 3 siblings, 0 replies; 27+ messages in thread From: Ivan T. Ivanov @ 2013-11-11 13:35 UTC (permalink / raw) To: alexander.shishkin-VuQAYsv1563Yd54FQh9/CA Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, rob.herring-bsGFqQB8/DxBDgjK7y7TUQ, pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8, swarren-3lzwWm7+Weoh9ZMKESR00Q, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg, davidb-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Ivan T. Ivanov, devicetree-u79uwXL29TY76Z2rM5mHXA From: "Ivan T. Ivanov" <iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> Signed-off-by: Ivan T. Ivanov <iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org --- .../devicetree/bindings/usb/msm-hsusb.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/msm-hsusb.txt b/Documentation/devicetree/bindings/usb/msm-hsusb.txt index 5ea26c6..0a85eba 100644 --- a/Documentation/devicetree/bindings/usb/msm-hsusb.txt +++ b/Documentation/devicetree/bindings/usb/msm-hsusb.txt @@ -15,3 +15,19 @@ Example EHCI controller device node: usb-phy = <&usb_otg>; }; +CI13xxx (Chipidea) USB controllers + +Required properties: +- compatible: should contain "qcom,ci-hdrc" +- reg: offset and length of the register set in the memory map +- interrupts: interrupt-specifier for the controller interrupt. +- usb-phy: phandle for the PHY device +- dr_mode: Sould be "peripheral" + + gadget@f9a55000 { + compatible = "qcom,ci-hdrc"; + reg = <0xf9a55000 0x400>; + dr_mode = "peripheral"; + interrupts = <0 134 0>; + usb-phy = <&usb_otg>; + }; \ No newline at end of file -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 1/4] usb: chipidea: msm: Add device tree binding information @ 2013-11-11 13:35 ` Ivan T. Ivanov 0 siblings, 0 replies; 27+ messages in thread From: Ivan T. Ivanov @ 2013-11-11 13:35 UTC (permalink / raw) To: alexander.shishkin Cc: gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel, Ivan T. Ivanov, devicetree From: "Ivan T. Ivanov" <iivanov@mm-sol.com> Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> Cc: devicetree@vger.kernel.org --- .../devicetree/bindings/usb/msm-hsusb.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/msm-hsusb.txt b/Documentation/devicetree/bindings/usb/msm-hsusb.txt index 5ea26c6..0a85eba 100644 --- a/Documentation/devicetree/bindings/usb/msm-hsusb.txt +++ b/Documentation/devicetree/bindings/usb/msm-hsusb.txt @@ -15,3 +15,19 @@ Example EHCI controller device node: usb-phy = <&usb_otg>; }; +CI13xxx (Chipidea) USB controllers + +Required properties: +- compatible: should contain "qcom,ci-hdrc" +- reg: offset and length of the register set in the memory map +- interrupts: interrupt-specifier for the controller interrupt. +- usb-phy: phandle for the PHY device +- dr_mode: Sould be "peripheral" + + gadget@f9a55000 { + compatible = "qcom,ci-hdrc"; + reg = <0xf9a55000 0x400>; + dr_mode = "peripheral"; + interrupts = <0 134 0>; + usb-phy = <&usb_otg>; + }; \ No newline at end of file -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 1/4] usb: chipidea: msm: Add device tree binding information 2013-11-11 13:35 ` Ivan T. Ivanov @ 2013-12-04 5:40 ` Peter Chen -1 siblings, 0 replies; 27+ messages in thread From: Peter Chen @ 2013-12-04 5:40 UTC (permalink / raw) To: Ivan T. Ivanov Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel, devicetree On Mon, Nov 11, 2013 at 03:35:34PM +0200, Ivan T. Ivanov wrote: > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > Please add something in commit log > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> > Cc: devicetree@vger.kernel.org > --- > .../devicetree/bindings/usb/msm-hsusb.txt | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/Documentation/devicetree/bindings/usb/msm-hsusb.txt b/Documentation/devicetree/bindings/usb/msm-hsusb.txt > index 5ea26c6..0a85eba 100644 > --- a/Documentation/devicetree/bindings/usb/msm-hsusb.txt > +++ b/Documentation/devicetree/bindings/usb/msm-hsusb.txt > @@ -15,3 +15,19 @@ Example EHCI controller device node: > usb-phy = <&usb_otg>; > }; > > +CI13xxx (Chipidea) USB controllers > + We have already renamed ci13xxx to ci_hdrc. > +Required properties: > +- compatible: should contain "qcom,ci-hdrc" > +- reg: offset and length of the register set in the memory map > +- interrupts: interrupt-specifier for the controller interrupt. > +- usb-phy: phandle for the PHY device > +- dr_mode: Sould be "peripheral" > + Please keep alignment for "reg" Peter > + gadget@f9a55000 { > + compatible = "qcom,ci-hdrc"; > + reg = <0xf9a55000 0x400>; > + dr_mode = "peripheral"; > + interrupts = <0 134 0>; > + usb-phy = <&usb_otg>; > + }; > \ No newline at end of file > -- > 1.7.9.5 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- Best Regards, Peter Chen ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 1/4] usb: chipidea: msm: Add device tree binding information @ 2013-12-04 5:40 ` Peter Chen 0 siblings, 0 replies; 27+ messages in thread From: Peter Chen @ 2013-12-04 5:40 UTC (permalink / raw) To: Ivan T. Ivanov Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel, devicetree On Mon, Nov 11, 2013 at 03:35:34PM +0200, Ivan T. Ivanov wrote: > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > Please add something in commit log > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> > Cc: devicetree@vger.kernel.org > --- > .../devicetree/bindings/usb/msm-hsusb.txt | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/Documentation/devicetree/bindings/usb/msm-hsusb.txt b/Documentation/devicetree/bindings/usb/msm-hsusb.txt > index 5ea26c6..0a85eba 100644 > --- a/Documentation/devicetree/bindings/usb/msm-hsusb.txt > +++ b/Documentation/devicetree/bindings/usb/msm-hsusb.txt > @@ -15,3 +15,19 @@ Example EHCI controller device node: > usb-phy = <&usb_otg>; > }; > > +CI13xxx (Chipidea) USB controllers > + We have already renamed ci13xxx to ci_hdrc. > +Required properties: > +- compatible: should contain "qcom,ci-hdrc" > +- reg: offset and length of the register set in the memory map > +- interrupts: interrupt-specifier for the controller interrupt. > +- usb-phy: phandle for the PHY device > +- dr_mode: Sould be "peripheral" > + Please keep alignment for "reg" Peter > + gadget@f9a55000 { > + compatible = "qcom,ci-hdrc"; > + reg = <0xf9a55000 0x400>; > + dr_mode = "peripheral"; > + interrupts = <0 134 0>; > + usb-phy = <&usb_otg>; > + }; > \ No newline at end of file > -- > 1.7.9.5 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- Best Regards, Peter Chen ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 1/4] usb: chipidea: msm: Add device tree binding information 2013-12-04 5:40 ` Peter Chen (?) @ 2013-12-04 8:33 ` Ivan T. Ivanov 2013-12-04 13:13 ` Peter Chen -1 siblings, 1 reply; 27+ messages in thread From: Ivan T. Ivanov @ 2013-12-04 8:33 UTC (permalink / raw) To: Peter Chen Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel, devicetree Hi Peter, Thank you for reviewing this patch. On Wed, 2013-12-04 at 13:40 +0800, Peter Chen wrote: > On Mon, Nov 11, 2013 at 03:35:34PM +0200, Ivan T. Ivanov wrote: > > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > > > > Please add something in commit log > > > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> > > Cc: devicetree@vger.kernel.org > > --- > > .../devicetree/bindings/usb/msm-hsusb.txt | 16 ++++++++++++++++ > > 1 file changed, 16 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/usb/msm-hsusb.txt b/Documentation/devicetree/bindings/usb/msm-hsusb.txt > > index 5ea26c6..0a85eba 100644 > > --- a/Documentation/devicetree/bindings/usb/msm-hsusb.txt > > +++ b/Documentation/devicetree/bindings/usb/msm-hsusb.txt > > @@ -15,3 +15,19 @@ Example EHCI controller device node: > > usb-phy = <&usb_otg>; > > }; > > > > +CI13xxx (Chipidea) USB controllers > > + > > We have already renamed ci13xxx to ci_hdrc. Yes, but the chip is still CI13XXX. Freescale documentations is also referring to actual chip family. > > > +Required properties: > > +- compatible: should contain "qcom,ci-hdrc" > > +- reg: offset and length of the register set in the memory map > > +- interrupts: interrupt-specifier for the controller interrupt. > > +- usb-phy: phandle for the PHY device > > +- dr_mode: Sould be "peripheral" > > + > > Please keep alignment for "reg" > It looks aligned in editor with smart-tab support. Regards, Ivan > Peter > > > + gadget@f9a55000 { > > + compatible = "qcom,ci-hdrc"; > > + reg = <0xf9a55000 0x400>; > > + dr_mode = "peripheral"; > > + interrupts = <0 134 0>; > > + usb-phy = <&usb_otg>; > > + }; > > \ No newline at end of file > > -- > > 1.7.9.5 > > > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > > ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 1/4] usb: chipidea: msm: Add device tree binding information 2013-12-04 8:33 ` Ivan T. Ivanov @ 2013-12-04 13:13 ` Peter Chen 0 siblings, 0 replies; 27+ messages in thread From: Peter Chen @ 2013-12-04 13:13 UTC (permalink / raw) To: Ivan T. Ivanov Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel, devicetree On Wed, Dec 04, 2013 at 10:33:57AM +0200, Ivan T. Ivanov wrote: > Hi Peter, > > Thank you for reviewing this patch. > > On Wed, 2013-12-04 at 13:40 +0800, Peter Chen wrote: > > On Mon, Nov 11, 2013 at 03:35:34PM +0200, Ivan T. Ivanov wrote: > > > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > > > > > > > Please add something in commit log > > > > > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> > > > Cc: devicetree@vger.kernel.org > > > --- > > > .../devicetree/bindings/usb/msm-hsusb.txt | 16 ++++++++++++++++ > > > 1 file changed, 16 insertions(+) > > > > > > diff --git a/Documentation/devicetree/bindings/usb/msm-hsusb.txt b/Documentation/devicetree/bindings/usb/msm-hsusb.txt > > > index 5ea26c6..0a85eba 100644 > > > --- a/Documentation/devicetree/bindings/usb/msm-hsusb.txt > > > +++ b/Documentation/devicetree/bindings/usb/msm-hsusb.txt > > > @@ -15,3 +15,19 @@ Example EHCI controller device node: > > > usb-phy = <&usb_otg>; > > > }; > > > > > > +CI13xxx (Chipidea) USB controllers > > > + > > > > We have already renamed ci13xxx to ci_hdrc. > > Yes, but the chip is still CI13XXX. Freescale documentations is also > referring to actual chip family. OK, let's keep IP reference at doc. I will change the Freescale doc name from ci13xxx-imx.txt to ci-hdrc-imx.txt > > > > > > +Required properties: > > > +- compatible: should contain "qcom,ci-hdrc" > > > +- reg: offset and length of the register set in the memory map > > > +- interrupts: interrupt-specifier for the controller interrupt. > > > +- usb-phy: phandle for the PHY device > > > +- dr_mode: Sould be "peripheral" > > > + > > > > Please keep alignment for "reg" > > > > It looks aligned in editor with smart-tab support. > OK, let's keep it -- Best Regards, Peter Chen ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 1/4] usb: chipidea: msm: Add device tree binding information @ 2013-12-04 13:13 ` Peter Chen 0 siblings, 0 replies; 27+ messages in thread From: Peter Chen @ 2013-12-04 13:13 UTC (permalink / raw) To: Ivan T. Ivanov Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel, devicetree On Wed, Dec 04, 2013 at 10:33:57AM +0200, Ivan T. Ivanov wrote: > Hi Peter, > > Thank you for reviewing this patch. > > On Wed, 2013-12-04 at 13:40 +0800, Peter Chen wrote: > > On Mon, Nov 11, 2013 at 03:35:34PM +0200, Ivan T. Ivanov wrote: > > > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > > > > > > > Please add something in commit log > > > > > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> > > > Cc: devicetree@vger.kernel.org > > > --- > > > .../devicetree/bindings/usb/msm-hsusb.txt | 16 ++++++++++++++++ > > > 1 file changed, 16 insertions(+) > > > > > > diff --git a/Documentation/devicetree/bindings/usb/msm-hsusb.txt b/Documentation/devicetree/bindings/usb/msm-hsusb.txt > > > index 5ea26c6..0a85eba 100644 > > > --- a/Documentation/devicetree/bindings/usb/msm-hsusb.txt > > > +++ b/Documentation/devicetree/bindings/usb/msm-hsusb.txt > > > @@ -15,3 +15,19 @@ Example EHCI controller device node: > > > usb-phy = <&usb_otg>; > > > }; > > > > > > +CI13xxx (Chipidea) USB controllers > > > + > > > > We have already renamed ci13xxx to ci_hdrc. > > Yes, but the chip is still CI13XXX. Freescale documentations is also > referring to actual chip family. OK, let's keep IP reference at doc. I will change the Freescale doc name from ci13xxx-imx.txt to ci-hdrc-imx.txt > > > > > > +Required properties: > > > +- compatible: should contain "qcom,ci-hdrc" > > > +- reg: offset and length of the register set in the memory map > > > +- interrupts: interrupt-specifier for the controller interrupt. > > > +- usb-phy: phandle for the PHY device > > > +- dr_mode: Sould be "peripheral" > > > + > > > > Please keep alignment for "reg" > > > > It looks aligned in editor with smart-tab support. > OK, let's keep it -- Best Regards, Peter Chen ^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 2/4] usb: chipidea: msm: Add device tree support 2013-11-11 13:35 [PATCH 0/4] usb: chipidea: msm: Clean and fix glue layer driver Ivan T. Ivanov @ 2013-11-11 13:35 ` Ivan T. Ivanov 2013-11-11 13:35 ` [PATCH 3/4] usb: chipidea: msm: Initialize offset of the capability registers Ivan T. Ivanov ` (2 subsequent siblings) 3 siblings, 0 replies; 27+ messages in thread From: Ivan T. Ivanov @ 2013-11-11 13:35 UTC (permalink / raw) To: alexander.shishkin-VuQAYsv1563Yd54FQh9/CA Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, rob.herring-bsGFqQB8/DxBDgjK7y7TUQ, pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8, swarren-3lzwWm7+Weoh9ZMKESR00Q, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg, davidb-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Ivan T. Ivanov, devicetree-u79uwXL29TY76Z2rM5mHXA From: "Ivan T. Ivanov" <iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> Allows controller to be specified via device tree. Pass PHY phandle specified in DT to core driver. Signed-off-by: Ivan T. Ivanov <iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org --- drivers/usb/chipidea/ci_hdrc_msm.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c index 2d51d85..747d6c1 100644 --- a/drivers/usb/chipidea/ci_hdrc_msm.c +++ b/drivers/usb/chipidea/ci_hdrc_msm.c @@ -57,9 +57,21 @@ static struct ci_hdrc_platform_data ci_hdrc_msm_platdata = { static int ci_hdrc_msm_probe(struct platform_device *pdev) { struct platform_device *plat_ci; + struct usb_phy *phy; dev_dbg(&pdev->dev, "ci_hdrc_msm_probe\n"); + /* + * OTG(PHY) driver takes care of PHY initialization, clock management, + * powering up VBUS, mapping of registers address space and power + * management. + */ + phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0); + if (IS_ERR(phy)) + return PTR_ERR(phy); + else + ci_hdrc_msm_platdata.phy = phy; + plat_ci = ci_hdrc_add_device(&pdev->dev, pdev->resource, pdev->num_resources, &ci_hdrc_msm_platdata); @@ -86,10 +98,19 @@ static int ci_hdrc_msm_remove(struct platform_device *pdev) return 0; } +static struct of_device_id msm_ci_dt_match[] = { + { .compatible = "qcom,ci-hdrc", }, + { } +}; +MODULE_DEVICE_TABLE(of, msm_ci_dt_match); + static struct platform_driver ci_hdrc_msm_driver = { .probe = ci_hdrc_msm_probe, .remove = ci_hdrc_msm_remove, - .driver = { .name = "msm_hsusb", }, + .driver = { + .name = "msm_hsusb", + .of_match_table = msm_ci_dt_match, + }, }; module_platform_driver(ci_hdrc_msm_driver); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 2/4] usb: chipidea: msm: Add device tree support @ 2013-11-11 13:35 ` Ivan T. Ivanov 0 siblings, 0 replies; 27+ messages in thread From: Ivan T. Ivanov @ 2013-11-11 13:35 UTC (permalink / raw) To: alexander.shishkin Cc: gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel, Ivan T. Ivanov, devicetree From: "Ivan T. Ivanov" <iivanov@mm-sol.com> Allows controller to be specified via device tree. Pass PHY phandle specified in DT to core driver. Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> Cc: devicetree@vger.kernel.org --- drivers/usb/chipidea/ci_hdrc_msm.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c index 2d51d85..747d6c1 100644 --- a/drivers/usb/chipidea/ci_hdrc_msm.c +++ b/drivers/usb/chipidea/ci_hdrc_msm.c @@ -57,9 +57,21 @@ static struct ci_hdrc_platform_data ci_hdrc_msm_platdata = { static int ci_hdrc_msm_probe(struct platform_device *pdev) { struct platform_device *plat_ci; + struct usb_phy *phy; dev_dbg(&pdev->dev, "ci_hdrc_msm_probe\n"); + /* + * OTG(PHY) driver takes care of PHY initialization, clock management, + * powering up VBUS, mapping of registers address space and power + * management. + */ + phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0); + if (IS_ERR(phy)) + return PTR_ERR(phy); + else + ci_hdrc_msm_platdata.phy = phy; + plat_ci = ci_hdrc_add_device(&pdev->dev, pdev->resource, pdev->num_resources, &ci_hdrc_msm_platdata); @@ -86,10 +98,19 @@ static int ci_hdrc_msm_remove(struct platform_device *pdev) return 0; } +static struct of_device_id msm_ci_dt_match[] = { + { .compatible = "qcom,ci-hdrc", }, + { } +}; +MODULE_DEVICE_TABLE(of, msm_ci_dt_match); + static struct platform_driver ci_hdrc_msm_driver = { .probe = ci_hdrc_msm_probe, .remove = ci_hdrc_msm_remove, - .driver = { .name = "msm_hsusb", }, + .driver = { + .name = "msm_hsusb", + .of_match_table = msm_ci_dt_match, + }, }; module_platform_driver(ci_hdrc_msm_driver); -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 3/4] usb: chipidea: msm: Initialize offset of the capability registers 2013-11-11 13:35 [PATCH 0/4] usb: chipidea: msm: Clean and fix glue layer driver Ivan T. Ivanov [not found] ` <1384176937-1658-1-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> @ 2013-11-11 13:35 ` Ivan T. Ivanov [not found] ` <1384176937-1658-4-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> 2013-11-11 13:35 ` [PATCH 4/4] usb: chipidea: msm: Use USB PHY API to control PHY state Ivan T. Ivanov 2013-11-11 14:02 ` Peter Chen 3 siblings, 1 reply; 27+ messages in thread From: Ivan T. Ivanov @ 2013-11-11 13:35 UTC (permalink / raw) To: alexander.shishkin Cc: gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel, Ivan T. Ivanov From: "Ivan T. Ivanov" <iivanov@mm-sol.com> Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> --- drivers/usb/chipidea/ci_hdrc_msm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c index 747d6c1..e9624f3 100644 --- a/drivers/usb/chipidea/ci_hdrc_msm.c +++ b/drivers/usb/chipidea/ci_hdrc_msm.c @@ -47,6 +47,7 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) static struct ci_hdrc_platform_data ci_hdrc_msm_platdata = { .name = "ci_hdrc_msm", + .capoffset = DEF_CAPOFFSET, .flags = CI_HDRC_REGS_SHARED | CI_HDRC_REQUIRE_TRANSCEIVER | CI_HDRC_DISABLE_STREAMING, -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 27+ messages in thread
[parent not found: <1384176937-1658-4-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH 3/4] usb: chipidea: msm: Initialize offset of the capability registers 2013-11-11 13:35 ` [PATCH 3/4] usb: chipidea: msm: Initialize offset of the capability registers Ivan T. Ivanov @ 2013-12-04 5:43 ` Peter Chen 0 siblings, 0 replies; 27+ messages in thread From: Peter Chen @ 2013-12-04 5:43 UTC (permalink / raw) To: Ivan T. Ivanov Cc: alexander.shishkin-VuQAYsv1563Yd54FQh9/CA, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, rob.herring-bsGFqQB8/DxBDgjK7y7TUQ, pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8, swarren-3lzwWm7+Weoh9ZMKESR00Q, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg, davidb-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA On Mon, Nov 11, 2013 at 03:35:36PM +0200, Ivan T. Ivanov wrote: > From: "Ivan T. Ivanov" <iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> > The commit log is needed. > Signed-off-by: Ivan T. Ivanov <iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> > --- > drivers/usb/chipidea/ci_hdrc_msm.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c > index 747d6c1..e9624f3 100644 > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c > @@ -47,6 +47,7 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > > static struct ci_hdrc_platform_data ci_hdrc_msm_platdata = { > .name = "ci_hdrc_msm", > + .capoffset = DEF_CAPOFFSET, > .flags = CI_HDRC_REGS_SHARED | > CI_HDRC_REQUIRE_TRANSCEIVER | > CI_HDRC_DISABLE_STREAMING, > -- > 1.7.9.5 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 3/4] usb: chipidea: msm: Initialize offset of the capability registers @ 2013-12-04 5:43 ` Peter Chen 0 siblings, 0 replies; 27+ messages in thread From: Peter Chen @ 2013-12-04 5:43 UTC (permalink / raw) To: Ivan T. Ivanov Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel On Mon, Nov 11, 2013 at 03:35:36PM +0200, Ivan T. Ivanov wrote: > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > The commit log is needed. > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> > --- > drivers/usb/chipidea/ci_hdrc_msm.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c > index 747d6c1..e9624f3 100644 > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c > @@ -47,6 +47,7 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > > static struct ci_hdrc_platform_data ci_hdrc_msm_platdata = { > .name = "ci_hdrc_msm", > + .capoffset = DEF_CAPOFFSET, > .flags = CI_HDRC_REGS_SHARED | > CI_HDRC_REQUIRE_TRANSCEIVER | > CI_HDRC_DISABLE_STREAMING, > -- > 1.7.9.5 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- Best Regards, Peter Chen ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 3/4] usb: chipidea: msm: Initialize offset of the capability registers 2013-12-04 5:43 ` Peter Chen (?) @ 2013-12-04 9:07 ` Ivan T. Ivanov -1 siblings, 0 replies; 27+ messages in thread From: Ivan T. Ivanov @ 2013-12-04 9:07 UTC (permalink / raw) To: Peter Chen Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel On Wed, 2013-12-04 at 13:43 +0800, Peter Chen wrote: > On Mon, Nov 11, 2013 at 03:35:36PM +0200, Ivan T. Ivanov wrote: > > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > > > > The commit log is needed. Will fix it. Regards, Ivan > > > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> > > --- > > drivers/usb/chipidea/ci_hdrc_msm.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c > > index 747d6c1..e9624f3 100644 > > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c > > @@ -47,6 +47,7 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > > > > static struct ci_hdrc_platform_data ci_hdrc_msm_platdata = { > > .name = "ci_hdrc_msm", > > + .capoffset = DEF_CAPOFFSET, > > .flags = CI_HDRC_REGS_SHARED | > > CI_HDRC_REQUIRE_TRANSCEIVER | > > CI_HDRC_DISABLE_STREAMING, > > -- > > 1.7.9.5 > > > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > > ^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 4/4] usb: chipidea: msm: Use USB PHY API to control PHY state 2013-11-11 13:35 [PATCH 0/4] usb: chipidea: msm: Clean and fix glue layer driver Ivan T. Ivanov [not found] ` <1384176937-1658-1-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> 2013-11-11 13:35 ` [PATCH 3/4] usb: chipidea: msm: Initialize offset of the capability registers Ivan T. Ivanov @ 2013-11-11 13:35 ` Ivan T. Ivanov 2013-11-11 13:59 ` Peter Chen 2013-11-11 14:02 ` Peter Chen 3 siblings, 1 reply; 27+ messages in thread From: Ivan T. Ivanov @ 2013-11-11 13:35 UTC (permalink / raw) To: alexander.shishkin Cc: gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel, Ivan T. Ivanov From: "Ivan T. Ivanov" <iivanov@mm-sol.com> PHY drivers keep track of the current state of the hardware, so don't change PHY settings under it. Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> --- drivers/usb/chipidea/ci_hdrc_msm.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c index e9624f3..338b209 100644 --- a/drivers/usb/chipidea/ci_hdrc_msm.c +++ b/drivers/usb/chipidea/ci_hdrc_msm.c @@ -20,13 +20,11 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) { struct device *dev = ci->gadget.dev.parent; - int val; switch (event) { case CI_HDRC_CONTROLLER_RESET_EVENT: dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n"); - writel(0, USB_AHBBURST); - writel(0, USB_AHBMODE); + usb_phy_init(ci->transceiver); break; case CI_HDRC_CONTROLLER_STOPPED_EVENT: dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n"); @@ -34,10 +32,7 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) * Put the transceiver in non-driving mode. Otherwise host * may not detect soft-disconnection. */ - val = usb_phy_io_read(ci->transceiver, ULPI_FUNC_CTRL); - val &= ~ULPI_FUNC_CTRL_OPMODE_MASK; - val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING; - usb_phy_io_write(ci->transceiver, val, ULPI_FUNC_CTRL); + usb_phy_notify_disconnect(ci->transceiver, USB_SPEED_UNKNOWN); break; default: dev_dbg(dev, "unknown ci_hdrc event\n"); -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 4/4] usb: chipidea: msm: Use USB PHY API to control PHY state 2013-11-11 13:35 ` [PATCH 4/4] usb: chipidea: msm: Use USB PHY API to control PHY state Ivan T. Ivanov @ 2013-11-11 13:59 ` Peter Chen 0 siblings, 0 replies; 27+ messages in thread From: Peter Chen @ 2013-11-11 13:59 UTC (permalink / raw) To: Ivan T. Ivanov Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel On Mon, Nov 11, 2013 at 03:35:37PM +0200, Ivan T. Ivanov wrote: > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > > PHY drivers keep track of the current state of the hardware, > so don't change PHY settings under it. > > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> > --- > drivers/usb/chipidea/ci_hdrc_msm.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c > index e9624f3..338b209 100644 > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c > @@ -20,13 +20,11 @@ > static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > { > struct device *dev = ci->gadget.dev.parent; > - int val; > > switch (event) { > case CI_HDRC_CONTROLLER_RESET_EVENT: > dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n"); > - writel(0, USB_AHBBURST); > - writel(0, USB_AHBMODE); > + usb_phy_init(ci->transceiver); It will reset the PHY, but your comment is "don't change PHY settings under it" > break; > case CI_HDRC_CONTROLLER_STOPPED_EVENT: > dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n"); > @@ -34,10 +32,7 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > * Put the transceiver in non-driving mode. Otherwise host > * may not detect soft-disconnection. > */ > - val = usb_phy_io_read(ci->transceiver, ULPI_FUNC_CTRL); > - val &= ~ULPI_FUNC_CTRL_OPMODE_MASK; > - val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING; > - usb_phy_io_write(ci->transceiver, val, ULPI_FUNC_CTRL); > + usb_phy_notify_disconnect(ci->transceiver, USB_SPEED_UNKNOWN); Where you have implemented .notify_disconnect? I have not found it at your phy driver. -- Best Regards, Peter Chen ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/4] usb: chipidea: msm: Use USB PHY API to control PHY state @ 2013-11-11 13:59 ` Peter Chen 0 siblings, 0 replies; 27+ messages in thread From: Peter Chen @ 2013-11-11 13:59 UTC (permalink / raw) To: Ivan T. Ivanov Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel On Mon, Nov 11, 2013 at 03:35:37PM +0200, Ivan T. Ivanov wrote: > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > > PHY drivers keep track of the current state of the hardware, > so don't change PHY settings under it. > > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> > --- > drivers/usb/chipidea/ci_hdrc_msm.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c > index e9624f3..338b209 100644 > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c > @@ -20,13 +20,11 @@ > static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > { > struct device *dev = ci->gadget.dev.parent; > - int val; > > switch (event) { > case CI_HDRC_CONTROLLER_RESET_EVENT: > dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n"); > - writel(0, USB_AHBBURST); > - writel(0, USB_AHBMODE); > + usb_phy_init(ci->transceiver); It will reset the PHY, but your comment is "don't change PHY settings under it" > break; > case CI_HDRC_CONTROLLER_STOPPED_EVENT: > dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n"); > @@ -34,10 +32,7 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > * Put the transceiver in non-driving mode. Otherwise host > * may not detect soft-disconnection. > */ > - val = usb_phy_io_read(ci->transceiver, ULPI_FUNC_CTRL); > - val &= ~ULPI_FUNC_CTRL_OPMODE_MASK; > - val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING; > - usb_phy_io_write(ci->transceiver, val, ULPI_FUNC_CTRL); > + usb_phy_notify_disconnect(ci->transceiver, USB_SPEED_UNKNOWN); Where you have implemented .notify_disconnect? I have not found it at your phy driver. -- Best Regards, Peter Chen ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/4] usb: chipidea: msm: Use USB PHY API to control PHY state 2013-11-11 13:59 ` Peter Chen (?) @ 2013-11-11 14:36 ` Ivan T. Ivanov 2013-12-04 5:37 ` Peter Chen -1 siblings, 1 reply; 27+ messages in thread From: Ivan T. Ivanov @ 2013-11-11 14:36 UTC (permalink / raw) To: Peter Chen Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel Hi Peter, On Mon, 2013-11-11 at 21:59 +0800, Peter Chen wrote: > On Mon, Nov 11, 2013 at 03:35:37PM +0200, Ivan T. Ivanov wrote: > > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > > > > PHY drivers keep track of the current state of the hardware, > > so don't change PHY settings under it. > > > > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> > > --- > > drivers/usb/chipidea/ci_hdrc_msm.c | 9 ++------- > > 1 file changed, 2 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c > > index e9624f3..338b209 100644 > > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c > > @@ -20,13 +20,11 @@ > > static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > > { > > struct device *dev = ci->gadget.dev.parent; > > - int val; > > > > switch (event) { > > case CI_HDRC_CONTROLLER_RESET_EVENT: > > dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n"); > > - writel(0, USB_AHBBURST); > > - writel(0, USB_AHBMODE); > > + usb_phy_init(ci->transceiver); > > It will reset the PHY, but your comment is "don't change PHY settings under it" :-). This function is exported by PHY drivers, so they will know how to handle this change. > > > break; > > case CI_HDRC_CONTROLLER_STOPPED_EVENT: > > dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n"); > > @@ -34,10 +32,7 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > > * Put the transceiver in non-driving mode. Otherwise host > > * may not detect soft-disconnection. > > */ > > - val = usb_phy_io_read(ci->transceiver, ULPI_FUNC_CTRL); > > - val &= ~ULPI_FUNC_CTRL_OPMODE_MASK; > > - val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING; > > - usb_phy_io_write(ci->transceiver, val, ULPI_FUNC_CTRL); > > + usb_phy_notify_disconnect(ci->transceiver, USB_SPEED_UNKNOWN); > > Where you have implemented .notify_disconnect? > I have not found it at your phy driver. Yep, I will post PHY driver changes shortly. Meanwhile this should not break existing board file based platforms, because not of them could be compiled (HTC Dream, Halibut Board) and DT based platforms are sill work in progress. Regards, Ivan ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/4] usb: chipidea: msm: Use USB PHY API to control PHY state 2013-11-11 14:36 ` Ivan T. Ivanov @ 2013-12-04 5:37 ` Peter Chen 0 siblings, 0 replies; 27+ messages in thread From: Peter Chen @ 2013-12-04 5:37 UTC (permalink / raw) To: Ivan T. Ivanov Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel On Mon, Nov 11, 2013 at 04:36:09PM +0200, Ivan T. Ivanov wrote: > > Hi Peter, > > On Mon, 2013-11-11 at 21:59 +0800, Peter Chen wrote: > > On Mon, Nov 11, 2013 at 03:35:37PM +0200, Ivan T. Ivanov wrote: > > > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > > > > > > PHY drivers keep track of the current state of the hardware, > > > so don't change PHY settings under it. > > > > > > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> > > > --- > > > drivers/usb/chipidea/ci_hdrc_msm.c | 9 ++------- > > > 1 file changed, 2 insertions(+), 7 deletions(-) > > > > > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c > > > index e9624f3..338b209 100644 > > > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > > > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c > > > @@ -20,13 +20,11 @@ > > > static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > > > { > > > struct device *dev = ci->gadget.dev.parent; > > > - int val; > > > > > > switch (event) { > > > case CI_HDRC_CONTROLLER_RESET_EVENT: > > > dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n"); > > > - writel(0, USB_AHBBURST); > > > - writel(0, USB_AHBMODE); > > > + usb_phy_init(ci->transceiver); > > > > It will reset the PHY, but your comment is "don't change PHY settings under it" > > :-). This function is exported by PHY drivers, so they will know how > to handle this change. > > > > > > break; > > > case CI_HDRC_CONTROLLER_STOPPED_EVENT: > > > dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n"); > > > @@ -34,10 +32,7 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > > > * Put the transceiver in non-driving mode. Otherwise host > > > * may not detect soft-disconnection. > > > */ > > > - val = usb_phy_io_read(ci->transceiver, ULPI_FUNC_CTRL); > > > - val &= ~ULPI_FUNC_CTRL_OPMODE_MASK; > > > - val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING; > > > - usb_phy_io_write(ci->transceiver, val, ULPI_FUNC_CTRL); > > > + usb_phy_notify_disconnect(ci->transceiver, USB_SPEED_UNKNOWN); > > > > Where you have implemented .notify_disconnect? > > I have not found it at your phy driver. > > Yep, I will post PHY driver changes shortly. Meanwhile this should > not break existing board file based platforms, because not of them > could be compiled (HTC Dream, Halibut Board) and DT based platforms > are sill work in progress. > Hi Ivan, I am going to apply this msm chipidea patchset, but the change in this file is different with its original meaning. Have you tested at existing platforms? -- Best Regards, Peter Chen ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/4] usb: chipidea: msm: Use USB PHY API to control PHY state @ 2013-12-04 5:37 ` Peter Chen 0 siblings, 0 replies; 27+ messages in thread From: Peter Chen @ 2013-12-04 5:37 UTC (permalink / raw) To: Ivan T. Ivanov Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel On Mon, Nov 11, 2013 at 04:36:09PM +0200, Ivan T. Ivanov wrote: > > Hi Peter, > > On Mon, 2013-11-11 at 21:59 +0800, Peter Chen wrote: > > On Mon, Nov 11, 2013 at 03:35:37PM +0200, Ivan T. Ivanov wrote: > > > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > > > > > > PHY drivers keep track of the current state of the hardware, > > > so don't change PHY settings under it. > > > > > > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> > > > --- > > > drivers/usb/chipidea/ci_hdrc_msm.c | 9 ++------- > > > 1 file changed, 2 insertions(+), 7 deletions(-) > > > > > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c > > > index e9624f3..338b209 100644 > > > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > > > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c > > > @@ -20,13 +20,11 @@ > > > static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > > > { > > > struct device *dev = ci->gadget.dev.parent; > > > - int val; > > > > > > switch (event) { > > > case CI_HDRC_CONTROLLER_RESET_EVENT: > > > dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n"); > > > - writel(0, USB_AHBBURST); > > > - writel(0, USB_AHBMODE); > > > + usb_phy_init(ci->transceiver); > > > > It will reset the PHY, but your comment is "don't change PHY settings under it" > > :-). This function is exported by PHY drivers, so they will know how > to handle this change. > > > > > > break; > > > case CI_HDRC_CONTROLLER_STOPPED_EVENT: > > > dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n"); > > > @@ -34,10 +32,7 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > > > * Put the transceiver in non-driving mode. Otherwise host > > > * may not detect soft-disconnection. > > > */ > > > - val = usb_phy_io_read(ci->transceiver, ULPI_FUNC_CTRL); > > > - val &= ~ULPI_FUNC_CTRL_OPMODE_MASK; > > > - val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING; > > > - usb_phy_io_write(ci->transceiver, val, ULPI_FUNC_CTRL); > > > + usb_phy_notify_disconnect(ci->transceiver, USB_SPEED_UNKNOWN); > > > > Where you have implemented .notify_disconnect? > > I have not found it at your phy driver. > > Yep, I will post PHY driver changes shortly. Meanwhile this should > not break existing board file based platforms, because not of them > could be compiled (HTC Dream, Halibut Board) and DT based platforms > are sill work in progress. > Hi Ivan, I am going to apply this msm chipidea patchset, but the change in this file is different with its original meaning. Have you tested at existing platforms? -- Best Regards, Peter Chen ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/4] usb: chipidea: msm: Use USB PHY API to control PHY state 2013-12-04 5:37 ` Peter Chen (?) @ 2013-12-04 9:35 ` Ivan T. Ivanov 2013-12-04 13:38 ` Peter Chen -1 siblings, 1 reply; 27+ messages in thread From: Ivan T. Ivanov @ 2013-12-04 9:35 UTC (permalink / raw) To: Peter Chen Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel Hi Peter, On Wed, 2013-12-04 at 13:37 +0800, Peter Chen wrote: > On Mon, Nov 11, 2013 at 04:36:09PM +0200, Ivan T. Ivanov wrote: > > > > Hi Peter, > > > > On Mon, 2013-11-11 at 21:59 +0800, Peter Chen wrote: > > > On Mon, Nov 11, 2013 at 03:35:37PM +0200, Ivan T. Ivanov wrote: > > > > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > > > > > > > > PHY drivers keep track of the current state of the hardware, > > > > so don't change PHY settings under it. > > > > > > > > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> > > > > --- > > > > drivers/usb/chipidea/ci_hdrc_msm.c | 9 ++------- > > > > 1 file changed, 2 insertions(+), 7 deletions(-) > > > > > > > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c > > > > index e9624f3..338b209 100644 > > > > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > > > > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c > > > > @@ -20,13 +20,11 @@ > > > > static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > > > > { > > > > struct device *dev = ci->gadget.dev.parent; > > > > - int val; > > > > > > > > switch (event) { > > > > case CI_HDRC_CONTROLLER_RESET_EVENT: > > > > dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n"); > > > > - writel(0, USB_AHBBURST); > > > > - writel(0, USB_AHBMODE); > > > > + usb_phy_init(ci->transceiver); > > > > > > It will reset the PHY, but your comment is "don't change PHY settings under it" > > > > :-). This function is exported by PHY drivers, so they will know how > > to handle this change. > > > > > > > > > break; > > > > case CI_HDRC_CONTROLLER_STOPPED_EVENT: > > > > dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n"); > > > > @@ -34,10 +32,7 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > > > > * Put the transceiver in non-driving mode. Otherwise host > > > > * may not detect soft-disconnection. > > > > */ > > > > - val = usb_phy_io_read(ci->transceiver, ULPI_FUNC_CTRL); > > > > - val &= ~ULPI_FUNC_CTRL_OPMODE_MASK; > > > > - val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING; > > > > - usb_phy_io_write(ci->transceiver, val, ULPI_FUNC_CTRL); > > > > + usb_phy_notify_disconnect(ci->transceiver, USB_SPEED_UNKNOWN); > > > > > > Where you have implemented .notify_disconnect? > > > I have not found it at your phy driver. > > > > Yep, I will post PHY driver changes shortly. Meanwhile this should > > not break existing board file based platforms, because not of them > > could be compiled (HTC Dream, Halibut Board) and DT based platforms > > are sill work in progress. > > > > Hi Ivan, I am going to apply this msm chipidea patchset, but the change > in this file is different with its original meaning. What did you mean? CI_HDRC_CONTROLLER_RESET_EVENT -> usb_phy_init() Take wherever actions are needed to put device in known state. ? CI_HDRC_CONTROLLER_STOPPED_EVENT -> usb_phy_notify_disconnect() Emitted after ci->driver->disconnect(&ci->gadget); Probably I am missing something. > Have you > tested at existing platforms? I have 8074 based DragonBoard which I used for testing. CV Test Suite engine "Chapter 9 tests" are passing except "Halt Endpoint Test". Regards, Ivan > ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/4] usb: chipidea: msm: Use USB PHY API to control PHY state 2013-12-04 9:35 ` Ivan T. Ivanov @ 2013-12-04 13:38 ` Peter Chen 0 siblings, 0 replies; 27+ messages in thread From: Peter Chen @ 2013-12-04 13:38 UTC (permalink / raw) To: Ivan T. Ivanov Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel On Wed, Dec 04, 2013 at 11:35:54AM +0200, Ivan T. Ivanov wrote: > > Hi Peter, > > On Wed, 2013-12-04 at 13:37 +0800, Peter Chen wrote: > > On Mon, Nov 11, 2013 at 04:36:09PM +0200, Ivan T. Ivanov wrote: > > > > > > Hi Peter, > > > > > > On Mon, 2013-11-11 at 21:59 +0800, Peter Chen wrote: > > > > On Mon, Nov 11, 2013 at 03:35:37PM +0200, Ivan T. Ivanov wrote: > > > > > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > > > > > > > > > > PHY drivers keep track of the current state of the hardware, > > > > > so don't change PHY settings under it. > > > > > > > > > > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> > > > > > --- > > > > > drivers/usb/chipidea/ci_hdrc_msm.c | 9 ++------- > > > > > 1 file changed, 2 insertions(+), 7 deletions(-) > > > > > > > > > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c > > > > > index e9624f3..338b209 100644 > > > > > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > > > > > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c > > > > > @@ -20,13 +20,11 @@ > > > > > static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > > > > > { > > > > > struct device *dev = ci->gadget.dev.parent; > > > > > - int val; > > > > > > > > > > switch (event) { > > > > > case CI_HDRC_CONTROLLER_RESET_EVENT: > > > > > dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n"); > > > > > - writel(0, USB_AHBBURST); > > > > > - writel(0, USB_AHBMODE); > > > > > + usb_phy_init(ci->transceiver); > > > > > > > > It will reset the PHY, but your comment is "don't change PHY settings under it" > > > > > > :-). This function is exported by PHY drivers, so they will know how > > > to handle this change. > > > > > > > > > > > > break; > > > > > case CI_HDRC_CONTROLLER_STOPPED_EVENT: > > > > > dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n"); > > > > > @@ -34,10 +32,7 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > > > > > * Put the transceiver in non-driving mode. Otherwise host > > > > > * may not detect soft-disconnection. > > > > > */ > > > > > - val = usb_phy_io_read(ci->transceiver, ULPI_FUNC_CTRL); > > > > > - val &= ~ULPI_FUNC_CTRL_OPMODE_MASK; > > > > > - val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING; > > > > > - usb_phy_io_write(ci->transceiver, val, ULPI_FUNC_CTRL); > > > > > + usb_phy_notify_disconnect(ci->transceiver, USB_SPEED_UNKNOWN); > > > > > > > > Where you have implemented .notify_disconnect? > > > > I have not found it at your phy driver. > > > > > > Yep, I will post PHY driver changes shortly. Meanwhile this should > > > not break existing board file based platforms, because not of them > > > could be compiled (HTC Dream, Halibut Board) and DT based platforms > > > are sill work in progress. > > > > > > > Hi Ivan, I am going to apply this msm chipidea patchset, but the change > > in this file is different with its original meaning. > > What did you mean? > > CI_HDRC_CONTROLLER_RESET_EVENT -> usb_phy_init() > Take wherever actions are needed to put device in known state. ? At current code, it only sets two AHB parameters which should be only related to controller but your patch init the whole PHY, look at msm_otg_reset, it does many other things, like phy reset, controller reset, etc. Does the partial otg fsm at msm_otg_sm_work will be called or not? If it is not called, then, it is OK you just use msm_otg_reset here. > > CI_HDRC_CONTROLLER_STOPPED_EVENT -> usb_phy_notify_disconnect() > Emitted after ci->driver->disconnect(&ci->gadget); I just see your [PATCH v4 14/15] usb: phy: msm: Handle disconnect events, then, it is ok now. By the way, do I need to wait your phy patches are queued, otherwise, it may not work? > > Probably I am missing something. > > > > Have you > > tested at existing platforms? > > > I have 8074 based DragonBoard which I used for testing. > CV Test Suite engine "Chapter 9 tests" are passing except > "Halt Endpoint Test". I mean with your patch, the old non-dt platform can work or not? -- Best Regards, Peter Chen ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/4] usb: chipidea: msm: Use USB PHY API to control PHY state @ 2013-12-04 13:38 ` Peter Chen 0 siblings, 0 replies; 27+ messages in thread From: Peter Chen @ 2013-12-04 13:38 UTC (permalink / raw) To: Ivan T. Ivanov Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel On Wed, Dec 04, 2013 at 11:35:54AM +0200, Ivan T. Ivanov wrote: > > Hi Peter, > > On Wed, 2013-12-04 at 13:37 +0800, Peter Chen wrote: > > On Mon, Nov 11, 2013 at 04:36:09PM +0200, Ivan T. Ivanov wrote: > > > > > > Hi Peter, > > > > > > On Mon, 2013-11-11 at 21:59 +0800, Peter Chen wrote: > > > > On Mon, Nov 11, 2013 at 03:35:37PM +0200, Ivan T. Ivanov wrote: > > > > > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > > > > > > > > > > PHY drivers keep track of the current state of the hardware, > > > > > so don't change PHY settings under it. > > > > > > > > > > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> > > > > > --- > > > > > drivers/usb/chipidea/ci_hdrc_msm.c | 9 ++------- > > > > > 1 file changed, 2 insertions(+), 7 deletions(-) > > > > > > > > > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c > > > > > index e9624f3..338b209 100644 > > > > > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > > > > > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c > > > > > @@ -20,13 +20,11 @@ > > > > > static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > > > > > { > > > > > struct device *dev = ci->gadget.dev.parent; > > > > > - int val; > > > > > > > > > > switch (event) { > > > > > case CI_HDRC_CONTROLLER_RESET_EVENT: > > > > > dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n"); > > > > > - writel(0, USB_AHBBURST); > > > > > - writel(0, USB_AHBMODE); > > > > > + usb_phy_init(ci->transceiver); > > > > > > > > It will reset the PHY, but your comment is "don't change PHY settings under it" > > > > > > :-). This function is exported by PHY drivers, so they will know how > > > to handle this change. > > > > > > > > > > > > break; > > > > > case CI_HDRC_CONTROLLER_STOPPED_EVENT: > > > > > dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n"); > > > > > @@ -34,10 +32,7 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > > > > > * Put the transceiver in non-driving mode. Otherwise host > > > > > * may not detect soft-disconnection. > > > > > */ > > > > > - val = usb_phy_io_read(ci->transceiver, ULPI_FUNC_CTRL); > > > > > - val &= ~ULPI_FUNC_CTRL_OPMODE_MASK; > > > > > - val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING; > > > > > - usb_phy_io_write(ci->transceiver, val, ULPI_FUNC_CTRL); > > > > > + usb_phy_notify_disconnect(ci->transceiver, USB_SPEED_UNKNOWN); > > > > > > > > Where you have implemented .notify_disconnect? > > > > I have not found it at your phy driver. > > > > > > Yep, I will post PHY driver changes shortly. Meanwhile this should > > > not break existing board file based platforms, because not of them > > > could be compiled (HTC Dream, Halibut Board) and DT based platforms > > > are sill work in progress. > > > > > > > Hi Ivan, I am going to apply this msm chipidea patchset, but the change > > in this file is different with its original meaning. > > What did you mean? > > CI_HDRC_CONTROLLER_RESET_EVENT -> usb_phy_init() > Take wherever actions are needed to put device in known state. ? At current code, it only sets two AHB parameters which should be only related to controller but your patch init the whole PHY, look at msm_otg_reset, it does many other things, like phy reset, controller reset, etc. Does the partial otg fsm at msm_otg_sm_work will be called or not? If it is not called, then, it is OK you just use msm_otg_reset here. > > CI_HDRC_CONTROLLER_STOPPED_EVENT -> usb_phy_notify_disconnect() > Emitted after ci->driver->disconnect(&ci->gadget); I just see your [PATCH v4 14/15] usb: phy: msm: Handle disconnect events, then, it is ok now. By the way, do I need to wait your phy patches are queued, otherwise, it may not work? > > Probably I am missing something. > > > > Have you > > tested at existing platforms? > > > I have 8074 based DragonBoard which I used for testing. > CV Test Suite engine "Chapter 9 tests" are passing except > "Halt Endpoint Test". I mean with your patch, the old non-dt platform can work or not? -- Best Regards, Peter Chen ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/4] usb: chipidea: msm: Use USB PHY API to control PHY state 2013-12-04 13:38 ` Peter Chen (?) @ 2013-12-11 10:26 ` Ivan T. Ivanov -1 siblings, 0 replies; 27+ messages in thread From: Ivan T. Ivanov @ 2013-12-11 10:26 UTC (permalink / raw) To: Peter Chen Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel Hi, On Wed, 2013-12-04 at 21:38 +0800, Peter Chen wrote: > On Wed, Dec 04, 2013 at 11:35:54AM +0200, Ivan T. Ivanov wrote: > > > > Hi Peter, > > > > On Wed, 2013-12-04 at 13:37 +0800, Peter Chen wrote: > > > On Mon, Nov 11, 2013 at 04:36:09PM +0200, Ivan T. Ivanov wrote: > > > > > > > > Hi Peter, > > > > > > > > On Mon, 2013-11-11 at 21:59 +0800, Peter Chen wrote: > > > > > On Mon, Nov 11, 2013 at 03:35:37PM +0200, Ivan T. Ivanov wrote: > > > > > > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > > > > > > > > > > > > PHY drivers keep track of the current state of the hardware, > > > > > > so don't change PHY settings under it. > > > > > > > > > > > > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> > > > > > > --- > > > > > > drivers/usb/chipidea/ci_hdrc_msm.c | 9 ++------- > > > > > > 1 file changed, 2 insertions(+), 7 deletions(-) > > > > > > > > > > > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c > > > > > > index e9624f3..338b209 100644 > > > > > > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > > > > > > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c > > > > > > @@ -20,13 +20,11 @@ > > > > > > static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > > > > > > { > > > > > > struct device *dev = ci->gadget.dev.parent; > > > > > > - int val; > > > > > > > > > > > > switch (event) { > > > > > > case CI_HDRC_CONTROLLER_RESET_EVENT: > > > > > > dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n"); > > > > > > - writel(0, USB_AHBBURST); > > > > > > - writel(0, USB_AHBMODE); > > > > > > + usb_phy_init(ci->transceiver); > > > > > > > > > > It will reset the PHY, but your comment is "don't change PHY settings under it" > > > > > > > > :-). This function is exported by PHY drivers, so they will know how > > > > to handle this change. > > > > > > > > > > > > > > > break; > > > > > > case CI_HDRC_CONTROLLER_STOPPED_EVENT: > > > > > > dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n"); > > > > > > @@ -34,10 +32,7 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) > > > > > > * Put the transceiver in non-driving mode. Otherwise host > > > > > > * may not detect soft-disconnection. > > > > > > */ > > > > > > - val = usb_phy_io_read(ci->transceiver, ULPI_FUNC_CTRL); > > > > > > - val &= ~ULPI_FUNC_CTRL_OPMODE_MASK; > > > > > > - val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING; > > > > > > - usb_phy_io_write(ci->transceiver, val, ULPI_FUNC_CTRL); > > > > > > + usb_phy_notify_disconnect(ci->transceiver, USB_SPEED_UNKNOWN); > > > > > > > > > > Where you have implemented .notify_disconnect? > > > > > I have not found it at your phy driver. > > > > > > > > Yep, I will post PHY driver changes shortly. Meanwhile this should > > > > not break existing board file based platforms, because not of them > > > > could be compiled (HTC Dream, Halibut Board) and DT based platforms > > > > are sill work in progress. > > > > > > > > > > Hi Ivan, I am going to apply this msm chipidea patchset, but the change > > > in this file is different with its original meaning. > > > > What did you mean? > > > > CI_HDRC_CONTROLLER_RESET_EVENT -> usb_phy_init() > > Take wherever actions are needed to put device in known state. ? > > At current code, it only sets two AHB parameters which should be only related > to controller but your patch init the whole PHY, look at msm_otg_reset, > it does many other things, like phy reset, controller reset, etc. > > Does the partial otg fsm at msm_otg_sm_work will be called or not? If it is > not called, then, it is OK you just use msm_otg_reset here. > > > > > CI_HDRC_CONTROLLER_STOPPED_EVENT -> usb_phy_notify_disconnect() > > Emitted after ci->driver->disconnect(&ci->gadget); > > I just see your [PATCH v4 14/15] usb: phy: msm: Handle disconnect events, > then, it is ok now. By the way, do I need to wait your phy patches are queued, > otherwise, it may not work? This driver is not working on MSM platforms more than year now, since "usb: gadget: ci13xxx: convert to platform device" Lets postpone this patch after changes to phy-drivers are ready. I will post rest of the patches with fixes for your comments shortly. > > > > > Probably I am missing something. > > > > > > > Have you > > > tested at existing platforms? > > > > > > I have 8074 based DragonBoard which I used for testing. > > CV Test Suite engine "Chapter 9 tests" are passing except > > "Halt Endpoint Test". > > I mean with your patch, the old non-dt platform can work or not? Regards, Ivan ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 0/4] usb: chipidea: msm: Clean and fix glue layer driver 2013-11-11 13:35 [PATCH 0/4] usb: chipidea: msm: Clean and fix glue layer driver Ivan T. Ivanov @ 2013-11-11 14:02 ` Peter Chen 2013-11-11 13:35 ` [PATCH 3/4] usb: chipidea: msm: Initialize offset of the capability registers Ivan T. Ivanov ` (2 subsequent siblings) 3 siblings, 0 replies; 27+ messages in thread From: Peter Chen @ 2013-11-11 14:02 UTC (permalink / raw) To: Ivan T. Ivanov Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel On Mon, Nov 11, 2013 at 03:35:33PM +0200, Ivan T. Ivanov wrote: > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > > Hi, > > This series intend to fixup driver, which was broken for a while. It is > used to create peripheral role device, which in coordination with > phy-usb-msm driver (still some cleanups pending) will provide again > USB2.0 gadget support for MSM targets. > We haven't seen msm chipidea patch for a long time, good news they appear. Any plans to use the whole chipidea function for msm controller driver (otg, host and peripheral)? -- Best Regards, Peter Chen ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 0/4] usb: chipidea: msm: Clean and fix glue layer driver @ 2013-11-11 14:02 ` Peter Chen 0 siblings, 0 replies; 27+ messages in thread From: Peter Chen @ 2013-11-11 14:02 UTC (permalink / raw) To: Ivan T. Ivanov Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel On Mon, Nov 11, 2013 at 03:35:33PM +0200, Ivan T. Ivanov wrote: > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > > Hi, > > This series intend to fixup driver, which was broken for a while. It is > used to create peripheral role device, which in coordination with > phy-usb-msm driver (still some cleanups pending) will provide again > USB2.0 gadget support for MSM targets. > We haven't seen msm chipidea patch for a long time, good news they appear. Any plans to use the whole chipidea function for msm controller driver (otg, host and peripheral)? -- Best Regards, Peter Chen ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 0/4] usb: chipidea: msm: Clean and fix glue layer driver 2013-11-11 14:02 ` Peter Chen (?) @ 2013-11-11 14:49 ` Ivan T. Ivanov -1 siblings, 0 replies; 27+ messages in thread From: Ivan T. Ivanov @ 2013-11-11 14:49 UTC (permalink / raw) To: Peter Chen Cc: alexander.shishkin, gregkh, rob.herring, pawel.moll, mark.rutland, swarren, ijc+devicetree, davidb, linux-usb, linux-arm-msm, linux-kernel Hi Peter, On Mon, 2013-11-11 at 22:02 +0800, Peter Chen wrote: > On Mon, Nov 11, 2013 at 03:35:33PM +0200, Ivan T. Ivanov wrote: > > From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > > > > Hi, > > > > This series intend to fixup driver, which was broken for a while. It is > > used to create peripheral role device, which in coordination with > > phy-usb-msm driver (still some cleanups pending) will provide again > > USB2.0 gadget support for MSM targets. > > > > We haven't seen msm chipidea patch for a long time, good news they appear. > Any plans to use the whole chipidea function for msm controller driver > (otg, host and peripheral)? > Things are little complicated here :-). Currently qcom,echi-host is supposed to control host role. Not tested this completely, but this how is handled also by down stream kernel (codeaurora.org). In this repo there are even 2 slightly different versions of the driver. And OTG and PHY control situations is even ... Currently this functionality is handled by phy-msm-usb. There is a separate gadget driver downstream, which seems to be used in production targets. My plan is to first port minimal set of changes form downstream kernel to phy-msm-usb, which will bring up peripheral role. Regards, Ivan ^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2013-12-11 10:28 UTC | newest] Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2013-11-11 13:35 [PATCH 0/4] usb: chipidea: msm: Clean and fix glue layer driver Ivan T. Ivanov [not found] ` <1384176937-1658-1-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> 2013-11-11 13:35 ` [PATCH 1/4] usb: chipidea: msm: Add device tree binding information Ivan T. Ivanov 2013-11-11 13:35 ` Ivan T. Ivanov 2013-12-04 5:40 ` Peter Chen 2013-12-04 5:40 ` Peter Chen 2013-12-04 8:33 ` Ivan T. Ivanov 2013-12-04 13:13 ` Peter Chen 2013-12-04 13:13 ` Peter Chen 2013-11-11 13:35 ` [PATCH 2/4] usb: chipidea: msm: Add device tree support Ivan T. Ivanov 2013-11-11 13:35 ` Ivan T. Ivanov 2013-11-11 13:35 ` [PATCH 3/4] usb: chipidea: msm: Initialize offset of the capability registers Ivan T. Ivanov [not found] ` <1384176937-1658-4-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> 2013-12-04 5:43 ` Peter Chen 2013-12-04 5:43 ` Peter Chen 2013-12-04 9:07 ` Ivan T. Ivanov 2013-11-11 13:35 ` [PATCH 4/4] usb: chipidea: msm: Use USB PHY API to control PHY state Ivan T. Ivanov 2013-11-11 13:59 ` Peter Chen 2013-11-11 13:59 ` Peter Chen 2013-11-11 14:36 ` Ivan T. Ivanov 2013-12-04 5:37 ` Peter Chen 2013-12-04 5:37 ` Peter Chen 2013-12-04 9:35 ` Ivan T. Ivanov 2013-12-04 13:38 ` Peter Chen 2013-12-04 13:38 ` Peter Chen 2013-12-11 10:26 ` Ivan T. Ivanov 2013-11-11 14:02 ` [PATCH 0/4] usb: chipidea: msm: Clean and fix glue layer driver Peter Chen 2013-11-11 14:02 ` Peter Chen 2013-11-11 14:49 ` Ivan T. Ivanov
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.