diff options
author | Ivan T. Ivanov <iivanov@mm-sol.com> | 2013-12-30 16:15:27 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2014-01-09 03:06:48 -0500 |
commit | 5146d7714302f0b5dff7c591c6de947067669ca3 (patch) | |
tree | 2ef0b29f1bae62ecb13a4064117f2492fb24435d /arch/arm/mach-msm | |
parent | 21dea66951342ec514ad498eda843cf633a13634 (diff) |
usb: phy: msm: Move mach dependent code to platform data
This patch fix compilation error when driver is compiled
in multi-platform builds.
drivers/built-in.o: In function `msm_otg_link_clk_reset':
./drivers/usb/phy/phy-msm-usb.c:314: undefined reference to `clk_reset'
./drivers/usb/phy/phy-msm-usb.c:318: undefined reference to `clk_reset'
Use platform data supplied reset handlers and adjust error
messages reported when reset sequence fail.
This is an intermediate step before adding support for reset
framework and newer targets.
Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Acked-by: David Brown <davidb@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-msm')
-rw-r--r-- | arch/arm/mach-msm/board-msm7x30.c | 35 | ||||
-rw-r--r-- | arch/arm/mach-msm/board-qsd8x50.c | 35 |
2 files changed, 70 insertions, 0 deletions
diff --git a/arch/arm/mach-msm/board-msm7x30.c b/arch/arm/mach-msm/board-msm7x30.c index f9af5a46e8b6..46de789ad3ae 100644 --- a/arch/arm/mach-msm/board-msm7x30.c +++ b/arch/arm/mach-msm/board-msm7x30.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <asm/memory.h> | 30 | #include <asm/memory.h> |
31 | #include <asm/setup.h> | 31 | #include <asm/setup.h> |
32 | 32 | ||
33 | #include <mach/clk.h> | ||
33 | #include <mach/msm_iomap.h> | 34 | #include <mach/msm_iomap.h> |
34 | #include <mach/dma.h> | 35 | #include <mach/dma.h> |
35 | 36 | ||
@@ -60,10 +61,44 @@ static int hsusb_phy_init_seq[] = { | |||
60 | -1 | 61 | -1 |
61 | }; | 62 | }; |
62 | 63 | ||
64 | static int hsusb_link_clk_reset(struct clk *link_clk, bool assert) | ||
65 | { | ||
66 | int ret; | ||
67 | |||
68 | if (assert) { | ||
69 | ret = clk_reset(link_clk, CLK_RESET_ASSERT); | ||
70 | if (ret) | ||
71 | pr_err("usb hs_clk assert failed\n"); | ||
72 | } else { | ||
73 | ret = clk_reset(link_clk, CLK_RESET_DEASSERT); | ||
74 | if (ret) | ||
75 | pr_err("usb hs_clk deassert failed\n"); | ||
76 | } | ||
77 | return ret; | ||
78 | } | ||
79 | |||
80 | static int hsusb_phy_clk_reset(struct clk *phy_clk) | ||
81 | { | ||
82 | int ret; | ||
83 | |||
84 | ret = clk_reset(phy_clk, CLK_RESET_ASSERT); | ||
85 | if (ret) { | ||
86 | pr_err("usb phy clk assert failed\n"); | ||
87 | return ret; | ||
88 | } | ||
89 | usleep_range(10000, 12000); | ||
90 | ret = clk_reset(phy_clk, CLK_RESET_DEASSERT); | ||
91 | if (ret) | ||
92 | pr_err("usb phy clk deassert failed\n"); | ||
93 | return ret; | ||
94 | } | ||
95 | |||
63 | static struct msm_otg_platform_data msm_otg_pdata = { | 96 | static struct msm_otg_platform_data msm_otg_pdata = { |
64 | .phy_init_seq = hsusb_phy_init_seq, | 97 | .phy_init_seq = hsusb_phy_init_seq, |
65 | .mode = USB_PERIPHERAL, | 98 | .mode = USB_PERIPHERAL, |
66 | .otg_control = OTG_PHY_CONTROL, | 99 | .otg_control = OTG_PHY_CONTROL, |
100 | .link_clk_reset = hsusb_link_clk_reset, | ||
101 | .phy_clk_reset = hsusb_phy_clk_reset, | ||
67 | }; | 102 | }; |
68 | 103 | ||
69 | struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = { | 104 | 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 5f933bc50783..9169ec324a43 100644 --- a/arch/arm/mach-msm/board-qsd8x50.c +++ b/arch/arm/mach-msm/board-qsd8x50.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <mach/irqs.h> | 31 | #include <mach/irqs.h> |
32 | #include <mach/sirc.h> | 32 | #include <mach/sirc.h> |
33 | #include <mach/vreg.h> | 33 | #include <mach/vreg.h> |
34 | #include <mach/clk.h> | ||
34 | #include <linux/platform_data/mmc-msm_sdcc.h> | 35 | #include <linux/platform_data/mmc-msm_sdcc.h> |
35 | 36 | ||
36 | #include "devices.h" | 37 | #include "devices.h" |
@@ -81,10 +82,44 @@ static int hsusb_phy_init_seq[] = { | |||
81 | -1 | 82 | -1 |
82 | }; | 83 | }; |
83 | 84 | ||
85 | static int hsusb_link_clk_reset(struct clk *link_clk, bool assert) | ||
86 | { | ||
87 | int ret; | ||
88 | |||
89 | if (assert) { | ||
90 | ret = clk_reset(link_clk, CLK_RESET_ASSERT); | ||
91 | if (ret) | ||
92 | pr_err("usb hs_clk assert failed\n"); | ||
93 | } else { | ||
94 | ret = clk_reset(link_clk, CLK_RESET_DEASSERT); | ||
95 | if (ret) | ||
96 | pr_err("usb hs_clk deassert failed\n"); | ||
97 | } | ||
98 | return ret; | ||
99 | } | ||
100 | |||
101 | static int hsusb_phy_clk_reset(struct clk *phy_clk) | ||
102 | { | ||
103 | int ret; | ||
104 | |||
105 | ret = clk_reset(phy_clk, CLK_RESET_ASSERT); | ||
106 | if (ret) { | ||
107 | pr_err("usb phy clk assert failed\n"); | ||
108 | return ret; | ||
109 | } | ||
110 | usleep_range(10000, 12000); | ||
111 | ret = clk_reset(phy_clk, CLK_RESET_DEASSERT); | ||
112 | if (ret) | ||
113 | pr_err("usb phy clk deassert failed\n"); | ||
114 | return ret; | ||
115 | } | ||
116 | |||
84 | static struct msm_otg_platform_data msm_otg_pdata = { | 117 | static struct msm_otg_platform_data msm_otg_pdata = { |
85 | .phy_init_seq = hsusb_phy_init_seq, | 118 | .phy_init_seq = hsusb_phy_init_seq, |
86 | .mode = USB_PERIPHERAL, | 119 | .mode = USB_PERIPHERAL, |
87 | .otg_control = OTG_PHY_CONTROL, | 120 | .otg_control = OTG_PHY_CONTROL, |
121 | .link_clk_reset = hsusb_link_clk_reset, | ||
122 | .phy_clk_reset = hsusb_phy_clk_reset, | ||
88 | }; | 123 | }; |
89 | 124 | ||
90 | static struct platform_device *devices[] __initdata = { | 125 | static struct platform_device *devices[] __initdata = { |