All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] support other fsl SoCs with usbmisc + small fixes
@ 2012-11-14 11:55 ` Michael Grzeschik
  0 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-14 11:55 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.

Marc Kleine-Budde (3):
  usb: chipidea: usbmisc: unset global varibale usbmisc on driver
    remove
  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/ci13xxx_imx.c                 |   12 +
 drivers/usb/chipidea/ci13xxx_imx.h                 |    3 +
 drivers/usb/chipidea/usbmisc_imx.c                 |  256 ++++++++++++++++++++
 drivers/usb/chipidea/usbmisc_imx6q.c               |  162 -------------
 5 files changed, 273 insertions(+), 162 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] 38+ messages in thread

* [PATCH 0/6] support other fsl SoCs with usbmisc + small fixes
@ 2012-11-14 11:55 ` Michael Grzeschik
  0 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-14 11:55 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.

Marc Kleine-Budde (3):
  usb: chipidea: usbmisc: unset global varibale usbmisc on driver
    remove
  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/ci13xxx_imx.c                 |   12 +
 drivers/usb/chipidea/ci13xxx_imx.h                 |    3 +
 drivers/usb/chipidea/usbmisc_imx.c                 |  256 ++++++++++++++++++++
 drivers/usb/chipidea/usbmisc_imx6q.c               |  162 -------------
 5 files changed, 273 insertions(+), 162 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] 38+ messages in thread

* [PATCH 1/6] usb: chipidea: usbmisc: unset global varibale usbmisc on driver remove
  2012-11-14 11:55 ` Michael Grzeschik
@ 2012-11-14 11:55     ` Michael Grzeschik
  -1 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-14 11:55 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>

While there fix a potential race condition, 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>
---
 drivers/usb/chipidea/usbmisc_imx6q.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/chipidea/usbmisc_imx6q.c b/drivers/usb/chipidea/usbmisc_imx6q.c
index 416e3fc..edc0edd 100644
--- a/drivers/usb/chipidea/usbmisc_imx6q.c
+++ b/drivers/usb/chipidea/usbmisc_imx6q.c
@@ -116,14 +116,14 @@ static int __devinit usbmisc_imx6q_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] 38+ messages in thread

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

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

While there fix a potential race condition, 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>
---
 drivers/usb/chipidea/usbmisc_imx6q.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/chipidea/usbmisc_imx6q.c b/drivers/usb/chipidea/usbmisc_imx6q.c
index 416e3fc..edc0edd 100644
--- a/drivers/usb/chipidea/usbmisc_imx6q.c
+++ b/drivers/usb/chipidea/usbmisc_imx6q.c
@@ -116,14 +116,14 @@ static int __devinit usbmisc_imx6q_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;
 }
 
@@ -131,6 +131,7 @@ static int __devexit usbmisc_imx6q_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] 38+ messages in thread

* [PATCH 2/6] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx
  2012-11-14 11:55 ` Michael Grzeschik
@ 2012-11-14 11:55     ` Michael Grzeschik
  -1 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-14 11:55 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>
