diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2017-10-30 20:59:10 -0400 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2017-10-30 20:59:10 -0400 |
commit | ae74ac0828868af3295395be7bc892e0d0aba376 (patch) | |
tree | 3afe9ccaa8b7f5fc195d3a76556570a3edd8bab2 | |
parent | faa865f18cb7e64fe96fdbeb3662f50050bb8d26 (diff) | |
parent | 7679eb20353dc74e47fbc97b2d77fd4f88a77c0f (diff) |
Merge tag 'clk-v4.15-exynos-pm' of git://git.kernel.org/pub/scm/linux/kernel/git/snawrocki/clk into clk-next
Pull Samsung clk driver updates from Sylwester Nawrocki:
- An addition of separate driver for the Exynos 4412 ISP CMU, needed
to model and properly handle the clock controller's dependencies
on the ISP power domain.
- Adding __maybe_unused attributes to the exynos5433_cmu_{suspend,
resume} ops to suppress compiler warnings with CONFIG_PM disabled.
* tag 'clk-v4.15-exynos-pm' of git://git.kernel.org/pub/scm/linux/kernel/git/snawrocki/clk:
clk: samsung: Add a separate driver for Exynos4412 ISP clocks
clk: samsung: Add dt bindings for Exynos4412 ISP clock controller
clk: samsung: Instantiate Exynos4412 ISP clocks only when available
clk: samsung: exynos5433: mark PM functions as __maybe_unused
-rw-r--r-- | Documentation/devicetree/bindings/clock/exynos4-clock.txt | 43 | ||||
-rw-r--r-- | drivers/clk/samsung/Makefile | 1 | ||||
-rw-r--r-- | drivers/clk/samsung/clk-exynos4.c | 31 | ||||
-rw-r--r-- | drivers/clk/samsung/clk-exynos4412-isp.c | 179 | ||||
-rw-r--r-- | drivers/clk/samsung/clk-exynos5433.c | 4 | ||||
-rw-r--r-- | include/dt-bindings/clock/exynos4.h | 35 |
6 files changed, 284 insertions, 9 deletions
diff --git a/Documentation/devicetree/bindings/clock/exynos4-clock.txt b/Documentation/devicetree/bindings/clock/exynos4-clock.txt index f5a5b19ed3b2..bc61c952cb0b 100644 --- a/Documentation/devicetree/bindings/clock/exynos4-clock.txt +++ b/Documentation/devicetree/bindings/clock/exynos4-clock.txt | |||
@@ -41,3 +41,46 @@ Example 2: UART controller node that consumes the clock generated by the clock | |||
41 | clocks = <&clock CLK_UART2>, <&clock CLK_SCLK_UART2>; | 41 | clocks = <&clock CLK_UART2>, <&clock CLK_SCLK_UART2>; |
42 | clock-names = "uart", "clk_uart_baud0"; | 42 | clock-names = "uart", "clk_uart_baud0"; |
43 | }; | 43 | }; |
44 | |||
45 | Exynos4412 SoC contains some additional clocks for FIMC-ISP (Camera ISP) | ||
46 | subsystem. Registers for those clocks are located in the ISP power domain. | ||
47 | Because those registers are also located in a different memory region than | ||
48 | the main clock controller, a separate clock controller has to be defined for | ||
49 | handling them. | ||
50 | |||
51 | Required Properties: | ||
52 | |||
53 | - compatible: should be "samsung,exynos4412-isp-clock". | ||
54 | |||
55 | - reg: physical base address of the ISP clock controller and length of memory | ||
56 | mapped region. | ||
57 | |||
58 | - #clock-cells: should be 1. | ||
59 | |||
60 | - clocks: list of the clock controller input clock identifiers, | ||
61 | from common clock bindings, should point to CLK_ACLK200 and | ||
62 | CLK_ACLK400_MCUISP clocks from the main clock controller. | ||
63 | |||
64 | - clock-names: list of the clock controller input clock names, | ||
65 | as described in clock-bindings.txt, should be "aclk200" and | ||
66 | "aclk400_mcuisp". | ||
67 | |||
68 | - power-domains: a phandle to ISP power domain node as described by | ||
69 | generic PM domain bindings. | ||
70 | |||
71 | Example 3: The clock controllers bindings for Exynos4412 SoCs. | ||
72 | |||
73 | clock: clock-controller@10030000 { | ||
74 | compatible = "samsung,exynos4412-clock"; | ||
75 | reg = <0x10030000 0x18000>; | ||
76 | #clock-cells = <1>; | ||
77 | }; | ||
78 | |||
79 | isp_clock: clock-controller@10048000 { | ||
80 | compatible = "samsung,exynos4412-isp-clock"; | ||
81 | reg = <0x10048000 0x1000>; | ||
82 | #clock-cells = <1>; | ||
83 | power-domains = <&pd_isp>; | ||
84 | clocks = <&clock CLK_ACLK200>, <&clock CLK_ACLK400_MCUISP>; | ||
85 | clock-names = "aclk200", "aclk400_mcuisp"; | ||
86 | }; | ||
diff --git a/drivers/clk/samsung/Makefile b/drivers/clk/samsung/Makefile index 7afc21dc374e..8a67a3bb6803 100644 --- a/drivers/clk/samsung/Makefile +++ b/drivers/clk/samsung/Makefile | |||
@@ -5,6 +5,7 @@ | |||
5 | obj-$(CONFIG_COMMON_CLK) += clk.o clk-pll.o clk-cpu.o | 5 | obj-$(CONFIG_COMMON_CLK) += clk.o clk-pll.o clk-cpu.o |
6 | obj-$(CONFIG_SOC_EXYNOS3250) += clk-exynos3250.o | 6 | obj-$(CONFIG_SOC_EXYNOS3250) += clk-exynos3250.o |
7 | obj-$(CONFIG_ARCH_EXYNOS4) += clk-exynos4.o | 7 | obj-$(CONFIG_ARCH_EXYNOS4) += clk-exynos4.o |
8 | obj-$(CONFIG_ARCH_EXYNOS4) += clk-exynos4412-isp.o | ||
8 | obj-$(CONFIG_SOC_EXYNOS5250) += clk-exynos5250.o | 9 | obj-$(CONFIG_SOC_EXYNOS5250) += clk-exynos5250.o |
9 | obj-$(CONFIG_SOC_EXYNOS5260) += clk-exynos5260.o | 10 | obj-$(CONFIG_SOC_EXYNOS5260) += clk-exynos5260.o |
10 | obj-$(CONFIG_SOC_EXYNOS5410) += clk-exynos5410.o | 11 | obj-$(CONFIG_SOC_EXYNOS5410) += clk-exynos5410.o |
diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c index f452abc6a702..134f25f2a913 100644 --- a/drivers/clk/samsung/clk-exynos4.c +++ b/drivers/clk/samsung/clk-exynos4.c | |||
@@ -836,6 +836,12 @@ static const struct samsung_div_clock exynos4x12_div_clks[] __initconst = { | |||
836 | DIV(0, "div_spi1_isp", "mout_spi1_isp", E4X12_DIV_ISP, 16, 4), | 836 | DIV(0, "div_spi1_isp", "mout_spi1_isp", E4X12_DIV_ISP, 16, 4), |
837 | DIV(0, "div_spi1_isp_pre", "div_spi1_isp", E4X12_DIV_ISP, 20, 8), | 837 | DIV(0, "div_spi1_isp_pre", "div_spi1_isp", E4X12_DIV_ISP, 20, 8), |
838 | DIV(0, "div_uart_isp", "mout_uart_isp", E4X12_DIV_ISP, 28, 4), | 838 | DIV(0, "div_uart_isp", "mout_uart_isp", E4X12_DIV_ISP, 28, 4), |
839 | DIV(CLK_SCLK_FIMG2D, "sclk_fimg2d", "mout_g2d", DIV_DMC1, 0, 4), | ||
840 | DIV(CLK_DIV_C2C, "div_c2c", "mout_c2c", DIV_DMC1, 4, 3), | ||
841 | DIV(0, "div_c2c_aclk", "div_c2c", DIV_DMC1, 12, 3), | ||
842 | }; | ||
843 | |||
844 | static struct samsung_div_clock exynos4x12_isp_div_clks[] = { | ||
839 | DIV_F(CLK_DIV_ISP0, "div_isp0", "aclk200", E4X12_DIV_ISP0, 0, 3, | 845 | DIV_F(CLK_DIV_ISP0, "div_isp0", "aclk200", E4X12_DIV_ISP0, 0, 3, |
840 | CLK_GET_RATE_NOCACHE, 0), | 846 | CLK_GET_RATE_NOCACHE, 0), |
841 | DIV_F(CLK_DIV_ISP1, "div_isp1", "aclk200", E4X12_DIV_ISP0, 4, 3, | 847 | DIV_F(CLK_DIV_ISP1, "div_isp1", "aclk200", E4X12_DIV_ISP0, 4, 3, |
@@ -845,9 +851,6 @@ static const struct samsung_div_clock exynos4x12_div_clks[] __initconst = { | |||
845 | 4, 3, CLK_GET_RATE_NOCACHE, 0), | 851 | 4, 3, CLK_GET_RATE_NOCACHE, 0), |
846 | DIV_F(CLK_DIV_MCUISP1, "div_mcuisp1", "div_mcuisp0", E4X12_DIV_ISP1, | 852 | DIV_F(CLK_DIV_MCUISP1, "div_mcuisp1", "div_mcuisp0", E4X12_DIV_ISP1, |
847 | 8, 3, CLK_GET_RATE_NOCACHE, 0), | 853 | 8, 3, CLK_GET_RATE_NOCACHE, 0), |
848 | DIV(CLK_SCLK_FIMG2D, "sclk_fimg2d", "mout_g2d", DIV_DMC1, 0, 4), | ||
849 | DIV(CLK_DIV_C2C, "div_c2c", "mout_c2c", DIV_DMC1, 4, 3), | ||
850 | DIV(0, "div_c2c_aclk", "div_c2c", DIV_DMC1, 12, 3), | ||
851 | }; | 854 | }; |
852 | 855 | ||
853 | /* list of gate clocks supported in all exynos4 soc's */ | 856 | /* list of gate clocks supported in all exynos4 soc's */ |
@@ -1141,6 +1144,13 @@ static const struct samsung_gate_clock exynos4x12_gate_clks[] __initconst = { | |||
1141 | 0, 0), | 1144 | 0, 0), |
1142 | GATE(CLK_I2S0, "i2s0", "aclk100", E4X12_GATE_IP_MAUDIO, 3, | 1145 | GATE(CLK_I2S0, "i2s0", "aclk100", E4X12_GATE_IP_MAUDIO, 3, |
1143 | 0, 0), | 1146 | 0, 0), |
1147 | GATE(CLK_G2D, "g2d", "aclk200", GATE_IP_DMC, 23, 0, 0), | ||
1148 | GATE(CLK_SMMU_G2D, "smmu_g2d", "aclk200", GATE_IP_DMC, 24, 0, 0), | ||
1149 | GATE(CLK_TMU_APBIF, "tmu_apbif", "aclk100", E4X12_GATE_IP_PERIR, 17, 0, | ||
1150 | 0), | ||
1151 | }; | ||
1152 | |||
1153 | static struct samsung_gate_clock exynos4x12_isp_gate_clks[] = { | ||
1144 | GATE(CLK_FIMC_ISP, "isp", "aclk200", E4X12_GATE_ISP0, 0, | 1154 | GATE(CLK_FIMC_ISP, "isp", "aclk200", E4X12_GATE_ISP0, 0, |
1145 | CLK_IGNORE_UNUSED | CLK_GET_RATE_NOCACHE, 0), | 1155 | CLK_IGNORE_UNUSED | CLK_GET_RATE_NOCACHE, 0), |
1146 | GATE(CLK_FIMC_DRC, "drc", "aclk200", E4X12_GATE_ISP0, 1, | 1156 | GATE(CLK_FIMC_DRC, "drc", "aclk200", E4X12_GATE_ISP0, 1, |
@@ -1193,10 +1203,6 @@ static const struct samsung_gate_clock exynos4x12_gate_clks[] __initconst = { | |||
1193 | CLK_IGNORE_UNUSED | CLK_GET_RATE_NOCACHE, 0), | 1203 | CLK_IGNORE_UNUSED | CLK_GET_RATE_NOCACHE, 0), |
1194 | GATE(CLK_SPI1_ISP, "spi1_isp", "aclk200", E4X12_GATE_ISP1, 13, | 1204 | GATE(CLK_SPI1_ISP, "spi1_isp", "aclk200", E4X12_GATE_ISP1, 13, |
1195 | CLK_IGNORE_UNUSED | CLK_GET_RATE_NOCACHE, 0), | 1205 | CLK_IGNORE_UNUSED | CLK_GET_RATE_NOCACHE, 0), |
1196 | GATE(CLK_G2D, "g2d", "aclk200", GATE_IP_DMC, 23, 0, 0), | ||
1197 | GATE(CLK_SMMU_G2D, "smmu_g2d", "aclk200", GATE_IP_DMC, 24, 0, 0), | ||
1198 | GATE(CLK_TMU_APBIF, "tmu_apbif", "aclk100", E4X12_GATE_IP_PERIR, 17, 0, | ||
1199 | 0), | ||
1200 | }; | 1206 | }; |
1201 | 1207 | ||
1202 | /* | 1208 | /* |
@@ -1497,6 +1503,8 @@ static void __init exynos4_clk_init(struct device_node *np, | |||
1497 | e4210_armclk_d, ARRAY_SIZE(e4210_armclk_d), | 1503 | e4210_armclk_d, ARRAY_SIZE(e4210_armclk_d), |
1498 | CLK_CPU_NEEDS_DEBUG_ALT_DIV | CLK_CPU_HAS_DIV1); | 1504 | CLK_CPU_NEEDS_DEBUG_ALT_DIV | CLK_CPU_HAS_DIV1); |
1499 | } else { | 1505 | } else { |
1506 | struct resource res; | ||
1507 | |||
1500 | samsung_clk_register_mux(ctx, exynos4x12_mux_clks, | 1508 | samsung_clk_register_mux(ctx, exynos4x12_mux_clks, |
1501 | ARRAY_SIZE(exynos4x12_mux_clks)); | 1509 | ARRAY_SIZE(exynos4x12_mux_clks)); |
1502 | samsung_clk_register_div(ctx, exynos4x12_div_clks, | 1510 | samsung_clk_register_div(ctx, exynos4x12_div_clks, |
@@ -1506,6 +1514,15 @@ static void __init exynos4_clk_init(struct device_node *np, | |||
1506 | samsung_clk_register_fixed_factor(ctx, | 1514 | samsung_clk_register_fixed_factor(ctx, |
1507 | exynos4x12_fixed_factor_clks, | 1515 | exynos4x12_fixed_factor_clks, |
1508 | ARRAY_SIZE(exynos4x12_fixed_factor_clks)); | 1516 | ARRAY_SIZE(exynos4x12_fixed_factor_clks)); |
1517 | |||
1518 | of_address_to_resource(np, 0, &res); | ||
1519 | if (resource_size(&res) > 0x18000) { | ||
1520 | samsung_clk_register_div(ctx, exynos4x12_isp_div_clks, | ||
1521 | ARRAY_SIZE(exynos4x12_isp_div_clks)); | ||
1522 | samsung_clk_register_gate(ctx, exynos4x12_isp_gate_clks, | ||
1523 | ARRAY_SIZE(exynos4x12_isp_gate_clks)); | ||
1524 | } | ||
1525 | |||
1509 | exynos_register_cpu_clock(ctx, CLK_ARM_CLK, "armclk", | 1526 | exynos_register_cpu_clock(ctx, CLK_ARM_CLK, "armclk", |
1510 | mout_core_p4x12[0], mout_core_p4x12[1], 0x14200, | 1527 | mout_core_p4x12[0], mout_core_p4x12[1], 0x14200, |
1511 | e4412_armclk_d, ARRAY_SIZE(e4412_armclk_d), | 1528 | e4412_armclk_d, ARRAY_SIZE(e4412_armclk_d), |
diff --git a/drivers/clk/samsung/clk-exynos4412-isp.c b/drivers/clk/samsung/clk-exynos4412-isp.c new file mode 100644 index 000000000000..d5f1ccb36300 --- /dev/null +++ b/drivers/clk/samsung/clk-exynos4412-isp.c | |||
@@ -0,0 +1,179 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2017 Samsung Electronics Co., Ltd. | ||
3 | * Author: Marek Szyprowski <m.szyprowski@samsung.com> | ||
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 version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * Common Clock Framework support for Exynos4412 ISP module. | ||
10 | */ | ||
11 | |||
12 | #include <dt-bindings/clock/exynos4.h> | ||
13 | #include <linux/slab.h> | ||
14 | #include <linux/clk.h> | ||
15 | #include <linux/clk-provider.h> | ||
16 | #include <linux/of.h> | ||
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/pm_runtime.h> | ||
19 | |||
20 | #include "clk.h" | ||
21 | |||
22 | /* Exynos4x12 specific registers, which belong to ISP power domain */ | ||
23 | #define E4X12_DIV_ISP0 0x0300 | ||
24 | #define E4X12_DIV_ISP1 0x0304 | ||
25 | #define E4X12_GATE_ISP0 0x0800 | ||
26 | #define E4X12_GATE_ISP1 0x0804 | ||
27 | |||
28 | /* | ||
29 | * Support for CMU save/restore across system suspends | ||
30 | */ | ||
31 | static struct samsung_clk_reg_dump *exynos4x12_save_isp; | ||
32 | |||
33 | static const unsigned long exynos4x12_clk_isp_save[] __initconst = { | ||
34 | E4X12_DIV_ISP0, | ||
35 | E4X12_DIV_ISP1, | ||
36 | E4X12_GATE_ISP0, | ||
37 | E4X12_GATE_ISP1, | ||
38 | }; | ||
39 | |||
40 | PNAME(mout_user_aclk400_mcuisp_p4x12) = { "fin_pll", "div_aclk400_mcuisp", }; | ||
41 | |||
42 | static struct samsung_div_clock exynos4x12_isp_div_clks[] = { | ||
43 | DIV(CLK_ISP_DIV_ISP0, "div_isp0", "aclk200", E4X12_DIV_ISP0, 0, 3), | ||
44 | DIV(CLK_ISP_DIV_ISP1, "div_isp1", "aclk200", E4X12_DIV_ISP0, 4, 3), | ||
45 | DIV(CLK_ISP_DIV_MCUISP0, "div_mcuisp0", "aclk400_mcuisp", | ||
46 | E4X12_DIV_ISP1, 4, 3), | ||
47 | DIV(CLK_ISP_DIV_MCUISP1, "div_mcuisp1", "div_mcuisp0", | ||
48 | E4X12_DIV_ISP1, 8, 3), | ||
49 | DIV(0, "div_mpwm", "div_isp1", E4X12_DIV_ISP1, 0, 3), | ||
50 | }; | ||
51 | |||
52 | static struct samsung_gate_clock exynos4x12_isp_gate_clks[] = { | ||
53 | GATE(CLK_ISP_FIMC_ISP, "isp", "aclk200", E4X12_GATE_ISP0, 0, 0, 0), | ||
54 | GATE(CLK_ISP_FIMC_DRC, "drc", "aclk200", E4X12_GATE_ISP0, 1, 0, 0), | ||
55 | GATE(CLK_ISP_FIMC_FD, "fd", "aclk200", E4X12_GATE_ISP0, 2, 0, 0), | ||
56 | GATE(CLK_ISP_FIMC_LITE0, "lite0", "aclk200", E4X12_GATE_ISP0, 3, 0, 0), | ||
57 | GATE(CLK_ISP_FIMC_LITE1, "lite1", "aclk200", E4X12_GATE_ISP0, 4, 0, 0), | ||
58 | GATE(CLK_ISP_MCUISP, "mcuisp", "aclk200", E4X12_GATE_ISP0, 5, 0, 0), | ||
59 | GATE(CLK_ISP_GICISP, "gicisp", "aclk200", E4X12_GATE_ISP0, 7, 0, 0), | ||
60 | GATE(CLK_ISP_SMMU_ISP, "smmu_isp", "aclk200", E4X12_GATE_ISP0, 8, 0, 0), | ||
61 | GATE(CLK_ISP_SMMU_DRC, "smmu_drc", "aclk200", E4X12_GATE_ISP0, 9, 0, 0), | ||
62 | GATE(CLK_ISP_SMMU_FD, "smmu_fd", "aclk200", E4X12_GATE_ISP0, 10, 0, 0), | ||
63 | GATE(CLK_ISP_SMMU_LITE0, "smmu_lite0", "aclk200", E4X12_GATE_ISP0, 11, | ||
64 | 0, 0), | ||
65 | GATE(CLK_ISP_SMMU_LITE1, "smmu_lite1", "aclk200", E4X12_GATE_ISP0, 12, | ||
66 | 0, 0), | ||
67 | GATE(CLK_ISP_PPMUISPMX, "ppmuispmx", "aclk200", E4X12_GATE_ISP0, 20, | ||
68 | 0, 0), | ||
69 | GATE(CLK_ISP_PPMUISPX, "ppmuispx", "aclk200", E4X12_GATE_ISP0, 21, | ||
70 | 0, 0), | ||
71 | GATE(CLK_ISP_MCUCTL_ISP, "mcuctl_isp", "aclk200", E4X12_GATE_ISP0, 23, | ||
72 | 0, 0), | ||
73 | GATE(CLK_ISP_MPWM_ISP, "mpwm_isp", "aclk200", E4X12_GATE_ISP0, 24, | ||
74 | 0, 0), | ||
75 | GATE(CLK_ISP_I2C0_ISP, "i2c0_isp", "aclk200", E4X12_GATE_ISP0, 25, | ||
76 | 0, 0), | ||
77 | GATE(CLK_ISP_I2C1_ISP, "i2c1_isp", "aclk200", E4X12_GATE_ISP0, 26, | ||
78 | 0, 0), | ||
79 | GATE(CLK_ISP_MTCADC_ISP, "mtcadc_isp", "aclk200", E4X12_GATE_ISP0, 27, | ||
80 | 0, 0), | ||
81 | GATE(CLK_ISP_PWM_ISP, "pwm_isp", "aclk200", E4X12_GATE_ISP0, 28, 0, 0), | ||
82 | GATE(CLK_ISP_WDT_ISP, "wdt_isp", "aclk200", E4X12_GATE_ISP0, 30, 0, 0), | ||
83 | GATE(CLK_ISP_UART_ISP, "uart_isp", "aclk200", E4X12_GATE_ISP0, 31, | ||
84 | 0, 0), | ||
85 | GATE(CLK_ISP_ASYNCAXIM, "asyncaxim", "aclk200", E4X12_GATE_ISP1, 0, | ||
86 | 0, 0), | ||
87 | GATE(CLK_ISP_SMMU_ISPCX, "smmu_ispcx", "aclk200", E4X12_GATE_ISP1, 4, | ||
88 | 0, 0), | ||
89 | GATE(CLK_ISP_SPI0_ISP, "spi0_isp", "aclk200", E4X12_GATE_ISP1, 12, | ||
90 | 0, 0), | ||
91 | GATE(CLK_ISP_SPI1_ISP, "spi1_isp", "aclk200", E4X12_GATE_ISP1, 13, | ||
92 | 0, 0), | ||
93 | }; | ||
94 | |||
95 | static int __maybe_unused exynos4x12_isp_clk_suspend(struct device *dev) | ||
96 | { | ||
97 | struct samsung_clk_provider *ctx = dev_get_drvdata(dev); | ||
98 | |||
99 | samsung_clk_save(ctx->reg_base, exynos4x12_save_isp, | ||
100 | ARRAY_SIZE(exynos4x12_clk_isp_save)); | ||
101 | return 0; | ||
102 | } | ||
103 | |||
104 | static int __maybe_unused exynos4x12_isp_clk_resume(struct device *dev) | ||
105 | { | ||
106 | struct samsung_clk_provider *ctx = dev_get_drvdata(dev); | ||
107 | |||
108 | samsung_clk_restore(ctx->reg_base, exynos4x12_save_isp, | ||
109 | ARRAY_SIZE(exynos4x12_clk_isp_save)); | ||
110 | return 0; | ||
111 | } | ||
112 | |||
113 | static int __init exynos4x12_isp_clk_probe(struct platform_device *pdev) | ||
114 | { | ||
115 | struct samsung_clk_provider *ctx; | ||
116 | struct device *dev = &pdev->dev; | ||
117 | struct device_node *np = dev->of_node; | ||
118 | struct resource *res; | ||
119 | void __iomem *reg_base; | ||
120 | |||
121 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
122 | reg_base = devm_ioremap_resource(dev, res); | ||
123 | if (IS_ERR(reg_base)) { | ||
124 | dev_err(dev, "failed to map registers\n"); | ||
125 | return PTR_ERR(reg_base); | ||
126 | } | ||
127 | |||
128 | exynos4x12_save_isp = samsung_clk_alloc_reg_dump(exynos4x12_clk_isp_save, | ||
129 | ARRAY_SIZE(exynos4x12_clk_isp_save)); | ||
130 | if (!exynos4x12_save_isp) | ||
131 | return -ENOMEM; | ||
132 | |||
133 | ctx = samsung_clk_init(np, reg_base, CLK_NR_ISP_CLKS); | ||
134 | ctx->dev = dev; | ||
135 | |||
136 | platform_set_drvdata(pdev, ctx); | ||
137 | |||
138 | pm_runtime_set_active(dev); | ||
139 | pm_runtime_enable(dev); | ||
140 | pm_runtime_get_sync(dev); | ||
141 | |||
142 | samsung_clk_register_div(ctx, exynos4x12_isp_div_clks, | ||
143 | ARRAY_SIZE(exynos4x12_isp_div_clks)); | ||
144 | samsung_clk_register_gate(ctx, exynos4x12_isp_gate_clks, | ||
145 | ARRAY_SIZE(exynos4x12_isp_gate_clks)); | ||
146 | |||
147 | samsung_clk_of_add_provider(np, ctx); | ||
148 | pm_runtime_put(dev); | ||
149 | |||
150 | return 0; | ||
151 | } | ||
152 | |||
153 | static const struct of_device_id exynos4x12_isp_clk_of_match[] = { | ||
154 | { .compatible = "samsung,exynos4412-isp-clock", }, | ||
155 | { }, | ||
156 | }; | ||
157 | |||
158 | static const struct dev_pm_ops exynos4x12_isp_pm_ops = { | ||
159 | SET_RUNTIME_PM_OPS(exynos4x12_isp_clk_suspend, | ||
160 | exynos4x12_isp_clk_resume, NULL) | ||
161 | SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, | ||
162 | pm_runtime_force_resume) | ||
163 | }; | ||
164 | |||
165 | static struct platform_driver exynos4x12_isp_clk_driver __refdata = { | ||
166 | .driver = { | ||
167 | .name = "exynos4x12-isp-clk", | ||
168 | .of_match_table = exynos4x12_isp_clk_of_match, | ||
169 | .suppress_bind_attrs = true, | ||
170 | .pm = &exynos4x12_isp_pm_ops, | ||
171 | }, | ||
172 | .probe = exynos4x12_isp_clk_probe, | ||
173 | }; | ||
174 | |||
175 | static int __init exynos4x12_isp_clk_init(void) | ||
176 | { | ||
177 | return platform_driver_register(&exynos4x12_isp_clk_driver); | ||
178 | } | ||
179 | core_initcall(exynos4x12_isp_clk_init); | ||
diff --git a/drivers/clk/samsung/clk-exynos5433.c b/drivers/clk/samsung/clk-exynos5433.c index cd9337613dd8..db270908037a 100644 --- a/drivers/clk/samsung/clk-exynos5433.c +++ b/drivers/clk/samsung/clk-exynos5433.c | |||
@@ -5450,7 +5450,7 @@ struct exynos5433_cmu_data { | |||
5450 | struct samsung_clk_provider ctx; | 5450 | struct samsung_clk_provider ctx; |
5451 | }; | 5451 | }; |
5452 | 5452 | ||
5453 | static int exynos5433_cmu_suspend(struct device *dev) | 5453 | static int __maybe_unused exynos5433_cmu_suspend(struct device *dev) |
5454 | { | 5454 | { |
5455 | struct exynos5433_cmu_data *data = dev_get_drvdata(dev); | 5455 | struct exynos5433_cmu_data *data = dev_get_drvdata(dev); |
5456 | int i; | 5456 | int i; |
@@ -5473,7 +5473,7 @@ static int exynos5433_cmu_suspend(struct device *dev) | |||
5473 | return 0; | 5473 | return 0; |
5474 | } | 5474 | } |
5475 | 5475 | ||
5476 | static int exynos5433_cmu_resume(struct device *dev) | 5476 | static int __maybe_unused exynos5433_cmu_resume(struct device *dev) |
5477 | { | 5477 | { |
5478 | struct exynos5433_cmu_data *data = dev_get_drvdata(dev); | 5478 | struct exynos5433_cmu_data *data = dev_get_drvdata(dev); |
5479 | int i; | 5479 | int i; |
diff --git a/include/dt-bindings/clock/exynos4.h b/include/dt-bindings/clock/exynos4.h index c40111f36d5e..e9f9d400c322 100644 --- a/include/dt-bindings/clock/exynos4.h +++ b/include/dt-bindings/clock/exynos4.h | |||
@@ -272,4 +272,39 @@ | |||
272 | /* must be greater than maximal clock id */ | 272 | /* must be greater than maximal clock id */ |
273 | #define CLK_NR_CLKS 461 | 273 | #define CLK_NR_CLKS 461 |
274 | 274 | ||
275 | /* Exynos4x12 ISP clocks */ | ||
276 | #define CLK_ISP_FIMC_ISP 1 | ||
277 | #define CLK_ISP_FIMC_DRC 2 | ||
278 | #define CLK_ISP_FIMC_FD 3 | ||
279 | #define CLK_ISP_FIMC_LITE0 4 | ||
280 | #define CLK_ISP_FIMC_LITE1 5 | ||
281 | #define CLK_ISP_MCUISP 6 | ||
282 | #define CLK_ISP_GICISP 7 | ||
283 | #define CLK_ISP_SMMU_ISP 8 | ||
284 | #define CLK_ISP_SMMU_DRC 9 | ||
285 | #define CLK_ISP_SMMU_FD 10 | ||
286 | #define CLK_ISP_SMMU_LITE0 11 | ||
287 | #define CLK_ISP_SMMU_LITE1 12 | ||
288 | #define CLK_ISP_PPMUISPMX 13 | ||
289 | #define CLK_ISP_PPMUISPX 14 | ||
290 | #define CLK_ISP_MCUCTL_ISP 15 | ||
291 | #define CLK_ISP_MPWM_ISP 16 | ||
292 | #define CLK_ISP_I2C0_ISP 17 | ||
293 | #define CLK_ISP_I2C1_ISP 18 | ||
294 | #define CLK_ISP_MTCADC_ISP 19 | ||
295 | #define CLK_ISP_PWM_ISP 20 | ||
296 | #define CLK_ISP_WDT_ISP 21 | ||
297 | #define CLK_ISP_UART_ISP 22 | ||
298 | #define CLK_ISP_ASYNCAXIM 23 | ||
299 | #define CLK_ISP_SMMU_ISPCX 24 | ||
300 | #define CLK_ISP_SPI0_ISP 25 | ||
301 | #define CLK_ISP_SPI1_ISP 26 | ||
302 | |||
303 | #define CLK_ISP_DIV_ISP0 27 | ||
304 | #define CLK_ISP_DIV_ISP1 28 | ||
305 | #define CLK_ISP_DIV_MCUISP0 29 | ||
306 | #define CLK_ISP_DIV_MCUISP1 30 | ||
307 | |||
308 | #define CLK_NR_ISP_CLKS 31 | ||
309 | |||
275 | #endif /* _DT_BINDINGS_CLOCK_EXYNOS_4_H */ | 310 | #endif /* _DT_BINDINGS_CLOCK_EXYNOS_4_H */ |