Re: [PATCH 1/7] usb: phy: msm: Move mach dependent code to platform data

2013-07-26 Thread Ivan T. Ivanov
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 iiva...@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 dav...@codeaurora.org
 Cc: Daniel Walker dwal...@fifo99.com
 Cc: Bryan Huntsman bry...@codeaurora.org
 Cc: Russell King li...@arm.linux.org.uk
 Cc: Felipe Balbi ba...@ti.com
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
 Cc: Stephen Boyd sb...@codeaurora.org
 Cc: linux-arm-ker...@lists.infradead.org
 Cc: linux-ker...@vger.kernel.org
 
 Signed-off-by: Ivan T. Ivanov iiva...@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 dav...@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

--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/7] usb: phy: msm: Move mach dependent code to platform data

2013-07-24 Thread Felipe Balbi
On Mon, Jun 24, 2013 at 06:27:38PM +0300, Ivan T. Ivanov wrote:
 From: Ivan T. Ivanov iiva...@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 dav...@codeaurora.org
 Cc: Daniel Walker dwal...@fifo99.com
 Cc: Bryan Huntsman bry...@codeaurora.org
 Cc: Russell King li...@arm.linux.org.uk
 Cc: Felipe Balbi ba...@ti.com
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
 Cc: Stephen Boyd sb...@codeaurora.org
 Cc: linux-arm-ker...@lists.infradead.org
 Cc: linux-ker...@vger.kernel.org
 
 Signed-off-by: Ivan T. Ivanov iiva...@mm-sol.com

I need Acks

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 1/7] usb: phy: msm: Move mach dependent code to platform data

2013-07-24 Thread David Brown

On Mon, Jun 24, 2013 at 06:27:38PM +0300, Ivan T. Ivanov wrote:

From: Ivan T. Ivanov iiva...@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 dav...@codeaurora.org
Cc: Daniel Walker dwal...@fifo99.com
Cc: Bryan Huntsman bry...@codeaurora.org
Cc: Russell King li...@arm.linux.org.uk
Cc: Felipe Balbi ba...@ti.com
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
Cc: Stephen Boyd sb...@codeaurora.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org

Signed-off-by: Ivan T. Ivanov iiva...@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 dav...@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
--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/7] usb: phy: msm: Move mach dependent code to platform data

2013-06-24 Thread Ivan T. Ivanov
From: Ivan T. Ivanov iiva...@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 dav...@codeaurora.org
Cc: Daniel Walker dwal...@fifo99.com
Cc: Bryan Huntsman bry...@codeaurora.org
Cc: Russell King li...@arm.linux.org.uk
Cc: Felipe Balbi ba...@ti.com
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
Cc: Stephen Boyd sb...@codeaurora.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org

Signed-off-by: Ivan T. Ivanov iiva...@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(1, 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(1, 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_NAMEmsm_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)
-