---
 drivers/usb/chipidea/usbmisc_imx.c   |  163 ++++++++++++++++++++++++++++++++++
 drivers/usb/chipidea/usbmisc_imx6q.c |  163 ----------------------------------
 2 files changed, 163 insertions(+), 163 deletions(-)
 create mode 100644 drivers/usb/chipidea/usbmisc_imx.c
 delete mode 100644 drivers/usb/chipidea/usbmisc_imx6q.c

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
new file mode 100644
index 0000000..9145e04
--- /dev/null
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -0,0 +1,163 @@
+/*
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <linux/module.h>
+#include <linux/of_platform.h>
+#include <linux/clk.h>
+#include <linux/err.h>
+#include <linux/io.h>
+
+#include "ci13xxx_imx.h"
+
+#define USB_DEV_MAX 4
+
+#define 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];
+};
+
+static struct imx_usbmisc *usbmisc;
+
+static struct usbmisc_usb_device *get_usbdev(struct device *dev)
+{
+	int i, ret;
+
+	for (i = 0; i < USB_DEV_MAX; i++) {
+		if (usbmisc->usbdev[i].dev == dev)
+			return &usbmisc->usbdev[i];
+		else if (!usbmisc->usbdev[i].dev)
+			break;
+	}
+
+	if (i >= USB_DEV_MAX)
+		return ERR_PTR(-EBUSY);
+
+	ret = usbmisc_get_init_data(dev, &usbmisc->usbdev[i]);
+	if (ret)
+		return ERR_PTR(ret);
+
+	return &usbmisc->usbdev[i];
+}
+
+static int usbmisc_imx6q_init(struct device *dev)
+{
+
+	struct usbmisc_usb_device *usbdev;
+	unsigned long flags;
+	u32 reg;
+
+	usbdev = get_usbdev(dev);
+	if (IS_ERR(usbdev))
+		return PTR_ERR(usbdev);
+
+	if (usbdev->disable_oc) {
+		spin_lock_irqsave(&usbmisc->lock, flags);
+		reg = readl(usbmisc->base + usbdev->index * 4);
+		writel(reg | BM_OVER_CUR_DIS,
+			usbmisc->base + usbdev->index * 4);
+		spin_unlock_irqrestore(&usbmisc->lock, flags);
+	}
+
+	return 0;
+}
+
+static const struct usbmisc_ops imx6q_usbmisc_ops = {
+	.init = usbmisc_imx6q_init,
+};
+
+static const struct of_device_id usbmisc_imx_dt_ids[] = {
+	{ .compatible = "fsl,imx6q-usbmisc"},
+	{ /* sentinel */ }
+};
+
+static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
+{
+	struct resource	*res;
+	struct imx_usbmisc *data;
+	int ret;
+
+	if (usbmisc)
+		return -EBUSY;
+
+	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
+
+	spin_lock_init(&data->lock);
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	data->base = devm_request_and_ioremap(&pdev->dev, res);
+	if (!data->base)
+		return -EADDRNOTAVAIL;
+
+	data->clk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(data->clk)) {
+		dev_err(&pdev->dev,
+			"failed to get clock, err=%ld\n", PTR_ERR(data->clk));
+		return PTR_ERR(data->clk);
+	}
+
+	ret = clk_prepare_enable(data->clk);
+	if (ret) {
+		dev_err(&pdev->dev,
+			"clk_prepare_enable failed, err=%d\n", ret);
+		return ret;
+	}
+
+	usbmisc = data;
+	ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
+	if (ret) {
+		usbmisc = NULL;
+		clk_disable_unprepare(data->clk);
+		return ret;
+	}
+
+	return 0;
+}
+
+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;
+}
+
+static struct platform_driver usbmisc_imx_driver = {
+	.probe = usbmisc_imx_probe,
+	.remove = __devexit_p(usbmisc_imx_remove),
+	.driver = {
+		.name = "usbmisc_imx",
+		.owner = THIS_MODULE,
+		.of_match_table = usbmisc_imx_dt_ids,
+	 },
+};
+
+int __init usbmisc_imx_drv_init(void)
+{
+	return platform_driver_register(&usbmisc_imx_driver);
+}
+subsys_initcall(usbmisc_imx_drv_init);
+
+void __exit usbmisc_imx_drv_exit(void)
+{
+	platform_driver_unregister(&usbmisc_imx_driver);
+}
+module_exit(usbmisc_imx_drv_exit);
+
+MODULE_ALIAS("platform:usbmisc-imx");
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("driver for imx usb non-core registers");
+MODULE_AUTHOR("Richard Zhao <richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>");
diff --git a/drivers/usb/chipidea/usbmisc_imx6q.c b/drivers/usb/chipidea/usbmisc_imx6q.c
deleted file mode 100644
index edc0edd..0000000
--- a/drivers/usb/chipidea/usbmisc_imx6q.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright 2012 Freescale Semiconductor, Inc.
- *
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 or later at the following locations:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#include <linux/module.h>
-#include <linux/of_platform.h>
-#include <linux/clk.h>
-#include <linux/err.h>
-#include <linux/io.h>
-
-#include "ci13xxx_imx.h"
-
-#define USB_DEV_MAX 4
-
-#define BM_OVER_CUR_DIS		BIT(7)
-
-struct imx6q_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 usbmisc_usb_device *get_usbdev(struct device *dev)
-{
-	int i, ret;
-
-	for (i = 0; i < USB_DEV_MAX; i++) {
-		if (usbmisc->usbdev[i].dev == dev)
-			return &usbmisc->usbdev[i];
-		else if (!usbmisc->usbdev[i].dev)
-			break;
-	}
-
-	if (i >= USB_DEV_MAX)
-		return ERR_PTR(-EBUSY);
-
-	ret = usbmisc_get_init_data(dev, &usbmisc->usbdev[i]);
-	if (ret)
-		return ERR_PTR(ret);
-
-	return &usbmisc->usbdev[i];
-}
-
-static int usbmisc_imx6q_init(struct device *dev)
-{
-
-	struct usbmisc_usb_device *usbdev;
-	unsigned long flags;
-	u32 reg;
-
-	usbdev = get_usbdev(dev);
-	if (IS_ERR(usbdev))
-		return PTR_ERR(usbdev);
-
-	if (usbdev->disable_oc) {
-		spin_lock_irqsave(&usbmisc->lock, flags);
-		reg = readl(usbmisc->base + usbdev->index * 4);
-		writel(reg | BM_OVER_CUR_DIS,
-			usbmisc->base + usbdev->index * 4);
-		spin_unlock_irqrestore(&usbmisc->lock, flags);
-	}
-
-	return 0;
-}
-
-static const struct usbmisc_ops imx6q_usbmisc_ops = {
-	.init = usbmisc_imx6q_init,
-};
-
-static const struct of_device_id usbmisc_imx6q_dt_ids[] = {
-	{ .compatible = "fsl,imx6q-usbmisc"},
-	{ /* sentinel */ }
-};
-
-static int __devinit usbmisc_imx6q_probe(struct platform_device *pdev)
-{
-	struct resource	*res;
-	struct imx6q_usbmisc *data;
-	int ret;
-
-	if (usbmisc)
-		return -EBUSY;
-
-	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
-	if (!data)
-		return -ENOMEM;
-
-	spin_lock_init(&data->lock);
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	data->base = devm_request_and_ioremap(&pdev->dev, res);
-	if (!data->base)
-		return -EADDRNOTAVAIL;
-
-	data->clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(data->clk)) {
-		dev_err(&pdev->dev,
-			"failed to get clock, err=%ld\n", PTR_ERR(data->clk));
-		return PTR_ERR(data->clk);
-	}
-
-	ret = clk_prepare_enable(data->clk);
-	if (ret) {
-		dev_err(&pdev->dev,
-			"clk_prepare_enable failed, err=%d\n", ret);
-		return ret;
-	}
-
-	usbmisc = data;
-	ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
-	if (ret) {
-		usbmisc = NULL;
-		clk_disable_unprepare(data->clk);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int __devexit usbmisc_imx6q_remove(struct platform_device *pdev)
-{
-	usbmisc_unset_ops(&imx6q_usbmisc_ops);
-	clk_disable_unprepare(usbmisc->clk);
-	usbmisc = NULL;
-	return 0;
-}
-
-static struct platform_driver usbmisc_imx6q_driver = {
-	.probe = usbmisc_imx6q_probe,
-	.remove = __devexit_p(usbmisc_imx6q_remove),
-	.driver = {
-		.name = "usbmisc_imx6q",
-		.owner = THIS_MODULE,
-		.of_match_table = usbmisc_imx6q_dt_ids,
-	 },
-};
-
-int __init usbmisc_imx6q_drv_init(void)
-{
-	return platform_driver_register(&usbmisc_imx6q_driver);
-}
-subsys_initcall(usbmisc_imx6q_drv_init);
-
-void __exit usbmisc_imx6q_drv_exit(void)
-{
-	platform_driver_unregister(&usbmisc_imx6q_driver);
-}
-module_exit(usbmisc_imx6q_drv_exit);

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

* [PATCH 2/6] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx
@ 2012-11-14 11:55     ` Michael Grzeschik
  0 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-14 11:55 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>
---
 drivers/usb/chipidea/usbmisc_imx.c   |  163 ++++++++++++++++++++++++++++++++++
 drivers/usb/chipidea/usbmisc_imx6q.c |  163 ----------------------------------
 2 files changed, 163 insertions(+), 163 deletions(-)
 create mode 100644 drivers/usb/chipidea/usbmisc_imx.c
 delete mode 100644 drivers/usb/chipidea/usbmisc_imx6q.c

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
new file mode 100644
index 0000000..9145e04
--- /dev/null
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -0,0 +1,163 @@
+/*
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <linux/module.h>
+#include <linux/of_platform.h>
+#include <linux/clk.h>
+#include <linux/err.h>
+#include <linux/io.h>
+
+#include "ci13xxx_imx.h"
+
+#define USB_DEV_MAX 4
+
+#define 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];
+};
+
+static struct imx_usbmisc *usbmisc;
+
+static struct usbmisc_usb_device *get_usbdev(struct device *dev)
+{
+	int i, ret;
+
+	for (i = 0; i < USB_DEV_MAX; i++) {
+		if (usbmisc->usbdev[i].dev == dev)
+			return &usbmisc->usbdev[i];
+		else if (!usbmisc->usbdev[i].dev)
+			break;
+	}
+
+	if (i >= USB_DEV_MAX)
+		return ERR_PTR(-EBUSY);
+
+	ret = usbmisc_get_init_data(dev, &usbmisc->usbdev[i]);
+	if (ret)
+		return ERR_PTR(ret);
+
+	return &usbmisc->usbdev[i];
+}
+
+static int usbmisc_imx6q_init(struct device *dev)
+{
+
+	struct usbmisc_usb_device *usbdev;
+	unsigned long flags;
+	u32 reg;
+
+	usbdev = get_usbdev(dev);
+	if (IS_ERR(usbdev))
+		return PTR_ERR(usbdev);
+
+	if (usbdev->disable_oc) {
+		spin_lock_irqsave(&usbmisc->lock, flags);
+		reg = readl(usbmisc->base + usbdev->index * 4);
+		writel(reg | BM_OVER_CUR_DIS,
+			usbmisc->base + usbdev->index * 4);
+		spin_unlock_irqrestore(&usbmisc->lock, flags);
+	}
+
+	return 0;
+}
+
+static const struct usbmisc_ops imx6q_usbmisc_ops = {
+	.init = usbmisc_imx6q_init,
+};
+
+static const struct of_device_id usbmisc_imx_dt_ids[] = {
+	{ .compatible = "fsl,imx6q-usbmisc"},
+	{ /* sentinel */ }
+};
+
+static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
+{
+	struct resource	*res;
+	struct imx_usbmisc *data;
+	int ret;
+
+	if (usbmisc)
+		return -EBUSY;
+
+	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
+
+	spin_lock_init(&data->lock);
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	data->base = devm_request_and_ioremap(&pdev->dev, res);
+	if (!data->base)
+		return -EADDRNOTAVAIL;
+
+	data->clk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(data->clk)) {
+		dev_err(&pdev->dev,
+			"failed to get clock, err=%ld\n", PTR_ERR(data->clk));
+		return PTR_ERR(data->clk);
+	}
+
+	ret = clk_prepare_enable(data->clk);
+	if (ret) {
+		dev_err(&pdev->dev,
+			"clk_prepare_enable failed, err=%d\n", ret);
+		return ret;
+	}
+
+	usbmisc = data;
+	ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
+	if (ret) {
+		usbmisc = NULL;
+		clk_disable_unprepare(data->clk);
+		return ret;
+	}
+
+	return 0;
+}
+
+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;
+}
+
+static struct platform_driver usbmisc_imx_driver = {
+	.probe = usbmisc_imx_probe,
+	.remove = __devexit_p(usbmisc_imx_remove),
+	.driver = {
+		.name = "usbmisc_imx",
+		.owner = THIS_MODULE,
+		.of_match_table = usbmisc_imx_dt_ids,
+	 },
+};
+
+int __init usbmisc_imx_drv_init(void)
+{
+	return platform_driver_register(&usbmisc_imx_driver);
+}
+subsys_initcall(usbmisc_imx_drv_init);
+
+void __exit usbmisc_imx_drv_exit(void)
+{
+	platform_driver_unregister(&usbmisc_imx_driver);
+}
+module_exit(usbmisc_imx_drv_exit);
+
+MODULE_ALIAS("platform:usbmisc-imx");
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("driver for imx usb non-core registers");
+MODULE_AUTHOR("Richard Zhao <richard.zhao@freescale.com>");
diff --git a/drivers/usb/chipidea/usbmisc_imx6q.c b/drivers/usb/chipidea/usbmisc_imx6q.c
deleted file mode 100644
index edc0edd..0000000
--- a/drivers/usb/chipidea/usbmisc_imx6q.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright 2012 Freescale Semiconductor, Inc.
- *
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 or later at the following locations:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#include <linux/module.h>
-#include <linux/of_platform.h>
-#include <linux/clk.h>
-#include <linux/err.h>
-#include <linux/io.h>
-
-#include "ci13xxx_imx.h"
-
-#define USB_DEV_MAX 4
-
-#define BM_OVER_CUR_DIS		BIT(7)
-
-struct imx6q_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 usbmisc_usb_device *get_usbdev(struct device *dev)
-{
-	int i, ret;
-
-	for (i = 0; i < USB_DEV_MAX; i++) {
-		if (usbmisc->usbdev[i].dev == dev)
-			return &usbmisc->usbdev[i];
-		else if (!usbmisc->usbdev[i].dev)
-			break;
-	}
-
-	if (i >= USB_DEV_MAX)
-		return ERR_PTR(-EBUSY);
-
-	ret = usbmisc_get_init_data(dev, &usbmisc->usbdev[i]);
-	if (ret)
-		return ERR_PTR(ret);
-
-	return &usbmisc->usbdev[i];
-}
-
-static int usbmisc_imx6q_init(struct device *dev)
-{
-
-	struct usbmisc_usb_device *usbdev;
-	unsigned long flags;
-	u32 reg;
-
-	usbdev = get_usbdev(dev);
-	if (IS_ERR(usbdev))
-		return PTR_ERR(usbdev);
-
-	if (usbdev->disable_oc) {
-		spin_lock_irqsave(&usbmisc->lock, flags);
-		reg = readl(usbmisc->base + usbdev->index * 4);
-		writel(reg | BM_OVER_CUR_DIS,
-			usbmisc->base + usbdev->index * 4);
-		spin_unlock_irqrestore(&usbmisc->lock, flags);
-	}
-
-	return 0;
-}
-
-static const struct usbmisc_ops imx6q_usbmisc_ops = {
-	.init = usbmisc_imx6q_init,
-};
-
-static const struct of_device_id usbmisc_imx6q_dt_ids[] = {
-	{ .compatible = "fsl,imx6q-usbmisc"},
-	{ /* sentinel */ }
-};
-
-static int __devinit usbmisc_imx6q_probe(struct platform_device *pdev)
-{
-	struct resource	*res;
-	struct imx6q_usbmisc *data;
-	int ret;
-
-	if (usbmisc)
-		return -EBUSY;
-
-	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
-	if (!data)
-		return -ENOMEM;
-
-	spin_lock_init(&data->lock);
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	data->base = devm_request_and_ioremap(&pdev->dev, res);
-	if (!data->base)
-		return -EADDRNOTAVAIL;
-
-	data->clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(data->clk)) {
-		dev_err(&pdev->dev,
-			"failed to get clock, err=%ld\n", PTR_ERR(data->clk));
-		return PTR_ERR(data->clk);
-	}
-
-	ret = clk_prepare_enable(data->clk);
-	if (ret) {
-		dev_err(&pdev->dev,
-			"clk_prepare_enable failed, err=%d\n", ret);
-		return ret;
-	}
-
-	usbmisc = data;
-	ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
-	if (ret) {
-		usbmisc = NULL;
-		clk_disable_unprepare(data->clk);
-		return ret;
-	}
-
-	return 0;
-}
-
-static int __devexit usbmisc_imx6q_remove(struct platform_device *pdev)
-{
-	usbmisc_unset_ops(&imx6q_usbmisc_ops);
-	clk_disable_unprepare(usbmisc->clk);
-	usbmisc = NULL;
-	return 0;
-}
-
-static struct platform_driver usbmisc_imx6q_driver = {
-	.probe = usbmisc_imx6q_probe,
-	.remove = __devexit_p(usbmisc_imx6q_remove),
-	.driver = {
-		.name = "usbmisc_imx6q",
-		.owner = THIS_MODULE,
-		.of_match_table = usbmisc_imx6q_dt_ids,
-	 },
-};
-
-int __init usbmisc_imx6q_drv_init(void)
-{
-	return platform_driver_register(&usbmisc_imx6q_driver);
-}
-subsys_initcall(usbmisc_imx6q_drv_init);
-
-void __exit usbmisc_imx6q_drv_exit(void)
-{
-	platform_driver_unregister(&usbmisc_imx6q_driver);
-}
-module_exit(usbmisc_imx6q_drv_exit);
-
-MODULE_ALIAS("platform:usbmisc-imx6q");
-MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("driver for imx6q usb non-core registers");
-MODULE_AUTHOR("Richard Zhao <richard.zhao@freescale.com>");
-- 
1.7.10.4

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

* [PATCH 3/6] usb: chipidea: usbmisc: prepare driver to handle more than one soc
  2012-11-14 11:55 ` Michael Grzeschik
@ 2012-11-14 11:55     ` Michael Grzeschik
  -1 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-14 11:55 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>
---
 drivers/usb/chipidea/usbmisc_imx.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 9145e04..72445f7 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -26,6 +26,7 @@ struct imx_usbmisc {
 	spinlock_t lock;
 	struct clk *clk;
 	struct usbmisc_usb_device usbdev[USB_DEV_MAX];
+	const struct usbmisc_ops *ops;
 };
 
 static struct imx_usbmisc *usbmisc;
@@ -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_imx6q_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] 38+ messages in thread

* [PATCH 3/6] usb: chipidea: usbmisc: prepare driver to handle more than one soc
@ 2012-11-14 11:55     ` Michael Grzeschik
  0 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-14 11:55 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>
---
 drivers/usb/chipidea/usbmisc_imx.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 9145e04..72445f7 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -26,6 +26,7 @@ struct imx_usbmisc {
 	spinlock_t lock;
 	struct clk *clk;
 	struct usbmisc_usb_device usbdev[USB_DEV_MAX];
+	const struct usbmisc_ops *ops;
 };
 
 static struct imx_usbmisc *usbmisc;
@@ -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_imx6q_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] 38+ messages in thread

