Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1379203 > unrolled thread
| Started by | David Lechner <david@lechnology.com> |
|---|---|
| First post | 2016-04-14 20:40 +0200 |
| Last post | 2016-04-14 20:40 +0200 |
| Articles | 6 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v4 0/7] da8xx USB PHY (was da8xx USB clocks) David Lechner <david@lechnology.com> - 2016-04-14 20:40 +0200
[PATCH v4 2/7] dt-bindings: Add bindings for phy-da8xx-usb David Lechner <david@lechnology.com> - 2016-04-14 20:40 +0200
Re: [PATCH v4 2/7] dt-bindings: Add bindings for phy-da8xx-usb Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-04-15 13:00 +0200
Re: [PATCH v4 2/7] dt-bindings: Add bindings for phy-da8xx-usb David Lechner <david@lechnology.com> - 2016-04-15 18:20 +0200
Re: [PATCH v4 2/7] dt-bindings: Add bindings for phy-da8xx-usb Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-04-15 19:10 +0200
[PATCH v4 6/7] usb: musb: da8xx: Use devm in probe David Lechner <david@lechnology.com> - 2016-04-14 20:40 +0200
| From | David Lechner <david@lechnology.com> |
|---|---|
| Date | 2016-04-14 20:40 +0200 |
| Subject | [PATCH v4 0/7] da8xx USB PHY (was da8xx USB clocks) |
| Message-ID | <rnUlk-6mH-3@gated-at.bofh.it> |
The "da8xx USB clocks" patch series was growing a bit too big, so on the advice of Sekhar Nori, I am splitting it into two parts. This part contains everything in drivers/ and the other part will contain everything in arch/arm/mach-davinci. This patch series will apply and build on its own. It just won't work at runtime without the corresponding mach-davinci changes to provide clocks, etc. This round just contains changes from feedback. See individual patches for details. Tested working on LEGO MINDSTORMS EV3 using linux-davinci/master branch. David Lechner (7): mfd: da8xx-cfgchip: New header file for CFGCHIP registers. dt-bindings: Add bindings for phy-da8xx-usb phy: Add set_mode callback phy: da8xx-usb: new driver for DA8xx SoC USB PHY usb: ohci-da8xx: Remove code that references mach usb: musb: da8xx: Use devm in probe usb: musb: da8xx: Remove mach code .../devicetree/bindings/phy/phy-da8xx-usb.txt | 40 ++++ drivers/phy/Kconfig | 10 + drivers/phy/Makefile | 1 + drivers/phy/phy-core.c | 15 ++ drivers/phy/phy-da8xx-usb.c | 245 +++++++++++++++++++++ drivers/usb/host/Kconfig | 1 + drivers/usb/host/ohci-da8xx.c | 102 +++++---- drivers/usb/musb/Kconfig | 2 +- drivers/usb/musb/da8xx.c | 160 +++++--------- include/linux/mfd/da8xx-cfgchip.h | 153 +++++++++++++ include/linux/phy/phy.h | 15 ++ include/linux/platform_data/usb-davinci.h | 22 -- 12 files changed, 594 insertions(+), 172 deletions(-) create mode 100644 Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt create mode 100644 drivers/phy/phy-da8xx-usb.c create mode 100644 include/linux/mfd/da8xx-cfgchip.h -- 1.9.1
[toc] | [next] | [standalone]
| From | David Lechner <david@lechnology.com> |
|---|---|
| Date | 2016-04-14 20:40 +0200 |
| Subject | [PATCH v4 2/7] dt-bindings: Add bindings for phy-da8xx-usb |
| Message-ID | <rnUll-6mH-23@gated-at.bofh.it> |
| In reply to | #1379203 |
Device tree binding for new phy-da8xx-usb driver.
Signed-off-by: David Lechner <david@lechnology.com>
Acked-by: Rob Herring <robh@kernel.org>
---
v4 changes:
* swapped order of usb20 and usb11 to be in logical order of reg address.
.../devicetree/bindings/phy/phy-da8xx-usb.txt | 40 ++++++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100644 Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt
diff --git a/Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt b/Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt
new file mode 100644
index 0000000..bead185
--- /dev/null
+++ b/Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt
@@ -0,0 +1,40 @@
+TI DaVinci DA8xx USB PHY
+
+Required properties:
+ - compatible: must be "ti,da830-usbphy".
+ - #phy-cells: must be 1.
+
+This device controls the PHY for both the USB 1.1 OHCI and USB 2.0 OTG
+controllers on DA8xx SoCs. Consumers of this device should use index 0 for
+the USB 2.0 phy device and index 1 for the USB 1.1 phy device.
+
+It also requires a "syscon" node with compatible = "ti,da830-cfgchip", "syscon"
+to access the CFGCHIP2 register.
+
+Example:
+
+ cfgchip: cfgchip@1417c {
+ compatible = "ti,da830-cfgchip", "syscon";
+ reg = <0x1417c 0x14>;
+ };
+
+ usbphy: usbphy {
+ compatible = "ti,da830-usbphy";
+ #phy-cells = <1>;
+ };
+
+ usb20: usb@200000 {
+ compatible = "ti,da830-musb";
+ reg = <0x200000 0x1000>;
+ interrupts = <58>;
+ phys = <&usbphy 0>;
+ phy-names = "usbphy";
+ };
+
+ usb11: usb@225000 {
+ compatible = "ti,da830-ohci";
+ reg = <0x225000 0x1000>;
+ interrupts = <59>;
+ phys = <&usbphy 1>;
+ phy-names = "usbphy";
+ };
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> |
|---|---|
| Date | 2016-04-15 13:00 +0200 |
| Subject | Re: [PATCH v4 2/7] dt-bindings: Add bindings for phy-da8xx-usb |
| Message-ID | <ro9DI-1Ev-11@gated-at.bofh.it> |
| In reply to | #1379204 |
Hello.
On 4/14/2016 9:35 PM, David Lechner wrote:
> Device tree binding for new phy-da8xx-usb driver.
>
> Signed-off-by: David Lechner <david@lechnology.com>
> Acked-by: Rob Herring <robh@kernel.org>
> ---
>
> v4 changes:
>
> * swapped order of usb20 and usb11 to be in logical order of reg address.
>
> .../devicetree/bindings/phy/phy-da8xx-usb.txt | 40 ++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt
>
> diff --git a/Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt b/Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt
> new file mode 100644
> index 0000000..bead185
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt
> @@ -0,0 +1,40 @@
> +TI DaVinci DA8xx USB PHY
DA8xx is not DaVinci, please omit this.
> +
> +Required properties:
> + - compatible: must be "ti,da830-usbphy".
> + - #phy-cells: must be 1.
> +
> +This device controls the PHY for both the USB 1.1 OHCI and USB 2.0 OTG
> +controllers on DA8xx SoCs. Consumers of this device should use index 0 for
> +the USB 2.0 phy device and index 1 for the USB 1.1 phy device.
Not indices 2 and 1 already?
> +It also requires a "syscon" node with compatible = "ti,da830-cfgchip", "syscon"
> +to access the CFGCHIP2 register.
> +
> +Example:
> +
> + cfgchip: cfgchip@1417c {
> + compatible = "ti,da830-cfgchip", "syscon";
> + reg = <0x1417c 0x14>;
> + };
> +
> + usbphy: usbphy {
Name it "usb-phy" please, consistent to what ePAPR has mandated for
Ethernet PHYs.
[...]
MBR, Sergei
[toc] | [prev] | [next] | [standalone]
| From | David Lechner <david@lechnology.com> |
|---|---|
| Date | 2016-04-15 18:20 +0200 |
| Subject | Re: [PATCH v4 2/7] dt-bindings: Add bindings for phy-da8xx-usb |
| Message-ID | <roeDo-5Pa-43@gated-at.bofh.it> |
| In reply to | #1379714 |
On 04/15/2016 05:48 AM, Sergei Shtylyov wrote:
> On 4/14/2016 9:35 PM, David Lechner wrote:
>
>> Device tree binding for new phy-da8xx-usb driver.
>>
>> Signed-off-by: David Lechner <david@lechnology.com>
>> Acked-by: Rob Herring <robh@kernel.org>
>> ---
>>
>> v4 changes:
>>
>> * swapped order of usb20 and usb11 to be in logical order of reg address.
>>
>> .../devicetree/bindings/phy/phy-da8xx-usb.txt | 40
>> ++++++++++++++++++++++
>> 1 file changed, 40 insertions(+)
>> create mode 100644
>> Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt
>>
>> diff --git a/Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt
>> b/Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt
>> new file mode 100644
>> index 0000000..bead185
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt
>> @@ -0,0 +1,40 @@
>> +TI DaVinci DA8xx USB PHY
>
> DA8xx is not DaVinci, please omit this.
Just to be sure, you mean omit "DaVinci"?
>
>> +
>> +Required properties:
>> + - compatible: must be "ti,da830-usbphy".
>> + - #phy-cells: must be 1.
>> +
>> +This device controls the PHY for both the USB 1.1 OHCI and USB 2.0 OTG
>> +controllers on DA8xx SoCs. Consumers of this device should use index
>> 0 for
>> +the USB 2.0 phy device and index 1 for the USB 1.1 phy device.
>
> Not indices 2 and 1 already?
I changed this to reflect the TRM. USB0PHY = USB 2.0 and USB1PHY = USB 1.1
>
>> + usbphy: usbphy {
>
> Name it "usb-phy" please, consistent to what ePAPR has mandated for
> Ethernet PHYs.
Ack.
[toc] | [prev] | [next] | [standalone]
| From | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> |
|---|---|
| Date | 2016-04-15 19:10 +0200 |
| Subject | Re: [PATCH v4 2/7] dt-bindings: Add bindings for phy-da8xx-usb |
| Message-ID | <rofpL-6tr-9@gated-at.bofh.it> |
| In reply to | #1379980 |
On 04/15/2016 07:13 PM, David Lechner wrote:
>>> Device tree binding for new phy-da8xx-usb driver.
>>>
>>> Signed-off-by: David Lechner <david@lechnology.com>
>>> Acked-by: Rob Herring <robh@kernel.org>
>>> ---
>>>
>>> v4 changes:
>>>
>>> * swapped order of usb20 and usb11 to be in logical order of reg address.
>>>
>>> .../devicetree/bindings/phy/phy-da8xx-usb.txt | 40
>>> ++++++++++++++++++++++
>>> 1 file changed, 40 insertions(+)
>>> create mode 100644
>>> Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt
>>> b/Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt
>>> new file mode 100644
>>> index 0000000..bead185
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/phy/phy-da8xx-usb.txt
>>> @@ -0,0 +1,40 @@
>>> +TI DaVinci DA8xx USB PHY
>>
>> DA8xx is not DaVinci, please omit this.
>
> Just to be sure, you mean omit "DaVinci"?
Exactly. It would be better to mention OMAP-L1x instead.
MBR, Sergei
[toc] | [prev] | [next] | [standalone]
| From | David Lechner <david@lechnology.com> |
|---|---|
| Date | 2016-04-14 20:40 +0200 |
| Subject | [PATCH v4 6/7] usb: musb: da8xx: Use devm in probe |
| Message-ID | <rnUll-6mH-29@gated-at.bofh.it> |
| In reply to | #1379203 |
Simplify things a bit by using devm functions where possible.
Signed-off-by: David Lechner <david@lechnology.com>
---
v4 changes: no change
drivers/usb/musb/da8xx.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index b03d3b8..0c1997c 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -490,20 +490,18 @@ static int da8xx_probe(struct platform_device *pdev)
struct da8xx_glue *glue;
struct platform_device_info pinfo;
struct clk *clk;
+ int ret;
- int ret = -ENOMEM;
-
- glue = kzalloc(sizeof(*glue), GFP_KERNEL);
+ glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
if (!glue) {
dev_err(&pdev->dev, "failed to allocate glue context\n");
- goto err0;
+ return -ENOMEM;
}
- clk = clk_get(&pdev->dev, "usb20");
+ clk = devm_clk_get(&pdev->dev, "usb20");
if (IS_ERR(clk)) {
dev_err(&pdev->dev, "failed to get clock\n");
- ret = PTR_ERR(clk);
- goto err3;
+ return PTR_ERR(clk);
}
ret = clk_enable(clk);
@@ -560,12 +558,7 @@ err5:
clk_disable(clk);
err4:
- clk_put(clk);
-
-err3:
- kfree(glue);
-err0:
return ret;
}
@@ -576,8 +569,6 @@ static int da8xx_remove(struct platform_device *pdev)
platform_device_unregister(glue->musb);
usb_phy_generic_unregister(glue->phy);
clk_disable(glue->clk);
- clk_put(glue->clk);
- kfree(glue);
return 0;
}
--
1.9.1
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web