linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 00/11] usb: musb: adding multi instance support
@ 2012-08-02 12:12 Ravi Babu
  2012-08-02 12:12 ` [PATCH v7 03/11] usb: musb: am335x: add support for dual instance Ravi Babu
                   ` (4 more replies)
  0 siblings, 5 replies; 27+ messages in thread
From: Ravi Babu @ 2012-08-02 12:12 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA, balbi-l0cyMroinI0,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	tony-4v6yS6AI5VpBDgjK7y7TUQ, ajayguptaj-Re5JQEeQqe8AvxtiuMwx3w

This series of patches adds,
a) Multi instances support in musb driver
b) DT support for musb_dsps glue layer
c) DT support for NOP transceiver

AM33xx and TI81xx has dual musb controller and has two usb PHY of same type.
This patch series uses 'phandle' based API devm_usb_get_phy_by_phandle() to
get the PHY of same type. This API support is being added by Kishon's patch
discussed at [1]

The series applies to linux-omap (master branch)
	+ Vaibhav baseport patches on his tree at [3]
	+ Kishon's multi phy patches on Felipe's branch 'xceiv'
	+ Kishon's patch on phandle at [1]
	+ AM33xx musb glue compile and bugfix patches at [4], [5], [6] and [7]
	+ Damodar's recent patch at [2] 

and have been tested on Beaglebone board.

1. http://marc.info/?l=linux-usb&m=134070369306112&w=2
2. http://marc.info/?l=linux-usb&m=134200284230689&w=2
3. https://github.com/hvaibhav/am335x-linux/commits/am335x-upstream-staging
4. http://marc.info/?l=linux-usb&m=134131746111637&w=2
5. http://marc.info/?l=linux-usb&m=134131746411639&w=2
6. http://marc.info/?l=linux-usb&m=134062716011251&w=2
7. http://marc.info/?l=linux-usb&m=134061179405213&w=2

Changes from v6:
	- Removed parent_pdev to get glue and used dev_get_getdrv() as per
	  Felipe's comment
	- use pr_debug() instead of pr_info() as per Felipe's comment
Changes from v5:
	- Removed musb->id as per Felipe's comment
	- used nop_ida as per Felipe's comment
Changes from v4:
	- Fixed Felipe's comment for adding EXPORT_SYMBOL_GPL()
	- Fixed Felipe's comment on using dev_set_mask()
Changes from v3:
	- Fixed Kishon's comment on removing "id" from phy struct and
	  removing unneeded "#else" part.
Changes from v2:
	- Fixed Sergei's comment on not using address prefix in musb_dsps
	  glue and nop transceiver dt dats.
	- Also removed the "ti" string in compatible property for nop data.
Changes from v1:
	- Defined musb_ida to manage core ids based on Felipe's comment
	  in [PATCH 01/11]

Ajay Kumar Gupta (10):
  usb: musb: add musb_ida for multi instance support
  usb: musb: kill global and static for multi instance
  usb: musb: am335x: add support for dual instance
  usb: otg: nop: add support for multiple tranceiver
  usb: musb: dsps: add dt support
  arm/dts: am33xx: Add dt data for usbss
  usb: otg: nop: add dt support
  arm/dts: am33xx: add dt data for usb nop phy
  usb: musb: dsps: remove explicit NOP device creation
  arm/dts: am33xx: add phy phandle to usbss

Ravi Babu (1):
  usb: musb: dsps: get the PHY using phandle api

 .../devicetree/bindings/usb/am33xx-usb.txt         |   19 ++
 arch/arm/boot/dts/am33xx.dtsi                      |   21 ++
 drivers/usb/musb/am35x.c                           |   44 +++--
 drivers/usb/musb/blackfin.c                        |   28 ++-
 drivers/usb/musb/da8xx.c                           |   36 +++-
 drivers/usb/musb/davinci.c                         |   38 +++--
 drivers/usb/musb/musb_core.c                       |   53 ++++--
 drivers/usb/musb/musb_core.h                       |    6 +
 drivers/usb/musb/musb_debugfs.c                    |    8 +-
 drivers/usb/musb/musb_dsps.c                       |  210 +++++++++++++-------
 drivers/usb/musb/omap2430.c                        |   26 ++-
 drivers/usb/musb/tusb6010.c                        |   30 ++-
 drivers/usb/musb/ux500.c                           |   33 +++-
 drivers/usb/otg/nop-usb-xceiv.c                    |   64 ++++++-
 include/linux/usb/otg.h                            |    4 +-
 15 files changed, 455 insertions(+), 165 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/am33xx-usb.txt

--
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