* [PATCH 4/6] usb: chipidea: usbmisc: add support for ahb, ipg and per clock
  2012-11-14 11:55 ` Michael Grzeschik
@ 2012-11-14 11:55     ` Michael Grzeschik
  -1 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-14 11:55 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 ahb, ipg and per clock, which is needed to support
imx53.

Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
 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 72445f7..239b752 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_imx6q_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] 38+ messages in thread

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

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

This patch adds support for ahb, ipg and per clock, which is needed to support
imx53.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 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 72445f7..239b752 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_imx6q_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] 38+ messages in thread

* [PATCH 5/6] usb: chipidea: usbmisc: add mx53 support
  2012-11-14 11:55 ` Michael Grzeschik
@ 2012-11-14 11:55     ` Michael Grzeschik
  -1 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-14 11:55 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>
---
 drivers/usb/chipidea/usbmisc_imx.c |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 239b752..4ddc872 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -54,6 +54,29 @@ 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);
+
+	reg = usbmisc->base + usbdev->index * 8;
+
+	if (usbdev->disable_oc) {
+		spin_lock_irqsave(&usbmisc->lock, flags);
+		val = readl(reg);
+		writel(val | (1 << 5), reg);
+		spin_unlock_irqrestore(&usbmisc->lock, flags);
+	}
+
+	return 0;
+}
+
 static int usbmisc_imx6q_init(struct device *dev)
 {
 
@@ -76,11 +99,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] 38+ messages in thread

