aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-15 01:05:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-15 01:05:03 -0400
commitc0fa2373f8cfed90437d8d7b17e0b1a84009a10a (patch)
tree43fb2edd0c11874d0b2e56714e53894d10321e19 /include
parentfcc3a5d277571bc6048e7b4ef8cd391b935de629 (diff)
parent98d147f50eb0ce4328e013f5f2c076896003c761 (diff)
Merge tag 'clk-for-linus-3.18' of git://git.linaro.org/people/mike.turquette/linux
Pull clock tree updates from Mike Turquette: "The clk tree changes for 3.18 are dominated by clock drivers. Mostly fixes and enhancements to existing drivers as well as new drivers. This tag contains a bit more arch code than I usually take due to some OMAP2+ changes. Additionally it contains the restart notifier handlers which are merged as a dependency into several trees. The PXA changes are the only messy part. Due to having a stable tree I had to revert one patch and follow up with one more fix near the tip of this tag. Some dead code is introduced but it will soon become live code after 3.18-rc1 is released as the rest of the PXA family is converted over to the common clock framework. Another trend in this tag is that multiple vendors have started to push the complexity of changing their CPU frequency into the clock driver, whereas this used to be done in CPUfreq drivers. Changes to the clk core include a generic gpio-clock type and a clk_set_phase() function added to the top-level clk.h api. Due to some confusion on the fbdev mailing list the kernel boot parameters documentation was updated to further explain the clk_ignore_unused parameter, which is often required by users of the simplefb driver. Finally some fixes to the locking around the clock debugfs stuff was done to prevent deadlocks when interacting with other subsystems." * tag 'clk-for-linus-3.18' of git://git.linaro.org/people/mike.turquette/linux: (99 commits) clk: pxa clocks build system fix Revert "arm: pxa: Transition pxa27x to clk framework" clk: samsung: register restart handlers for s3c2412 and s3c2443 clk: rockchip: add restart handler clk: rockchip: rk3288: i2s_frac adds flag to set parent's rate doc/kernel-parameters.txt: clarify clk_ignore_unused arm: pxa: Transition pxa27x to clk framework dts: add devicetree bindings for pxa27x clocks clk: add pxa27x clock drivers arm: pxa: add clock pll selection bits clk: dts: document pxa clock binding clk: add pxa clocks infrastructure clk: gpio-gate: Ensure gpiod_ APIs are prototyped clk: ti: dra7-atl-clock: Mark the device as pm_runtime_irq_safe clk: ti: LLVMLinux: Move __init outside of type definition clk: ti: consider the fact that of_clk_get() might return an error clk: ti: dra7-atl-clock: fix a memory leak clk: ti: change clock init to use generic of_clk_init clk: hix5hd2: add I2C clocks clk: hix5hd2: add watchdog0 clocks ...
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/clkdev.h2
-rw-r--r--include/dt-bindings/clock/exynos3250.h27
-rw-r--r--include/dt-bindings/clock/exynos4.h12
-rw-r--r--include/dt-bindings/clock/hix5hd2-clock.h27
-rw-r--r--include/dt-bindings/clock/maxim,max77686.h23
-rw-r--r--include/dt-bindings/clock/maxim,max77802.h22
-rw-r--r--include/dt-bindings/clock/pxa-clock.h77
-rw-r--r--include/dt-bindings/clock/rk3188-cru-common.h1
-rw-r--r--include/dt-bindings/clock/rk3288-cru.h82
-rw-r--r--include/dt-bindings/clock/tegra124-car.h6
-rw-r--r--include/linux/clk-private.h2
-rw-r--r--include/linux/clk-provider.h33
-rw-r--r--include/linux/clk.h29
-rw-r--r--include/linux/clk/ti.h1
14 files changed, 337 insertions, 7 deletions
diff --git a/include/asm-generic/clkdev.h b/include/asm-generic/clkdev.h
index 90a32a61dd21..4ff334749ed5 100644
--- a/include/asm-generic/clkdev.h
+++ b/include/asm-generic/clkdev.h
@@ -15,10 +15,12 @@
15 15
16#include <linux/slab.h> 16#include <linux/slab.h>
17 17
18#ifndef CONFIG_COMMON_CLK
18struct clk; 19struct clk;
19 20
20static inline int __clk_get(struct clk *clk) { return 1; } 21static inline int __clk_get(struct clk *clk) { return 1; }
21static inline void __clk_put(struct clk *clk) { } 22static inline void __clk_put(struct clk *clk) { }
23#endif
22 24
23static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size) 25static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
24{ 26{
diff --git a/include/dt-bindings/clock/exynos3250.h b/include/dt-bindings/clock/exynos3250.h
index b535e9da7de6..961b9c130ea9 100644
--- a/include/dt-bindings/clock/exynos3250.h
+++ b/include/dt-bindings/clock/exynos3250.h
@@ -255,4 +255,31 @@
255 */ 255 */
256#define CLK_NR_CLKS 248 256#define CLK_NR_CLKS 248
257 257
258/*
259 * CMU DMC
260 */
261
262#define CLK_FOUT_BPLL 1
263#define CLK_FOUT_EPLL 2
264
265/* Muxes */
266#define CLK_MOUT_MPLL_MIF 8
267#define CLK_MOUT_BPLL 9
268#define CLK_MOUT_DPHY 10
269#define CLK_MOUT_DMC_BUS 11
270#define CLK_MOUT_EPLL 12
271
272/* Dividers */
273#define CLK_DIV_DMC 16
274#define CLK_DIV_DPHY 17
275#define CLK_DIV_DMC_PRE 18
276#define CLK_DIV_DMCP 19
277#define CLK_DIV_DMCD 20
278
279/*
280 * Total number of clocks of main CMU.
281 * NOTE: Must be equal to last clock ID increased by one.
282 */
283#define NR_CLKS_DMC 21
284
258#endif /* _DT_BINDINGS_CLOCK_SAMSUNG_EXYNOS3250_CLOCK_H */ 285#endif /* _DT_BINDINGS_CLOCK_SAMSUNG_EXYNOS3250_CLOCK_H */
diff --git a/include/dt-bindings/clock/exynos4.h b/include/dt-bindings/clock/exynos4.h
index 459bd2bd411f..34fe28c622d0 100644
--- a/include/dt-bindings/clock/exynos4.h
+++ b/include/dt-bindings/clock/exynos4.h
@@ -115,11 +115,11 @@
115#define CLK_SMMU_MFCR 275 115#define CLK_SMMU_MFCR 275
116#define CLK_G3D 276 116#define CLK_G3D 276
117#define CLK_G2D 277 117#define CLK_G2D 277
118#define CLK_ROTATOR 278 /* Exynos4210 only */ 118#define CLK_ROTATOR 278
119#define CLK_MDMA 279 /* Exynos4210 only */ 119#define CLK_MDMA 279
120#define CLK_SMMU_G2D 280 /* Exynos4210 only */ 120#define CLK_SMMU_G2D 280
121#define CLK_SMMU_ROTATOR 281 /* Exynos4210 only */ 121#define CLK_SMMU_ROTATOR 281
122#define CLK_SMMU_MDMA 282 /* Exynos4210 only */ 122#define CLK_SMMU_MDMA 282
123#define CLK_FIMD0 283 123#define CLK_FIMD0 283
124#define CLK_MIE0 284 124#define CLK_MIE0 284
125#define CLK_MDNIE0 285 /* Exynos4412 only */ 125#define CLK_MDNIE0 285 /* Exynos4412 only */
@@ -234,6 +234,8 @@
234#define CLK_MOUT_G3D1 393 234#define CLK_MOUT_G3D1 393
235#define CLK_MOUT_G3D 394 235#define CLK_MOUT_G3D 394
236#define CLK_ACLK400_MCUISP 395 /* Exynos4x12 only */ 236#define CLK_ACLK400_MCUISP 395 /* Exynos4x12 only */
237#define CLK_MOUT_HDMI 396
238#define CLK_MOUT_MIXER 397
237 239
238/* gate clocks - ppmu */ 240/* gate clocks - ppmu */
239#define CLK_PPMULEFT 400 241#define CLK_PPMULEFT 400
diff --git a/include/dt-bindings/clock/hix5hd2-clock.h b/include/dt-bindings/clock/hix5hd2-clock.h
index aad579a75802..fd29c174ba63 100644
--- a/include/dt-bindings/clock/hix5hd2-clock.h
+++ b/include/dt-bindings/clock/hix5hd2-clock.h
@@ -46,6 +46,7 @@
46#define HIX5HD2_SFC_MUX 64 46#define HIX5HD2_SFC_MUX 64
47#define HIX5HD2_MMC_MUX 65 47#define HIX5HD2_MMC_MUX 65
48#define HIX5HD2_FEPHY_MUX 66 48#define HIX5HD2_FEPHY_MUX 66
49#define HIX5HD2_SD_MUX 67
49 50
50/* gate clocks */ 51/* gate clocks */
51#define HIX5HD2_SFC_RST 128 52#define HIX5HD2_SFC_RST 128
@@ -53,6 +54,32 @@
53#define HIX5HD2_MMC_CIU_CLK 130 54#define HIX5HD2_MMC_CIU_CLK 130
54#define HIX5HD2_MMC_BIU_CLK 131 55#define HIX5HD2_MMC_BIU_CLK 131
55#define HIX5HD2_MMC_CIU_RST 132 56#define HIX5HD2_MMC_CIU_RST 132
57#define HIX5HD2_FWD_BUS_CLK 133
58#define HIX5HD2_FWD_SYS_CLK 134
59#define HIX5HD2_MAC0_PHY_CLK 135
60#define HIX5HD2_SD_CIU_CLK 136
61#define HIX5HD2_SD_BIU_CLK 137
62#define HIX5HD2_SD_CIU_RST 138
63#define HIX5HD2_WDG0_CLK 139
64#define HIX5HD2_WDG0_RST 140
65#define HIX5HD2_I2C0_CLK 141
66#define HIX5HD2_I2C0_RST 142
67#define HIX5HD2_I2C1_CLK 143
68#define HIX5HD2_I2C1_RST 144
69#define HIX5HD2_I2C2_CLK 145
70#define HIX5HD2_I2C2_RST 146
71#define HIX5HD2_I2C3_CLK 147
72#define HIX5HD2_I2C3_RST 148
73#define HIX5HD2_I2C4_CLK 149
74#define HIX5HD2_I2C4_RST 150
75#define HIX5HD2_I2C5_CLK 151
76#define HIX5HD2_I2C5_RST 152
77
78/* complex */
79#define HIX5HD2_MAC0_CLK 192
80#define HIX5HD2_MAC1_CLK 193
81#define HIX5HD2_SATA_CLK 194
82#define HIX5HD2_USB_CLK 195
56 83
57#define HIX5HD2_NR_CLKS 256 84#define HIX5HD2_NR_CLKS 256
58#endif /* __DTS_HIX5HD2_CLOCK_H */ 85#endif /* __DTS_HIX5HD2_CLOCK_H */
diff --git a/include/dt-bindings/clock/maxim,max77686.h b/include/dt-bindings/clock/maxim,max77686.h
new file mode 100644
index 000000000000..7b28b0905869
--- /dev/null
+++ b/include/dt-bindings/clock/maxim,max77686.h
@@ -0,0 +1,23 @@
1/*
2 * Copyright (C) 2014 Google, Inc
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 version 2 as
6 * published by the Free Software Foundation.
7 *
8 * Device Tree binding constants clocks for the Maxim 77686 PMIC.
9 */
10
11#ifndef _DT_BINDINGS_CLOCK_MAXIM_MAX77686_CLOCK_H
12#define _DT_BINDINGS_CLOCK_MAXIM_MAX77686_CLOCK_H
13
14/* Fixed rate clocks. */
15
16#define MAX77686_CLK_AP 0
17#define MAX77686_CLK_CP 1
18#define MAX77686_CLK_PMIC 2
19
20/* Total number of clocks. */
21#define MAX77686_CLKS_NUM (MAX77686_CLK_PMIC + 1)
22
23#endif /* _DT_BINDINGS_CLOCK_MAXIM_MAX77686_CLOCK_H */
diff --git a/include/dt-bindings/clock/maxim,max77802.h b/include/dt-bindings/clock/maxim,max77802.h
new file mode 100644
index 000000000000..997312edcbb5
--- /dev/null
+++ b/include/dt-bindings/clock/maxim,max77802.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) 2014 Google, Inc
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 version 2 as
6 * published by the Free Software Foundation.
7 *
8 * Device Tree binding constants clocks for the Maxim 77802 PMIC.
9 */
10
11#ifndef _DT_BINDINGS_CLOCK_MAXIM_MAX77802_CLOCK_H
12#define _DT_BINDINGS_CLOCK_MAXIM_MAX77802_CLOCK_H
13
14/* Fixed rate clocks. */
15
16#define MAX77802_CLK_32K_AP 0
17#define MAX77802_CLK_32K_CP 1
18
19/* Total number of clocks. */
20#define MAX77802_CLKS_NUM (MAX77802_CLK_32K_CP + 1)
21
22#endif /* _DT_BINDINGS_CLOCK_MAXIM_MAX77802_CLOCK_H */
diff --git a/include/dt-bindings/clock/pxa-clock.h b/include/dt-bindings/clock/pxa-clock.h
new file mode 100644
index 000000000000..e65803b1dc7e
--- /dev/null
+++ b/include/dt-bindings/clock/pxa-clock.h
@@ -0,0 +1,77 @@
1/*
2 * Inspired by original work from pxa2xx-regs.h by Nicolas Pitre
3 * Copyright (C) 2014 Robert Jarzmik
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#ifndef __DT_BINDINGS_CLOCK_PXA2XX_H__
12#define __DT_BINDINGS_CLOCK_PXA2XX_H__
13
14#define CLK_NONE 0
15#define CLK_1WIRE 1
16#define CLK_AC97 2
17#define CLK_AC97CONF 3
18#define CLK_ASSP 4
19#define CLK_BOOT 5
20#define CLK_BTUART 6
21#define CLK_CAMERA 7
22#define CLK_CIR 8
23#define CLK_CORE 9
24#define CLK_DMC 10
25#define CLK_FFUART 11
26#define CLK_FICP 12
27#define CLK_GPIO 13
28#define CLK_HSIO2 14
29#define CLK_HWUART 15
30#define CLK_I2C 16
31#define CLK_I2S 17
32#define CLK_IM 18
33#define CLK_INC 19
34#define CLK_ISC 20
35#define CLK_KEYPAD 21
36#define CLK_LCD 22
37#define CLK_MEMC 23
38#define CLK_MEMSTK 24
39#define CLK_MINI_IM 25
40#define CLK_MINI_LCD 26
41#define CLK_MMC 27
42#define CLK_MMC1 28
43#define CLK_MMC2 29
44#define CLK_MMC3 30
45#define CLK_MSL 31
46#define CLK_MSL0 32
47#define CLK_MVED 33
48#define CLK_NAND 34
49#define CLK_NSSP 35
50#define CLK_OSTIMER 36
51#define CLK_PWM0 37
52#define CLK_PWM1 38
53#define CLK_PWM2 39
54#define CLK_PWM3 40
55#define CLK_PWRI2C 41
56#define CLK_PXA300_GCU 42
57#define CLK_PXA320_GCU 43
58#define CLK_SMC 44
59#define CLK_SSP 45
60#define CLK_SSP1 46
61#define CLK_SSP2 47
62#define CLK_SSP3 48
63#define CLK_SSP4 49
64#define CLK_STUART 50
65#define CLK_TOUCH 51
66#define CLK_TPM 52
67#define CLK_UDC 53
68#define CLK_USB 54
69#define CLK_USB2 55
70#define CLK_USBH 56
71#define CLK_USBHOST 57
72#define CLK_USIM 58
73#define CLK_USIM1 59
74#define CLK_USMI0 60
75#define CLK_MAX 61
76
77#endif
diff --git a/include/dt-bindings/clock/rk3188-cru-common.h b/include/dt-bindings/clock/rk3188-cru-common.h
index 750ee60e75fb..6a370503c954 100644
--- a/include/dt-bindings/clock/rk3188-cru-common.h
+++ b/include/dt-bindings/clock/rk3188-cru-common.h
@@ -20,6 +20,7 @@
20#define PLL_GPLL 4 20#define PLL_GPLL 4
21#define CORE_PERI 5 21#define CORE_PERI 5
22#define CORE_L2C 6 22#define CORE_L2C 6
23#define ARMCLK 7
23 24
24/* sclk gates (special clocks) */ 25/* sclk gates (special clocks) */
25#define SCLK_UART0 64 26#define SCLK_UART0 64
diff --git a/include/dt-bindings/clock/rk3288-cru.h b/include/dt-bindings/clock/rk3288-cru.h
index ebcb460ea4ad..100a08c47692 100644
--- a/include/dt-bindings/clock/rk3288-cru.h
+++ b/include/dt-bindings/clock/rk3288-cru.h
@@ -19,6 +19,7 @@
19#define PLL_CPLL 3 19#define PLL_CPLL 3
20#define PLL_GPLL 4 20#define PLL_GPLL 4
21#define PLL_NPLL 5 21#define PLL_NPLL 5
22#define ARMCLK 6
22 23
23/* sclk gates (special clocks) */ 24/* sclk gates (special clocks) */
24#define SCLK_GPU 64 25#define SCLK_GPU 64
@@ -61,6 +62,15 @@
61#define SCLK_LCDC_PWM1 101 62#define SCLK_LCDC_PWM1 101
62#define SCLK_MAC_RX 102 63#define SCLK_MAC_RX 102
63#define SCLK_MAC_TX 103 64#define SCLK_MAC_TX 103
65#define SCLK_EDP_24M 104
66#define SCLK_EDP 105
67#define SCLK_RGA 106
68#define SCLK_ISP 107
69#define SCLK_ISP_JPE 108
70#define SCLK_HDMI_HDCP 109
71#define SCLK_HDMI_CEC 110
72#define SCLK_HEVC_CABAC 111
73#define SCLK_HEVC_CORE 112
64 74
65#define DCLK_VOP0 190 75#define DCLK_VOP0 190
66#define DCLK_VOP1 191 76#define DCLK_VOP1 191
@@ -75,6 +85,16 @@
75#define ACLK_VOP1 198 85#define ACLK_VOP1 198
76#define ACLK_CRYPTO 199 86#define ACLK_CRYPTO 199
77#define ACLK_RGA 200 87#define ACLK_RGA 200
88#define ACLK_RGA_NIU 201
89#define ACLK_IEP 202
90#define ACLK_VIO0_NIU 203
91#define ACLK_VIP 204
92#define ACLK_ISP 205
93#define ACLK_VIO1_NIU 206
94#define ACLK_HEVC 207
95#define ACLK_VCODEC 208
96#define ACLK_CPU 209
97#define ACLK_PERI 210
78 98
79/* pclk gates */ 99/* pclk gates */
80#define PCLK_GPIO0 320 100#define PCLK_GPIO0 320
@@ -112,6 +132,15 @@
112#define PCLK_PS2C 352 132#define PCLK_PS2C 352
113#define PCLK_TIMER 353 133#define PCLK_TIMER 353
114#define PCLK_TZPC 354 134#define PCLK_TZPC 354
135#define PCLK_EDP_CTRL 355
136#define PCLK_MIPI_DSI0 356
137#define PCLK_MIPI_DSI1 357
138#define PCLK_MIPI_CSI 358
139#define PCLK_LVDS_PHY 359
140#define PCLK_HDMI_CTRL 360
141#define PCLK_VIO2_H2P 361
142#define PCLK_CPU 362
143#define PCLK_PERI 363
115 144
116/* hclk gates */ 145/* hclk gates */
117#define HCLK_GPS 448 146#define HCLK_GPS 448
@@ -137,8 +166,16 @@
137#define HCLK_IEP 468 166#define HCLK_IEP 468
138#define HCLK_ISP 469 167#define HCLK_ISP 469
139#define HCLK_RGA 470 168#define HCLK_RGA 470
169#define HCLK_VIO_AHB_ARBI 471
170#define HCLK_VIO_NIU 472
171#define HCLK_VIP 473
172#define HCLK_VIO2_H2P 474
173#define HCLK_HEVC 475
174#define HCLK_VCODEC 476
175#define HCLK_CPU 477
176#define HCLK_PERI 478
140 177
141#define CLK_NR_CLKS (HCLK_RGA + 1) 178#define CLK_NR_CLKS (HCLK_PERI + 1)
142 179
143/* soft-reset indices */ 180/* soft-reset indices */
144#define SRST_CORE0 0 181#define SRST_CORE0 0
@@ -276,3 +313,46 @@
276#define SRST_USBHOST1_CON 140 313#define SRST_USBHOST1_CON 140
277#define SRST_USB_ADP 141 314#define SRST_USB_ADP 141
278#define SRST_ACC_EFUSE 142 315#define SRST_ACC_EFUSE 142
316
317#define SRST_CORESIGHT 144
318#define SRST_PD_CORE_AHB_NOC 145
319#define SRST_PD_CORE_APB_NOC 146
320#define SRST_PD_CORE_MP_AXI 147
321#define SRST_GIC 148
322#define SRST_LCDC_PWM0 149
323#define SRST_LCDC_PWM1 150
324#define SRST_VIO0_H2P_BRG 151
325#define SRST_VIO1_H2P_BRG 152
326#define SRST_RGA_H2P_BRG 153
327#define SRST_HEVC 154
328#define SRST_TSADC 159
329
330#define SRST_DDRPHY0 160
331#define SRST_DDRPHY0_APB 161
332#define SRST_DDRCTRL0 162
333#define SRST_DDRCTRL0_APB 163
334#define SRST_DDRPHY0_CTRL 164
335#define SRST_DDRPHY1 165
336#define SRST_DDRPHY1_APB 166
337#define SRST_DDRCTRL1 167
338#define SRST_DDRCTRL1_APB 168
339#define SRST_DDRPHY1_CTRL 169
340#define SRST_DDRMSCH0 170
341#define SRST_DDRMSCH1 171
342#define SRST_CRYPTO 174
343#define SRST_C2C_HOST 175
344
345#define SRST_LCDC1_AXI 176
346#define SRST_LCDC1_AHB 177
347#define SRST_LCDC1_DCLK 178
348#define SRST_UART0 179
349#define SRST_UART1 180
350#define SRST_UART2 181
351#define SRST_UART3 182
352#define SRST_UART4 183
353#define SRST_SIMC 186
354#define SRST_PS2C 187
355#define SRST_TSP 188
356#define SRST_TSP_CLKIN0 189
357#define SRST_TSP_CLKIN1 190
358#define SRST_TSP_27M 191
diff --git a/include/dt-bindings/clock/tegra124-car.h b/include/dt-bindings/clock/tegra124-car.h
index 8a4c5892890f..6bac637fd635 100644
--- a/include/dt-bindings/clock/tegra124-car.h
+++ b/include/dt-bindings/clock/tegra124-car.h
@@ -337,6 +337,10 @@
337#define TEGRA124_CLK_DSIB_MUX 310 337#define TEGRA124_CLK_DSIB_MUX 310
338#define TEGRA124_CLK_SOR0_LVDS 311 338#define TEGRA124_CLK_SOR0_LVDS 311
339#define TEGRA124_CLK_XUSB_SS_DIV2 312 339#define TEGRA124_CLK_XUSB_SS_DIV2 312
340#define TEGRA124_CLK_CLK_MAX 313 340
341#define TEGRA124_CLK_PLL_M_UD 313
342#define TEGRA124_CLK_PLL_C_UD 314
343
344#define TEGRA124_CLK_CLK_MAX 315
341 345
342#endif /* _DT_BINDINGS_CLOCK_TEGRA124_CAR_H */ 346#endif /* _DT_BINDINGS_CLOCK_TEGRA124_CAR_H */
diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h
index efbf70b9fd84..0ca5f6046920 100644
--- a/include/linux/clk-private.h
+++ b/include/linux/clk-private.h
@@ -46,8 +46,10 @@ struct clk {
46 unsigned int enable_count; 46 unsigned int enable_count;
47 unsigned int prepare_count; 47 unsigned int prepare_count;
48 unsigned long accuracy; 48 unsigned long accuracy;
49 int phase;
49 struct hlist_head children; 50 struct hlist_head children;
50 struct hlist_node child_node; 51 struct hlist_node child_node;
52 struct hlist_node debug_node;
51 unsigned int notifier_count; 53 unsigned int notifier_count;
52#ifdef CONFIG_DEBUG_FS 54#ifdef CONFIG_DEBUG_FS
53 struct dentry *dentry; 55 struct dentry *dentry;
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 411dd7eb2653..be21af149f11 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -13,6 +13,7 @@
13 13
14#include <linux/clk.h> 14#include <linux/clk.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/of.h>
16 17
17#ifdef CONFIG_COMMON_CLK 18#ifdef CONFIG_COMMON_CLK
18 19
@@ -129,6 +130,14 @@ struct dentry;
129 * set then clock accuracy will be initialized to parent accuracy 130 * set then clock accuracy will be initialized to parent accuracy
130 * or 0 (perfect clock) if clock has no parent. 131 * or 0 (perfect clock) if clock has no parent.
131 * 132 *
133 * @get_phase: Queries the hardware to get the current phase of a clock.
134 * Returned values are 0-359 degrees on success, negative
135 * error codes on failure.
136 *
137 * @set_phase: Shift the phase this clock signal in degrees specified
138 * by the second argument. Valid values for degrees are
139 * 0-359. Return 0 on success, otherwise -EERROR.
140 *
132 * @init: Perform platform-specific initialization magic. 141 * @init: Perform platform-specific initialization magic.
133 * This is not not used by any of the basic clock types. 142 * This is not not used by any of the basic clock types.
134 * Please consider other ways of solving initialization problems 143 * Please consider other ways of solving initialization problems
@@ -177,6 +186,8 @@ struct clk_ops {
177 unsigned long parent_rate, u8 index); 186 unsigned long parent_rate, u8 index);
178 unsigned long (*recalc_accuracy)(struct clk_hw *hw, 187 unsigned long (*recalc_accuracy)(struct clk_hw *hw,
179 unsigned long parent_accuracy); 188 unsigned long parent_accuracy);
189 int (*get_phase)(struct clk_hw *hw);
190 int (*set_phase)(struct clk_hw *hw, int degrees);
180 void (*init)(struct clk_hw *hw); 191 void (*init)(struct clk_hw *hw);
181 int (*debug_init)(struct clk_hw *hw, struct dentry *dentry); 192 int (*debug_init)(struct clk_hw *hw, struct dentry *dentry);
182}; 193};
@@ -488,6 +499,28 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
488 struct clk_hw *gate_hw, const struct clk_ops *gate_ops, 499 struct clk_hw *gate_hw, const struct clk_ops *gate_ops,
489 unsigned long flags); 500 unsigned long flags);
490 501
502/***
503 * struct clk_gpio_gate - gpio gated clock
504 *
505 * @hw: handle between common and hardware-specific interfaces
506 * @gpiod: gpio descriptor
507 *
508 * Clock with a gpio control for enabling and disabling the parent clock.
509 * Implements .enable, .disable and .is_enabled
510 */
511
512struct clk_gpio {
513 struct clk_hw hw;
514 struct gpio_desc *gpiod;
515};
516
517extern const struct clk_ops clk_gpio_gate_ops;
518struct clk *clk_register_gpio_gate(struct device *dev, const char *name,
519 const char *parent_name, struct gpio_desc *gpio,
520 unsigned long flags);
521
522void of_gpio_clk_gate_setup(struct device_node *node);
523
491/** 524/**
492 * clk_register - allocate a new clock, register it and return an opaque cookie 525 * clk_register - allocate a new clock, register it and return an opaque cookie
493 * @dev: device that is registering this clock 526 * @dev: device that is registering this clock
diff --git a/include/linux/clk.h b/include/linux/clk.h
index afb44bfaf8d1..c7f258a81761 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -106,6 +106,25 @@ int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb);
106 */ 106 */
107long clk_get_accuracy(struct clk *clk); 107long clk_get_accuracy(struct clk *clk);
108 108
109/**
110 * clk_set_phase - adjust the phase shift of a clock signal
111 * @clk: clock signal source
112 * @degrees: number of degrees the signal is shifted
113 *
114 * Shifts the phase of a clock signal by the specified degrees. Returns 0 on
115 * success, -EERROR otherwise.
116 */
117int clk_set_phase(struct clk *clk, int degrees);
118
119/**
120 * clk_get_phase - return the phase shift of a clock signal
121 * @clk: clock signal source
122 *
123 * Returns the phase shift of a clock node in degrees, otherwise returns
124 * -EERROR.
125 */
126int clk_get_phase(struct clk *clk);
127
109#else 128#else
110 129
111static inline long clk_get_accuracy(struct clk *clk) 130static inline long clk_get_accuracy(struct clk *clk)
@@ -113,6 +132,16 @@ static inline long clk_get_accuracy(struct clk *clk)
113 return -ENOTSUPP; 132 return -ENOTSUPP;
114} 133}
115 134
135static inline long clk_set_phase(struct clk *clk, int phase)
136{
137 return -ENOTSUPP;
138}
139
140static inline long clk_get_phase(struct clk *clk)
141{
142 return -ENOTSUPP;
143}
144
116#endif 145#endif
117 146
118/** 147/**
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
index e8d8a35034a5..f75acbf70e96 100644
--- a/include/linux/clk/ti.h
+++ b/include/linux/clk/ti.h
@@ -292,6 +292,7 @@ void omap2xxx_clkt_vps_init(void);
292void __iomem *ti_clk_get_reg_addr(struct device_node *node, int index); 292void __iomem *ti_clk_get_reg_addr(struct device_node *node, int index);
293void ti_dt_clocks_register(struct ti_dt_clk *oclks); 293void ti_dt_clocks_register(struct ti_dt_clk *oclks);
294void ti_dt_clk_init_provider(struct device_node *np, int index); 294void ti_dt_clk_init_provider(struct device_node *np, int index);
295void ti_dt_clk_init_retry_clks(void);
295void ti_dt_clockdomains_setup(void); 296void ti_dt_clockdomains_setup(void);
296int ti_clk_retry_init(struct device_node *node, struct clk_hw *hw, 297int ti_clk_retry_init(struct device_node *node, struct clk_hw *hw,
297 ti_of_clk_init_cb_t func); 298 ti_of_clk_init_cb_t func);