* [PATCH v7 01/11] usb: musb: add musb_ida for multi instance support
       [not found] ` <1343909574-15633-1-git-send-email-ravibabu-l0cyMroinI0@public.gmane.org>
@ 2012-08-02 12:12   ` Ravi Babu
  2012-08-02 12:12   ` [PATCH v7 02/11] usb: musb: kill global and static for multi instance Ravi Babu
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 27+ messages in thread
From: Ravi Babu @ 2012-08-02 12:12 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA, balbi-l0cyMroinI0,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	tony-4v6yS6AI5VpBDgjK7y7TUQ, ajayguptaj-Re5JQEeQqe8AvxtiuMwx3w

From: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>

Added musb_ida in musb_core.c to manage the multi core ids.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
Signed-off-by: Ravi Babu <ravibabu-l0cyMroinI0@public.gmane.org>
---
 drivers/usb/musb/am35x.c     |   42 ++++++++++++++++++++++++++++--------------
 drivers/usb/musb/blackfin.c  |   26 ++++++++++++++++++++------
 drivers/usb/musb/da8xx.c     |   34 ++++++++++++++++++++++++----------
 drivers/usb/musb/davinci.c   |   34 ++++++++++++++++++++++++----------
 drivers/usb/musb/musb_core.c |   31 +++++++++++++++++++++++++++++++
 drivers/usb/musb/musb_core.h |    2 ++
 drivers/usb/musb/musb_dsps.c |   25 ++++++++++++++++++-------
 drivers/usb/musb/omap2430.c  |   26 ++++++++++++++++++++------
 drivers/usb/musb/tusb6010.c  |   26 ++++++++++++++++++++------
 drivers/usb/musb/ux500.c     |   33 +++++++++++++++++++++++----------
 10 files changed, 210 insertions(+), 69 deletions(-)

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index 7a95ab8..01203eb 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -468,6 +468,7 @@ static int __devinit am35x_probe(struct platform_device *pdev)
 	struct clk			*clk;
 
 	int				ret = -ENOMEM;
+	int				musbid;
 
 	glue = kzalloc(sizeof(*glue), GFP_KERNEL);
 	if (!glue) {
@@ -475,38 +476,47 @@ static int __devinit am35x_probe(struct platform_device *pdev)
 		goto err0;
 	}
 
-	musb = platform_device_alloc("musb-hdrc", -1);
+	/* get the musb id */
+	musbid = musb_get_id(&pdev->dev, GFP_KERNEL);
+	if (musbid < 0) {
+		dev_err(&pdev->dev, "failed to allocate musb id\n");
+		ret = -ENOMEM;
+		goto err1;
+	}
+
+	musb = platform_device_alloc("musb-hdrc", musbid);
 	if (!musb) {
 		dev_err(&pdev->dev, "failed to allocate musb device\n");
-		goto err1;
+		goto err2;
 	}
 
 	phy_clk = clk_get(&pdev->dev, "fck");
 	if (IS_ERR(phy_clk)) {
 		dev_err(&pdev->dev, "failed to get PHY clock\n");
 		ret = PTR_ERR(phy_clk);
-		goto err2;
+		goto err3;
 	}
 
 	clk = clk_get(&pdev->dev, "ick");
 	if (IS_ERR(clk)) {
 		dev_err(&pdev->dev, "failed to get clock\n");
 		ret = PTR_ERR(clk);
-		goto err3;
+		goto err4;
 	}
 
 	ret = clk_enable(phy_clk);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to enable PHY clock\n");
-		goto err4;
+		goto err5;
 	}
 
 	ret = clk_enable(clk);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to enable clock\n");
-		goto err5;
+		goto err6;
 	}
 
+	musb->id			= musbid;
 	musb->dev.parent		= &pdev->dev;
 	musb->dev.dma_mask		= &am35x_dmamask;
 	musb->dev.coherent_dma_mask	= am35x_dmamask;
@@ -524,38 +534,41 @@ static int __devinit am35x_probe(struct platform_device *pdev)
 			pdev->num_resources);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add resources\n");
-		goto err6;
+		goto err7;
 	}
 
 	ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add platform_data\n");
-		goto err6;
+		goto err7;
 	}
 
 	ret = platform_device_add(musb);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register musb device\n");
-		goto err6;
+		goto err7;
 	}
 
 	return 0;
 
-err6:
+err7:
 	clk_disable(clk);
 
-err5:
+err6:
 	clk_disable(phy_clk);
 
-err4:
+err5:
 	clk_put(clk);
 
-err3:
+err4:
 	clk_put(phy_clk);
 
-err2:
+err3:
 	platform_device_put(musb);
 
+err2:
+	musb_put_id(&pdev->dev, musbid);
+
 err1:
 	kfree(glue);
 
@@ -567,6 +580,7 @@ static int __devexit am35x_remove(struct platform_device *pdev)
 {
 	struct am35x_glue	*glue = platform_get_drvdata(pdev);
 
+	musb_put_id(&pdev->dev, glue->musb->id);
 	platform_device_del(glue->musb);
 	platform_device_put(glue->musb);
 	clk_disable(glue->clk);
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index 428e6aa..c848b82 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -471,6 +471,7 @@ static int __devinit bfin_probe(struct platform_device *pdev)
 	struct bfin_glue		*glue;
 
 	int				ret = -ENOMEM;
+	int				musbid;
 
 	glue = kzalloc(sizeof(*glue), GFP_KERNEL);
 	if (!glue) {
@@ -478,12 +479,21 @@ static int __devinit bfin_probe(struct platform_device *pdev)
 		goto err0;
 	}
 
-	musb = platform_device_alloc("musb-hdrc", -1);
+	/* get the musb id */
+	musbid = musb_get_id(&pdev->dev, GFP_KERNEL);
+	if (musbid < 0) {
+		dev_err(&pdev->dev, "failed to allocate musb id\n");
+		ret = -ENOMEM;
+		goto err1;
+	}
+
+	musb = platform_device_alloc("musb-hdrc", musbid);
 	if (!musb) {
 		dev_err(&pdev->dev, "failed to allocate musb device\n");
-		goto err1;
+		goto err2;
 	}
 
+	musb->id			= musbid;
 	musb->dev.parent		= &pdev->dev;
 	musb->dev.dma_mask		= &bfin_dmamask;
 	musb->dev.coherent_dma_mask	= bfin_dmamask;
@@ -499,26 +509,29 @@ static int __devinit bfin_probe(struct platform_device *pdev)
 			pdev->num_resources);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add resources\n");
-		goto err2;
+		goto err3;
 	}
 
 	ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add platform_data\n");
-		goto err2;
+		goto err3;
 	}
 
 	ret = platform_device_add(musb);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register musb device\n");
-		goto err2;
+		goto err3;
 	}
 
 	return 0;
 
-err2:
+err3:
 	platform_device_put(musb);
 
+err2:
+	musb_put_id(&pdev->dev, musbid);
+
 err1:
 	kfree(glue);
 
@@ -530,6 +543,7 @@ static int __devexit bfin_remove(struct platform_device *pdev)
 {
 	struct bfin_glue		*glue = platform_get_drvdata(pdev);
 
+	musb_put_id(&pdev->dev, glue->musb->id);
 	platform_device_del(glue->musb);
 	platform_device_put(glue->musb);
 	kfree(glue);
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index 0f9fcec..cebd9d7 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -489,6 +489,7 @@ static int __devinit da8xx_probe(struct platform_device *pdev)
 	struct clk			*clk;
 
 	int				ret = -ENOMEM;
+	int				musbid;
 
 	glue = kzalloc(sizeof(*glue), GFP_KERNEL);
 	if (!glue) {
@@ -496,25 +497,34 @@ static int __devinit da8xx_probe(struct platform_device *pdev)
 		goto err0;
 	}
 
-	musb = platform_device_alloc("musb-hdrc", -1);
+	/* get the musb id */
+	musbid = musb_get_id(&pdev->dev, GFP_KERNEL);
+	if (musbid < 0) {
+		dev_err(&pdev->dev, "failed to allocate musb id\n");
+		ret = -ENOMEM;
+		goto err1;
+	}
+
+	musb = platform_device_alloc("musb-hdrc", musbid);
 	if (!musb) {
 		dev_err(&pdev->dev, "failed to allocate musb device\n");
-		goto err1;
+		goto err2;
 	}
 
 	clk = clk_get(&pdev->dev, "usb20");
 	if (IS_ERR(clk)) {
 		dev_err(&pdev->dev, "failed to get clock\n");
 		ret = PTR_ERR(clk);
-		goto err2;
+		goto err3;
 	}
 
 	ret = clk_enable(clk);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to enable clock\n");
-		goto err3;
+		goto err4;
 	}
 
+	musb->id			= musbid;
 	musb->dev.parent		= &pdev->dev;
 	musb->dev.dma_mask		= &da8xx_dmamask;
 	musb->dev.coherent_dma_mask	= da8xx_dmamask;
@@ -531,32 +541,35 @@ static int __devinit da8xx_probe(struct platform_device *pdev)
 			pdev->num_resources);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add resources\n");
-		goto err4;
+		goto err5;
 	}
 
 	ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add platform_data\n");
-		goto err4;
+		goto err5;
 	}
 
 	ret = platform_device_add(musb);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register musb device\n");
-		goto err4;
+		goto err5;
 	}
 
 	return 0;
 
-err4:
+err5:
 	clk_disable(clk);
 
-err3:
+err4:
 	clk_put(clk);
 
-err2:
+err3:
 	platform_device_put(musb);
 
+err2:
+	musb_put_id(&pdev->dev, musbid);
+
 err1:
 	kfree(glue);
 
@@ -568,6 +581,7 @@ static int __devexit da8xx_remove(struct platform_device *pdev)
 {
 	struct da8xx_glue		*glue = platform_get_drvdata(pdev);
 
+	musb_put_id(&pdev->dev, glue->musb->id);
 	platform_device_del(glue->musb);
 	platform_device_put(glue->musb);
 	clk_disable(glue->clk);
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 472c8b4..3f094f2 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -523,6 +523,7 @@ static int __devinit davinci_probe(struct platform_device *pdev)
 	struct clk			*clk;
 
 	int				ret = -ENOMEM;
+	int				musbid;
 
 	glue = kzalloc(sizeof(*glue), GFP_KERNEL);
 	if (!glue) {
@@ -530,25 +531,34 @@ static int __devinit davinci_probe(struct platform_device *pdev)
 		goto err0;
 	}
 
-	musb = platform_device_alloc("musb-hdrc", -1);
+	/* get the musb id */
+	musbid = musb_get_id(&pdev->dev, GFP_KERNEL);
+	if (musbid < 0) {
+		dev_err(&pdev->dev, "failed to allocate musb id\n");
+		ret = -ENOMEM;
+		goto err1;
+	}
+
+	musb = platform_device_alloc("musb-hdrc", musbid);
 	if (!musb) {
 		dev_err(&pdev->dev, "failed to allocate musb device\n");
-		goto err1;
+		goto err2;
 	}
 
 	clk = clk_get(&pdev->dev, "usb");
 	if (IS_ERR(clk)) {
 		dev_err(&pdev->dev, "failed to get clock\n");
 		ret = PTR_ERR(clk);
-		goto err2;
+		goto err3;
 	}
 
 	ret = clk_enable(clk);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to enable clock\n");
-		goto err3;
+		goto err4;
 	}
 
+	musb->id			= musbid;
 	musb->dev.parent		= &pdev->dev;
 	musb->dev.dma_mask		= &davinci_dmamask;
 	musb->dev.coherent_dma_mask	= davinci_dmamask;
@@ -565,32 +575,35 @@ static int __devinit davinci_probe(struct platform_device *pdev)
 			pdev->num_resources);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add resources\n");
-		goto err4;
+		goto err5;
 	}
 
 	ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add platform_data\n");
-		goto err4;
+		goto err5;
 	}
 
 	ret = platform_device_add(musb);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register musb device\n");
-		goto err4;
+		goto err5;
 	}
 
 	return 0;
 
-err4:
+err5:
 	clk_disable(clk);
 
-err3:
+err4:
 	clk_put(clk);
 
-err2:
+err3:
 	platform_device_put(musb);
 
+err2:
+	musb_put_id(&pdev->dev, musbid);
+
 err1:
 	kfree(glue);
 
@@ -602,6 +615,7 @@ static int __devexit davinci_remove(struct platform_device *pdev)
 {
 	struct davinci_glue		*glue = platform_get_drvdata(pdev);
 
+	musb_put_id(&pdev->dev, glue->musb->id);
 	platform_device_del(glue->musb);
 	platform_device_put(glue->musb);
 	clk_disable(glue->clk);
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 89d1871..a565fc2 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -99,6 +99,7 @@
 #include <linux/prefetch.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
+#include <linux/idr.h>
 
 #include "musb_core.h"
 
@@ -114,6 +115,7 @@
 
 #define MUSB_DRIVER_NAME "musb-hdrc"
 const char musb_driver_name[] = MUSB_DRIVER_NAME;
+static DEFINE_IDA(musb_ida);
 
 MODULE_DESCRIPTION(DRIVER_INFO);
 MODULE_AUTHOR(DRIVER_AUTHOR);
@@ -130,6 +132,35 @@ static inline struct musb *dev_to_musb(struct device *dev)
 
 /*-------------------------------------------------------------------------*/
 
+int musb_get_id(struct device *dev, gfp_t gfp_mask)
+{
+	int ret;
+	int id;
+
+	ret = ida_pre_get(&musb_ida, gfp_mask);
+	if (!ret) {
+		dev_err(dev, "failed to reserve resource for id\n");
+		return -ENOMEM;
+	}
+
+	ret = ida_get_new(&musb_ida, &id);
+	if (ret < 0) {
+		dev_err(dev, "failed to allocate a new id\n");
+		return ret;
+	}
+
+	return id;
+}
+EXPORT_SYMBOL_GPL(musb_get_id);
+
+void musb_put_id(struct device *dev, int id)
+{
+
+	dev_dbg(dev, "removing id %d\n", id);
+	ida_remove(&musb_ida, id);
+}
+EXPORT_SYMBOL_GPL(musb_put_id);
+
 #ifndef CONFIG_BLACKFIN
 static int musb_ulpi_read(struct usb_phy *phy, u32 offset)
 {
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index 51bd7b2..84436f7 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -530,6 +530,8 @@ extern const char musb_driver_name[];
 
 extern void musb_start(struct musb *musb);
 extern void musb_stop(struct musb *musb);
+extern int musb_get_id(struct device *dev, gfp_t gfp_mask);
+extern void musb_put_id(struct device *dev, int id);
 
 extern void musb_write_fifo(struct musb_hw_ep *ep, u16 len, const u8 *src);
 extern void musb_read_fifo(struct musb_hw_ep *ep, u16 len, u8 *dst);
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 46b07cc..2174699 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -494,7 +494,7 @@ static int __devinit dsps_create_musb_pdev(struct dsps_glue *glue, u8 id)
 	struct resource *res;
 	struct resource	resources[2];
 	char res_name[10];
-	int ret;
+	int ret, musbid;
 
 	/* get memory resource for usb control register */
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 2 * id + 2);
@@ -534,14 +534,22 @@ static int __devinit dsps_create_musb_pdev(struct dsps_glue *glue, u8 id)
 	resources[1] = *res;
 	resources[1].name = "mc";
 
+	/* get the musb id */
+	musbid = musb_get_id(dev, GFP_KERNEL);
+	if (musbid < 0) {
+		dev_err(dev, "failed to allocate musb id\n");
+		ret = -ENOMEM;
+		goto err0;
+	}
 	/* allocate the child platform device */
-	musb = platform_device_alloc("musb-hdrc", -1);
+	musb = platform_device_alloc("musb-hdrc", musbid);
 	if (!musb) {
 		dev_err(dev, "failed to allocate musb device\n");
 		ret = -ENOMEM;
-		goto err0;
+		goto err1;
 	}
 
+	musb->id			= musbid;
 	musb->dev.parent		= dev;
 	musb->dev.dma_mask		= &musb_dmamask;
 	musb->dev.coherent_dma_mask	= musb_dmamask;
@@ -553,31 +561,34 @@ static int __devinit dsps_create_musb_pdev(struct dsps_glue *glue, u8 id)
 	ret = platform_device_add_resources(musb, resources, 2);
 	if (ret) {
 		dev_err(dev, "failed to add resources\n");
-		goto err1;
+		goto err2;
 	}
 
 	ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
 	if (ret) {
 		dev_err(dev, "failed to add platform_data\n");
-		goto err1;
+		goto err2;
 	}
 
 	ret = platform_device_add(musb);
 	if (ret) {
 		dev_err(dev, "failed to register musb device\n");
-		goto err1;
+		goto err2;
 	}
 
 	return 0;
 
-err1:
+err2:
 	platform_device_put(musb);
+err1:
+	musb_put_id(dev, musbid);
 err0:
 	return ret;
 }
 
 static void __devexit dsps_delete_musb_pdev(struct dsps_glue *glue)
 {
+	musb_put_id(glue->dev, glue->musb->id);
 	platform_device_del(glue->musb);
 	platform_device_put(glue->musb);
 }
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 5fdb9da..759752b 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -441,6 +441,7 @@ static int __devinit omap2430_probe(struct platform_device *pdev)
 	struct platform_device		*musb;
 	struct omap2430_glue		*glue;
 	int				ret = -ENOMEM;
+	int				musbid;
 
 	glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
 	if (!glue) {
@@ -448,12 +449,21 @@ static int __devinit omap2430_probe(struct platform_device *pdev)
 		goto err0;
 	}
 
-	musb = platform_device_alloc("musb-hdrc", -1);
+	/* get the musb id */
+	musbid = musb_get_id(&pdev->dev, GFP_KERNEL);
+	if (musbid < 0) {
+		dev_err(&pdev->dev, "failed to allocate musb id\n");
+		ret = -ENOMEM;
+		goto err0;
+	}
+
+	musb = platform_device_alloc("musb-hdrc", musbid);
 	if (!musb) {
 		dev_err(&pdev->dev, "failed to allocate musb device\n");
-		goto err0;
+		goto err1;
 	}
 
+	musb->id			= musbid;
 	musb->dev.parent		= &pdev->dev;
 	musb->dev.dma_mask		= &omap2430_dmamask;
 	musb->dev.coherent_dma_mask	= omap2430_dmamask;
@@ -478,13 +488,13 @@ static int __devinit omap2430_probe(struct platform_device *pdev)
 			pdev->num_resources);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add resources\n");
-		goto err1;
+		goto err2;
 	}
 
 	ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add platform_data\n");
-		goto err1;
+		goto err2;
 	}
 
 	pm_runtime_enable(&pdev->dev);
@@ -492,14 +502,17 @@ static int __devinit omap2430_probe(struct platform_device *pdev)
 	ret = platform_device_add(musb);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register musb device\n");
-		goto err1;
+		goto err2;
 	}
 
 	return 0;
 
-err1:
+err2:
 	platform_device_put(musb);
 
+err1:
+	musb_put_id(&pdev->dev, musbid);
+
 err0:
 	return ret;
 }
@@ -509,6 +522,7 @@ static int __devexit omap2430_remove(struct platform_device *pdev)
 	struct omap2430_glue		*glue = platform_get_drvdata(pdev);
 
 	cancel_work_sync(&glue->omap_musb_mailbox_work);
+	musb_put_id(&pdev->dev, glue->musb->id);
 	platform_device_del(glue->musb);
 	platform_device_put(glue->musb);
 
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index 1a1bd9c..64a0e95 100644
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -1175,6 +1175,7 @@ static int __devinit tusb_probe(struct platform_device *pdev)
 	struct tusb6010_glue		*glue;
 
 	int				ret = -ENOMEM;
+	int				musbid;
 
 	glue = kzalloc(sizeof(*glue), GFP_KERNEL);
 	if (!glue) {
@@ -1182,12 +1183,21 @@ static int __devinit tusb_probe(struct platform_device *pdev)
 		goto err0;
 	}
 
-	musb = platform_device_alloc("musb-hdrc", -1);
+	/* get the musb id */
+	musbid = musb_get_id(&pdev->dev, GFP_KERNEL);
+	if (musbid < 0) {
+		dev_err(&pdev->dev, "failed to allocate musb id\n");
+		ret = -ENOMEM;
+		goto err1;
+	}
+
+	musb = platform_device_alloc("musb-hdrc", musbid);
 	if (!musb) {
 		dev_err(&pdev->dev, "failed to allocate musb device\n");
-		goto err1;
+		goto err2;
 	}
 
+	musb->id			= musbid;
 	musb->dev.parent		= &pdev->dev;
 	musb->dev.dma_mask		= &tusb_dmamask;
 	musb->dev.coherent_dma_mask	= tusb_dmamask;
@@ -1203,26 +1213,29 @@ static int __devinit tusb_probe(struct platform_device *pdev)
 			pdev->num_resources);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add resources\n");
-		goto err2;
+		goto err3;
 	}
 
 	ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add platform_data\n");
-		goto err2;
+		goto err3;
 	}
 
 	ret = platform_device_add(musb);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register musb device\n");
-		goto err1;
+		goto err3;
 	}
 
 	return 0;
 
-err2:
+err3:
 	platform_device_put(musb);
 
+err2:
+	musb_put_id(&pdev->dev, musbid);
+
 err1:
 	kfree(glue);
 
@@ -1234,6 +1247,7 @@ static int __devexit tusb_remove(struct platform_device *pdev)
 {
 	struct tusb6010_glue		*glue = platform_get_drvdata(pdev);
 
+	musb_put_id(&pdev->dev, glue->musb->id);
 	platform_device_del(glue->musb);
 	platform_device_put(glue->musb);
 	kfree(glue);
diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c
index a8c0fad..d62a91f 100644
--- a/drivers/usb/musb/ux500.c
+++ b/drivers/usb/musb/ux500.c
@@ -74,25 +74,34 @@ static int __devinit ux500_probe(struct platform_device *pdev)
 		goto err0;
 	}
 
-	musb = platform_device_alloc("musb-hdrc", -1);
+	/* get the musb id */
+	musbid = musb_get_id(&pdev->dev, GFP_KERNEL);
+	if (musbid < 0) {
+		dev_err(&pdev->dev, "failed to allocate musb id\n");
+		ret = -ENOMEM;
+		goto err1;
+	}
+
+	musb = platform_device_alloc("musb-hdrc", musbid);
 	if (!musb) {
 		dev_err(&pdev->dev, "failed to allocate musb device\n");
-		goto err1;
+		goto err2;
 	}
 
 	clk = clk_get(&pdev->dev, "usb");
 	if (IS_ERR(clk)) {
 		dev_err(&pdev->dev, "failed to get clock\n");
 		ret = PTR_ERR(clk);
-		goto err2;
+		goto err3;
 	}
 
 	ret = clk_enable(clk);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to enable clock\n");
-		goto err3;
+		goto err4;
 	}
 
+	musb->id			= musbid;
 	musb->dev.parent		= &pdev->dev;
 	musb->dev.dma_mask		= pdev->dev.dma_mask;
 	musb->dev.coherent_dma_mask	= pdev->dev.coherent_dma_mask;
@@ -109,32 +118,35 @@ static int __devinit ux500_probe(struct platform_device *pdev)
 			pdev->num_resources);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add resources\n");
-		goto err4;
+		goto err5;
 	}
 
 	ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add platform_data\n");
-		goto err4;
+		goto err5;
 	}
 
 	ret = platform_device_add(musb);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register musb device\n");
-		goto err4;
+		goto err5;
 	}
 
 	return 0;
 
-err4:
+err5:
 	clk_disable(clk);
 
-err3:
+err4:
 	clk_put(clk);
 
-err2:
+err3:
 	platform_device_put(musb);
 
+err2:
+	musb_put_id(&pdev->dev, musbid);
+
 err1:
 	kfree(glue);
 
@@ -146,6 +158,7 @@ static int __devexit ux500_remove(struct platform_device *pdev)
 {
 	struct ux500_glue	*glue = platform_get_drvdata(pdev);
 
+	musb_put_id(&pdev->dev, glue->musb->id);
 	platform_device_del(glue->musb);
 	platform_device_put(glue->musb);
 	clk_disable(glue->clk);
-- 
1.7.0.4

--
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 v7 02/11] usb: musb: kill global and static for multi instance
       [not found] ` <1343909574-15633-1-git-send-email-ravibabu-l0cyMroinI0@public.gmane.org>
  2012-08-02 12:12   ` [PATCH v7 01/11] usb: musb: add musb_ida for multi instance support Ravi Babu
@ 2012-08-02 12:12   ` Ravi Babu
  2012-08-02 12:12   ` [PATCH v7 05/11] usb: musb: dsps: add dt support Ravi Babu
                     ` (6 subsequent siblings)
  8 siblings, 0 replies; 27+ messages in thread
