linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] usb: phy: msm: Move mach dependent code to platform data
       [not found] <1372087664-26396-1-git-send-email-iivanov@mm-sol.com>
@ 2013-06-24 15:27 ` Ivan T. Ivanov
  2013-07-24 12:23   ` Felipe Balbi
  2013-07-24 15:55   ` David Brown
  2013-06-24 15:27 ` [PATCH 2/7] usb: phy: msm: Migrate to Managed Device Resource allocation Ivan T. Ivanov
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 13+ messages in thread
From: Ivan T. Ivanov @ 2013-06-24 15:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: Ivan T. Ivanov, David Brown, Daniel Walker, Bryan Huntsman,
	Russell King, Felipe Balbi, Greg Kroah-Hartman, Stephen Boyd,
	linux-arm-kernel, linux-kernel

From: "Ivan T. Ivanov" <iivanov@mm-sol.com>

This patch fix compilation error and is an intermediate step
before the addition of DeviceTree support for newer targets.
Fix suggested here: https://lkml.org/lkml/2013/6/19/381

Cc: David Brown <davidb@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org

Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
---
 arch/arm/mach-msm/board-msm7x30.c |   35 +++++++++++++++++++++++
 arch/arm/mach-msm/board-qsd8x50.c |   34 +++++++++++++++++++++++
 drivers/usb/phy/phy-msm-usb.c     |   55 ++++++++++---------------------------
 include/linux/usb/msm_hsusb.h     |    2 ++
 4 files changed, 85 insertions(+), 41 deletions(-)

diff --git a/arch/arm/mach-msm/board-msm7x30.c b/arch/arm/mach-msm/board-msm7x30.c
index db3d8c0..4df7daa 100644
--- a/arch/arm/mach-msm/board-msm7x30.c
+++ b/arch/arm/mach-msm/board-msm7x30.c
@@ -31,6 +31,7 @@
 #include <asm/setup.h>
 
 #include <mach/board.h>
+#include <mach/clk.h>
 #include <mach/msm_iomap.h>
 #include <mach/dma.h>
 
@@ -61,10 +62,44 @@ static int hsusb_phy_init_seq[] = {
 	-1
 };
 
+static int hsusb_phy_link_clk_reset(struct clk *link_clk, bool assert)
+{
+	int ret;
+
+	if (assert) {
+		ret = clk_reset(link_clk, CLK_RESET_ASSERT);
+		if (ret)
+			pr_err("usb hs_clk assert failed\n");
+	} else {
+		ret = clk_reset(link_clk, CLK_RESET_DEASSERT);
+		if (ret)
+			pr_err("usb hs_clk deassert failed\n");
+	}
+	return ret;
+}
+
+static int hsusb_phy_clk_reset(struct clk *phy_clk)
+{
+	int ret;
+
+	ret = clk_reset(phy_clk, CLK_RESET_ASSERT);
+	if (ret) {
+		pr_err("usb phy clk assert failed\n");
+		return ret;
+	}
+	usleep_range(10000, 12000);
+	ret = clk_reset(phy_clk, CLK_RESET_DEASSERT);
+	if (ret)
+		pr_err("usb phy clk deassert failed\n");
+	return ret;
+}
+
 static struct msm_otg_platform_data msm_otg_pdata = {
 	.phy_init_seq		= hsusb_phy_init_seq,
 	.mode                   = USB_PERIPHERAL,
 	.otg_control		= OTG_PHY_CONTROL,
+	.phy_link_clk_reset	= hsusb_phy_link_clk_reset,
+	.phy_phy_clk_reset	= hsusb_phy_clk_reset,
 };
 
 struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = {
diff --git a/arch/arm/mach-msm/board-qsd8x50.c b/arch/arm/mach-msm/board-qsd8x50.c
index f14a73d..d3d92ab 100644
--- a/arch/arm/mach-msm/board-qsd8x50.c
+++ b/arch/arm/mach-msm/board-qsd8x50.c
@@ -82,10 +82,44 @@ static int hsusb_phy_init_seq[] = {
 	-1
 };
 
+static int hsusb_phy_link_clk_reset(struct clk *link_clk, bool assert)
+{
+	int ret;
+
+	if (assert) {
+		ret = clk_reset(link_clk, CLK_RESET_ASSERT);
+		if (ret)
+			pr_err("usb hs_clk assert failed\n");
+	} else {
+		ret = clk_reset(link_clk, CLK_RESET_DEASSERT);
+		if (ret)
+			pr_err("usb hs_clk deassert failed\n");
+	}
+	return ret;
+}
+
+static int hsusb_phy_clk_reset(struct clk *phy_clk)
+{
+	int ret;
+
+	ret = clk_reset(phy_clk, CLK_RESET_ASSERT);
+	if (ret) {
+		pr_err("usb phy clk assert failed\n");
+		return ret;
+	}
+	usleep_range(10000, 12000);
+	ret = clk_reset(phy_clk, CLK_RESET_DEASSERT);
+	if (ret)
+		pr_err("usb phy clk deassert failed\n");
+	return ret;
+}
+
 static struct msm_otg_platform_data msm_otg_pdata = {
 	.phy_init_seq		= hsusb_phy_init_seq,
 	.mode                   = USB_PERIPHERAL,
 	.otg_control		= OTG_PHY_CONTROL,
+	.phy_link_clk_reset	= hsusb_phy_link_clk_reset,
+	.phy_phy_clk_reset	= hsusb_phy_clk_reset,
 };
 
 static struct platform_device *devices[] __initdata = {
diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index d08f334..ab1b880 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -40,8 +40,6 @@
 #include <linux/usb/msm_hsusb_hw.h>
 #include <linux/regulator/consumer.h>
 
-#include <mach/clk.h>
-
 #define MSM_USB_BASE	(motg->regs)
 #define DRIVER_NAME	"msm_otg"
 
@@ -306,51 +304,20 @@ static void ulpi_init(struct msm_otg *motg)
 	}
 }
 
-static int msm_otg_link_clk_reset(struct msm_otg *motg, bool assert)
-{
-	int ret;
-
-	if (assert) {
-		ret = clk_reset(motg->clk, CLK_RESET_ASSERT);
-		if (ret)
-			dev_err(motg->phy.dev, "usb hs_clk assert failed\n");
-	} else {
-		ret = clk_reset(motg->clk, CLK_RESET_DEASSERT);
-		if (ret)
-			dev_err(motg->phy.dev, "usb hs_clk deassert failed\n");
-	}
-	return ret;
-}
-
-static int msm_otg_phy_clk_reset(struct msm_otg *motg)
-{
-	int ret;
-
-	ret = clk_reset(motg->phy_reset_clk, CLK_RESET_ASSERT);
-	if (ret) {
-		dev_err(motg->phy.dev, "usb phy clk assert failed\n");
-		return ret;
-	}
-	usleep_range(10000, 12000);
-	ret = clk_reset(motg->phy_reset_clk, CLK_RESET_DEASSERT);
-	if (ret)
-		dev_err(motg->phy.dev, "usb phy clk deassert failed\n");
-	return ret;
-}
-
 static int msm_otg_phy_reset(struct msm_otg *motg)
 {
+	struct msm_otg_platform_data *pdata = motg->pdata;
 	u32 val;
 	int ret;
 	int retries;
 
-	ret = msm_otg_link_clk_reset(motg, 1);
+	ret = pdata->phy_link_clk_reset(motg->clk, true);
 	if (ret)
 		return ret;
-	ret = msm_otg_phy_clk_reset(motg);
+	ret = pdata->phy_clk_reset(motg->phy_reset_clk);
 	if (ret)
 		return ret;
-	ret = msm_otg_link_clk_reset(motg, 0);
+	ret = pdata->phy_link_clk_reset(motg->clk, false);
 	if (ret)
 		return ret;
 
@@ -362,7 +329,7 @@ static int msm_otg_phy_reset(struct msm_otg *motg)
 				ULPI_CLR(ULPI_FUNC_CTRL));
 		if (!ret)
 			break;
-		ret = msm_otg_phy_clk_reset(motg);
+		ret = pdata->phy_clk_reset(motg->phy_reset_clk);
 		if (ret)
 			return ret;
 	}
@@ -370,7 +337,7 @@ static int msm_otg_phy_reset(struct msm_otg *motg)
 		return -ETIMEDOUT;
 
 	/* This reset calibrates the phy, if the above write succeeded */
-	ret = msm_otg_phy_clk_reset(motg);
+	ret = pdata->phy_clk_reset(motg->phy_reset_clk);
 	if (ret)
 		return ret;
 
@@ -378,7 +345,7 @@ static int msm_otg_phy_reset(struct msm_otg *motg)
 		ret = ulpi_read(&motg->phy, ULPI_DEBUG);
 		if (ret != -ETIMEDOUT)
 			break;
-		ret = msm_otg_phy_clk_reset(motg);
+		ret = pdata->phy_clk_reset(motg->phy_reset_clk);
 		if (ret)
 			return ret;
 	}