* [PATCH 5/6] usb: chipidea: usbmisc: add mx53 support
@ 2012-11-14 11:55     ` Michael Grzeschik
  0 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-14 11:55 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>
---
 drivers/usb/chipidea/usbmisc_imx.c |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 239b752..4ddc872 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -54,6 +54,29 @@ 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);
+
+	reg = usbmisc->base + usbdev->index * 8;
+
+	if (usbdev->disable_oc) {
+		spin_lock_irqsave(&usbmisc->lock, flags);
+		val = readl(reg);
+		writel(val | (1 << 5), reg);
+		spin_unlock_irqrestore(&usbmisc->lock, flags);
+	}
+
+	return 0;
+}
+
 static int usbmisc_imx6q_init(struct device *dev)
 {
 
@@ -76,11 +99,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] 38+ messages in thread

* [PATCH 6/6] usb: chipidea: usbmisc: add post handling and errata fix for mx25
  2012-11-14 11:55 ` Michael Grzeschik
@ 2012-11-14 11:55     ` Michael Grzeschik
  -1 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-14 11:55 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>
---
 .../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                 |   30 ++++++++++++++++++++
 4 files changed, 47 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..095fee5 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 err;
+		}
+	}
+
 	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 4ddc872..1b15a20 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -14,6 +14,7 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/io.h>
+#include <linux/delay.h>
 
 #include "ci13xxx_imx.h"
 
@@ -54,6 +55,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 + 0x08;
+
+	if (usbdev->evdo) {
+		spin_lock_irqsave(&usbmisc->lock, flags);
+		val = readl(reg);
+		writel(val | (1 << 23), 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;
@@ -99,6 +124,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,
 };
@@ -108,6 +137,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] 38+ messages in thread

* [PATCH 6/6] usb: chipidea: usbmisc: add post handling and errata fix for mx25
@ 2012-11-14 11:55     ` Michael Grzeschik
  0 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-14 11:55 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>
---
 .../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                 |   30 ++++++++++++++++++++
 4 files changed, 47 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..095fee5 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 err;
+		}
+	}
+
 	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 4ddc872..1b15a20 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -14,6 +14,7 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/io.h>
+#include <linux/delay.h>
 
 #include "ci13xxx_imx.h"
 
@@ -54,6 +55,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 + 0x08;
+
+	if (usbdev->evdo) {
+		spin_lock_irqsave(&usbmisc->lock, flags);
+		val = readl(reg);
+		writel(val | (1 << 23), 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;
@@ -99,6 +124,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,
 };
@@ -108,6 +137,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] 38+ messages in thread

* Re: [PATCH 2/6] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx
  2012-11-14 11:55     ` Michael Grzeschik
@ 2012-11-14 11:57         ` Fabio Estevam
  -1 siblings, 0 replies; 38+ messages in thread
From: Fabio Estevam @ 2012-11-14 11:57 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

Hi Michael,

On Wed, Nov 14, 2012 at 9:55 AM, Michael Grzeschik
<m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
> 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>
> ---
>  drivers/usb/chipidea/usbmisc_imx.c   |  163 ++++++++++++++++++++++++++++++++++
>  drivers/usb/chipidea/usbmisc_imx6q.c |  163 ----------------------------------

Please use git mv / git format -M so that git can detect the file rename.

Thanks,

Fabio Estevam
--
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] 38+ messages in thread

* [PATCH 2/6] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx
@ 2012-11-14 11:57         ` Fabio Estevam
  0 siblings, 0 replies; 38+ messages in thread
From: Fabio Estevam @ 2012-11-14 11:57 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Michael,

On Wed, Nov 14, 2012 at 9:55 AM, Michael Grzeschik
<m.grzeschik@pengutronix.de> wrote:
> 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>
> ---
>  drivers/usb/chipidea/usbmisc_imx.c   |  163 ++++++++++++++++++++++++++++++++++
>  drivers/usb/chipidea/usbmisc_imx6q.c |  163 ----------------------------------

Please use git mv / git format -M so that git can detect the file rename.

Thanks,

Fabio Estevam

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

* Re: [PATCH 1/6] usb: chipidea: usbmisc: unset global varibale usbmisc on driver remove
  2012-11-14 11:55     ` Michael Grzeschik
@ 2012-11-14 13:22         ` Alexander Shishkin
  -1 siblings, 0 replies; 38+ messages in thread
From: Alexander Shishkin @ 2012-11-14 13:22 UTC (permalink / raw)
  To: Michael Grzeschik, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

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

> From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
>
> While there fix a potential race condition, first set usbmisc, then call
> usbmisc_set_ops().

This should be really two separate patches, both of which could use
more elaborate commit messages. That is, if you unset variable, what
kind of scenario it prevents, what exactly is the potential race
condition, etc. Saves time for everybody.

>
> Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> ---
>  drivers/usb/chipidea/usbmisc_imx6q.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

I'd also move the renaming patch in front of everything else, but that's
up to you.

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

* [PATCH 1/6] usb: chipidea: usbmisc: unset global varibale usbmisc on driver remove
@ 2012-11-14 13:22         ` Alexander Shishkin
  0 siblings, 0 replies; 38+ messages in thread
