All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/7] support other fsl SoCs with usbmisc + small fixes
@ 2012-11-21 14:06 ` Michael Grzeschik
  0 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 14:06 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

Nearly every SoC from Freescale has this non-core usb registers. This series
adds support for more users of this driver.

This series is based on Peter Chen's work. Its needed to merge his master branch
before applying this series:

https://github.com/hzpeterchen/linux-usb.git

Marc Kleine-Budde (4):
  usb: chipidea: usbmisc: unset global varibale usbmisc on driver
    remove
  usb: chipidea: usbmisc: fix a potential race condition
  usb: chipidea: usbmisc: prepare driver to handle more than one soc
  usb: chipidea: usbmisc: add support for ahb, ipg and per clock

Michael Grzeschik (3):
  usb: chipidea: usbmisc: rename file, struct and functions to
    usbmisc_imx
  usb: chipidea: usbmisc: add mx53 support
  usb: chipidea: usbmisc: add post handling and errata fix for mx25

 .../devicetree/bindings/usb/ci13xxx-imx.txt        |    2 +
 drivers/usb/chipidea/Makefile                      |    2 +-
 drivers/usb/chipidea/ci13xxx_imx.c                 |   12 +
 drivers/usb/chipidea/ci13xxx_imx.h                 |    3 +
 drivers/usb/chipidea/usbmisc_imx.c                 |  282 ++++++++++++++++++++
 drivers/usb/chipidea/usbmisc_imx6q.c               |  162 -----------
 6 files changed, 300 insertions(+), 163 deletions(-)
 create mode 100644 drivers/usb/chipidea/usbmisc_imx.c
 delete mode 100644 drivers/usb/chipidea/usbmisc_imx6q.c

-- 
1.7.10.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	[flat|nested] 54+ messages in thread

* [PATCH v3 0/7] support other fsl SoCs with usbmisc + small fixes
@ 2012-11-21 14:06 ` Michael Grzeschik
  0 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 14:06 UTC (permalink / raw)
  To: linux-arm-kernel

Nearly every SoC from Freescale has this non-core usb registers. This series
adds support for more users of this driver.

This series is based on Peter Chen's work. Its needed to merge his master branch
before applying this series:

https://github.com/hzpeterchen/linux-usb.git

Marc Kleine-Budde (4):
  usb: chipidea: usbmisc: unset global varibale usbmisc on driver
    remove
  usb: chipidea: usbmisc: fix a potential race condition
  usb: chipidea: usbmisc: prepare driver to handle more than one soc
  usb: chipidea: usbmisc: add support for ahb, ipg and per clock

Michael Grzeschik (3):
  usb: chipidea: usbmisc: rename file, struct and functions to
    usbmisc_imx
  usb: chipidea: usbmisc: add mx53 support
  usb: chipidea: usbmisc: add post handling and errata fix for mx25

 .../devicetree/bindings/usb/ci13xxx-imx.txt        |    2 +
 drivers/usb/chipidea/Makefile                      |    2 +-
 drivers/usb/chipidea/ci13xxx_imx.c                 |   12 +
 drivers/usb/chipidea/ci13xxx_imx.h                 |    3 +
 drivers/usb/chipidea/usbmisc_imx.c                 |  282 ++++++++++++++++++++
 drivers/usb/chipidea/usbmisc_imx6q.c               |  162 -----------
 6 files changed, 300 insertions(+), 163 deletions(-)
 create mode 100644 drivers/usb/chipidea/usbmisc_imx.c
 delete mode 100644 drivers/usb/chipidea/usbmisc_imx6q.c

-- 
1.7.10.4

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

* [PATCH v3 1/7] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx
  2012-11-21 14:06 ` Michael Grzeschik
@ 2012-11-21 14:06     ` Michael Grzeschik
  -1 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 14:06 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

This driver will be used for every Freescale SoC which has this misc
memory layout to control the basic usb handling. So better name this
driver, function and struct names in a more generic way.

Reported-by: Fabio Estevam <festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
Changes since v1:
* added Makefile change to be build as well
* moved this patch infront all other

 drivers/usb/chipidea/Makefile                      |    2 +-
 .../chipidea/{usbmisc_imx6q.c => usbmisc_imx.c}    |   38 ++++++++++----------
 2 files changed, 20 insertions(+), 20 deletions(-)
 rename drivers/usb/chipidea/{usbmisc_imx6q.c => usbmisc_imx.c} (75%)

diff --git a/drivers/usb/chipidea/Makefile b/drivers/usb/chipidea/Makefile
index 11f513c..146ecd7 100644
--- a/drivers/usb/chipidea/Makefile
+++ b/drivers/usb/chipidea/Makefile
@@ -17,5 +17,5 @@ ifneq ($(CONFIG_PCI),)
 endif
 
 ifneq ($(CONFIG_OF_DEVICE),)
-	obj-$(CONFIG_USB_CHIPIDEA)	+= ci13xxx_imx.o usbmisc_imx6q.o
+	obj-$(CONFIG_USB_CHIPIDEA)	+= ci13xxx_imx.o usbmisc_imx.o
 endif
diff --git a/drivers/usb/chipidea/usbmisc_imx6q.c b/drivers/usb/chipidea/usbmisc_imx.c
similarity index 75%
rename from drivers/usb/chipidea/usbmisc_imx6q.c
rename to drivers/usb/chipidea/usbmisc_imx.c
index 416e3fc..5da379a 100644
--- a/drivers/usb/chipidea/usbmisc_imx6q.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -21,14 +21,14 @@
 
 #define BM_OVER_CUR_DIS		BIT(7)
 