From: Ravi Babu @ 2012-08-02 12:12 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA, balbi-l0cyMroinI0,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	tony-4v6yS6AI5VpBDgjK7y7TUQ, ajayguptaj-Re5JQEeQqe8AvxtiuMwx3w

From: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>

Moved global variable "musb_debugfs_root" and static variable
"old_state" to 'struct musb' to help support multi instance of
musb controller as present on AM335x platform.

Also removed the global variable "orig_dma_mask" and filled the
dev->dma_mask with parent device's dma_mask.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
Signed-off-by: Ravi Babu <ravibabu-l0cyMroinI0@public.gmane.org>
---
 drivers/usb/musb/musb_core.c    |   22 +++++++---------------
 drivers/usb/musb/musb_core.h    |    4 ++++
 drivers/usb/musb/musb_debugfs.c |    8 +++-----
 3 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index a565fc2..e781800 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -100,6 +100,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/idr.h>
+#include <linux/dma-mapping.h>
 
 #include "musb_core.h"
 
@@ -1804,10 +1805,9 @@ static const struct attribute_group musb_attr_group = {
 static void musb_irq_work(struct work_struct *data)
 {
 	struct musb *musb = container_of(data, struct musb, irq_work);
-	static int old_state;
 
-	if (musb->xceiv->state != old_state) {
-		old_state = musb->xceiv->state;
+	if (musb->xceiv->state != musb->xceiv_old_state) {
+		musb->xceiv_old_state = musb->xceiv->state;
 		sysfs_notify(&musb->controller->kobj, NULL, "mode");
 	}
 }
@@ -2115,11 +2115,6 @@ fail0:
 /* all implementations (PCI bridge to FPGA, VLYNQ, etc) should just
  * bridge to a platform device; this driver then suffices.
  */
-
-#ifndef CONFIG_MUSB_PIO_ONLY
-static u64	*orig_dma_mask;
-#endif
-
 static int __devinit musb_probe(struct platform_device *pdev)
 {
 	struct device	*dev = &pdev->dev;
@@ -2138,10 +2133,6 @@ static int __devinit musb_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
-#ifndef CONFIG_MUSB_PIO_ONLY
-	/* clobbered by use_dma=n */
-	orig_dma_mask = dev->dma_mask;
-#endif
 	status = musb_init_controller(dev, irq, base);
 	if (status < 0)
 		iounmap(base);
@@ -2151,7 +2142,8 @@ static int __devinit musb_probe(struct platform_device *pdev)
 
 static int __devexit musb_remove(struct platform_device *pdev)
 {
-	struct musb	*musb = dev_to_musb(&pdev->dev);
+	struct device	*dev = &pdev->dev;
+	struct musb	*musb = dev_to_musb(dev);
 	void __iomem	*ctrl_base = musb->ctrl_base;
 
 	/* this gets called on rmmod.
@@ -2164,9 +2156,9 @@ static int __devexit musb_remove(struct platform_device *pdev)
 
 	musb_free(musb);
 	iounmap(ctrl_base);
-	device_init_wakeup(&pdev->dev, 0);
+	device_init_wakeup(dev, 0);
 #ifndef CONFIG_MUSB_PIO_ONLY
-	pdev->dev.dma_mask = orig_dma_mask;
+	dma_set_mask(dev, *dev->parent->dma_mask);
 #endif
 	return 0;
 }
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index 84436f7..5ec32b9 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -450,6 +450,10 @@ struct musb {
 #ifdef MUSB_CONFIG_PROC_FS
 	struct proc_dir_entry *proc_entry;
 #endif
+	int			xceiv_old_state;
+#ifdef CONFIG_DEBUG_FS
+	struct dentry		*debugfs_root;
+#endif
 };
 
 static inline struct musb *gadget_to_musb(struct usb_gadget *g)
diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c
index 40a37c9..1d6e8af 100644
--- a/drivers/usb/musb/musb_debugfs.c
+++ b/drivers/usb/musb/musb_debugfs.c
@@ -103,8 +103,6 @@ static const struct musb_register_map musb_regmap[] = {
 	{  }	/* Terminating Entry */
 };
 
-static struct dentry *musb_debugfs_root;
-
 static int musb_regdump_show(struct seq_file *s, void *unused)
 {
 	struct musb		*musb = s->private;
@@ -241,7 +239,7 @@ int __devinit musb_init_debugfs(struct musb *musb)
 	struct dentry		*file;
 	int			ret;
 
-	root = debugfs_create_dir("musb", NULL);
+	root = debugfs_create_dir(dev_name(musb->controller), NULL);
 	if (!root) {
 		ret = -ENOMEM;
 		goto err0;
@@ -261,7 +259,7 @@ int __devinit musb_init_debugfs(struct musb *musb)
 		goto err1;
 	}
 
-	musb_debugfs_root = root;
+	musb->debugfs_root = root;
 
 	return 0;
 
@@ -274,5 +272,5 @@ err0:
 
 void /* __init_or_exit */ musb_exit_debugfs(struct musb *musb)
 {
-	debugfs_remove_recursive(musb_debugfs_root);
+	debugfs_remove_recursive(musb->debugfs_root);
 }
-- 
1.7.0.4

--
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 v7 03/11] usb: musb: am335x: add support for dual instance
  2012-08-02 12:12 [PATCH v7 00/11] usb: musb: adding multi instance support Ravi Babu
@ 2012-08-02 12:12 ` Ravi Babu
  2012-08-02 12:12 ` [PATCH v7 04/11] usb: otg: nop: add support for multiple tranceiver Ravi Babu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 27+ messages in thread
From: Ravi Babu @ 2012-08-02 12:12 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-omap, balbi, grant.likely, devicetree-discuss, tony,
	ajayguptaj

From: Ajay Kumar Gupta <ajay.gupta@ti.com>

AM335x and TI81xx platform has dual musb controller so updating the
musb_dspc.c to support the same.

Changes:
	- Moved otg_workaround timer to glue structure
	- Moved static local variable last_timer to glue structure
	- PHY on/off related cleanups

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Ravi Babu <ravibabu@ti.com>
---
 drivers/usb/musb/musb_dsps.c |  113 +++++++++++++++++++++++++-----------------
 1 files changed, 67 insertions(+), 46 deletions(-)

diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 2174699..7a09d55 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -105,6 +105,8 @@ struct dsps_musb_wrapper {
 	/* miscellaneous stuff */
 	u32		musb_core_offset;
 	u8		poll_seconds;
+	/* number of musb instances */
+	u8		instances;
 };
 
 /**
@@ -112,16 +114,18 @@ struct dsps_musb_wrapper {
  */
 struct dsps_glue {
 	struct device *dev;
-	struct platform_device *musb;	/* child musb pdev */
+	struct platform_device *musb[2];	/* child musb pdev */
 	const struct dsps_musb_wrapper *wrp; /* wrapper register offsets */
-	struct timer_list timer;	/* otg_workaround timer */
-	u32 __iomem *usb_ctrl;
+	struct timer_list timer[2];	/* otg_workaround timer */
+	unsigned long last_timer[2];    /* last timer data for each instance */
+	u32 __iomem *usb_ctrl[2];
 	u8      usbss_rev;
 };
 
 /**
  * musb_dsps_phy_control - phy on/off
  * @glue: struct dsps_glue *
+ * @id: musb instance
  * @on: flag for phy to be switched on or off
  *
  * This is to enable the PHY using usb_ctrl register in system control
@@ -130,11 +134,11 @@ struct dsps_glue {
  * XXX: This function will be removed once we have a seperate driver for
  * control module
  */
-static void musb_dsps_phy_control(struct dsps_glue *glue, u8 on)
+static void musb_dsps_phy_control(struct dsps_glue *glue, u8 id, u8 on)
 {
 	u32 usbphycfg;
 
-	usbphycfg = __raw_readl(glue->usb_ctrl);
+	usbphycfg = __raw_readl(glue->usb_ctrl[id]);
 
 	if (on) {
 		if (glue->usbss_rev == MUSB_USBSS_REV_816X) {
@@ -157,7 +161,7 @@ static void musb_dsps_phy_control(struct dsps_glue *glue, u8 on)
 				glue->usbss_rev == MUSB_USBSS_REV_33XX)
 			usbphycfg |= USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN;
 	}
-	__raw_writel(usbphycfg, glue->usb_ctrl);
+	__raw_writel(usbphycfg, glue->usb_ctrl[id]);
 }
 /**
  * dsps_musb_enable - enable interrupts
@@ -207,8 +211,8 @@ static void otg_timer(unsigned long _musb)
 	struct musb *musb = (void *)_musb;
 	void __iomem *mregs = musb->mregs;
 	struct device *dev = musb->controller;
-	struct platform_device *pdev = to_platform_device(dev->parent);
-	struct dsps_glue *glue = platform_get_drvdata(pdev);
+	struct platform_device *pdev = to_platform_device(dev);
+	struct dsps_glue *glue = dev_get_drvdata(dev->parent);
 	const struct dsps_musb_wrapper *wrp = glue->wrp;
 	u8 devctl;
 	unsigned long flags;
@@ -247,7 +251,7 @@ static void otg_timer(unsigned long _musb)
 
 		devctl = dsps_readb(mregs, MUSB_DEVCTL);
 		if (devctl & MUSB_DEVCTL_BDEVICE)
-			mod_timer(&glue->timer,
+			mod_timer(&glue->timer[pdev->id],
 					jiffies + wrp->poll_seconds * HZ);
 		else
 			musb->xceiv->state = OTG_STATE_A_IDLE;
@@ -261,9 +265,8 @@ static void otg_timer(unsigned long _musb)
 static void dsps_musb_try_idle(struct musb *musb, unsigned long timeout)
 {
 	struct device *dev = musb->controller;
-	struct platform_device *pdev = to_platform_device(dev->parent);
-	struct dsps_glue *glue = platform_get_drvdata(pdev);
-	static unsigned long last_timer;
+	struct platform_device *pdev = to_platform_device(dev);
+	struct dsps_glue *glue = dev_get_drvdata(dev->parent);
 
 	if (!is_otg_enabled(musb))
 		return;
@@ -276,22 +279,23 @@ static void dsps_musb_try_idle(struct musb *musb, unsigned long timeout)
 				musb->xceiv->state == OTG_STATE_A_WAIT_BCON)) {
 		dev_dbg(musb->controller, "%s active, deleting timer\n",
 				otg_state_string(musb->xceiv->state));
-		del_timer(&glue->timer);
-		last_timer = jiffies;
+		del_timer(&glue->timer[pdev->id]);
+		glue->last_timer[pdev->id] = jiffies;
 		return;
 	}
 
-	if (time_after(last_timer, timeout) && timer_pending(&glue->timer)) {
+	if (time_after(glue->last_timer[pdev->id], timeout) &&
+				timer_pending(&glue->timer[pdev->id])) {
 		dev_dbg(musb->controller,
 			"Longer idle timer already pending, ignoring...\n");
 		return;
 	}
-	last_timer = timeout;
+	glue->last_timer[pdev->id] = timeout;
 
 	dev_dbg(musb->controller, "%s inactive, starting idle timer for %u ms\n",
 		otg_state_string(musb->xceiv->state),
 			jiffies_to_msecs(timeout - jiffies));
-	mod_timer(&glue->timer, timeout);
+	mod_timer(&glue->timer[pdev->id], timeout);
 }
 
 static irqreturn_t dsps_interrupt(int irq, void *hci)
@@ -299,8 +303,8 @@ static irqreturn_t dsps_interrupt(int irq, void *hci)
 	struct musb  *musb = hci;
 	void __iomem *reg_base = musb->ctrl_base;
 	struct device *dev = musb->controller;
-	struct platform_device *pdev = to_platform_device(dev->parent);
-	struct dsps_glue *glue = platform_get_drvdata(pdev);
+	struct platform_device *pdev = to_platform_device(dev);
+	struct dsps_glue *glue = dev_get_drvdata(dev->parent);
 	const struct dsps_musb_wrapper *wrp = glue->wrp;
 	unsigned long flags;
 	irqreturn_t ret = IRQ_NONE;
@@ -360,7 +364,7 @@ static irqreturn_t dsps_interrupt(int irq, void *hci)
 			 */
 			musb->int_usb &= ~MUSB_INTR_VBUSERROR;
 			musb->xceiv->state = OTG_STATE_A_WAIT_VFALL;
-			mod_timer(&glue->timer,
+			mod_timer(&glue->timer[pdev->id],
 					jiffies + wrp->poll_seconds * HZ);
 			WARNING("VBUS error workaround (delay coming)\n");
 		} else if (is_host_enabled(musb) && drvvbus) {
@@ -368,7 +372,7 @@ static irqreturn_t dsps_interrupt(int irq, void *hci)
 			MUSB_HST_MODE(musb);
 			musb->xceiv->otg->default_a = 1;
 			musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
-			del_timer(&glue->timer);
+			del_timer(&glue->timer[pdev->id]);
 		} else {
 			musb->is_active = 0;
 			MUSB_DEV_MODE(musb);
@@ -395,7 +399,8 @@ static irqreturn_t dsps_interrupt(int irq, void *hci)
 
 	/* Poll for ID change */
 	if (is_otg_enabled(musb) && musb->xceiv->state == OTG_STATE_B_IDLE)
-		mod_timer(&glue->timer, jiffies + wrp->poll_seconds * HZ);
+		mod_timer(&glue->timer[pdev->id],
+				jiffies + wrp->poll_seconds * HZ);
 
 	spin_unlock_irqrestore(&musb->lock, flags);
 
@@ -405,8 +410,8 @@ static irqreturn_t dsps_interrupt(int irq, void *hci)
 static int dsps_musb_init(struct musb *musb)
 {
 	struct device *dev = musb->controller;
-	struct platform_device *pdev = to_platform_device(dev->parent);
-	struct dsps_glue *glue = platform_get_drvdata(pdev);
+	struct platform_device *pdev = to_platform_device(dev);
+	struct dsps_glue *glue = dev_get_drvdata(dev->parent);
 	const struct dsps_musb_wrapper *wrp = glue->wrp;
 	void __iomem *reg_base = musb->ctrl_base;
 	u32 rev, val;
@@ -429,13 +434,14 @@ static int dsps_musb_init(struct musb *musb)
 	}
 
 	if (is_host_enabled(musb))
-		setup_timer(&glue->timer, otg_timer, (unsigned long) musb);
+		setup_timer(&glue->timer[pdev->id], otg_timer,
+			(unsigned long) musb);
 
 	/* Reset the musb */
 	dsps_writel(reg_base, wrp->control, (1 << wrp->reset));
 
 	/* Start the on-chip PHY and its PLL. */
-	musb_dsps_phy_control(glue, 1);
+	musb_dsps_phy_control(glue, pdev->id, 1);
 
 	musb->isr = dsps_interrupt;
 
@@ -457,14 +463,14 @@ err0:
 static int dsps_musb_exit(struct musb *musb)
 {
 	struct device *dev = musb->controller;
-	struct platform_device *pdev = to_platform_device(dev->parent);
-	struct dsps_glue *glue = platform_get_drvdata(pdev);
+	struct platform_device *pdev = to_platform_device(dev);
+	struct dsps_glue *glue = dev_get_drvdata(dev->parent);
 
 	if (is_host_enabled(musb))
-		del_timer_sync(&glue->timer);
+		del_timer_sync(&glue->timer[pdev->id]);
 
 	/* Shutdown the on-chip PHY and its PLL. */
-	musb_dsps_phy_control(glue, 0);
+	musb_dsps_phy_control(glue, pdev->id, 0);
 
 	/* NOP driver needs change if supporting dual instance */
 	usb_put_phy(musb->xceiv);
@@ -504,8 +510,8 @@ static int __devinit dsps_create_musb_pdev(struct dsps_glue *glue, u8 id)
 		goto err0;
 	}
 
-	glue->usb_ctrl = devm_request_and_ioremap(&pdev->dev, res);
-	if (glue->usb_ctrl == NULL) {
+	glue->usb_ctrl[id] = devm_request_and_ioremap(&pdev->dev, res);
+	if (glue->usb_ctrl[id] == NULL) {
 		dev_err(dev, "Failed to obtain usb_ctrl%d memory\n", id);
 		ret = -ENODEV;
 		goto err0;
@@ -554,7 +560,7 @@ static int __devinit dsps_create_musb_pdev(struct dsps_glue *glue, u8 id)
 	musb->dev.dma_mask		= &musb_dmamask;
 	musb->dev.coherent_dma_mask	= musb_dmamask;
 
-	glue->musb			= musb;
+	glue->musb[id]			= musb;
 
 	pdata->platform_ops		= &dsps_ops;
 
@@ -586,11 +592,11 @@ err0:
 	return ret;
 }
 
-static void __devexit dsps_delete_musb_pdev(struct dsps_glue *glue)
+static void __devexit dsps_delete_musb_pdev(struct dsps_glue *glue, u8 id)
 {
-	musb_put_id(glue->dev, glue->musb->id);
-	platform_device_del(glue->musb);
-	platform_device_put(glue->musb);
+	musb_put_id(glue->dev, glue->musb[id]->id);
+	platform_device_del(glue->musb[id]);
+	platform_device_put(glue->musb[id]);
 }
 
 static int __devinit dsps_probe(struct platform_device *pdev)
@@ -601,7 +607,7 @@ static int __devinit dsps_probe(struct platform_device *pdev)
 	struct dsps_glue *glue;
 	struct resource *iomem;
 	u32 __iomem *usbss;
-	int ret;
+	int ret, i;
 
 	/* allocate glue */
 	glue = kzalloc(sizeof(*glue), GFP_KERNEL);
@@ -645,11 +651,16 @@ static int __devinit dsps_probe(struct platform_device *pdev)
 		goto err2;
 	}
 
-	/* create the child platform device for first instances of musb */
-	ret = dsps_create_musb_pdev(glue, 0);
-	if (ret != 0) {
-		dev_err(&pdev->dev, "failed to create child pdev\n");
-		goto err3;
+	/* create the child platform device for all instances of musb */
+	for (i = 0; i < wrp->instances ; i++) {
+		ret = dsps_create_musb_pdev(glue, i);
+		if (ret != 0) {
+			dev_err(&pdev->dev, "failed to create child pdev\n");
+			/* release resources of previously created instances */
+			for (i--; i >= 0 ; i--)
+				dsps_delete_musb_pdev(glue, i);
+			goto err3;
+		}
 	}
 
 	/* read the usbss revision register */
@@ -670,9 +681,12 @@ err0:
 static int __devexit dsps_remove(struct platform_device *pdev)
 {
 	struct dsps_glue *glue = platform_get_drvdata(pdev);
+	const struct dsps_musb_wrapper *wrp = glue->wrp;
+	int i;
 
 	/* delete the child platform device */
-	dsps_delete_musb_pdev(glue);
+	for (i = 0; i < wrp->instances ; i++)
+		dsps_delete_musb_pdev(glue, i);
 
 	/* disable usbss clocks */
 	pm_runtime_put(&pdev->dev);
@@ -687,9 +701,12 @@ static int dsps_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev->parent);
 	struct dsps_glue *glue = platform_get_drvdata(pdev);
+	const struct dsps_musb_wrapper *wrp = glue->wrp;
+	int i;
 
 	/* Shutdown the on-chip PHY and its PLL. */
-	musb_dsps_phy_control(glue, 0);
+	for (i = 0 ; i < wrp->instances ; i++)
+		musb_dsps_phy_control(glue, i, 0);
 
 	return 0;
 }
@@ -698,9 +715,12 @@ static int dsps_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev->parent);
 	struct dsps_glue *glue = platform_get_drvdata(pdev);
+	const struct dsps_musb_wrapper *wrp = glue->wrp;
+	int i;
 
 	/* Start the on-chip PHY and its PLL. */
-	musb_dsps_phy_control(glue, 1);
+	for (i = 0 ; i < wrp->instances ; i++)
+		musb_dsps_phy_control(glue, i, 1);
 
 	return 0;
 }
@@ -736,6 +756,7 @@ static const struct dsps_musb_wrapper ti81xx_driver_data __devinitconst = {
 	.rxep_bitmap		= (0xfffe << 16),
 	.musb_core_offset	= 0x400,
 	.poll_seconds		= 2,
+	.instances		= 2,
 };
 
 static const struct platform_device_id musb_dsps_id_table[] __devinitconst = {
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v7 04/11] usb: otg: nop: add support for multiple tranceiver
  2012-08-02 12:12 [PATCH v7 00/11] usb: musb: adding multi instance support Ravi Babu
  2012-08-02 12:12 ` [PATCH v7 03/11] usb: musb: am335x: add support for dual instance Ravi Babu
@ 2012-08-02 12:12 ` Ravi Babu
       [not found] ` <1343909574-15633-1-git-send-email-ravibabu-l0cyMroinI0@public.gmane.org>
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 27+ messages in thread
From: Ravi Babu @ 2012-08-02 12:12 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-omap, balbi, grant.likely, devicetree-discuss, tony,
	ajayguptaj

From: Ajay Kumar Gupta <ajay.gupta@ti.com>

Currently we have one single nop transceiver support as same is
defined as a global variable in drivers/usb/otg/nop-usb-xceiv.c.
This need to be changed to support multiple otg controller each
using nop transceiver on a platform such as am335x.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Ravi Babu <ravibabu@ti.com>
---
 drivers/usb/musb/am35x.c        |    2 +-
 drivers/usb/musb/blackfin.c     |    2 +-
 drivers/usb/musb/da8xx.c        |    2 +-
 drivers/usb/musb/davinci.c      |    4 +-
 drivers/usb/musb/musb_dsps.c    |    8 +++---
 drivers/usb/musb/tusb6010.c     |    4 +-
 drivers/usb/otg/nop-usb-xceiv.c |   54 +++++++++++++++++++++++++++++++++-----
 include/linux/usb/otg.h         |    4 +-
 8 files changed, 60 insertions(+), 20 deletions(-)

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index 01203eb..984e439 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -408,7 +408,7 @@ static int am35x_musb_exit(struct musb *musb)
 		data->set_phy_power(0);
 
 	usb_put_phy(musb->xceiv);
-	usb_nop_xceiv_unregister();
+	usb_nop_xceiv_unregister(musb->xceiv);
 
 	return 0;
 }
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index c848b82..f1fe728 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -442,7 +442,7 @@ static int bfin_musb_exit(struct musb *musb)
 	gpio_free(musb->config->gpio_vrsel);
 
 	usb_put_phy(musb->xceiv);
-	usb_nop_xceiv_unregister();
+	usb_nop_xceiv_unregister(musb->xceiv);
 	return 0;
 }
 
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index cebd9d7..a5260b6 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -460,7 +460,7 @@ static int da8xx_musb_exit(struct musb *musb)
 	phy_off();
 
 	usb_put_phy(musb->xceiv);
-	usb_nop_xceiv_unregister();
+	usb_nop_xceiv_unregister(musb->xceiv);
 
 	return 0;
 }
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 3f094f2..c7ef654 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -447,7 +447,7 @@ static int davinci_musb_init(struct musb *musb)
 fail:
 	usb_put_phy(musb->xceiv);
 unregister:
-	usb_nop_xceiv_unregister();
+	usb_nop_xceiv_unregister(musb->xceiv);
 	return -ENODEV;
 }
 
@@ -496,7 +496,7 @@ static int davinci_musb_exit(struct musb *musb)
 	phy_off();
 
 	usb_put_phy(musb->xceiv);
-	usb_nop_xceiv_unregister();
+	usb_nop_xceiv_unregister(musb->xceiv);
 
 	return 0;
 }
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 7a09d55..c529ccb 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -420,7 +420,7 @@ static int dsps_musb_init(struct musb *musb)
 	/* mentor core register starts at offset of 0x400 from musb base */
 	musb->mregs += wrp->musb_core_offset;
 
-	/* NOP driver needs change if supporting dual instance */
+	/* Register NOP driver */
 	usb_nop_xceiv_register();
 	musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
 	if (IS_ERR_OR_NULL(musb->xceiv))
@@ -456,7 +456,7 @@ static int dsps_musb_init(struct musb *musb)
 	return 0;
 err0:
 	usb_put_phy(musb->xceiv);
-	usb_nop_xceiv_unregister();
+	usb_nop_xceiv_unregister(musb->xceiv);
 	return status;
 }
 
@@ -472,9 +472,9 @@ static int dsps_musb_exit(struct musb *musb)
 	/* Shutdown the on-chip PHY and its PLL. */
 	musb_dsps_phy_control(glue, pdev->id, 0);
 
-	/* NOP driver needs change if supporting dual instance */
+	/* Unregister NOP driver */
 	usb_put_phy(musb->xceiv);
-	usb_nop_xceiv_unregister();
+	usb_nop_xceiv_unregister(musb->xceiv);
 
 	return 0;
 }
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index 64a0e95..3a12330 100644
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -1132,7 +1132,7 @@ done:
 			iounmap(sync);
 
 		usb_put_phy(musb->xceiv);
-		usb_nop_xceiv_unregister();
+		usb_nop_xceiv_unregister(musb->xceiv);
 	}
 	return ret;
 }
@@ -1148,7 +1148,7 @@ static int tusb_musb_exit(struct musb *musb)
 	iounmap(musb->sync_va);
 
 	usb_put_phy(musb->xceiv);
-	usb_nop_xceiv_unregister();
+	usb_nop_xceiv_unregister(musb->xceiv);
 	return 0;
 }
 
diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
index 803f958..04ddcee 100644
--- a/drivers/usb/otg/nop-usb-xceiv.c
+++ b/drivers/usb/otg/nop-usb-xceiv.c
@@ -31,30 +31,69 @@
 #include <linux/dma-mapping.h>
 #include <linux/usb/otg.h>
 #include <linux/slab.h>
+#include <linux/idr.h>
 
 struct nop_usb_xceiv {
 	struct usb_phy		phy;
 	struct device		*dev;
+	struct platform_device	*pd;
 };
 
-static struct platform_device *pd;
+static DEFINE_IDA(nop_ida);
 
-void usb_nop_xceiv_register(void)
+static int nop_get_id(gfp_t gfp_mask)
 {
-	if (pd)
+	int ret, id;
+
+	ret = ida_pre_get(&nop_ida, gfp_mask);
+	if (!ret) {
+		pr_err("failed to reserve resource for id\n");
+		return -ENOMEM;
+	}
+
+	ret = ida_get_new(&nop_ida, &id);
+	if (ret < 0) {
+		pr_err("failed to allocate a new id\n");
+		return ret;
+	}
+
+	return id;
+}
+
+static void nop_put_id(int id)
+{
+
+	pr_debug("removing id %d\n", id);
+	ida_remove(&nop_ida, id);
+}
+
+void usb_nop_xceiv_register()
+{
+	struct platform_device *pd;
+	int id;
+
+	id = nop_get_id(GFP_KERNEL);
+	if (id < 0) {
+		pr_err("failed to allocate a new id\n");
 		return;
-	pd = platform_device_register_simple("nop_usb_xceiv", -1, NULL, 0);
+	}
+
+	pd = platform_device_register_simple("nop_usb_xceiv", id, NULL, 0);
 	if (!pd) {
-		printk(KERN_ERR "Unable to register usb nop transceiver\n");
+		pr_err("Unable to register usb nop transceiver\n");
 		return;
 	}
 }
 EXPORT_SYMBOL(usb_nop_xceiv_register);
 
-void usb_nop_xceiv_unregister(void)
+void usb_nop_xceiv_unregister(struct usb_phy *phy)
 {
+	struct nop_usb_xceiv *nop = container_of(phy,
+			struct nop_usb_xceiv, phy);
+	struct platform_device *pd = nop->pd;
+
 	platform_device_unregister(pd);
-	pd = NULL;
+	nop_put_id(pd->id);
 }
 EXPORT_SYMBOL(usb_nop_xceiv_unregister);
 
@@ -107,6 +146,7 @@ static int __devinit nop_usb_xceiv_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
+	nop->pd			= pdev;
 	nop->dev		= &pdev->dev;
 	nop->phy.dev		= nop->dev;
 	nop->phy.label		= "nop-xceiv";
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 4636d39..2d7704e 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -138,13 +138,13 @@ extern void usb_remove_phy(struct usb_phy *);
 #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
 /* sometimes transceivers are accessed only through e.g. ULPI */
 extern void usb_nop_xceiv_register(void);
-extern void usb_nop_xceiv_unregister(void);
+extern void usb_nop_xceiv_unregister(struct usb_phy *);
 #else
 static inline void usb_nop_xceiv_register(void)
 {
 }
 
-static inline void usb_nop_xceiv_unregister(void)
+static inline void usb_nop_xceiv_unregister(struct usb_phy *phy)
 {
 }
 #endif
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v7 05/11] usb: musb: dsps: add dt support
       [not found] ` <1343909574-15633-1-git-send-email-ravibabu-l0cyMroinI0@public.gmane.org>
  2012-08-02 12:12   ` [PATCH v7 01/11] usb: musb: add musb_ida for multi instance support Ravi Babu
  2012-08-02 12:12   ` [PATCH v7 02/11] usb: musb: kill global and static for multi instance Ravi Babu
@ 2012-08-02 12:12   ` Ravi Babu
  2012-08-02 12:12   ` [PATCH v7 06/11] arm/dts: am33xx: Add dt data for usbss Ravi Babu
                     ` (5 subsequent siblings)
  8 siblings, 0 replies; 27+ messages in thread
From: Ravi Babu @ 2012-08-02 12:12 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA, balbi-l0cyMroinI0,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	tony-4v6yS6AI5VpBDgjK7y7TUQ, ajayguptaj-Re5JQEeQqe8AvxtiuMwx3w

From: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>

Added device tree support for dsps musb glue driver and updated the
Documentation with device tree binding information.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
Signed-off-by: Ravi Babu <ravibabu-l0cyMroinI0@public.gmane.org>
---
 .../devicetree/bindings/usb/am33xx-usb.txt         |   14 +++++
 drivers/usb/musb/musb_dsps.c                       |   60 +++++++++++++++++---
 2 files changed, 65 insertions(+), 9 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/am33xx-usb.txt

diff --git a/Documentation/devicetree/bindings/usb/am33xx-usb.txt b/Documentation/devicetree/bindings/usb/am33xx-usb.txt
new file mode 100644
index 0000000..ca8fa56
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/am33xx-usb.txt
@@ -0,0 +1,14 @@
+AM33XX MUSB GLUE
+ - compatible : Should be "ti,musb-am33xx"
+ - ti,hwmods : must be "usb_otg_hs"
+ - multipoint : Should be "1" indicating the musb controller supports
+   multipoint. This is a MUSB configuration-specific setting.
+ - num_eps : Specifies the number of endpoints. This is also a
+   MUSB configuration-specific setting. Should be set to "16"
+ - ram_bits : Specifies the ram address size. Should be set to "12"
+ - port0_mode : Should be "3" to represent OTG. "1" signifies HOST and "2"
+   represents PERIPHERAL.
+ - port1_mode : Should be "1" to represent HOST. "3" signifies OTG and "2"
+   represents PERIPHERAL.
+ - power : Should be "250". This signifies the controller can supply upto
+   500mA when operating in host mode.
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index c529ccb..13c9341 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -31,6 +31,7 @@
 
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/of.h>
 #include <linux/err.h>
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
@@ -45,6 +46,10 @@
 
 #include "musb_core.h"
 
+#ifdef CONFIG_OF
+static const struct of_device_id musb_dsps_of_match[];
+#endif
+
 /**
  * avoid using musb_readx()/musb_writex() as glue layer should not be
  * dependent on musb core layer symbols.
@@ -496,6 +501,8 @@ static int __devinit dsps_create_musb_pdev(struct dsps_glue *glue, u8 id)
 	struct device *dev = glue->dev;
 	struct platform_device *pdev = to_platform_device(dev);
 	struct musb_hdrc_platform_data  *pdata = dev->platform_data;
+	struct device_node *np = pdev->dev.of_node;
+	struct musb_hdrc_config	*config;
 	struct platform_device	*musb;
 	struct resource *res;
 	struct resource	resources[2];
@@ -562,14 +569,40 @@ static int __devinit dsps_create_musb_pdev(struct dsps_glue *glue, u8 id)
 
 	glue->musb[id]			= musb;
 
-	pdata->platform_ops		= &dsps_ops;
-
 	ret = platform_device_add_resources(musb, resources, 2);
 	if (ret) {
 		dev_err(dev, "failed to add resources\n");
 		goto err2;
 	}
 
+	if (np) {
+		pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
+		if (!pdata) {
+			dev_err(&pdev->dev,
+				"failed to allocate musb platfrom data\n");
+			ret = -ENOMEM;
+			goto err2;
+		}
+
+		config = devm_kzalloc(&pdev->dev, sizeof(*config), GFP_KERNEL);
+		if (!config) {
+			dev_err(&pdev->dev,
+				"failed to allocate musb hdrc config\n");
+			goto err2;
+		}
+
+		of_property_read_u32(np, "num_eps", (u32 *)&config->num_eps);
+		of_property_read_u32(np, "ram_bits", (u32 *)&config->ram_bits);
+		sprintf(res_name, "port%d_mode", id);
+		of_property_read_u32(np, res_name, (u32 *)&pdata->mode);
+		of_property_read_u32(np, "power", (u32 *)&pdata->power);
+		config->multipoint = of_property_read_bool(np, "multipoint");
+
+		pdata->config		= config;
+	}
+
+	pdata->platform_ops		= &dsps_ops;
+
 	ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
 	if (ret) {
 		dev_err(dev, "failed to add platform_data\n");
@@ -601,14 +634,22 @@ static void __devexit dsps_delete_musb_pdev(struct dsps_glue *glue, u8 id)
 
 static int __devinit dsps_probe(struct platform_device *pdev)
 {
-	const struct platform_device_id *id = platform_get_device_id(pdev);
-	const struct dsps_musb_wrapper *wrp =
-				(struct dsps_musb_wrapper *)id->driver_data;
+	struct device_node *np = pdev->dev.of_node;
+	const struct of_device_id *match;
+	const struct dsps_musb_wrapper *wrp;
 	struct dsps_glue *glue;
 	struct resource *iomem;
 	u32 __iomem *usbss;
 	int ret, i;
 
+	match = of_match_node(musb_dsps_of_match, np);
+	if (!match) {
+		dev_err(&pdev->dev, "fail to get matching of_match struct\n");
+		ret = -EINVAL;
+		goto err0;
+	}
+	wrp = match->data;
+
 	/* allocate glue */
 	glue = kzalloc(sizeof(*glue), GFP_KERNEL);
 	if (!glue) {
@@ -768,13 +809,14 @@ static const struct platform_device_id musb_dsps_id_table[] __devinitconst = {
 };
 MODULE_DEVICE_TABLE(platform, musb_dsps_id_table);
 
+#ifdef CONFIG_OF
 static const struct of_device_id musb_dsps_of_match[] __devinitconst = {
-	{ .compatible = "musb-ti81xx", },
-	{ .compatible = "ti,ti81xx-musb", },
-	{ .compatible = "ti,am335x-musb", },
+	{ .compatible = "ti,musb-am33xx",
+		.data = (void *) &ti81xx_driver_data, },
 	{  },
 };
 MODULE_DEVICE_TABLE(of, musb_dsps_of_match);
+#endif
 
 static struct platform_driver dsps_usbss_driver = {
 	.probe		= dsps_probe,
@@ -782,7 +824,7 @@ static struct platform_driver dsps_usbss_driver = {
 	.driver         = {
 		.name   = "musb-dsps",
 		.pm	= &dsps_pm_ops,
-		.of_match_table	= musb_dsps_of_match,
+		.of_match_table	= of_match_ptr(musb_dsps_of_match),
 	},
 	.id_table	= musb_dsps_id_table,
 };
-- 
1.7.0.4

--
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 v7 06/11] arm/dts: am33xx: Add dt data for usbss
       [not found] ` <1343909574-15633-1-git-send-email-ravibabu-l0cyMroinI0@public.gmane.org>
                     ` (2 preceding siblings ...)
  2012-08-02 12:12   ` [PATCH v7 05/11] usb: musb: dsps: add dt support Ravi Babu
@ 2012-08-02 12:12   ` Ravi Babu
  2012-08-02 12:12   ` [PATCH v7 08/11] arm/dts: am33xx: add dt data for usb nop phy Ravi Babu
                     ` (4 subsequent siblings)
  8 siblings, 0 replies; 27+ messages in thread
From: Ravi Babu @ 2012-08-02 12:12 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA, balbi-l0cyMroinI0,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	tony-4v6yS6AI5VpBDgjK7y7TUQ, ajayguptaj-Re5JQEeQqe8AvxtiuMwx3w

From: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>

Added device tree data for usbss on am33xx. There are two musb controllers
on am33xx platform so have port0_mode and port1_mode additional data.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
Signed-off-by: Ravi Babu <ravibabu-l0cyMroinI0@public.gmane.org>
---
 arch/arm/boot/dts/am33xx.dtsi |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 59509c4..08e9a40 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -154,5 +154,16 @@
 			#size-cells = <0>;
 			ti,hwmods = "i2c3";
 		};
+
+		usb_otg_hs: usb_otg_hs {
+			compatible = "ti,musb-am33xx";
+			ti,hwmods = "usb_otg_hs";
+			multipoint = <1>;
+			num_eps = <16>;
+			ram_bits = <12>;
+			port0_mode = <3>;
+			port1_mode = <1>;
+			power = <250>;
+		};
 	};
 };
-- 
1.7.0.4

--
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 v7 07/11] usb: otg: nop: add dt support
  2012-08-02 12:12 [PATCH v7 00/11] usb: musb: adding multi instance support Ravi Babu
                   ` (2 preceding siblings ...)
       [not found] ` <1343909574-15633-1-git-send-email-ravibabu-l0cyMroinI0@public.gmane.org>
@ 2012-08-02 12:12 ` Ravi Babu
  2012-08-02 12:12 ` [PATCH v7 11/11] arm/dts: am33xx: add phy phandle to usbss Ravi Babu
  4 siblings, 0 replies; 27+ messages in thread
From: Ravi Babu @ 2012-08-02 12:12 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-omap, balbi, grant.likely, devicetree-discuss, tony,
	ajayguptaj

From: Ajay Kumar Gupta <ajay.gupta@ti.com>

Added device tree support for nop transceiver driver and updated the
Documentation with device tree binding information for am33xx platform.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Ravi Babu <ravibabu@ti.com>
---
 .../devicetree/bindings/usb/am33xx-usb.txt         |    3 +++
 drivers/usb/otg/nop-usb-xceiv.c                    |   10 ++++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/am33xx-usb.txt b/Documentation/devicetree/bindings/usb/am33xx-usb.txt
index ca8fa56..9782585 100644
--- a/Documentation/devicetree/bindings/usb/am33xx-usb.txt
+++ b/Documentation/devicetree/bindings/usb/am33xx-usb.txt
@@ -12,3 +12,6 @@ AM33XX MUSB GLUE
    represents PERIPHERAL.
  - power : Should be "250". This signifies the controller can supply upto
    500mA when operating in host mode.
+
+NOP USB PHY
+ - compatible : Should be "nop-xceiv-usb"
diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
index 04ddcee..a66e3bc 100644
--- a/drivers/usb/otg/nop-usb-xceiv.c
+++ b/drivers/usb/otg/nop-usb-xceiv.c
@@ -27,6 +27,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 #include <linux/usb/otg.h>
@@ -188,12 +189,21 @@ static int __devexit nop_usb_xceiv_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id nop_xceiv_id_table[] = {
+	{ .compatible = "nop-xceiv-usb" },
+	{}
+};
+MODULE_DEVICE_TABLE(of, nop_xceiv_id_table);
+#endif
+
 static struct platform_driver nop_usb_xceiv_driver = {
 	.probe		= nop_usb_xceiv_probe,
 	.remove		= __devexit_p(nop_usb_xceiv_remove),
 	.driver		= {
 		.name	= "nop_usb_xceiv",
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(nop_xceiv_id_table),
 	},
 };
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v7 08/11] arm/dts: am33xx: add dt data for usb nop phy
       [not found] ` <1343909574-15633-1-git-send-email-ravibabu-l0cyMroinI0@public.gmane.org>
                     ` (3 preceding siblings ...)
  2012-08-02 12:12   ` [PATCH v7 06/11] arm/dts: am33xx: Add dt data for usbss Ravi Babu
@ 2012-08-02 12:12   ` Ravi Babu
  2012-08-02 12:12   ` [PATCH v7 09/11] usb: musb: dsps: remove explicit NOP device creation Ravi Babu
                     ` (3 subsequent siblings)
  8 siblings, 0 replies; 27+ messages in thread
From: Ravi Babu @ 2012-08-02 12:12 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA, balbi-l0cyMroinI0,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	tony-4v6yS6AI5VpBDgjK7y7TUQ, ajayguptaj-Re5JQEeQqe8AvxtiuMwx3w

From: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>

AM33xx has two musb controller and they have one NOP PHY each.
Added the device tree data for NOP PHY.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
Signed-off-by: Ravi Babu <ravibabu-l0cyMroinI0@public.gmane.org>
---
 arch/arm/boot/dts/am33xx.dtsi |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 08e9a40..b03a9b5 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -155,6 +155,14 @@
 			ti,hwmods = "i2c3";
 		};
 
+		usb0_phy: phy0 {
+			compatible = "nop-xceiv-usb";
+		};
+
+		usb1_phy: phy1 {
+			compatible = "nop-xceiv-usb";
+		};
+
 		usb_otg_hs: usb_otg_hs {
 			compatible = "ti,musb-am33xx";
 			ti,hwmods = "usb_otg_hs";
-- 
1.7.0.4

--
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 v7 09/11] usb: musb: dsps: remove explicit NOP device creation
       [not found] ` <1343909574-15633-1-git-send-email-ravibabu-l0cyMroinI0@public.gmane.org>
                     ` (4 preceding siblings ...)
  2012-08-02 12:12   ` [PATCH v7 08/11] arm/dts: am33xx: add dt data for usb nop phy Ravi Babu
@ 2012-08-02 12:12   ` Ravi Babu
  2012-08-02 12:12   ` [PATCH v7 10/11] usb: musb: dsps: get the PHY using phandle api Ravi Babu
                     ` (2 subsequent siblings)
  8 siblings, 0 replies; 27+ messages in thread
From: Ravi Babu @ 2012-08-02 12:12 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA, balbi-l0cyMroinI0,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	tony-4v6yS6AI5VpBDgjK7y7TUQ, ajayguptaj-Re5JQEeQqe8AvxtiuMwx3w

From: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>

As NOP device node is now added in am33xx tree so remove the call
which creates the NOP platform_device.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
Signed-off-by: Ravi Babu <ravibabu-l0cyMroinI0@public.gmane.org>
---
 drivers/usb/musb/musb_dsps.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 13c9341..891c2be 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -425,8 +425,7 @@ static int dsps_musb_init(struct musb *musb)
 	/* mentor core register starts at offset of 0x400 from musb base */
 	musb->mregs += wrp->musb_core_offset;
 
-	/* Register NOP driver */
-	usb_nop_xceiv_register();
+	/* Get the NOP PHY */
 	musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
 	if (IS_ERR_OR_NULL(musb->xceiv))
 		return -ENODEV;
-- 
1.7.0.4

--
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 v7 10/11] usb: musb: dsps: get the PHY using phandle api
       [not found] ` <1343909574-15633-1-git-send-email-ravibabu-l0cyMroinI0@public.gmane.org>
                     ` (5 preceding siblings ...)
  2012-08-02 12:12   ` [PATCH v7 09/11] usb: musb: dsps: remove explicit NOP device creation Ravi Babu
@ 2012-08-02 12:12   ` Ravi Babu
  2012-08-02 22:08   ` [PATCH v7 00/11] usb: musb: adding multi instance support Daniel Mack
  2012-08-15 14:39   ` Christopher Harvey
  8 siblings, 0 replies; 27+ messages in thread
From: Ravi Babu @ 2012-08-02 12:12 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA, balbi-l0cyMroinI0,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	tony-4v6yS6AI5VpBDgjK7y7TUQ, ajayguptaj-Re5JQEeQqe8AvxtiuMwx3w

AM33xx has two PHY of same type used by each musb controller so
use phandle of phy nodes to get the phy pointer.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
Signed-off-by: Ravi Babu <ravibabu-l0cyMroinI0@public.gmane.org>
---
 .../devicetree/bindings/usb/am33xx-usb.txt         |    2 ++
 drivers/usb/musb/musb_dsps.c                       |    5 ++++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/am33xx-usb.txt b/Documentation/devicetree/bindings/usb/am33xx-usb.txt
index 9782585..e2702df 100644
--- a/Documentation/devicetree/bindings/usb/am33xx-usb.txt
+++ b/Documentation/devicetree/bindings/usb/am33xx-usb.txt
@@ -12,6 +12,8 @@ AM33XX MUSB GLUE
    represents PERIPHERAL.
  - power : Should be "250". This signifies the controller can supply upto
    500mA when operating in host mode.
+ - usb0-phy : phandle for usb0 NOP PHY
+ - usb1-phy : phandle for usb1 NOP PHY
 
 NOP USB PHY
  - compatible : Should be "nop-xceiv-usb"
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 891c2be..255e71a 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -416,9 +416,11 @@ static int dsps_musb_init(struct musb *musb)
 {
 	struct device *dev = musb->controller;
 	struct platform_device *pdev = to_platform_device(dev);
+	struct platform_device *parent_pdev = to_platform_device(dev->parent);
 	struct dsps_glue *glue = dev_get_drvdata(dev->parent);
 	const struct dsps_musb_wrapper *wrp = glue->wrp;
 	void __iomem *reg_base = musb->ctrl_base;
+	char name[10];
 	u32 rev, val;
 	int status;
 
@@ -426,7 +428,8 @@ static int dsps_musb_init(struct musb *musb)
 	musb->mregs += wrp->musb_core_offset;
 
 	/* Get the NOP PHY */
-	musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
+	sprintf(name, "usb%d-phy", pdev->id);
+	musb->xceiv = devm_usb_get_phy_by_phandle(&parent_pdev->dev, name);
 	if (IS_ERR_OR_NULL(musb->xceiv))
 		return -ENODEV;
 
-- 
1.7.0.4

--
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 v7 11/11] arm/dts: am33xx: add phy phandle to usbss
  2012-08-02 12:12 [PATCH v7 00/11] usb: musb: adding multi instance support Ravi Babu
                   ` (3 preceding siblings ...)
  2012-08-02 12:12 ` [PATCH v7 07/11] usb: otg: nop: add dt support Ravi Babu
@ 2012-08-02 12:12 ` Ravi Babu
  4 siblings, 0 replies; 27+ messages in thread
From: Ravi Babu @ 2012-08-02 12:12 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-omap, balbi, grant.likely, devicetree-discuss, tony,
	ajayguptaj

From: Ajay Kumar Gupta <ajay.gupta@ti.com>

Added NOP PHY phandle to usbss device node as same will be used
to get the phy from otg framework.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Ravi Babu <ravibabu@ti.com>
---
 arch/arm/boot/dts/am33xx.dtsi |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index b03a9b5..d3ab69a 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -172,6 +172,8 @@
 			port0_mode = <3>;
 			port1_mode = <1>;
 			power = <250>;
+			usb0-phy = <&usb0_phy>;
+			usb1-phy = <&usb1_phy>;
 		};
 	};
 };
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [PATCH v7 00/11] usb: musb: adding multi instance support
       [not found] ` <1343909574-15633-1-git-send-email-ravibabu-l0cyMroinI0@public.gmane.org>
                     ` (6 preceding siblings ...)
  2012-08-02 12:12   ` [PATCH v7 10/11] usb: musb: dsps: get the PHY using phandle api Ravi Babu
@ 2012-08-02 22:08   ` Daniel Mack
       [not found]     ` <501AFA6B.4010005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2012-08-15 14:39   ` Christopher Harvey
  8 siblings, 1 reply; 27+ messages in thread
