aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-05-20 23:18:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-20 23:18:12 -0400
commit0eff4589c36edd03d50b835d0768b2c2ef3f20bd (patch)
treef0a08e7ed4dac042d89d24bb4c79f66df70085ff /include
parent087afe8aaf562dc7a53f2577049830d6a3245742 (diff)
parentef56b79b66faeeb0dc14213d3cc9e0534a960dee (diff)
Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
Pull clk updates from Stephen Boyd: "It's the usual big pile of driver updates and additions, but we do have a couple core changes in here as well. Core: - CLK_IS_CRITICAL support has been added. This should allow drivers to properly express that a certain clk should stay on even if their prepare/enable count drops to 0 (and in turn the parents of these clks should stay enabled). - A clk registration API has been added, clk_hw_register(), and an OF clk provider API has been added, of_clk_add_hw_provider(). These APIs have been put in place to further split clk providers from clk consumers, with the goal being to have clk providers never deal with struct clk pointers at all. Conversion of provider drivers is on going. clkdev has also gained support for registering clk_hw pointers directly so we can convert drivers that don't use devicetree. New Drivers: - Marvell ap806 and cp110 system controllers (with clks inside!) - Hisilicon Hi3519 clock and reset controller - Axis ARTPEC-6 clock controllers - Oxford Semiconductor OXNAS clock controllers - AXS10X I2S PLL - Rockchip RK3399 clock and reset controller Updates: - MMC2 and UART2 clks on Samsung Exynos 3250, ACLK on Samsung Exynos 542x SoCs, and some more clk ID exporting for bus frequency scaling - Proper BCM2835 PCM clk support and various other clks - i.MX clk updates for i.MX6SX, i.MX7, and VF610 - Renesas updates for R-Car H3 - Tegra210 got updates for DisplayPort and HDMI 2.0 - Rockchip driver refactorings and fixes due to adding RK3399 support" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (139 commits) clk: fix critical clock locking clk: qcom: mmcc-8996: Remove clocks that should be controlled by RPM clk: ingenic: Allow divider value to be divided clk: sunxi: Add display and TCON0 clocks driver clk: rockchip: drop old_rate calculation on pll rate changes clk: rockchip: simplify GRF handling in pll clocks clk: rockchip: lookup General Register Files in rockchip_clk_init clk: rockchip: fix the rk3399 sdmmc sample / drv name clk: mvebu: new driver for Armada CP110 system controller dt-bindings: arm: add DT binding for Marvell CP110 system controller clk: mvebu: new driver for Armada AP806 system controller clk: hisilicon: add CRG driver for hi3519 soc clk: hisilicon: export some hisilicon APIs to modules reset: hisilicon: add reset controller driver for hisilicon SOCs clk: bcm/kona: Do not use sizeof on pointer type clk: qcom: msm8916: Fix crypto clock flags clk: nxp: lpc18xx: Initialize clk_init_data::flags to 0 clk/axs10x: Add I2S PLL clock driver clk: imx7d: fix ahb clock mux 1 clk: fix comment of devm_clk_hw_register() ...
Diffstat (limited to 'include')
-rw-r--r--include/dt-bindings/clock/axis,artpec6-clkctrl.h38
-rw-r--r--include/dt-bindings/clock/bcm2835.h20
-rw-r--r--include/dt-bindings/clock/exynos5420.h24
-rw-r--r--include/dt-bindings/clock/hi3519-clock.h40
-rw-r--r--include/dt-bindings/clock/imx7d-clock.h3
-rw-r--r--include/dt-bindings/clock/tegra210-car.h2
-rw-r--r--include/dt-bindings/clock/vf610-clock.h8
-rw-r--r--include/linux/clk-provider.h103
-rw-r--r--include/linux/clk/ti.h2
-rw-r--r--include/linux/clkdev.h7
10 files changed, 239 insertions, 8 deletions
diff --git a/include/dt-bindings/clock/axis,artpec6-clkctrl.h b/include/dt-bindings/clock/axis,artpec6-clkctrl.h
new file mode 100644
index 000000000000..f9f04dccc996
--- /dev/null
+++ b/include/dt-bindings/clock/axis,artpec6-clkctrl.h
@@ -0,0 +1,38 @@
1/*
2 * ARTPEC-6 clock controller indexes
3 *
4 * Copyright 2016 Axis Comunications AB.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef DT_BINDINGS_CLK_ARTPEC6_CLKCTRL_H
12#define DT_BINDINGS_CLK_ARTPEC6_CLKCTRL_H
13
14#define ARTPEC6_CLK_CPU 0
15#define ARTPEC6_CLK_CPU_PERIPH 1
16#define ARTPEC6_CLK_NAND_CLKA 2
17#define ARTPEC6_CLK_NAND_CLKB 3
18#define ARTPEC6_CLK_ETH_ACLK 4
19#define ARTPEC6_CLK_DMA_ACLK 5
20#define ARTPEC6_CLK_PTP_REF 6
21#define ARTPEC6_CLK_SD_PCLK 7
22#define ARTPEC6_CLK_SD_IMCLK 8
23#define ARTPEC6_CLK_I2S_HST 9
24#define ARTPEC6_CLK_I2S0_CLK 10
25#define ARTPEC6_CLK_I2S1_CLK 11
26#define ARTPEC6_CLK_UART_PCLK 12
27#define ARTPEC6_CLK_UART_REFCLK 13
28#define ARTPEC6_CLK_I2C 14
29#define ARTPEC6_CLK_SPI_PCLK 15
30#define ARTPEC6_CLK_SPI_SSPCLK 16
31#define ARTPEC6_CLK_SYS_TIMER 17
32#define ARTPEC6_CLK_FRACDIV_IN 18
33#define ARTPEC6_CLK_DBG_PCLK 19
34
35/* This must be the highest clock index plus one. */
36#define ARTPEC6_CLK_NUMCLOCKS 20
37
38#endif
diff --git a/include/dt-bindings/clock/bcm2835.h b/include/dt-bindings/clock/bcm2835.h
index 61f1d20c2a67..360e00cefd35 100644
--- a/include/dt-bindings/clock/bcm2835.h
+++ b/include/dt-bindings/clock/bcm2835.h
@@ -44,5 +44,23 @@
44#define BCM2835_CLOCK_EMMC 28 44#define BCM2835_CLOCK_EMMC 28
45#define BCM2835_CLOCK_PERI_IMAGE 29 45#define BCM2835_CLOCK_PERI_IMAGE 29
46#define BCM2835_CLOCK_PWM 30 46#define BCM2835_CLOCK_PWM 30
47#define BCM2835_CLOCK_PCM 31
47 48
48#define BCM2835_CLOCK_COUNT 31 49#define BCM2835_PLLA_DSI0 32
50#define BCM2835_PLLA_CCP2 33
51#define BCM2835_PLLD_DSI0 34
52#define BCM2835_PLLD_DSI1 35
53
54#define BCM2835_CLOCK_AVEO 36
55#define BCM2835_CLOCK_DFT 37
56#define BCM2835_CLOCK_GP0 38
57#define BCM2835_CLOCK_GP1 39
58#define BCM2835_CLOCK_GP2 40
59#define BCM2835_CLOCK_SLIM 41
60#define BCM2835_CLOCK_SMI 42
61#define BCM2835_CLOCK_TEC 43
62#define BCM2835_CLOCK_DPI 44
63#define BCM2835_CLOCK_CAM0 45
64#define BCM2835_CLOCK_CAM1 46
65#define BCM2835_CLOCK_DSI0E 47
66#define BCM2835_CLOCK_DSI1E 48
diff --git a/include/dt-bindings/clock/exynos5420.h b/include/dt-bindings/clock/exynos5420.h
index 7699ee9c16c0..17ab8394bec7 100644
--- a/include/dt-bindings/clock/exynos5420.h
+++ b/include/dt-bindings/clock/exynos5420.h
@@ -217,8 +217,30 @@
217 217
218/* divider clocks */ 218/* divider clocks */
219#define CLK_DOUT_PIXEL 768 219#define CLK_DOUT_PIXEL 768
220#define CLK_DOUT_ACLK400_WCORE 769
221#define CLK_DOUT_ACLK400_ISP 770
222#define CLK_DOUT_ACLK400_MSCL 771
223#define CLK_DOUT_ACLK200 772
224#define CLK_DOUT_ACLK200_FSYS2 773
225#define CLK_DOUT_ACLK100_NOC 774
226#define CLK_DOUT_PCLK200_FSYS 775
227#define CLK_DOUT_ACLK200_FSYS 776
228#define CLK_DOUT_ACLK333_432_GSCL 777
229#define CLK_DOUT_ACLK333_432_ISP 778
230#define CLK_DOUT_ACLK66 779
231#define CLK_DOUT_ACLK333_432_ISP0 780
232#define CLK_DOUT_ACLK266 781
233#define CLK_DOUT_ACLK166 782
234#define CLK_DOUT_ACLK333 783
235#define CLK_DOUT_ACLK333_G2D 784
236#define CLK_DOUT_ACLK266_G2D 785
237#define CLK_DOUT_ACLK_G3D 786
238#define CLK_DOUT_ACLK300_JPEG 787
239#define CLK_DOUT_ACLK300_DISP1 788
240#define CLK_DOUT_ACLK300_GSCL 789
241#define CLK_DOUT_ACLK400_DISP1 790
220 242
221/* must be greater than maximal clock id */ 243/* must be greater than maximal clock id */
222#define CLK_NR_CLKS 769 244#define CLK_NR_CLKS 791
223 245
224#endif /* _DT_BINDINGS_CLOCK_EXYNOS_5420_H */ 246#endif /* _DT_BINDINGS_CLOCK_EXYNOS_5420_H */
diff --git a/include/dt-bindings/clock/hi3519-clock.h b/include/dt-bindings/clock/hi3519-clock.h
new file mode 100644
index 000000000000..14f4d2184e5a
--- /dev/null
+++ b/include/dt-bindings/clock/hi3519-clock.h
@@ -0,0 +1,40 @@
1/*
2 * Copyright (c) 2015 HiSilicon Technologies Co., Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __DTS_HI3519_CLOCK_H
19#define __DTS_HI3519_CLOCK_H
20
21#define HI3519_FMC_CLK 1
22#define HI3519_SPI0_CLK 2
23#define HI3519_SPI1_CLK 3
24#define HI3519_SPI2_CLK 4
25#define HI3519_UART0_CLK 5
26#define HI3519_UART1_CLK 6
27#define HI3519_UART2_CLK 7
28#define HI3519_UART3_CLK 8
29#define HI3519_UART4_CLK 9
30#define HI3519_PWM_CLK 10
31#define HI3519_DMA_CLK 11
32#define HI3519_IR_CLK 12
33#define HI3519_ETH_PHY_CLK 13
34#define HI3519_ETH_MAC_CLK 14
35#define HI3519_ETH_MACIF_CLK 15
36#define HI3519_USB2_BUS_CLK 16
37#define HI3519_USB2_PORT_CLK 17
38#define HI3519_USB3_CLK 18
39
40#endif /* __DTS_HI3519_CLOCK_H */
diff --git a/include/dt-bindings/clock/imx7d-clock.h b/include/dt-bindings/clock/imx7d-clock.h
index edca8985c50e..1183347c383f 100644
--- a/include/dt-bindings/clock/imx7d-clock.h
+++ b/include/dt-bindings/clock/imx7d-clock.h
@@ -448,5 +448,6 @@
448#define IMX7D_PLL_DRAM_TEST_DIV 435 448#define IMX7D_PLL_DRAM_TEST_DIV 435
449#define IMX7D_ADC_ROOT_CLK 436 449#define IMX7D_ADC_ROOT_CLK 436
450#define IMX7D_CLK_ARM 437 450#define IMX7D_CLK_ARM 437
451#define IMX7D_CLK_END 438 451#define IMX7D_CKIL 438
452#define IMX7D_CLK_END 439
452#endif /* __DT_BINDINGS_CLOCK_IMX7D_H */ 453#endif /* __DT_BINDINGS_CLOCK_IMX7D_H */
diff --git a/include/dt-bindings/clock/tegra210-car.h b/include/dt-bindings/clock/tegra210-car.h
index 0a05b0d36ae7..bd3530e56d46 100644
--- a/include/dt-bindings/clock/tegra210-car.h
+++ b/include/dt-bindings/clock/tegra210-car.h
@@ -346,7 +346,7 @@
346#define TEGRA210_CLK_PLL_P_OUT_HSIO 316 346#define TEGRA210_CLK_PLL_P_OUT_HSIO 316
347#define TEGRA210_CLK_PLL_P_OUT_XUSB 317 347#define TEGRA210_CLK_PLL_P_OUT_XUSB 317
348#define TEGRA210_CLK_XUSB_SSP_SRC 318 348#define TEGRA210_CLK_XUSB_SSP_SRC 318
349/* 319 */ 349#define TEGRA210_CLK_PLL_RE_OUT1 319
350/* 320 */ 350/* 320 */
351/* 321 */ 351/* 321 */
352/* 322 */ 352/* 322 */
diff --git a/include/dt-bindings/clock/vf610-clock.h b/include/dt-bindings/clock/vf610-clock.h
index 56c16aaea112..45997750c8a0 100644
--- a/include/dt-bindings/clock/vf610-clock.h
+++ b/include/dt-bindings/clock/vf610-clock.h
@@ -194,7 +194,11 @@
194#define VF610_PLL7_BYPASS 181 194#define VF610_PLL7_BYPASS 181
195#define VF610_CLK_SNVS 182 195#define VF610_CLK_SNVS 182
196#define VF610_CLK_DAP 183 196#define VF610_CLK_DAP 183
197#define VF610_CLK_OCOTP 184 197#define VF610_CLK_OCOTP 184
198#define VF610_CLK_END 185 198#define VF610_CLK_DDRMC 185
199#define VF610_CLK_WKPU 186
200#define VF610_CLK_TCON0 187
201#define VF610_CLK_TCON1 188
202#define VF610_CLK_END 189
199 203
200#endif /* __DT_BINDINGS_CLOCK_VF610_H */ 204#endif /* __DT_BINDINGS_CLOCK_VF610_H */
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index da95258127aa..0c72204c75fc 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -32,6 +32,7 @@
32#define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */ 32#define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */
33#define CLK_RECALC_NEW_RATES BIT(9) /* recalc rates after notifications */ 33#define CLK_RECALC_NEW_RATES BIT(9) /* recalc rates after notifications */
34#define CLK_SET_RATE_UNGATE BIT(10) /* clock needs to run to set rate */ 34#define CLK_SET_RATE_UNGATE BIT(10) /* clock needs to run to set rate */
35#define CLK_IS_CRITICAL BIT(11) /* do not gate, ever */
35 36
36struct clk; 37struct clk;
37struct clk_hw; 38struct clk_hw;
@@ -282,10 +283,17 @@ extern const struct clk_ops clk_fixed_rate_ops;
282struct clk *clk_register_fixed_rate(struct device *dev, const char *name, 283struct clk *clk_register_fixed_rate(struct device *dev, const char *name,
283 const char *parent_name, unsigned long flags, 284 const char *parent_name, unsigned long flags,
284 unsigned long fixed_rate); 285 unsigned long fixed_rate);
286struct clk_hw *clk_hw_register_fixed_rate(struct device *dev, const char *name,
287 const char *parent_name, unsigned long flags,
288 unsigned long fixed_rate);
285struct clk *clk_register_fixed_rate_with_accuracy(struct device *dev, 289struct clk *clk_register_fixed_rate_with_accuracy(struct device *dev,
286 const char *name, const char *parent_name, unsigned long flags, 290 const char *name, const char *parent_name, unsigned long flags,
287 unsigned long fixed_rate, unsigned long fixed_accuracy); 291 unsigned long fixed_rate, unsigned long fixed_accuracy);
288void clk_unregister_fixed_rate(struct clk *clk); 292void clk_unregister_fixed_rate(struct clk *clk);
293struct clk_hw *clk_hw_register_fixed_rate_with_accuracy(struct device *dev,
294 const char *name, const char *parent_name, unsigned long flags,
295 unsigned long fixed_rate, unsigned long fixed_accuracy);
296
289void of_fixed_clk_setup(struct device_node *np); 297void of_fixed_clk_setup(struct device_node *np);
290 298
291/** 299/**
@@ -326,7 +334,12 @@ struct clk *clk_register_gate(struct device *dev, const char *name,
326 const char *parent_name, unsigned long flags, 334 const char *parent_name, unsigned long flags,
327 void __iomem *reg, u8 bit_idx, 335 void __iomem *reg, u8 bit_idx,
328 u8 clk_gate_flags, spinlock_t *lock); 336 u8 clk_gate_flags, spinlock_t *lock);
337struct clk_hw *clk_hw_register_gate(struct device *dev, const char *name,
338 const char *parent_name, unsigned long flags,
339 void __iomem *reg, u8 bit_idx,
340 u8 clk_gate_flags, spinlock_t *lock);
329void clk_unregister_gate(struct clk *clk); 341void clk_unregister_gate(struct clk *clk);
342void clk_hw_unregister_gate(struct clk_hw *hw);
330 343
331struct clk_div_table { 344struct clk_div_table {
332 unsigned int val; 345 unsigned int val;
@@ -407,12 +420,22 @@ struct clk *clk_register_divider(struct device *dev, const char *name,
407 const char *parent_name, unsigned long flags, 420 const char *parent_name, unsigned long flags,
408 void __iomem *reg, u8 shift, u8 width, 421 void __iomem *reg, u8 shift, u8 width,
409 u8 clk_divider_flags, spinlock_t *lock); 422 u8 clk_divider_flags, spinlock_t *lock);
423struct clk_hw *clk_hw_register_divider(struct device *dev, const char *name,
424 const char *parent_name, unsigned long flags,
425 void __iomem *reg, u8 shift, u8 width,
426 u8 clk_divider_flags, spinlock_t *lock);
410struct clk *clk_register_divider_table(struct device *dev, const char *name, 427struct clk *clk_register_divider_table(struct device *dev, const char *name,
411 const char *parent_name, unsigned long flags, 428 const char *parent_name, unsigned long flags,
412 void __iomem *reg, u8 shift, u8 width, 429 void __iomem *reg, u8 shift, u8 width,
413 u8 clk_divider_flags, const struct clk_div_table *table, 430 u8 clk_divider_flags, const struct clk_div_table *table,
414 spinlock_t *lock); 431 spinlock_t *lock);
432struct clk_hw *clk_hw_register_divider_table(struct device *dev,
433 const char *name, const char *parent_name, unsigned long flags,
434 void __iomem *reg, u8 shift, u8 width,
435 u8 clk_divider_flags, const struct clk_div_table *table,
436 spinlock_t *lock);
415void clk_unregister_divider(struct clk *clk); 437void clk_unregister_divider(struct clk *clk);
438void clk_hw_unregister_divider(struct clk_hw *hw);
416 439
417/** 440/**
418 * struct clk_mux - multiplexer clock 441 * struct clk_mux - multiplexer clock
@@ -463,14 +486,25 @@ struct clk *clk_register_mux(struct device *dev, const char *name,
463 unsigned long flags, 486 unsigned long flags,
464 void __iomem *reg, u8 shift, u8 width, 487 void __iomem *reg, u8 shift, u8 width,
465 u8 clk_mux_flags, spinlock_t *lock); 488 u8 clk_mux_flags, spinlock_t *lock);
489struct clk_hw *clk_hw_register_mux(struct device *dev, const char *name,
490 const char * const *parent_names, u8 num_parents,
491 unsigned long flags,
492 void __iomem *reg, u8 shift, u8 width,
493 u8 clk_mux_flags, spinlock_t *lock);
466 494
467struct clk *clk_register_mux_table(struct device *dev, const char *name, 495struct clk *clk_register_mux_table(struct device *dev, const char *name,
468 const char * const *parent_names, u8 num_parents, 496 const char * const *parent_names, u8 num_parents,
469 unsigned long flags, 497 unsigned long flags,
470 void __iomem *reg, u8 shift, u32 mask, 498 void __iomem *reg, u8 shift, u32 mask,
471 u8 clk_mux_flags, u32 *table, spinlock_t *lock); 499 u8 clk_mux_flags, u32 *table, spinlock_t *lock);
500struct clk_hw *clk_hw_register_mux_table(struct device *dev, const char *name,
501 const char * const *parent_names, u8 num_parents,
502 unsigned long flags,
503 void __iomem *reg, u8 shift, u32 mask,
504 u8 clk_mux_flags, u32 *table, spinlock_t *lock);
472 505
473void clk_unregister_mux(struct clk *clk); 506void clk_unregister_mux(struct clk *clk);
507void clk_hw_unregister_mux(struct clk_hw *hw);
474 508
475void of_fixed_factor_clk_setup(struct device_node *node); 509void of_fixed_factor_clk_setup(struct device_node *node);
476 510
@@ -499,6 +533,10 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
499 const char *parent_name, unsigned long flags, 533 const char *parent_name, unsigned long flags,
500 unsigned int mult, unsigned int div); 534 unsigned int mult, unsigned int div);
501void clk_unregister_fixed_factor(struct clk *clk); 535void clk_unregister_fixed_factor(struct clk *clk);
536struct clk_hw *clk_hw_register_fixed_factor(struct device *dev,
537 const char *name, const char *parent_name, unsigned long flags,
538 unsigned int mult, unsigned int div);
539void clk_hw_unregister_fixed_factor(struct clk_hw *hw);
502 540
503/** 541/**
504 * struct clk_fractional_divider - adjustable fractional divider clock 542 * struct clk_fractional_divider - adjustable fractional divider clock
@@ -533,6 +571,11 @@ struct clk *clk_register_fractional_divider(struct device *dev,
533 const char *name, const char *parent_name, unsigned long flags, 571 const char *name, const char *parent_name, unsigned long flags,
534 void __iomem *reg, u8 mshift, u8 mwidth, u8 nshift, u8 nwidth, 572 void __iomem *reg, u8 mshift, u8 mwidth, u8 nshift, u8 nwidth,
535 u8 clk_divider_flags, spinlock_t *lock); 573 u8 clk_divider_flags, spinlock_t *lock);
574struct clk_hw *clk_hw_register_fractional_divider(struct device *dev,
575 const char *name, const char *parent_name, unsigned long flags,
576 void __iomem *reg, u8 mshift, u8 mwidth, u8 nshift, u8 nwidth,
577 u8 clk_divider_flags, spinlock_t *lock);
578void clk_hw_unregister_fractional_divider(struct clk_hw *hw);
536 579
537/** 580/**
538 * struct clk_multiplier - adjustable multiplier clock 581 * struct clk_multiplier - adjustable multiplier clock
@@ -603,6 +646,14 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
603 struct clk_hw *rate_hw, const struct clk_ops *rate_ops, 646 struct clk_hw *rate_hw, const struct clk_ops *rate_ops,
604 struct clk_hw *gate_hw, const struct clk_ops *gate_ops, 647 struct clk_hw *gate_hw, const struct clk_ops *gate_ops,
605 unsigned long flags); 648 unsigned long flags);
649void clk_unregister_composite(struct clk *clk);
650struct clk_hw *clk_hw_register_composite(struct device *dev, const char *name,
651 const char * const *parent_names, int num_parents,
652 struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
653 struct clk_hw *rate_hw, const struct clk_ops *rate_ops,
654 struct clk_hw *gate_hw, const struct clk_ops *gate_ops,
655 unsigned long flags);
656void clk_hw_unregister_composite(struct clk_hw *hw);
606 657
607/*** 658/***
608 * struct clk_gpio_gate - gpio gated clock 659 * struct clk_gpio_gate - gpio gated clock
@@ -625,6 +676,10 @@ extern const struct clk_ops clk_gpio_gate_ops;
625struct clk *clk_register_gpio_gate(struct device *dev, const char *name, 676struct clk *clk_register_gpio_gate(struct device *dev, const char *name,
626 const char *parent_name, unsigned gpio, bool active_low, 677 const char *parent_name, unsigned gpio, bool active_low,
627 unsigned long flags); 678 unsigned long flags);
679struct clk_hw *clk_hw_register_gpio_gate(struct device *dev, const char *name,
680 const char *parent_name, unsigned gpio, bool active_low,
681 unsigned long flags);
682void clk_hw_unregister_gpio_gate(struct clk_hw *hw);
628 683
629/** 684/**
630 * struct clk_gpio_mux - gpio controlled clock multiplexer 685 * struct clk_gpio_mux - gpio controlled clock multiplexer
@@ -640,6 +695,10 @@ extern const struct clk_ops clk_gpio_mux_ops;
640struct clk *clk_register_gpio_mux(struct device *dev, const char *name, 695struct clk *clk_register_gpio_mux(struct device *dev, const char *name,
641 const char * const *parent_names, u8 num_parents, unsigned gpio, 696 const char * const *parent_names, u8 num_parents, unsigned gpio,
642 bool active_low, unsigned long flags); 697 bool active_low, unsigned long flags);
698struct clk_hw *clk_hw_register_gpio_mux(struct device *dev, const char *name,
699 const char * const *parent_names, u8 num_parents, unsigned gpio,
700 bool active_low, unsigned long flags);
701void clk_hw_unregister_gpio_mux(struct clk_hw *hw);
643 702
644/** 703/**
645 * clk_register - allocate a new clock, register it and return an opaque cookie 704 * clk_register - allocate a new clock, register it and return an opaque cookie
@@ -655,9 +714,15 @@ struct clk *clk_register_gpio_mux(struct device *dev, const char *name,
655struct clk *clk_register(struct device *dev, struct clk_hw *hw); 714struct clk *clk_register(struct device *dev, struct clk_hw *hw);
656struct clk *devm_clk_register(struct device *dev, struct clk_hw *hw); 715struct clk *devm_clk_register(struct device *dev, struct clk_hw *hw);
657 716
717int __must_check clk_hw_register(struct device *dev, struct clk_hw *hw);
718int __must_check devm_clk_hw_register(struct device *dev, struct clk_hw *hw);
719
658void clk_unregister(struct clk *clk); 720void clk_unregister(struct clk *clk);
659void devm_clk_unregister(struct device *dev, struct clk *clk); 721void devm_clk_unregister(struct device *dev, struct clk *clk);
660 722
723void clk_hw_unregister(struct clk_hw *hw);
724void devm_clk_hw_unregister(struct device *dev, struct clk_hw *hw);
725
661/* helper functions */ 726/* helper functions */
662const char *__clk_get_name(const struct clk *clk); 727const char *__clk_get_name(const struct clk *clk);
663const char *clk_hw_get_name(const struct clk_hw *hw); 728const char *clk_hw_get_name(const struct clk_hw *hw);
@@ -703,6 +768,11 @@ struct clk_onecell_data {
703 unsigned int clk_num; 768 unsigned int clk_num;
704}; 769};
705 770
771struct clk_hw_onecell_data {
772 size_t num;
773 struct clk_hw *hws[];
774};
775
706extern struct of_device_id __clk_of_table; 776extern struct of_device_id __clk_of_table;
707 777
708#define CLK_OF_DECLARE(name, compat, fn) OF_DECLARE_1(clk, name, compat, fn) 778#define CLK_OF_DECLARE(name, compat, fn) OF_DECLARE_1(clk, name, compat, fn)
@@ -712,15 +782,24 @@ int of_clk_add_provider(struct device_node *np,
712 struct clk *(*clk_src_get)(struct of_phandle_args *args, 782 struct clk *(*clk_src_get)(struct of_phandle_args *args,
713 void *data), 783 void *data),
714 void *data); 784 void *data);
785int of_clk_add_hw_provider(struct device_node *np,
786 struct clk_hw *(*get)(struct of_phandle_args *clkspec,
787 void *data),
788 void *data);
715void of_clk_del_provider(struct device_node *np); 789void of_clk_del_provider(struct device_node *np);
716struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, 790struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
717 void *data); 791 void *data);
792struct clk_hw *of_clk_hw_simple_get(struct of_phandle_args *clkspec,
793 void *data);
718struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); 794struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data);
795struct clk_hw *of_clk_hw_onecell_get(struct of_phandle_args *clkspec,
796 void *data);
719unsigned int of_clk_get_parent_count(struct device_node *np); 797unsigned int of_clk_get_parent_count(struct device_node *np);
720int of_clk_parent_fill(struct device_node *np, const char **parents, 798int of_clk_parent_fill(struct device_node *np, const char **parents,
721 unsigned int size); 799 unsigned int size);
722const char *of_clk_get_parent_name(struct device_node *np, int index); 800const char *of_clk_get_parent_name(struct device_node *np, int index);
723 801int of_clk_detect_critical(struct device_node *np, int index,
802 unsigned long *flags);
724void of_clk_init(const struct of_device_id *matches); 803void of_clk_init(const struct of_device_id *matches);
725 804
726#else /* !CONFIG_OF */ 805#else /* !CONFIG_OF */
@@ -732,17 +811,34 @@ static inline int of_clk_add_provider(struct device_node *np,
732{ 811{
733 return 0; 812 return 0;
734} 813}
814static inline int of_clk_add_hw_provider(struct device_node *np,
815 struct clk_hw *(*get)(struct of_phandle_args *clkspec,
816 void *data),
817 void *data)
818{
819 return 0;
820}
735static inline void of_clk_del_provider(struct device_node *np) {} 821static inline void of_clk_del_provider(struct device_node *np) {}
736static inline struct clk *of_clk_src_simple_get( 822static inline struct clk *of_clk_src_simple_get(
737 struct of_phandle_args *clkspec, void *data) 823 struct of_phandle_args *clkspec, void *data)
738{ 824{
739 return ERR_PTR(-ENOENT); 825 return ERR_PTR(-ENOENT);
740} 826}
827static inline struct clk_hw *
828of_clk_hw_simple_get(struct of_phandle_args *clkspec, void *data)
829{
830 return ERR_PTR(-ENOENT);
831}
741static inline struct clk *of_clk_src_onecell_get( 832static inline struct clk *of_clk_src_onecell_get(
742 struct of_phandle_args *clkspec, void *data) 833 struct of_phandle_args *clkspec, void *data)
743{ 834{
744 return ERR_PTR(-ENOENT); 835 return ERR_PTR(-ENOENT);
745} 836}
837static inline struct clk_hw *
838of_clk_hw_onecell_get(struct of_phandle_args *clkspec, void *data)
839{
840 return ERR_PTR(-ENOENT);
841}
746static inline int of_clk_get_parent_count(struct device_node *np) 842static inline int of_clk_get_parent_count(struct device_node *np)
747{ 843{
748 return 0; 844 return 0;
@@ -757,6 +853,11 @@ static inline const char *of_clk_get_parent_name(struct device_node *np,
757{ 853{
758 return NULL; 854 return NULL;
759} 855}
856static inline int of_clk_detect_critical(struct device_node *np, int index,
857 unsigned long *flags)
858{
859 return 0;
860}
760static inline void of_clk_init(const struct of_device_id *matches) {} 861static inline void of_clk_init(const struct of_device_id *matches) {}
761#endif /* CONFIG_OF */ 862#endif /* CONFIG_OF */
762 863
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
index dc5164a6df29..6110fe09ed18 100644
--- a/include/linux/clk/ti.h
+++ b/include/linux/clk/ti.h
@@ -37,6 +37,7 @@
37 * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate() 37 * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate()
38 * @min_divider: minimum valid non-bypass divider value (actual) 38 * @min_divider: minimum valid non-bypass divider value (actual)
39 * @max_divider: maximum valid non-bypass divider value (actual) 39 * @max_divider: maximum valid non-bypass divider value (actual)
40 * @max_rate: maximum clock rate for the DPLL
40 * @modes: possible values of @enable_mask 41 * @modes: possible values of @enable_mask
41 * @autoidle_reg: register containing the DPLL autoidle mode bitfield 42 * @autoidle_reg: register containing the DPLL autoidle mode bitfield
42 * @idlest_reg: register containing the DPLL idle status bitfield 43 * @idlest_reg: register containing the DPLL idle status bitfield
@@ -81,6 +82,7 @@ struct dpll_data {
81 u8 last_rounded_n; 82 u8 last_rounded_n;
82 u8 min_divider; 83 u8 min_divider;
83 u16 max_divider; 84 u16 max_divider;
85 unsigned long max_rate;
84 u8 modes; 86 u8 modes;
85 void __iomem *autoidle_reg; 87 void __iomem *autoidle_reg;
86 void __iomem *idlest_reg; 88 void __iomem *idlest_reg;
diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h
index c2c04f7cbe8a..2eabc862abdb 100644
--- a/include/linux/clkdev.h
+++ b/include/linux/clkdev.h
@@ -15,6 +15,7 @@
15#include <asm/clkdev.h> 15#include <asm/clkdev.h>
16 16
17struct clk; 17struct clk;
18struct clk_hw;
18struct device; 19struct device;
19 20
20struct clk_lookup { 21struct clk_lookup {
@@ -34,18 +35,22 @@ struct clk_lookup {
34 35
35struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id, 36struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
36 const char *dev_fmt, ...) __printf(3, 4); 37 const char *dev_fmt, ...) __printf(3, 4);
38struct clk_lookup *clkdev_hw_alloc(struct clk_hw *hw, const char *con_id,
39 const char *dev_fmt, ...) __printf(3, 4);
37 40
38void clkdev_add(struct clk_lookup *cl); 41void clkdev_add(struct clk_lookup *cl);
39void clkdev_drop(struct clk_lookup *cl); 42void clkdev_drop(struct clk_lookup *cl);
40 43
41struct clk_lookup *clkdev_create(struct clk *clk, const char *con_id, 44struct clk_lookup *clkdev_create(struct clk *clk, const char *con_id,
42 const char *dev_fmt, ...) __printf(3, 4); 45 const char *dev_fmt, ...) __printf(3, 4);
46struct clk_lookup *clkdev_hw_create(struct clk_hw *hw, const char *con_id,
47 const char *dev_fmt, ...) __printf(3, 4);
43 48
44void clkdev_add_table(struct clk_lookup *, size_t); 49void clkdev_add_table(struct clk_lookup *, size_t);
45int clk_add_alias(const char *, const char *, const char *, struct device *); 50int clk_add_alias(const char *, const char *, const char *, struct device *);
46 51
47int clk_register_clkdev(struct clk *, const char *, const char *); 52int clk_register_clkdev(struct clk *, const char *, const char *);
48int clk_register_clkdevs(struct clk *, struct clk_lookup *, size_t); 53int clk_hw_register_clkdev(struct clk_hw *, const char *, const char *);
49 54
50#ifdef CONFIG_COMMON_CLK 55#ifdef CONFIG_COMMON_CLK
51int __clk_get(struct clk *clk); 56int __clk_get(struct clk *clk);