-struct imx6q_usbmisc {
+struct imx_usbmisc {
 	void __iomem *base;
 	spinlock_t lock;
 	struct clk *clk;
 	struct usbmisc_usb_device usbdev[USB_DEV_MAX];
 };
 
-static struct imx6q_usbmisc *usbmisc;
+static struct imx_usbmisc *usbmisc;
 
 static struct usbmisc_usb_device *get_usbdev(struct device *dev)
 {
@@ -77,15 +77,15 @@ static const struct usbmisc_ops imx6q_usbmisc_ops = {
 	.init = usbmisc_imx6q_init,
 };
 
-static const struct of_device_id usbmisc_imx6q_dt_ids[] = {
+static const struct of_device_id usbmisc_imx_dt_ids[] = {
 	{ .compatible = "fsl,imx6q-usbmisc"},
 	{ /* sentinel */ }
 };
 
-static int __devinit usbmisc_imx6q_probe(struct platform_device *pdev)
+static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
 {
 	struct resource	*res;
-	struct imx6q_usbmisc *data;
+	struct imx_usbmisc *data;
 	int ret;
 
 	if (usbmisc)
@@ -127,36 +127,36 @@ static int __devinit usbmisc_imx6q_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __devexit usbmisc_imx6q_remove(struct platform_device *pdev)
+static int __devexit usbmisc_imx_remove(struct platform_device *pdev)
 {
 	usbmisc_unset_ops(&imx6q_usbmisc_ops);
 	clk_disable_unprepare(usbmisc->clk);
 	return 0;
 }
 
-static struct platform_driver usbmisc_imx6q_driver = {
-	.probe = usbmisc_imx6q_probe,
-	.remove = __devexit_p(usbmisc_imx6q_remove),
+static struct platform_driver usbmisc_imx_driver = {
+	.probe = usbmisc_imx_probe,
+	.remove = __devexit_p(usbmisc_imx_remove),
 	.driver = {
-		.name = "usbmisc_imx6q",
+		.name = "usbmisc_imx",
 		.owner = THIS_MODULE,
-		.of_match_table = usbmisc_imx6q_dt_ids,
+		.of_match_table = usbmisc_imx_dt_ids,
 	 },
 };
 
-int __init usbmisc_imx6q_drv_init(void)
+int __init usbmisc_imx_drv_init(void)
 {
-	return platform_driver_register(&usbmisc_imx6q_driver);
+	return platform_driver_register(&usbmisc_imx_driver);
 }
-subsys_initcall(usbmisc_imx6q_drv_init);
+subsys_initcall(usbmisc_imx_drv_init);
 
-void __exit usbmisc_imx6q_drv_exit(void)
+void __exit usbmisc_imx_drv_exit(void)
 {
-	platform_driver_unregister(&usbmisc_imx6q_driver);
+	platform_driver_unregister(&usbmisc_imx_driver);
 }
-module_exit(usbmisc_imx6q_drv_exit);
+module_exit(usbmisc_imx_drv_exit);
 
-MODULE_ALIAS("platform:usbmisc-imx6q");
+MODULE_ALIAS("platform:usbmisc-imx");
 MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("driver for imx6q usb non-core registers");
+MODULE_DESCRIPTION("driver for imx usb non-core registers");
 MODULE_AUTHOR("Richard Zhao <richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>");
-- 
1.7.10.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] 54+ messages in thread

* [PATCH v3 1/7] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx
@ 2012-11-21 14:06     ` Michael Grzeschik
  0 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 14:06 UTC (permalink / raw)
  To: linux-arm-kernel

This driver will be used for every Freescale SoC which has this misc
memory layout to control the basic usb handling. So better name this
driver, function and struct names in a more generic way.

Reported-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Changes since v1:
* added Makefile change to be build as well
* moved this patch infront all other

 drivers/usb/chipidea/Makefile                      |    2 +-
 .../chipidea/{usbmisc_imx6q.c => usbmisc_imx.c}    |   38 ++++++++++----------
 2 files changed, 20 insertions(+), 20 deletions(-)
 rename drivers/usb/chipidea/{usbmisc_imx6q.c => usbmisc_imx.c} (75%)

diff --git a/drivers/usb/chipidea/Makefile b/drivers/usb/chipidea/Makefile
index 11f513c..146ecd7 100644
--- a/drivers/usb/chipidea/Makefile
+++ b/drivers/usb/chipidea/Makefile
@@ -17,5 +17,5 @@ ifneq ($(CONFIG_PCI),)
 endif
 
 ifneq ($(CONFIG_OF_DEVICE),)
-	obj-$(CONFIG_USB_CHIPIDEA)	+= ci13xxx_imx.o usbmisc_imx6q.o
+	obj-$(CONFIG_USB_CHIPIDEA)	+= ci13xxx_imx.o usbmisc_imx.o
 endif
diff --git a/drivers/usb/chipidea/usbmisc_imx6q.c b/drivers/usb/chipidea/usbmisc_imx.c
similarity index 75%
rename from drivers/usb/chipidea/usbmisc_imx6q.c
rename to drivers/usb/chipidea/usbmisc_imx.c
index 416e3fc..5da379a 100644
--- a/drivers/usb/chipidea/usbmisc_imx6q.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -21,14 +21,14 @@
 
 #define BM_OVER_CUR_DIS		BIT(7)
 
-struct imx6q_usbmisc {
+struct imx_usbmisc {
 	void __iomem *base;
 	spinlock_t lock;
 	struct clk *clk;
 	struct usbmisc_usb_device usbdev[USB_DEV_MAX];
 };
 
-static struct imx6q_usbmisc *usbmisc;
+static struct imx_usbmisc *usbmisc;
 
 static struct usbmisc_usb_device *get_usbdev(struct device *dev)
 {
@@ -77,15 +77,15 @@ static const struct usbmisc_ops imx6q_usbmisc_ops = {
 	.init = usbmisc_imx6q_init,
 };
 
-static const struct of_device_id usbmisc_imx6q_dt_ids[] = {
+static const struct of_device_id usbmisc_imx_dt_ids[] = {
 	{ .compatible = "fsl,imx6q-usbmisc"},
 	{ /* sentinel */ }
 };
 
-static int __devinit usbmisc_imx6q_probe(struct platform_device *pdev)
+static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
 {
 	struct resource	*res;
-	struct imx6q_usbmisc *data;
+	struct imx_usbmisc *data;
 	int ret;
 
 	if (usbmisc)
@@ -127,36 +127,36 @@ static int __devinit usbmisc_imx6q_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __devexit usbmisc_imx6q_remove(struct platform_device *pdev)
+static int __devexit usbmisc_imx_remove(struct platform_device *pdev)
 {
 	usbmisc_unset_ops(&imx6q_usbmisc_ops);
 	clk_disable_unprepare(usbmisc->clk);
 	return 0;
 }
 
-static struct platform_driver usbmisc_imx6q_driver = {
-	.probe = usbmisc_imx6q_probe,
-	.remove = __devexit_p(usbmisc_imx6q_remove),
+static struct platform_driver usbmisc_imx_driver = {
+	.probe = usbmisc_imx_probe,
+	.remove = __devexit_p(usbmisc_imx_remove),
 	.driver = {
-		.name = "usbmisc_imx6q",
+		.name = "usbmisc_imx",
 		.owner = THIS_MODULE,
-		.of_match_table = usbmisc_imx6q_dt_ids,
+		.of_match_table = usbmisc_imx_dt_ids,
 	 },
 };
 
-int __init usbmisc_imx6q_drv_init(void)
+int __init usbmisc_imx_drv_init(void)
 {
-	return platform_driver_register(&usbmisc_imx6q_driver);
+	return platform_driver_register(&usbmisc_imx_driver);
 }
-subsys_initcall(usbmisc_imx6q_drv_init);
+subsys_initcall(usbmisc_imx_drv_init);
 
-void __exit usbmisc_imx6q_drv_exit(void)
+void __exit usbmisc_imx_drv_exit(void)
 {
-	platform_driver_unregister(&usbmisc_imx6q_driver);
+	platform_driver_unregister(&usbmisc_imx_driver);
 }
-module_exit(usbmisc_imx6q_drv_exit);
+module_exit(usbmisc_imx_drv_exit);
 
-MODULE_ALIAS("platform:usbmisc-imx6q");
+MODULE_ALIAS("platform:usbmisc-imx");
 MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("driver for imx6q usb non-core registers");
+MODULE_DESCRIPTION("driver for imx usb non-core registers");
 MODULE_AUTHOR("Richard Zhao <richard.zhao@freescale.com>");
-- 
1.7.10.4

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

* [PATCH v3 2/7] usb: chipidea: usbmisc: unset global varibale usbmisc on driver remove
  2012-11-21 14:06 ` Michael Grzeschik
@ 2012-11-21 14:06     ` Michael Grzeschik
  -1 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 14:06 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

The probe function checks usbmisc to be NULL in the beginning. Without
this patch the can only be loaded once.

Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
Changes since v1:
* split previous patch into two seperate.

 drivers/usb/chipidea/usbmisc_imx.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 5da379a..552c63f 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -131,6 +131,7 @@ static int __devexit usbmisc_imx_remove(struct platform_device *pdev)
 {
 	usbmisc_unset_ops(&imx6q_usbmisc_ops);
 	clk_disable_unprepare(usbmisc->clk);
+	usbmisc = NULL;
 	return 0;
 }
 
-- 
1.7.10.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] 54+ messages in thread

* [PATCH v3 2/7] usb: chipidea: usbmisc: unset global varibale usbmisc on driver remove
@ 2012-11-21 14:06     ` Michael Grzeschik
  0 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 14:06 UTC (permalink / raw)
  To: linux-arm-kernel

From: Marc Kleine-Budde <mkl@pengutronix.de>

The probe function checks usbmisc to be NULL in the beginning. Without
this patch the can only be loaded once.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
Changes since v1:
* split previous patch into two seperate.

 drivers/usb/chipidea/usbmisc_imx.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 5da379a..552c63f 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -131,6 +131,7 @@ static int __devexit usbmisc_imx_remove(struct platform_device *pdev)
 {
 	usbmisc_unset_ops(&imx6q_usbmisc_ops);
 	clk_disable_unprepare(usbmisc->clk);
+	usbmisc = NULL;
 	return 0;
 }
 
-- 
1.7.10.4

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

* [PATCH v3 3/7] usb: chipidea: usbmisc: fix a potential race condition
  2012-11-21 14:06 ` Michael Grzeschik
@ 2012-11-21 14:06     ` Michael Grzeschik
  -1 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 14:06 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

This fixes a potential race condition where the ci13xxx_imx glue code
could be fast enough to call one of the usbmisc_ops before he got a
valid value on the static usbmisc pointer. To fix that we first set
usbmisc, then call usbmisc_set_ops().

Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
Changes since v1:
* split previous patch into two seperate.

 drivers/usb/chipidea/usbmisc_imx.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 552c63f..9145e04 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -116,14 +116,14 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
 		return ret;
 	}
 
+	usbmisc = data;
 	ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
 	if (ret) {
+		usbmisc = NULL;
 		clk_disable_unprepare(data->clk);
 		return ret;
 	}
 
-	usbmisc = data;

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

* [PATCH v3 3/7] usb: chipidea: usbmisc: fix a potential race condition
@ 2012-11-21 14:06     ` Michael Grzeschik
  0 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 14:06 UTC (permalink / raw)
  To: linux-arm-kernel

From: Marc Kleine-Budde <mkl@pengutronix.de>

This fixes a potential race condition where the ci13xxx_imx glue code
could be fast enough to call one of the usbmisc_ops before he got a
valid value on the static usbmisc pointer. To fix that we first set
usbmisc, then call usbmisc_set_ops().

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
Changes since v1:
* split previous patch into two seperate.

 drivers/usb/chipidea/usbmisc_imx.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 552c63f..9145e04 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -116,14 +116,14 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
 		return ret;
 	}
 
+	usbmisc = data;
 	ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
 	if (ret) {
+		usbmisc = NULL;
 		clk_disable_unprepare(data->clk);
 		return ret;
 	}
 
-	usbmisc = data;
-
 	return 0;
 }
 
-- 
1.7.10.4

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

* [PATCH v3 4/7] usb: chipidea: usbmisc: prepare driver to handle more than one soc
  2012-11-21 14:06 ` Michael Grzeschik
@ 2012-11-21 14:06     ` Michael Grzeschik
  -1 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 14:06 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

This attaches the usbmisc_ops to the of_device_id data and
makes it possible to define special functions per soc.

Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
Changes since v2:
* renamed bitmask to reflect soctype mx6

 drivers/usb/chipidea/usbmisc_imx.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 9145e04..d0c7a03 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -19,13 +19,14 @@
 
 #define USB_DEV_MAX 4
 
-#define BM_OVER_CUR_DIS		BIT(7)
+#define MX6_BM_OVER_CUR_DIS		BIT(7)
 
 struct imx_usbmisc {
 	void __iomem *base;
 	spinlock_t lock;
 	struct clk *clk;
 	struct usbmisc_usb_device usbdev[USB_DEV_MAX];
+	const struct usbmisc_ops *ops;
 };
 
 static struct imx_usbmisc *usbmisc;
@@ -65,7 +66,7 @@ static int usbmisc_imx6q_init(struct device *dev)
 	if (usbdev->disable_oc) {
 		spin_lock_irqsave(&usbmisc->lock, flags);
 		reg = readl(usbmisc->base + usbdev->index * 4);
-		writel(reg | BM_OVER_CUR_DIS,
+		writel(reg | MX6_BM_OVER_CUR_DIS,
 			usbmisc->base + usbdev->index * 4);
 		spin_unlock_irqrestore(&usbmisc->lock, flags);
 	}
@@ -78,7 +79,7 @@ static const struct usbmisc_ops imx6q_usbmisc_ops = {
 };
 
 static const struct of_device_id usbmisc_imx_dt_ids[] = {
-	{ .compatible = "fsl,imx6q-usbmisc"},
+	{ .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
 	{ /* sentinel */ }
 };
 
@@ -87,6 +88,7 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
 	struct resource	*res;
 	struct imx_usbmisc *data;
 	int ret;
+	struct of_device_id *tmp_dev;
 
 	if (usbmisc)
 		return -EBUSY;
@@ -116,8 +118,11 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
 		return ret;
 	}
 
+	tmp_dev = (struct of_device_id *)
+		of_match_device(usbmisc_imx_dt_ids, &pdev->dev);
+	data->ops = (const struct usbmisc_ops *)tmp_dev->data;
 	usbmisc = data;
-	ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
+	ret = usbmisc_set_ops(data->ops);
 	if (ret) {
 		usbmisc = NULL;
 		clk_disable_unprepare(data->clk);
@@ -129,7 +134,7 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
 
 static int __devexit usbmisc_imx_remove(struct platform_device *pdev)
 {
-	usbmisc_unset_ops(&imx6q_usbmisc_ops);
+	usbmisc_unset_ops(usbmisc->ops);
 	clk_disable_unprepare(usbmisc->clk);
 	usbmisc = NULL;
 	return 0;
-- 
1.7.10.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] 54+ messages in thread

* [PATCH v3 4/7] usb: chipidea: usbmisc: prepare driver to handle more than one soc
@ 2012-11-21 14:06     ` Michael Grzeschik
  0 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 14:06 UTC (permalink / raw)
  To: linux-arm-kernel

From: Marc Kleine-Budde <mkl@pengutronix.de>

This attaches the usbmisc_ops to the of_device_id data and
makes it possible to define special functions per soc.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
Changes since v2:
* renamed bitmask to reflect soctype mx6

 drivers/usb/chipidea/usbmisc_imx.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 9145e04..d0c7a03 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -19,13 +19,14 @@
 
 #define USB_DEV_MAX 4
 
-#define BM_OVER_CUR_DIS		BIT(7)
+#define MX6_BM_OVER_CUR_DIS		BIT(7)
 
 struct imx_usbmisc {
 	void __iomem *base;
 	spinlock_t lock;
 	struct clk *clk;
 	struct usbmisc_usb_device usbdev[USB_DEV_MAX];
+	const struct usbmisc_ops *ops;
 };
 
 static struct imx_usbmisc *usbmisc;
@@ -65,7 +66,7 @@ static int usbmisc_imx6q_init(struct device *dev)
 	if (usbdev->disable_oc) {
 		spin_lock_irqsave(&usbmisc->lock, flags);
 		reg = readl(usbmisc->base + usbdev->index * 4);
-		writel(reg | BM_OVER_CUR_DIS,
+		writel(reg | MX6_BM_OVER_CUR_DIS,
 			usbmisc->base + usbdev->index * 4);
 		spin_unlock_irqrestore(&usbmisc->lock, flags);
 	}
@@ -78,7 +79,7 @@ static const struct usbmisc_ops imx6q_usbmisc_ops = {
 };
 
 static const struct of_device_id usbmisc_imx_dt_ids[] = {
-	{ .compatible = "fsl,imx6q-usbmisc"},
+	{ .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
 	{ /* sentinel */ }
 };
 
@@ -87,6 +88,7 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
 	struct resource	*res;
 	struct imx_usbmisc *data;
 	int ret;
+	struct of_device_id *tmp_dev;
 
 	if (usbmisc)
 		return -EBUSY;
@@ -116,8 +118,11 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
 		return ret;
 	}
 
+	tmp_dev = (struct of_device_id *)
+		of_match_device(usbmisc_imx_dt_ids, &pdev->dev);
+	data->ops = (const struct usbmisc_ops *)tmp_dev->data;
 	usbmisc = data;
-	ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
+	ret = usbmisc_set_ops(data->ops);
 	if (ret) {
 		usbmisc = NULL;
 		clk_disable_unprepare(data->clk);
@@ -129,7 +134,7 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
 
 static int __devexit usbmisc_imx_remove(struct platform_device *pdev)
 {
-	usbmisc_unset_ops(&imx6q_usbmisc_ops);
+	usbmisc_unset_ops(usbmisc->ops);
 	clk_disable_unprepare(usbmisc->clk);
 	usbmisc = NULL;
 	return 0;
-- 
1.7.10.4

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

* [PATCH v3 5/7] usb: chipidea: usbmisc: add support for ahb, ipg and per clock
  2012-11-21 14:06 ` Michael Grzeschik
@ 2012-11-21 14:06     ` Michael Grzeschik
  -1 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 14:06 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

This patch adds support for a second and third clock to the usbmisc driver. On
modern freescale ARM cores like the imx51, imx53 and imx6q three clocks ("ahb",
"ipg" and "per") must be enabled in order to access the USB core.

ahb - AMBA High-Performance Bus clock domain
ipg - IP-Bus Gate clock domain
per - Peripheral clock domain

Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
Changes since v1:
* changed patch description

 drivers/usb/chipidea/usbmisc_imx.c |   60 +++++++++++++++++++++++++++---------
 1 file changed, 45 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index d0c7a03..e090e0f 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -24,7 +24,9 @@
 struct imx_usbmisc {
 	void __iomem *base;
 	spinlock_t lock;
-	struct clk *clk;
+	struct clk *clk_ahb;
+	struct clk *clk_ipg;
+	struct clk *clk_per;
 	struct usbmisc_usb_device usbdev[USB_DEV_MAX];
 	const struct usbmisc_ops *ops;
 };
@@ -104,38 +106,66 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
 	if (!data->base)
 		return -EADDRNOTAVAIL;
 
-	data->clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(data->clk)) {
+	data->clk_ahb = devm_clk_get(&pdev->dev, "ahb");
+	if (IS_ERR(data->clk_ahb)) {
 		dev_err(&pdev->dev,
-			"failed to get clock, err=%ld\n", PTR_ERR(data->clk));
-		return PTR_ERR(data->clk);
+			"failed to get ahb clock, err=%ld\n", PTR_ERR(data->clk_ahb));
+		return PTR_ERR(data->clk_ahb);
 	}
 
-	ret = clk_prepare_enable(data->clk);
-	if (ret) {
+	data->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
+	if (IS_ERR(data->clk_ipg)) {
 		dev_err(&pdev->dev,
-			"clk_prepare_enable failed, err=%d\n", ret);
-		return ret;
+			"failed to get ipg clock, err=%ld\n", PTR_ERR(data->clk_ipg));
+		return PTR_ERR(data->clk_ipg);
 	}
 
+	data->clk_per = devm_clk_get(&pdev->dev, "per");
+	if (IS_ERR(data->clk_per)) {
+		dev_err(&pdev->dev,
+			"failed to get per clock, err=%ld\n", PTR_ERR(data->clk_per));
+		return PTR_ERR(data->clk_per);
+	}
+
+	ret = clk_prepare_enable(data->clk_ahb);
+	if (ret)
+		return ret;
+
+	ret = clk_prepare_enable(data->clk_ipg);
+	if (ret)
+		goto err_ipg_failed;
+
+	ret = clk_prepare_enable(data->clk_per);
+	if (ret)
+		goto err_per_failed;
+
 	tmp_dev = (struct of_device_id *)
 		of_match_device(usbmisc_imx_dt_ids, &pdev->dev);
 	data->ops = (const struct usbmisc_ops *)tmp_dev->data;
 	usbmisc = data;
 	ret = usbmisc_set_ops(data->ops);
-	if (ret) {
-		usbmisc = NULL;
-		clk_disable_unprepare(data->clk);
-		return ret;
-	}
+	if (ret)
+		goto err_set_ops_failed;
 
 	return 0;
+
+ err_set_ops_failed:
+	usbmisc = NULL;
+	clk_disable_unprepare(data->clk_per);
+ err_per_failed:
+	clk_disable_unprepare(data->clk_ipg);
+ err_ipg_failed:
+	clk_disable_unprepare(data->clk_ahb);
+
+	return ret;
 }
 
 static int __devexit usbmisc_imx_remove(struct platform_device *pdev)
 {
 	usbmisc_unset_ops(usbmisc->ops);
-	clk_disable_unprepare(usbmisc->clk);
+	clk_disable_unprepare(usbmisc->clk_per);
+	clk_disable_unprepare(usbmisc->clk_ipg);
+	clk_disable_unprepare(usbmisc->clk_ahb);
 	usbmisc = NULL;
 	return 0;
 }
-- 
1.7.10.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] 54+ messages in thread

* [PATCH v3 5/7] usb: chipidea: usbmisc: add support for ahb, ipg and per clock
@ 2012-11-21 14:06     ` Michael Grzeschik
  0 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 14:06 UTC (permalink / raw)
  To: linux-arm-kernel

From: Marc Kleine-Budde <mkl@pengutronix.de>

This patch adds support for a second and third clock to the usbmisc driver. On
modern freescale ARM cores like the imx51, imx53 and imx6q three clocks ("ahb",
"ipg" and "per") must be enabled in order to access the USB core.

ahb - AMBA High-Performance Bus clock domain
ipg - IP-Bus Gate clock domain
per - Peripheral clock domain

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
Changes since v1:
* changed patch description

 drivers/usb/chipidea/usbmisc_imx.c |   60 +++++++++++++++++++++++++++---------
 1 file changed, 45 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index d0c7a03..e090e0f 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -24,7 +24,9 @@
 struct imx_usbmisc {
 	void __iomem *base;
 	spinlock_t lock;
-	struct clk *clk;
+	struct clk *clk_ahb;
+	struct clk *clk_ipg;
+	struct clk *clk_per;
 	struct usbmisc_usb_device usbdev[USB_DEV_MAX];
 	const struct usbmisc_ops *ops;
 };
@@ -104,38 +106,66 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
 	if (!data->base)
 		return -EADDRNOTAVAIL;
 
-	data->clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(data->clk)) {
+	data->clk_ahb = devm_clk_get(&pdev->dev, "ahb");
+	if (IS_ERR(data->clk_ahb)) {
 		dev_err(&pdev->dev,
-			"failed to get clock, err=%ld\n", PTR_ERR(data->clk));
-		return PTR_ERR(data->clk);
+			"failed to get ahb clock, err=%ld\n", PTR_ERR(data->clk_ahb));
+		return PTR_ERR(data->clk_ahb);
 	}
 
-	ret = clk_prepare_enable(data->clk);
-	if (ret) {
+	data->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
+	if (IS_ERR(data->clk_ipg)) {
 		dev_err(&pdev->dev,
-			"clk_prepare_enable failed, err=%d\n", ret);
-		return ret;
+			"failed to get ipg clock, err=%ld\n", PTR_ERR(data->clk_ipg));
+		return PTR_ERR(data->clk_ipg);
 	}
 
+	data->clk_per = devm_clk_get(&pdev->dev, "per");
+	if (IS_ERR(data->clk_per)) {
+		dev_err(&pdev->dev,
+			"failed to get per clock, err=%ld\n", PTR_ERR(data->clk_per));
+		return PTR_ERR(data->clk_per);
+	}
+
+	ret = clk_prepare_enable(data->clk_ahb);
+	if (ret)
+		return ret;
+
+	ret = clk_prepare_enable(data->clk_ipg);
+	if (ret)
+		goto err_ipg_failed;
+
+	ret = clk_prepare_enable(data->clk_per);
+	if (ret)
+		goto err_per_failed;
+
 	tmp_dev = (struct of_device_id *)
 		of_match_device(usbmisc_imx_dt_ids, &pdev->dev);
 	data->ops = (const struct usbmisc_ops *)tmp_dev->data;
 	usbmisc = data;
 	ret = usbmisc_set_ops(data->ops);
-	if (ret) {
-		usbmisc = NULL;
-		clk_disable_unprepare(data->clk);
-		return ret;
-	}
+	if (ret)
+		goto err_set_ops_failed;
 
 	return 0;
+
+ err_set_ops_failed:
+	usbmisc = NULL;
+	clk_disable_unprepare(data->clk_per);
+ err_per_failed:
+	clk_disable_unprepare(data->clk_ipg);
+ err_ipg_failed:
+	clk_disable_unprepare(data->clk_ahb);
+
+	return ret;
 }
 
 static int __devexit usbmisc_imx_remove(struct platform_device *pdev)
 {
 	usbmisc_unset_ops(usbmisc->ops);
-	clk_disable_unprepare(usbmisc->clk);
+	clk_disable_unprepare(usbmisc->clk_per);
+	clk_disable_unprepare(usbmisc->clk_ipg);
+	clk_disable_unprepare(usbmisc->clk_ahb);
 	usbmisc = NULL;
 	return 0;
 }
-- 
1.7.10.4

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

* [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
  2012-11-21 14:06 ` Michael Grzeschik
@ 2012-11-21 14:06     ` Michael Grzeschik
  -1 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 14:06 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

This adds mx53 as the next user of the usbmisc driver and makes it
possible to disable the overcurrent-detection of the internal phy.

Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
Changes since v2:
* added defines for register offsets and bitmasks
* fixed disable_oc option for all ports

 drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index e090e0f..b1811df 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -19,6 +19,13 @@
 
 #define USB_DEV_MAX 4
 
+#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
+#define MX53_USB_UH2_CTRL_OFFSET	0x14;
+#define MX53_USB_UH3_CTRL_OFFSET	0x18;
+#define MX53_BM_OVER_CUR_DIS_H1		BIT(5)
+#define MX53_BM_OVER_CUR_DIS_OTG	BIT(8)
+#define MX53_BM_OVER_CUR_DIS_UHx	BIT(30)
+
 #define MX6_BM_OVER_CUR_DIS		BIT(7)
 
 struct imx_usbmisc {
@@ -54,6 +61,45 @@ static struct usbmisc_usb_device *get_usbdev(struct device *dev)
 	return &usbmisc->usbdev[i];
 }
 
+static int usbmisc_imx53_init(struct device *dev)
+{
+	struct usbmisc_usb_device *usbdev;
+	void __iomem *reg;
+	unsigned long flags;
+	u32 val;
+
+	usbdev = get_usbdev(dev);
+	if (IS_ERR(usbdev))
+		return PTR_ERR(usbdev);
+
+	if (usbdev->disable_oc) {
+		spin_lock_irqsave(&usbmisc->lock, flags);
+		switch (usbdev->index) {
+		case 0:
+			reg = usbmisc->base + MX53_USB_OTG_PHY_CTRL_0_OFFSET;
+			val = readl(reg) | MX53_BM_OVER_CUR_DIS_OTG;
+			break;
+		case 1:
+			reg = usbmisc->base + MX53_USB_OTG_PHY_CTRL_0_OFFSET;
+			val = readl(reg) | MX53_BM_OVER_CUR_DIS_H1;
+			break;
+		case 2:
+			reg = usbmisc->base + MX53_USB_UH2_CTRL_OFFSET;
+			val = readl(reg) | MX53_BM_OVER_CUR_DIS_UHx;
+			break;
+		case 3:
+			reg = usbmisc->base + MX53_USB_UH3_CTRL_OFFSET;
+			val = readl(reg) | MX53_BM_OVER_CUR_DIS_UHx;
+			break;
+		}
+		if (reg && val)
+			writel(val, reg);
+		spin_unlock_irqrestore(&usbmisc->lock, flags);
+	}
+
+	return 0;
+}
+
 static int usbmisc_imx6q_init(struct device *dev)
 {
 
@@ -76,11 +122,16 @@ static int usbmisc_imx6q_init(struct device *dev)
 	return 0;
 }
 
+static const struct usbmisc_ops imx53_usbmisc_ops = {
+	.init = usbmisc_imx53_init,
+};
+
 static const struct usbmisc_ops imx6q_usbmisc_ops = {
 	.init = usbmisc_imx6q_init,
 };
 
 static const struct of_device_id usbmisc_imx_dt_ids[] = {
+	{ .compatible = "fsl,imx53-usbmisc", .data = (void *)&imx53_usbmisc_ops },
 	{ .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
 	{ /* sentinel */ }
 };
-- 
1.7.10.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] 54+ messages in thread

* [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
@ 2012-11-21 14:06     ` Michael Grzeschik
  0 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 14:06 UTC (permalink / raw)
  To: linux-arm-kernel

This adds mx53 as the next user of the usbmisc driver and makes it
possible to disable the overcurrent-detection of the internal phy.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Changes since v2:
* added defines for register offsets and bitmasks
* fixed disable_oc option for all ports

 drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index e090e0f..b1811df 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -19,6 +19,13 @@
 
 #define USB_DEV_MAX 4
 
+#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
+#define MX53_USB_UH2_CTRL_OFFSET	0x14;
+#define MX53_USB_UH3_CTRL_OFFSET	0x18;
+#define MX53_BM_OVER_CUR_DIS_H1		BIT(5)
+#define MX53_BM_OVER_CUR_DIS_OTG	BIT(8)
+#define MX53_BM_OVER_CUR_DIS_UHx	BIT(30)
+
 #define MX6_BM_OVER_CUR_DIS		BIT(7)
 
 struct imx_usbmisc {
@@ -54,6 +61,45 @@ static struct usbmisc_usb_device *get_usbdev(struct device *dev)
 	return &usbmisc->usbdev[i];
 }
 
+static int usbmisc_imx53_init(struct device *dev)
+{
+	struct usbmisc_usb_device *usbdev;
+	void __iomem *reg;
+	unsigned long flags;
+	u32 val;
+
+	usbdev = get_usbdev(dev);
+	if (IS_ERR(usbdev))
+		return PTR_ERR(usbdev);
+
+	if (usbdev->disable_oc) {
+		spin_lock_irqsave(&usbmisc->lock, flags);
+		switch (usbdev->index) {
+		case 0:
+			reg = usbmisc->base + MX53_USB_OTG_PHY_CTRL_0_OFFSET;
+			val = readl(reg) | MX53_BM_OVER_CUR_DIS_OTG;
+			break;
+		case 1:
+			reg = usbmisc->base + MX53_USB_OTG_PHY_CTRL_0_OFFSET;
+			val = readl(reg) | MX53_BM_OVER_CUR_DIS_H1;
+			break;
+		case 2:
+			reg = usbmisc->base + MX53_USB_UH2_CTRL_OFFSET;
+			val = readl(reg) | MX53_BM_OVER_CUR_DIS_UHx;
+			break;
+		case 3:
+			reg = usbmisc->base + MX53_USB_UH3_CTRL_OFFSET;
+			val = readl(reg) | MX53_BM_OVER_CUR_DIS_UHx;
+			break;
+		}
+		if (reg && val)
+			writel(val, reg);
+		spin_unlock_irqrestore(&usbmisc->lock, flags);
+	}
+
+	return 0;
+}
+
 static int usbmisc_imx6q_init(struct device *dev)
 {
 
@@ -76,11 +122,16 @@ static int usbmisc_imx6q_init(struct device *dev)
 	return 0;
 }
 
+static const struct usbmisc_ops imx53_usbmisc_ops = {
+	.init = usbmisc_imx53_init,
+};
+
 static const struct usbmisc_ops imx6q_usbmisc_ops = {
 	.init = usbmisc_imx6q_init,
 };
 
 static const struct of_device_id usbmisc_imx_dt_ids[] = {
+	{ .compatible = "fsl,imx53-usbmisc", .data = (void *)&imx53_usbmisc_ops },
 	{ .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
 	{ /* sentinel */ }
 };
-- 
1.7.10.4

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

* [PATCH v3 7/7] usb: chipidea: usbmisc: add post handling and errata fix for mx25
  2012-11-21 14:06 ` Michael Grzeschik
@ 2012-11-21 14:06     ` Michael Grzeschik
  -1 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 14:06 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

This adds a post handling routine which is called after
ci13xxx_add_device was called. The first user is the mx25, which has to
disable the external-vbus-divider after the ude has started.

Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
Changes since v2:
* added defines for register offsets and bitmasks

 .../devicetree/bindings/usb/ci13xxx-imx.txt        |    2 ++
 drivers/usb/chipidea/ci13xxx_imx.c                 |   12 +++++++
 drivers/usb/chipidea/ci13xxx_imx.h                 |    3 ++
 drivers/usb/chipidea/usbmisc_imx.c                 |   33 ++++++++++++++++++++
 4 files changed, 50 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
index 5778b9c..1c04a4c 100644
--- a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
+++ b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
@@ -11,6 +11,7 @@ Optional properties:
   that indicate usb controller index
 - vbus-supply: regulator for vbus
 - disable-over-current: disable over current detect
+- external-vbus-divider: enables off-chip resistor divider for Vbus
 
 Examples:
 usb@02184000 { /* USB OTG */
@@ -20,4 +21,5 @@ usb@02184000 { /* USB OTG */
 	fsl,usbphy = <&usbphy1>;
 	fsl,usbmisc = <&usbmisc 0>;
 	disable-over-current;
+	external-vbus-divider;
 };
diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
index 935de97..d346c99 100644
--- a/drivers/usb/chipidea/ci13xxx_imx.c
+++ b/drivers/usb/chipidea/ci13xxx_imx.c
@@ -79,6 +79,9 @@ int usbmisc_get_init_data(struct device *dev, struct usbmisc_usb_device *usbdev)
 	if (of_find_property(np, "disable-over-current", NULL))
 		usbdev->disable_oc = 1;
 
+	if (of_find_property(np, "external-vbus-divider", NULL))
+		usbdev->evdo = 1;
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(usbmisc_get_init_data);
@@ -213,6 +216,15 @@ static int __devinit ci13xxx_imx_probe(struct platform_device *pdev)
 		goto put_np;
 	}
 
+	if (usbmisc_ops && usbmisc_ops->post) {
+		ret = usbmisc_ops->post(&pdev->dev);
+		if (ret) {
+			dev_err(&pdev->dev,
+				"usbmisc post failed, ret=%d\n", ret);
+			goto put_np;
+		}
+	}
+
 	data->ci_pdev = plat_ci;
 	platform_set_drvdata(pdev, data);
 
diff --git a/drivers/usb/chipidea/ci13xxx_imx.h b/drivers/usb/chipidea/ci13xxx_imx.h
index 2e88acc..d065273 100644
--- a/drivers/usb/chipidea/ci13xxx_imx.h
+++ b/drivers/usb/chipidea/ci13xxx_imx.h
@@ -13,6 +13,8 @@
 struct usbmisc_ops {
 	/* It's called once when probe a usb device */
 	int (*init)(struct device *dev);
+	/* It's called once after adding a usb device */
+	int (*post)(struct device *dev);
 };
 
 struct usbmisc_usb_device {
@@ -20,6 +22,7 @@ struct usbmisc_usb_device {
 	int index;
 
 	int disable_oc:1; /* over current detect disabled */
+	int evdo:1; /* set external vbus divider option */
 };
 
 int usbmisc_set_ops(const struct usbmisc_ops *ops);
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index b1811df..8c947c1 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -14,11 +14,15 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/io.h>
+#include <linux/delay.h>
 
 #include "ci13xxx_imx.h"
 
 #define USB_DEV_MAX 4
 
+#define MX25_USB_PHY_CTRL_OFFSET	0x08;
+#define MX25_BM_EXTERNAL_VBUS_DIVIDER	BIT(23)
+
 #define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
 #define MX53_USB_UH2_CTRL_OFFSET	0x14;
 #define MX53_USB_UH3_CTRL_OFFSET	0x18;
@@ -61,6 +65,30 @@ static struct usbmisc_usb_device *get_usbdev(struct device *dev)
 	return &usbmisc->usbdev[i];
 }
 
+static int usbmisc_imx25_post(struct device *dev)
+{
+	struct usbmisc_usb_device *usbdev;
+	void __iomem *reg;
+	unsigned long flags;
+	u32 val;
+
+	usbdev = get_usbdev(dev);
+	if (IS_ERR(usbdev))
+		return PTR_ERR(usbdev);
+
+	reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET;
+
+	if (usbdev->evdo) {
+		spin_lock_irqsave(&usbmisc->lock, flags);
+		val = readl(reg);
+		writel(val | MX25_BM_EXTERNAL_VBUS_DIVIDER, reg);
+		spin_unlock_irqrestore(&usbmisc->lock, flags);
+		mdelay(5); /* needed to stabilize voltage */
+	}
+
+	return 0;
+}
+
 static int usbmisc_imx53_init(struct device *dev)
 {
 	struct usbmisc_usb_device *usbdev;
@@ -122,6 +150,10 @@ static int usbmisc_imx6q_init(struct device *dev)
 	return 0;
 }
 
+static const struct usbmisc_ops imx25_usbmisc_ops = {
+	.post = usbmisc_imx25_post,
+};
+
 static const struct usbmisc_ops imx53_usbmisc_ops = {
 	.init = usbmisc_imx53_init,
 };
@@ -131,6 +163,7 @@ static const struct usbmisc_ops imx6q_usbmisc_ops = {
 };
 
 static const struct of_device_id usbmisc_imx_dt_ids[] = {
+	{ .compatible = "fsl,imx25-usbmisc", .data = (void *)&imx25_usbmisc_ops },
 	{ .compatible = "fsl,imx53-usbmisc", .data = (void *)&imx53_usbmisc_ops },
 	{ .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
 	{ /* sentinel */ }
-- 
1.7.10.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] 54+ messages in thread

* [PATCH v3 7/7] usb: chipidea: usbmisc: add post handling and errata fix for mx25
@ 2012-11-21 14:06     ` Michael Grzeschik
  0 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 14:06 UTC (permalink / raw)
  To: linux-arm-kernel

This adds a post handling routine which is called after
ci13xxx_add_device was called. The first user is the mx25, which has to
disable the external-vbus-divider after the ude has started.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Changes since v2:
* added defines for register offsets and bitmasks

 .../devicetree/bindings/usb/ci13xxx-imx.txt        |    2 ++
 drivers/usb/chipidea/ci13xxx_imx.c                 |   12 +++++++
 drivers/usb/chipidea/ci13xxx_imx.h                 |    3 ++
 drivers/usb/chipidea/usbmisc_imx.c                 |   33 ++++++++++++++++++++
 4 files changed, 50 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
index 5778b9c..1c04a4c 100644
--- a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
+++ b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
@@ -11,6 +11,7 @@ Optional properties:
   that indicate usb controller index
 - vbus-supply: regulator for vbus
 - disable-over-current: disable over current detect
+- external-vbus-divider: enables off-chip resistor divider for Vbus
 
 Examples:
 usb at 02184000 { /* USB OTG */
@@ -20,4 +21,5 @@ usb at 02184000 { /* USB OTG */
 	fsl,usbphy = <&usbphy1>;
 	fsl,usbmisc = <&usbmisc 0>;
 	disable-over-current;
+	external-vbus-divider;
 };
diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
index 935de97..d346c99 100644
--- a/drivers/usb/chipidea/ci13xxx_imx.c
+++ b/drivers/usb/chipidea/ci13xxx_imx.c
@@ -79,6 +79,9 @@ int usbmisc_get_init_data(struct device *dev, struct usbmisc_usb_device *usbdev)
 	if (of_find_property(np, "disable-over-current", NULL))
 		usbdev->disable_oc = 1;
 
+	if (of_find_property(np, "external-vbus-divider", NULL))
+		usbdev->evdo = 1;
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(usbmisc_get_init_data);
@@ -213,6 +216,15 @@ static int __devinit ci13xxx_imx_probe(struct platform_device *pdev)
 		goto put_np;
 	}
 
+	if (usbmisc_ops && usbmisc_ops->post) {
+		ret = usbmisc_ops->post(&pdev->dev);
+		if (ret) {
+			dev_err(&pdev->dev,
+				"usbmisc post failed, ret=%d\n", ret);
+			goto put_np;
+		}
+	}
+
 	data->ci_pdev = plat_ci;
 	platform_set_drvdata(pdev, data);
 
diff --git a/drivers/usb/chipidea/ci13xxx_imx.h b/drivers/usb/chipidea/ci13xxx_imx.h
index 2e88acc..d065273 100644
--- a/drivers/usb/chipidea/ci13xxx_imx.h
+++ b/drivers/usb/chipidea/ci13xxx_imx.h
@@ -13,6 +13,8 @@
 struct usbmisc_ops {
 	/* It's called once when probe a usb device */
 	int (*init)(struct device *dev);
+	/* It's called once after adding a usb device */
+	int (*post)(struct device *dev);
 };
 
 struct usbmisc_usb_device {
@@ -20,6 +22,7 @@ struct usbmisc_usb_device {
 	int index;
 
 	int disable_oc:1; /* over current detect disabled */
+	int evdo:1; /* set external vbus divider option */
 };
 
 int usbmisc_set_ops(const struct usbmisc_ops *ops);
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index b1811df..8c947c1 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -14,11 +14,15 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/io.h>
+#include <linux/delay.h>
 
 #include "ci13xxx_imx.h"
 
 #define USB_DEV_MAX 4
 
+#define MX25_USB_PHY_CTRL_OFFSET	0x08;
+#define MX25_BM_EXTERNAL_VBUS_DIVIDER	BIT(23)
+
 #define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
 #define MX53_USB_UH2_CTRL_OFFSET	0x14;
 #define MX53_USB_UH3_CTRL_OFFSET	0x18;
@@ -61,6 +65,30 @@ static struct usbmisc_usb_device *get_usbdev(struct device *dev)
 	return &usbmisc->usbdev[i];
 }
 
+static int usbmisc_imx25_post(struct device *dev)
+{
+	struct usbmisc_usb_device *usbdev;
+	void __iomem *reg;
+	unsigned long flags;
+	u32 val;
+
+	usbdev = get_usbdev(dev);
+	if (IS_ERR(usbdev))
+		return PTR_ERR(usbdev);
+
+	reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET;
+
+	if (usbdev->evdo) {
+		spin_lock_irqsave(&usbmisc->lock, flags);
+		val = readl(reg);
+		writel(val | MX25_BM_EXTERNAL_VBUS_DIVIDER, reg);
+		spin_unlock_irqrestore(&usbmisc->lock, flags);
+		mdelay(5); /* needed to stabilize voltage */
+	}
+
+	return 0;
+}
+
 static int usbmisc_imx53_init(struct device *dev)
 {
 	struct usbmisc_usb_device *usbdev;
@@ -122,6 +150,10 @@ static int usbmisc_imx6q_init(struct device *dev)
 	return 0;
 }
 
+static const struct usbmisc_ops imx25_usbmisc_ops = {
+	.post = usbmisc_imx25_post,
+};
+
 static const struct usbmisc_ops imx53_usbmisc_ops = {
 	.init = usbmisc_imx53_init,
 };
@@ -131,6 +163,7 @@ static const struct usbmisc_ops imx6q_usbmisc_ops = {
 };
 
 static const struct of_device_id usbmisc_imx_dt_ids[] = {
+	{ .compatible = "fsl,imx25-usbmisc", .data = (void *)&imx25_usbmisc_ops },
 	{ .compatible = "fsl,imx53-usbmisc", .data = (void *)&imx53_usbmisc_ops },
 	{ .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
 	{ /* sentinel */ }
-- 
1.7.10.4

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

* Re: [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
  2012-11-21 20:28         ` Sergei Shtylyov
@ 2012-11-21 19:58             ` Michael Grzeschik
  -1 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 19:58 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Michael Grzeschik, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Wed, Nov 21, 2012 at 11:28:36PM +0300, Sergei Shtylyov wrote:
> Hello.
> 
> On 11/21/2012 05:06 PM, Michael Grzeschik wrote:
> 
> > This adds mx53 as the next user of the usbmisc driver and makes it
> > possible to disable the overcurrent-detection of the internal phy.
> 
> > Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > ---
> > Changes since v2:
> > * added defines for register offsets and bitmasks
> > * fixed disable_oc option for all ports
> 
> >  drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 51 insertions(+)
> 
> > diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> > index e090e0f..b1811df 100644
> > --- a/drivers/usb/chipidea/usbmisc_imx.c
> > +++ b/drivers/usb/chipidea/usbmisc_imx.c
> > @@ -19,6 +19,13 @@
> >  
> >  #define USB_DEV_MAX 4
> >  
> > +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
> > +#define MX53_USB_UH2_CTRL_OFFSET	0x14;
> > +#define MX53_USB_UH3_CTRL_OFFSET	0x18;
> 
>    Semicolons here? This can't be right.

You're right. Its compiling without errors, because its only used at the
end of an assignement. So this will result in two Semicolons.

I will fix that.

Thanks,
Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
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] 54+ messages in thread

* [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
@ 2012-11-21 19:58             ` Michael Grzeschik
  0 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-21 19:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 21, 2012 at 11:28:36PM +0300, Sergei Shtylyov wrote:
> Hello.
> 
> On 11/21/2012 05:06 PM, Michael Grzeschik wrote:
> 
> > This adds mx53 as the next user of the usbmisc driver and makes it
> > possible to disable the overcurrent-detection of the internal phy.
> 
> > Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> > Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> > ---
> > Changes since v2:
> > * added defines for register offsets and bitmasks
> > * fixed disable_oc option for all ports
> 
> >  drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 51 insertions(+)
> 
> > diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> > index e090e0f..b1811df 100644
> > --- a/drivers/usb/chipidea/usbmisc_imx.c
> > +++ b/drivers/usb/chipidea/usbmisc_imx.c
> > @@ -19,6 +19,13 @@
> >  
> >  #define USB_DEV_MAX 4
> >  
> > +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
> > +#define MX53_USB_UH2_CTRL_OFFSET	0x14;
> > +#define MX53_USB_UH3_CTRL_OFFSET	0x18;
> 
>    Semicolons here? This can't be right.

You're right. Its compiling without errors, because its only used at the
end of an assignement. So this will result in two Semicolons.

I will fix that.

Thanks,
Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
  2012-11-21 14:06     ` Michael Grzeschik
@ 2012-11-21 20:28         ` Sergei Shtylyov
  -1 siblings, 0 replies; 54+ messages in thread
From: Sergei Shtylyov @ 2012-11-21 20:28 UTC (permalink / raw)
  To: Michael Grzeschik
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

Hello.

On 11/21/2012 05:06 PM, Michael Grzeschik wrote:

> This adds mx53 as the next user of the usbmisc driver and makes it
> possible to disable the overcurrent-detection of the internal phy.

> Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> ---
> Changes since v2:
> * added defines for register offsets and bitmasks
> * fixed disable_oc option for all ports

>  drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 51 insertions(+)

> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> index e090e0f..b1811df 100644
> --- a/drivers/usb/chipidea/usbmisc_imx.c
> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> @@ -19,6 +19,13 @@
>  
>  #define USB_DEV_MAX 4
>  
> +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
> +#define MX53_USB_UH2_CTRL_OFFSET	0x14;
> +#define MX53_USB_UH3_CTRL_OFFSET	0x18;

   Semicolons here? This can't be right.

WBR, Sergei

--
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] 54+ messages in thread

* [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
@ 2012-11-21 20:28         ` Sergei Shtylyov
  0 siblings, 0 replies; 54+ messages in thread
From: Sergei Shtylyov @ 2012-11-21 20:28 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 11/21/2012 05:06 PM, Michael Grzeschik wrote:

> This adds mx53 as the next user of the usbmisc driver and makes it
> possible to disable the overcurrent-detection of the internal phy.

> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
> Changes since v2:
> * added defines for register offsets and bitmasks
> * fixed disable_oc option for all ports

>  drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 51 insertions(+)

> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> index e090e0f..b1811df 100644
> --- a/drivers/usb/chipidea/usbmisc_imx.c
> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> @@ -19,6 +19,13 @@
>  
>  #define USB_DEV_MAX 4
>  
> +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
> +#define MX53_USB_UH2_CTRL_OFFSET	0x14;
> +#define MX53_USB_UH3_CTRL_OFFSET	0x18;

   Semicolons here? This can't be right.

WBR, Sergei

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

* Re: [PATCH v3 0/7] support other fsl SoCs with usbmisc + small fixes
  2012-11-21 14:06 ` Michael Grzeschik
@ 2012-11-22  9:24     ` Alexander Shishkin
  -1 siblings, 0 replies; 54+ messages in thread
From: Alexander Shishkin @ 2012-11-22  9:24 UTC (permalink / raw)
  To: Michael Grzeschik, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ, Peter Chen,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ

Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> writes:

> Nearly every SoC from Freescale has this non-core usb registers. This series
> adds support for more users of this driver.
>
> This series is based on Peter Chen's work. Its needed to merge his master branch
> before applying this series:
>
> https://github.com/hzpeterchen/linux-usb.git
>
> Marc Kleine-Budde (4):
>   usb: chipidea: usbmisc: unset global varibale usbmisc on driver
>     remove
>   usb: chipidea: usbmisc: fix a potential race condition
>   usb: chipidea: usbmisc: prepare driver to handle more than one soc
>   usb: chipidea: usbmisc: add support for ahb, ipg and per clock
>
> Michael Grzeschik (3):
>   usb: chipidea: usbmisc: rename file, struct and functions to
>     usbmisc_imx
>   usb: chipidea: usbmisc: add mx53 support
>   usb: chipidea: usbmisc: add post handling and errata fix for mx25

Cc'ing Peter Chen, in case he didn't see this. Peter, can you have a
look and give your Tested-by/Reviewed-by where appropriate?

Regards,
--
Alex

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

* [PATCH v3 0/7] support other fsl SoCs with usbmisc + small fixes
@ 2012-11-22  9:24     ` Alexander Shishkin
  0 siblings, 0 replies; 54+ messages in thread
From: Alexander Shishkin @ 2012-11-22  9:24 UTC (permalink / raw)
  To: linux-arm-kernel

Michael Grzeschik <m.grzeschik@pengutronix.de> writes:

> Nearly every SoC from Freescale has this non-core usb registers. This series
> adds support for more users of this driver.
>
> This series is based on Peter Chen's work. Its needed to merge his master branch
> before applying this series:
>
> https://github.com/hzpeterchen/linux-usb.git
>
> Marc Kleine-Budde (4):
>   usb: chipidea: usbmisc: unset global varibale usbmisc on driver
>     remove
>   usb: chipidea: usbmisc: fix a potential race condition
>   usb: chipidea: usbmisc: prepare driver to handle more than one soc
>   usb: chipidea: usbmisc: add support for ahb, ipg and per clock
>
> Michael Grzeschik (3):
>   usb: chipidea: usbmisc: rename file, struct and functions to
>     usbmisc_imx
>   usb: chipidea: usbmisc: add mx53 support
>   usb: chipidea: usbmisc: add post handling and errata fix for mx25

Cc'ing Peter Chen, in case he didn't see this. Peter, can you have a
look and give your Tested-by/Reviewed-by where appropriate?

Regards,
--
Alex

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

* Re: [PATCH v3 0/7] support other fsl SoCs with usbmisc + small fixes
  2012-11-22  9:24     ` Alexander Shishkin
@ 2012-11-22  9:31       ` Peter Chen
  -1 siblings, 0 replies; 54+ messages in thread
From: Peter Chen @ 2012-11-22  9:31 UTC (permalink / raw)
  To: Alexander Shishkin
  Cc: fabio.estevam, Michael Grzeschik, gregkh, devicetree-discuss,
	linux-usb, mkl, kernel, linux-arm-kernel

On Thu, Nov 22, 2012 at 11:24:44AM +0200, Alexander Shishkin wrote:
> Michael Grzeschik <m.grzeschik@pengutronix.de> writes:
> 
> > Nearly every SoC from Freescale has this non-core usb registers. This series
> > adds support for more users of this driver.
> >
> > This series is based on Peter Chen's work. Its needed to merge his master branch
> > before applying this series:
> >
> > https://github.com/hzpeterchen/linux-usb.git
> >
> > Marc Kleine-Budde (4):
> >   usb: chipidea: usbmisc: unset global varibale usbmisc on driver
> >     remove
> >   usb: chipidea: usbmisc: fix a potential race condition
> >   usb: chipidea: usbmisc: prepare driver to handle more than one soc
> >   usb: chipidea: usbmisc: add support for ahb, ipg and per clock
> >
> > Michael Grzeschik (3):
> >   usb: chipidea: usbmisc: rename file, struct and functions to
> >     usbmisc_imx
> >   usb: chipidea: usbmisc: add mx53 support
> >   usb: chipidea: usbmisc: add post handling and errata fix for mx25
> 
> Cc'ing Peter Chen, in case he didn't see this. Peter, can you have a
> look and give your Tested-by/Reviewed-by where appropriate?

OK, I will have a look tomorrow or the beginning of next week.
> 
> Regards,
> --
> Alex
> 

-- 

Best Regards,
Peter Chen

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

* [PATCH v3 0/7] support other fsl SoCs with usbmisc + small fixes
@ 2012-11-22  9:31       ` Peter Chen
  0 siblings, 0 replies; 54+ messages in thread
From: Peter Chen @ 2012-11-22  9:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 22, 2012 at 11:24:44AM +0200, Alexander Shishkin wrote:
> Michael Grzeschik <m.grzeschik@pengutronix.de> writes:
> 
> > Nearly every SoC from Freescale has this non-core usb registers. This series
> > adds support for more users of this driver.
> >
> > This series is based on Peter Chen's work. Its needed to merge his master branch
> > before applying this series:
> >
> > https://github.com/hzpeterchen/linux-usb.git
> >
> > Marc Kleine-Budde (4):
> >   usb: chipidea: usbmisc: unset global varibale usbmisc on driver
> >     remove
> >   usb: chipidea: usbmisc: fix a potential race condition
> >   usb: chipidea: usbmisc: prepare driver to handle more than one soc
> >   usb: chipidea: usbmisc: add support for ahb, ipg and per clock
> >
> > Michael Grzeschik (3):
> >   usb: chipidea: usbmisc: rename file, struct and functions to
> >     usbmisc_imx
> >   usb: chipidea: usbmisc: add mx53 support
> >   usb: chipidea: usbmisc: add post handling and errata fix for mx25
> 
> Cc'ing Peter Chen, in case he didn't see this. Peter, can you have a
> look and give your Tested-by/Reviewed-by where appropriate?

OK, I will have a look tomorrow or the beginning of next week.
> 
> Regards,
> --
> Alex
> 

-- 

Best Regards,
Peter Chen

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

* Re: [PATCH v3 3/7] usb: chipidea: usbmisc: fix a potential race condition
  2012-11-21 14:06     ` Michael Grzeschik
@ 2012-11-23  5:36         ` Peter Chen
  -1 siblings, 0 replies; 54+ messages in thread
From: Peter Chen @ 2012-11-23  5:36 UTC (permalink / raw)
  To: Michael Grzeschik
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Wed, Nov 21, 2012 at 03:06:29PM +0100, Michael Grzeschik wrote:
> From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> 
> This fixes a potential race condition where the ci13xxx_imx glue code
> could be fast enough to call one of the usbmisc_ops before he got a
> valid value on the static usbmisc pointer. To fix that we first set
> usbmisc, then call usbmisc_set_ops().

usbmisc is subsys_initcall, and cil13xxx_imx is module_init. Any
potential situation that the ci13xxx_imx's probe is ran before the
usbmisc's probe is completed? Besides, there is usbmisc_ops value
check at the beginning of cil13xxx_imx's probe.
> 
> Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> ---
> Changes since v1:
> * split previous patch into two seperate.
> 
>  drivers/usb/chipidea/usbmisc_imx.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> index 552c63f..9145e04 100644
> --- a/drivers/usb/chipidea/usbmisc_imx.c
> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> @@ -116,14 +116,14 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>  
> +	usbmisc = data;
>  	ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
>  	if (ret) {
> +		usbmisc = NULL;
>  		clk_disable_unprepare(data->clk);
>  		return ret;
>  	}
>  
> -	usbmisc = data;
> -
>  	return 0;
>  }
>  
> -- 
> 1.7.10.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
> 

-- 

Best Regards,
Peter Chen

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 3/7] usb: chipidea: usbmisc: fix a potential race condition
@ 2012-11-23  5:36         ` Peter Chen
  0 siblings, 0 replies; 54+ messages in thread
From: Peter Chen @ 2012-11-23  5:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 21, 2012 at 03:06:29PM +0100, Michael Grzeschik wrote:
> From: Marc Kleine-Budde <mkl@pengutronix.de>
> 
> This fixes a potential race condition where the ci13xxx_imx glue code
> could be fast enough to call one of the usbmisc_ops before he got a
> valid value on the static usbmisc pointer. To fix that we first set
> usbmisc, then call usbmisc_set_ops().

usbmisc is subsys_initcall, and cil13xxx_imx is module_init. Any
potential situation that the ci13xxx_imx's probe is ran before the
usbmisc's probe is completed? Besides, there is usbmisc_ops value
check at the beginning of cil13xxx_imx's probe.
> 
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
> Changes since v1:
> * split previous patch into two seperate.
> 
>  drivers/usb/chipidea/usbmisc_imx.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> index 552c63f..9145e04 100644
> --- a/drivers/usb/chipidea/usbmisc_imx.c
> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> @@ -116,14 +116,14 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>  
> +	usbmisc = data;
>  	ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
>  	if (ret) {
> +		usbmisc = NULL;
>  		clk_disable_unprepare(data->clk);
>  		return ret;
>  	}
>  
> -	usbmisc = data;
> -
>  	return 0;
>  }
>  
> -- 
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 

Best Regards,
Peter Chen

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

* Re: [PATCH v3 5/7] usb: chipidea: usbmisc: add support for ahb, ipg and per clock
  2012-11-21 14:06     ` Michael Grzeschik
@ 2012-11-23  6:51         ` Peter Chen
  -1 siblings, 0 replies; 54+ messages in thread
From: Peter Chen @ 2012-11-23  6:51 UTC (permalink / raw)
  To: Michael Grzeschik
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Wed, Nov 21, 2012 at 03:06:31PM +0100, Michael Grzeschik wrote:
> From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> 
> This patch adds support for a second and third clock to the usbmisc driver. On
> modern freescale ARM cores like the imx51, imx53 and imx6q three clocks ("ahb",
> "ipg" and "per") must be enabled in order to access the USB core.

The imx6q usb's clock structure is different with old mxc serials (mx3x, mx5x)
due to different PHY. This patch will cause mx6q's probe fail, the message
like below:

imx_usb 2184000.usb: Failed to get clock, err=-2
imx_usb: probe of 2184000.usb failed with error -2

The mx5x (50, 51, 53) and mx6q's clock structure like below:

mx5x:
- usboh3_ipg_ahb: CCGR2(index13), used to access register
(like your ahb)
- usboh3_60M: CCGR2(index14), used to access register at serial phy mode
as the phy is at serial mode, we need to use it at the first before the phy
goes to other modes.
(like your ipg)
usbphy: used to transfer data
(like your per)

mx6q:
- usboh3(Index 162 at DT), used to access register
- usbphy(Index 182 for otg port at DT), at phy controller

So, we may consider a way to consolidate both mx6q (mx28) and mxc (mx5x, mx3x)
platforms.
> 
> ahb - AMBA High-Performance Bus clock domain
> ipg - IP-Bus Gate clock domain
> per - Peripheral clock domain
> 
> Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> ---
> Changes since v1:
> * changed patch description
> 
>  drivers/usb/chipidea/usbmisc_imx.c |   60 +++++++++++++++++++++++++++---------
>  1 file changed, 45 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> index d0c7a03..e090e0f 100644
> --- a/drivers/usb/chipidea/usbmisc_imx.c
> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> @@ -24,7 +24,9 @@
>  struct imx_usbmisc {
>  	void __iomem *base;
>  	spinlock_t lock;
> -	struct clk *clk;
> +	struct clk *clk_ahb;
> +	struct clk *clk_ipg;
> +	struct clk *clk_per;
>  	struct usbmisc_usb_device usbdev[USB_DEV_MAX];
>  	const struct usbmisc_ops *ops;
>  };
> @@ -104,38 +106,66 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
>  	if (!data->base)
>  		return -EADDRNOTAVAIL;
>  
> -	data->clk = devm_clk_get(&pdev->dev, NULL);
> -	if (IS_ERR(data->clk)) {
> +	data->clk_ahb = devm_clk_get(&pdev->dev, "ahb");
> +	if (IS_ERR(data->clk_ahb)) {
>  		dev_err(&pdev->dev,
> -			"failed to get clock, err=%ld\n", PTR_ERR(data->clk));
> -		return PTR_ERR(data->clk);
> +			"failed to get ahb clock, err=%ld\n", PTR_ERR(data->clk_ahb));
> +		return PTR_ERR(data->clk_ahb);
>  	}
>  
> -	ret = clk_prepare_enable(data->clk);
> -	if (ret) {
> +	data->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
> +	if (IS_ERR(data->clk_ipg)) {
>  		dev_err(&pdev->dev,
> -			"clk_prepare_enable failed, err=%d\n", ret);
> -		return ret;
> +			"failed to get ipg clock, err=%ld\n", PTR_ERR(data->clk_ipg));
> +		return PTR_ERR(data->clk_ipg);
>  	}
>  
> +	data->clk_per = devm_clk_get(&pdev->dev, "per");
> +	if (IS_ERR(data->clk_per)) {
> +		dev_err(&pdev->dev,
> +			"failed to get per clock, err=%ld\n", PTR_ERR(data->clk_per));
> +		return PTR_ERR(data->clk_per);
> +	}
> +
> +	ret = clk_prepare_enable(data->clk_ahb);
> +	if (ret)
> +		return ret;
> +
> +	ret = clk_prepare_enable(data->clk_ipg);
> +	if (ret)
> +		goto err_ipg_failed;
> +
> +	ret = clk_prepare_enable(data->clk_per);
> +	if (ret)
> +		goto err_per_failed;
> +
>  	tmp_dev = (struct of_device_id *)
>  		of_match_device(usbmisc_imx_dt_ids, &pdev->dev);
>  	data->ops = (const struct usbmisc_ops *)tmp_dev->data;
>  	usbmisc = data;
>  	ret = usbmisc_set_ops(data->ops);
> -	if (ret) {
> -		usbmisc = NULL;
> -		clk_disable_unprepare(data->clk);
> -		return ret;
> -	}
> +	if (ret)
> +		goto err_set_ops_failed;
>  
>  	return 0;
> +
> + err_set_ops_failed:
> +	usbmisc = NULL;
> +	clk_disable_unprepare(data->clk_per);
> + err_per_failed:
> +	clk_disable_unprepare(data->clk_ipg);
> + err_ipg_failed:
> +	clk_disable_unprepare(data->clk_ahb);
> +
> +	return ret;
>  }
>  
>  static int __devexit usbmisc_imx_remove(struct platform_device *pdev)
>  {
>  	usbmisc_unset_ops(usbmisc->ops);
> -	clk_disable_unprepare(usbmisc->clk);
> +	clk_disable_unprepare(usbmisc->clk_per);
> +	clk_disable_unprepare(usbmisc->clk_ipg);
> +	clk_disable_unprepare(usbmisc->clk_ahb);
>  	usbmisc = NULL;
>  	return 0;
>  }
> -- 
> 1.7.10.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
> 

-- 

Best Regards,
Peter Chen

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 5/7] usb: chipidea: usbmisc: add support for ahb, ipg and per clock
@ 2012-11-23  6:51         ` Peter Chen
  0 siblings, 0 replies; 54+ messages in thread
From: Peter Chen @ 2012-11-23  6:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 21, 2012 at 03:06:31PM +0100, Michael Grzeschik wrote:
> From: Marc Kleine-Budde <mkl@pengutronix.de>
> 
> This patch adds support for a second and third clock to the usbmisc driver. On
> modern freescale ARM cores like the imx51, imx53 and imx6q three clocks ("ahb",
> "ipg" and "per") must be enabled in order to access the USB core.

The imx6q usb's clock structure is different with old mxc serials (mx3x, mx5x)
due to different PHY. This patch will cause mx6q's probe fail, the message
like below:

imx_usb 2184000.usb: Failed to get clock, err=-2
imx_usb: probe of 2184000.usb failed with error -2

The mx5x (50, 51, 53) and mx6q's clock structure like below:

mx5x:
- usboh3_ipg_ahb: CCGR2(index13), used to access register
(like your ahb)
- usboh3_60M: CCGR2(index14), used to access register at serial phy mode
as the phy is at serial mode, we need to use it at the first before the phy
goes to other modes.
(like your ipg)
usbphy: used to transfer data
(like your per)

mx6q:
- usboh3(Index 162 at DT), used to access register
- usbphy(Index 182 for otg port at DT), at phy controller

So, we may consider a way to consolidate both mx6q (mx28) and mxc (mx5x, mx3x)
platforms.
> 
> ahb - AMBA High-Performance Bus clock domain
> ipg - IP-Bus Gate clock domain
> per - Peripheral clock domain
> 
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
> Changes since v1:
> * changed patch description
> 
>  drivers/usb/chipidea/usbmisc_imx.c |   60 +++++++++++++++++++++++++++---------
>  1 file changed, 45 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> index d0c7a03..e090e0f 100644
> --- a/drivers/usb/chipidea/usbmisc_imx.c
> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> @@ -24,7 +24,9 @@
>  struct imx_usbmisc {
>  	void __iomem *base;
>  	spinlock_t lock;
> -	struct clk *clk;
> +	struct clk *clk_ahb;
> +	struct clk *clk_ipg;
> +	struct clk *clk_per;
>  	struct usbmisc_usb_device usbdev[USB_DEV_MAX];
>  	const struct usbmisc_ops *ops;
>  };
> @@ -104,38 +106,66 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
>  	if (!data->base)
>  		return -EADDRNOTAVAIL;
>  
> -	data->clk = devm_clk_get(&pdev->dev, NULL);
> -	if (IS_ERR(data->clk)) {
> +	data->clk_ahb = devm_clk_get(&pdev->dev, "ahb");
> +	if (IS_ERR(data->clk_ahb)) {
>  		dev_err(&pdev->dev,
> -			"failed to get clock, err=%ld\n", PTR_ERR(data->clk));
> -		return PTR_ERR(data->clk);
> +			"failed to get ahb clock, err=%ld\n", PTR_ERR(data->clk_ahb));
> +		return PTR_ERR(data->clk_ahb);
>  	}
>  
> -	ret = clk_prepare_enable(data->clk);
> -	if (ret) {
> +	data->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
> +	if (IS_ERR(data->clk_ipg)) {
>  		dev_err(&pdev->dev,
> -			"clk_prepare_enable failed, err=%d\n", ret);
> -		return ret;
> +			"failed to get ipg clock, err=%ld\n", PTR_ERR(data->clk_ipg));
> +		return PTR_ERR(data->clk_ipg);
>  	}
>  
> +	data->clk_per = devm_clk_get(&pdev->dev, "per");
> +	if (IS_ERR(data->clk_per)) {
> +		dev_err(&pdev->dev,
> +			"failed to get per clock, err=%ld\n", PTR_ERR(data->clk_per));
> +		return PTR_ERR(data->clk_per);
> +	}
> +
> +	ret = clk_prepare_enable(data->clk_ahb);
> +	if (ret)
> +		return ret;
> +
> +	ret = clk_prepare_enable(data->clk_ipg);
> +	if (ret)
> +		goto err_ipg_failed;
> +
> +	ret = clk_prepare_enable(data->clk_per);
> +	if (ret)
> +		goto err_per_failed;
> +
>  	tmp_dev = (struct of_device_id *)
>  		of_match_device(usbmisc_imx_dt_ids, &pdev->dev);
>  	data->ops = (const struct usbmisc_ops *)tmp_dev->data;
>  	usbmisc = data;
>  	ret = usbmisc_set_ops(data->ops);
> -	if (ret) {
> -		usbmisc = NULL;
> -		clk_disable_unprepare(data->clk);
> -		return ret;
> -	}
> +	if (ret)
> +		goto err_set_ops_failed;
>  
>  	return 0;
> +
> + err_set_ops_failed:
> +	usbmisc = NULL;
> +	clk_disable_unprepare(data->clk_per);
> + err_per_failed:
> +	clk_disable_unprepare(data->clk_ipg);
> + err_ipg_failed:
> +	clk_disable_unprepare(data->clk_ahb);
> +
> +	return ret;
>  }
>  
>  static int __devexit usbmisc_imx_remove(struct platform_device *pdev)
>  {
>  	usbmisc_unset_ops(usbmisc->ops);
> -	clk_disable_unprepare(usbmisc->clk);
> +	clk_disable_unprepare(usbmisc->clk_per);
> +	clk_disable_unprepare(usbmisc->clk_ipg);
> +	clk_disable_unprepare(usbmisc->clk_ahb);
>  	usbmisc = NULL;
>  	return 0;
>  }
> -- 
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 

Best Regards,
Peter Chen

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

* Re: [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
  2012-11-21 14:06     ` Michael Grzeschik
@ 2012-11-23  6:53         ` Peter Chen
  -1 siblings, 0 replies; 54+ messages in thread
From: Peter Chen @ 2012-11-23  6:53 UTC (permalink / raw)
  To: Michael Grzeschik
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Wed, Nov 21, 2012 at 03:06:32PM +0100, Michael Grzeschik wrote:
> This adds mx53 as the next user of the usbmisc driver and makes it
> possible to disable the overcurrent-detection of the internal phy.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> ---
> Changes since v2:
> * added defines for register offsets and bitmasks
> * fixed disable_oc option for all ports
> 
>  drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 51 insertions(+)
> 
> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> index e090e0f..b1811df 100644
> --- a/drivers/usb/chipidea/usbmisc_imx.c
> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> @@ -19,6 +19,13 @@
>  
>  #define USB_DEV_MAX 4
>  
> +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
> +#define MX53_USB_UH2_CTRL_OFFSET	0x14;
> +#define MX53_USB_UH3_CTRL_OFFSET	0x18;
> +#define MX53_BM_OVER_CUR_DIS_H1		BIT(5)
> +#define MX53_BM_OVER_CUR_DIS_OTG	BIT(8)
> +#define MX53_BM_OVER_CUR_DIS_UHx	BIT(30)
> +
>  #define MX6_BM_OVER_CUR_DIS		BIT(7)

As every SoC platform's non-core register mapping is different,
it is better to use .h to put register bit definition
>  
>  struct imx_usbmisc {
> @@ -54,6 +61,45 @@ static struct usbmisc_usb_device *get_usbdev(struct device *dev)
>  	return &usbmisc->usbdev[i];
>  }
>  
> +static int usbmisc_imx53_init(struct device *dev)
> +{
> +	struct usbmisc_usb_device *usbdev;
> +	void __iomem *reg;
> +	unsigned long flags;
> +	u32 val;
> +
> +	usbdev = get_usbdev(dev);
> +	if (IS_ERR(usbdev))
> +		return PTR_ERR(usbdev);
> +
> +	if (usbdev->disable_oc) {
> +		spin_lock_irqsave(&usbmisc->lock, flags);
> +		switch (usbdev->index) {
> +		case 0:
> +			reg = usbmisc->base + MX53_USB_OTG_PHY_CTRL_0_OFFSET;
> +			val = readl(reg) | MX53_BM_OVER_CUR_DIS_OTG;
> +			break;
> +		case 1:
> +			reg = usbmisc->base + MX53_USB_OTG_PHY_CTRL_0_OFFSET;
> +			val = readl(reg) | MX53_BM_OVER_CUR_DIS_H1;
> +			break;
> +		case 2:
> +			reg = usbmisc->base + MX53_USB_UH2_CTRL_OFFSET;
> +			val = readl(reg) | MX53_BM_OVER_CUR_DIS_UHx;
> +			break;
> +		case 3:
> +			reg = usbmisc->base + MX53_USB_UH3_CTRL_OFFSET;
> +			val = readl(reg) | MX53_BM_OVER_CUR_DIS_UHx;
> +			break;
> +		}
> +		if (reg && val)
> +			writel(val, reg);
> +		spin_unlock_irqrestore(&usbmisc->lock, flags);
> +	}
> +
> +	return 0;
> +}
> +
>  static int usbmisc_imx6q_init(struct device *dev)
>  {
>  
> @@ -76,11 +122,16 @@ static int usbmisc_imx6q_init(struct device *dev)
>  	return 0;
>  }
>  
> +static const struct usbmisc_ops imx53_usbmisc_ops = {
> +	.init = usbmisc_imx53_init,
> +};
> +
>  static const struct usbmisc_ops imx6q_usbmisc_ops = {
>  	.init = usbmisc_imx6q_init,
>  };
>  
>  static const struct of_device_id usbmisc_imx_dt_ids[] = {
> +	{ .compatible = "fsl,imx53-usbmisc", .data = (void *)&imx53_usbmisc_ops },
>  	{ .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
>  	{ /* sentinel */ }
>  };
> -- 
> 1.7.10.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
> 

-- 

Best Regards,
Peter Chen

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
@ 2012-11-23  6:53         ` Peter Chen
  0 siblings, 0 replies; 54+ messages in thread
From: Peter Chen @ 2012-11-23  6:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 21, 2012 at 03:06:32PM +0100, Michael Grzeschik wrote:
> This adds mx53 as the next user of the usbmisc driver and makes it
> possible to disable the overcurrent-detection of the internal phy.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
> Changes since v2:
> * added defines for register offsets and bitmasks
> * fixed disable_oc option for all ports
> 
>  drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 51 insertions(+)
> 
> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> index e090e0f..b1811df 100644
> --- a/drivers/usb/chipidea/usbmisc_imx.c
> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> @@ -19,6 +19,13 @@
>  
>  #define USB_DEV_MAX 4
>  
> +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
> +#define MX53_USB_UH2_CTRL_OFFSET	0x14;
> +#define MX53_USB_UH3_CTRL_OFFSET	0x18;
> +#define MX53_BM_OVER_CUR_DIS_H1		BIT(5)
> +#define MX53_BM_OVER_CUR_DIS_OTG	BIT(8)
> +#define MX53_BM_OVER_CUR_DIS_UHx	BIT(30)
> +
>  #define MX6_BM_OVER_CUR_DIS		BIT(7)

As every SoC platform's non-core register mapping is different,
it is better to use .h to put register bit definition
>  
>  struct imx_usbmisc {
> @@ -54,6 +61,45 @@ static struct usbmisc_usb_device *get_usbdev(struct device *dev)
>  	return &usbmisc->usbdev[i];
>  }
>  
> +static int usbmisc_imx53_init(struct device *dev)
> +{
> +	struct usbmisc_usb_device *usbdev;
> +	void __iomem *reg;
> +	unsigned long flags;
> +	u32 val;
> +
> +	usbdev = get_usbdev(dev);
> +	if (IS_ERR(usbdev))
> +		return PTR_ERR(usbdev);
> +
> +	if (usbdev->disable_oc) {
> +		spin_lock_irqsave(&usbmisc->lock, flags);
> +		switch (usbdev->index) {
> +		case 0:
> +			reg = usbmisc->base + MX53_USB_OTG_PHY_CTRL_0_OFFSET;
> +			val = readl(reg) | MX53_BM_OVER_CUR_DIS_OTG;
> +			break;
> +		case 1:
> +			reg = usbmisc->base + MX53_USB_OTG_PHY_CTRL_0_OFFSET;
> +			val = readl(reg) | MX53_BM_OVER_CUR_DIS_H1;
> +			break;
> +		case 2:
> +			reg = usbmisc->base + MX53_USB_UH2_CTRL_OFFSET;
> +			val = readl(reg) | MX53_BM_OVER_CUR_DIS_UHx;
> +			break;
> +		case 3:
> +			reg = usbmisc->base + MX53_USB_UH3_CTRL_OFFSET;
> +			val = readl(reg) | MX53_BM_OVER_CUR_DIS_UHx;
> +			break;
> +		}
> +		if (reg && val)
> +			writel(val, reg);
> +		spin_unlock_irqrestore(&usbmisc->lock, flags);
> +	}
> +
> +	return 0;
> +}
> +
>  static int usbmisc_imx6q_init(struct device *dev)
>  {
>  
> @@ -76,11 +122,16 @@ static int usbmisc_imx6q_init(struct device *dev)
>  	return 0;
>  }
>  
> +static const struct usbmisc_ops imx53_usbmisc_ops = {
> +	.init = usbmisc_imx53_init,
> +};
> +
>  static const struct usbmisc_ops imx6q_usbmisc_ops = {
>  	.init = usbmisc_imx6q_init,
>  };
>  
>  static const struct of_device_id usbmisc_imx_dt_ids[] = {
> +	{ .compatible = "fsl,imx53-usbmisc", .data = (void *)&imx53_usbmisc_ops },
>  	{ .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
>  	{ /* sentinel */ }
>  };
> -- 
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 

Best Regards,
Peter Chen

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

* Re: [PATCH v3 7/7] usb: chipidea: usbmisc: add post handling and errata fix for mx25
  2012-11-21 14:06     ` Michael Grzeschik
@ 2012-11-23  6:59         ` Peter Chen
  -1 siblings, 0 replies; 54+ messages in thread
From: Peter Chen @ 2012-11-23  6:59 UTC (permalink / raw)
  To: Michael Grzeschik
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Wed, Nov 21, 2012 at 03:06:33PM +0100, Michael Grzeschik wrote:
> This adds a post handling routine which is called after
> ci13xxx_add_device was called. The first user is the mx25, which has to
> disable the external-vbus-divider after the ude has started.
udc has started?
> 
>  
> +static int usbmisc_imx25_post(struct device *dev)
> +{
> +	struct usbmisc_usb_device *usbdev;
> +	void __iomem *reg;
> +	unsigned long flags;
> +	u32 val;
> +
> +	usbdev = get_usbdev(dev);
> +	if (IS_ERR(usbdev))
> +		return PTR_ERR(usbdev);
> +
> +	reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET;
> +
> +	if (usbdev->evdo) {
> +		spin_lock_irqsave(&usbmisc->lock, flags);
> +		val = readl(reg);
> +		writel(val | MX25_BM_EXTERNAL_VBUS_DIVIDER, reg);
> +		spin_unlock_irqrestore(&usbmisc->lock, flags);
> +		mdelay(5); /* needed to stabilize voltage */
better use usleep_range to avoid busy-wait.
> +	}
> +
> +	return 0;
> +}
> +
>  static int usbmisc_imx53_init(struct device *dev)
>  {
>  	struct usbmisc_usb_device *usbdev;
> @@ -122,6 +150,10 @@ static int usbmisc_imx6q_init(struct device *dev)
>  	return 0;
>  }
>  
> +static const struct usbmisc_ops imx25_usbmisc_ops = {
> +	.post = usbmisc_imx25_post,
> +};
> +
>  static const struct usbmisc_ops imx53_usbmisc_ops = {
>  	.init = usbmisc_imx53_init,
>  };
> @@ -131,6 +163,7 @@ static const struct usbmisc_ops imx6q_usbmisc_ops = {
>  };
>  
>  static const struct of_device_id usbmisc_imx_dt_ids[] = {
> +	{ .compatible = "fsl,imx25-usbmisc", .data = (void *)&imx25_usbmisc_ops },
>  	{ .compatible = "fsl,imx53-usbmisc", .data = (void *)&imx53_usbmisc_ops },
>  	{ .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
>  	{ /* sentinel */ }
> -- 
> 1.7.10.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
> 

-- 

Best Regards,
Peter Chen

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 7/7] usb: chipidea: usbmisc: add post handling and errata fix for mx25
@ 2012-11-23  6:59         ` Peter Chen
  0 siblings, 0 replies; 54+ messages in thread
From: Peter Chen @ 2012-11-23  6:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 21, 2012 at 03:06:33PM +0100, Michael Grzeschik wrote:
> This adds a post handling routine which is called after
> ci13xxx_add_device was called. The first user is the mx25, which has to
> disable the external-vbus-divider after the ude has started.
udc has started?
> 
>  
> +static int usbmisc_imx25_post(struct device *dev)
> +{
> +	struct usbmisc_usb_device *usbdev;
> +	void __iomem *reg;
> +	unsigned long flags;
> +	u32 val;
> +
> +	usbdev = get_usbdev(dev);
> +	if (IS_ERR(usbdev))
> +		return PTR_ERR(usbdev);
> +
> +	reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET;
> +
> +	if (usbdev->evdo) {
> +		spin_lock_irqsave(&usbmisc->lock, flags);
> +		val = readl(reg);
> +		writel(val | MX25_BM_EXTERNAL_VBUS_DIVIDER, reg);
> +		spin_unlock_irqrestore(&usbmisc->lock, flags);
> +		mdelay(5); /* needed to stabilize voltage */
better use usleep_range to avoid busy-wait.
> +	}
> +
> +	return 0;
> +}
> +
>  static int usbmisc_imx53_init(struct device *dev)
>  {
>  	struct usbmisc_usb_device *usbdev;
> @@ -122,6 +150,10 @@ static int usbmisc_imx6q_init(struct device *dev)
>  	return 0;
>  }
>  
> +static const struct usbmisc_ops imx25_usbmisc_ops = {
> +	.post = usbmisc_imx25_post,
> +};
> +
>  static const struct usbmisc_ops imx53_usbmisc_ops = {
>  	.init = usbmisc_imx53_init,
>  };
> @@ -131,6 +163,7 @@ static const struct usbmisc_ops imx6q_usbmisc_ops = {
>  };
>  
>  static const struct of_device_id usbmisc_imx_dt_ids[] = {
> +	{ .compatible = "fsl,imx25-usbmisc", .data = (void *)&imx25_usbmisc_ops },
>  	{ .compatible = "fsl,imx53-usbmisc", .data = (void *)&imx53_usbmisc_ops },
>  	{ .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
>  	{ /* sentinel */ }
> -- 
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 

Best Regards,
Peter Chen

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

* Re: [PATCH v3 3/7] usb: chipidea: usbmisc: fix a potential race condition
  2012-11-23  5:36         ` Peter Chen
@ 2012-11-23  7:37           ` Sascha Hauer
  -1 siblings, 0 replies; 54+ messages in thread
From: Sascha Hauer @ 2012-11-23  7:37 UTC (permalink / raw)
  To: Peter Chen
  Cc: Michael Grzeschik, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Fri, Nov 23, 2012 at 01:36:36PM +0800, Peter Chen wrote:
> On Wed, Nov 21, 2012 at 03:06:29PM +0100, Michael Grzeschik wrote:
> > From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > 
> > This fixes a potential race condition where the ci13xxx_imx glue code
> > could be fast enough to call one of the usbmisc_ops before he got a
> > valid value on the static usbmisc pointer. To fix that we first set
> > usbmisc, then call usbmisc_set_ops().
> 
> usbmisc is subsys_initcall, and cil13xxx_imx is module_init. Any
> potential situation that the ci13xxx_imx's probe is ran before the
> usbmisc's probe is completed?

Not having looked at the code you are referring to at all I just want
to say that: drivers can be modules (don't know if that's true for
chipidea) and sooner or later we'll probably get devicetree overlays, so
the devicetree nodes might just appear during runtime. Depending on
initcall order is generally not a good idea.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
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] 54+ messages in thread

* [PATCH v3 3/7] usb: chipidea: usbmisc: fix a potential race condition
@ 2012-11-23  7:37           ` Sascha Hauer
  0 siblings, 0 replies; 54+ messages in thread
From: Sascha Hauer @ 2012-11-23  7:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Nov 23, 2012 at 01:36:36PM +0800, Peter Chen wrote:
> On Wed, Nov 21, 2012 at 03:06:29PM +0100, Michael Grzeschik wrote:
> > From: Marc Kleine-Budde <mkl@pengutronix.de>
> > 
> > This fixes a potential race condition where the ci13xxx_imx glue code
> > could be fast enough to call one of the usbmisc_ops before he got a
> > valid value on the static usbmisc pointer. To fix that we first set
> > usbmisc, then call usbmisc_set_ops().
> 
> usbmisc is subsys_initcall, and cil13xxx_imx is module_init. Any
> potential situation that the ci13xxx_imx's probe is ran before the
> usbmisc's probe is completed?

Not having looked at the code you are referring to at all I just want
to say that: drivers can be modules (don't know if that's true for
chipidea) and sooner or later we'll probably get devicetree overlays, so
the devicetree nodes might just appear during runtime. Depending on
initcall order is generally not a good idea.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
  2012-11-23  6:53         ` Peter Chen
@ 2012-11-23  7:39           ` Sascha Hauer
  -1 siblings, 0 replies; 54+ messages in thread
From: Sascha Hauer @ 2012-11-23  7:39 UTC (permalink / raw)
  To: Peter Chen
  Cc: Michael Grzeschik, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Fri, Nov 23, 2012 at 02:53:41PM +0800, Peter Chen wrote:
> On Wed, Nov 21, 2012 at 03:06:32PM +0100, Michael Grzeschik wrote:
> > This adds mx53 as the next user of the usbmisc driver and makes it
> > possible to disable the overcurrent-detection of the internal phy.
> > 
> > Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > ---
> > Changes since v2:
> > * added defines for register offsets and bitmasks
> > * fixed disable_oc option for all ports
> > 
> >  drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 51 insertions(+)
> > 
> > diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> > index e090e0f..b1811df 100644
> > --- a/drivers/usb/chipidea/usbmisc_imx.c
> > +++ b/drivers/usb/chipidea/usbmisc_imx.c
> > @@ -19,6 +19,13 @@
> >  
> >  #define USB_DEV_MAX 4
> >  
> > +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
> > +#define MX53_USB_UH2_CTRL_OFFSET	0x14;
> > +#define MX53_USB_UH3_CTRL_OFFSET	0x18;
> > +#define MX53_BM_OVER_CUR_DIS_H1		BIT(5)
> > +#define MX53_BM_OVER_CUR_DIS_OTG	BIT(8)
> > +#define MX53_BM_OVER_CUR_DIS_UHx	BIT(30)
> > +
> >  #define MX6_BM_OVER_CUR_DIS		BIT(7)
> 
> As every SoC platform's non-core register mapping is different,
> it is better to use .h to put register bit definition

What do the different register mapping have to do with putting the
definitions in .h files or not?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
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] 54+ messages in thread

* [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
@ 2012-11-23  7:39           ` Sascha Hauer
  0 siblings, 0 replies; 54+ messages in thread
From: Sascha Hauer @ 2012-11-23  7:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Nov 23, 2012 at 02:53:41PM +0800, Peter Chen wrote:
> On Wed, Nov 21, 2012 at 03:06:32PM +0100, Michael Grzeschik wrote:
> > This adds mx53 as the next user of the usbmisc driver and makes it
> > possible to disable the overcurrent-detection of the internal phy.
> > 
> > Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> > Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> > ---
> > Changes since v2:
> > * added defines for register offsets and bitmasks
> > * fixed disable_oc option for all ports
> > 
> >  drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 51 insertions(+)
> > 
> > diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> > index e090e0f..b1811df 100644
> > --- a/drivers/usb/chipidea/usbmisc_imx.c
> > +++ b/drivers/usb/chipidea/usbmisc_imx.c
> > @@ -19,6 +19,13 @@
> >  
> >  #define USB_DEV_MAX 4
> >  
> > +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
> > +#define MX53_USB_UH2_CTRL_OFFSET	0x14;
> > +#define MX53_USB_UH3_CTRL_OFFSET	0x18;
> > +#define MX53_BM_OVER_CUR_DIS_H1		BIT(5)
> > +#define MX53_BM_OVER_CUR_DIS_OTG	BIT(8)
> > +#define MX53_BM_OVER_CUR_DIS_UHx	BIT(30)
> > +
> >  #define MX6_BM_OVER_CUR_DIS		BIT(7)
> 
> As every SoC platform's non-core register mapping is different,
> it is better to use .h to put register bit definition

What do the different register mapping have to do with putting the
definitions in .h files or not?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH v3 3/7] usb: chipidea: usbmisc: fix a potential race condition
  2012-11-23  7:37           ` Sascha Hauer
@ 2012-11-23  9:01               ` Alexander Shishkin
  -1 siblings, 0 replies; 54+ messages in thread
From: Alexander Shishkin @ 2012-11-23  9:01 UTC (permalink / raw)
  To: Sascha Hauer, Peter Chen
  Cc: Michael Grzeschik, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> writes:

> On Fri, Nov 23, 2012 at 01:36:36PM +0800, Peter Chen wrote:
>> On Wed, Nov 21, 2012 at 03:06:29PM +0100, Michael Grzeschik wrote:
>> > From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
>> > 
>> > This fixes a potential race condition where the ci13xxx_imx glue code
>> > could be fast enough to call one of the usbmisc_ops before he got a
>> > valid value on the static usbmisc pointer. To fix that we first set
>> > usbmisc, then call usbmisc_set_ops().
>> 
>> usbmisc is subsys_initcall, and cil13xxx_imx is module_init. Any
>> potential situation that the ci13xxx_imx's probe is ran before the
>> usbmisc's probe is completed?
>
> Not having looked at the code you are referring to at all I just want
> to say that: drivers can be modules (don't know if that's true for
> chipidea) and sooner or later we'll probably get devicetree overlays,

ChipIdea can be not even one, but two modules (ci_hdrc, the actual
controller driver, always a platform_driver) and platform bindings like
ci13xxx_imx, ci13xxx_pci, ci13xxx_msm, which can be platform or pci or
whatever else drivers.

> so the devicetree nodes might just appear during runtime. Depending on
> initcall order is generally not a good idea.

That's very true.

Regards,
--
Alex
--
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] 54+ messages in thread

* [PATCH v3 3/7] usb: chipidea: usbmisc: fix a potential race condition
@ 2012-11-23  9:01               ` Alexander Shishkin
  0 siblings, 0 replies; 54+ messages in thread
From: Alexander Shishkin @ 2012-11-23  9:01 UTC (permalink / raw)
  To: linux-arm-kernel

Sascha Hauer <s.hauer@pengutronix.de> writes:

> On Fri, Nov 23, 2012 at 01:36:36PM +0800, Peter Chen wrote:
>> On Wed, Nov 21, 2012 at 03:06:29PM +0100, Michael Grzeschik wrote:
>> > From: Marc Kleine-Budde <mkl@pengutronix.de>
>> > 
>> > This fixes a potential race condition where the ci13xxx_imx glue code
>> > could be fast enough to call one of the usbmisc_ops before he got a
>> > valid value on the static usbmisc pointer. To fix that we first set
>> > usbmisc, then call usbmisc_set_ops().
>> 
>> usbmisc is subsys_initcall, and cil13xxx_imx is module_init. Any
>> potential situation that the ci13xxx_imx's probe is ran before the
>> usbmisc's probe is completed?
>
> Not having looked at the code you are referring to at all I just want
> to say that: drivers can be modules (don't know if that's true for
> chipidea) and sooner or later we'll probably get devicetree overlays,

ChipIdea can be not even one, but two modules (ci_hdrc, the actual
controller driver, always a platform_driver) and platform bindings like
ci13xxx_imx, ci13xxx_pci, ci13xxx_msm, which can be platform or pci or
whatever else drivers.

> so the devicetree nodes might just appear during runtime. Depending on
> initcall order is generally not a good idea.

That's very true.

Regards,
--
Alex

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

* Re: [PATCH v3 3/7] usb: chipidea: usbmisc: fix a potential race condition
  2012-11-23  5:36         ` Peter Chen
@ 2012-11-23 10:00           ` Marc Kleine-Budde
  -1 siblings, 0 replies; 54+ messages in thread
From: Marc Kleine-Budde @ 2012-11-23 10:00 UTC (permalink / raw)
  To: Peter Chen
  Cc: Michael Grzeschik, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

[-- Attachment #1: Type: text/plain, Size: 1212 bytes --]

On 11/23/2012 06:36 AM, Peter Chen wrote:
> On Wed, Nov 21, 2012 at 03:06:29PM +0100, Michael Grzeschik wrote:
>> From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
>>
>> This fixes a potential race condition where the ci13xxx_imx glue code
>> could be fast enough to call one of the usbmisc_ops before he got a
>> valid value on the static usbmisc pointer. To fix that we first set
>> usbmisc, then call usbmisc_set_ops().
> 
> usbmisc is subsys_initcall, and cil13xxx_imx is module_init. Any
> potential situation that the ci13xxx_imx's probe is ran before the
> usbmisc's probe is completed? Besides, there is usbmisc_ops value
> check at the beginning of cil13xxx_imx's probe.

It's bad practice to rely your code on some external ordering mechanism,
even more if the correct solution is so simple. And as Sascha pointed
out everything might be build as modules and loaded individually.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

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

* [PATCH v3 3/7] usb: chipidea: usbmisc: fix a potential race condition
@ 2012-11-23 10:00           ` Marc Kleine-Budde
  0 siblings, 0 replies; 54+ messages in thread
From: Marc Kleine-Budde @ 2012-11-23 10:00 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/23/2012 06:36 AM, Peter Chen wrote:
> On Wed, Nov 21, 2012 at 03:06:29PM +0100, Michael Grzeschik wrote:
>> From: Marc Kleine-Budde <mkl@pengutronix.de>
>>
>> This fixes a potential race condition where the ci13xxx_imx glue code
>> could be fast enough to call one of the usbmisc_ops before he got a
>> valid value on the static usbmisc pointer. To fix that we first set
>> usbmisc, then call usbmisc_set_ops().
> 
> usbmisc is subsys_initcall, and cil13xxx_imx is module_init. Any
> potential situation that the ci13xxx_imx's probe is ran before the
> usbmisc's probe is completed? Besides, there is usbmisc_ops value
> check at the beginning of cil13xxx_imx's probe.

It's bad practice to rely your code on some external ordering mechanism,
even more if the correct solution is so simple. And as Sascha pointed
out everything might be build as modules and loaded individually.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121123/0408da18/attachment.sig>

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

* Re: [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
  2012-11-23  6:53         ` Peter Chen
@ 2012-11-23 10:02           ` Marc Kleine-Budde
  -1 siblings, 0 replies; 54+ messages in thread
From: Marc Kleine-Budde @ 2012-11-23 10:02 UTC (permalink / raw)
  To: Peter Chen
  Cc: Michael Grzeschik, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

[-- Attachment #1: Type: text/plain, Size: 1809 bytes --]

On 11/23/2012 07:53 AM, Peter Chen wrote:
> On Wed, Nov 21, 2012 at 03:06:32PM +0100, Michael Grzeschik wrote:
>> This adds mx53 as the next user of the usbmisc driver and makes it
>> possible to disable the overcurrent-detection of the internal phy.
>>
>> Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
>> Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
>> ---
>> Changes since v2:
>> * added defines for register offsets and bitmasks
>> * fixed disable_oc option for all ports
>>
>>  drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
>>  1 file changed, 51 insertions(+)
>>
>> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
>> index e090e0f..b1811df 100644
>> --- a/drivers/usb/chipidea/usbmisc_imx.c
>> +++ b/drivers/usb/chipidea/usbmisc_imx.c
>> @@ -19,6 +19,13 @@
>>  
>>  #define USB_DEV_MAX 4
>>  
>> +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
>> +#define MX53_USB_UH2_CTRL_OFFSET	0x14;
>> +#define MX53_USB_UH3_CTRL_OFFSET	0x18;
>> +#define MX53_BM_OVER_CUR_DIS_H1		BIT(5)
>> +#define MX53_BM_OVER_CUR_DIS_OTG	BIT(8)
>> +#define MX53_BM_OVER_CUR_DIS_UHx	BIT(30)
>> +
>>  #define MX6_BM_OVER_CUR_DIS		BIT(7)
> 
> As every SoC platform's non-core register mapping is different,
> it is better to use .h to put register bit definition

AFAIK in the kernel we don't make extra .h files any more, if there is
only a single user of the contents.

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

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

* [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
@ 2012-11-23 10:02           ` Marc Kleine-Budde
  0 siblings, 0 replies; 54+ messages in thread
From: Marc Kleine-Budde @ 2012-11-23 10:02 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/23/2012 07:53 AM, Peter Chen wrote:
> On Wed, Nov 21, 2012 at 03:06:32PM +0100, Michael Grzeschik wrote:
>> This adds mx53 as the next user of the usbmisc driver and makes it
>> possible to disable the overcurrent-detection of the internal phy.
>>
>> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
>> ---
>> Changes since v2:
>> * added defines for register offsets and bitmasks
>> * fixed disable_oc option for all ports
>>
>>  drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
>>  1 file changed, 51 insertions(+)
>>
>> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
>> index e090e0f..b1811df 100644
>> --- a/drivers/usb/chipidea/usbmisc_imx.c
>> +++ b/drivers/usb/chipidea/usbmisc_imx.c
>> @@ -19,6 +19,13 @@
>>  
>>  #define USB_DEV_MAX 4
>>  
>> +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
>> +#define MX53_USB_UH2_CTRL_OFFSET	0x14;
>> +#define MX53_USB_UH3_CTRL_OFFSET	0x18;
>> +#define MX53_BM_OVER_CUR_DIS_H1		BIT(5)
>> +#define MX53_BM_OVER_CUR_DIS_OTG	BIT(8)
>> +#define MX53_BM_OVER_CUR_DIS_UHx	BIT(30)
>> +
>>  #define MX6_BM_OVER_CUR_DIS		BIT(7)
> 
> As every SoC platform's non-core register mapping is different,
> it is better to use .h to put register bit definition

AFAIK in the kernel we don't make extra .h files any more, if there is
only a single user of the contents.

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121123/f530b8a1/attachment.sig>

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

* Re: [PATCH v3 5/7] usb: chipidea: usbmisc: add support for ahb, ipg and per clock
  2012-11-23  6:51         ` Peter Chen
@ 2012-11-23 16:20           ` Michael Grzeschik
  -1 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-23 16:20 UTC (permalink / raw)
  To: Peter Chen
  Cc: Michael Grzeschik, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Fri, Nov 23, 2012 at 02:51:16PM +0800, Peter Chen wrote:
> On Wed, Nov 21, 2012 at 03:06:31PM +0100, Michael Grzeschik wrote:
> > From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > 
> > This patch adds support for a second and third clock to the usbmisc driver. On
> > modern freescale ARM cores like the imx51, imx53 and imx6q three clocks ("ahb",
> > "ipg" and "per") must be enabled in order to access the USB core.
> 
> The imx6q usb's clock structure is different with old mxc serials (mx3x, mx5x)
> due to different PHY. This patch will cause mx6q's probe fail, the message
> like below:
> 
> imx_usb 2184000.usb: Failed to get clock, err=-2
> imx_usb: probe of 2184000.usb failed with error -2
> 
> The mx5x (50, 51, 53) and mx6q's clock structure like below:
> 
> mx5x:
> - usboh3_ipg_ahb: CCGR2(index13), used to access register
> (like your ahb)

That is probably the one, which already gets enabled inside the
ci13xxx_imx code.

> - usboh3_60M: CCGR2(index14), used to access register at serial phy mode
> as the phy is at serial mode, we need to use it at the first before the phy
> goes to other modes.
> (like your ipg)



> usbphy: used to transfer data
> (like your per)

The "per" clk is a different clk than the usbphy. We have an usbphy clk
aswell on the mx5x. As discussed before [1], we need a solution to enable
the usbphy clk. The current approach is to let the nop-xceiver enable
this.

[1] http://www.spinics.net/lists/linux-usb/msg74489.html

> mx6q:
> - usboh3(Index 162 at DT), used to access register
> - usbphy(Index 182 for otg port at DT), at phy controller

> So, we may consider a way to consolidate both mx6q (mx28) and mxc (mx5x, mx3x)
> platforms.

Yes, we will discuss a real clktree solution in the usbmisc driver for
the different cores. The first thoughts are, that the clk configuration
has completely to be done inside the usbmisc driver. For this, the
usbmisc needs to become a hard dependency for the ci13xxx_imx glue code.

Regards,
Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
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] 54+ messages in thread

* [PATCH v3 5/7] usb: chipidea: usbmisc: add support for ahb, ipg and per clock
@ 2012-11-23 16:20           ` Michael Grzeschik
  0 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-23 16:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Nov 23, 2012 at 02:51:16PM +0800, Peter Chen wrote:
> On Wed, Nov 21, 2012 at 03:06:31PM +0100, Michael Grzeschik wrote:
> > From: Marc Kleine-Budde <mkl@pengutronix.de>
> > 
> > This patch adds support for a second and third clock to the usbmisc driver. On
> > modern freescale ARM cores like the imx51, imx53 and imx6q three clocks ("ahb",
> > "ipg" and "per") must be enabled in order to access the USB core.
> 
> The imx6q usb's clock structure is different with old mxc serials (mx3x, mx5x)
> due to different PHY. This patch will cause mx6q's probe fail, the message
> like below:
> 
> imx_usb 2184000.usb: Failed to get clock, err=-2
> imx_usb: probe of 2184000.usb failed with error -2
> 
> The mx5x (50, 51, 53) and mx6q's clock structure like below:
> 
> mx5x:
> - usboh3_ipg_ahb: CCGR2(index13), used to access register
> (like your ahb)

That is probably the one, which already gets enabled inside the
ci13xxx_imx code.

> - usboh3_60M: CCGR2(index14), used to access register at serial phy mode
> as the phy is at serial mode, we need to use it at the first before the phy
> goes to other modes.
> (like your ipg)



> usbphy: used to transfer data
> (like your per)

The "per" clk is a different clk than the usbphy. We have an usbphy clk
aswell on the mx5x. As discussed before [1], we need a solution to enable
the usbphy clk. The current approach is to let the nop-xceiver enable
this.

[1] http://www.spinics.net/lists/linux-usb/msg74489.html

> mx6q:
> - usboh3(Index 162 at DT), used to access register
> - usbphy(Index 182 for otg port at DT), at phy controller

> So, we may consider a way to consolidate both mx6q (mx28) and mxc (mx5x, mx3x)
> platforms.

Yes, we will discuss a real clktree solution in the usbmisc driver for
the different cores. The first thoughts are, that the clk configuration
has completely to be done inside the usbmisc driver. For this, the
usbmisc needs to become a hard dependency for the ci13xxx_imx glue code.

Regards,
Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
  2012-11-23  7:39           ` Sascha Hauer
@ 2012-11-25  8:05               ` Peter Chen
  -1 siblings, 0 replies; 54+ messages in thread
From: Peter Chen @ 2012-11-25  8:05 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: fabio.estevam-KZfg59tc24xl57MIdRCFDg, Michael Grzeschik,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Fri, Nov 23, 2012 at 08:39:39AM +0100, Sascha Hauer wrote:
> On Fri, Nov 23, 2012 at 02:53:41PM +0800, Peter Chen wrote:
> > On Wed, Nov 21, 2012 at 03:06:32PM +0100, Michael Grzeschik wrote:
> > > This adds mx53 as the next user of the usbmisc driver and makes it
> > > possible to disable the overcurrent-detection of the internal phy.
> > > 
> > > Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > > Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > > ---
> > > Changes since v2:
> > > * added defines for register offsets and bitmasks
> > > * fixed disable_oc option for all ports
> > > 
> > >  drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
> > >  1 file changed, 51 insertions(+)
> > > 
> > > diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> > > index e090e0f..b1811df 100644
> > > --- a/drivers/usb/chipidea/usbmisc_imx.c
> > > +++ b/drivers/usb/chipidea/usbmisc_imx.c
> > > @@ -19,6 +19,13 @@
> > >  
> > >  #define USB_DEV_MAX 4
> > >  
> > > +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
> > > +#define MX53_USB_UH2_CTRL_OFFSET	0x14;
> > > +#define MX53_USB_UH3_CTRL_OFFSET	0x18;
> > > +#define MX53_BM_OVER_CUR_DIS_H1		BIT(5)
> > > +#define MX53_BM_OVER_CUR_DIS_OTG	BIT(8)
> > > +#define MX53_BM_OVER_CUR_DIS_UHx	BIT(30)
> > > +
> > >  #define MX6_BM_OVER_CUR_DIS		BIT(7)
> > 
> > As every SoC platform's non-core register mapping is different,
> > it is better to use .h to put register bit definition
> 
> What do the different register mapping have to do with putting the
> definitions in .h files or not?

No difference, just keep the .c clean and short, as every soc has its
non-core register mapping, so it may occupy several ten lines if
you write down every offset and bit for single SoC, the bit definition 
will grow longer and longer when more SoCs and more function are added.
> 
> Sascha
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 

-- 

Best Regards,
Peter Chen

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

* [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
@ 2012-11-25  8:05               ` Peter Chen
  0 siblings, 0 replies; 54+ messages in thread
From: Peter Chen @ 2012-11-25  8:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Nov 23, 2012 at 08:39:39AM +0100, Sascha Hauer wrote:
> On Fri, Nov 23, 2012 at 02:53:41PM +0800, Peter Chen wrote:
> > On Wed, Nov 21, 2012 at 03:06:32PM +0100, Michael Grzeschik wrote:
> > > This adds mx53 as the next user of the usbmisc driver and makes it
> > > possible to disable the overcurrent-detection of the internal phy.
> > > 
> > > Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> > > Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> > > ---
> > > Changes since v2:
> > > * added defines for register offsets and bitmasks
> > > * fixed disable_oc option for all ports
> > > 
> > >  drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
> > >  1 file changed, 51 insertions(+)
> > > 
> > > diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> > > index e090e0f..b1811df 100644
> > > --- a/drivers/usb/chipidea/usbmisc_imx.c
> > > +++ b/drivers/usb/chipidea/usbmisc_imx.c
> > > @@ -19,6 +19,13 @@
> > >  
> > >  #define USB_DEV_MAX 4
> > >  
> > > +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
> > > +#define MX53_USB_UH2_CTRL_OFFSET	0x14;
> > > +#define MX53_USB_UH3_CTRL_OFFSET	0x18;
> > > +#define MX53_BM_OVER_CUR_DIS_H1		BIT(5)
> > > +#define MX53_BM_OVER_CUR_DIS_OTG	BIT(8)
> > > +#define MX53_BM_OVER_CUR_DIS_UHx	BIT(30)
> > > +
> > >  #define MX6_BM_OVER_CUR_DIS		BIT(7)
> > 
> > As every SoC platform's non-core register mapping is different,
> > it is better to use .h to put register bit definition
> 
> What do the different register mapping have to do with putting the
> definitions in .h files or not?

No difference, just keep the .c clean and short, as every soc has its
non-core register mapping, so it may occupy several ten lines if
you write down every offset and bit for single SoC, the bit definition 
will grow longer and longer when more SoCs and more function are added.
> 
> Sascha
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 

-- 

Best Regards,
Peter Chen

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

* Re: [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
  2012-11-23 10:02           ` Marc Kleine-Budde
@ 2012-11-25  8:09               ` Peter Chen
  -1 siblings, 0 replies; 54+ messages in thread
From: Peter Chen @ 2012-11-25  8:09 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: fabio.estevam-KZfg59tc24xl57MIdRCFDg, Michael Grzeschik,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Fri, Nov 23, 2012 at 11:02:13AM +0100, Marc Kleine-Budde wrote:
> On 11/23/2012 07:53 AM, Peter Chen wrote:
> > On Wed, Nov 21, 2012 at 03:06:32PM +0100, Michael Grzeschik wrote:
> >> This adds mx53 as the next user of the usbmisc driver and makes it
> >> possible to disable the overcurrent-detection of the internal phy.
> >>
> >> Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> >> Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> >> ---
> >> Changes since v2:
> >> * added defines for register offsets and bitmasks
> >> * fixed disable_oc option for all ports
> >>
> >>  drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
> >>  1 file changed, 51 insertions(+)
> >>
> >> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> >> index e090e0f..b1811df 100644
> >> --- a/drivers/usb/chipidea/usbmisc_imx.c
> >> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> >> @@ -19,6 +19,13 @@
> >>  
> >>  #define USB_DEV_MAX 4
> >>  
> >> +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
> >> +#define MX53_USB_UH2_CTRL_OFFSET	0x14;
> >> +#define MX53_USB_UH3_CTRL_OFFSET	0x18;
> >> +#define MX53_BM_OVER_CUR_DIS_H1		BIT(5)
> >> +#define MX53_BM_OVER_CUR_DIS_OTG	BIT(8)
> >> +#define MX53_BM_OVER_CUR_DIS_UHx	BIT(30)
> >> +
> >>  #define MX6_BM_OVER_CUR_DIS		BIT(7)
> > 
> > As every SoC platform's non-core register mapping is different,
> > it is better to use .h to put register bit definition
> 
> AFAIK in the kernel we don't make extra .h files any more, if there is
> only a single user of the contents.
OK, if it is the current rule for kernel, then just keep it.
My original mind was there will be more and more bit definition
in future, and move it to .h to make the code clean and short.
> 
> Marc
> -- 
> Pengutronix e.K.                  | Marc Kleine-Budde           |
> Industrial Linux Solutions        | Phone: +49-231-2826-924     |
> Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
> Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
> 



-- 

Best Regards,
Peter Chen

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

* [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
@ 2012-11-25  8:09               ` Peter Chen
  0 siblings, 0 replies; 54+ messages in thread
From: Peter Chen @ 2012-11-25  8:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Nov 23, 2012 at 11:02:13AM +0100, Marc Kleine-Budde wrote:
> On 11/23/2012 07:53 AM, Peter Chen wrote:
> > On Wed, Nov 21, 2012 at 03:06:32PM +0100, Michael Grzeschik wrote:
> >> This adds mx53 as the next user of the usbmisc driver and makes it
> >> possible to disable the overcurrent-detection of the internal phy.
> >>
> >> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> >> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> >> ---
> >> Changes since v2:
> >> * added defines for register offsets and bitmasks
> >> * fixed disable_oc option for all ports
> >>
> >>  drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
> >>  1 file changed, 51 insertions(+)
> >>
> >> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> >> index e090e0f..b1811df 100644
> >> --- a/drivers/usb/chipidea/usbmisc_imx.c
> >> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> >> @@ -19,6 +19,13 @@
> >>  
> >>  #define USB_DEV_MAX 4
> >>  
> >> +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
> >> +#define MX53_USB_UH2_CTRL_OFFSET	0x14;
> >> +#define MX53_USB_UH3_CTRL_OFFSET	0x18;
> >> +#define MX53_BM_OVER_CUR_DIS_H1		BIT(5)
> >> +#define MX53_BM_OVER_CUR_DIS_OTG	BIT(8)
> >> +#define MX53_BM_OVER_CUR_DIS_UHx	BIT(30)
> >> +
> >>  #define MX6_BM_OVER_CUR_DIS		BIT(7)
> > 
> > As every SoC platform's non-core register mapping is different,
> > it is better to use .h to put register bit definition
> 
> AFAIK in the kernel we don't make extra .h files any more, if there is
> only a single user of the contents.
OK, if it is the current rule for kernel, then just keep it.
My original mind was there will be more and more bit definition
in future, and move it to .h to make the code clean and short.
> 
> Marc
> -- 
> Pengutronix e.K.                  | Marc Kleine-Budde           |
> Industrial Linux Solutions        | Phone: +49-231-2826-924     |
> Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
> Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
> 



-- 

Best Regards,
Peter Chen

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

* Re: [PATCH v3 5/7] usb: chipidea: usbmisc: add support for ahb, ipg and per clock
  2012-11-23 16:20           ` Michael Grzeschik
@ 2012-11-25  9:18               ` Peter Chen
  -1 siblings, 0 replies; 54+ messages in thread
From: Peter Chen @ 2012-11-25  9:18 UTC (permalink / raw)
  To: Michael Grzeschik
  Cc: Michael Grzeschik, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Fri, Nov 23, 2012 at 05:20:51PM +0100, Michael Grzeschik wrote:
> > usbphy: used to transfer data
> > (like your per)
> 
> The "per" clk is a different clk than the usbphy. We have an usbphy clk
> aswell on the mx5x. As discussed before [1], we need a solution to enable
> the usbphy clk. The current approach is to let the nop-xceiver enable
> this.
> 
> [1] http://www.spinics.net/lists/linux-usb/msg74489.html
It does not matter which the name is, this clock is related to usb 480M or 
its source. We use nop-xceiver is just to create struct usb_otg
and usb_phy. Clock information can be at imx specific file like
cil13xxx_imx.

> 
> > mx6q:
> > - usboh3(Index 162 at DT), used to access register
> > - usbphy(Index 182 for otg port at DT), at phy controller
> 
> > So, we may consider a way to consolidate both mx6q (mx28) and mxc (mx5x, mx3x)
> > platforms.
> 
> Yes, we will discuss a real clktree solution in the usbmisc driver for
> the different cores. The first thoughts are, that the clk configuration
> has completely to be done inside the usbmisc driver. For this, the
> usbmisc needs to become a hard dependency for the ci13xxx_imx glue code.

For my mind, imx usb clock handling is better only at place, that is
cil13xxx_imx. We can have imx_clk_enable and imx_clk_disable in it,
and handling clk in imx_clk_enable using id_table or what else platform
specific.
> 
> Regards,
> Michael
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 

-- 

Best Regards,
Peter Chen

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 5/7] usb: chipidea: usbmisc: add support for ahb, ipg and per clock
@ 2012-11-25  9:18               ` Peter Chen
  0 siblings, 0 replies; 54+ messages in thread
From: Peter Chen @ 2012-11-25  9:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Nov 23, 2012 at 05:20:51PM +0100, Michael Grzeschik wrote:
> > usbphy: used to transfer data
> > (like your per)
> 
> The "per" clk is a different clk than the usbphy. We have an usbphy clk
> aswell on the mx5x. As discussed before [1], we need a solution to enable
> the usbphy clk. The current approach is to let the nop-xceiver enable
> this.
> 
> [1] http://www.spinics.net/lists/linux-usb/msg74489.html
It does not matter which the name is, this clock is related to usb 480M or 
its source. We use nop-xceiver is just to create struct usb_otg
and usb_phy. Clock information can be at imx specific file like
cil13xxx_imx.

> 
> > mx6q:
> > - usboh3(Index 162 at DT), used to access register
> > - usbphy(Index 182 for otg port at DT), at phy controller
> 
> > So, we may consider a way to consolidate both mx6q (mx28) and mxc (mx5x, mx3x)
> > platforms.
> 
> Yes, we will discuss a real clktree solution in the usbmisc driver for
> the different cores. The first thoughts are, that the clk configuration
> has completely to be done inside the usbmisc driver. For this, the
> usbmisc needs to become a hard dependency for the ci13xxx_imx glue code.

For my mind, imx usb clock handling is better only at place, that is
cil13xxx_imx. We can have imx_clk_enable and imx_clk_disable in it,
and handling clk in imx_clk_enable using id_table or what else platform
specific.
> 
> Regards,
> Michael
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 

-- 

Best Regards,
Peter Chen

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

* Re: [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
  2012-11-25  8:09               ` Peter Chen
@ 2012-11-26 15:40                 ` Grant Likely
  -1 siblings, 0 replies; 54+ messages in thread
From: Grant Likely @ 2012-11-26 15:40 UTC (permalink / raw)
  To: Peter Chen, Marc Kleine-Budde
  Cc: fabio.estevam-KZfg59tc24xl57MIdRCFDg, Michael Grzeschik,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sun, 25 Nov 2012 16:09:31 +0800, Peter Chen <peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org> wrote:
> On Fri, Nov 23, 2012 at 11:02:13AM +0100, Marc Kleine-Budde wrote:
> > On 11/23/2012 07:53 AM, Peter Chen wrote:
> > > On Wed, Nov 21, 2012 at 03:06:32PM +0100, Michael Grzeschik wrote:
> > >> This adds mx53 as the next user of the usbmisc driver and makes it
> > >> possible to disable the overcurrent-detection of the internal phy.
> > >>
> > >> Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > >> Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > >> ---
> > >> Changes since v2:
> > >> * added defines for register offsets and bitmasks
> > >> * fixed disable_oc option for all ports
> > >>
> > >>  drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
> > >>  1 file changed, 51 insertions(+)
> > >>
> > >> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> > >> index e090e0f..b1811df 100644
> > >> --- a/drivers/usb/chipidea/usbmisc_imx.c
> > >> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> > >> @@ -19,6 +19,13 @@
> > >>  
> > >>  #define USB_DEV_MAX 4
> > >>  
> > >> +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
> > >> +#define MX53_USB_UH2_CTRL_OFFSET	0x14;
> > >> +#define MX53_USB_UH3_CTRL_OFFSET	0x18;
> > >> +#define MX53_BM_OVER_CUR_DIS_H1		BIT(5)
> > >> +#define MX53_BM_OVER_CUR_DIS_OTG	BIT(8)
> > >> +#define MX53_BM_OVER_CUR_DIS_UHx	BIT(30)
> > >> +
> > >>  #define MX6_BM_OVER_CUR_DIS		BIT(7)
> > > 
> > > As every SoC platform's non-core register mapping is different,
> > > it is better to use .h to put register bit definition
> > 
> > AFAIK in the kernel we don't make extra .h files any more, if there is
> > only a single user of the contents.
> OK, if it is the current rule for kernel, then just keep it.
> My original mind was there will be more and more bit definition
> in future, and move it to .h to make the code clean and short.

Yeah. If there is only one user then keep it in the .c file. The kernel
is huge, so keeping things out of the global scope is a GoodThing(tm).

g.

--
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] 54+ messages in thread

* [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support
@ 2012-11-26 15:40                 ` Grant Likely
  0 siblings, 0 replies; 54+ messages in thread
From: Grant Likely @ 2012-11-26 15:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, 25 Nov 2012 16:09:31 +0800, Peter Chen <peter.chen@freescale.com> wrote:
> On Fri, Nov 23, 2012 at 11:02:13AM +0100, Marc Kleine-Budde wrote:
> > On 11/23/2012 07:53 AM, Peter Chen wrote:
> > > On Wed, Nov 21, 2012 at 03:06:32PM +0100, Michael Grzeschik wrote:
> > >> This adds mx53 as the next user of the usbmisc driver and makes it
> > >> possible to disable the overcurrent-detection of the internal phy.
> > >>
> > >> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> > >> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> > >> ---
> > >> Changes since v2:
> > >> * added defines for register offsets and bitmasks
> > >> * fixed disable_oc option for all ports
> > >>
> > >>  drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
> > >>  1 file changed, 51 insertions(+)
> > >>
> > >> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> > >> index e090e0f..b1811df 100644
> > >> --- a/drivers/usb/chipidea/usbmisc_imx.c
> > >> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> > >> @@ -19,6 +19,13 @@
> > >>  
> > >>  #define USB_DEV_MAX 4
> > >>  
> > >> +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08;
> > >> +#define MX53_USB_UH2_CTRL_OFFSET	0x14;
> > >> +#define MX53_USB_UH3_CTRL_OFFSET	0x18;
> > >> +#define MX53_BM_OVER_CUR_DIS_H1		BIT(5)
> > >> +#define MX53_BM_OVER_CUR_DIS_OTG	BIT(8)
> > >> +#define MX53_BM_OVER_CUR_DIS_UHx	BIT(30)
> > >> +
> > >>  #define MX6_BM_OVER_CUR_DIS		BIT(7)
> > > 
> > > As every SoC platform's non-core register mapping is different,
> > > it is better to use .h to put register bit definition
> > 
> > AFAIK in the kernel we don't make extra .h files any more, if there is
> > only a single user of the contents.
> OK, if it is the current rule for kernel, then just keep it.
> My original mind was there will be more and more bit definition
> in future, and move it to .h to make the code clean and short.

Yeah. If there is only one user then keep it in the .c file. The kernel
is huge, so keeping things out of the global scope is a GoodThing(tm).

g.

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

* Re: [PATCH v3 5/7] usb: chipidea: usbmisc: add support for ahb, ipg and per clock
  2012-11-25  9:18               ` Peter Chen
@ 2012-11-26 15:44                 ` Michael Grzeschik
  -1 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-26 15:44 UTC (permalink / raw)
  To: Peter Chen
  Cc: Michael Grzeschik, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Sun, Nov 25, 2012 at 05:18:35PM +0800, Peter Chen wrote:
> On Fri, Nov 23, 2012 at 05:20:51PM +0100, Michael Grzeschik wrote:
> > > usbphy: used to transfer data
> > > (like your per)
> > 
> > The "per" clk is a different clk than the usbphy. We have an usbphy clk
> > aswell on the mx5x. As discussed before [1], we need a solution to enable
> > the usbphy clk. The current approach is to let the nop-xceiver enable
> > this.
> > 
> > [1] http://www.spinics.net/lists/linux-usb/msg74489.html
> It does not matter which the name is, this clock is related to usb 480M or 
> its source. We use nop-xceiver is just to create struct usb_otg
> and usb_phy. Clock information can be at imx specific file like
> cil13xxx_imx.

I think the clock task needs to become a sepreate topic, apart from this
series.

> > 
> > > mx6q:
> > > - usboh3(Index 162 at DT), used to access register
> > > - usbphy(Index 182 for otg port at DT), at phy controller
> > 
> > > So, we may consider a way to consolidate both mx6q (mx28) and mxc (mx5x, mx3x)
> > > platforms.
> > 
> > Yes, we will discuss a real clktree solution in the usbmisc driver for
> > the different cores. The first thoughts are, that the clk configuration
> > has completely to be done inside the usbmisc driver. For this, the
> > usbmisc needs to become a hard dependency for the ci13xxx_imx glue code.
> 
> For my mind, imx usb clock handling is better only at place, that is
> cil13xxx_imx. We can have imx_clk_enable and imx_clk_disable in it,
> and handling clk in imx_clk_enable using id_table or what else platform
> specific.

As already mentioned, the clock layout differs from SoC to SoC.
Therefore the usbmisc can become a mandatory instance over the
ci13xxx_imx instances in all imx cases. This controlling interface can
define the special clock setups and connection types for the underlying
usb cores.

I will send the next series without this clock handling.

Regards,
Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
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] 54+ messages in thread

* [PATCH v3 5/7] usb: chipidea: usbmisc: add support for ahb, ipg and per clock
@ 2012-11-26 15:44                 ` Michael Grzeschik
  0 siblings, 0 replies; 54+ messages in thread
From: Michael Grzeschik @ 2012-11-26 15:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Nov 25, 2012 at 05:18:35PM +0800, Peter Chen wrote:
> On Fri, Nov 23, 2012 at 05:20:51PM +0100, Michael Grzeschik wrote:
> > > usbphy: used to transfer data
> > > (like your per)
> > 
> > The "per" clk is a different clk than the usbphy. We have an usbphy clk
> > aswell on the mx5x. As discussed before [1], we need a solution to enable
> > the usbphy clk. The current approach is to let the nop-xceiver enable
> > this.
> > 
> > [1] http://www.spinics.net/lists/linux-usb/msg74489.html
> It does not matter which the name is, this clock is related to usb 480M or 
> its source. We use nop-xceiver is just to create struct usb_otg
> and usb_phy. Clock information can be at imx specific file like
> cil13xxx_imx.

I think the clock task needs to become a sepreate topic, apart from this
series.

> > 
> > > mx6q:
> > > - usboh3(Index 162 at DT), used to access register
> > > - usbphy(Index 182 for otg port at DT), at phy controller
> > 
> > > So, we may consider a way to consolidate both mx6q (mx28) and mxc (mx5x, mx3x)
> > > platforms.
> > 
> > Yes, we will discuss a real clktree solution in the usbmisc driver for
> > the different cores. The first thoughts are, that the clk configuration
> > has completely to be done inside the usbmisc driver. For this, the
> > usbmisc needs to become a hard dependency for the ci13xxx_imx glue code.
> 
> For my mind, imx usb clock handling is better only at place, that is
> cil13xxx_imx. We can have imx_clk_enable and imx_clk_disable in it,
> and handling clk in imx_clk_enable using id_table or what else platform
> specific.

As already mentioned, the clock layout differs from SoC to SoC.
Therefore the usbmisc can become a mandatory instance over the
ci13xxx_imx instances in all imx cases. This controlling interface can
define the special clock setups and connection types for the underlying
usb cores.

I will send the next series without this clock handling.

Regards,
Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

end of thread, other threads:[~2012-11-26 15:44 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-21 14:06 [PATCH v3 0/7] support other fsl SoCs with usbmisc + small fixes Michael Grzeschik
2012-11-21 14:06 ` Michael Grzeschik
     [not found] ` <1353506793-8354-1-git-send-email-m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-21 14:06   ` [PATCH v3 1/7] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx Michael Grzeschik
2012-11-21 14:06     ` Michael Grzeschik
2012-11-21 14:06   ` [PATCH v3 2/7] usb: chipidea: usbmisc: unset global varibale usbmisc on driver remove Michael Grzeschik
2012-11-21 14:06     ` Michael Grzeschik
2012-11-21 14:06   ` [PATCH v3 3/7] usb: chipidea: usbmisc: fix a potential race condition Michael Grzeschik
2012-11-21 14:06     ` Michael Grzeschik
     [not found]     ` <1353506793-8354-4-git-send-email-m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-23  5:36       ` Peter Chen
2012-11-23  5:36         ` Peter Chen
2012-11-23  7:37         ` Sascha Hauer
2012-11-23  7:37           ` Sascha Hauer
     [not found]           ` <20121123073711.GJ10369-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-23  9:01             ` Alexander Shishkin
2012-11-23  9:01               ` Alexander Shishkin
2012-11-23 10:00         ` Marc Kleine-Budde
2012-11-23 10:00           ` Marc Kleine-Budde
2012-11-21 14:06   ` [PATCH v3 4/7] usb: chipidea: usbmisc: prepare driver to handle more than one soc Michael Grzeschik
2012-11-21 14:06     ` Michael Grzeschik
2012-11-21 14:06   ` [PATCH v3 5/7] usb: chipidea: usbmisc: add support for ahb, ipg and per clock Michael Grzeschik
2012-11-21 14:06     ` Michael Grzeschik
     [not found]     ` <1353506793-8354-6-git-send-email-m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-23  6:51       ` Peter Chen
2012-11-23  6:51         ` Peter Chen
2012-11-23 16:20         ` Michael Grzeschik
2012-11-23 16:20           ` Michael Grzeschik
     [not found]           ` <20121123162051.GA31008-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-25  9:18             ` Peter Chen
2012-11-25  9:18               ` Peter Chen
2012-11-26 15:44               ` Michael Grzeschik
2012-11-26 15:44                 ` Michael Grzeschik
2012-11-21 14:06   ` [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support Michael Grzeschik
2012-11-21 14:06     ` Michael Grzeschik
     [not found]     ` <1353506793-8354-7-git-send-email-m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-21 20:28       ` Sergei Shtylyov
2012-11-21 20:28         ` Sergei Shtylyov
     [not found]         ` <50AD3974.4000608-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org>
2012-11-21 19:58           ` Michael Grzeschik
2012-11-21 19:58             ` Michael Grzeschik
2012-11-23  6:53       ` Peter Chen
2012-11-23  6:53         ` Peter Chen
2012-11-23  7:39         ` Sascha Hauer
2012-11-23  7:39           ` Sascha Hauer
     [not found]           ` <20121123073939.GK10369-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-25  8:05             ` Peter Chen
2012-11-25  8:05               ` Peter Chen
2012-11-23 10:02         ` Marc Kleine-Budde
2012-11-23 10:02           ` Marc Kleine-Budde
     [not found]           ` <50AF49A5.6030708-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-25  8:09             ` Peter Chen
2012-11-25  8:09               ` Peter Chen
2012-11-26 15:40               ` Grant Likely
2012-11-26 15:40                 ` Grant Likely
2012-11-21 14:06   ` [PATCH v3 7/7] usb: chipidea: usbmisc: add post handling and errata fix for mx25 Michael Grzeschik
2012-11-21 14:06     ` Michael Grzeschik
     [not found]     ` <1353506793-8354-8-git-send-email-m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-23  6:59       ` Peter Chen
2012-11-23  6:59         ` Peter Chen
2012-11-22  9:24   ` [PATCH v3 0/7] support other fsl SoCs with usbmisc + small fixes Alexander Shishkin
2012-11-22  9:24     ` Alexander Shishkin
2012-11-22  9:31     ` Peter Chen
2012-11-22  9:31       ` Peter Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.