From: Alexander Shishkin @ 2012-11-14 13:22 UTC (permalink / raw)
  To: linux-arm-kernel

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

> From: Marc Kleine-Budde <mkl@pengutronix.de>
>
> While there fix a potential race condition, first set usbmisc, then call
> usbmisc_set_ops().

This should be really two separate patches, both of which could use
more elaborate commit messages. That is, if you unset variable, what
kind of scenario it prevents, what exactly is the potential race
condition, etc. Saves time for everybody.

>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
>  drivers/usb/chipidea/usbmisc_imx6q.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

I'd also move the renaming patch in front of everything else, but that's
up to you.

Regards,
--
Alex

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

* Re: [PATCH 2/6] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx
  2012-11-14 11:55     ` Michael Grzeschik
@ 2012-11-14 13:25         ` Alexander Shishkin
  -1 siblings, 0 replies; 38+ messages in thread
From: Alexander Shishkin @ 2012-11-14 13:25 UTC (permalink / raw)
  To: Michael Grzeschik, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

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

> 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>
> ---
>  drivers/usb/chipidea/usbmisc_imx.c   |  163 ++++++++++++++++++++++++++++++++++
>  drivers/usb/chipidea/usbmisc_imx6q.c |  163 ----------------------------------
>  2 files changed, 163 insertions(+), 163 deletions(-)
>  create mode 100644 drivers/usb/chipidea/usbmisc_imx.c
>  delete mode 100644 drivers/usb/chipidea/usbmisc_imx6q.c

Like Fabio suggested already, please use rename detection.
Another thing, how do you get away with this without fixing the Makefile
accordingly? Did you (at least) compile-test this patchset?

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

* [PATCH 2/6] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx
@ 2012-11-14 13:25         ` Alexander Shishkin
  0 siblings, 0 replies; 38+ messages in thread
From: Alexander Shishkin @ 2012-11-14 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

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

> 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>
> ---
>  drivers/usb/chipidea/usbmisc_imx.c   |  163 ++++++++++++++++++++++++++++++++++
>  drivers/usb/chipidea/usbmisc_imx6q.c |  163 ----------------------------------
>  2 files changed, 163 insertions(+), 163 deletions(-)
>  create mode 100644 drivers/usb/chipidea/usbmisc_imx.c
>  delete mode 100644 drivers/usb/chipidea/usbmisc_imx6q.c

Like Fabio suggested already, please use rename detection.
Another thing, how do you get away with this without fixing the Makefile
accordingly? Did you (at least) compile-test this patchset?

Regards,
--
Alex

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

* Re: [PATCH 2/6] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx
  2012-11-14 13:25         ` Alexander Shishkin
@ 2012-11-14 13:28             ` Michael Grzeschik
  -1 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-14 13:28 UTC (permalink / raw)
  To: Alexander Shishkin
  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

On Wed, Nov 14, 2012 at 03:25:30PM +0200, Alexander Shishkin wrote:
> Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> writes:
> 
> > 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>
> > ---
> >  drivers/usb/chipidea/usbmisc_imx.c   |  163 ++++++++++++++++++++++++++++++++++
> >  drivers/usb/chipidea/usbmisc_imx6q.c |  163 ----------------------------------
> >  2 files changed, 163 insertions(+), 163 deletions(-)
> >  create mode 100644 drivers/usb/chipidea/usbmisc_imx.c
> >  delete mode 100644 drivers/usb/chipidea/usbmisc_imx6q.c
> 
> Like Fabio suggested already, please use rename detection.
> Another thing, how do you get away with this without fixing the Makefile
> accordingly? Did you (at least) compile-test this patchset?

You are right, i have compile tested this patchset before adding this
patch. Sorry for that, i will test the whole series again on my
platform (mx53), before sending v2.

Regars,
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] 38+ messages in thread

* [PATCH 2/6] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx
@ 2012-11-14 13:28             ` Michael Grzeschik
  0 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-14 13:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 14, 2012 at 03:25:30PM +0200, Alexander Shishkin wrote:
> Michael Grzeschik <m.grzeschik@pengutronix.de> writes:
> 
> > 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>
> > ---
> >  drivers/usb/chipidea/usbmisc_imx.c   |  163 ++++++++++++++++++++++++++++++++++
> >  drivers/usb/chipidea/usbmisc_imx6q.c |  163 ----------------------------------
> >  2 files changed, 163 insertions(+), 163 deletions(-)
> >  create mode 100644 drivers/usb/chipidea/usbmisc_imx.c
> >  delete mode 100644 drivers/usb/chipidea/usbmisc_imx6q.c
> 
> Like Fabio suggested already, please use rename detection.
> Another thing, how do you get away with this without fixing the Makefile
> accordingly? Did you (at least) compile-test this patchset?

You are right, i have compile tested this patchset before adding this
patch. Sorry for that, i will test the whole series again on my
platform (mx53), before sending v2.

Regars,
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] 38+ messages in thread

* Re: [PATCH 2/6] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx
  2012-11-14 13:28             ` Michael Grzeschik
@ 2012-11-14 13:32                 ` Alexander Shishkin
  -1 siblings, 0 replies; 38+ messages in thread
From: Alexander Shishkin @ 2012-11-14 13:32 UTC (permalink / raw)
  To: Michael Grzeschik
  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

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

> On Wed, Nov 14, 2012 at 03:25:30PM +0200, Alexander Shishkin wrote:
>> Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> writes:
>> 
>> > 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>
>> > ---
>> >  drivers/usb/chipidea/usbmisc_imx.c   |  163 ++++++++++++++++++++++++++++++++++
>> >  drivers/usb/chipidea/usbmisc_imx6q.c |  163 ----------------------------------
>> >  2 files changed, 163 insertions(+), 163 deletions(-)
>> >  create mode 100644 drivers/usb/chipidea/usbmisc_imx.c
>> >  delete mode 100644 drivers/usb/chipidea/usbmisc_imx6q.c
>> 
>> Like Fabio suggested already, please use rename detection.
>> Another thing, how do you get away with this without fixing the Makefile
>> accordingly? Did you (at least) compile-test this patchset?
>
> You are right, i have compile tested this patchset before adding this
> patch. Sorry for that, i will test the whole series again on my
> platform (mx53), before sending v2.

Thanks!

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

* [PATCH 2/6] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx
@ 2012-11-14 13:32                 ` Alexander Shishkin
  0 siblings, 0 replies; 38+ messages in thread
From: Alexander Shishkin @ 2012-11-14 13:32 UTC (permalink / raw)
  To: linux-arm-kernel

Michael Grzeschik <mgr@pengutronix.de> writes:

> On Wed, Nov 14, 2012 at 03:25:30PM +0200, Alexander Shishkin wrote:
>> Michael Grzeschik <m.grzeschik@pengutronix.de> writes:
>> 
>> > 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>
>> > ---
>> >  drivers/usb/chipidea/usbmisc_imx.c   |  163 ++++++++++++++++++++++++++++++++++
>> >  drivers/usb/chipidea/usbmisc_imx6q.c |  163 ----------------------------------
>> >  2 files changed, 163 insertions(+), 163 deletions(-)
>> >  create mode 100644 drivers/usb/chipidea/usbmisc_imx.c
>> >  delete mode 100644 drivers/usb/chipidea/usbmisc_imx6q.c
>> 
>> Like Fabio suggested already, please use rename detection.
>> Another thing, how do you get away with this without fixing the Makefile
>> accordingly? Did you (at least) compile-test this patchset?
>
> You are right, i have compile tested this patchset before adding this
> patch. Sorry for that, i will test the whole series again on my
> platform (mx53), before sending v2.

Thanks!

Regards,
--
Alex

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

* Re: [PATCH 4/6] usb: chipidea: usbmisc: add support for ahb, ipg and per clock
  2012-11-14 11:55     ` Michael Grzeschik