From: Daniel Mack @ 2012-08-02 22:08 UTC (permalink / raw)
  To: Ravi Babu
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, balbi-l0cyMroinI0,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	tony-4v6yS6AI5VpBDgjK7y7TUQ, ajayguptaj-Re5JQEeQqe8AvxtiuMwx3w,
	Hiremath, Vaibhav

Hi Ravi,

On 02.08.2012 14:12, Ravi Babu wrote:
> This series of patches adds,
> a) Multi instances support in musb driver
> b) DT support for musb_dsps glue layer
> c) DT support for NOP transceiver
> 
> AM33xx and TI81xx has dual musb controller and has two usb PHY of same type.
> This patch series uses 'phandle' based API devm_usb_get_phy_by_phandle() to
> get the PHY of same type. This API support is being added by Kishon's patch
> discussed at [1]
> 
> The series applies to linux-omap (master branch)
> 	+ Vaibhav baseport patches on his tree at [3]
> 	+ Kishon's multi phy patches on Felipe's branch 'xceiv'
> 	+ Kishon's patch on phandle at [1]
> 	+ AM33xx musb glue compile and bugfix patches at [4], [5], [6] and [7]
> 	+ Damodar's recent patch at [2] 
> 
> and have been tested on Beaglebone board.

I would like to test these patches on a custom AM33xx board, but I'm
having trouble applying them. I am based on Linus' master tree, and "git
am" fails for drivers/usb/musb/musb_dsps.c. The commits I got for that
file are:

ded017ee6 usb: phy: fix return value check of usb_get_phy
662dca54c usb: otg: support for multiple transceivers by a single controller
721002ec1 usb: otg: utils: rename function name in OTG utils
9ecb88752 usb: musb: Add support for ti81xx platform

I wonder which branch you are based on and which tree those patches
should go thru eventually.


Thanks,
Daniel

--
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 v7 00/11] usb: musb: adding multi instance support
       [not found]     ` <501AFA6B.4010005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2012-08-03  0:54       ` B, Ravi
       [not found]         ` <6C6B28D4DC342643927BEAFCE8707BF63E9DB6AE-Er742YJ7I/eIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: B, Ravi @ 2012-08-03  0:54 UTC (permalink / raw)
  To: Daniel Mack
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Balbi, Felipe,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org,
	ajayguptaj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	Hiremath, Vaibhav

Hi

> 
> On 02.08.2012 14:12, Ravi Babu wrote:
> > This series of patches adds,
> > a) Multi instances support in musb driver
> > b) DT support for musb_dsps glue layer
> > c) DT support for NOP transceiver
> > 
> > AM33xx and TI81xx has dual musb controller and has two usb 
> PHY of same type.
> > This patch series uses 'phandle' based API 
> > devm_usb_get_phy_by_phandle() to get the PHY of same type. This API 
> > support is being added by Kishon's patch discussed at [1]
> > 
> > The series applies to linux-omap (master branch)
> > 	+ Vaibhav baseport patches on his tree at [3]
> > 	+ Kishon's multi phy patches on Felipe's branch 'xceiv'
> > 	+ Kishon's patch on phandle at [1]
> > 	+ AM33xx musb glue compile and bugfix patches at [4], 
> [5], [6] and [7]
> > 	+ Damodar's recent patch at [2]
> > 
> > and have been tested on Beaglebone board.

Have you applied the above patches before applying these patches.

Ravi Babu

> 
> I would like to test these patches on a custom AM33xx board, 
> but I'm having trouble applying them. I am based on Linus' 
> master tree, and "git am" fails for 
> drivers/usb/musb/musb_dsps.c. The commits I got for that file are:
> 
> ded017ee6 usb: phy: fix return value check of usb_get_phy 
> 662dca54c usb: otg: support for multiple transceivers by a 
> single controller
> 721002ec1 usb: otg: utils: rename function name in OTG utils
> 9ecb88752 usb: musb: Add support for ti81xx platform
> 
> I wonder which branch you are based on and which tree those 
> patches should go thru eventually.
> 
> 
> Thanks,
> Daniel
> 
> --
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 v7 00/11] usb: musb: adding multi instance support
       [not found]         ` <6C6B28D4DC342643927BEAFCE8707BF63E9DB6AE-Er742YJ7I/eIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
