diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2011-02-23 12:37:42 -0500 |
---|---|---|
committer | David Brown <davidb@codeaurora.org> | 2011-02-28 15:40:17 -0500 |
commit | bd32344a6baa8baac9c2b3e9c6c649cc4ed53920 (patch) | |
tree | 0b272cc0ea1e7dae1d86fd5ea43de78264000eac | |
parent | 2a52220c89e02423aa23e6b9fb6dc0c706465a82 (diff) |
msm: clock: Migrate to clkdev
Migrating to clkdev has several advantages:
* Less code in mach-msm/clock.c
* A more robust clk_get() implementation
* clk_add_alias() support
* clk_get_sys() support
In general, this will help board authors setup clock aliases and
break the dependency on device pointers in the clock tables.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
-rw-r--r-- | arch/arm/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-msm/board-msm7x30.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-msm/board-msm8960.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-msm/board-qsd8x50.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-msm/board-trout.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-msm/clock-7x30.h | 31 | ||||
-rw-r--r-- | arch/arm/mach-msm/clock-pcom.h | 16 | ||||
-rw-r--r-- | arch/arm/mach-msm/clock.c | 39 | ||||
-rw-r--r-- | arch/arm/mach-msm/clock.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-msm/devices-msm7x00.c | 32 | ||||
-rw-r--r-- | arch/arm/mach-msm/devices-msm7x30.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-msm/devices-qsd8x50.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-msm/devices.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-msm/include/mach/board.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-msm/include/mach/clkdev.h | 19 |
15 files changed, 98 insertions, 86 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 5cff165b7eb..4d266509b45 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -619,6 +619,7 @@ config ARCH_MSM | |||
619 | select HAVE_CLK | 619 | select HAVE_CLK |
620 | select GENERIC_CLOCKEVENTS | 620 | select GENERIC_CLOCKEVENTS |
621 | select ARCH_REQUIRE_GPIOLIB | 621 | select ARCH_REQUIRE_GPIOLIB |
622 | select CLKDEV_LOOKUP | ||
622 | help | 623 | help |
623 | Support for Qualcomm MSM/QSD based systems. This runs on the | 624 | Support for Qualcomm MSM/QSD based systems. This runs on the |
624 | apps processor of the MSM/QSD and depends on a shared memory | 625 | apps processor of the MSM/QSD and depends on a shared memory |
diff --git a/arch/arm/mach-msm/board-msm7x30.c b/arch/arm/mach-msm/board-msm7x30.c index dc9fac107c6..cf15889ab61 100644 --- a/arch/arm/mach-msm/board-msm7x30.c +++ b/arch/arm/mach-msm/board-msm7x30.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/smsc911x.h> | 24 | #include <linux/smsc911x.h> |
25 | #include <linux/usb/msm_hsusb.h> | 25 | #include <linux/usb/msm_hsusb.h> |
26 | #include <linux/clkdev.h> | ||
26 | 27 | ||
27 | #include <asm/mach-types.h> | 28 | #include <asm/mach-types.h> |
28 | #include <asm/mach/arch.h> | 29 | #include <asm/mach/arch.h> |
diff --git a/arch/arm/mach-msm/board-msm8960.c b/arch/arm/mach-msm/board-msm8960.c index ef80f46d6cb..1993721d472 100644 --- a/arch/arm/mach-msm/board-msm8960.c +++ b/arch/arm/mach-msm/board-msm8960.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | #include <linux/irq.h> | 21 | #include <linux/irq.h> |
22 | #include <linux/clkdev.h> | ||
22 | 23 | ||
23 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
24 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
diff --git a/arch/arm/mach-msm/board-qsd8x50.c b/arch/arm/mach-msm/board-qsd8x50.c index b464d48da7c..127ee6df242 100644 --- a/arch/arm/mach-msm/board-qsd8x50.c +++ b/arch/arm/mach-msm/board-qsd8x50.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <linux/usb/msm_hsusb.h> | 23 | #include <linux/usb/msm_hsusb.h> |
24 | #include <linux/err.h> | 24 | #include <linux/err.h> |
25 | #include <linux/clkdev.h> | ||
25 | 26 | ||
26 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
27 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
diff --git a/arch/arm/mach-msm/board-trout.c b/arch/arm/mach-msm/board-trout.c index 8448687f5a4..814386772c6 100644 --- a/arch/arm/mach-msm/board-trout.c +++ b/arch/arm/mach-msm/board-trout.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
20 | #include <linux/clkdev.h> | ||
20 | 21 | ||
21 | #include <asm/mach-types.h> | 22 | #include <asm/mach-types.h> |
22 | #include <asm/mach/arch.h> | 23 | #include <asm/mach/arch.h> |
diff --git a/arch/arm/mach-msm/clock-7x30.h b/arch/arm/mach-msm/clock-7x30.h index 53622b3992b..14104453688 100644 --- a/arch/arm/mach-msm/clock-7x30.h +++ b/arch/arm/mach-msm/clock-7x30.h | |||
@@ -130,23 +130,26 @@ void pll_disable(uint32_t pll); | |||
130 | extern int internal_pwr_rail_ctl_auto(unsigned rail_id, bool enable); | 130 | extern int internal_pwr_rail_ctl_auto(unsigned rail_id, bool enable); |
131 | 131 | ||
132 | #define CLK_7X30(clk_name, clk_id, clk_dev, clk_flags) { \ | 132 | #define CLK_7X30(clk_name, clk_id, clk_dev, clk_flags) { \ |
133 | .name = clk_name, \ | 133 | .con_id = clk_name, \ |
134 | .id = L_7X30_##clk_id, \ | 134 | .dev_id = clk_dev, \ |
135 | .remote_id = P_##clk_id, \ | 135 | .clk = &(struct clk){ \ |
136 | .flags = clk_flags, \ | 136 | .id = L_7X30_##clk_id, \ |
137 | .dev = clk_dev, \ | 137 | .remote_id = P_##clk_id, \ |
138 | .dbg_name = #clk_id, \ | 138 | .flags = clk_flags, \ |
139 | .dbg_name = #clk_id, \ | ||
140 | }, \ | ||
139 | } | 141 | } |
140 | 142 | ||
141 | #define CLK_7X30S(clk_name, l_id, r_id, clk_dev, clk_flags) { \ | 143 | #define CLK_7X30S(clk_name, l_id, r_id, clk_dev, clk_flags) { \ |
142 | .name = clk_name, \ | 144 | .con_id = clk_name, \ |
143 | .id = L_7X30_##l_id, \ | 145 | .dev_id = clk_dev, \ |
144 | .remote_id = P_##r_id, \ | 146 | .clk = &(struct clk){ \ |
145 | .flags = clk_flags, \ | 147 | .id = L_7X30_##l_id, \ |
146 | .dev = clk_dev, \ | 148 | .remote_id = P_##r_id, \ |
147 | .dbg_name = #l_id, \ | 149 | .flags = clk_flags, \ |
148 | .ops = &clk_ops_pcom, \ | 150 | .dbg_name = #l_id, \ |
151 | .ops = &clk_ops_pcom, \ | ||
152 | }, \ | ||
149 | } | 153 | } |
150 | 154 | ||
151 | #endif | 155 | #endif |
152 | |||
diff --git a/arch/arm/mach-msm/clock-pcom.h b/arch/arm/mach-msm/clock-pcom.h index 53dea61da76..974d0032f3a 100644 --- a/arch/arm/mach-msm/clock-pcom.h +++ b/arch/arm/mach-msm/clock-pcom.h | |||
@@ -126,13 +126,15 @@ extern struct clk_ops clk_ops_pcom; | |||
126 | int pc_clk_reset(unsigned id, enum clk_reset_action action); | 126 | int pc_clk_reset(unsigned id, enum clk_reset_action action); |
127 | 127 | ||
128 | #define CLK_PCOM(clk_name, clk_id, clk_dev, clk_flags) { \ | 128 | #define CLK_PCOM(clk_name, clk_id, clk_dev, clk_flags) { \ |
129 | .name = clk_name, \ | 129 | .con_id = clk_name, \ |
130 | .id = P_##clk_id, \ | 130 | .dev_id = clk_dev, \ |
131 | .remote_id = P_##clk_id, \ | 131 | .clk = &(struct clk){ \ |
132 | .ops = &clk_ops_pcom, \ | 132 | .id = P_##clk_id, \ |
133 | .flags = clk_flags, \ | 133 | .remote_id = P_##clk_id, \ |
134 | .dev = clk_dev, \ | 134 | .ops = &clk_ops_pcom, \ |
135 | .dbg_name = #clk_id, \ | 135 | .flags = clk_flags, \ |
136 | .dbg_name = #clk_id, \ | ||
137 | }, \ | ||
136 | } | 138 | } |
137 | 139 | ||
138 | #endif | 140 | #endif |
diff --git a/arch/arm/mach-msm/clock.c b/arch/arm/mach-msm/clock.c index e00f6a040ad..22a53766962 100644 --- a/arch/arm/mach-msm/clock.c +++ b/arch/arm/mach-msm/clock.c | |||
@@ -19,6 +19,11 @@ | |||
19 | #include <linux/err.h> | 19 | #include <linux/err.h> |
20 | #include <linux/spinlock.h> | 20 | #include <linux/spinlock.h> |
21 | #include <linux/pm_qos_params.h> | 21 | #include <linux/pm_qos_params.h> |
22 | #include <linux/mutex.h> | ||
23 | #include <linux/clk.h> | ||
24 | #include <linux/string.h> | ||
25 | #include <linux/module.h> | ||
26 | #include <linux/clkdev.h> | ||
22 | 27 | ||
23 | #include "clock.h" | 28 | #include "clock.h" |
24 | 29 | ||
@@ -29,32 +34,6 @@ static LIST_HEAD(clocks); | |||
29 | /* | 34 | /* |
30 | * Standard clock functions defined in include/linux/clk.h | 35 | * Standard clock functions defined in include/linux/clk.h |
31 | */ | 36 | */ |
32 | struct clk *clk_get(struct device *dev, const char *id) | ||
33 | { | ||
34 | struct clk *clk; | ||
35 | |||
36 | mutex_lock(&clocks_mutex); | ||
37 | |||
38 | list_for_each_entry(clk, &clocks, list) | ||
39 | if (!strcmp(id, clk->name) && clk->dev == dev) | ||
40 | goto found_it; | ||
41 | |||
42 | list_for_each_entry(clk, &clocks, list) | ||
43 | if (!strcmp(id, clk->name) && clk->dev == NULL) | ||
44 | goto found_it; | ||
45 | |||
46 | clk = ERR_PTR(-ENOENT); | ||
47 | found_it: | ||
48 | mutex_unlock(&clocks_mutex); | ||
49 | return clk; | ||
50 | } | ||
51 | EXPORT_SYMBOL(clk_get); | ||
52 | |||
53 | void clk_put(struct clk *clk) | ||
54 | { | ||
55 | } | ||
56 | EXPORT_SYMBOL(clk_put); | ||
57 | |||
58 | int clk_enable(struct clk *clk) | 37 | int clk_enable(struct clk *clk) |
59 | { | 38 | { |
60 | unsigned long flags; | 39 | unsigned long flags; |
@@ -157,13 +136,15 @@ EXPORT_SYMBOL(clk_set_flags); | |||
157 | */ | 136 | */ |
158 | static struct clk *ebi1_clk; | 137 | static struct clk *ebi1_clk; |
159 | 138 | ||
160 | void __init msm_clock_init(struct clk *clock_tbl, unsigned num_clocks) | 139 | void __init msm_clock_init(struct clk_lookup *clock_tbl, unsigned num_clocks) |
161 | { | 140 | { |
162 | unsigned n; | 141 | unsigned n; |
163 | 142 | ||
164 | mutex_lock(&clocks_mutex); | 143 | mutex_lock(&clocks_mutex); |
165 | for (n = 0; n < num_clocks; n++) | 144 | for (n = 0; n < num_clocks; n++) { |
166 | list_add_tail(&clock_tbl[n].list, &clocks); | 145 | clkdev_add(&clock_tbl[n]); |
146 | list_add_tail(&clock_tbl[n].clk->list, &clocks); | ||
147 | } | ||
167 | mutex_unlock(&clocks_mutex); | 148 | mutex_unlock(&clocks_mutex); |
168 | 149 | ||
169 | ebi1_clk = clk_get(NULL, "ebi1_clk"); | 150 | ebi1_clk = clk_get(NULL, "ebi1_clk"); |
diff --git a/arch/arm/mach-msm/clock.h b/arch/arm/mach-msm/clock.h index 8d302c7403a..2c007f606d2 100644 --- a/arch/arm/mach-msm/clock.h +++ b/arch/arm/mach-msm/clock.h | |||
@@ -51,11 +51,9 @@ struct clk { | |||
51 | uint32_t remote_id; | 51 | uint32_t remote_id; |
52 | uint32_t count; | 52 | uint32_t count; |
53 | uint32_t flags; | 53 | uint32_t flags; |
54 | const char *name; | ||
55 | struct clk_ops *ops; | 54 | struct clk_ops *ops; |
56 | const char *dbg_name; | 55 | const char *dbg_name; |
57 | struct list_head list; | 56 | struct list_head list; |
58 | struct device *dev; | ||
59 | }; | 57 | }; |
60 | 58 | ||
61 | #define OFF CLKFLAG_AUTO_OFF | 59 | #define OFF CLKFLAG_AUTO_OFF |
diff --git a/arch/arm/mach-msm/devices-msm7x00.c b/arch/arm/mach-msm/devices-msm7x00.c index ed62806559e..c4f5e26feb4 100644 --- a/arch/arm/mach-msm/devices-msm7x00.c +++ b/arch/arm/mach-msm/devices-msm7x00.c | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/clkdev.h> | ||
18 | 19 | ||
19 | #include <mach/irqs.h> | 20 | #include <mach/irqs.h> |
20 | #include <mach/msm_iomap.h> | 21 | #include <mach/msm_iomap.h> |
@@ -24,7 +25,6 @@ | |||
24 | #include <linux/mtd/nand.h> | 25 | #include <linux/mtd/nand.h> |
25 | #include <linux/mtd/partitions.h> | 26 | #include <linux/mtd/partitions.h> |
26 | 27 | ||
27 | |||
28 | #include "clock.h" | 28 | #include "clock.h" |
29 | #include "clock-pcom.h" | 29 | #include "clock-pcom.h" |
30 | #include <mach/mmc.h> | 30 | #include <mach/mmc.h> |
@@ -418,7 +418,7 @@ struct platform_device msm_device_mdp = { | |||
418 | .resource = resources_mdp, | 418 | .resource = resources_mdp, |
419 | }; | 419 | }; |
420 | 420 | ||
421 | struct clk msm_clocks_7x01a[] = { | 421 | struct clk_lookup msm_clocks_7x01a[] = { |
422 | CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), | 422 | CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), |
423 | CLK_PCOM("adsp_clk", ADSP_CLK, NULL, 0), | 423 | CLK_PCOM("adsp_clk", ADSP_CLK, NULL, 0), |
424 | CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, 0), | 424 | CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, 0), |
@@ -427,7 +427,7 @@ struct clk msm_clocks_7x01a[] = { | |||
427 | CLK_PCOM("emdh_clk", EMDH_CLK, NULL, OFF), | 427 | CLK_PCOM("emdh_clk", EMDH_CLK, NULL, OFF), |
428 | CLK_PCOM("gp_clk", GP_CLK, NULL, 0), | 428 | CLK_PCOM("gp_clk", GP_CLK, NULL, 0), |
429 | CLK_PCOM("grp_clk", GRP_3D_CLK, NULL, OFF), | 429 | CLK_PCOM("grp_clk", GRP_3D_CLK, NULL, OFF), |
430 | CLK_PCOM("i2c_clk", I2C_CLK, &msm_device_i2c.dev, 0), | 430 | CLK_PCOM("i2c_clk", I2C_CLK, "msm_i2c.0", 0), |
431 | CLK_PCOM("icodec_rx_clk", ICODEC_RX_CLK, NULL, 0), | 431 | CLK_PCOM("icodec_rx_clk", ICODEC_RX_CLK, NULL, 0), |
432 | CLK_PCOM("icodec_tx_clk", ICODEC_TX_CLK, NULL, 0), | 432 | CLK_PCOM("icodec_tx_clk", ICODEC_TX_CLK, NULL, 0), |
433 | CLK_PCOM("imem_clk", IMEM_CLK, NULL, OFF), | 433 | CLK_PCOM("imem_clk", IMEM_CLK, NULL, OFF), |
@@ -437,25 +437,25 @@ struct clk msm_clocks_7x01a[] = { | |||
437 | CLK_PCOM("pcm_clk", PCM_CLK, NULL, 0), | 437 | CLK_PCOM("pcm_clk", PCM_CLK, NULL, 0), |
438 | CLK_PCOM("mddi_clk", PMDH_CLK, NULL, OFF | CLK_MINMAX), | 438 | CLK_PCOM("mddi_clk", PMDH_CLK, NULL, OFF | CLK_MINMAX), |
439 | CLK_PCOM("sdac_clk", SDAC_CLK, NULL, OFF), | 439 | CLK_PCOM("sdac_clk", SDAC_CLK, NULL, OFF), |
440 | CLK_PCOM("sdc_clk", SDC1_CLK, &msm_device_sdc1.dev, OFF), | 440 | CLK_PCOM("sdc_clk", SDC1_CLK, "msm_sdcc.1", OFF), |
441 | CLK_PCOM("sdc_pclk", SDC1_P_CLK, &msm_device_sdc1.dev, OFF), | 441 | CLK_PCOM("sdc_pclk", SDC1_P_CLK, "msm_sdcc.1", OFF), |
442 | CLK_PCOM("sdc_clk", SDC2_CLK, &msm_device_sdc2.dev, OFF), | 442 | CLK_PCOM("sdc_clk", SDC2_CLK, "msm_sdcc.2", OFF), |
443 | CLK_PCOM("sdc_pclk", SDC2_P_CLK, &msm_device_sdc2.dev, OFF), | 443 | CLK_PCOM("sdc_pclk", SDC2_P_CLK, "msm_sdcc.2", OFF), |
444 | CLK_PCOM("sdc_clk", SDC3_CLK, &msm_device_sdc3.dev, OFF), | 444 | CLK_PCOM("sdc_clk", SDC3_CLK, "msm_sdcc.3", OFF), |
445 | CLK_PCOM("sdc_pclk", SDC3_P_CLK, &msm_device_sdc3.dev, OFF), | 445 | CLK_PCOM("sdc_pclk", SDC3_P_CLK, "msm_sdcc.3", OFF), |
446 | CLK_PCOM("sdc_clk", SDC4_CLK, &msm_device_sdc4.dev, OFF), | 446 | CLK_PCOM("sdc_clk", SDC4_CLK, "msm_sdcc.4", OFF), |
447 | CLK_PCOM("sdc_pclk", SDC4_P_CLK, &msm_device_sdc4.dev, OFF), | 447 | CLK_PCOM("sdc_pclk", SDC4_P_CLK, "msm_sdcc.4", OFF), |
448 | CLK_PCOM("tsif_clk", TSIF_CLK, NULL, 0), | 448 | CLK_PCOM("tsif_clk", TSIF_CLK, NULL, 0), |
449 | CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0), | 449 | CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0), |
450 | CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), | 450 | CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), |
451 | CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), | 451 | CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), |
452 | CLK_PCOM("uart_clk", UART1_CLK, &msm_device_uart1.dev, OFF), | 452 | CLK_PCOM("uart_clk", UART1_CLK, "msm_serial.0", OFF), |
453 | CLK_PCOM("uart_clk", UART2_CLK, &msm_device_uart2.dev, 0), | 453 | CLK_PCOM("uart_clk", UART2_CLK, "msm_serial.1", 0), |
454 | CLK_PCOM("uart_clk", UART3_CLK, &msm_device_uart3.dev, OFF), | 454 | CLK_PCOM("uart_clk", UART3_CLK, "msm_serial.2", OFF), |
455 | CLK_PCOM("uart1dm_clk", UART1DM_CLK, NULL, OFF), | 455 | CLK_PCOM("uart1dm_clk", UART1DM_CLK, NULL, OFF), |
456 | CLK_PCOM("uart2dm_clk", UART2DM_CLK, NULL, 0), | 456 | CLK_PCOM("uart2dm_clk", UART2DM_CLK, NULL, 0), |
457 | CLK_PCOM("usb_hs_clk", USB_HS_CLK, &msm_device_hsusb.dev, OFF), | 457 | CLK_PCOM("usb_hs_clk", USB_HS_CLK, "msm_hsusb", OFF), |
458 | CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, &msm_device_hsusb.dev, OFF), | 458 | CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, "msm_hsusb", OFF), |
459 | CLK_PCOM("usb_otg_clk", USB_OTG_CLK, NULL, 0), | 459 | CLK_PCOM("usb_otg_clk", USB_OTG_CLK, NULL, 0), |
460 | CLK_PCOM("vdc_clk", VDC_CLK, NULL, OFF ), | 460 | CLK_PCOM("vdc_clk", VDC_CLK, NULL, OFF ), |
461 | CLK_PCOM("vfe_clk", VFE_CLK, NULL, OFF), | 461 | CLK_PCOM("vfe_clk", VFE_CLK, NULL, OFF), |
diff --git a/arch/arm/mach-msm/devices-msm7x30.c b/arch/arm/mach-msm/devices-msm7x30.c index cd4343bcf73..09b4f140382 100644 --- a/arch/arm/mach-msm/devices-msm7x30.c +++ b/arch/arm/mach-msm/devices-msm7x30.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | 18 | ||
19 | #include <linux/dma-mapping.h> | 19 | #include <linux/dma-mapping.h> |
20 | #include <linux/clkdev.h> | ||
20 | #include <mach/irqs.h> | 21 | #include <mach/irqs.h> |
21 | #include <mach/msm_iomap.h> | 22 | #include <mach/msm_iomap.h> |
22 | #include <mach/dma.h> | 23 | #include <mach/dma.h> |
@@ -129,7 +130,7 @@ struct platform_device msm_device_hsusb_host = { | |||
129 | }, | 130 | }, |
130 | }; | 131 | }; |
131 | 132 | ||
132 | struct clk msm_clocks_7x30[] = { | 133 | struct clk_lookup msm_clocks_7x30[] = { |
133 | CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), | 134 | CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), |
134 | CLK_PCOM("adsp_clk", ADSP_CLK, NULL, 0), | 135 | CLK_PCOM("adsp_clk", ADSP_CLK, NULL, 0), |
135 | CLK_PCOM("cam_m_clk", CAM_M_CLK, NULL, 0), | 136 | CLK_PCOM("cam_m_clk", CAM_M_CLK, NULL, 0), |
@@ -181,7 +182,7 @@ struct clk msm_clocks_7x30[] = { | |||
181 | CLK_7X30S("tv_src_clk", TV_CLK, TV_ENC_CLK, NULL, 0), | 182 | CLK_7X30S("tv_src_clk", TV_CLK, TV_ENC_CLK, NULL, 0), |
182 | CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), | 183 | CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), |
183 | CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), | 184 | CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), |
184 | CLK_PCOM("uart_clk", UART2_CLK, &msm_device_uart2.dev, 0), | 185 | CLK_PCOM("uart_clk", UART2_CLK, "msm_serial.1", 0), |
185 | CLK_PCOM("usb_phy_clk", USB_PHY_CLK, NULL, 0), | 186 | CLK_PCOM("usb_phy_clk", USB_PHY_CLK, NULL, 0), |
186 | CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), | 187 | CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), |
187 | CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF), | 188 | CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF), |
diff --git a/arch/arm/mach-msm/devices-qsd8x50.c b/arch/arm/mach-msm/devices-qsd8x50.c index bd545f9e8c2..12d8deb78d9 100644 --- a/arch/arm/mach-msm/devices-qsd8x50.c +++ b/arch/arm/mach-msm/devices-qsd8x50.c | |||
@@ -15,8 +15,9 @@ | |||
15 | 15 | ||
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | 18 | #include <linux/clkdev.h> | |
19 | #include <linux/dma-mapping.h> | 19 | #include <linux/dma-mapping.h> |
20 | |||
20 | #include <mach/irqs.h> | 21 | #include <mach/irqs.h> |
21 | #include <mach/msm_iomap.h> | 22 | #include <mach/msm_iomap.h> |
22 | #include <mach/dma.h> | 23 | #include <mach/dma.h> |
@@ -314,7 +315,7 @@ int __init msm_add_sdcc(unsigned int controller, | |||
314 | return platform_device_register(pdev); | 315 | return platform_device_register(pdev); |
315 | } | 316 | } |
316 | 317 | ||
317 | struct clk msm_clocks_8x50[] = { | 318 | struct clk_lookup msm_clocks_8x50[] = { |
318 | CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), | 319 | CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), |
319 | CLK_PCOM("ce_clk", CE_CLK, NULL, 0), | 320 | CLK_PCOM("ce_clk", CE_CLK, NULL, 0), |
320 | CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, CLK_MIN), | 321 | CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, CLK_MIN), |
@@ -336,14 +337,14 @@ struct clk msm_clocks_8x50[] = { | |||
336 | CLK_PCOM("pbus_clk", PBUS_CLK, NULL, CLK_MIN), | 337 | CLK_PCOM("pbus_clk", PBUS_CLK, NULL, CLK_MIN), |
337 | CLK_PCOM("pcm_clk", PCM_CLK, NULL, 0), | 338 | CLK_PCOM("pcm_clk", PCM_CLK, NULL, 0), |
338 | CLK_PCOM("sdac_clk", SDAC_CLK, NULL, OFF), | 339 | CLK_PCOM("sdac_clk", SDAC_CLK, NULL, OFF), |
339 | CLK_PCOM("sdc_clk", SDC1_CLK, &msm_device_sdc1.dev, OFF), | 340 | CLK_PCOM("sdc_clk", SDC1_CLK, "msm_sdcc.1", OFF), |
340 | CLK_PCOM("sdc_pclk", SDC1_P_CLK, &msm_device_sdc1.dev, OFF), | 341 | CLK_PCOM("sdc_pclk", SDC1_P_CLK, "msm_sdcc.1", OFF), |
341 | CLK_PCOM("sdc_clk", SDC2_CLK, &msm_device_sdc2.dev, OFF), | 342 | CLK_PCOM("sdc_clk", SDC2_CLK, "msm_sdcc.2", OFF), |
342 | CLK_PCOM("sdc_pclk", SDC2_P_CLK, &msm_device_sdc2.dev, OFF), | 343 | CLK_PCOM("sdc_pclk", SDC2_P_CLK, "msm_sdcc.2", OFF), |
343 | CLK_PCOM("sdc_clk", SDC3_CLK, &msm_device_sdc3.dev, OFF), | 344 | CLK_PCOM("sdc_clk", SDC3_CLK, "msm_sdcc.3", OFF), |
344 | CLK_PCOM("sdc_pclk", SDC3_P_CLK, &msm_device_sdc3.dev, OFF), | 345 | CLK_PCOM("sdc_pclk", SDC3_P_CLK, "msm_sdcc.3", OFF), |
345 | CLK_PCOM("sdc_clk", SDC4_CLK, &msm_device_sdc4.dev, OFF), | 346 | CLK_PCOM("sdc_clk", SDC4_CLK, "msm_sdcc.4", OFF), |
346 | CLK_PCOM("sdc_pclk", SDC4_P_CLK, &msm_device_sdc4.dev, OFF), | 347 | CLK_PCOM("sdc_pclk", SDC4_P_CLK, "msm_sdcc.4", OFF), |
347 | CLK_PCOM("spi_clk", SPI_CLK, NULL, 0), | 348 | CLK_PCOM("spi_clk", SPI_CLK, NULL, 0), |
348 | CLK_PCOM("tsif_clk", TSIF_CLK, NULL, 0), | 349 | CLK_PCOM("tsif_clk", TSIF_CLK, NULL, 0), |
349 | CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0), | 350 | CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0), |
@@ -351,7 +352,7 @@ struct clk msm_clocks_8x50[] = { | |||
351 | CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), | 352 | CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), |
352 | CLK_PCOM("uart_clk", UART1_CLK, NULL, OFF), | 353 | CLK_PCOM("uart_clk", UART1_CLK, NULL, OFF), |
353 | CLK_PCOM("uart_clk", UART2_CLK, NULL, 0), | 354 | CLK_PCOM("uart_clk", UART2_CLK, NULL, 0), |
354 | CLK_PCOM("uart_clk", UART3_CLK, &msm_device_uart3.dev, OFF), | 355 | CLK_PCOM("uart_clk", UART3_CLK, "msm_serial.2", OFF), |
355 | CLK_PCOM("uartdm_clk", UART1DM_CLK, NULL, OFF), | 356 | CLK_PCOM("uartdm_clk", UART1DM_CLK, NULL, OFF), |
356 | CLK_PCOM("uartdm_clk", UART2DM_CLK, NULL, 0), | 357 | CLK_PCOM("uartdm_clk", UART2DM_CLK, NULL, 0), |
357 | CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), | 358 | CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), |
diff --git a/arch/arm/mach-msm/devices.h b/arch/arm/mach-msm/devices.h index e2643b340b2..9545c196c6e 100644 --- a/arch/arm/mach-msm/devices.h +++ b/arch/arm/mach-msm/devices.h | |||
@@ -16,6 +16,8 @@ | |||
16 | #ifndef __ARCH_ARM_MACH_MSM_DEVICES_H | 16 | #ifndef __ARCH_ARM_MACH_MSM_DEVICES_H |
17 | #define __ARCH_ARM_MACH_MSM_DEVICES_H | 17 | #define __ARCH_ARM_MACH_MSM_DEVICES_H |
18 | 18 | ||
19 | #include <linux/clkdev.h> | ||
20 | |||
19 | #include "clock.h" | 21 | #include "clock.h" |
20 | 22 | ||
21 | extern struct platform_device msm_device_uart1; | 23 | extern struct platform_device msm_device_uart1; |
@@ -44,13 +46,13 @@ extern struct platform_device msm_device_mddi0; | |||
44 | extern struct platform_device msm_device_mddi1; | 46 | extern struct platform_device msm_device_mddi1; |
45 | extern struct platform_device msm_device_mdp; | 47 | extern struct platform_device msm_device_mdp; |
46 | 48 | ||
47 | extern struct clk msm_clocks_7x01a[]; | 49 | extern struct clk_lookup msm_clocks_7x01a[]; |
48 | extern unsigned msm_num_clocks_7x01a; | 50 | extern unsigned msm_num_clocks_7x01a; |
49 | 51 | ||
50 | extern struct clk msm_clocks_7x30[]; | 52 | extern struct clk_lookup msm_clocks_7x30[]; |
51 | extern unsigned msm_num_clocks_7x30; | 53 | extern unsigned msm_num_clocks_7x30; |
52 | 54 | ||
53 | extern struct clk msm_clocks_8x50[]; | 55 | extern struct clk_lookup msm_clocks_8x50[]; |
54 | extern unsigned msm_num_clocks_8x50; | 56 | extern unsigned msm_num_clocks_8x50; |
55 | 57 | ||
56 | #endif | 58 | #endif |
diff --git a/arch/arm/mach-msm/include/mach/board.h b/arch/arm/mach-msm/include/mach/board.h index 6abf4a6eadc..2ce8f1f2fc4 100644 --- a/arch/arm/mach-msm/include/mach/board.h +++ b/arch/arm/mach-msm/include/mach/board.h | |||
@@ -31,7 +31,7 @@ struct msm_acpu_clock_platform_data | |||
31 | unsigned long wait_for_irq_khz; | 31 | unsigned long wait_for_irq_khz; |
32 | }; | 32 | }; |
33 | 33 | ||
34 | struct clk; | 34 | struct clk_lookup; |
35 | 35 | ||
36 | extern struct sys_timer msm_timer; | 36 | extern struct sys_timer msm_timer; |
37 | 37 | ||
@@ -41,7 +41,7 @@ void __init msm_add_devices(void); | |||
41 | void __init msm_map_common_io(void); | 41 | void __init msm_map_common_io(void); |
42 | void __init msm_init_irq(void); | 42 | void __init msm_init_irq(void); |
43 | void __init msm_init_gpio(void); | 43 | void __init msm_init_gpio(void); |
44 | void __init msm_clock_init(struct clk *clock_tbl, unsigned num_clocks); | 44 | void __init msm_clock_init(struct clk_lookup *clock_tbl, unsigned num_clocks); |
45 | void __init msm_acpu_clock_init(struct msm_acpu_clock_platform_data *); | 45 | void __init msm_acpu_clock_init(struct msm_acpu_clock_platform_data *); |
46 | int __init msm_add_sdcc(unsigned int controller, | 46 | int __init msm_add_sdcc(unsigned int controller, |
47 | struct msm_mmc_platform_data *plat, | 47 | struct msm_mmc_platform_data *plat, |
diff --git a/arch/arm/mach-msm/include/mach/clkdev.h b/arch/arm/mach-msm/include/mach/clkdev.h new file mode 100644 index 00000000000..f87a57b5953 --- /dev/null +++ b/arch/arm/mach-msm/include/mach/clkdev.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* Copyright (c) 2011, Code Aurora Forum. All rights reserved. | ||
2 | * | ||
3 | * This program is free software; you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License version 2 and | ||
5 | * only version 2 as published by the Free Software Foundation. | ||
6 | * | ||
7 | * This program is distributed in the hope that it will be useful, | ||
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
10 | * GNU General Public License for more details. | ||
11 | */ | ||
12 | #ifndef __ASM_ARCH_MSM_CLKDEV_H | ||
13 | #define __ASM_ARCH_MSM_CLKDEV_H | ||
14 | |||
15 | struct clk; | ||
16 | |||
17 | static inline int __clk_get(struct clk *clk) { return 1; } | ||
18 | static inline void __clk_put(struct clk *clk) { } | ||
19 | #endif | ||