From: Kishon Vijay Abraham I <hidden> Date: 2012-09-06 14:57:43
This patch series adds device tree support for phy's (twl4030 and twl6030).
A new omap-usb2 phy driver has been added (with only dt suppport)
to perform phy configurations. Previously this configuration was
performed by twl6030, using pdata function pointers.
With the addition of omap-usb2 to perform phy configurations,
twl6030 is made as a comparator driver to detect VBUS and ID events
and notify it to the glue layer.
Previously these patches were part of
[PATCH v7 0/7] omap: musb: Add device tree support
This patch series was developed on
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git xceiv
Kishon Vijay Abraham I (5):
drivers: usb: phy: add a new driver for omap usb2 phy
drivers: usb: otg: make twl6030_usb as a comparator driver to
omap_usb2
drivers: usb: twl6030: Add dt support for twl6030 usb
drivers: usb: twl4030: Add device tree support for twl4030 usb
arm: omap: phy: remove unused functions from omap-phy-internal.c
.../devicetree/bindings/usb/twlxxxx-usb.txt | 40 +++
Documentation/devicetree/bindings/usb/usb-phy.txt | 17 ++
arch/arm/mach-omap2/omap_phy_internal.c | 138 ----------
arch/arm/mach-omap2/twl-common.c | 5 -
arch/arm/mach-omap2/usb-musb.c | 3 -
drivers/usb/otg/Kconfig | 2 +-
drivers/usb/otg/twl4030-usb.c | 26 +-
drivers/usb/otg/twl6030-usb.c | 157 ++++--------
drivers/usb/phy/Kconfig | 9 +
drivers/usb/phy/Makefile | 1 +
drivers/usb/phy/omap-usb2.c | 271 ++++++++++++++++++++
include/linux/usb/omap_usb.h | 46 ++++
include/linux/usb/phy_companion.h | 34 +++
13 files changed, 483 insertions(+), 266 deletions(-)
create mode 100644 Documentation/devicetree/bindings/usb/twlxxxx-usb.txt
create mode 100644 Documentation/devicetree/bindings/usb/usb-phy.txt
create mode 100644 drivers/usb/phy/omap-usb2.c
create mode 100644 include/linux/usb/omap_usb.h
create mode 100644 include/linux/usb/phy_companion.h
--
1.7.9.5
From: Kishon Vijay Abraham I <hidden> Date: 2012-09-06 14:57:42
Add device tree support for twl4030 usb driver.
Update the Documentation with device tree binding information.
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
.../devicetree/bindings/usb/twlxxxx-usb.txt | 19 ++++++++++++++
drivers/usb/otg/twl4030-usb.c | 26 +++++++++++++++-----
2 files changed, 39 insertions(+), 6 deletions(-)
@@ -19,3 +19,22 @@ Board specific device node entry &twl6030-usb { usb-supply = <&vusb>; };++TWL4030 USB PHY AND COMPARATOR+ - compatible : Should be "ti,twl4030-usb"+ - interrupts : The interrupt numbers to the cpu should be specified. First+ interrupt number is the otg interrupt number that raises ID interrupts+ and VBUS interrupts. The second interrupt number is optional.+ - <supply-name>-supply : phandle to the regulator device tree node.+ <supply-name> should be vusb1v5, vusb1v8 and vusb3v1+ - usb_mode : The mode used by the phy to connect to the controller. "1"+ specifies "ULPI" mode and "2" specifies "CEA2011_3PIN" mode.++twl4030-usb {+ compatible = "ti,twl4030-usb";+ interrupts = < 10 4 >;+ usb1v5-supply = <&vusb1v5>;+ usb1v8-supply = <&vusb1v8>;+ usb3v1-supply = <&vusb3v1>;+ usb_mode = <1>;+};
@@ -585,23 +585,28 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev)structtwl4030_usb*twl;intstatus,err;structusb_otg*otg;--if(!pdata){-dev_dbg(&pdev->dev,"platform_data not available\n");-return-EINVAL;-}+structdevice_node*np=pdev->dev.of_node;twl=devm_kzalloc(&pdev->dev,sizeof*twl,GFP_KERNEL);if(!twl)return-ENOMEM;+if(np)+of_property_read_u32(np,"usb_mode",+(enumtwl4030_usb_mode*)&twl->usb_mode);+elseif(pdata)+twl->usb_mode=pdata->usb_mode;+else{+dev_err(&pdev->dev,"twl4030 initialized without pdata\n");+return-EINVAL;+}+otg=devm_kzalloc(&pdev->dev,sizeof*otg,GFP_KERNEL);if(!otg)return-ENOMEM;twl->dev=&pdev->dev;twl->irq=platform_get_irq(pdev,0);-twl->usb_mode=pdata->usb_mode;twl->vbus_supplied=false;twl->asleep=1;twl->linkstat=OMAP_MUSB_UNKNOWN;
From: Kishon Vijay Abraham I <hidden> Date: 2012-09-06 14:57:46
Add device tree support for twl6030 usb driver.
Update the Documentation with device tree binding information.
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
.../devicetree/bindings/usb/twlxxxx-usb.txt | 21 +++++++++++
drivers/usb/otg/twl6030-usb.c | 39 +++++++++++++-------
2 files changed, 47 insertions(+), 13 deletions(-)
create mode 100644 Documentation/devicetree/bindings/usb/twlxxxx-usb.txt
@@ -0,0 +1,21 @@+USB COMPARATOR OF TWL CHIPS++TWL6030 USB COMPARATOR+ - compatible : Should be "ti,twl6030-usb"+ - interrupts : Two interrupt numbers to the cpu should be specified. First+ interrupt number is the otg interrupt number that raises ID interrupts when+ the controller has to act as host and the second interrupt number is the+ usb interrupt number that raises VBUS interrupts when the controller has to+ act as device+ - usb-supply : phandle to the regulator device tree node. It should be vusb+ if it is twl6030 or ldousb if it is twl6025 subclass.++twl6030-usb {+ compatible = "ti,twl6030-usb";+ interrupts = < 4 10 >;+};++Board specific device node entry+&twl6030-usb {+ usb-supply = <&vusb>;+};
@@ -153,13 +153,6 @@ static int twl6030_start_srp(struct phy_companion *comparator)staticinttwl6030_usb_ldo_init(structtwl6030_usb*twl){-char*regulator_name;--if(twl->features&TWL6025_SUBCLASS)-regulator_name="ldousb";-else-regulator_name="vusb";-/* Set to OTG_REV 1.3 and turn on the ID_WAKEUP_COMP */twl6030_writeb(twl,TWL6030_MODULE_ID0,0x1,TWL6030_BACKUP_REG);
@@ -169,7 +162,7 @@ static int twl6030_usb_ldo_init(struct twl6030_usb *twl)/* Program MISC2 register and set bit VUSB_IN_VBAT */twl6030_writeb(twl,TWL6030_MODULE_ID0,0x10,TWL6030_MISC2);-twl->usb3v3=regulator_get(twl->dev,regulator_name);+twl->usb3v3=regulator_get(twl->dev,twl->regulator);if(IS_ERR(twl->usb3v3))return-ENODEV;
@@ -322,9 +315,9 @@ static int __devinit twl6030_usb_probe(struct platform_device *pdev)u32ret;structtwl6030_usb*twl;intstatus,err;-structtwl4030_usb_data*pdata;-structdevice*dev=&pdev->dev;-pdata=dev->platform_data;+structdevice_node*np=pdev->dev.of_node;+structdevice*dev=&pdev->dev;+structtwl4030_usb_data*pdata=dev->platform_data;twl=devm_kzalloc(dev,sizeof*twl,GFP_KERNEL);if(!twl)
@@ -333,7 +326,6 @@ static int __devinit twl6030_usb_probe(struct platform_device *pdev)twl->dev=&pdev->dev;twl->irq1=platform_get_irq(pdev,0);twl->irq2=platform_get_irq(pdev,1);-twl->features=pdata->features;twl->linkstat=OMAP_MUSB_UNKNOWN;twl->comparator.set_vbus=twl6030_set_vbus;
@@ -345,6 +337,18 @@ static int __devinit twl6030_usb_probe(struct platform_device *pdev)return-EPROBE_DEFER;}+if(np){+twl->regulator="usb";+}elseif(pdata){+if(pdata->features&TWL6025_SUBCLASS)+twl->regulator="ldousb";+else+twl->regulator="vusb";+}else{+dev_err(&pdev->dev,"twl6030 initialized without pdata\n");+return-EINVAL;+}+/* init spinlock for workqueue */spin_lock_init(&twl->lock);
From: Kishon Vijay Abraham I <hidden> Date: 2012-09-06 14:57:53
All the PHY configuration other than VBUS, ID GND and OTG SRP are removed
from twl6030. The phy configurations are taken care by the dedicated
usb2 phy driver. So twl6030 is made as comparator driver for VBUS and
ID detection.
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
drivers/usb/otg/Kconfig | 2 +-
drivers/usb/otg/twl6030-usb.c | 118 +++++++----------------------------------
2 files changed, 19 insertions(+), 101 deletions(-)
From: Rabin Vincent <hidden> Date: 2012-09-21 21:33:52
2012/9/6 Kishon Vijay Abraham I [off-list ref]:
All the PHY configuration other than VBUS, ID GND and OTG SRP are removed
from twl6030. The phy configurations are taken care by the dedicated
usb2 phy driver. So twl6030 is made as comparator driver for VBUS and
ID detection.
Signed-off-by: Kishon Vijay Abraham I <redacted>
USB doesn't work on pandaboard on linux-next, and bisection shows this
patch. Unfortunately, I can't provide a dmesg log because USB is the
only way I currently have to get one out(!), but presumably it's because
this omap-usb2 device is never registered? Looks like this breaks
non-dt USB on pandaboard; is that intended?
(I see that current linux-next doesn't have USB support even in
pandaboard DT, but I see patches for that on the lists)
Hi,
On Sat, Sep 22, 2012 at 3:03 AM, Rabin Vincent [off-list ref] wrote:
2012/9/6 Kishon Vijay Abraham I [off-list ref]:
quoted
All the PHY configuration other than VBUS, ID GND and OTG SRP are removed
from twl6030. The phy configurations are taken care by the dedicated
usb2 phy driver. So twl6030 is made as comparator driver for VBUS and
ID detection.
Signed-off-by: Kishon Vijay Abraham I <redacted>
USB doesn't work on pandaboard on linux-next, and bisection shows this
patch. Unfortunately, I can't provide a dmesg log because USB is the
only way I currently have to get one out(!), but presumably it's because
this omap-usb2 device is never registered? Looks like this breaks
non-dt USB on pandaboard; is that intended?
Yes. omap-usb2 is *only* dt supported (New drivers shouldn't have the
old non-dt support).
Some patches are queued only for 3.7.
In case you want to use MUSB please use these patches on linux-next..
[PATCH v2] arm: omap: hwmod: make *phy_48m* as the main_clk of ocp2scp
[PATCH] ARM: OMAP2+: hwmod data: Fix ocp2scp_usb_phy and usb_host_hs
entries (from Benoit)
[PATCH 0/2] ARM: dts: Add subnode for ocp2scp (patch series)
[PATCH v3 0/3] ARM: dts: omap: add dt data for MUSB (patch series)
Pls note all these patches are queued for 3.7
Thanks
Kishon
From: Rabin Vincent <hidden> Date: 2012-09-24 09:06:57
2012/9/24 ABRAHAM, KISHON VIJAY [off-list ref]:
On Sat, Sep 22, 2012 at 3:03 AM, Rabin Vincent [off-list ref] wrote:
quoted
USB doesn't work on pandaboard on linux-next, and bisection shows this
patch. Unfortunately, I can't provide a dmesg log because USB is the
only way I currently have to get one out(!), but presumably it's because
this omap-usb2 device is never registered? Looks like this breaks
non-dt USB on pandaboard; is that intended?
Yes. omap-usb2 is *only* dt supported (New drivers shouldn't have the
old non-dt support).
Well, USB used to work fine on Pandaboard without DT before the
introduction of "omap-usb2", so one would expected it to continue
working (until the board file is completely removed).
Anyway, I've moved to DT now.
Some patches are queued only for 3.7.
In case you want to use MUSB please use these patches on linux-next..
[PATCH v2] arm: omap: hwmod: make *phy_48m* as the main_clk of ocp2scp
[PATCH] ARM: OMAP2+: hwmod data: Fix ocp2scp_usb_phy and usb_host_hs
entries (from Benoit)
[PATCH 0/2] ARM: dts: Add subnode for ocp2scp (patch series)
[PATCH v3 0/3] ARM: dts: omap: add dt data for MUSB (patch series)
I got these by merging in Benoit's for_3.7/dts_part2 on top of
next-20120921. Thanks.
From: Roger Quadros <hidden> Date: 2012-10-26 15:16:27
Hi Kishon & Benoit,
On 09/24/2012 12:06 PM, Rabin Vincent wrote:
2012/9/24 ABRAHAM, KISHON VIJAY [off-list ref]:
quoted
On Sat, Sep 22, 2012 at 3:03 AM, Rabin Vincent [off-list ref] wrote:
quoted
USB doesn't work on pandaboard on linux-next, and bisection shows this
patch. Unfortunately, I can't provide a dmesg log because USB is the
only way I currently have to get one out(!), but presumably it's because
this omap-usb2 device is never registered? Looks like this breaks
non-dt USB on pandaboard; is that intended?
Yes. omap-usb2 is *only* dt supported (New drivers shouldn't have the
old non-dt support).
Well, USB used to work fine on Pandaboard without DT before the
introduction of "omap-usb2", so one would expected it to continue
working (until the board file is completely removed).
Anyway, I've moved to DT now.
quoted
Some patches are queued only for 3.7.
In case you want to use MUSB please use these patches on linux-next..
[PATCH v2] arm: omap: hwmod: make *phy_48m* as the main_clk of ocp2scp
[PATCH] ARM: OMAP2+: hwmod data: Fix ocp2scp_usb_phy and usb_host_hs
entries (from Benoit)
[PATCH 0/2] ARM: dts: Add subnode for ocp2scp (patch series)
[PATCH v3 0/3] ARM: dts: omap: add dt data for MUSB (patch series)
I got these by merging in Benoit's for_3.7/dts_part2 on top of
next-20120921. Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
I still can't get musb to work on 3.7-rc2. Apparently it is still
missing the patches from Benoit's for_3.7/dts_part2.
Maybe I just need to wait for it to be merged?
Till then, where can I get a tree where musb works on Panda?
Benoit,
FYI, I get merge conflicts when merging 3.7-rc2 on top of Linus's kernel
HEAD. Am I missing something?
regards,
-roger
Hi Roger,
On 10/26/2012 05:16 PM, Roger Quadros wrote:
Hi Kishon & Benoit,
On 09/24/2012 12:06 PM, Rabin Vincent wrote:
quoted
2012/9/24 ABRAHAM, KISHON VIJAY [off-list ref]:
quoted
On Sat, Sep 22, 2012 at 3:03 AM, Rabin Vincent [off-list ref] wrote:
quoted
USB doesn't work on pandaboard on linux-next, and bisection shows this
patch. Unfortunately, I can't provide a dmesg log because USB is the
only way I currently have to get one out(!), but presumably it's because
this omap-usb2 device is never registered? Looks like this breaks
non-dt USB on pandaboard; is that intended?
Yes. omap-usb2 is *only* dt supported (New drivers shouldn't have the
old non-dt support).
Well, USB used to work fine on Pandaboard without DT before the
introduction of "omap-usb2", so one would expected it to continue
working (until the board file is completely removed).
Anyway, I've moved to DT now.
quoted
Some patches are queued only for 3.7.
In case you want to use MUSB please use these patches on linux-next..
[PATCH v2] arm: omap: hwmod: make *phy_48m* as the main_clk of ocp2scp
[PATCH] ARM: OMAP2+: hwmod data: Fix ocp2scp_usb_phy and usb_host_hs
entries (from Benoit)
[PATCH 0/2] ARM: dts: Add subnode for ocp2scp (patch series)
[PATCH v3 0/3] ARM: dts: omap: add dt data for MUSB (patch series)
I got these by merging in Benoit's for_3.7/dts_part2 on top of
next-20120921. Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
I still can't get musb to work on 3.7-rc2. Apparently it is still
missing the patches from Benoit's for_3.7/dts_part2.
Maybe I just need to wait for it to be merged?
They are now in a for_3.8/dts. Unfortunately, one patch that was adding
ctrl_module address in the USB data was rejected and thus I'm not sure
it will work without that.
I think Tony had an idea to map the ctrl_register to regulator fmwk or
something like that.
Till then, where can I get a tree where musb works on Panda?
Benoit,
FYI, I get merge conflicts when merging 3.7-rc2 on top of Linus's kernel
HEAD. Am I missing something?
Yeah, some more patches were merged outside our tree.
I fixed that. Can you try with the updated branch?
Regards,
Benoit
From: Kishon Vijay Abraham I <hidden> Date: 2012-09-06 14:58:13
All the unnessary functions in omap-phy-internal is removed.
These functionality are now handled by omap-usb2 phy driver.
Cc: Felipe Balbi <redacted>
Signed-off-by: Kishon Vijay Abraham I <redacted>
Acked-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/omap_phy_internal.c | 138 -------------------------------
arch/arm/mach-omap2/twl-common.c | 5 --
arch/arm/mach-omap2/usb-musb.c | 3 -
3 files changed, 146 deletions(-)
@@ -31,144 +31,6 @@#include<plat/usb.h>#include"control.h"-/* OMAP control module register for UTMI PHY */-#define CONTROL_DEV_CONF 0x300-#define PHY_PD 0x1--#define USBOTGHS_CONTROL 0x33c-#define AVALID BIT(0)-#define BVALID BIT(1)-#define VBUSVALID BIT(2)-#define SESSEND BIT(3)-#define IDDIG BIT(4)--staticstructclk*phyclk,*clk48m,*clk32k;-staticvoid__iomem*ctrl_base;-staticintusbotghs_control;--intomap4430_phy_init(structdevice*dev)-{-ctrl_base=ioremap(OMAP443X_SCM_BASE,SZ_1K);-if(!ctrl_base){-pr_err("control module ioremap failed\n");-return-ENOMEM;-}-/* Power down the phy */-__raw_writel(PHY_PD,ctrl_base+CONTROL_DEV_CONF);--if(!dev){-iounmap(ctrl_base);-return0;-}--phyclk=clk_get(dev,"ocp2scp_usb_phy_ick");-if(IS_ERR(phyclk)){-dev_err(dev,"cannot clk_get ocp2scp_usb_phy_ick\n");-iounmap(ctrl_base);-returnPTR_ERR(phyclk);-}--clk48m=clk_get(dev,"ocp2scp_usb_phy_phy_48m");-if(IS_ERR(clk48m)){-dev_err(dev,"cannot clk_get ocp2scp_usb_phy_phy_48m\n");-clk_put(phyclk);-iounmap(ctrl_base);-returnPTR_ERR(clk48m);-}--clk32k=clk_get(dev,"usb_phy_cm_clk32k");-if(IS_ERR(clk32k)){-dev_err(dev,"cannot clk_get usb_phy_cm_clk32k\n");-clk_put(phyclk);-clk_put(clk48m);-iounmap(ctrl_base);-returnPTR_ERR(clk32k);-}-return0;-}--intomap4430_phy_set_clk(structdevice*dev,inton)-{-staticintstate;--if(on&&!state){-/* Enable the phy clocks */-clk_enable(phyclk);-clk_enable(clk48m);-clk_enable(clk32k);-state=1;-}elseif(state){-/* Disable the phy clocks */-clk_disable(phyclk);-clk_disable(clk48m);-clk_disable(clk32k);-state=0;-}-return0;-}--intomap4430_phy_power(structdevice*dev,intID,inton)-{-if(on){-if(ID)-/* enable VBUS valid, IDDIG groung */-__raw_writel(AVALID|VBUSVALID,ctrl_base+-USBOTGHS_CONTROL);-else-/*-*EnableVBUSValid,AValidandIDDIG-*highimpedance-*/-__raw_writel(IDDIG|AVALID|VBUSVALID,-ctrl_base+USBOTGHS_CONTROL);-}else{-/* Enable session END and IDIG to high impedance. */-__raw_writel(SESSEND|IDDIG,ctrl_base+-USBOTGHS_CONTROL);-}-return0;-}--intomap4430_phy_suspend(structdevice*dev,intsuspend)-{-if(suspend){-/* Disable the clocks */-omap4430_phy_set_clk(dev,0);-/* Power down the phy */-__raw_writel(PHY_PD,ctrl_base+CONTROL_DEV_CONF);--/* save the context */-usbotghs_control=__raw_readl(ctrl_base+USBOTGHS_CONTROL);-}else{-/* Enable the internel phy clcoks */-omap4430_phy_set_clk(dev,1);-/* power on the phy */-if(__raw_readl(ctrl_base+CONTROL_DEV_CONF)&PHY_PD){-__raw_writel(~PHY_PD,ctrl_base+CONTROL_DEV_CONF);-mdelay(200);-}--/* restore the context */-__raw_writel(usbotghs_control,ctrl_base+USBOTGHS_CONTROL);-}--return0;-}--intomap4430_phy_exit(structdevice*dev)-{-if(ctrl_base)-iounmap(ctrl_base);-if(phyclk)-clk_put(phyclk);-if(clk48m)-clk_put(clk48m);-if(clk32k)-clk_put(clk32k);--return0;-}-voidam35x_musb_reset(void){u32regval;
From: Kishon Vijay Abraham I <hidden> Date: 2012-09-06 14:58:15
All phy related programming like enabling/disabling the clocks, powering
on/off the phy is taken care of by this driver. It is also used for OTG
related functionality like srp.
This also includes device tree support for usb2 phy driver and
the documentation with device tree binding information is updated.
Currently writing to control module register is taken care in this
driver which will be removed once the control module driver is in place.
Cc: Felipe Balbi <redacted>
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
Documentation/devicetree/bindings/usb/usb-phy.txt | 17 ++
drivers/usb/phy/Kconfig | 9 +
drivers/usb/phy/Makefile | 1 +
drivers/usb/phy/omap-usb2.c | 271 +++++++++++++++++++++
include/linux/usb/omap_usb.h | 46 ++++
include/linux/usb/phy_companion.h | 34 +++
6 files changed, 378 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/usb-phy.txt
create mode 100644 drivers/usb/phy/omap-usb2.c
create mode 100644 include/linux/usb/omap_usb.h
create mode 100644 include/linux/usb/phy_companion.h
@@ -0,0 +1,17 @@+USB PHY++OMAP USB2 PHY++Required properties:+ - compatible: Should be "ti,omap-usb2"+ - reg : Address and length of the register set for the device. Also+add the address of control module dev conf register until a driver for+control module is added++This is usually a subnode of ocp2scp to which it is connected.++usb2phy at 4a0ad080 {+ compatible = "ti,omap-usb2";+ reg = <0x4a0ad080 0x58>,+ <0x4a002300 0x4>;+};
@@ -0,0 +1,271 @@+/*+*omap-usb2.c-USBPHY,talkingtomusbcontrollerinOMAP.+*+*Copyright(C)2012TexasInstrumentsIncorporated-http://www.ti.com+*Thisprogramisfreesoftware;youcanredistributeitand/ormodify+*itunderthetermsoftheGNUGeneralPublicLicenseaspublishedby+*theFreeSoftwareFoundation;eitherversion2oftheLicense,or+*(atyouroption)anylaterversion.+*+*Author:KishonVijayAbrahamI<kishon@ti.com>+*+*Thisprogramisdistributedinthehopethatitwillbeuseful,+*butWITHOUTANYWARRANTY;withouteventheimpliedwarrantyof+*MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.Seethe+*GNUGeneralPublicLicenseformoredetails.+*+*/++#include<linux/module.h>+#include<linux/platform_device.h>+#include<linux/slab.h>+#include<linux/of.h>+#include<linux/io.h>+#include<linux/usb/omap_usb.h>+#include<linux/usb/phy_companion.h>+#include<linux/clk.h>+#include<linux/err.h>+#include<linux/pm_runtime.h>+#include<linux/delay.h>++/**+*omap_usb2_set_comparator-linksthecomparatorpresentinthesytemwith+*thisphy+*@comparator-thecompanionphy(comparator)forthisphy+*+*ThephycompaniondrivershouldcallthisAPIpassingthephy_companion+*filledwithset_vbusandstart_srptobeusedbyusbphy.+*+*Forusebyphycompaniondriver+*/+intomap_usb2_set_comparator(structphy_companion*comparator)+{+structomap_usb*phy;+structusb_phy*x=usb_get_phy(USB_PHY_TYPE_USB2);++if(IS_ERR(x))+return-ENODEV;++phy=phy_to_omapusb(x);+phy->comparator=comparator;+return0;+}+EXPORT_SYMBOL_GPL(omap_usb2_set_comparator);++/**+*omap_usb_phy_power-poweron/offthephyusingcontrolmodulereg+*@phy:structomap_usb*+*@on:0or1,basedonpoweringonoroffthePHY+*+*XXX:Removethisfunctiononcecontrolmoduledrivergetsmerged+*/+staticvoidomap_usb_phy_power(structomap_usb*phy,inton)+{+u32val;++if(on){+val=readl(phy->control_dev);+if(val&PHY_PD){+writel(~PHY_PD,phy->control_dev);+/* XXX: add proper documentation for this delay */+mdelay(200);+}+}else{+writel(PHY_PD,phy->control_dev);+}+}++staticintomap_usb_set_vbus(structusb_otg*otg,boolenabled)+{+structomap_usb*phy=phy_to_omapusb(otg->phy);++if(!phy->comparator)+return-ENODEV;++returnphy->comparator->set_vbus(phy->comparator,enabled);+}++staticintomap_usb_start_srp(structusb_otg*otg)+{+structomap_usb*phy=phy_to_omapusb(otg->phy);++if(!phy->comparator)+return-ENODEV;++returnphy->comparator->start_srp(phy->comparator);+}++staticintomap_usb_set_host(structusb_otg*otg,structusb_bus*host)+{+structusb_phy*phy=otg->phy;++otg->host=host;+if(!host)+phy->state=OTG_STATE_UNDEFINED;++return0;+}++staticintomap_usb_set_peripheral(structusb_otg*otg,+structusb_gadget*gadget)+{+structusb_phy*phy=otg->phy;++otg->gadget=gadget;+if(!gadget)+phy->state=OTG_STATE_UNDEFINED;++return0;+}++staticintomap_usb2_suspend(structusb_phy*x,intsuspend)+{+u32ret;+structomap_usb*phy=phy_to_omapusb(x);++if(suspend&&!phy->is_suspended){+omap_usb_phy_power(phy,0);+pm_runtime_put_sync(phy->dev);+phy->is_suspended=1;+}elseif(!suspend&&phy->is_suspended){+ret=pm_runtime_get_sync(phy->dev);+if(ret<0){+dev_err(phy->dev,"get_sync failed with err %d\n",+ret);+returnret;+}+omap_usb_phy_power(phy,1);+phy->is_suspended=0;+}++return0;+}++staticint__devinitomap_usb2_probe(structplatform_device*pdev)+{+structomap_usb*phy;+structusb_otg*otg;+structresource*res;++phy=devm_kzalloc(&pdev->dev,sizeof(*phy),GFP_KERNEL);+if(!phy){+dev_err(&pdev->dev,"unable to allocate memory for USB2 PHY\n");+return-ENOMEM;+}++otg=devm_kzalloc(&pdev->dev,sizeof(*otg),GFP_KERNEL);+if(!otg){+dev_err(&pdev->dev,"unable to allocate memory for USB OTG\n");+return-ENOMEM;+}++phy->dev=&pdev->dev;++phy->phy.dev=phy->dev;+phy->phy.label="omap-usb2";+phy->phy.set_suspend=omap_usb2_suspend;+phy->phy.otg=otg;++res=platform_get_resource(pdev,IORESOURCE_MEM,1);++phy->control_dev=devm_request_and_ioremap(&pdev->dev,res);+if(phy->control_dev==NULL){+dev_err(&pdev->dev,"Failed to obtain io memory\n");+return-ENXIO;+}++phy->is_suspended=1;+omap_usb_phy_power(phy,0);++otg->set_host=omap_usb_set_host;+otg->set_peripheral=omap_usb_set_peripheral;+otg->set_vbus=omap_usb_set_vbus;+otg->start_srp=omap_usb_start_srp;+otg->phy=&phy->phy;++phy->wkupclk=devm_clk_get(phy->dev,"usb_phy_cm_clk32k");+if(IS_ERR(phy->wkupclk)){+dev_err(&pdev->dev,"unable to get usb_phy_cm_clk32k\n");+returnPTR_ERR(phy->wkupclk);+}+clk_prepare(phy->wkupclk);++usb_add_phy(&phy->phy,USB_PHY_TYPE_USB2);++platform_set_drvdata(pdev,phy);++pm_runtime_enable(phy->dev);++return0;+}++staticint__devexitomap_usb2_remove(structplatform_device*pdev)+{+structomap_usb*phy=platform_get_drvdata(pdev);++clk_unprepare(phy->wkupclk);+usb_remove_phy(&phy->phy);++return0;+}++#ifdef CONFIG_PM_RUNTIME++staticintomap_usb2_runtime_suspend(structdevice*dev)+{+structplatform_device*pdev=to_platform_device(dev);+structomap_usb*phy=platform_get_drvdata(pdev);++clk_disable(phy->wkupclk);++return0;+}++staticintomap_usb2_runtime_resume(structdevice*dev)+{+u32ret=0;+structplatform_device*pdev=to_platform_device(dev);+structomap_usb*phy=platform_get_drvdata(pdev);++ret=clk_enable(phy->wkupclk);+if(ret<0)+dev_err(phy->dev,"Failed to enable wkupclk %d\n",ret);++returnret;+}++staticconststructdev_pm_opsomap_usb2_pm_ops={+SET_RUNTIME_PM_OPS(omap_usb2_runtime_suspend,omap_usb2_runtime_resume,+NULL)+};++#define DEV_PM_OPS (&omap_usb2_pm_ops)+#else+#define DEV_PM_OPS NULL+#endif++#ifdef CONFIG_OF+staticconststructof_device_idomap_usb2_id_table[]={+{.compatible="ti,omap-usb2"},+{}+};+MODULE_DEVICE_TABLE(of,omap_usb2_id_table);+#endif++staticstructplatform_driveromap_usb2_driver={+.probe=omap_usb2_probe,+.remove=__devexit_p(omap_usb2_remove),+.driver={+.name="omap-usb2",+.owner=THIS_MODULE,+.pm=DEV_PM_OPS,+.of_match_table=of_match_ptr(omap_usb2_id_table),+},+};++module_platform_driver(omap_usb2_driver);++MODULE_ALIAS("platform: omap_usb2");+MODULE_AUTHOR("Texas Instruments Inc.");+MODULE_DESCRIPTION("OMAP USB2 phy driver");+MODULE_LICENSE("GPL v2");
@@ -0,0 +1,34 @@+/*+*phy-companion.h--phycompaniontoindicatethecomparatorpartofPHY+*+*Copyright(C)2012TexasInstrumentsIncorporated-http://www.ti.com+*Thisprogramisfreesoftware;youcanredistributeitand/ormodify+*itunderthetermsoftheGNUGeneralPublicLicenseaspublishedby+*theFreeSoftwareFoundation;eitherversion2oftheLicense,or+*(atyouroption)anylaterversion.+*+*Author:KishonVijayAbrahamI<kishon@ti.com>+*+*Thisprogramisdistributedinthehopethatitwillbeuseful,+*butWITHOUTANYWARRANTY;withouteventheimpliedwarrantyof+*MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.Seethe+*GNUGeneralPublicLicenseformoredetails.+*+*/++#ifndef __DRIVERS_PHY_COMPANION_H+#define __DRIVERS_PHY_COMPANION_H++#include<linux/usb/otg.h>++/* phy_companion to take care of VBUS, ID and srp capabilities */+structphy_companion{++/* effective for A-peripheral, ignored for B devices */+int(*set_vbus)(structphy_companion*x,boolenabled);++/* for B devices only: start session with A-Host */+int(*start_srp)(structphy_companion*x);+};++#endif /* __DRIVERS_PHY_COMPANION_H */
From: Rob Herring <hidden> Date: 2012-09-24 13:15:46
On 09/06/2012 09:57 AM, Kishon Vijay Abraham I wrote:
quoted hunk
All phy related programming like enabling/disabling the clocks, powering
on/off the phy is taken care of by this driver. It is also used for OTG
related functionality like srp.
This also includes device tree support for usb2 phy driver and
the documentation with device tree binding information is updated.
Currently writing to control module register is taken care in this
driver which will be removed once the control module driver is in place.
Cc: Felipe Balbi <redacted>
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
Documentation/devicetree/bindings/usb/usb-phy.txt | 17 ++
drivers/usb/phy/Kconfig | 9 +
drivers/usb/phy/Makefile | 1 +
drivers/usb/phy/omap-usb2.c | 271 +++++++++++++++++++++
include/linux/usb/omap_usb.h | 46 ++++
include/linux/usb/phy_companion.h | 34 +++
6 files changed, 378 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/usb-phy.txt
create mode 100644 drivers/usb/phy/omap-usb2.c
create mode 100644 include/linux/usb/omap_usb.h
create mode 100644 include/linux/usb/phy_companion.h
@@ -0,0 +1,17 @@+USB PHY++OMAP USB2 PHY++Required properties:+ - compatible: Should be "ti,omap-usb2"
...for a specific phy. However, I do think a generic binding to describe
host ctrlr to phy connections is needed.
+ - reg : Address and length of the register set for the device. Also
+add the address of control module dev conf register until a driver for
+control module is added
The dts should describe the h/w, not what you need for the current
driver. The 2nd reg field does not belong here.
+
+This is usually a subnode of ocp2scp to which it is connected.
@@ -0,0 +1,271 @@+/*+*omap-usb2.c-USBPHY,talkingtomusbcontrollerinOMAP.+*+*Copyright(C)2012TexasInstrumentsIncorporated-http://www.ti.com+*Thisprogramisfreesoftware;youcanredistributeitand/ormodify+*itunderthetermsoftheGNUGeneralPublicLicenseaspublishedby+*theFreeSoftwareFoundation;eitherversion2oftheLicense,or+*(atyouroption)anylaterversion.+*+*Author:KishonVijayAbrahamI<kishon@ti.com>+*+*Thisprogramisdistributedinthehopethatitwillbeuseful,+*butWITHOUTANYWARRANTY;withouteventheimpliedwarrantyof+*MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.Seethe+*GNUGeneralPublicLicenseformoredetails.+*+*/++#include<linux/module.h>+#include<linux/platform_device.h>+#include<linux/slab.h>+#include<linux/of.h>+#include<linux/io.h>+#include<linux/usb/omap_usb.h>+#include<linux/usb/phy_companion.h>+#include<linux/clk.h>+#include<linux/err.h>+#include<linux/pm_runtime.h>+#include<linux/delay.h>++/**+*omap_usb2_set_comparator-linksthecomparatorpresentinthesytemwith+*thisphy+*@comparator-thecompanionphy(comparator)forthisphy+*+*ThephycompaniondrivershouldcallthisAPIpassingthephy_companion+*filledwithset_vbusandstart_srptobeusedbyusbphy.+*+*Forusebyphycompaniondriver+*/+intomap_usb2_set_comparator(structphy_companion*comparator)+{+structomap_usb*phy;+structusb_phy*x=usb_get_phy(USB_PHY_TYPE_USB2);++if(IS_ERR(x))+return-ENODEV;++phy=phy_to_omapusb(x);+phy->comparator=comparator;+return0;+}+EXPORT_SYMBOL_GPL(omap_usb2_set_comparator);++/**+*omap_usb_phy_power-poweron/offthephyusingcontrolmodulereg+*@phy:structomap_usb*+*@on:0or1,basedonpoweringonoroffthePHY+*+*XXX:Removethisfunctiononcecontrolmoduledrivergetsmerged+*/+staticvoidomap_usb_phy_power(structomap_usb*phy,inton)+{+u32val;++if(on){+val=readl(phy->control_dev);+if(val&PHY_PD){+writel(~PHY_PD,phy->control_dev);+/* XXX: add proper documentation for this delay */+mdelay(200);+}+}else{+writel(PHY_PD,phy->control_dev);+}+}++staticintomap_usb_set_vbus(structusb_otg*otg,boolenabled)+{+structomap_usb*phy=phy_to_omapusb(otg->phy);++if(!phy->comparator)+return-ENODEV;++returnphy->comparator->set_vbus(phy->comparator,enabled);+}++staticintomap_usb_start_srp(structusb_otg*otg)+{+structomap_usb*phy=phy_to_omapusb(otg->phy);++if(!phy->comparator)+return-ENODEV;++returnphy->comparator->start_srp(phy->comparator);+}++staticintomap_usb_set_host(structusb_otg*otg,structusb_bus*host)+{+structusb_phy*phy=otg->phy;++otg->host=host;+if(!host)+phy->state=OTG_STATE_UNDEFINED;++return0;+}++staticintomap_usb_set_peripheral(structusb_otg*otg,+structusb_gadget*gadget)+{+structusb_phy*phy=otg->phy;++otg->gadget=gadget;+if(!gadget)+phy->state=OTG_STATE_UNDEFINED;++return0;+}++staticintomap_usb2_suspend(structusb_phy*x,intsuspend)+{+u32ret;+structomap_usb*phy=phy_to_omapusb(x);++if(suspend&&!phy->is_suspended){+omap_usb_phy_power(phy,0);+pm_runtime_put_sync(phy->dev);+phy->is_suspended=1;+}elseif(!suspend&&phy->is_suspended){+ret=pm_runtime_get_sync(phy->dev);+if(ret<0){+dev_err(phy->dev,"get_sync failed with err %d\n",+ret);+returnret;+}+omap_usb_phy_power(phy,1);+phy->is_suspended=0;+}++return0;+}++staticint__devinitomap_usb2_probe(structplatform_device*pdev)+{+structomap_usb*phy;+structusb_otg*otg;+structresource*res;++phy=devm_kzalloc(&pdev->dev,sizeof(*phy),GFP_KERNEL);+if(!phy){+dev_err(&pdev->dev,"unable to allocate memory for USB2 PHY\n");+return-ENOMEM;+}++otg=devm_kzalloc(&pdev->dev,sizeof(*otg),GFP_KERNEL);+if(!otg){+dev_err(&pdev->dev,"unable to allocate memory for USB OTG\n");+return-ENOMEM;+}++phy->dev=&pdev->dev;++phy->phy.dev=phy->dev;+phy->phy.label="omap-usb2";+phy->phy.set_suspend=omap_usb2_suspend;+phy->phy.otg=otg;++res=platform_get_resource(pdev,IORESOURCE_MEM,1);++phy->control_dev=devm_request_and_ioremap(&pdev->dev,res);+if(phy->control_dev==NULL){+dev_err(&pdev->dev,"Failed to obtain io memory\n");+return-ENXIO;+}++phy->is_suspended=1;+omap_usb_phy_power(phy,0);++otg->set_host=omap_usb_set_host;+otg->set_peripheral=omap_usb_set_peripheral;+otg->set_vbus=omap_usb_set_vbus;+otg->start_srp=omap_usb_start_srp;+otg->phy=&phy->phy;++phy->wkupclk=devm_clk_get(phy->dev,"usb_phy_cm_clk32k");+if(IS_ERR(phy->wkupclk)){+dev_err(&pdev->dev,"unable to get usb_phy_cm_clk32k\n");+returnPTR_ERR(phy->wkupclk);+}+clk_prepare(phy->wkupclk);++usb_add_phy(&phy->phy,USB_PHY_TYPE_USB2);++platform_set_drvdata(pdev,phy);++pm_runtime_enable(phy->dev);++return0;+}++staticint__devexitomap_usb2_remove(structplatform_device*pdev)+{+structomap_usb*phy=platform_get_drvdata(pdev);++clk_unprepare(phy->wkupclk);+usb_remove_phy(&phy->phy);++return0;+}++#ifdef CONFIG_PM_RUNTIME++staticintomap_usb2_runtime_suspend(structdevice*dev)+{+structplatform_device*pdev=to_platform_device(dev);+structomap_usb*phy=platform_get_drvdata(pdev);++clk_disable(phy->wkupclk);++return0;+}++staticintomap_usb2_runtime_resume(structdevice*dev)+{+u32ret=0;+structplatform_device*pdev=to_platform_device(dev);+structomap_usb*phy=platform_get_drvdata(pdev);++ret=clk_enable(phy->wkupclk);+if(ret<0)+dev_err(phy->dev,"Failed to enable wkupclk %d\n",ret);++returnret;+}++staticconststructdev_pm_opsomap_usb2_pm_ops={+SET_RUNTIME_PM_OPS(omap_usb2_runtime_suspend,omap_usb2_runtime_resume,+NULL)+};++#define DEV_PM_OPS (&omap_usb2_pm_ops)+#else+#define DEV_PM_OPS NULL+#endif++#ifdef CONFIG_OF+staticconststructof_device_idomap_usb2_id_table[]={+{.compatible="ti,omap-usb2"},+{}+};+MODULE_DEVICE_TABLE(of,omap_usb2_id_table);+#endif++staticstructplatform_driveromap_usb2_driver={+.probe=omap_usb2_probe,+.remove=__devexit_p(omap_usb2_remove),+.driver={+.name="omap-usb2",+.owner=THIS_MODULE,+.pm=DEV_PM_OPS,+.of_match_table=of_match_ptr(omap_usb2_id_table),+},+};++module_platform_driver(omap_usb2_driver);++MODULE_ALIAS("platform: omap_usb2");+MODULE_AUTHOR("Texas Instruments Inc.");+MODULE_DESCRIPTION("OMAP USB2 phy driver");+MODULE_LICENSE("GPL v2");
@@ -0,0 +1,34 @@+/*+*phy-companion.h--phycompaniontoindicatethecomparatorpartofPHY+*+*Copyright(C)2012TexasInstrumentsIncorporated-http://www.ti.com+*Thisprogramisfreesoftware;youcanredistributeitand/ormodify+*itunderthetermsoftheGNUGeneralPublicLicenseaspublishedby+*theFreeSoftwareFoundation;eitherversion2oftheLicense,or+*(atyouroption)anylaterversion.+*+*Author:KishonVijayAbrahamI<kishon@ti.com>+*+*Thisprogramisdistributedinthehopethatitwillbeuseful,+*butWITHOUTANYWARRANTY;withouteventheimpliedwarrantyof+*MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.Seethe+*GNUGeneralPublicLicenseformoredetails.+*+*/++#ifndef __DRIVERS_PHY_COMPANION_H+#define __DRIVERS_PHY_COMPANION_H++#include<linux/usb/otg.h>++/* phy_companion to take care of VBUS, ID and srp capabilities */+structphy_companion{++/* effective for A-peripheral, ignored for B devices */+int(*set_vbus)(structphy_companion*x,boolenabled);++/* for B devices only: start session with A-Host */+int(*start_srp)(structphy_companion*x);+};++#endif /* __DRIVERS_PHY_COMPANION_H */
Hi,
On Mon, Sep 24, 2012 at 6:45 PM, Rob Herring [off-list ref] wrote:
On 09/06/2012 09:57 AM, Kishon Vijay Abraham I wrote:
quoted
All phy related programming like enabling/disabling the clocks, powering
on/off the phy is taken care of by this driver. It is also used for OTG
related functionality like srp.
This also includes device tree support for usb2 phy driver and
the documentation with device tree binding information is updated.
Currently writing to control module register is taken care in this
driver which will be removed once the control module driver is in place.
Cc: Felipe Balbi <redacted>
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
Documentation/devicetree/bindings/usb/usb-phy.txt | 17 ++
drivers/usb/phy/Kconfig | 9 +
drivers/usb/phy/Makefile | 1 +
drivers/usb/phy/omap-usb2.c | 271 +++++++++++++++++++++
include/linux/usb/omap_usb.h | 46 ++++
include/linux/usb/phy_companion.h | 34 +++
6 files changed, 378 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/usb-phy.txt
create mode 100644 drivers/usb/phy/omap-usb2.c
create mode 100644 include/linux/usb/omap_usb.h
create mode 100644 include/linux/usb/phy_companion.h
@@ -0,0 +1,17 @@+USB PHY++OMAP USB2 PHY++Required properties:+ - compatible: Should be "ti,omap-usb2"
...for a specific phy. However, I do think a generic binding to describe
host ctrlr to phy connections is needed.
quoted
+ - reg : Address and length of the register set for the device. Also
+add the address of control module dev conf register until a driver for
+control module is added
The dts should describe the h/w, not what you need for the current
driver. The 2nd reg field does not belong here.
Indeed. This was discussed and agreed upon as a interim solution till
we have a control module driver in place to write to the control
module register.
quoted
+
+This is usually a subnode of ocp2scp to which it is connected.
From: Rob Herring <hidden> Date: 2012-09-27 14:24:37
On 09/25/2012 05:06 AM, ABRAHAM, KISHON VIJAY wrote:
Hi,
On Mon, Sep 24, 2012 at 6:45 PM, Rob Herring [off-list ref] wrote:
quoted
On 09/06/2012 09:57 AM, Kishon Vijay Abraham I wrote:
quoted
All phy related programming like enabling/disabling the clocks, powering
on/off the phy is taken care of by this driver. It is also used for OTG
related functionality like srp.
This also includes device tree support for usb2 phy driver and
the documentation with device tree binding information is updated.
Currently writing to control module register is taken care in this
driver which will be removed once the control module driver is in place.
Cc: Felipe Balbi <redacted>
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
Documentation/devicetree/bindings/usb/usb-phy.txt | 17 ++
drivers/usb/phy/Kconfig | 9 +
drivers/usb/phy/Makefile | 1 +
drivers/usb/phy/omap-usb2.c | 271 +++++++++++++++++++++
include/linux/usb/omap_usb.h | 46 ++++
include/linux/usb/phy_companion.h | 34 +++
6 files changed, 378 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/usb-phy.txt
create mode 100644 drivers/usb/phy/omap-usb2.c
create mode 100644 include/linux/usb/omap_usb.h
create mode 100644 include/linux/usb/phy_companion.h
@@ -0,0 +1,17 @@+USB PHY++OMAP USB2 PHY++Required properties:+ - compatible: Should be "ti,omap-usb2"
...for a specific phy. However, I do think a generic binding to describe
host ctrlr to phy connections is needed.
quoted
+ - reg : Address and length of the register set for the device. Also
+add the address of control module dev conf register until a driver for
+control module is added
The dts should describe the h/w, not what you need for the current
driver. The 2nd reg field does not belong here.
Indeed. This was discussed and agreed upon as a interim solution till
we have a control module driver in place to write to the control
module register.
Discussed where and agreed by who? I for one do not agree.
Rob
quoted
quoted
+
+This is usually a subnode of ocp2scp to which it is connected.
Hi,
On Thu, Sep 27, 2012 at 7:54 PM, Rob Herring [off-list ref] wrote:
On 09/25/2012 05:06 AM, ABRAHAM, KISHON VIJAY wrote:
quoted
Hi,
On Mon, Sep 24, 2012 at 6:45 PM, Rob Herring [off-list ref] wrote:
quoted
On 09/06/2012 09:57 AM, Kishon Vijay Abraham I wrote:
quoted
All phy related programming like enabling/disabling the clocks, powering
on/off the phy is taken care of by this driver. It is also used for OTG
related functionality like srp.
This also includes device tree support for usb2 phy driver and
the documentation with device tree binding information is updated.
Currently writing to control module register is taken care in this
driver which will be removed once the control module driver is in place.
Cc: Felipe Balbi <redacted>
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
Documentation/devicetree/bindings/usb/usb-phy.txt | 17 ++
drivers/usb/phy/Kconfig | 9 +
drivers/usb/phy/Makefile | 1 +
drivers/usb/phy/omap-usb2.c | 271 +++++++++++++++++++++
include/linux/usb/omap_usb.h | 46 ++++
include/linux/usb/phy_companion.h | 34 +++
6 files changed, 378 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/usb-phy.txt
create mode 100644 drivers/usb/phy/omap-usb2.c
create mode 100644 include/linux/usb/omap_usb.h
create mode 100644 include/linux/usb/phy_companion.h
@@ -0,0 +1,17 @@+USB PHY++OMAP USB2 PHY++Required properties:+ - compatible: Should be "ti,omap-usb2"
...for a specific phy. However, I do think a generic binding to describe
host ctrlr to phy connections is needed.
quoted
+ - reg : Address and length of the register set for the device. Also
+add the address of control module dev conf register until a driver for
+control module is added
The dts should describe the h/w, not what you need for the current
driver. The 2nd reg field does not belong here.
Indeed. This was discussed and agreed upon as a interim solution till
we have a control module driver in place to write to the control
module register.
Discussed where and agreed by who? I for one do not agree.
On 09/25/2012 05:06 AM, ABRAHAM, KISHON VIJAY wrote:
quoted
Hi,
On Mon, Sep 24, 2012 at 6:45 PM, Rob Herring [off-list ref] wrote:
quoted
On 09/06/2012 09:57 AM, Kishon Vijay Abraham I wrote:
quoted
All phy related programming like enabling/disabling the clocks, powering
on/off the phy is taken care of by this driver. It is also used for OTG
related functionality like srp.
This also includes device tree support for usb2 phy driver and
the documentation with device tree binding information is updated.
Currently writing to control module register is taken care in this
driver which will be removed once the control module driver is in place.
Cc: Felipe Balbi <redacted>
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
Documentation/devicetree/bindings/usb/usb-phy.txt | 17 ++
drivers/usb/phy/Kconfig | 9 +
drivers/usb/phy/Makefile | 1 +
drivers/usb/phy/omap-usb2.c | 271 +++++++++++++++++++++
include/linux/usb/omap_usb.h | 46 ++++
include/linux/usb/phy_companion.h | 34 +++
6 files changed, 378 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/usb-phy.txt
create mode 100644 drivers/usb/phy/omap-usb2.c
create mode 100644 include/linux/usb/omap_usb.h
create mode 100644 include/linux/usb/phy_companion.h
@@ -0,0 +1,17 @@+USB PHY++OMAP USB2 PHY++Required properties:+ - compatible: Should be "ti,omap-usb2"
...for a specific phy. However, I do think a generic binding to describe
host ctrlr to phy connections is needed.
quoted
+ - reg : Address and length of the register set for the device. Also
+add the address of control module dev conf register until a driver for
+control module is added
The dts should describe the h/w, not what you need for the current
driver. The 2nd reg field does not belong here.
Indeed. This was discussed and agreed upon as a interim solution till
we have a control module driver in place to write to the control
module register.
Discussed where and agreed by who? I for one do not agree.
Yeah, what was tolerated was the addition of that address inside hwmod
data, but I do agree that it should not go into DTS.
Regards,
Benoit
Hi,
On Fri, Sep 28, 2012 at 4:18 AM, Cousson, Benoit [off-list ref] wrote:
On 9/27/2012 7:24 AM, Rob Herring wrote:
quoted
On 09/25/2012 05:06 AM, ABRAHAM, KISHON VIJAY wrote:
quoted
Hi,
On Mon, Sep 24, 2012 at 6:45 PM, Rob Herring [off-list ref]
wrote:
quoted
On 09/06/2012 09:57 AM, Kishon Vijay Abraham I wrote:
quoted
All phy related programming like enabling/disabling the clocks,
powering
on/off the phy is taken care of by this driver. It is also used for OTG
related functionality like srp.
This also includes device tree support for usb2 phy driver and
the documentation with device tree binding information is updated.
Currently writing to control module register is taken care in this
driver which will be removed once the control module driver is in
place.
Cc: Felipe Balbi <redacted>
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
Documentation/devicetree/bindings/usb/usb-phy.txt | 17 ++
drivers/usb/phy/Kconfig | 9 +
drivers/usb/phy/Makefile | 1 +
drivers/usb/phy/omap-usb2.c | 271
+++++++++++++++++++++
include/linux/usb/omap_usb.h | 46 ++++
include/linux/usb/phy_companion.h | 34 +++
6 files changed, 378 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/usb-phy.txt
create mode 100644 drivers/usb/phy/omap-usb2.c
create mode 100644 include/linux/usb/omap_usb.h
create mode 100644 include/linux/usb/phy_companion.h
@@ -0,0 +1,17 @@+USB PHY++OMAP USB2 PHY++Required properties:+ - compatible: Should be "ti,omap-usb2"
...for a specific phy. However, I do think a generic binding to describe
host ctrlr to phy connections is needed.
quoted
+ - reg : Address and length of the register set for the device. Also
+add the address of control module dev conf register until a driver for
+control module is added
The dts should describe the h/w, not what you need for the current
driver. The 2nd reg field does not belong here.
Indeed. This was discussed and agreed upon as a interim solution till
we have a control module driver in place to write to the control
module register.
Discussed where and agreed by who? I for one do not agree.
Yeah, what was tolerated was the addition of that address inside hwmod data,
but I do agree that it should not go into DTS.
So how can we handle reg writes to control module until we have a
control module driver. usb2 phy does not have a hwmod data for itself.
Do you think we should add a new hwmod data for usb2 phy and use this
in the usb2phy data node in the dts file?
Thanks
Kishon
On 9/28/2012 3:07 AM, ABRAHAM, KISHON VIJAY wrote:
Hi,
On Fri, Sep 28, 2012 at 4:18 AM, Cousson, Benoit [off-list ref] wrote:
quoted
On 9/27/2012 7:24 AM, Rob Herring wrote:
quoted
On 09/25/2012 05:06 AM, ABRAHAM, KISHON VIJAY wrote:
quoted
Hi,
On Mon, Sep 24, 2012 at 6:45 PM, Rob Herring [off-list ref]
wrote:
quoted
On 09/06/2012 09:57 AM, Kishon Vijay Abraham I wrote:
quoted
All phy related programming like enabling/disabling the clocks,
powering
on/off the phy is taken care of by this driver. It is also used for OTG
related functionality like srp.
This also includes device tree support for usb2 phy driver and
the documentation with device tree binding information is updated.
Currently writing to control module register is taken care in this
driver which will be removed once the control module driver is in
place.
Cc: Felipe Balbi <redacted>
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
Documentation/devicetree/bindings/usb/usb-phy.txt | 17 ++
drivers/usb/phy/Kconfig | 9 +
drivers/usb/phy/Makefile | 1 +
drivers/usb/phy/omap-usb2.c | 271
+++++++++++++++++++++
include/linux/usb/omap_usb.h | 46 ++++
include/linux/usb/phy_companion.h | 34 +++
6 files changed, 378 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/usb-phy.txt
create mode 100644 drivers/usb/phy/omap-usb2.c
create mode 100644 include/linux/usb/omap_usb.h
create mode 100644 include/linux/usb/phy_companion.h
@@ -0,0 +1,17 @@+USB PHY++OMAP USB2 PHY++Required properties:+ - compatible: Should be "ti,omap-usb2"
...for a specific phy. However, I do think a generic binding to describe
host ctrlr to phy connections is needed.
quoted
+ - reg : Address and length of the register set for the device. Also
+add the address of control module dev conf register until a driver for
+control module is added
The dts should describe the h/w, not what you need for the current
driver. The 2nd reg field does not belong here.
Indeed. This was discussed and agreed upon as a interim solution till
we have a control module driver in place to write to the control
module register.
Discussed where and agreed by who? I for one do not agree.
Yeah, what was tolerated was the addition of that address inside hwmod data,
but I do agree that it should not go into DTS.
So how can we handle reg writes to control module until we have a
control module driver. usb2 phy does not have a hwmod data for itself.
Do you think we should add a new hwmod data for usb2 phy and use this
in the usb2phy data node in the dts file?
Now, I'm confused... didn't you already do that? What was the hwmod you
added?
Maybe it is time to write your own control module driver now.
Talking with Tony on that, there is no need for a common control driver,
it is up to each individual control driver to handle their own register
space. It means that you should probably just add a simple driver to
access these region.
Regards,
Benoit
Hi,
On Fri, Sep 28, 2012 at 8:42 PM, Cousson, Benoit [off-list ref] wrote:
On 9/28/2012 3:07 AM, ABRAHAM, KISHON VIJAY wrote:
quoted
Hi,
On Fri, Sep 28, 2012 at 4:18 AM, Cousson, Benoit [off-list ref] wrote:
quoted
On 9/27/2012 7:24 AM, Rob Herring wrote:
quoted
On 09/25/2012 05:06 AM, ABRAHAM, KISHON VIJAY wrote:
quoted
Hi,
On Mon, Sep 24, 2012 at 6:45 PM, Rob Herring [off-list ref]
wrote:
quoted
On 09/06/2012 09:57 AM, Kishon Vijay Abraham I wrote:
quoted
All phy related programming like enabling/disabling the clocks,
powering
on/off the phy is taken care of by this driver. It is also used for
OTG
related functionality like srp.
This also includes device tree support for usb2 phy driver and
the documentation with device tree binding information is updated.
Currently writing to control module register is taken care in this
driver which will be removed once the control module driver is in
place.
Cc: Felipe Balbi <redacted>
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
Documentation/devicetree/bindings/usb/usb-phy.txt | 17 ++
drivers/usb/phy/Kconfig | 9 +
drivers/usb/phy/Makefile | 1 +
drivers/usb/phy/omap-usb2.c | 271
+++++++++++++++++++++
include/linux/usb/omap_usb.h | 46 ++++
include/linux/usb/phy_companion.h | 34 +++
6 files changed, 378 insertions(+)
create mode 100644
Documentation/devicetree/bindings/usb/usb-phy.txt
create mode 100644 drivers/usb/phy/omap-usb2.c
create mode 100644 include/linux/usb/omap_usb.h
create mode 100644 include/linux/usb/phy_companion.h
@@ -0,0 +1,17 @@+USB PHY++OMAP USB2 PHY++Required properties:+ - compatible: Should be "ti,omap-usb2"
...for a specific phy. However, I do think a generic binding to
describe
host ctrlr to phy connections is needed.
quoted
+ - reg : Address and length of the register set for the device. Also
+add the address of control module dev conf register until a driver
for
+control module is added
The dts should describe the h/w, not what you need for the current
driver. The 2nd reg field does not belong here.
Indeed. This was discussed and agreed upon as a interim solution till
we have a control module driver in place to write to the control
module register.
Discussed where and agreed by who? I for one do not agree.
Yeah, what was tolerated was the addition of that address inside hwmod
data,
but I do agree that it should not go into DTS.
So how can we handle reg writes to control module until we have a
control module driver. usb2 phy does not have a hwmod data for itself.
Do you think we should add a new hwmod data for usb2 phy and use this
in the usb2phy data node in the dts file?
Now, I'm confused... didn't you already do that? What was the hwmod you
added?
That was in usb_otg_hs (musb glue for omap) for writing to MUSB
mailbox. This is for usb2 phy for powering on/off the PHY.
Thanks
Kishon