@ 2012-08-03  8:19           ` Daniel Mack
  2012-08-03  8:43             ` Ajay Gupta
  0 siblings, 1 reply; 27+ messages in thread
From: Daniel Mack @ 2012-08-03  8:19 UTC (permalink / raw)
  To: B, Ravi
  Cc: ajayguptaj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Balbi, Felipe,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On 03.08.2012 02:54, B, Ravi wrote:
>> On 02.08.2012 14:12, Ravi Babu wrote:
>>> This series of patches adds,
>>> a) Multi instances support in musb driver
>>> b) DT support for musb_dsps glue layer
>>> c) DT support for NOP transceiver
>>>
>>> AM33xx and TI81xx has dual musb controller and has two usb 
>> PHY of same type.
>>> This patch series uses 'phandle' based API 
>>> devm_usb_get_phy_by_phandle() to get the PHY of same type. This API 
>>> support is being added by Kishon's patch discussed at [1]
>>>
>>> The series applies to linux-omap (master branch)
>>> 	+ Vaibhav baseport patches on his tree at [3]
>>> 	+ Kishon's multi phy patches on Felipe's branch 'xceiv'
>>> 	+ Kishon's patch on phandle at [1]
>>> 	+ AM33xx musb glue compile and bugfix patches at [4], 
>> [5], [6] and [7]
>>> 	+ Damodar's recent patch at [2]
>>>
>>> and have been tested on Beaglebone board.
> 
> Have you applied the above patches before applying these patches.

Somehow, I was missing some of Ajay's patches. I resolved that, and now
the series applied.

However, I needed to add a phandle "usb0-phy = <&usb0_phy>" to the
usb_otg_hs DTSI block, otherwise devm_usb_get_phy_by_phandle() in
drivers/usb/musb/musb_dsps.c would fail. Is that correct? I can't seem
to find that in your patches.

With this addition, I see the following:

[    1.782180] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
[    1.809966] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
[    1.819068] musb-hdrc musb-hdrc.0: new USB bus registered, assigned
bus number 1
[    1.827970] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.835184] usb usb1: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[    1.842818] usb usb1: Product: MUSB HDRC host driver
[    1.848031] usb usb1: Manufacturer: Linux
3.6.0-rc1-00038-g8a1ec8f-dirty musb-hcd
[    1.855933] usb usb1: SerialNumber: musb-hdrc.0
[    1.866913] hub 1-0:1.0: USB hub found
[    1.871192] hub 1-0:1.0: 1 port detected
[    1.878106] musb-hdrc musb-hdrc.0: USB Host mode controller at
d08c0000 using PIO, IRQ 18

... but no USB functions. Also, every two seconds, the following message
is printed:

[   11.036608] musb_bus_suspend 2308: trying to suspend as a_wait_vrise
while active
[   13.044811] musb_bus_suspend 2308: trying to suspend as a_wait_vrise
while active
[   15.052196] musb_bus_suspend 2308: trying to suspend as a_wait_vrise
while active


Anything obvious that I'm missing?


Thanks,
Daniel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH v7 00/11] usb: musb: adding multi instance support
  2012-08-03  8:19           ` Daniel Mack
@ 2012-08-03  8:43             ` Ajay Gupta
       [not found]               ` <F20D4CDD972CFA4D89D3A083D2D561967FF1F67DE3-kdsAE/FnitNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
  2012-08-03  9:02               ` Daniel Mack
  0 siblings, 2 replies; 27+ messages in thread
From: Ajay Gupta @ 2012-08-03  8:43 UTC (permalink / raw)
  To: Daniel Mack, B, Ravi
  Cc: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
	Balbi, Felipe, grant.likely@secretlab.ca,
	devicetree-discuss@lists.ozlabs.org, tony@atomide.com,
	ajayguptaj@gmail.com, Hiremath, Vaibhav

Hi,
> On 03.08.2012 02:54, B, Ravi wrote:
> >> On 02.08.2012 14:12, Ravi Babu wrote:
> >>> This series of patches adds,
> >>> a) Multi instances support in musb driver
> >>> b) DT support for musb_dsps glue layer
> >>> c) DT support for NOP transceiver
> >>>
> >>> AM33xx and TI81xx has dual musb controller and has two usb
> >> PHY of same type.
> >>> This patch series uses 'phandle' based API
> >>> devm_usb_get_phy_by_phandle() to get the PHY of same type. This API
> >>> support is being added by Kishon's patch discussed at [1]
> >>>
> >>> The series applies to linux-omap (master branch)
> >>> 	+ Vaibhav baseport patches on his tree at [3]
> >>> 	+ Kishon's multi phy patches on Felipe's branch 'xceiv'
> >>> 	+ Kishon's patch on phandle at [1]
> >>> 	+ AM33xx musb glue compile and bugfix patches at [4],
> >> [5], [6] and [7]
> >>> 	+ Damodar's recent patch at [2]
> >>>
> >>> and have been tested on Beaglebone board.
> >
> > Have you applied the above patches before applying these patches.
> 
> Somehow, I was missing some of Ajay's patches. I resolved that, and now the
> series applied.
> 
> However, I needed to add a phandle "usb0-phy = <&usb0_phy>" to the
> usb_otg_hs DTSI block, otherwise devm_usb_get_phy_by_phandle() in
> drivers/usb/musb/musb_dsps.c would fail. Is that correct? I can't seem to
> find that in your patches.

