aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/dt-bindings/clock/bcm21664.h62
-rw-r--r--include/dt-bindings/clock/bcm281xx.h12
-rw-r--r--include/dt-bindings/clock/hix5hd2-clock.h58
-rw-r--r--include/dt-bindings/clock/qcom,gcc-msm8960.h7
-rw-r--r--include/dt-bindings/clock/qcom,gcc-msm8974.h4
-rw-r--r--include/dt-bindings/clock/r8a7779-clock.h64
-rw-r--r--include/dt-bindings/clock/tegra114-car.h3
-rw-r--r--include/dt-bindings/clock/tegra124-car.h3
-rw-r--r--include/dt-bindings/reset/qcom,gcc-msm8960.h2
-rw-r--r--include/linux/clk-provider.h127
-rw-r--r--include/linux/clk/shmobile.h3
-rw-r--r--include/linux/clk/sunxi.h22
12 files changed, 303 insertions, 64 deletions
diff --git a/include/dt-bindings/clock/bcm21664.h b/include/dt-bindings/clock/bcm21664.h
new file mode 100644
index 000000000000..5a7f0e4750a8
--- /dev/null
+++ b/include/dt-bindings/clock/bcm21664.h
@@ -0,0 +1,62 @@
1/*
2 * Copyright (C) 2013 Broadcom Corporation
3 * Copyright 2013 Linaro Limited
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation version 2.
8 *
9 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
10 * kind, whether express or implied; without even the implied warranty
11 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#ifndef _CLOCK_BCM21664_H
16#define _CLOCK_BCM21664_H
17
18/*
19 * This file defines the values used to specify clocks provided by
20 * the clock control units (CCUs) on Broadcom BCM21664 family SoCs.
21 */
22
23/* bcm21664 CCU device tree "compatible" strings */
24#define BCM21664_DT_ROOT_CCU_COMPAT "brcm,bcm21664-root-ccu"
25#define BCM21664_DT_AON_CCU_COMPAT "brcm,bcm21664-aon-ccu"
26#define BCM21664_DT_MASTER_CCU_COMPAT "brcm,bcm21664-master-ccu"
27#define BCM21664_DT_SLAVE_CCU_COMPAT "brcm,bcm21664-slave-ccu"
28
29/* root CCU clock ids */
30
31#define BCM21664_ROOT_CCU_FRAC_1M 0
32#define BCM21664_ROOT_CCU_CLOCK_COUNT 1
33
34/* aon CCU clock ids */
35
36#define BCM21664_AON_CCU_HUB_TIMER 0
37#define BCM21664_AON_CCU_CLOCK_COUNT 1
38
39/* master CCU clock ids */
40
41#define BCM21664_MASTER_CCU_SDIO1 0
42#define BCM21664_MASTER_CCU_SDIO2 1
43#define BCM21664_MASTER_CCU_SDIO3 2
44#define BCM21664_MASTER_CCU_SDIO4 3
45#define BCM21664_MASTER_CCU_SDIO1_SLEEP 4
46#define BCM21664_MASTER_CCU_SDIO2_SLEEP 5
47#define BCM21664_MASTER_CCU_SDIO3_SLEEP 6
48#define BCM21664_MASTER_CCU_SDIO4_SLEEP 7
49#define BCM21664_MASTER_CCU_CLOCK_COUNT 8
50
51/* slave CCU clock ids */
52
53#define BCM21664_SLAVE_CCU_UARTB 0
54#define BCM21664_SLAVE_CCU_UARTB2 1
55#define BCM21664_SLAVE_CCU_UARTB3 2
56#define BCM21664_SLAVE_CCU_BSC1 3
57#define BCM21664_SLAVE_CCU_BSC2 4
58#define BCM21664_SLAVE_CCU_BSC3 5
59#define BCM21664_SLAVE_CCU_BSC4 6
60#define BCM21664_SLAVE_CCU_CLOCK_COUNT 7
61
62#endif /* _CLOCK_BCM21664_H */
diff --git a/include/dt-bindings/clock/bcm281xx.h b/include/dt-bindings/clock/bcm281xx.h
index e0096940886d..a763460cf1af 100644
--- a/include/dt-bindings/clock/bcm281xx.h
+++ b/include/dt-bindings/clock/bcm281xx.h
@@ -20,6 +20,18 @@
20 * the clock control units (CCUs) on Broadcom BCM281XX family SoCs. 20 * the clock control units (CCUs) on Broadcom BCM281XX family SoCs.
21 */ 21 */
22 22
23/*
24 * These are the bcm281xx CCU device tree "compatible" strings.
25 * We're stuck with using "bcm11351" in the string because wild
26 * cards aren't allowed, and that name was the first one defined
27 * in this family of devices.
28 */
29#define BCM281XX_DT_ROOT_CCU_COMPAT "brcm,bcm11351-root-ccu"
30#define BCM281XX_DT_AON_CCU_COMPAT "brcm,bcm11351-aon-ccu"
31#define BCM281XX_DT_HUB_CCU_COMPAT "brcm,bcm11351-hub-ccu"
32#define BCM281XX_DT_MASTER_CCU_COMPAT "brcm,bcm11351-master-ccu"
33#define BCM281XX_DT_SLAVE_CCU_COMPAT "brcm,bcm11351-slave-ccu"
34
23/* root CCU clock ids */ 35/* root CCU clock ids */
24 36
25#define BCM281XX_ROOT_CCU_FRAC_1M 0 37#define BCM281XX_ROOT_CCU_FRAC_1M 0
diff --git a/include/dt-bindings/clock/hix5hd2-clock.h b/include/dt-bindings/clock/hix5hd2-clock.h
new file mode 100644
index 000000000000..aad579a75802
--- /dev/null
+++ b/include/dt-bindings/clock/hix5hd2-clock.h
@@ -0,0 +1,58 @@
1/*
2 * Copyright (c) 2014 Linaro Ltd.
3 * Copyright (c) 2014 Hisilicon Limited.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 */
9
10#ifndef __DTS_HIX5HD2_CLOCK_H
11#define __DTS_HIX5HD2_CLOCK_H
12
13/* fixed rate */
14#define HIX5HD2_FIXED_1200M 1
15#define HIX5HD2_FIXED_400M 2
16#define HIX5HD2_FIXED_48M 3
17#define HIX5HD2_FIXED_24M 4
18#define HIX5HD2_FIXED_600M 5
19#define HIX5HD2_FIXED_300M 6
20#define HIX5HD2_FIXED_75M 7
21#define HIX5HD2_FIXED_200M 8
22#define HIX5HD2_FIXED_100M 9
23#define HIX5HD2_FIXED_40M 10
24#define HIX5HD2_FIXED_150M 11
25#define HIX5HD2_FIXED_1728M 12
26#define HIX5HD2_FIXED_28P8M 13
27#define HIX5HD2_FIXED_432M 14
28#define HIX5HD2_FIXED_345P6M 15
29#define HIX5HD2_FIXED_288M 16
30#define HIX5HD2_FIXED_60M 17
31#define HIX5HD2_FIXED_750M 18
32#define HIX5HD2_FIXED_500M 19
33#define HIX5HD2_FIXED_54M 20
34#define HIX5HD2_FIXED_27M 21
35#define HIX5HD2_FIXED_1500M 22
36#define HIX5HD2_FIXED_375M 23
37#define HIX5HD2_FIXED_187M 24
38#define HIX5HD2_FIXED_250M 25
39#define HIX5HD2_FIXED_125M 26
40#define HIX5HD2_FIXED_2P02M 27
41#define HIX5HD2_FIXED_50M 28
42#define HIX5HD2_FIXED_25M 29
43#define HIX5HD2_FIXED_83M 30
44
45/* mux clocks */
46#define HIX5HD2_SFC_MUX 64
47#define HIX5HD2_MMC_MUX 65
48#define HIX5HD2_FEPHY_MUX 66
49
50/* gate clocks */
51#define HIX5HD2_SFC_RST 128
52#define HIX5HD2_SFC_CLK 129
53#define HIX5HD2_MMC_CIU_CLK 130
54#define HIX5HD2_MMC_BIU_CLK 131
55#define HIX5HD2_MMC_CIU_RST 132
56
57#define HIX5HD2_NR_CLKS 256
58#endif /* __DTS_HIX5HD2_CLOCK_H */
diff --git a/include/dt-bindings/clock/qcom,gcc-msm8960.h b/include/dt-bindings/clock/qcom,gcc-msm8960.h
index 03bbf49d43b7..f9f547146a15 100644
--- a/include/dt-bindings/clock/qcom,gcc-msm8960.h
+++ b/include/dt-bindings/clock/qcom,gcc-msm8960.h
@@ -51,7 +51,7 @@
51#define QDSS_TSCTR_CLK 34 51#define QDSS_TSCTR_CLK 34
52#define SFAB_ADM0_M0_A_CLK 35 52#define SFAB_ADM0_M0_A_CLK 35
53#define SFAB_ADM0_M1_A_CLK 36 53#define SFAB_ADM0_M1_A_CLK 36
54#define SFAB_ADM0_M2_A_CLK 37 54#define SFAB_ADM0_M2_H_CLK 37
55#define ADM0_CLK 38 55#define ADM0_CLK 38
56#define ADM0_PBUS_CLK 39 56#define ADM0_PBUS_CLK 39
57#define MSS_XPU_CLK 40 57#define MSS_XPU_CLK 40
@@ -99,7 +99,7 @@
99#define CFPB2_H_CLK 82 99#define CFPB2_H_CLK 82
100#define SFAB_CFPB_M_H_CLK 83 100#define SFAB_CFPB_M_H_CLK 83
101#define CFPB_MASTER_H_CLK 84 101#define CFPB_MASTER_H_CLK 84
102#define SFAB_CFPB_S_HCLK 85 102#define SFAB_CFPB_S_H_CLK 85
103#define CFPB_SPLITTER_H_CLK 86 103#define CFPB_SPLITTER_H_CLK 86
104#define TSIF_H_CLK 87 104#define TSIF_H_CLK 87
105#define TSIF_INACTIVITY_TIMERS_CLK 88 105#define TSIF_INACTIVITY_TIMERS_CLK 88
@@ -110,7 +110,6 @@
110#define CE1_SLEEP_CLK 93 110#define CE1_SLEEP_CLK 93
111#define CE2_H_CLK 94 111#define CE2_H_CLK 94
112#define CE2_CORE_CLK 95 112#define CE2_CORE_CLK 95
113#define CE2_SLEEP_CLK 96
114#define SFPB_H_CLK_SRC 97 113#define SFPB_H_CLK_SRC 97
115#define SFPB_H_CLK 98 114#define SFPB_H_CLK 98
116#define SFAB_SFPB_M_H_CLK 99 115#define SFAB_SFPB_M_H_CLK 99
@@ -252,7 +251,7 @@
252#define MSS_S_H_CLK 235 251#define MSS_S_H_CLK 235
253#define MSS_CXO_SRC_CLK 236 252#define MSS_CXO_SRC_CLK 236
254#define SATA_H_CLK 237 253#define SATA_H_CLK 237
255#define SATA_SRC_CLK 238 254#define SATA_CLK_SRC 238
256#define SATA_RXOOB_CLK 239 255#define SATA_RXOOB_CLK 239
257#define SATA_PMALIVE_CLK 240 256#define SATA_PMALIVE_CLK 240
258#define SATA_PHY_REF_CLK 241 257#define SATA_PHY_REF_CLK 241
diff --git a/include/dt-bindings/clock/qcom,gcc-msm8974.h b/include/dt-bindings/clock/qcom,gcc-msm8974.h
index 223ca174d9d3..51e51c860fe6 100644
--- a/include/dt-bindings/clock/qcom,gcc-msm8974.h
+++ b/include/dt-bindings/clock/qcom,gcc-msm8974.h
@@ -316,5 +316,9 @@
316#define GCC_CE2_CLK_SLEEP_ENA 299 316#define GCC_CE2_CLK_SLEEP_ENA 299
317#define GCC_CE2_AXI_CLK_SLEEP_ENA 300 317#define GCC_CE2_AXI_CLK_SLEEP_ENA 300
318#define GCC_CE2_AHB_CLK_SLEEP_ENA 301 318#define GCC_CE2_AHB_CLK_SLEEP_ENA 301
319#define GPLL4 302
320#define GPLL4_VOTE 303
321#define GCC_SDCC1_CDCCAL_SLEEP_CLK 304
322#define GCC_SDCC1_CDCCAL_FF_CLK 305
319 323
320#endif 324#endif
diff --git a/include/dt-bindings/clock/r8a7779-clock.h b/include/dt-bindings/clock/r8a7779-clock.h
new file mode 100644
index 000000000000..381a6114237a
--- /dev/null
+++ b/include/dt-bindings/clock/r8a7779-clock.h
@@ -0,0 +1,64 @@
1/*
2 * Copyright (C) 2013 Horms Solutions Ltd.
3 *
4 * Contact: Simon Horman <horms@verge.net.au>
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef __DT_BINDINGS_CLOCK_R8A7779_H__
13#define __DT_BINDINGS_CLOCK_R8A7779_H__
14
15/* CPG */
16#define R8A7779_CLK_PLLA 0
17#define R8A7779_CLK_Z 1
18#define R8A7779_CLK_ZS 2
19#define R8A7779_CLK_S 3
20#define R8A7779_CLK_S1 4
21#define R8A7779_CLK_P 5
22#define R8A7779_CLK_B 6
23#define R8A7779_CLK_OUT 7
24
25/* MSTP 0 */
26#define R8A7779_CLK_HSPI 7
27#define R8A7779_CLK_TMU2 14
28#define R8A7779_CLK_TMU1 15
29#define R8A7779_CLK_TMU0 16
30#define R8A7779_CLK_HSCIF1 18
31#define R8A7779_CLK_HSCIF0 19
32#define R8A7779_CLK_SCIF5 21
33#define R8A7779_CLK_SCIF4 22
34#define R8A7779_CLK_SCIF3 23
35#define R8A7779_CLK_SCIF2 24
36#define R8A7779_CLK_SCIF1 25
37#define R8A7779_CLK_SCIF0 26
38#define R8A7779_CLK_I2C3 27
39#define R8A7779_CLK_I2C2 28
40#define R8A7779_CLK_I2C1 29
41#define R8A7779_CLK_I2C0 30
42
43/* MSTP 1 */
44#define R8A7779_CLK_USB01 0
45#define R8A7779_CLK_USB2 1
46#define R8A7779_CLK_DU 3
47#define R8A7779_CLK_VIN2 8
48#define R8A7779_CLK_VIN1 9
49#define R8A7779_CLK_VIN0 10
50#define R8A7779_CLK_ETHER 14
51#define R8A7779_CLK_SATA 15
52#define R8A7779_CLK_PCIE 16
53#define R8A7779_CLK_VIN3 20
54
55/* MSTP 3 */
56#define R8A7779_CLK_SDHI3 20
57#define R8A7779_CLK_SDHI2 21
58#define R8A7779_CLK_SDHI1 22
59#define R8A7779_CLK_SDHI0 23
60#define R8A7779_CLK_MMC1 30
61#define R8A7779_CLK_MMC0 31
62
63
64#endif /* __DT_BINDINGS_CLOCK_R8A7779_H__ */
diff --git a/include/dt-bindings/clock/tegra114-car.h b/include/dt-bindings/clock/tegra114-car.h
index 6d0d8d8ef31e..fc12621fb432 100644
--- a/include/dt-bindings/clock/tegra114-car.h
+++ b/include/dt-bindings/clock/tegra114-car.h
@@ -337,6 +337,7 @@
337#define TEGRA114_CLK_CLK_OUT_3_MUX 308 337#define TEGRA114_CLK_CLK_OUT_3_MUX 308
338#define TEGRA114_CLK_DSIA_MUX 309 338#define TEGRA114_CLK_DSIA_MUX 309
339#define TEGRA114_CLK_DSIB_MUX 310 339#define TEGRA114_CLK_DSIB_MUX 310
340#define TEGRA114_CLK_CLK_MAX 311 340#define TEGRA114_CLK_XUSB_SS_DIV2 311
341#define TEGRA114_CLK_CLK_MAX 312
341 342
342#endif /* _DT_BINDINGS_CLOCK_TEGRA114_CAR_H */ 343#endif /* _DT_BINDINGS_CLOCK_TEGRA114_CAR_H */
diff --git a/include/dt-bindings/clock/tegra124-car.h b/include/dt-bindings/clock/tegra124-car.h
index 433528ab5161..8a4c5892890f 100644
--- a/include/dt-bindings/clock/tegra124-car.h
+++ b/include/dt-bindings/clock/tegra124-car.h
@@ -336,6 +336,7 @@
336#define TEGRA124_CLK_DSIA_MUX 309 336#define TEGRA124_CLK_DSIA_MUX 309
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_CLK_MAX 312 339#define TEGRA124_CLK_XUSB_SS_DIV2 312
340#define TEGRA124_CLK_CLK_MAX 313
340 341
341#endif /* _DT_BINDINGS_CLOCK_TEGRA124_CAR_H */ 342#endif /* _DT_BINDINGS_CLOCK_TEGRA124_CAR_H */
diff --git a/include/dt-bindings/reset/qcom,gcc-msm8960.h b/include/dt-bindings/reset/qcom,gcc-msm8960.h
index a840e680323c..07edd0e65eed 100644
--- a/include/dt-bindings/reset/qcom,gcc-msm8960.h
+++ b/include/dt-bindings/reset/qcom,gcc-msm8960.h
@@ -58,7 +58,7 @@
58#define PPSS_PROC_RESET 41 58#define PPSS_PROC_RESET 41
59#define PPSS_RESET 42 59#define PPSS_RESET 42
60#define DMA_BAM_RESET 43 60#define DMA_BAM_RESET 43
61#define SIC_TIC_RESET 44 61#define SPS_TIC_H_RESET 44
62#define SLIMBUS_H_RESET 45 62#define SLIMBUS_H_RESET 45
63#define SFAB_CFPB_M_RESET 46 63#define SFAB_CFPB_M_RESET 46
64#define SFAB_CFPB_S_RESET 47 64#define SFAB_CFPB_S_RESET 47
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index f295bab1865d..0c287dbbb144 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -40,14 +40,14 @@ struct dentry;
40 * through the clk_* api. 40 * through the clk_* api.
41 * 41 *
42 * @prepare: Prepare the clock for enabling. This must not return until 42 * @prepare: Prepare the clock for enabling. This must not return until
43 * the clock is fully prepared, and it's safe to call clk_enable. 43 * the clock is fully prepared, and it's safe to call clk_enable.
44 * This callback is intended to allow clock implementations to 44 * This callback is intended to allow clock implementations to
45 * do any initialisation that may sleep. Called with 45 * do any initialisation that may sleep. Called with
46 * prepare_lock held. 46 * prepare_lock held.
47 * 47 *
48 * @unprepare: Release the clock from its prepared state. This will typically 48 * @unprepare: Release the clock from its prepared state. This will typically
49 * undo any work done in the @prepare callback. Called with 49 * undo any work done in the @prepare callback. Called with
50 * prepare_lock held. 50 * prepare_lock held.
51 * 51 *
52 * @is_prepared: Queries the hardware to determine if the clock is prepared. 52 * @is_prepared: Queries the hardware to determine if the clock is prepared.
53 * This function is allowed to sleep. Optional, if this op is not 53 * This function is allowed to sleep. Optional, if this op is not
@@ -58,16 +58,16 @@ struct dentry;
58 * Called with prepare mutex held. This function may sleep. 58 * Called with prepare mutex held. This function may sleep.
59 * 59 *
60 * @enable: Enable the clock atomically. This must not return until the 60 * @enable: Enable the clock atomically. This must not return until the
61 * clock is generating a valid clock signal, usable by consumer 61 * clock is generating a valid clock signal, usable by consumer
62 * devices. Called with enable_lock held. This function must not 62 * devices. Called with enable_lock held. This function must not
63 * sleep. 63 * sleep.
64 * 64 *
65 * @disable: Disable the clock atomically. Called with enable_lock held. 65 * @disable: Disable the clock atomically. Called with enable_lock held.
66 * This function must not sleep. 66 * This function must not sleep.
67 * 67 *
68 * @is_enabled: Queries the hardware to determine if the clock is enabled. 68 * @is_enabled: Queries the hardware to determine if the clock is enabled.
69 * This function must not sleep. Optional, if this op is not 69 * This function must not sleep. Optional, if this op is not
70 * set then the enable count will be used. 70 * set then the enable count will be used.
71 * 71 *
72 * @disable_unused: Disable the clock atomically. Only called from 72 * @disable_unused: Disable the clock atomically. Only called from
73 * clk_disable_unused for gate clocks with special needs. 73 * clk_disable_unused for gate clocks with special needs.
@@ -75,34 +75,35 @@ struct dentry;
75 * sleep. 75 * sleep.
76 * 76 *
77 * @recalc_rate Recalculate the rate of this clock, by querying hardware. The 77 * @recalc_rate Recalculate the rate of this clock, by querying hardware. The
78 * parent rate is an input parameter. It is up to the caller to 78 * parent rate is an input parameter. It is up to the caller to
79 * ensure that the prepare_mutex is held across this call. 79 * ensure that the prepare_mutex is held across this call.
80 * Returns the calculated rate. Optional, but recommended - if 80 * Returns the calculated rate. Optional, but recommended - if
81 * this op is not set then clock rate will be initialized to 0. 81 * this op is not set then clock rate will be initialized to 0.
82 * 82 *
83 * @round_rate: Given a target rate as input, returns the closest rate actually 83 * @round_rate: Given a target rate as input, returns the closest rate actually
84 * supported by the clock. 84 * supported by the clock. The parent rate is an input/output
85 * parameter.
85 * 86 *
86 * @determine_rate: Given a target rate as input, returns the closest rate 87 * @determine_rate: Given a target rate as input, returns the closest rate
87 * actually supported by the clock, and optionally the parent clock 88 * actually supported by the clock, and optionally the parent clock
88 * that should be used to provide the clock rate. 89 * that should be used to provide the clock rate.
89 * 90 *
90 * @get_parent: Queries the hardware to determine the parent of a clock. The
91 * return value is a u8 which specifies the index corresponding to
92 * the parent clock. This index can be applied to either the
93 * .parent_names or .parents arrays. In short, this function
94 * translates the parent value read from hardware into an array
95 * index. Currently only called when the clock is initialized by
96 * __clk_init. This callback is mandatory for clocks with
97 * multiple parents. It is optional (and unnecessary) for clocks
98 * with 0 or 1 parents.
99 *
100 * @set_parent: Change the input source of this clock; for clocks with multiple 91 * @set_parent: Change the input source of this clock; for clocks with multiple
101 * possible parents specify a new parent by passing in the index 92 * possible parents specify a new parent by passing in the index
102 * as a u8 corresponding to the parent in either the .parent_names 93 * as a u8 corresponding to the parent in either the .parent_names
103 * or .parents arrays. This function in affect translates an 94 * or .parents arrays. This function in affect translates an
104 * array index into the value programmed into the hardware. 95 * array index into the value programmed into the hardware.
105 * Returns 0 on success, -EERROR otherwise. 96 * Returns 0 on success, -EERROR otherwise.
97 *
98 * @get_parent: Queries the hardware to determine the parent of a clock. The
99 * return value is a u8 which specifies the index corresponding to
100 * the parent clock. This index can be applied to either the
101 * .parent_names or .parents arrays. In short, this function
102 * translates the parent value read from hardware into an array
103 * index. Currently only called when the clock is initialized by
104 * __clk_init. This callback is mandatory for clocks with
105 * multiple parents. It is optional (and unnecessary) for clocks
106 * with 0 or 1 parents.
106 * 107 *
107 * @set_rate: Change the rate of this clock. The requested rate is specified 108 * @set_rate: Change the rate of this clock. The requested rate is specified
108 * by the second argument, which should typically be the return 109 * by the second argument, which should typically be the return
@@ -110,13 +111,6 @@ struct dentry;
110 * which is likely helpful for most .set_rate implementation. 111 * which is likely helpful for most .set_rate implementation.
111 * Returns 0 on success, -EERROR otherwise. 112 * Returns 0 on success, -EERROR otherwise.
112 * 113 *
113 * @recalc_accuracy: Recalculate the accuracy of this clock. The clock accuracy
114 * is expressed in ppb (parts per billion). The parent accuracy is
115 * an input parameter.
116 * Returns the calculated accuracy. Optional - if this op is not
117 * set then clock accuracy will be initialized to parent accuracy
118 * or 0 (perfect clock) if clock has no parent.
119 *
120 * @set_rate_and_parent: Change the rate and the parent of this clock. The 114 * @set_rate_and_parent: Change the rate and the parent of this clock. The
121 * requested rate is specified by the second argument, which 115 * requested rate is specified by the second argument, which
122 * should typically be the return of .round_rate call. The 116 * should typically be the return of .round_rate call. The
@@ -128,6 +122,18 @@ struct dentry;
128 * separately via calls to .set_parent and .set_rate. 122 * separately via calls to .set_parent and .set_rate.
129 * Returns 0 on success, -EERROR otherwise. 123 * Returns 0 on success, -EERROR otherwise.
130 * 124 *
125 * @recalc_accuracy: Recalculate the accuracy of this clock. The clock accuracy
126 * is expressed in ppb (parts per billion). The parent accuracy is
127 * an input parameter.
128 * Returns the calculated accuracy. Optional - if this op is not
129 * set then clock accuracy will be initialized to parent accuracy
130 * or 0 (perfect clock) if clock has no parent.
131 *
132 * @init: Perform platform-specific initialization magic.
133 * This is not not used by any of the basic clock types.
134 * Please consider other ways of solving initialization problems
135 * before using this callback, as its use is discouraged.
136 *
131 * @debug_init: Set up type-specific debugfs entries for this clock. This 137 * @debug_init: Set up type-specific debugfs entries for this clock. This
132 * is called once, after the debugfs directory entry for this 138 * is called once, after the debugfs directory entry for this
133 * clock has been created. The dentry pointer representing that 139 * clock has been created. The dentry pointer representing that
@@ -157,15 +163,15 @@ struct clk_ops {
157 void (*disable_unused)(struct clk_hw *hw); 163 void (*disable_unused)(struct clk_hw *hw);
158 unsigned long (*recalc_rate)(struct clk_hw *hw, 164 unsigned long (*recalc_rate)(struct clk_hw *hw,
159 unsigned long parent_rate); 165 unsigned long parent_rate);
160 long (*round_rate)(struct clk_hw *hw, unsigned long, 166 long (*round_rate)(struct clk_hw *hw, unsigned long rate,
161 unsigned long *); 167 unsigned long *parent_rate);
162 long (*determine_rate)(struct clk_hw *hw, unsigned long rate, 168 long (*determine_rate)(struct clk_hw *hw, unsigned long rate,
163 unsigned long *best_parent_rate, 169 unsigned long *best_parent_rate,
164 struct clk **best_parent_clk); 170 struct clk **best_parent_clk);
165 int (*set_parent)(struct clk_hw *hw, u8 index); 171 int (*set_parent)(struct clk_hw *hw, u8 index);
166 u8 (*get_parent)(struct clk_hw *hw); 172 u8 (*get_parent)(struct clk_hw *hw);
167 int (*set_rate)(struct clk_hw *hw, unsigned long, 173 int (*set_rate)(struct clk_hw *hw, unsigned long rate,
168 unsigned long); 174 unsigned long parent_rate);
169 int (*set_rate_and_parent)(struct clk_hw *hw, 175 int (*set_rate_and_parent)(struct clk_hw *hw,
170 unsigned long rate, 176 unsigned long rate,
171 unsigned long parent_rate, u8 index); 177 unsigned long parent_rate, u8 index);
@@ -254,12 +260,12 @@ void of_fixed_clk_setup(struct device_node *np);
254 * 260 *
255 * Flags: 261 * Flags:
256 * CLK_GATE_SET_TO_DISABLE - by default this clock sets the bit at bit_idx to 262 * CLK_GATE_SET_TO_DISABLE - by default this clock sets the bit at bit_idx to
257 * enable the clock. Setting this flag does the opposite: setting the bit 263 * enable the clock. Setting this flag does the opposite: setting the bit
258 * disable the clock and clearing it enables the clock 264 * disable the clock and clearing it enables the clock
259 * CLK_GATE_HIWORD_MASK - The gate settings are only in lower 16-bit 265 * CLK_GATE_HIWORD_MASK - The gate settings are only in lower 16-bit
260 * of this register, and mask of gate bits are in higher 16-bit of this 266 * of this register, and mask of gate bits are in higher 16-bit of this
261 * register. While setting the gate bits, higher 16-bit should also be 267 * register. While setting the gate bits, higher 16-bit should also be
262 * updated to indicate changing gate bits. 268 * updated to indicate changing gate bits.
263 */ 269 */
264struct clk_gate { 270struct clk_gate {
265 struct clk_hw hw; 271 struct clk_hw hw;
@@ -298,20 +304,24 @@ struct clk_div_table {
298 * 304 *
299 * Flags: 305 * Flags:
300 * CLK_DIVIDER_ONE_BASED - by default the divisor is the value read from the 306 * CLK_DIVIDER_ONE_BASED - by default the divisor is the value read from the
301 * register plus one. If CLK_DIVIDER_ONE_BASED is set then the divider is 307 * register plus one. If CLK_DIVIDER_ONE_BASED is set then the divider is
302 * the raw value read from the register, with the value of zero considered 308 * the raw value read from the register, with the value of zero considered
303 * invalid, unless CLK_DIVIDER_ALLOW_ZERO is set. 309 * invalid, unless CLK_DIVIDER_ALLOW_ZERO is set.
304 * CLK_DIVIDER_POWER_OF_TWO - clock divisor is 2 raised to the value read from 310 * CLK_DIVIDER_POWER_OF_TWO - clock divisor is 2 raised to the value read from
305 * the hardware register 311 * the hardware register
306 * CLK_DIVIDER_ALLOW_ZERO - Allow zero divisors. For dividers which have 312 * CLK_DIVIDER_ALLOW_ZERO - Allow zero divisors. For dividers which have
307 * CLK_DIVIDER_ONE_BASED set, it is possible to end up with a zero divisor. 313 * CLK_DIVIDER_ONE_BASED set, it is possible to end up with a zero divisor.
308 * Some hardware implementations gracefully handle this case and allow a 314 * Some hardware implementations gracefully handle this case and allow a
309 * zero divisor by not modifying their input clock 315 * zero divisor by not modifying their input clock
310 * (divide by one / bypass). 316 * (divide by one / bypass).
311 * CLK_DIVIDER_HIWORD_MASK - The divider settings are only in lower 16-bit 317 * CLK_DIVIDER_HIWORD_MASK - The divider settings are only in lower 16-bit
312 * of this register, and mask of divider bits are in higher 16-bit of this 318 * of this register, and mask of divider bits are in higher 16-bit of this
313 * register. While setting the divider bits, higher 16-bit should also be 319 * register. While setting the divider bits, higher 16-bit should also be
314 * updated to indicate changing divider bits. 320 * updated to indicate changing divider bits.
321 * CLK_DIVIDER_ROUND_CLOSEST - Makes the best calculated divider to be rounded
322 * to the closest integer instead of the up one.
323 * CLK_DIVIDER_READ_ONLY - The divider settings are preconfigured and should
324 * not be changed by the clock framework.
315 */ 325 */
316struct clk_divider { 326struct clk_divider {
317 struct clk_hw hw; 327 struct clk_hw hw;
@@ -327,8 +337,11 @@ struct clk_divider {
327#define CLK_DIVIDER_POWER_OF_TWO BIT(1) 337#define CLK_DIVIDER_POWER_OF_TWO BIT(1)
328#define CLK_DIVIDER_ALLOW_ZERO BIT(2) 338#define CLK_DIVIDER_ALLOW_ZERO BIT(2)
329#define CLK_DIVIDER_HIWORD_MASK BIT(3) 339#define CLK_DIVIDER_HIWORD_MASK BIT(3)
340#define CLK_DIVIDER_ROUND_CLOSEST BIT(4)
341#define CLK_DIVIDER_READ_ONLY BIT(5)
330 342
331extern const struct clk_ops clk_divider_ops; 343extern const struct clk_ops clk_divider_ops;
344extern const struct clk_ops clk_divider_ro_ops;
332struct clk *clk_register_divider(struct device *dev, const char *name, 345struct clk *clk_register_divider(struct device *dev, const char *name,
333 const char *parent_name, unsigned long flags, 346 const char *parent_name, unsigned long flags,
334 void __iomem *reg, u8 shift, u8 width, 347 void __iomem *reg, u8 shift, u8 width,
@@ -356,9 +369,9 @@ struct clk *clk_register_divider_table(struct device *dev, const char *name,
356 * CLK_MUX_INDEX_ONE - register index starts at 1, not 0 369 * CLK_MUX_INDEX_ONE - register index starts at 1, not 0
357 * CLK_MUX_INDEX_BIT - register index is a single bit (power of two) 370 * CLK_MUX_INDEX_BIT - register index is a single bit (power of two)
358 * CLK_MUX_HIWORD_MASK - The mux settings are only in lower 16-bit of this 371 * CLK_MUX_HIWORD_MASK - The mux settings are only in lower 16-bit of this
359 * register, and mask of mux bits are in higher 16-bit of this register. 372 * register, and mask of mux bits are in higher 16-bit of this register.
360 * While setting the mux bits, higher 16-bit should also be updated to 373 * While setting the mux bits, higher 16-bit should also be updated to
361 * indicate changing mux bits. 374 * indicate changing mux bits.
362 */ 375 */
363struct clk_mux { 376struct clk_mux {
364 struct clk_hw hw; 377 struct clk_hw hw;
diff --git a/include/linux/clk/shmobile.h b/include/linux/clk/shmobile.h
index f9bf080a1123..9f8a14041dd5 100644
--- a/include/linux/clk/shmobile.h
+++ b/include/linux/clk/shmobile.h
@@ -1,7 +1,9 @@
1/* 1/*
2 * Copyright 2013 Ideas On Board SPRL 2 * Copyright 2013 Ideas On Board SPRL
3 * Copyright 2013, 2014 Horms Solutions Ltd.
3 * 4 *
4 * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com> 5 * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
6 * Contact: Simon Horman <horms@verge.net.au>
5 * 7 *
6 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -14,6 +16,7 @@
14 16
15#include <linux/types.h> 17#include <linux/types.h>
16 18
19void r8a7779_clocks_init(u32 mode);
17void rcar_gen2_clocks_init(u32 mode); 20void rcar_gen2_clocks_init(u32 mode);
18 21
19#endif 22#endif
diff --git a/include/linux/clk/sunxi.h b/include/linux/clk/sunxi.h
new file mode 100644
index 000000000000..aed28c4451d9
--- /dev/null
+++ b/include/linux/clk/sunxi.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright 2013 - Hans de Goede <hdegoede@redhat.com>
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
15#ifndef __LINUX_CLK_SUNXI_H_
16#define __LINUX_CLK_SUNXI_H_
17
18#include <linux/clk.h>
19
20void clk_sunxi_mmc_phase_control(struct clk *clk, u8 sample, u8 output);
21
22#endif