@ 2012-11-14 13:39         ` Alexander Shishkin
  -1 siblings, 0 replies; 38+ messages in thread
From: Alexander Shishkin @ 2012-11-14 13:39 UTC (permalink / raw)
  To: Michael Grzeschik, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

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

> From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
>
> This patch adds support for ahb, ipg and per clock, which is needed to support
> imx53.

I would also suggest using a more elaborate wording here, some people
might also be interested what are the different clocks for (like,
interface, peripheral, etc etc).

>
> Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> ---
>  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 72445f7..239b752 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");

I suppose the clock names are also being added/changed in the platform
code in another patchset that's also being queued? What's the target
merge window (if there's a dependency)?

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

* [PATCH 4/6] usb: chipidea: usbmisc: add support for ahb, ipg and per clock
@ 2012-11-14 13:39         ` Alexander Shishkin
  0 siblings, 0 replies; 38+ messages in thread
From: Alexander Shishkin @ 2012-11-14 13:39 UTC (permalink / raw)
  To: linux-arm-kernel

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

> From: Marc Kleine-Budde <mkl@pengutronix.de>
>
> This patch adds support for ahb, ipg and per clock, which is needed to support
> imx53.

I would also suggest using a more elaborate wording here, some people
might also be interested what are the different clocks for (like,
interface, peripheral, etc etc).

>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
>  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 72445f7..239b752 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");

I suppose the clock names are also being added/changed in the platform
code in another patchset that's also being queued? What's the target
merge window (if there's a dependency)?

Regards,
--
Alex

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

* Re: [PATCH 4/6] usb: chipidea: usbmisc: add support for ahb, ipg and per clock
  2012-11-14 13:39         ` Alexander Shishkin
@ 2012-11-14 15:27             ` Michael Grzeschik
  -1 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-14 15:27 UTC (permalink / raw)
  To: Alexander Shishkin
  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

On Wed, Nov 14, 2012 at 03:39:11PM +0200, Alexander Shishkin wrote:
> Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> writes:
> 
> > From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> >
> > This patch adds support for ahb, ipg and per clock, which is needed to support
> > imx53.
> 
> I would also suggest using a more elaborate wording here, some people
> might also be interested what are the different clocks for (like,
> interface, peripheral, etc etc).
> 

Will do in V2.

> >
> > Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > ---
> >  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 72445f7..239b752 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");
> 
> I suppose the clock names are also being added/changed in the platform
> code in another patchset that's also being queued? What's the target
> merge window (if there's a dependency)?

Yes we have more branches to be published next. One of them is
adding the usb device tree nodes and clock entries for mx53.

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

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

On Wed, Nov 14, 2012 at 03:39:11PM +0200, Alexander Shishkin wrote:
> Michael Grzeschik <m.grzeschik@pengutronix.de> writes:
> 
> > From: Marc Kleine-Budde <mkl@pengutronix.de>
> >
> > This patch adds support for ahb, ipg and per clock, which is needed to support
> > imx53.
> 
> I would also suggest using a more elaborate wording here, some people
> might also be interested what are the different clocks for (like,
> interface, peripheral, etc etc).
> 

Will do in V2.

> >
> > Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> > Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> > ---
> >  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 72445f7..239b752 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");
> 
> I suppose the clock names are also being added/changed in the platform
> code in another patchset that's also being queued? What's the target
> merge window (if there's a dependency)?

Yes we have more branches to be published next. One of them is
adding the usb device tree nodes and clock entries for mx53.

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

* Re: [PATCH 2/6] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx
  2012-11-14 11:57         ` Fabio Estevam
@ 2012-11-14 15:32             ` Michael Grzeschik
  -1 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-14 15:32 UTC (permalink / raw)
  To: Fabio Estevam
  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 14, 2012 at 09:57:50AM -0200, Fabio Estevam wrote:
> Hi Michael,
> 
> On Wed, Nov 14, 2012 at 9:55 AM, Michael Grzeschik
> <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
> > 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>
> > ---
> >  drivers/usb/chipidea/usbmisc_imx.c   |  163 ++++++++++++++++++++++++++++++++++
> >  drivers/usb/chipidea/usbmisc_imx6q.c |  163 ----------------------------------
> 
> Please use git mv / git format -M so that git can detect the file rename.

I have created this patch with git mv. Until now, i did not know
that git send-email needs -M to stick with the git format.

Will change that in V2.

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

* [PATCH 2/6] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx
@ 2012-11-14 15:32             ` Michael Grzeschik
  0 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-14 15:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 14, 2012 at 09:57:50AM -0200, Fabio Estevam wrote:
> Hi Michael,
> 
> On Wed, Nov 14, 2012 at 9:55 AM, Michael Grzeschik
> <m.grzeschik@pengutronix.de> wrote:
> > 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>
> > ---
> >  drivers/usb/chipidea/usbmisc_imx.c   |  163 ++++++++++++++++++++++++++++++++++
> >  drivers/usb/chipidea/usbmisc_imx6q.c |  163 ----------------------------------
> 
> Please use git mv / git format -M so that git can detect the file rename.

I have created this patch with git mv. Until now, i did not know
that git send-email needs -M to stick with the git format.

Will change that in V2.

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

* Re: [PATCH 6/6] usb: chipidea: usbmisc: add post handling and errata fix for mx25
  2012-11-14 11:55     ` Michael Grzeschik
@ 2012-11-15 10:08         ` Martin Fuzzey
  -1 siblings, 0 replies; 38+ messages in thread
From: Martin Fuzzey @ 2012-11-15 10:08 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

Hi,

On Wed, Nov 14, 2012 at 12:55 PM, Michael Grzeschik
<m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
> @@ -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 err;
> +               }
> +       }
> +
>         data->ci_pdev = plat_ci;
>         platform_set_drvdata(pdev, data);
>
This hunk fails to apply for me on 3.7-rc5:
error: while searching for:
		goto put_np;
	}

	data->ci_pdev = plat_ci;
	platform_set_drvdata(pdev, data);

Regards,

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

* [PATCH 6/6] usb: chipidea: usbmisc: add post handling and errata fix for mx25
@ 2012-11-15 10:08         ` Martin Fuzzey
  0 siblings, 0 replies; 38+ messages in thread
From: Martin Fuzzey @ 2012-11-15 10:08 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Wed, Nov 14, 2012 at 12:55 PM, Michael Grzeschik
<m.grzeschik@pengutronix.de> wrote:
> @@ -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 err;
> +               }
> +       }
> +
>         data->ci_pdev = plat_ci;
>         platform_set_drvdata(pdev, data);
>
This hunk fails to apply for me on 3.7-rc5:
error: while searching for:
		goto put_np;
	}

	data->ci_pdev = plat_ci;
	platform_set_drvdata(pdev, data);

Regards,

Martin

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

* Re: [PATCH 6/6] usb: chipidea: usbmisc: add post handling and errata fix for mx25
  2012-11-15 10:08         ` Martin Fuzzey
@ 2012-11-15 10:25             ` Michael Grzeschik
  -1 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-15 10:25 UTC (permalink / raw)
  To: Martin Fuzzey
  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 Thu, Nov 15, 2012 at 11:08:15AM +0100, Martin Fuzzey wrote:
