2014-04-22 09:44:24

by Ivan T. Ivanov

[permalink] [raw]
Subject: [PATCH v3 0/3] usb: chipidea: msm: Clean and fix glue layer driver

From: "Ivan T. Ivanov" <[email protected]>

This series intend to fix driver, which was broken for a while.
It is used to create peripheral role device, which in coordination
with phy-usb-msm driver could provide USB2.0 gadget support for
Qualcomm targets.

Changes since version 2.

- Rename devicetree description file to ci-hdrc-qcom.txt to be in-line
with Freescale and Zevio naming scheme
- Use better name for usb-phy phandle.
- Make of_device_id structure const

[1] https://lkml.org/lkml/2014/2/18/209

Ivan T. Ivanov (3):
usb: chipidea: msm: Add device tree binding information
usb: chipidea: msm: Add device tree support
usb: chipidea: msm: Initialize offset of the capability registers

.../devicetree/bindings/usb/ci-hdrc-qcom.txt | 17 +++++++++++++++
drivers/usb/chipidea/ci_hdrc_msm.c | 24 +++++++++++++++++++++-
2 files changed, 40 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/usb/ci-hdrc-qcom.txt

--
1.8.3.2


2014-04-22 09:44:33

by Ivan T. Ivanov

[permalink] [raw]
Subject: [PATCH v3 1/3] usb: chipidea: msm: Add device tree binding information

From: "Ivan T. Ivanov" <[email protected]>

Document device tree binding information as required by
the Qualcomm USB controller.

Signed-off-by: Ivan T. Ivanov <[email protected]>
---
Documentation/devicetree/bindings/usb/ci-hdrc-qcom.txt | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/ci-hdrc-qcom.txt

diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-qcom.txt b/Documentation/devicetree/bindings/usb/ci-hdrc-qcom.txt
new file mode 100644
index 0000000..7221072
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/ci-hdrc-qcom.txt
@@ -0,0 +1,17 @@
+Qualcomm 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"
+
+Examples:
+ gadget@f9a55000 {
+ compatible = "qcom,ci-hdrc";
+ reg = <0xf9a55000 0x400>;
+ dr_mode = "peripheral";
+ interrupts = <0 134 0>;
+ usb-phy = <&usbphy0>;
+ };
--
1.8.3.2

2014-04-22 09:44:41

by Ivan T. Ivanov

[permalink] [raw]
Subject: [PATCH v3 3/3] usb: chipidea: msm: Initialize offset of the capability registers

From: "Ivan T. Ivanov" <[email protected]>

Since commit 62bb84e (usb: gadget: ci13xxx: convert to platform device)
start address of the capability registers is not passed correctly to
udc_probe(). Fix this.

Signed-off-by: Ivan T. Ivanov <[email protected]>
---
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 736aeb2..d72b9d2 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.8.3.2

2014-04-22 09:44:22

by Ivan T. Ivanov

[permalink] [raw]
Subject: [PATCH v3 2/3] usb: chipidea: msm: Add device tree support

From: "Ivan T. Ivanov" <[email protected]>

Allows controller to be specified via device tree.
Pass PHY phandle specified in DT to core driver.

Signed-off-by: Ivan T. Ivanov <[email protected]>
---
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..736aeb2 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);
+
+ 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 const 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.8.3.2

2014-04-22 15:08:48

by Srinivas Kandagatla

[permalink] [raw]
Subject: Re: [PATCH v3 1/3] usb: chipidea: msm: Add device tree binding information



On 22/04/14 10:43, Ivan T. Ivanov wrote:
> +- interrupts: interrupt-specifier for the controller interrupt.
> +- usb-phy: phandle for the PHY device
> +- dr_mode: Sould be "peripheral"
s/Sould/Should/
> +

2014-04-22 15:21:43

by Ivan T. Ivanov

[permalink] [raw]
Subject: Re: [PATCH v3 1/3] usb: chipidea: msm: Add device tree binding information

On Tue, 2014-04-22 at 16:07 +0100, Srinivas Kandagatla wrote:
>
> On 22/04/14 10:43, Ivan T. Ivanov wrote:
> > +- interrupts: interrupt-specifier for the controller interrupt.
> > +- usb-phy: phandle for the PHY device
> > +- dr_mode: Sould be "peripheral"
> s/Sould/Should/
> > +

Thanks. will fix it.

Ivan

2014-04-23 09:32:39

by Peter Chen

[permalink] [raw]
Subject: Re: [PATCH v3 0/3] usb: chipidea: msm: Clean and fix glue layer driver

On Tue, Apr 22, 2014 at 12:43:14PM +0300, Ivan T. Ivanov wrote:
> From: "Ivan T. Ivanov" <[email protected]>
>
> This series intend to fix driver, which was broken for a while.
> It is used to create peripheral role device, which in coordination
> with phy-usb-msm driver could provide USB2.0 gadget support for
> Qualcomm targets.
>
> Changes since version 2.
>
> - Rename devicetree description file to ci-hdrc-qcom.txt to be in-line
> with Freescale and Zevio naming scheme
> - Use better name for usb-phy phandle.
> - Make of_device_id structure const
>
> [1] https://lkml.org/lkml/2014/2/18/209
>
> Ivan T. Ivanov (3):
> usb: chipidea: msm: Add device tree binding information
> usb: chipidea: msm: Add device tree support
> usb: chipidea: msm: Initialize offset of the capability registers
>
> .../devicetree/bindings/usb/ci-hdrc-qcom.txt | 17 +++++++++++++++
> drivers/usb/chipidea/ci_hdrc_msm.c | 24 +++++++++++++++++++++-
> 2 files changed, 40 insertions(+), 1 deletion(-)
> create mode 100644 Documentation/devicetree/bindings/usb/ci-hdrc-qcom.txt
>
> --
> 1.8.3.2
>
>
>

This patchset looks ok except the typo which Srinivas Kandagatla mentions.

--

Best Regards,
Peter Chen