It's getting done in patch 11/11.

> 
> With this addition, I see the following:
> 
> [    1.782180] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
> [    1.809966] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
> [    1.819068] musb-hdrc musb-hdrc.0: new USB bus registered, assigned
> bus number 1
> [    1.827970] usb usb1: New USB device found, idVendor=1d6b,
> idProduct=0002
> [    1.835184] usb usb1: New USB device strings: Mfr=3, Product=2,
> SerialNumber=1
> [    1.842818] usb usb1: Product: MUSB HDRC host driver
> [    1.848031] usb usb1: Manufacturer: Linux
> 3.6.0-rc1-00038-g8a1ec8f-dirty musb-hcd
> [    1.855933] usb usb1: SerialNumber: musb-hdrc.0
> [    1.866913] hub 1-0:1.0: USB hub found
> [    1.871192] hub 1-0:1.0: 1 port detected
> [    1.878106] musb-hdrc musb-hdrc.0: USB Host mode controller at
> d08c0000 using PIO, IRQ 18	
> 
> ... but no USB functions. Also, every two seconds, the following message is
> printed:
> 
> [   11.036608] musb_bus_suspend 2308: trying to suspend as a_wait_vrise
> while active
> [   13.044811] musb_bus_suspend 2308: trying to suspend as a_wait_vrise
> while active
> [   15.052196] musb_bus_suspend 2308: trying to suspend as a_wait_vrise
> while active

Do you see them even when you connect a device to port?

Ajay
> 
> 
> Anything obvious that I'm missing?
> 
> 
> Thanks,
> Daniel
> --
> 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
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH v7 00/11] usb: musb: adding multi instance support
       [not found]               ` <F20D4CDD972CFA4D89D3A083D2D561967FF1F67DE3-kdsAE/FnitNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
@ 2012-08-03  8:53                 ` B, Ravi
  0 siblings, 0 replies; 27+ messages in thread
From: B, Ravi @ 2012-08-03  8:53 UTC (permalink / raw)
  To: Ajay Gupta, Daniel Mack
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Balbi, Felipe,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org,
	ajayguptaj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	Hiremath, Vaibhav

Hi Daniel

> > >>> This series of patches adds,
> > >>> a) Multi instances support in musb driver
> > >>> b) DT support for musb_dsps glue layer
> > >>> c) DT support for NOP transceiver
> > >>>
> > >>> AM33xx and TI81xx has dual musb controller and has two usb
> > >> PHY of same type.
> > >>> This patch series uses 'phandle' based API
> > >>> devm_usb_get_phy_by_phandle() to get the PHY of same type. This 
> > >>> API support is being added by Kishon's patch discussed at [1]
> > >>>
> > >>> The series applies to linux-omap (master branch)
> > >>> 	+ Vaibhav baseport patches on his tree at [3]
> > >>> 	+ Kishon's multi phy patches on Felipe's branch 'xceiv'
> > >>> 	+ Kishon's patch on phandle at [1]
> > >>> 	+ AM33xx musb glue compile and bugfix patches at [4],
> > >> [5], [6] and [7]
> > >>> 	+ Damodar's recent patch at [2]
> > >>>
> > >>> and have been tested on Beaglebone board.
> > >
> > > Have you applied the above patches before applying these patches.
> > 
> > Somehow, I was missing some of Ajay's patches. I resolved that, and 
> > now the series applied.
> > 
> > However, I needed to add a phandle "usb0-phy = <&usb0_phy>" to the 
> > usb_otg_hs DTSI block, otherwise devm_usb_get_phy_by_phandle() in 
> > drivers/usb/musb/musb_dsps.c would fail. Is that correct? I 
> can't seem 
> > to find that in your patches.
> 
> It's getting done in patch 11/11.

Refer patch 11/11 available at http://marc.info/?l=linux-usb&m=134390988804627&w=2 

Ravi Babu

> 
> > 
> > With this addition, I see the following:
> > 
> > [    1.782180] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
> > [    1.809966] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
> > [    1.819068] musb-hdrc musb-hdrc.0: new USB bus 
> registered, assigned
> > bus number 1
> > [    1.827970] usb usb1: New USB device found, idVendor=1d6b,
> > idProduct=0002
> > [    1.835184] usb usb1: New USB device strings: Mfr=3, Product=2,
> > SerialNumber=1
> > [    1.842818] usb usb1: Product: MUSB HDRC host driver
> > [    1.848031] usb usb1: Manufacturer: Linux
> > 3.6.0-rc1-00038-g8a1ec8f-dirty musb-hcd
> > [    1.855933] usb usb1: SerialNumber: musb-hdrc.0
> > [    1.866913] hub 1-0:1.0: USB hub found
> > [    1.871192] hub 1-0:1.0: 1 port detected
> > [    1.878106] musb-hdrc musb-hdrc.0: USB Host mode controller at
> > d08c0000 using PIO, IRQ 18	
> > 
> > ... but no USB functions. Also, every two seconds, the following 
> > message is
> > printed:
> > 
> > [   11.036608] musb_bus_suspend 2308: trying to suspend as 
> a_wait_vrise
> > while active
> > [   13.044811] musb_bus_suspend 2308: trying to suspend as 
> a_wait_vrise
> > while active
> > [   15.052196] musb_bus_suspend 2308: trying to suspend as 
> a_wait_vrise
> > while active
> 
> Do you see them even when you connect a device to port?
> 
> Ajay
> > 
> > 
> > Anything obvious that I'm missing?
> > 
> > 
> > Thanks,
> > Daniel
> > --
> > 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
> --------------------------------------------------------------
> ---------------------
> This email message is for the sole use of the intended 
> recipient(s) and may contain confidential information.  Any 
> unauthorized review, use, disclosure or distribution is 
> prohibited.  If you are not the intended recipient, please 
> contact the sender by reply email and destroy all copies of 
> the original message.
> --------------------------------------------------------------
> ---------------------
> --
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 v7 00/11] usb: musb: adding multi instance support
  2012-08-03  8:43             ` Ajay Gupta
       [not found]               ` <F20D4CDD972CFA4D89D3A083D2D561967FF1F67DE3-kdsAE/FnitNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
@ 2012-08-03  9:02               ` Daniel Mack
       [not found]                 ` <501B93AB.7050501-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  1 sibling, 1 reply; 27+ messages in thread
From: Daniel Mack @ 2012-08-03  9:02 UTC (permalink / raw)
  To: Ajay Gupta
  Cc: B, Ravi, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
	Balbi, Felipe, grant.likely@secretlab.ca,
	devicetree-discuss@lists.ozlabs.org, tony@atomide.com,
	ajayguptaj@gmail.com, Hiremath, Vaibhav

On 03.08.2012 10:43, Ajay Gupta wrote:
>> On 03.08.2012 02:54, B, Ravi wrote:
>>>> On 02.08.2012 14:12, Ravi Babu wrote:

>> However, I needed to add a phandle "usb0-phy = <&usb0_phy>" to the
>> usb_otg_hs DTSI block, otherwise devm_usb_get_phy_by_phandle() in
>> drivers/usb/musb/musb_dsps.c would fail. Is that correct? I can't seem to
>> find that in your patches.
> 
> It's getting done in patch 11/11.

Ah, ok.

>> With this addition, I see the following:
>>
>> [    1.782180] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
>> [    1.809966] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
>> [    1.819068] musb-hdrc musb-hdrc.0: new USB bus registered, assigned
>> bus number 1
>> [    1.827970] usb usb1: New USB device found, idVendor=1d6b,
>> idProduct=0002
>> [    1.835184] usb usb1: New USB device strings: Mfr=3, Product=2,
>> SerialNumber=1
>> [    1.842818] usb usb1: Product: MUSB HDRC host driver
>> [    1.848031] usb usb1: Manufacturer: Linux
>> 3.6.0-rc1-00038-g8a1ec8f-dirty musb-hcd
>> [    1.855933] usb usb1: SerialNumber: musb-hdrc.0
>> [    1.866913] hub 1-0:1.0: USB hub found
>> [    1.871192] hub 1-0:1.0: 1 port detected
>> [    1.878106] musb-hdrc musb-hdrc.0: USB Host mode controller at
>> d08c0000 using PIO, IRQ 18	
>>
>> ... but no USB functions. Also, every two seconds, the following message is
>> printed:
>>
>> [   11.036608] musb_bus_suspend 2308: trying to suspend as a_wait_vrise
>> while active
>> [   13.044811] musb_bus_suspend 2308: trying to suspend as a_wait_vrise
>> while active
>> [   15.052196] musb_bus_suspend 2308: trying to suspend as a_wait_vrise
>> while active
> 
> Do you see them even when you connect a device to port?

Yes. Will investigate more later today. Just wanted to know whether this
is a typical config problem.


Daniel


^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH v7 00/11] usb: musb: adding multi instance support
       [not found]                 ` <501B93AB.7050501-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2012-08-03  9:07                   ` Hiremath, Vaibhav
       [not found]                     ` <79CD15C6BA57404B839C016229A409A83EA7F4A3-Er742YJ7I/eIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Hiremath, Vaibhav @ 2012-08-03  9:07 UTC (permalink / raw)
  To: Daniel Mack, Ajay Gupta
  Cc: B, Ravi, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Balbi, Felipe,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org,
	ajayguptaj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

On Fri, Aug 03, 2012 at 14:32:35, Daniel Mack wrote:
> On 03.08.2012 10:43, Ajay Gupta wrote:
> >> On 03.08.2012 02:54, B, Ravi wrote:
> >>>> On 02.08.2012 14:12, Ravi Babu wrote:
> 
> >> However, I needed to add a phandle "usb0-phy = <&usb0_phy>" to the
> >> usb_otg_hs DTSI block, otherwise devm_usb_get_phy_by_phandle() in
> >> drivers/usb/musb/musb_dsps.c would fail. Is that correct? I can't seem to
> >> find that in your patches.
> > 
> > It's getting done in patch 11/11.
> 
> Ah, ok.
> 
> >> With this addition, I see the following:
> >>
> >> [    1.782180] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
> >> [    1.809966] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
> >> [    1.819068] musb-hdrc musb-hdrc.0: new USB bus registered, assigned
> >> bus number 1
> >> [    1.827970] usb usb1: New USB device found, idVendor=1d6b,
> >> idProduct=0002
> >> [    1.835184] usb usb1: New USB device strings: Mfr=3, Product=2,
> >> SerialNumber=1
> >> [    1.842818] usb usb1: Product: MUSB HDRC host driver
> >> [    1.848031] usb usb1: Manufacturer: Linux
> >> 3.6.0-rc1-00038-g8a1ec8f-dirty musb-hcd
> >> [    1.855933] usb usb1: SerialNumber: musb-hdrc.0
> >> [    1.866913] hub 1-0:1.0: USB hub found
> >> [    1.871192] hub 1-0:1.0: 1 port detected
> >> [    1.878106] musb-hdrc musb-hdrc.0: USB Host mode controller at
> >> d08c0000 using PIO, IRQ 18	
> >>
> >> ... but no USB functions. Also, every two seconds, the following message is
> >> printed:
> >>
> >> [   11.036608] musb_bus_suspend 2308: trying to suspend as a_wait_vrise
> >> while active
> >> [   13.044811] musb_bus_suspend 2308: trying to suspend as a_wait_vrise
> >> while active
> >> [   15.052196] musb_bus_suspend 2308: trying to suspend as a_wait_vrise
> >> while active
> > 
> > Do you see them even when you connect a device to port?
> 
> Yes. Will investigate more later today. Just wanted to know whether this
> is a typical config problem.
> 

Daniel

I have just pushed the code (V7 which Ravi submitted), so can you please try 
with below branch? 

https://github.com/hvaibhav/am335x-linux/tree/am335x-upstream-staging-usb

Thanks,
Vaibhav
--
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 v7 00/11] usb: musb: adding multi instance support
       [not found]                     ` <79CD15C6BA57404B839C016229A409A83EA7F4A3-Er742YJ7I/eIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
@ 2012-08-03 11:41                       ` Daniel Mack
  2012-08-03 11:48                         ` B, Ravi
                                           ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Daniel Mack @ 2012-08-03 11:41 UTC (permalink / raw)
  To: Hiremath, Vaibhav
  Cc: Ajay Gupta, B, Ravi,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Balbi, Felipe,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org,
	ajayguptaj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

On 03.08.2012 11:07, Hiremath, Vaibhav wrote:
> I have just pushed the code (V7 which Ravi submitted), so can you please try 
> with below branch? 
> 
> https://github.com/hvaibhav/am335x-linux/tree/am335x-upstream-staging-usb

Thanks for doing this, but I'm unfortunately getting tons of merge
conflicts when I try to put this on top of 3.6-rc1. Still pondering
which way around is the easiest to get this solved.

OTOH, I wonder whether your staging branches would need to rebased
sooner or later anyway?


Daniel

--
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 v7 00/11] usb: musb: adding multi instance support
  2012-08-03 11:41                       ` Daniel Mack
@ 2012-08-03 11:48                         ` B, Ravi
  2012-08-03 12:35                         ` Koen Kooi
       [not found]                         ` <501BB8F2.8030909-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2 siblings, 0 replies; 27+ messages in thread
From: B, Ravi @ 2012-08-03 11:48 UTC (permalink / raw)
  To: Daniel Mack, Hiremath, Vaibhav
  Cc: Ajay Gupta, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
	Balbi, Felipe, grant.likely@secretlab.ca,
	devicetree-discuss@lists.ozlabs.org, tony@atomide.com,
	ajayguptaj@gmail.com

 
> On 03.08.2012 11:07, Hiremath, Vaibhav wrote:
> > I have just pushed the code (V7 which Ravi submitted), so can you 
> > please try with below branch?
> > 
> > 
> https://github.com/hvaibhav/am335x-linux/tree/am335x-upstream-staging-
> > usb
> 
> Thanks for doing this, but I'm unfortunately getting tons of 
> merge conflicts when I try to put this on top of 3.6-rc1. 
> Still pondering which way around is the easiest to get this solved.
> 
> OTOH, I wonder whether your staging branches would need to 
> rebased sooner or later anyway?
> 

Sorry, We don't have patches on latest v3.6-rc1 and will take couple of days.

> 
> Daniel
> 
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v7 00/11] usb: musb: adding multi instance support
  2012-08-03 11:41                       ` Daniel Mack
  2012-08-03 11:48                         ` B, Ravi
@ 2012-08-03 12:35                         ` Koen Kooi
       [not found]                         ` <501BB8F2.8030909-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2 siblings, 0 replies; 27+ messages in thread