@@ -1414,16 +1381,22 @@ static void msm_otg_debugfs_cleanup(void)
 static int __init msm_otg_probe(struct platform_device *pdev)
 {
 	int ret = 0;
+	struct msm_otg_platform_data *pdata = pdev->dev.platform_data;
 	struct resource *res;
 	struct msm_otg *motg;
 	struct usb_phy *phy;
 
 	dev_info(&pdev->dev, "msm_otg probe\n");
-	if (!pdev->dev.platform_data) {
+	if (!pdata) {
 		dev_err(&pdev->dev, "No platform data given. Bailing out\n");
 		return -ENODEV;
 	}
 
+	if (!pdata->phy_clk_reset || !pdata->phy_link_clk_reset) {
+		dev_err(&pdev->dev, "No phy or link clock reset methods\n");
+		return -ENODEV;
+	}
+
 	motg = kzalloc(sizeof(struct msm_otg), GFP_KERNEL);
 	if (!motg) {
 		dev_err(&pdev->dev, "unable to allocate msm_otg\n");
diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h
index 22a396c..66081ed 100644
--- a/include/linux/usb/msm_hsusb.h
+++ b/include/linux/usb/msm_hsusb.h
@@ -135,6 +135,8 @@ struct msm_otg_platform_data {
 	enum msm_usb_phy_type phy_type;
 	void (*setup_gpio)(enum usb_otg_state state);
 	char *pclk_src_name;
+	int (*phy_link_clk_reset)(struct clk *link_clk, bool assert);
+	int (*phy_clk_reset)(struct clk *phy_clk);
 };
 
 /**
-- 
1.7.9.5


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

* [PATCH 2/7] usb: phy: msm: Migrate to Managed Device Resource allocation
       [not found] <1372087664-26396-1-git-send-email-iivanov@mm-sol.com>
  2013-06-24 15:27 ` [PATCH 1/7] usb: phy: msm: Move mach dependent code to platform data Ivan T. Ivanov
@ 2013-06-24 15:27 ` Ivan T. Ivanov
  2013-06-24 15:27 ` [PATCH 3/7] usb: phy: msm: Move regulator usage to managed resource allocation Ivan T. Ivanov
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Ivan T. Ivanov @ 2013-06-24 15:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: Ivan T. Ivanov, Felipe Balbi, Greg Kroah-Hartman, linux-usb,
	linux-kernel

From: "Ivan T. Ivanov" <iivanov@mm-sol.com>

Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
---
 drivers/usb/phy/phy-msm-usb.c |   78 +++++++++++------------------------------
 1 file changed, 20 insertions(+), 58 deletions(-)

diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index ab1b880..cc37f5e 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -1397,13 +1397,14 @@ static int __init msm_otg_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
-	motg = kzalloc(sizeof(struct msm_otg), GFP_KERNEL);
+	motg = devm_kzalloc(&pdev->dev, sizeof(*motg), GFP_KERNEL);
 	if (!motg) {
 		dev_err(&pdev->dev, "unable to allocate msm_otg\n");
 		return -ENOMEM;
 	}
 
-	motg->phy.otg = kzalloc(sizeof(struct usb_otg), GFP_KERNEL);
+	motg->phy.otg = devm_kzalloc(&pdev->dev, sizeof(*motg->phy.otg),
+				     GFP_KERNEL);
 	if (!motg->phy.otg) {
 		dev_err(&pdev->dev, "unable to allocate msm_otg\n");
 		return -ENOMEM;
@@ -1413,18 +1414,16 @@ static int __init msm_otg_probe(struct platform_device *pdev)
 	phy = &motg->phy;
 	phy->dev = &pdev->dev;
 
-	motg->phy_reset_clk = clk_get(&pdev->dev, "usb_phy_clk");
+	motg->phy_reset_clk = devm_clk_get(&pdev->dev, "usb_phy_clk");
 	if (IS_ERR(motg->phy_reset_clk)) {
 		dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
-		ret = PTR_ERR(motg->phy_reset_clk);
-		goto free_motg;
+		return PTR_ERR(motg->phy_reset_clk);
 	}
 
-	motg->clk = clk_get(&pdev->dev, "usb_hs_clk");
+	motg->clk = devm_clk_get(&pdev->dev, "usb_hs_clk");
 	if (IS_ERR(motg->clk)) {
 		dev_err(&pdev->dev, "failed to get usb_hs_clk\n");
-		ret = PTR_ERR(motg->clk);
-		goto put_phy_reset_clk;
+		return PTR_ERR(motg->clk);
 	}
 	clk_set_rate(motg->clk, 60000000);
 
@@ -1436,21 +1435,19 @@ static int __init msm_otg_probe(struct platform_device *pdev)
 	 * on pclk source
 	 */
 	 if (motg->pdata->pclk_src_name) {
-		motg->pclk_src = clk_get(&pdev->dev,
+		motg->pclk_src = devm_clk_get(&pdev->dev,
 			motg->pdata->pclk_src_name);
 		if (IS_ERR(motg->pclk_src))
-			goto put_clk;
+			return PTR_ERR(motg->pclk_src);
 		clk_set_rate(motg->pclk_src, INT_MAX);
 		clk_prepare_enable(motg->pclk_src);
 	} else
 		motg->pclk_src = ERR_PTR(-ENOENT);
 
-
-	motg->pclk = clk_get(&pdev->dev, "usb_hs_pclk");
+	motg->pclk = devm_clk_get(&pdev->dev, "usb_hs_pclk");
 	if (IS_ERR(motg->pclk)) {
 		dev_err(&pdev->dev, "failed to get usb_hs_pclk\n");
-		ret = PTR_ERR(motg->pclk);
-		goto put_pclk_src;
+		return PTR_ERR(motg->pclk);
 	}
 
 	/*
@@ -1458,30 +1455,27 @@ static int __init msm_otg_probe(struct platform_device *pdev)
 	 * clock is introduced to remove the dependency on AXI
 	 * bus frequency.
 	 */
-	motg->core_clk = clk_get(&pdev->dev, "usb_hs_core_clk");
+	motg->core_clk = devm_clk_get(&pdev->dev, "usb_hs_core_clk");
 	if (IS_ERR(motg->core_clk))
 		motg->core_clk = NULL;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
 		dev_err(&pdev->dev, "failed to get platform resource mem\n");
-		ret = -ENODEV;
-		goto put_core_clk;
+		return -ENODEV;
 	}
 
-	motg->regs = ioremap(res->start, resource_size(res));
+	motg->regs = devm_ioremap_resource(&pdev->dev, res);
 	if (!motg->regs) {
 		dev_err(&pdev->dev, "ioremap failed\n");
-		ret = -ENOMEM;
-		goto put_core_clk;
+		return PTR_ERR(motg->regs);
 	}
 	dev_info(&pdev->dev, "OTG regs = %p\n", motg->regs);
 
 	motg->irq = platform_get_irq(pdev, 0);
-	if (!motg->irq) {
+	if (motg->irq < 0) {
 		dev_err(&pdev->dev, "platform_get_irq failed\n");
-		ret = -ENODEV;
-		goto free_regs;
+		return motg->irq;
 	}
 
 	clk_prepare_enable(motg->clk);
@@ -1490,7 +1484,7 @@ static int __init msm_otg_probe(struct platform_device *pdev)
 	ret = msm_hsusb_init_vddcx(motg, 1);
 	if (ret) {
 		dev_err(&pdev->dev, "hsusb vddcx configuration failed\n");
-		goto free_regs;
+		return ret;
 	}
 
 	ret = msm_hsusb_ldo_init(motg, 1);
@@ -1512,7 +1506,7 @@ static int __init msm_otg_probe(struct platform_device *pdev)
 
 	INIT_WORK(&motg->sm_work, msm_otg_sm_work);
 	INIT_DELAYED_WORK(&motg->chg_work, msm_chg_detect_work);
-	ret = request_irq(motg->irq, msm_otg_irq, IRQF_SHARED,
+	ret = devm_request_irq(&pdev->dev, motg->irq, msm_otg_irq, IRQF_SHARED,
 					"msm_otg", motg);
 	if (ret) {
 		dev_err(&pdev->dev, "request irq failed\n");
@@ -1531,7 +1525,7 @@ static int __init msm_otg_probe(struct platform_device *pdev)
 	ret = usb_add_phy(&motg->phy, USB_PHY_TYPE_USB2);
 	if (ret) {
 		dev_err(&pdev->dev, "usb_add_phy failed\n");
-		goto free_irq;
+		goto disable_clks;
 	}
 
 	platform_set_drvdata(pdev, motg);
@@ -1549,8 +1543,6 @@ static int __init msm_otg_probe(struct platform_device *pdev)
 	pm_runtime_enable(&pdev->dev);
 
 	return 0;
-free_irq:
-	free_irq(motg->irq, motg);
 disable_clks:
 	clk_disable_unprepare(motg->pclk);
 	clk_disable_unprepare(motg->clk);
@@ -1558,24 +1550,6 @@ ldo_exit:
 	msm_hsusb_ldo_init(motg, 0);
 vddcx_exit:
 	msm_hsusb_init_vddcx(motg, 0);
-free_regs:
-	iounmap(motg->regs);
-put_core_clk:
-	if (motg->core_clk)
-		clk_put(motg->core_clk);
-	clk_put(motg->pclk);
-put_pclk_src:
-	if (!IS_ERR(motg->pclk_src)) {
-		clk_disable_unprepare(motg->pclk_src);
-		clk_put(motg->pclk_src);
-	}
-put_clk:
-	clk_put(motg->clk);
-put_phy_reset_clk:
-	clk_put(motg->phy_reset_clk);
-free_motg:
-	kfree(motg->phy.otg);
-	kfree(motg);
 	return ret;
 }
 
@@ -1598,7 +1572,6 @@ static int msm_otg_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 
 	usb_remove_phy(phy);
-	free_irq(motg->irq, motg);
 
 	/*
 	 * Put PHY in low power mode.
@@ -1626,18 +1599,7 @@ static int msm_otg_remove(struct platform_device *pdev)
 	}
 	msm_hsusb_ldo_init(motg, 0);
 
-	iounmap(motg->regs);
 	pm_runtime_set_suspended(&pdev->dev);
-
-	clk_put(motg->phy_reset_clk);
-	clk_put(motg->pclk);
-	clk_put(motg->clk);
-	if (motg->core_clk)
-		clk_put(motg->core_clk);
-
-	kfree(motg->phy.otg);
-	kfree(motg);
-
 	return 0;
 }
 
-- 
1.7.9.5


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

* [PATCH 3/7] usb: phy: msm: Move regulator usage to managed resource allocation
       [not found] <1372087664-26396-1-git-send-email-iivanov@mm-sol.com>
  2013-06-24 15:27 ` [PATCH 1/7] usb: phy: msm: Move mach dependent code to platform data Ivan T. Ivanov
  2013-06-24 15:27 ` [PATCH 2/7] usb: phy: msm: Migrate to Managed Device Resource allocation Ivan T. Ivanov
@ 2013-06-24 15:27 ` Ivan T. Ivanov
  2013-06-24 15:27 ` [PATCH 4/7] usb: phy: msm: Remove unnecessarily check for valid regulators Ivan T. Ivanov
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Ivan T. Ivanov @ 2013-06-24 15:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: Ivan T. Ivanov, Felipe Balbi, Greg Kroah-Hartman, linux-usb,
	linux-kernel

From: "Ivan T. Ivanov" <iivanov@mm-sol.com>

This patch move global regulators variables to driver state
structire and move allocation of the regulators to be devm managed.

Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
---
 drivers/usb/phy/phy-msm-usb.c |  111 +++++++++++++++++++----------------------
 include/linux/usb/msm_hsusb.h |    3 ++
 2 files changed, 53 insertions(+), 61 deletions(-)

diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index cc37f5e..8289270 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -58,47 +58,32 @@
 #define USB_PHY_VDD_DIG_VOL_MIN	1000000 /* uV */
 #define USB_PHY_VDD_DIG_VOL_MAX	1320000 /* uV */
 
-static struct regulator *hsusb_3p3;
-static struct regulator *hsusb_1p8;
-static struct regulator *hsusb_vddcx;
-
 static int msm_hsusb_init_vddcx(struct msm_otg *motg, int init)
 {
 	int ret = 0;
 
 	if (init) {
-		hsusb_vddcx = regulator_get(motg->phy.dev, "HSUSB_VDDCX");
-		if (IS_ERR(hsusb_vddcx)) {
-			dev_err(motg->phy.dev, "unable to get hsusb vddcx\n");
-			return PTR_ERR(hsusb_vddcx);
-		}
-
-		ret = regulator_set_voltage(hsusb_vddcx,
+		ret = regulator_set_voltage(motg->vddcx,
 				USB_PHY_VDD_DIG_VOL_MIN,
 				USB_PHY_VDD_DIG_VOL_MAX);
 		if (ret) {
 			dev_err(motg->phy.dev, "unable to set the voltage "
 					"for hsusb vddcx\n");
-			regulator_put(hsusb_vddcx);
 			return ret;
 		}
 
-		ret = regulator_enable(hsusb_vddcx);
-		if (ret) {
+		ret = regulator_enable(motg->vddcx);
+		if (ret)
 			dev_err(motg->phy.dev, "unable to enable hsusb vddcx\n");
-			regulator_put(hsusb_vddcx);
-		}
 	} else {
-		ret = regulator_set_voltage(hsusb_vddcx, 0,
+		ret = regulator_set_voltage(motg->vddcx, 0,
 			USB_PHY_VDD_DIG_VOL_MAX);
 		if (ret)
 			dev_err(motg->phy.dev, "unable to set the voltage "
 					"for hsusb vddcx\n");
-		ret = regulator_disable(hsusb_vddcx);
+		ret = regulator_disable(motg->vddcx);
 		if (ret)
 			dev_err(motg->phy.dev, "unable to disable hsusb vddcx\n");
-
-		regulator_put(hsusb_vddcx);
 	}
 
 	return ret;
@@ -109,59 +94,44 @@ static int msm_hsusb_ldo_init(struct msm_otg *motg, int init)
 	int rc = 0;
 
 	if (init) {
-		hsusb_3p3 = regulator_get(motg->phy.dev, "HSUSB_3p3");
-		if (IS_ERR(hsusb_3p3)) {
-			dev_err(motg->phy.dev, "unable to get hsusb 3p3\n");
-			return PTR_ERR(hsusb_3p3);
-		}
-
-		rc = regulator_set_voltage(hsusb_3p3, USB_PHY_3P3_VOL_MIN,
+		rc = regulator_set_voltage(motg->v3p3, USB_PHY_3P3_VOL_MIN,
 				USB_PHY_3P3_VOL_MAX);
 		if (rc) {
 			dev_err(motg->phy.dev, "unable to set voltage level "
 					"for hsusb 3p3\n");
-			goto put_3p3;
+			return rc;
 		}
-		rc = regulator_enable(hsusb_3p3);
+		rc = regulator_enable(motg->v3p3);
 		if (rc) {
 			dev_err(motg->phy.dev, "unable to enable the hsusb 3p3\n");
-			goto put_3p3;
-		}
-		hsusb_1p8 = regulator_get(motg->phy.dev, "HSUSB_1p8");
-		if (IS_ERR(hsusb_1p8)) {
-			dev_err(motg->phy.dev, "unable to get hsusb 1p8\n");
-			rc = PTR_ERR(hsusb_1p8);
-			goto disable_3p3;
+			return rc;
 		}
-		rc = regulator_set_voltage(hsusb_1p8, USB_PHY_1P8_VOL_MIN,
+
+		rc = regulator_set_voltage(motg->v1p8, USB_PHY_1P8_VOL_MIN,
 				USB_PHY_1P8_VOL_MAX);
 		if (rc) {
 			dev_err(motg->phy.dev, "unable to set voltage level "
 					"for hsusb 1p8\n");
-			goto put_1p8;
+			goto disable_3p3;
 		}
-		rc = regulator_enable(hsusb_1p8);
+		rc = regulator_enable(motg->v1p8);
 		if (rc) {
 			dev_err(motg->phy.dev, "unable to enable the hsusb 1p8\n");
-			goto put_1p8;
+			goto disable_3p3;
 		}
 
 		return 0;
 	}
 
-	regulator_disable(hsusb_1p8);
-put_1p8:
-	regulator_put(hsusb_1p8);
+	regulator_disable(motg->v1p8);
 disable_3p3:
-	regulator_disable(hsusb_3p3);
-put_3p3:
-	regulator_put(hsusb_3p3);
+	regulator_disable(motg->v3p3);
 	return rc;
 }
 
 #ifdef CONFIG_PM_SLEEP
 #define USB_PHY_SUSP_DIG_VOL  500000
-static int msm_hsusb_config_vddcx(int high)
+static int msm_hsusb_config_vddcx(struct msm_otg *motg, int high)
 {
 	int max_vol = USB_PHY_VDD_DIG_VOL_MAX;
 	int min_vol;
@@ -172,7 +142,7 @@ static int msm_hsusb_config_vddcx(int high)
 	else
 		min_vol = USB_PHY_SUSP_DIG_VOL;
 
-	ret = regulator_set_voltage(hsusb_vddcx, min_vol, max_vol);
+	ret = regulator_set_voltage(motg->vddcx, min_vol, max_vol);
 	if (ret) {
 		pr_err("%s: unable to set the voltage for regulator "
 			"HSUSB_VDDCX\n", __func__);
@@ -185,44 +155,44 @@ static int msm_hsusb_config_vddcx(int high)
 }
 #endif
 
-static int msm_hsusb_ldo_set_mode(int on)
+static int msm_hsusb_ldo_set_mode(struct msm_otg *motg, int on)
 {
 	int ret = 0;
 
-	if (!hsusb_1p8 || IS_ERR(hsusb_1p8)) {
+	if (!motg->v1p8 || IS_ERR(motg->v1p8)) {
 		pr_err("%s: HSUSB_1p8 is not initialized\n", __func__);
 		return -ENODEV;
 	}
 
-	if (!hsusb_3p3 || IS_ERR(hsusb_3p3)) {
+	if (!motg->v3p3 || IS_ERR(motg->v3p3)) {
 		pr_err("%s: HSUSB_3p3 is not initialized\n", __func__);
 		return -ENODEV;
 	}
 
 	if (on) {
-		ret = regulator_set_optimum_mode(hsusb_1p8,
+		ret = regulator_set_optimum_mode(motg->v1p8,
 				USB_PHY_1P8_HPM_LOAD);
 		if (ret < 0) {
 			pr_err("%s: Unable to set HPM of the regulator "
 				"HSUSB_1p8\n", __func__);
 			return ret;
 		}
-		ret = regulator_set_optimum_mode(hsusb_3p3,
+		ret = regulator_set_optimum_mode(motg->v3p3,
 				USB_PHY_3P3_HPM_LOAD);
 		if (ret < 0) {
 			pr_err("%s: Unable to set HPM of the regulator "
 				"HSUSB_3p3\n", __func__);
-			regulator_set_optimum_mode(hsusb_1p8,
+			regulator_set_optimum_mode(motg->v1p8,
 				USB_PHY_1P8_LPM_LOAD);
 			return ret;
 		}
 	} else {
-		ret = regulator_set_optimum_mode(hsusb_1p8,
+		ret = regulator_set_optimum_mode(motg->v1p8,
 				USB_PHY_1P8_LPM_LOAD);
 		if (ret < 0)
 			pr_err("%s: Unable to set LPM of the regulator "
 				"HSUSB_1p8\n", __func__);
-		ret = regulator_set_optimum_mode(hsusb_3p3,
+		ret = regulator_set_optimum_mode(motg->v3p3,
 				USB_PHY_3P3_LPM_LOAD);
 		if (ret < 0)
 			pr_err("%s: Unable to set LPM of the regulator "
@@ -491,8 +461,8 @@ static int msm_otg_suspend(struct msm_otg *motg)
 
 	if (motg->pdata->phy_type == SNPS_28NM_INTEGRATED_PHY &&
 			motg->pdata->otg_control == OTG_PMIC_CONTROL) {
-		msm_hsusb_ldo_set_mode(0);
-		msm_hsusb_config_vddcx(0);
+		msm_hsusb_ldo_set_mode(motg, 0);
+		msm_hsusb_config_vddcx(motg, 0);
 	}
 
 	if (device_may_wakeup(phy->dev))
@@ -528,8 +498,8 @@ static int msm_otg_resume(struct msm_otg *motg)
 
 	if (motg->pdata->phy_type == SNPS_28NM_INTEGRATED_PHY &&
 			motg->pdata->otg_control == OTG_PMIC_CONTROL) {
-		msm_hsusb_ldo_set_mode(1);
-		msm_hsusb_config_vddcx(1);
+		msm_hsusb_ldo_set_mode(motg, 1);
+		msm_hsusb_config_vddcx(motg, 1);
 		writel(readl(USB_PHY_CTRL) & ~PHY_RETEN, USB_PHY_CTRL);
 	}
 
@@ -1478,6 +1448,24 @@ static int __init msm_otg_probe(struct platform_device *pdev)
 		return motg->irq;
 	}
 
+	motg->v3p3 = devm_regulator_get(&pdev->dev, "HSUSB_3p3");
+	if (IS_ERR(motg->v3p3)) {
+		dev_err(motg->phy.dev, "unable to get hsusb 3p3\n");
+		return PTR_ERR(motg->v3p3);
+	}
+
+	motg->v1p8 = devm_regulator_get(&pdev->dev, "HSUSB_1p8");
+	if (IS_ERR(motg->v1p8)) {
+		dev_err(motg->phy.dev, "unable to get hsusb 1p8\n");
+		return PTR_ERR(motg->v1p8);
+	}
+
+	motg->vddcx = devm_regulator_get(&pdev->dev, "HSUSB_VDDCX");
+	if (IS_ERR(motg->vddcx)) {
+		dev_err(motg->phy.dev, "unable to get hsusb vddcx\n");
+		return PTR_ERR(motg->vddcx);
+	}
+
 	clk_prepare_enable(motg->clk);
 	clk_prepare_enable(motg->pclk);
 
@@ -1492,7 +1480,7 @@ static int __init msm_otg_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "hsusb vreg configuration failed\n");
 		goto vddcx_exit;
 	}
-	ret = msm_hsusb_ldo_set_mode(1);
+	ret = msm_hsusb_ldo_set_mode(motg, 1);
 	if (ret) {
 		dev_err(&pdev->dev, "hsusb vreg enable failed\n");
 		goto ldo_exit;
@@ -1598,6 +1586,7 @@ static int msm_otg_remove(struct platform_device *pdev)
 		clk_put(motg->pclk_src);
 	}
 	msm_hsusb_ldo_init(motg, 0);
+	msm_hsusb_init_vddcx(motg, 0);
 
 	pm_runtime_set_suspended(&pdev->dev);
 	return 0;
diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h
index 66081ed..e01f7d4 100644
--- a/include/linux/usb/msm_hsusb.h
+++ b/include/linux/usb/msm_hsusb.h
@@ -182,6 +182,9 @@ struct msm_otg {
 	enum usb_chg_state chg_state;
 	enum usb_chg_type chg_type;
 	u8 dcd_retries;
+	struct regulator *v3p3;
+	struct regulator *v1p8;
+	struct regulator *vddcx;
 };
 
 #endif
-- 
1.7.9.5


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

* [PATCH 4/7] usb: phy: msm: Remove unnecessarily check for valid regulators.
       [not found] <1372087664-26396-1-git-send-email-iivanov@mm-sol.com>
                   ` (2 preceding siblings ...)
  2013-06-24 15:27 ` [PATCH 3/7] usb: phy: msm: Move regulator usage to managed resource allocation Ivan T. Ivanov
@ 2013-06-24 15:27 ` Ivan T. Ivanov
  2013-06-24 15:27 ` [PATCH 5/7] usb: phy: msm: Fix WARNING: quoted string split across lines Ivan T. Ivanov
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Ivan T. Ivanov @ 2013-06-24 15:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: Ivan T. Ivanov, Felipe Balbi, Greg Kroah-Hartman, linux-usb,
	linux-kernel

From: "Ivan T. Ivanov" <iivanov@mm-sol.com>

Whether regulators are available or not is checked at driver
probe. If they are not available driver will refuse to load,
so no need to check them again.

Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
---
 drivers/usb/phy/phy-msm-usb.c |   10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index 8289270..0e7d7ab 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -159,16 +159,6 @@ static int msm_hsusb_ldo_set_mode(struct msm_otg *motg, int on)
 {
 	int ret = 0;
 
-	if (!motg->v1p8 || IS_ERR(motg->v1p8)) {
-		pr_err("%s: HSUSB_1p8 is not initialized\n", __func__);
-		return -ENODEV;
-	}
-
-	if (!motg->v3p3 || IS_ERR(motg->v3p3)) {
-		pr_err("%s: HSUSB_3p3 is not initialized\n", __func__);
-		return -ENODEV;
-	}
-
 	if (on) {
 		ret = regulator_set_optimum_mode(motg->v1p8,
 				USB_PHY_1P8_HPM_LOAD);
-- 
1.7.9.5


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

* [PATCH 5/7] usb: phy: msm: Fix WARNING: quoted string split across lines
       [not found] <1372087664-26396-1-git-send-email-iivanov@mm-sol.com>
                   ` (3 preceding siblings ...)
  2013-06-24 15:27 ` [PATCH 4/7] usb: phy: msm: Remove unnecessarily check for valid regulators Ivan T. Ivanov
@ 2013-06-24 15:27 ` Ivan T. Ivanov
  2013-06-24 15:27 ` [PATCH 6/7] usb: phy: msm: Fix WARNING: Prefer seq_puts to seq_printf Ivan T. Ivanov
  2013-06-24 15:27 ` [PATCH 7/7] usb: phy: msm: Lindent the code Ivan T. Ivanov
  6 siblings, 0 replies; 13+ messages in thread
From: Ivan T. Ivanov @ 2013-06-24 15:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: Ivan T. Ivanov, Felipe Balbi, Greg Kroah-Hartman, linux-usb,
	linux-kernel

From: "Ivan T. Ivanov" <iivanov@mm-sol.com>

This fixes checkpatch.pl warnings.

Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
---
 drivers/usb/phy/phy-msm-usb.c |   33 +++++++++++----------------------
 1 file changed, 11 insertions(+), 22 deletions(-)

diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index 0e7d7ab..41938e6 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -67,8 +67,7 @@ static int msm_hsusb_init_vddcx(struct msm_otg *motg, int init)
 				USB_PHY_VDD_DIG_VOL_MIN,
 				USB_PHY_VDD_DIG_VOL_MAX);
 		if (ret) {
-			dev_err(motg->phy.dev, "unable to set the voltage "
-					"for hsusb vddcx\n");
+			dev_err(motg->phy.dev, "Cannot set vddcx voltage\n");
 			return ret;
 		}
 
@@ -79,8 +78,7 @@ static int msm_hsusb_init_vddcx(struct msm_otg *motg, int init)
 		ret = regulator_set_voltage(motg->vddcx, 0,
 			USB_PHY_VDD_DIG_VOL_MAX);
 		if (ret)
-			dev_err(motg->phy.dev, "unable to set the voltage "
-					"for hsusb vddcx\n");
+			dev_err(motg->phy.dev, "Cannot set vddcx voltage\n");
 		ret = regulator_disable(motg->vddcx);
 		if (ret)
 			dev_err(motg->phy.dev, "unable to disable hsusb vddcx\n");
@@ -97,8 +95,7 @@ static int msm_hsusb_ldo_init(struct msm_otg *motg, int init)
 		rc = regulator_set_voltage(motg->v3p3, USB_PHY_3P3_VOL_MIN,
 				USB_PHY_3P3_VOL_MAX);
 		if (rc) {
-			dev_err(motg->phy.dev, "unable to set voltage level "
-					"for hsusb 3p3\n");
+			dev_err(motg->phy.dev, "Cannot set v3p3 voltage\n");
 			return rc;
 		}
 		rc = regulator_enable(motg->v3p3);
@@ -110,8 +107,7 @@ static int msm_hsusb_ldo_init(struct msm_otg *motg, int init)
 		rc = regulator_set_voltage(motg->v1p8, USB_PHY_1P8_VOL_MIN,
 				USB_PHY_1P8_VOL_MAX);
 		if (rc) {
-			dev_err(motg->phy.dev, "unable to set voltage level "
-					"for hsusb 1p8\n");
+			dev_err(motg->phy.dev, "Cannot set v1p8 voltage\n");
 			goto disable_3p3;
 		}
 		rc = regulator_enable(motg->v1p8);
@@ -144,8 +140,7 @@ static int msm_hsusb_config_vddcx(struct msm_otg *motg, int high)
 
 	ret = regulator_set_voltage(motg->vddcx, min_vol, max_vol);
 	if (ret) {
-		pr_err("%s: unable to set the voltage for regulator "
-			"HSUSB_VDDCX\n", __func__);
+		dev_err(motg->phy.dev, "Cannot set vddcx voltage\n");
 		return ret;
 	}
 
@@ -163,15 +158,13 @@ static int msm_hsusb_ldo_set_mode(struct msm_otg *motg, int on)
 		ret = regulator_set_optimum_mode(motg->v1p8,
 				USB_PHY_1P8_HPM_LOAD);
 		if (ret < 0) {
-			pr_err("%s: Unable to set HPM of the regulator "
-				"HSUSB_1p8\n", __func__);
+			pr_err("Could not set HPM for v1p8\n");
 			return ret;
 		}
 		ret = regulator_set_optimum_mode(motg->v3p3,
 				USB_PHY_3P3_HPM_LOAD);
 		if (ret < 0) {
-			pr_err("%s: Unable to set HPM of the regulator "
-				"HSUSB_3p3\n", __func__);
+			pr_err("Could not set HPM for v3p3\n");
 			regulator_set_optimum_mode(motg->v1p8,
 				USB_PHY_1P8_LPM_LOAD);
 			return ret;
@@ -180,13 +173,11 @@ static int msm_hsusb_ldo_set_mode(struct msm_otg *motg, int on)
 		ret = regulator_set_optimum_mode(motg->v1p8,
 				USB_PHY_1P8_LPM_LOAD);
 		if (ret < 0)
-			pr_err("%s: Unable to set LPM of the regulator "
-				"HSUSB_1p8\n", __func__);
+			pr_err("Could not set LPM for v1p8\n");
 		ret = regulator_set_optimum_mode(motg->v3p3,
 				USB_PHY_3P3_LPM_LOAD);
 		if (ret < 0)
-			pr_err("%s: Unable to set LPM of the regulator "
-				"HSUSB_3p3\n", __func__);
+			pr_err("Could not set LPM for v3p3\n");
 	}
 
 	pr_debug("reg (%s)\n", on ? "HPM" : "LPM");
@@ -519,8 +510,7 @@ static int msm_otg_resume(struct msm_otg *motg)
 		 * PHY. USB state can not be restored. Re-insertion
 		 * of USB cable is the only way to get USB working.
 		 */
-		dev_err(phy->dev, "Unable to resume USB."
-				"Re-plugin the cable\n");
+		dev_err(phy->dev, "Unable to resume USB. Re-plugin the cable\n");
 		msm_otg_reset(phy);
 	}
 
@@ -1513,8 +1503,7 @@ static int __init msm_otg_probe(struct platform_device *pdev)
 			motg->pdata->otg_control == OTG_USER_CONTROL) {
 		ret = msm_otg_debugfs_init(motg);
 		if (ret)
-			dev_dbg(&pdev->dev, "mode debugfs file is"
-					"not available\n");
+			dev_dbg(&pdev->dev, "Can not create mode change file\n");
 	}
 
 	pm_runtime_set_active(&pdev->dev);
-- 
1.7.9.5


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

* [PATCH 6/7] usb: phy: msm: Fix WARNING: Prefer seq_puts to seq_printf
       [not found] <1372087664-26396-1-git-send-email-iivanov@mm-sol.com>
                   ` (4 preceding siblings ...)
  2013-06-24 15:27 ` [PATCH 5/7] usb: phy: msm: Fix WARNING: quoted string split across lines Ivan T. Ivanov
@ 2013-06-24 15:27 ` Ivan T. Ivanov
  2013-06-24 15:27 ` [PATCH 7/7] usb: phy: msm: Lindent the code Ivan T. Ivanov
  6 siblings, 0 replies; 13+ messages in thread
From: Ivan T. Ivanov @ 2013-06-24 15:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: Ivan T. Ivanov, Felipe Balbi, Greg Kroah-Hartman, linux-usb,
	linux-kernel

From: "Ivan T. Ivanov" <iivanov@mm-sol.com>

This fixes checkpatch.pl warnings.

Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
---
 drivers/usb/phy/phy-msm-usb.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index 41938e6..6d05085 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -1204,13 +1204,13 @@ static int msm_otg_mode_show(struct seq_file *s, void *unused)
 
 	switch (otg->phy->state) {
 	case OTG_STATE_A_HOST:
-		seq_printf(s, "host\n");
+		seq_puts(s, "host\n");
 		break;
 	case OTG_STATE_B_PERIPHERAL:
-		seq_printf(s, "peripheral\n");
+		seq_puts(s, "peripheral\n");
 		break;
 	default:
-		seq_printf(s, "none\n");
+		seq_puts(s, "none\n");
 		break;
 	}
 
-- 
1.7.9.5


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

* [PATCH 7/7] usb: phy: msm: Lindent the code
       [not found] <1372087664-26396-1-git-send-email-iivanov@mm-sol.com>
                   ` (5 preceding siblings ...)
  2013-06-24 15:27 ` [PATCH 6/7] usb: phy: msm: Fix WARNING: Prefer seq_puts to seq_printf Ivan T. Ivanov
@ 2013-06-24 15:27 ` Ivan T. Ivanov
  2013-07-24 12:22   ` Felipe Balbi
  6 siblings, 1 reply; 13+ messages in thread
From: Ivan T. Ivanov @ 2013-06-24 15:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: Ivan T. Ivanov, Felipe Balbi, Greg Kroah-Hartman, linux-usb,
	linux-kernel

From: "Ivan T. Ivanov" <iivanov@mm-sol.com>

Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
---
 drivers/usb/phy/phy-msm-usb.c |   99 ++++++++++++++++++++++-------------------
 1 file changed, 52 insertions(+), 47 deletions(-)

diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index 6d05085..111f454 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -45,18 +45,18 @@
 
 #define ULPI_IO_TIMEOUT_USEC	(10 * 1000)
 
-#define USB_PHY_3P3_VOL_MIN	3050000 /* uV */
-#define USB_PHY_3P3_VOL_MAX	3300000 /* uV */
+#define USB_PHY_3P3_VOL_MIN	3050000	/* uV */
+#define USB_PHY_3P3_VOL_MAX	3300000	/* uV */
 #define USB_PHY_3P3_HPM_LOAD	50000	/* uA */
 #define USB_PHY_3P3_LPM_LOAD	4000	/* uA */
 
-#define USB_PHY_1P8_VOL_MIN	1800000 /* uV */
-#define USB_PHY_1P8_VOL_MAX	1800000 /* uV */
+#define USB_PHY_1P8_VOL_MIN	1800000	/* uV */
+#define USB_PHY_1P8_VOL_MAX	1800000	/* uV */
 #define USB_PHY_1P8_HPM_LOAD	50000	/* uA */
 #define USB_PHY_1P8_LPM_LOAD	4000	/* uA */
 
-#define USB_PHY_VDD_DIG_VOL_MIN	1000000 /* uV */
-#define USB_PHY_VDD_DIG_VOL_MAX	1320000 /* uV */
+#define USB_PHY_VDD_DIG_VOL_MIN	1000000	/* uV */
+#define USB_PHY_VDD_DIG_VOL_MAX	1320000	/* uV */
 
 static int msm_hsusb_init_vddcx(struct msm_otg *motg, int init)
 {
@@ -64,8 +64,8 @@ static int msm_hsusb_init_vddcx(struct msm_otg *motg, int init)
 
 	if (init) {
 		ret = regulator_set_voltage(motg->vddcx,
-				USB_PHY_VDD_DIG_VOL_MIN,
-				USB_PHY_VDD_DIG_VOL_MAX);
+					    USB_PHY_VDD_DIG_VOL_MIN,
+					    USB_PHY_VDD_DIG_VOL_MAX);
 		if (ret) {
 			dev_err(motg->phy.dev, "Cannot set vddcx voltage\n");
 			return ret;
@@ -73,15 +73,17 @@ static int msm_hsusb_init_vddcx(struct msm_otg *motg, int init)
 
 		ret = regulator_enable(motg->vddcx);
 		if (ret)
-			dev_err(motg->phy.dev, "unable to enable hsusb vddcx\n");
+			dev_err(motg->phy.dev,
+				"unable to enable hsusb vddcx\n");
 	} else {
 		ret = regulator_set_voltage(motg->vddcx, 0,
-			USB_PHY_VDD_DIG_VOL_MAX);
+					    USB_PHY_VDD_DIG_VOL_MAX);
 		if (ret)
 			dev_err(motg->phy.dev, "Cannot set vddcx voltage\n");
 		ret = regulator_disable(motg->vddcx);
 		if (ret)
-			dev_err(motg->phy.dev, "unable to disable hsusb vddcx\n");
+			dev_err(motg->phy.dev,
+				"unable to disable hsusb vddcx\n");
 	}
 
 	return ret;
@@ -93,26 +95,28 @@ static int msm_hsusb_ldo_init(struct msm_otg *motg, int init)
 
 	if (init) {
 		rc = regulator_set_voltage(motg->v3p3, USB_PHY_3P3_VOL_MIN,
-				USB_PHY_3P3_VOL_MAX);
+					   USB_PHY_3P3_VOL_MAX);
 		if (rc) {
 			dev_err(motg->phy.dev, "Cannot set v3p3 voltage\n");
 			return rc;
 		}
 		rc = regulator_enable(motg->v3p3);
 		if (rc) {
-			dev_err(motg->phy.dev, "unable to enable the hsusb 3p3\n");
+			dev_err(motg->phy.dev,
+				"unable to enable the hsusb 3p3\n");
 			return rc;
 		}
 
 		rc = regulator_set_voltage(motg->v1p8, USB_PHY_1P8_VOL_MIN,
-				USB_PHY_1P8_VOL_MAX);
+					   USB_PHY_1P8_VOL_MAX);
 		if (rc) {
 			dev_err(motg->phy.dev, "Cannot set v1p8 voltage\n");
 			goto disable_3p3;
 		}
 		rc = regulator_enable(motg->v1p8);
 		if (rc) {
-			dev_err(motg->phy.dev, "unable to enable the hsusb 1p8\n");
+			dev_err(motg->phy.dev,
+				"unable to enable the hsusb 1p8\n");
 			goto disable_3p3;
 		}
 
@@ -156,26 +160,26 @@ static int msm_hsusb_ldo_set_mode(struct msm_otg *motg, int on)
 
 	if (on) {
 		ret = regulator_set_optimum_mode(motg->v1p8,
-				USB_PHY_1P8_HPM_LOAD);
+						 USB_PHY_1P8_HPM_LOAD);
 		if (ret < 0) {
 			pr_err("Could not set HPM for v1p8\n");
 			return ret;
 		}
 		ret = regulator_set_optimum_mode(motg->v3p3,
-				USB_PHY_3P3_HPM_LOAD);
+						 USB_PHY_3P3_HPM_LOAD);
 		if (ret < 0) {
 			pr_err("Could not set HPM for v3p3\n");
 			regulator_set_optimum_mode(motg->v1p8,
-				USB_PHY_1P8_LPM_LOAD);
+						   USB_PHY_1P8_LPM_LOAD);
 			return ret;
 		}
 	} else {
 		ret = regulator_set_optimum_mode(motg->v1p8,
-				USB_PHY_1P8_LPM_LOAD);
+						 USB_PHY_1P8_LPM_LOAD);
 		if (ret < 0)
 			pr_err("Could not set LPM for v1p8\n");
 		ret = regulator_set_optimum_mode(motg->v3p3,
-				USB_PHY_3P3_LPM_LOAD);
+						 USB_PHY_3P3_LPM_LOAD);
 		if (ret < 0)
 			pr_err("Could not set LPM for v3p3\n");
 	}
@@ -190,8 +194,7 @@ static int ulpi_read(struct usb_phy *phy, u32 reg)
 	int cnt = 0;
 
 	/* initiate read operation */
-	writel(ULPI_RUN | ULPI_READ | ULPI_ADDR(reg),
-	       USB_ULPI_VIEWPORT);
+	writel(ULPI_RUN | ULPI_READ | ULPI_ADDR(reg), USB_ULPI_VIEWPORT);
 
 	/* wait for completion */
 	while (cnt < ULPI_IO_TIMEOUT_USEC) {
@@ -216,8 +219,7 @@ static int ulpi_write(struct usb_phy *phy, u32 val, u32 reg)
 
 	/* initiate write operation */
 	writel(ULPI_RUN | ULPI_WRITE |
-	       ULPI_ADDR(reg) | ULPI_DATA(val),
-	       USB_ULPI_VIEWPORT);
+	       ULPI_ADDR(reg) | ULPI_DATA(val), USB_ULPI_VIEWPORT);
 
 	/* wait for completion */
 	while (cnt < ULPI_IO_TIMEOUT_USEC) {
@@ -249,7 +251,7 @@ static void ulpi_init(struct msm_otg *motg)
 
 	while (seq[0] >= 0) {
 		dev_vdbg(motg->phy.dev, "ulpi: write 0x%02x to 0x%02x\n",
-				seq[0], seq[1]);
+			 seq[0], seq[1]);
 		ulpi_write(&motg->phy, seq[0], seq[1]);
 		seq += 2;
 	}
@@ -277,7 +279,7 @@ static int msm_otg_phy_reset(struct msm_otg *motg)
 
 	for (retries = 3; retries > 0; retries--) {
 		ret = ulpi_write(&motg->phy, ULPI_FUNC_CTRL_SUSPENDM,
-				ULPI_CLR(ULPI_FUNC_CTRL));
+				 ULPI_CLR(ULPI_FUNC_CTRL));
 		if (!ret)
 			break;
 		ret = pdata->phy_clk_reset(motg->phy_reset_clk);
@@ -429,7 +431,7 @@ static int msm_otg_suspend(struct msm_otg *motg)
 	writel(readl(USB_USBCMD) | ASYNC_INTR_CTRL | ULPI_STP_CTRL, USB_USBCMD);
 
 	if (motg->pdata->phy_type == SNPS_28NM_INTEGRATED_PHY &&
-			motg->pdata->otg_control == OTG_PMIC_CONTROL)
+	    motg->pdata->otg_control == OTG_PMIC_CONTROL)
 		writel(readl(USB_PHY_CTRL) | PHY_RETEN, USB_PHY_CTRL);
 
 	clk_disable_unprepare(motg->pclk);
@@ -441,7 +443,7 @@ static int msm_otg_suspend(struct msm_otg *motg)
 		clk_disable_unprepare(motg->pclk_src);
 
 	if (motg->pdata->phy_type == SNPS_28NM_INTEGRATED_PHY &&
-			motg->pdata->otg_control == OTG_PMIC_CONTROL) {
+	    motg->pdata->otg_control == OTG_PMIC_CONTROL) {
 		msm_hsusb_ldo_set_mode(motg, 0);
 		msm_hsusb_config_vddcx(motg, 0);
 	}
@@ -478,7 +480,7 @@ static int msm_otg_resume(struct msm_otg *motg)
 		clk_prepare_enable(motg->core_clk);
 
 	if (motg->pdata->phy_type == SNPS_28NM_INTEGRATED_PHY &&
-			motg->pdata->otg_control == OTG_PMIC_CONTROL) {
+	    motg->pdata->otg_control == OTG_PMIC_CONTROL) {
 		msm_hsusb_ldo_set_mode(motg, 1);
 		msm_hsusb_config_vddcx(motg, 1);
 		writel(readl(USB_PHY_CTRL) & ~PHY_RETEN, USB_PHY_CTRL);
@@ -510,7 +512,8 @@ static int msm_otg_resume(struct msm_otg *motg)
 		 * PHY. USB state can not be restored. Re-insertion
 		 * of USB cable is the only way to get USB working.
 		 */
-		dev_err(phy->dev, "Unable to resume USB. Re-plugin the cable\n");
+		dev_err(phy->dev,
+			"Unable to resume USB. Re-plugin the cable\n");
 		msm_otg_reset(phy);
 	}
 
@@ -674,7 +677,7 @@ static void msm_otg_start_peripheral(struct usb_phy *phy, int on)
 }
 
 static int msm_otg_set_peripheral(struct usb_otg *otg,
-					struct usb_gadget *gadget)
+				  struct usb_gadget *gadget)
 {
 	struct msm_otg *motg = container_of(otg->phy, struct msm_otg, phy);
 
@@ -948,10 +951,10 @@ static void msm_chg_block_off(struct msm_otg *motg)
 	ulpi_write(phy, func_ctrl, ULPI_FUNC_CTRL);
 }
 
-#define MSM_CHG_DCD_POLL_TIME		(100 * HZ/1000) /* 100 msec */
-#define MSM_CHG_DCD_MAX_RETRIES		6 /* Tdcd_tmout = 6 * 100 msec */
-#define MSM_CHG_PRIMARY_DET_TIME	(40 * HZ/1000) /* TVDPSRC_ON */
-#define MSM_CHG_SECONDARY_DET_TIME	(40 * HZ/1000) /* TVDMSRC_ON */
+#define MSM_CHG_DCD_POLL_TIME		(100 * HZ/1000)	/* 100 msec */
+#define MSM_CHG_DCD_MAX_RETRIES		6	/* Tdcd_tmout = 6 * 100 msec */
+#define MSM_CHG_PRIMARY_DET_TIME	(40 * HZ/1000)	/* TVDPSRC_ON */
+#define MSM_CHG_SECONDARY_DET_TIME	(40 * HZ/1000)	/* TVDMSRC_ON */
 static void msm_chg_detect_work(struct work_struct *w)
 {
 	struct msm_otg *motg = container_of(w, struct msm_otg, chg_work.work);
@@ -1094,20 +1097,20 @@ static void msm_otg_sm_work(struct work_struct *w)
 				switch (motg->chg_type) {
 				case USB_DCP_CHARGER:
 					msm_otg_notify_charger(motg,
-							IDEV_CHG_MAX);
+							       IDEV_CHG_MAX);
 					break;
 				case USB_CDP_CHARGER:
 					msm_otg_notify_charger(motg,
-							IDEV_CHG_MAX);
+							       IDEV_CHG_MAX);
 					msm_otg_start_peripheral(otg->phy, 1);
 					otg->phy->state
-						= OTG_STATE_B_PERIPHERAL;
+					    = OTG_STATE_B_PERIPHERAL;
 					break;
 				case USB_SDP_CHARGER:
 					msm_otg_notify_charger(motg, IUNIT);
 					msm_otg_start_peripheral(otg->phy, 1);
 					otg->phy->state
-						= OTG_STATE_B_PERIPHERAL;
+					    = OTG_STATE_B_PERIPHERAL;
 					break;
 				default:
 					break;
@@ -1135,7 +1138,7 @@ static void msm_otg_sm_work(struct work_struct *w)
 	case OTG_STATE_B_PERIPHERAL:
 		dev_dbg(otg->phy->dev, "OTG_STATE_B_PERIPHERAL state\n");
 		if (!test_bit(B_SESS_VLD, &motg->inputs) ||
-				!test_bit(ID, &motg->inputs)) {
+		    !test_bit(ID, &motg->inputs)) {
 			msm_otg_notify_charger(motg, 0);
 			msm_otg_start_peripheral(otg->phy, 0);
 			motg->chg_state = USB_CHG_STATE_UNDEFINED;
@@ -1223,7 +1226,7 @@ static int msm_otg_mode_open(struct inode *inode, struct file *file)
 }
 
 static ssize_t msm_otg_mode_write(struct file *file, const char __user *ubuf,
-				size_t count, loff_t *ppos)
+				  size_t count, loff_t *ppos)
 {
 	struct seq_file *s = file->private_data;
 	struct msm_otg *motg = s->private;
@@ -1312,7 +1315,8 @@ static int msm_otg_debugfs_init(struct msm_otg *motg)
 		return -ENODEV;
 
 	msm_otg_dbg_mode = debugfs_create_file("mode", S_IRUGO | S_IWUSR,
-				msm_otg_dbg_root, motg, &msm_otg_mode_fops);
+					       msm_otg_dbg_root, motg,
+					       &msm_otg_mode_fops);
 	if (!msm_otg_dbg_mode) {
 		debugfs_remove(msm_otg_dbg_root);
 		msm_otg_dbg_root = NULL;
@@ -1384,9 +1388,9 @@ static int __init msm_otg_probe(struct platform_device *pdev)
 	 * CORE CLK. For such USB cores, vote for maximum clk frequency
 	 * on pclk source
 	 */
-	 if (motg->pdata->pclk_src_name) {
+	if (motg->pdata->pclk_src_name) {
 		motg->pclk_src = devm_clk_get(&pdev->dev,
-			motg->pdata->pclk_src_name);
+					      motg->pdata->pclk_src_name);
 		if (IS_ERR(motg->pclk_src))
 			return PTR_ERR(motg->pclk_src);
 		clk_set_rate(motg->pclk_src, INT_MAX);
@@ -1475,7 +1479,7 @@ static int __init msm_otg_probe(struct platform_device *pdev)
 	INIT_WORK(&motg->sm_work, msm_otg_sm_work);
 	INIT_DELAYED_WORK(&motg->chg_work, msm_chg_detect_work);
 	ret = devm_request_irq(&pdev->dev, motg->irq, msm_otg_irq, IRQF_SHARED,
-					"msm_otg", motg);
+			       "msm_otg", motg);
 	if (ret) {
 		dev_err(&pdev->dev, "request irq failed\n");
 		goto disable_clks;
@@ -1500,10 +1504,11 @@ static int __init msm_otg_probe(struct platform_device *pdev)
 	device_init_wakeup(&pdev->dev, 1);
 
 	if (motg->pdata->mode == USB_OTG &&
-			motg->pdata->otg_control == OTG_USER_CONTROL) {
+	    motg->pdata->otg_control == OTG_USER_CONTROL) {
 		ret = msm_otg_debugfs_init(motg);
 		if (ret)
-			dev_dbg(&pdev->dev, "Can not create mode change file\n");
+			dev_dbg(&pdev->dev,
+				"Can not create mode change file\n");
 	}
 
 	pm_runtime_set_active(&pdev->dev);
-- 
1.7.9.5


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

* Re: [PATCH 7/7] usb: phy: msm: Lindent the code
  2013-06-24 15:27 ` [PATCH 7/7] usb: phy: msm: Lindent the code Ivan T. Ivanov
@ 2013-07-24 12:22   ` Felipe Balbi
  2013-07-25 13:40     ` Ivan T. Ivanov
  0 siblings, 1 reply; 13+ messages in thread
From: Felipe Balbi @ 2013-07-24 12:22 UTC (permalink / raw)
  To: Ivan T. Ivanov
  Cc: linux-arm-msm, Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel

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

On Mon, Jun 24, 2013 at 06:27:44PM +0300, Ivan T. Ivanov wrote:
> From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
> 
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-usb@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> 
> Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>

I really don't like blind Lindent patches... sometimes it makes things
even worse.

> ---
>  drivers/usb/phy/phy-msm-usb.c |   99 ++++++++++++++++++++++-------------------
>  1 file changed, 52 insertions(+), 47 deletions(-)
> 
> diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
> index 6d05085..111f454 100644
> --- a/drivers/usb/phy/phy-msm-usb.c
> +++ b/drivers/usb/phy/phy-msm-usb.c
> @@ -64,8 +64,8 @@ static int msm_hsusb_init_vddcx(struct msm_otg *motg, int init)
>  
>  	if (init) {
>  		ret = regulator_set_voltage(motg->vddcx,
> -				USB_PHY_VDD_DIG_VOL_MIN,
> -				USB_PHY_VDD_DIG_VOL_MAX);
> +					    USB_PHY_VDD_DIG_VOL_MIN,
> +					    USB_PHY_VDD_DIG_VOL_MAX);

like here, what's the point ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 1/7] usb: phy: msm: Move mach dependent code to platform data
  2013-06-24 15:27 ` [PATCH 1/7] usb: phy: msm: Move mach dependent code to platform data Ivan T. Ivanov
@ 2013-07-24 12:23   ` Felipe Balbi
  2013-07-24 15:55   ` David Brown
  1 sibling, 0 replies; 13+ messages in thread
From: Felipe Balbi @ 2013-07-24 12:23 UTC (permalink / raw)
  To: Ivan T. Ivanov
  Cc: linux-arm-msm, David Brown, Daniel Walker, Bryan Huntsman,
	Russell King, Felipe Balbi, Greg Kroah-Hartman, Stephen Boyd,
	linux-arm-kernel, linux-kernel

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

On Mon, Jun 24, 2013 at 06:27:38PM +0300, Ivan T. Ivanov wrote:
> From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
> 
> This patch fix compilation error and is an intermediate step
> before the addition of DeviceTree support for newer targets.
> Fix suggested here: https://lkml.org/lkml/2013/6/19/381
> 
> Cc: David Brown <davidb@codeaurora.org>
> Cc: Daniel Walker <dwalker@fifo99.com>
> Cc: Bryan Huntsman <bryanh@codeaurora.org>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> 
> Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>

I need Acks

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 1/7] usb: phy: msm: Move mach dependent code to platform data
  2013-06-24 15:27 ` [PATCH 1/7] usb: phy: msm: Move mach dependent code to platform data Ivan T. Ivanov
  2013-07-24 12:23   ` Felipe Balbi
@ 2013-07-24 15:55   ` David Brown
  2013-07-26  9:11     ` Ivan T. Ivanov
  1 sibling, 1 reply; 13+ messages in thread
From: David Brown @ 2013-07-24 15:55 UTC (permalink / raw)
  To: Ivan T. Ivanov
  Cc: linux-arm-msm, Daniel Walker, Bryan Huntsman, Russell King,
	Felipe Balbi, Greg Kroah-Hartman, Stephen Boyd, linux-arm-kernel,
	linux-kernel

On Mon, Jun 24, 2013 at 06:27:38PM +0300, Ivan T. Ivanov wrote:
>From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
>
>This patch fix compilation error and is an intermediate step
>before the addition of DeviceTree support for newer targets.
>Fix suggested here: https://lkml.org/lkml/2013/6/19/381
>
>Cc: David Brown <davidb@codeaurora.org>
>Cc: Daniel Walker <dwalker@fifo99.com>
>Cc: Bryan Huntsman <bryanh@codeaurora.org>
>Cc: Russell King <linux@arm.linux.org.uk>
>Cc: Felipe Balbi <balbi@ti.com>
>Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>Cc: Stephen Boyd <sboyd@codeaurora.org>
>Cc: linux-arm-kernel@lists.infradead.org
>Cc: linux-kernel@vger.kernel.org
>
>Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
>---
> arch/arm/mach-msm/board-msm7x30.c |   35 +++++++++++++++++++++++
> arch/arm/mach-msm/board-qsd8x50.c |   34 +++++++++++++++++++++++
> drivers/usb/phy/phy-msm-usb.c     |   55 ++++++++++---------------------------
> include/linux/usb/msm_hsusb.h     |    2 ++
> 4 files changed, 85 insertions(+), 41 deletions(-)

Acked-by: David Brown <davidb@codeaurora.org>

-- 
sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

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

* Re: [PATCH 7/7] usb: phy: msm: Lindent the code
  2013-07-24 12:22   ` Felipe Balbi
@ 2013-07-25 13:40     ` Ivan T. Ivanov
  2013-07-25 14:22       ` Felipe Balbi
  0 siblings, 1 reply; 13+ messages in thread
From: Ivan T. Ivanov @ 2013-07-25 13:40 UTC (permalink / raw)
  To: balbi; +Cc: linux-arm-msm, Greg Kroah-Hartman, linux-usb, linux-kernel


Hi, 

On Wed, 2013-07-24 at 15:22 +0300, Felipe Balbi wrote:
> On Mon, Jun 24, 2013 at 06:27:44PM +0300, Ivan T. Ivanov wrote:
> > From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
> > 
> > Cc: Felipe Balbi <balbi@ti.com>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: linux-usb@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org
> > 
> > Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
> 
> I really don't like blind Lindent patches... sometimes it makes things
> even worse.

It is not exactly blindly. I have removed some of the changes in the
platform_driver structure. 

> 
> > ---
> >  drivers/usb/phy/phy-msm-usb.c |   99 ++++++++++++++++++++++-------------------
> >  1 file changed, 52 insertions(+), 47 deletions(-)
> > 
> > diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
> > index 6d05085..111f454 100644
> > --- a/drivers/usb/phy/phy-msm-usb.c
> > +++ b/drivers/usb/phy/phy-msm-usb.c
> > @@ -64,8 +64,8 @@ static int msm_hsusb_init_vddcx(struct msm_otg *motg, int init)
> >  
> >  	if (init) {
> >  		ret = regulator_set_voltage(motg->vddcx,
> > -				USB_PHY_VDD_DIG_VOL_MIN,
> > -				USB_PHY_VDD_DIG_VOL_MAX);
> > +					    USB_PHY_VDD_DIG_VOL_MIN,
> > +					    USB_PHY_VDD_DIG_VOL_MAX);
> 
> like here, what's the point ?

It makes indentation the same like the majority of the code.
I could drop this patch if you like.

Thanks,
Ivan


> 



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

* Re: [PATCH 7/7] usb: phy: msm: Lindent the code
  2013-07-25 13:40     ` Ivan T. Ivanov
@ 2013-07-25 14:22       ` Felipe Balbi
  0 siblings, 0 replies; 13+ messages in thread
From: Felipe Balbi @ 2013-07-25 14:22 UTC (permalink / raw)
  To: Ivan T. Ivanov
  Cc: balbi, linux-arm-msm, Greg Kroah-Hartman, linux-usb, linux-kernel

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

Hi,

On Thu, Jul 25, 2013 at 04:40:51PM +0300, Ivan T. Ivanov wrote:
> > > diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
> > > index 6d05085..111f454 100644
> > > --- a/drivers/usb/phy/phy-msm-usb.c
> > > +++ b/drivers/usb/phy/phy-msm-usb.c
> > > @@ -64,8 +64,8 @@ static int msm_hsusb_init_vddcx(struct msm_otg *motg, int init)
> > >  
> > >  	if (init) {
> > >  		ret = regulator_set_voltage(motg->vddcx,
> > > -				USB_PHY_VDD_DIG_VOL_MIN,
> > > -				USB_PHY_VDD_DIG_VOL_MAX);
> > > +					    USB_PHY_VDD_DIG_VOL_MIN,
> > > +					    USB_PHY_VDD_DIG_VOL_MAX);
> > 
> > like here, what's the point ?
> 
> It makes indentation the same like the majority of the code.
> I could drop this patch if you like.

yeah, I don't think it's worth to have this patch. Just looked at the
driver and, at least to my eyes, it didn't look all that bad. Matter of
taste though

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 1/7] usb: phy: msm: Move mach dependent code to platform data
  2013-07-24 15:55   ` David Brown
@ 2013-07-26  9:11     ` Ivan T. Ivanov
  0 siblings, 0 replies; 13+ messages in thread
From: Ivan T. Ivanov @ 2013-07-26  9:11 UTC (permalink / raw)
  To: David Brown
  Cc: Russell King, linux-arm-msm, Stephen Boyd, linux-kernel,
	Felipe Balbi, Bryan Huntsman, Greg Kroah-Hartman, Daniel Walker,
	linux-arm-kernel

On Wed, 2013-07-24 at 08:55 -0700, David Brown wrote:
> On Mon, Jun 24, 2013 at 06:27:38PM +0300, Ivan T. Ivanov wrote:
> >From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
> >
> >This patch fix compilation error and is an intermediate step
> >before the addition of DeviceTree support for newer targets.
> >Fix suggested here: https://lkml.org/lkml/2013/6/19/381
> >
> >Cc: David Brown <davidb@codeaurora.org>
> >Cc: Daniel Walker <dwalker@fifo99.com>
> >Cc: Bryan Huntsman <bryanh@codeaurora.org>
> >Cc: Russell King <linux@arm.linux.org.uk>
> >Cc: Felipe Balbi <balbi@ti.com>
> >Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >Cc: Stephen Boyd <sboyd@codeaurora.org>
> >Cc: linux-arm-kernel@lists.infradead.org
> >Cc: linux-kernel@vger.kernel.org
> >
> >Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
> >---
> > arch/arm/mach-msm/board-msm7x30.c |   35 +++++++++++++++++++++++
> > arch/arm/mach-msm/board-qsd8x50.c |   34 +++++++++++++++++++++++
> > drivers/usb/phy/phy-msm-usb.c     |   55 ++++++++++---------------------------
> > include/linux/usb/msm_hsusb.h     |    2 ++
> > 4 files changed, 85 insertions(+), 41 deletions(-)
> 
> Acked-by: David Brown <davidb@codeaurora.org>
> 

Thank you David, but I am afraid that I have screwup this patch. It
doesn't build fine. I will send second version.
Sorry. Ivan


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

end of thread, other threads:[~2013-07-26  9:12 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1372087664-26396-1-git-send-email-iivanov@mm-sol.com>
2013-06-24 15:27 ` [PATCH 1/7] usb: phy: msm: Move mach dependent code to platform data Ivan T. Ivanov
2013-07-24 12:23   ` Felipe Balbi
2013-07-24 15:55   ` David Brown
2013-07-26  9:11     ` Ivan T. Ivanov
2013-06-24 15:27 ` [PATCH 2/7] usb: phy: msm: Migrate to Managed Device Resource allocation Ivan T. Ivanov
2013-06-24 15:27 ` [PATCH 3/7] usb: phy: msm: Move regulator usage to managed resource allocation Ivan T. Ivanov
2013-06-24 15:27 ` [PATCH 4/7] usb: phy: msm: Remove unnecessarily check for valid regulators Ivan T. Ivanov
2013-06-24 15:27 ` [PATCH 5/7] usb: phy: msm: Fix WARNING: quoted string split across lines Ivan T. Ivanov
2013-06-24 15:27 ` [PATCH 6/7] usb: phy: msm: Fix WARNING: Prefer seq_puts to seq_printf Ivan T. Ivanov
2013-06-24 15:27 ` [PATCH 7/7] usb: phy: msm: Lindent the code Ivan T. Ivanov
2013-07-24 12:22   ` Felipe Balbi
2013-07-25 13:40     ` Ivan T. Ivanov
2013-07-25 14:22       ` Felipe Balbi

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