> On Wed, Nov 14, 2012 at 12:55 PM, Michael Grzeschik
> <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
> > @@ -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 err;
> > +               }
> > +       }
> > +
> >         data->ci_pdev = plat_ci;
> >         platform_set_drvdata(pdev, data);
> >
> This hunk fails to apply for me on 3.7-rc5:
> error: while searching for:
> 		goto put_np;
> 	}

This is because that series is based on Peter Chen's work. I should have
mentioned this in the cover-letter mail. You can merge his master branch
before adding my series:
https://github.com/hzpeterchen/linux-usb.git

Apart from the latter patches, his work already got queued up by Greg:
http://comments.gmane.org/gmane.linux.usb.general/74537

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

* [PATCH 6/6] usb: chipidea: usbmisc: add post handling and errata fix for mx25
@ 2012-11-15 10:25             ` Michael Grzeschik
  0 siblings, 0 replies; 38+ messages in thread
From: Michael Grzeschik @ 2012-11-15 10:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 15, 2012 at 11:08:15AM +0100, Martin Fuzzey wrote:
> On Wed, Nov 14, 2012 at 12:55 PM, Michael Grzeschik
> <m.grzeschik@pengutronix.de> wrote:
> > @@ -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 err;
> > +               }
> > +       }
> > +
> >         data->ci_pdev = plat_ci;
> >         platform_set_drvdata(pdev, data);
> >
> This hunk fails to apply for me on 3.7-rc5:
> error: while searching for:
> 		goto put_np;
> 	}

This is because that series is based on Peter Chen's work. I should have
mentioned this in the cover-letter mail. You can merge his master branch
before adding my series:
https://github.com/hzpeterchen/linux-usb.git

Apart from the latter patches, his work already got queued up by Greg:
http://comments.gmane.org/gmane.linux.usb.general/74537

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

* Re: [PATCH 6/6] usb: chipidea: usbmisc: add post handling and errata fix for mx25
  2012-11-15 10:25             ` Michael Grzeschik
@ 2012-11-15 13:51                 ` Martin Fuzzey
  -1 siblings, 0 replies; 38+ messages in thread
From: Martin Fuzzey @ 2012-11-15 13:51 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

> This is because that series is based on Peter Chen's work. I should have
> mentioned this in the cover-letter mail. You can merge his master branch
> before adding my series:

Ok thanks for the very rapid reply.

I've now built this together with patch 2 "ci13xxx_imx: add 2nd and
3rd clock to support imx5x and newer" from your other series.
But it hangs because the usb-phy clock is not being enabled.
If I add a clock enable for that clock too to usbmisc_imx.c it works
but that can't be the right way.

Who is supposed to enable the phy clock?
[I'm using the OTG port in host only mode on i.MX53 with "nop-usbphy"]

Here's what I did (illustration only, probably white space broken):

diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c
b/arch/arm/mach-imx/clk-imx51-imx53.c
index cd6d7a0..2f0687a 100644
--- a/arch/arm/mach-imx/clk-imx51-imx53.c
+++ b/arch/arm/mach-imx/clk-imx51-imx53.c
@@ -492,6 +492,7 @@ int __init mx53_clocks_init(unsigned long
rate_ckil, unsigned long rate_osc,
        clk_register_clkdev(clk[usboh3_per_gate], "per", "53f80800.usbmisc");
        clk_register_clkdev(clk[usboh3_gate], "ipg", "53f80800.usbmisc");
        clk_register_clkdev(clk[usboh3_gate], "ahb", "53f80800.usbmisc");
+       clk_register_clkdev(clk[usb_phy1_gate], "phy1",
"53f80800.usbmisc"); // MF
        clk_register_clkdev(clk[esdhc1_ipg_gate], "ipg", "sdhci-esdhc-imx53.0");
        clk_register_clkdev(clk[dummy], "ahb", "sdhci-esdhc-imx53.0");
        clk_register_clkdev(clk[esdhc1_per_gate], "per", "sdhci-esdhc-imx53.0");
diff --git a/drivers/usb/chipidea/usbmisc_imx.c
b/drivers/usb/chipidea/usbmisc_imx.c
index acca109..a59093a 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -197,6 +197,24 @@ static int __devinit usbmisc_imx_probe(struct
platform_device *pdev)
        if (ret)
                goto err_per_failed;

+
+       { /* Temp Hack by MF awaiting reply on mailing list */
+               struct clk *phy_clk;
+
+               dev_info(&pdev->dev, "@MF@ hacking phy clock enable\n");
+               phy_clk = devm_clk_get(&pdev->dev, "phy1");
+               if (IS_ERR(phy_clk)) {
+                       dev_err(&pdev->dev, "failed to get PHY clock,
err=%ld\n", PTR_ERR(phy_clk));
+                       goto err_per_failed;
+               }
+
+               ret = clk_prepare_enable(phy_clk);
+               if (ret) {
+                       dev_err(&pdev->dev, "failed to enable PHY
clock, err=%d\n", 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;
--
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] 38+ messages in thread

* [PATCH 6/6] usb: chipidea: usbmisc: add post handling and errata fix for mx25
@ 2012-11-15 13:51                 ` Martin Fuzzey
  0 siblings, 0 replies; 38+ messages in thread
From: Martin Fuzzey @ 2012-11-15 13:51 UTC (permalink / raw)
  To: linux-arm-kernel

> This is because that series is based on Peter Chen's work. I should have
> mentioned this in the cover-letter mail. You can merge his master branch
> before adding my series:

Ok thanks for the very rapid reply.

I've now built this together with patch 2 "ci13xxx_imx: add 2nd and
3rd clock to support imx5x and newer" from your other series.
But it hangs because the usb-phy clock is not being enabled.
If I add a clock enable for that clock too to usbmisc_imx.c it works
but that can't be the right way.