From: Koen Kooi @ 2012-08-03 12:35 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Hiremath, Vaibhav, Ajay Gupta, B, Ravi, linux-usb@vger.kernel.org,
	linux-omap@vger.kernel.org, Balbi, Felipe,
	grant.likely@secretlab.ca, devicetree-discuss@lists.ozlabs.org,
	tony@atomide.com, ajayguptaj@gmail.com


Op 3 aug. 2012, om 13:41 heeft Daniel Mack <zonque@gmail.com> het volgende geschreven:

> On 03.08.2012 11:07, Hiremath, Vaibhav wrote:
>> I have just pushed the code (V7 which Ravi submitted), so can you please try 
>> with below branch? 
>> 
>> https://github.com/hvaibhav/am335x-linux/tree/am335x-upstream-staging-usb
> 
> Thanks for doing this, but I'm unfortunately getting tons of merge
> conflicts when I try to put this on top of 3.6-rc1. Still pondering
> which way around is the easiest to get this solved.

A number of those patches are already in 3.6rc1 (the first 10 or so). I use this set: 

	https://github.com/beagleboard/kernel/tree/beaglebone-3.6/patches/usb 

Those where pulled from the staging branch and refreshed this morning. Matching git branch (will get rebased):

	https://github.com/koenkooi/linux/commits/beaglebone-3.6-dont-use

That gives me rootfs on USB on beaglebone port1 and g_ether gadget on beaglebone port0. Hopefully this will work on your custom board as well.

regards,

Koen

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH v7 00/11] usb: musb: adding multi instance support
       [not found]                         ` <501BB8F2.8030909-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2012-08-03 15:48                           ` Hiremath, Vaibhav
  2012-08-03 16:01                             ` Koen Kooi
  2012-08-05 19:52                             ` Daniel Mack
  0 siblings, 2 replies; 27+ messages in thread
From: Hiremath, Vaibhav @ 2012-08-03 15:48 UTC (permalink / raw)
  To: Daniel Mack
  Cc: ajayguptaj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, Ajay Gupta,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Balbi, Felipe,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, B, Ravi

On Fri, Aug 03, 2012 at 17:11:38, Daniel Mack wrote:
> On 03.08.2012 11:07, Hiremath, Vaibhav wrote:
> > I have just pushed the code (V7 which Ravi submitted), so can you please try 
> > with below branch? 
> > 
> > https://github.com/hvaibhav/am335x-linux/tree/am335x-upstream-staging-usb
> 
> Thanks for doing this, but I'm unfortunately getting tons of merge
> conflicts when I try to put this on top of 3.6-rc1. Still pondering
> which way around is the easiest to get this solved.
> 
> OTOH, I wonder whether your staging branches would need to rebased
> sooner or later anyway?
> 

I have already pushed branch based on v3.6-rc1 (boot tested),

https://github.com/hvaibhav/am335x-linux/tree/am335x-linux-next-master

Thanks,
Vaibhav

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v7 00/11] usb: musb: adding multi instance support
  2012-08-03 15:48                           ` Hiremath, Vaibhav
@ 2012-08-03 16:01                             ` Koen Kooi
  2012-08-05 19:52                             ` Daniel Mack
  1 sibling, 0 replies; 27+ messages in thread
From: Koen Kooi @ 2012-08-03 16:01 UTC (permalink / raw)
  To: Hiremath, Vaibhav
  Cc: Daniel Mack, Ajay Gupta, B, Ravi, linux-usb@vger.kernel.org,
	linux-omap@vger.kernel.org, Balbi, Felipe,
	grant.likely@secretlab.ca, devicetree-discuss@lists.ozlabs.org,
	tony@atomide.com, ajayguptaj@gmail.com


Op 3 aug. 2012, om 17:48 heeft "Hiremath, Vaibhav" <hvaibhav@ti.com> het volgende geschreven:

> On Fri, Aug 03, 2012 at 17:11:38, Daniel Mack wrote:
>> On 03.08.2012 11:07, Hiremath, Vaibhav wrote:
>>> I have just pushed the code (V7 which Ravi submitted), so can you please try 
>>> with below branch? 
>>> 
>>> https://github.com/hvaibhav/am335x-linux/tree/am335x-upstream-staging-usb
>> 
>> Thanks for doing this, but I'm unfortunately getting tons of merge
>> conflicts when I try to put this on top of 3.6-rc1. Still pondering
>> which way around is the easiest to get this solved.
>> 
>> OTOH, I wonder whether your staging branches would need to rebased
>> sooner or later anyway?
>> 
> 
> I have already pushed branch based on v3.6-rc1 (boot tested),
> 
> https://github.com/hvaibhav/am335x-linux/tree/am335x-linux-next-master

I think Daniel meant without the linux-next stuff in between. E.g. on top of the v3.6-rc1 tag. I can see that such a tree is not of much use for you, since you now need to target the 3.7 merge window for new patches. But I can't and won't speak for both of you :)

regards,

Koen

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v7 00/11] usb: musb: adding multi instance support
  2012-08-03 15:48                           ` Hiremath, Vaibhav
  2012-08-03 16:01                             ` Koen Kooi
@ 2012-08-05 19:52                             ` Daniel Mack
  2012-08-06  6:40                               ` Hiremath, Vaibhav
  1 sibling, 1 reply; 27+ messages in thread
From: Daniel Mack @ 2012-08-05 19:52 UTC (permalink / raw)
  To: Hiremath, Vaibhav
  Cc: Ajay Gupta, B, Ravi, linux-usb@vger.kernel.org,
	linux-omap@vger.kernel.org, Balbi, Felipe,
	grant.likely@secretlab.ca, devicetree-discuss@lists.ozlabs.org,
	tony@atomide.com, ajayguptaj@gmail.com

On 03.08.2012 17:48, Hiremath, Vaibhav wrote:
> On Fri, Aug 03, 2012 at 17:11:38, Daniel Mack wrote:
>> On 03.08.2012 11:07, Hiremath, Vaibhav wrote:
>>> I have just pushed the code (V7 which Ravi submitted), so can you please try 
>>> with below branch? 
>>>
>>> https://github.com/hvaibhav/am335x-linux/tree/am335x-upstream-staging-usb
>>
>> Thanks for doing this, but I'm unfortunately getting tons of merge
>> conflicts when I try to put this on top of 3.6-rc1. Still pondering
>> which way around is the easiest to get this solved.
>>
>> OTOH, I wonder whether your staging branches would need to rebased
>> sooner or later anyway?
>>
> 
> I have already pushed branch based on v3.6-rc1 (boot tested),
> 
> https://github.com/hvaibhav/am335x-linux/tree/am335x-linux-next-master

Sorry, I don't get it yet. Your am335x-linux-next-master can be merged
into v3.6-rc1 without problems, but it doesn't contain Ravi's patches.
And am335x-upstream-staging-usb doesn't apply on top of either
am335x-linux-next-master or v3.6-rc1.

Maybe I just miss a detail here. Could you again explain which branch
will you publish for merging in the 3.7 merge window, and what are its
dependencies?


Thanks for your work,
Daniel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH v7 00/11] usb: musb: adding multi instance support
  2012-08-05 19:52                             ` Daniel Mack
@ 2012-08-06  6:40                               ` Hiremath, Vaibhav
  0 siblings, 0 replies; 27+ messages in thread
From: Hiremath, Vaibhav @ 2012-08-06  6:40 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Ajay Gupta, B, Ravi, linux-usb@vger.kernel.org,
	linux-omap@vger.kernel.org, Balbi, Felipe,
	grant.likely@secretlab.ca, devicetree-discuss@lists.ozlabs.org,
	tony@atomide.com, ajayguptaj@gmail.com

On Mon, Aug 06, 2012 at 01:22:53, Daniel Mack wrote:
> On 03.08.2012 17:48, Hiremath, Vaibhav wrote:
> > On Fri, Aug 03, 2012 at 17:11:38, Daniel Mack wrote:
> >> On 03.08.2012 11:07, Hiremath, Vaibhav wrote:
> >>> I have just pushed the code (V7 which Ravi submitted), so can you please try 
> >>> with below branch? 
> >>>
> >>> https://github.com/hvaibhav/am335x-linux/tree/am335x-upstream-staging-usb
> >>
> >> Thanks for doing this, but I'm unfortunately getting tons of merge
> >> conflicts when I try to put this on top of 3.6-rc1. Still pondering
> >> which way around is the easiest to get this solved.
> >>
> >> OTOH, I wonder whether your staging branches would need to rebased
> >> sooner or later anyway?
> >>
> > 
> > I have already pushed branch based on v3.6-rc1 (boot tested),
> > 
> > https://github.com/hvaibhav/am335x-linux/tree/am335x-linux-next-master
> 
> Sorry, I don't get it yet. Your am335x-linux-next-master can be merged
> into v3.6-rc1 without problems, but it doesn't contain Ravi's patches.
> And am335x-upstream-staging-usb doesn't apply on top of either
> am335x-linux-next-master or v3.6-rc1.
> 
> Maybe I just miss a detail here. Could you again explain which branch
> will you publish for merging in the 3.7 merge window, and what are its
> dependencies?
> 

Daniel,

Every developer is supposed to submit the patches on top of their 
maintainer's repository, which may or may not be in-sync with latest linux-
next or Linus's tree at given time OR their could be some extra dependency 
from framework. For example, linux-omap is still not updated to v3.6-rc1, 
but I have to use linux-omap/master for all patch submissions.

It becomes extra work for each developers to maintain branch for both, one 
against their maintainer HEAD and one against linux-next/master.

So I am just pushing the branch which is being tested/validated (on 
BeagleBone) before submitting patches to the list.

I hope this clarifies all your confusion.

Thanks,
Vaibhav
> 
> Thanks for your work,
> Daniel
> 


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v7 00/11] usb: musb: adding multi instance support
       [not found] ` <1343909574-15633-1-git-send-email-ravibabu-l0cyMroinI0@public.gmane.org>
                     ` (7 preceding siblings ...)
  2012-08-02 22:08   ` [PATCH v7 00/11] usb: musb: adding multi instance support Daniel Mack
@ 2012-08-15 14:39   ` Christopher Harvey
  8 siblings, 0 replies; 27+ messages in thread
From: Christopher Harvey @ 2012-08-15 14:39 UTC (permalink / raw)
  To: Ravi Babu
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	ajayguptaj-Re5JQEeQqe8AvxtiuMwx3w

On Thu, Aug 02, 2012 at 05:42:43PM +0530, Ravi Babu wrote:
> This series of patches adds,
> a) Multi instances support in musb driver
> b) DT support for musb_dsps glue layer
> c) DT support for NOP transceiver
> 
> AM33xx and TI81xx has dual musb controller and has two usb PHY of same type.
> This patch series uses 'phandle' based API devm_usb_get_phy_by_phandle() to
> get the PHY of same type. This API support is being added by Kishon's patch
> discussed at [1]
> 
> The series applies to linux-omap (master branch)
> 	+ Vaibhav baseport patches on his tree at [3]
> 	+ Kishon's multi phy patches on Felipe's branch 'xceiv'
> 	+ Kishon's patch on phandle at [1]
> 	+ AM33xx musb glue compile and bugfix patches at [4], [5], [6] and [7]
> 	+ Damodar's recent patch at [2] 
> 
> and have been tested on Beaglebone board.

Any hints as to if or when this will be applied to the following
repository?

http://arago-project.org/git/projects/linux-omap3.git?p=projects/linux-omap3.git;a=summary

thanks,
Chris
--
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

end of thread, other threads:[~2012-08-15 14:39 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-02 12:12 [PATCH v7 00/11] usb: musb: adding multi instance support Ravi Babu
2012-08-02 12:12 ` [PATCH v7 03/11] usb: musb: am335x: add support for dual instance Ravi Babu
2012-08-02 12:12 ` [PATCH v7 04/11] usb: otg: nop: add support for multiple tranceiver Ravi Babu
     [not found] ` <1343909574-15633-1-git-send-email-ravibabu-l0cyMroinI0@public.gmane.org>
2012-08-02 12:12   ` [PATCH v7 01/11] usb: musb: add musb_ida for multi instance support Ravi Babu
2012-08-02 12:12   ` [PATCH v7 02/11] usb: musb: kill global and static for multi instance Ravi Babu
2012-08-02 12:12   ` [PATCH v7 05/11] usb: musb: dsps: add dt support Ravi Babu
2012-08-02 12:12   ` [PATCH v7 06/11] arm/dts: am33xx: Add dt data for usbss Ravi Babu
2012-08-02 12:12   ` [PATCH v7 08/11] arm/dts: am33xx: add dt data for usb nop phy Ravi Babu
2012-08-02 12:12   ` [PATCH v7 09/11] usb: musb: dsps: remove explicit NOP device creation Ravi Babu
2012-08-02 12:12   ` [PATCH v7 10/11] usb: musb: dsps: get the PHY using phandle api Ravi Babu
2012-08-02 22:08   ` [PATCH v7 00/11] usb: musb: adding multi instance support Daniel Mack
     [not found]     ` <501AFA6B.4010005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-08-03  0:54       ` B, Ravi
     [not found]         ` <6C6B28D4DC342643927BEAFCE8707BF63E9DB6AE-Er742YJ7I/eIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2012-08-03  8:19           ` Daniel Mack
2012-08-03  8:43             ` Ajay Gupta
     [not found]               ` <F20D4CDD972CFA4D89D3A083D2D561967FF1F67DE3-kdsAE/FnitNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-08-03  8:53                 ` B, Ravi
2012-08-03  9:02               ` Daniel Mack
     [not found]                 ` <501B93AB.7050501-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-08-03  9:07                   ` Hiremath, Vaibhav
     [not found]                     ` <79CD15C6BA57404B839C016229A409A83EA7F4A3-Er742YJ7I/eIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2012-08-03 11:41                       ` Daniel Mack
2012-08-03 11:48                         ` B, Ravi
2012-08-03 12:35                         ` Koen Kooi
     [not found]                         ` <501BB8F2.8030909-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-08-03 15:48                           ` Hiremath, Vaibhav
2012-08-03 16:01                             ` Koen Kooi
2012-08-05 19:52                             ` Daniel Mack
2012-08-06  6:40                               ` Hiremath, Vaibhav
2012-08-15 14:39   ` Christopher Harvey
2012-08-02 12:12 ` [PATCH v7 07/11] usb: otg: nop: add dt support Ravi Babu
2012-08-02 12:12 ` [PATCH v7 11/11] arm/dts: am33xx: add phy phandle to usbss Ravi Babu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).