Who is supposed to enable the phy clock?
[I'm using the OTG port in host only mode on i.MX53 with "nop-usbphy"]

Here's what I did (illustration only, probably white space broken):

diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c
b/arch/arm/mach-imx/clk-imx51-imx53.c
index cd6d7a0..2f0687a 100644
--- a/arch/arm/mach-imx/clk-imx51-imx53.c
+++ b/arch/arm/mach-imx/clk-imx51-imx53.c
@@ -492,6 +492,7 @@ int __init mx53_clocks_init(unsigned long
rate_ckil, unsigned long rate_osc,
        clk_register_clkdev(clk[usboh3_per_gate], "per", "53f80800.usbmisc");
        clk_register_clkdev(clk[usboh3_gate], "ipg", "53f80800.usbmisc");
        clk_register_clkdev(clk[usboh3_gate], "ahb", "53f80800.usbmisc");
+       clk_register_clkdev(clk[usb_phy1_gate], "phy1",
"53f80800.usbmisc"); // MF
        clk_register_clkdev(clk[esdhc1_ipg_gate], "ipg", "sdhci-esdhc-imx53.0");
        clk_register_clkdev(clk[dummy], "ahb", "sdhci-esdhc-imx53.0");
        clk_register_clkdev(clk[esdhc1_per_gate], "per", "sdhci-esdhc-imx53.0");
diff --git a/drivers/usb/chipidea/usbmisc_imx.c
b/drivers/usb/chipidea/usbmisc_imx.c
index acca109..a59093a 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -197,6 +197,24 @@ static int __devinit usbmisc_imx_probe(struct
platform_device *pdev)
        if (ret)
                goto err_per_failed;

+
+       { /* Temp Hack by MF awaiting reply on mailing list */
+               struct clk *phy_clk;
+
+               dev_info(&pdev->dev, "@MF@ hacking phy clock enable\n");
+               phy_clk = devm_clk_get(&pdev->dev, "phy1");
+               if (IS_ERR(phy_clk)) {
+                       dev_err(&pdev->dev, "failed to get PHY clock,
err=%ld\n", PTR_ERR(phy_clk));
+                       goto err_per_failed;
+               }
+
+               ret = clk_prepare_enable(phy_clk);
+               if (ret) {
+                       dev_err(&pdev->dev, "failed to enable PHY
clock, err=%d\n", 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;

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

* Re: [PATCH 6/6] usb: chipidea: usbmisc: add post handling and errata fix for mx25
  2012-11-15 13:51                 ` Martin Fuzzey
@ 2012-11-15 13:54                     ` Marc Kleine-Budde
  -1 siblings, 0 replies; 38+ messages in thread
From: Marc Kleine-Budde @ 2012-11-15 13:54 UTC (permalink / raw)
  To: Martin Fuzzey
  Cc: Michael Grzeschik, 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: 1200 bytes --]

On 11/15/2012 02:51 PM, Martin Fuzzey wrote:
>> This is because that series is based on Peter Chen's work. I should have
>> mentioned this in the cover-letter mail. You can merge his master branch
>> before adding my series:
> 
> Ok thanks for the very rapid reply.
> 
> I've now built this together with patch 2 "ci13xxx_imx: add 2nd and
> 3rd clock to support imx5x and newer" from your other series.
> But it hangs because the usb-phy clock is not being enabled.
> If I add a clock enable for that clock too to usbmisc_imx.c it works
> but that can't be the right way.
> 
> Who is supposed to enable the phy clock?
> [I'm using the OTG port in host only mode on i.MX53 with "nop-usbphy"]
> 
> Here's what I did (illustration only, probably white space broken):

We've have a patch that the missing clock handling to the nop phy
driver, which isn't much better. What are other possible options?

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: 259 bytes --]

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

* [PATCH 6/6] usb: chipidea: usbmisc: add post handling and errata fix for mx25
@ 2012-11-15 13:54                     ` Marc Kleine-Budde
  0 siblings, 0 replies; 38+ messages in thread
From: Marc Kleine-Budde @ 2012-11-15 13:54 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/15/2012 02:51 PM, Martin Fuzzey wrote:
>> This is because that series is based on Peter Chen's work. I should have
>> mentioned this in the cover-letter mail. You can merge his master branch
>> before adding my series:
> 
> Ok thanks for the very rapid reply.
> 
> I've now built this together with patch 2 "ci13xxx_imx: add 2nd and
> 3rd clock to support imx5x and newer" from your other series.
> But it hangs because the usb-phy clock is not being enabled.
> If I add a clock enable for that clock too to usbmisc_imx.c it works
> but that can't be the right way.
> 
> Who is supposed to enable the phy clock?
> [I'm using the OTG port in host only mode on i.MX53 with "nop-usbphy"]
> 
> Here's what I did (illustration only, probably white space broken):

We've have a patch that the missing clock handling to the nop phy
driver, which isn't much better. What are other possible options?

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: 259 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121115/0a32aec2/attachment.sig>

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

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

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-14 11:55 [PATCH 0/6] support other fsl SoCs with usbmisc + small fixes Michael Grzeschik
2012-11-14 11:55 ` Michael Grzeschik
     [not found] ` <1352894137-2050-1-git-send-email-m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-14 11:55   ` [PATCH 1/6] usb: chipidea: usbmisc: unset global varibale usbmisc on driver remove Michael Grzeschik
2012-11-14 11:55     ` Michael Grzeschik
     [not found]     ` <1352894137-2050-2-git-send-email-m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-14 13:22       ` Alexander Shishkin
2012-11-14 13:22         ` Alexander Shishkin
2012-11-14 11:55   ` [PATCH 2/6] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx Michael Grzeschik
2012-11-14 11:55     ` Michael Grzeschik
     [not found]     ` <1352894137-2050-3-git-send-email-m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-14 11:57       ` Fabio Estevam
2012-11-14 11:57         ` Fabio Estevam
     [not found]         ` <CAOMZO5Ajdp3DT1b+Mx6ufjhuCoOmZ6CEwk+TgWEj-mjd1Hub1Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-14 15:32           ` Michael Grzeschik
2012-11-14 15:32             ` Michael Grzeschik
2012-11-14 13:25       ` Alexander Shishkin
2012-11-14 13:25         ` Alexander Shishkin
     [not found]         ` <87pq3g71v9.fsf-qxRn5AmX6ZD9BXuAQUXR0fooFf0ArEBIu+b9c/7xato@public.gmane.org>
2012-11-14 13:28           ` Michael Grzeschik
2012-11-14 13:28             ` Michael Grzeschik
     [not found]             ` <20121114132807.GA12976-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-14 13:32               ` Alexander Shishkin
2012-11-14 13:32                 ` Alexander Shishkin
2012-11-14 11:55   ` [PATCH 3/6] usb: chipidea: usbmisc: prepare driver to handle more than one soc Michael Grzeschik
2012-11-14 11:55     ` Michael Grzeschik
2012-11-14 11:55   ` [PATCH 4/6] usb: chipidea: usbmisc: add support for ahb, ipg and per clock Michael Grzeschik
2012-11-14 11:55     ` Michael Grzeschik
     [not found]     ` <1352894137-2050-5-git-send-email-m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-14 13:39       ` Alexander Shishkin
2012-11-14 13:39         ` Alexander Shishkin
     [not found]         ` <87mwyk718g.fsf-qxRn5AmX6ZD9BXuAQUXR0fooFf0ArEBIu+b9c/7xato@public.gmane.org>
2012-11-14 15:27           ` Michael Grzeschik
2012-11-14 15:27             ` Michael Grzeschik
2012-11-14 11:55   ` [PATCH 5/6] usb: chipidea: usbmisc: add mx53 support Michael Grzeschik
2012-11-14 11:55     ` Michael Grzeschik
2012-11-14 11:55   ` [PATCH 6/6] usb: chipidea: usbmisc: add post handling and errata fix for mx25 Michael Grzeschik
2012-11-14 11:55     ` Michael Grzeschik
     [not found]     ` <1352894137-2050-7-git-send-email-m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-15 10:08       ` Martin Fuzzey
2012-11-15 10:08         ` Martin Fuzzey
     [not found]         ` <CALBypN6U=np93ZwnEZqbh=j0Vb_-x630GaktEiv+4K26eYp4Pg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-15 10:25           ` Michael Grzeschik
2012-11-15 10:25             ` Michael Grzeschik
     [not found]             ` <20121115102525.GA16118-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-15 13:51               ` Martin Fuzzey
2012-11-15 13:51                 ` Martin Fuzzey
     [not found]                 ` <CALBypN7-NKFmoPXWA0utFhUjLOWjvzwJ7ZSuQBa+W5edNQA_OA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-15 13:54                   ` Marc Kleine-Budde
2012-11-15 13:54                     ` Marc Kleine-Budde

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.