Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'clk-renesas-for-v4.15-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-next

Pull Renesas clk driver updates from Geert Uytterhoeven:

- Add support for the second display unit clock on RZ/G1E,
- Add git repository to MAINTAINERS,
- Add suspend/resume support for R-Car Gen3 CPG/MSSR,
- Small fixes and cleanups.

* tag 'clk-renesas-for-v4.15-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers:
clk: renesas: rcar-gen3: Restore R clock during resume
clk: renesas: rcar-gen3: Restore SDHI clocks during resume
clk: renesas: div6: Restore clock state during resume
clk: renesas: cpg-mssr: Add support to restore core clocks during resume
clk: renesas: cpg-mssr: Restore module clocks during resume
MAINTAINERS: Add git repository to Renesas clock driver section
clk: renesas: cpg-mssr: Add du1 clock to R8A7745
clk: renesas: rz: clk-rz is meant for RZ/A1
clk: renesas: r8a77995: Correct parent clock of INTC-AP
clk: renesas: r8a7796: Correct parent clock of INTC-AP
clk: renesas: r8a7795: Correct parent clock of INTC-AP

+217 -36
+2 -2
Documentation/devicetree/bindings/clock/renesas,rz-cpg-clocks.txt
··· 1 - * Renesas RZ Clock Pulse Generator (CPG) 1 + * Renesas RZ/A1 Clock Pulse Generator (CPG) 2 2 3 - The CPG generates core clocks for the RZ SoCs. It includes the PLL, variable 3 + The CPG generates core clocks for the RZ/A1 SoCs. It includes the PLL, variable 4 4 CPU and GPU clocks, and several fixed ratio dividers. 5 5 The CPG also provides a Clock Domain for SoC devices, in combination with the 6 6 CPG Module Stop (MSTP) Clocks.
+1
MAINTAINERS
··· 11428 11428 RENESAS CLOCK DRIVERS 11429 11429 M: Geert Uytterhoeven <geert+renesas@glider.be> 11430 11430 L: linux-renesas-soc@vger.kernel.org 11431 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git clk-renesas 11431 11432 S: Supported 11432 11433 F: drivers/clk/renesas/ 11433 11434
+36 -2
drivers/clk/renesas/clk-div6.c
··· 14 14 #include <linux/init.h> 15 15 #include <linux/io.h> 16 16 #include <linux/kernel.h> 17 + #include <linux/notifier.h> 17 18 #include <linux/of.h> 18 19 #include <linux/of_address.h> 20 + #include <linux/pm.h> 19 21 #include <linux/slab.h> 20 22 21 23 #include "clk-div6.h" ··· 34 32 * @src_shift: Shift to access the register bits to select the parent clock 35 33 * @src_width: Number of register bits to select the parent clock (may be 0) 36 34 * @parents: Array to map from valid parent clocks indices to hardware indices 35 + * @nb: Notifier block to save/restore clock state for system resume 37 36 */ 38 37 struct div6_clock { 39 38 struct clk_hw hw; ··· 43 40 u32 src_shift; 44 41 u32 src_width; 45 42 u8 *parents; 43 + struct notifier_block nb; 46 44 }; 47 45 48 46 #define to_div6_clock(_hw) container_of(_hw, struct div6_clock, hw) ··· 180 176 .set_rate = cpg_div6_clock_set_rate, 181 177 }; 182 178 179 + static int cpg_div6_clock_notifier_call(struct notifier_block *nb, 180 + unsigned long action, void *data) 181 + { 182 + struct div6_clock *clock = container_of(nb, struct div6_clock, nb); 183 + 184 + switch (action) { 185 + case PM_EVENT_RESUME: 186 + /* 187 + * TODO: This does not yet support DIV6 clocks with multiple 188 + * parents, as the parent selection bits are not restored. 189 + * Fortunately so far such DIV6 clocks are found only on 190 + * R/SH-Mobile SoCs, while the resume functionality is only 191 + * needed on R-Car Gen3. 192 + */ 193 + if (__clk_get_enable_count(clock->hw.clk)) 194 + cpg_div6_clock_enable(&clock->hw); 195 + else 196 + cpg_div6_clock_disable(&clock->hw); 197 + return NOTIFY_OK; 198 + } 199 + 200 + return NOTIFY_DONE; 201 + } 183 202 184 203 /** 185 204 * cpg_div6_register - Register a DIV6 clock ··· 210 183 * @num_parents: Number of parent clocks of the DIV6 clock (1, 4, or 8) 211 184 * @parent_names: Array containing the names of the parent clocks 212 185 * @reg: Mapped register used to control the DIV6 clock 186 + * @notifiers: Optional notifier chain to save/restore state for system resume 213 187 */ 214 188 struct clk * __init cpg_div6_register(const char *name, 215 189 unsigned int num_parents, 216 190 const char **parent_names, 217 - void __iomem *reg) 191 + void __iomem *reg, 192 + struct raw_notifier_head *notifiers) 218 193 { 219 194 unsigned int valid_parents; 220 195 struct clk_init_data init; ··· 287 258 if (IS_ERR(clk)) 288 259 goto free_parents; 289 260 261 + if (notifiers) { 262 + clock->nb.notifier_call = cpg_div6_clock_notifier_call; 263 + raw_notifier_chain_register(notifiers, &clock->nb); 264 + } 265 + 290 266 return clk; 291 267 292 268 free_parents: ··· 335 301 for (i = 0; i < num_parents; i++) 336 302 parent_names[i] = of_clk_get_parent_name(np, i); 337 303 338 - clk = cpg_div6_register(clk_name, num_parents, parent_names, reg); 304 + clk = cpg_div6_register(clk_name, num_parents, parent_names, reg, NULL); 339 305 if (IS_ERR(clk)) { 340 306 pr_err("%s: failed to register %s DIV6 clock (%ld)\n", 341 307 __func__, np->name, PTR_ERR(clk));
+2 -1
drivers/clk/renesas/clk-div6.h
··· 2 2 #define __RENESAS_CLK_DIV6_H__ 3 3 4 4 struct clk *cpg_div6_register(const char *name, unsigned int num_parents, 5 - const char **parent_names, void __iomem *reg); 5 + const char **parent_names, void __iomem *reg, 6 + struct raw_notifier_head *notifiers); 6 7 7 8 #endif
+1 -1
drivers/clk/renesas/clk-rz.c
··· 1 1 /* 2 - * rz Core CPG Clocks 2 + * RZ/A1 Core CPG Clocks 3 3 * 4 4 * Copyright (C) 2013 Ideas On Board SPRL 5 5 * Copyright (C) 2014 Wolfram Sang, Sang Engineering <wsa@sang-engineering.com>
+1
drivers/clk/renesas/r8a7745-cpg-mssr.c
··· 129 129 DEF_MOD("scif2", 719, R8A7745_CLK_P), 130 130 DEF_MOD("scif1", 720, R8A7745_CLK_P), 131 131 DEF_MOD("scif0", 721, R8A7745_CLK_P), 132 + DEF_MOD("du1", 723, R8A7745_CLK_ZX), 132 133 DEF_MOD("du0", 724, R8A7745_CLK_ZX), 133 134 DEF_MOD("ipmmu-sgx", 800, R8A7745_CLK_ZX), 134 135 DEF_MOD("vin1", 810, R8A7745_CLK_ZG),
+2 -1
drivers/clk/renesas/r8a7795-cpg-mssr.c
··· 149 149 DEF_MOD("usb-dmac1", 331, R8A7795_CLK_S3D1), 150 150 DEF_MOD("rwdt", 402, R8A7795_CLK_R), 151 151 DEF_MOD("intc-ex", 407, R8A7795_CLK_CP), 152 - DEF_MOD("intc-ap", 408, R8A7795_CLK_S3D1), 152 + DEF_MOD("intc-ap", 408, R8A7795_CLK_S0D3), 153 153 DEF_MOD("audmac1", 501, R8A7795_CLK_S0D3), 154 154 DEF_MOD("audmac0", 502, R8A7795_CLK_S0D3), 155 155 DEF_MOD("drif7", 508, R8A7795_CLK_S3D2), ··· 348 348 { MOD_CLK_ID(217), R8A7795_CLK_S3D1 }, /* SYS-DMAC2 */ 349 349 { MOD_CLK_ID(218), R8A7795_CLK_S3D1 }, /* SYS-DMAC1 */ 350 350 { MOD_CLK_ID(219), R8A7795_CLK_S3D1 }, /* SYS-DMAC0 */ 351 + { MOD_CLK_ID(408), R8A7795_CLK_S3D1 }, /* INTC-AP */ 351 352 { MOD_CLK_ID(501), R8A7795_CLK_S3D1 }, /* AUDMAC1 */ 352 353 { MOD_CLK_ID(502), R8A7795_CLK_S3D1 }, /* AUDMAC0 */ 353 354 { MOD_CLK_ID(523), R8A7795_CLK_S3D4 }, /* PWM */
+1 -1
drivers/clk/renesas/r8a7796-cpg-mssr.c
··· 143 143 DEF_MOD("usb-dmac1", 331, R8A7796_CLK_S3D1), 144 144 DEF_MOD("rwdt", 402, R8A7796_CLK_R), 145 145 DEF_MOD("intc-ex", 407, R8A7796_CLK_CP), 146 - DEF_MOD("intc-ap", 408, R8A7796_CLK_S3D1), 146 + DEF_MOD("intc-ap", 408, R8A7796_CLK_S0D3), 147 147 DEF_MOD("audmac1", 501, R8A7796_CLK_S0D3), 148 148 DEF_MOD("audmac0", 502, R8A7796_CLK_S0D3), 149 149 DEF_MOD("drif7", 508, R8A7796_CLK_S3D2),
+1 -1
drivers/clk/renesas/r8a77995-cpg-mssr.c
··· 127 127 DEF_MOD("usb-dmac1", 331, R8A77995_CLK_S3D1), 128 128 DEF_MOD("rwdt", 402, R8A77995_CLK_R), 129 129 DEF_MOD("intc-ex", 407, R8A77995_CLK_CP), 130 - DEF_MOD("intc-ap", 408, R8A77995_CLK_S3D1), 130 + DEF_MOD("intc-ap", 408, R8A77995_CLK_S1D2), 131 131 DEF_MOD("audmac0", 502, R8A77995_CLK_S3D1), 132 132 DEF_MOD("hscif3", 517, R8A77995_CLK_S3D1C), 133 133 DEF_MOD("hscif0", 520, R8A77995_CLK_S3D1C),
+3 -4
drivers/clk/renesas/rcar-gen2-cpg.c
··· 262 262 static u32 cpg_mode __initdata; 263 263 264 264 struct clk * __init rcar_gen2_cpg_clk_register(struct device *dev, 265 - const struct cpg_core_clk *core, 266 - const struct cpg_mssr_info *info, 267 - struct clk **clks, 268 - void __iomem *base) 265 + const struct cpg_core_clk *core, const struct cpg_mssr_info *info, 266 + struct clk **clks, void __iomem *base, 267 + struct raw_notifier_head *notifiers) 269 268 { 270 269 const struct clk_div_table *table = NULL; 271 270 const struct clk *parent;
+3 -3
drivers/clk/renesas/rcar-gen2-cpg.h
··· 34 34 }; 35 35 36 36 struct clk *rcar_gen2_cpg_clk_register(struct device *dev, 37 - const struct cpg_core_clk *core, 38 - const struct cpg_mssr_info *info, 39 - struct clk **clks, void __iomem *base); 37 + const struct cpg_core_clk *core, const struct cpg_mssr_info *info, 38 + struct clk **clks, void __iomem *base, 39 + struct raw_notifier_head *notifiers); 40 40 int rcar_gen2_cpg_init(const struct rcar_gen2_cpg_pll_config *config, 41 41 unsigned int pll0_div, u32 mode); 42 42
+63 -16
drivers/clk/renesas/rcar-gen3-cpg.c
··· 19 19 #include <linux/err.h> 20 20 #include <linux/init.h> 21 21 #include <linux/io.h> 22 + #include <linux/pm.h> 22 23 #include <linux/slab.h> 23 24 #include <linux/sys_soc.h> 24 25 ··· 30 29 #define CPG_PLL2CR 0x002c 31 30 #define CPG_PLL4CR 0x01f4 32 31 32 + struct cpg_simple_notifier { 33 + struct notifier_block nb; 34 + void __iomem *reg; 35 + u32 saved; 36 + }; 37 + 38 + static int cpg_simple_notifier_call(struct notifier_block *nb, 39 + unsigned long action, void *data) 40 + { 41 + struct cpg_simple_notifier *csn = 42 + container_of(nb, struct cpg_simple_notifier, nb); 43 + 44 + switch (action) { 45 + case PM_EVENT_SUSPEND: 46 + csn->saved = readl(csn->reg); 47 + return NOTIFY_OK; 48 + 49 + case PM_EVENT_RESUME: 50 + writel(csn->saved, csn->reg); 51 + return NOTIFY_OK; 52 + } 53 + return NOTIFY_DONE; 54 + } 55 + 56 + static void cpg_simple_notifier_register(struct raw_notifier_head *notifiers, 57 + struct cpg_simple_notifier *csn) 58 + { 59 + csn->nb.notifier_call = cpg_simple_notifier_call; 60 + raw_notifier_chain_register(notifiers, &csn->nb); 61 + } 33 62 34 63 /* 35 64 * SDn Clock ··· 86 55 87 56 struct sd_clock { 88 57 struct clk_hw hw; 89 - void __iomem *reg; 90 58 const struct sd_div_table *div_table; 59 + struct cpg_simple_notifier csn; 91 60 unsigned int div_num; 92 61 unsigned int div_min; 93 62 unsigned int div_max; ··· 128 97 static int cpg_sd_clock_enable(struct clk_hw *hw) 129 98 { 130 99 struct sd_clock *clock = to_sd_clock(hw); 131 - u32 val = readl(clock->reg); 100 + u32 val = readl(clock->csn.reg); 132 101 133 102 val &= ~(CPG_SD_STP_MASK); 134 103 val |= clock->div_table[clock->cur_div_idx].val & CPG_SD_STP_MASK; 135 104 136 - writel(val, clock->reg); 105 + writel(val, clock->csn.reg); 137 106 138 107 return 0; 139 108 } ··· 142 111 { 143 112 struct sd_clock *clock = to_sd_clock(hw); 144 113 145 - writel(readl(clock->reg) | CPG_SD_STP_MASK, clock->reg); 114 + writel(readl(clock->csn.reg) | CPG_SD_STP_MASK, clock->csn.reg); 146 115 } 147 116 148 117 static int cpg_sd_clock_is_enabled(struct clk_hw *hw) 149 118 { 150 119 struct sd_clock *clock = to_sd_clock(hw); 151 120 152 - return !(readl(clock->reg) & CPG_SD_STP_MASK); 121 + return !(readl(clock->csn.reg) & CPG_SD_STP_MASK); 153 122 } 154 123 155 124 static unsigned long cpg_sd_clock_recalc_rate(struct clk_hw *hw, ··· 201 170 202 171 clock->cur_div_idx = i; 203 172 204 - val = readl(clock->reg); 173 + val = readl(clock->csn.reg); 205 174 val &= ~(CPG_SD_STP_MASK | CPG_SD_FC_MASK); 206 175 val |= clock->div_table[i].val & (CPG_SD_STP_MASK | CPG_SD_FC_MASK); 207 - writel(val, clock->reg); 176 + writel(val, clock->csn.reg); 208 177 209 178 return 0; 210 179 } ··· 219 188 }; 220 189 221 190 static struct clk * __init cpg_sd_clk_register(const struct cpg_core_clk *core, 222 - void __iomem *base, 223 - const char *parent_name) 191 + void __iomem *base, const char *parent_name, 192 + struct raw_notifier_head *notifiers) 224 193 { 225 194 struct clk_init_data init; 226 195 struct sd_clock *clock; ··· 238 207 init.parent_names = &parent_name; 239 208 init.num_parents = 1; 240 209 241 - clock->reg = base + core->offset; 210 + clock->csn.reg = base + core->offset; 242 211 clock->hw.init = &init; 243 212 clock->div_table = cpg_sd_div_table; 244 213 clock->div_num = ARRAY_SIZE(cpg_sd_div_table); 245 214 246 - sd_fc = readl(clock->reg) & CPG_SD_FC_MASK; 215 + sd_fc = readl(clock->csn.reg) & CPG_SD_FC_MASK; 247 216 for (i = 0; i < clock->div_num; i++) 248 217 if (sd_fc == (clock->div_table[i].val & CPG_SD_FC_MASK)) 249 218 break; ··· 264 233 265 234 clk = clk_register(NULL, &clock->hw); 266 235 if (IS_ERR(clk)) 267 - kfree(clock); 236 + goto free_clock; 268 237 238 + cpg_simple_notifier_register(notifiers, &clock->csn); 239 + return clk; 240 + 241 + free_clock: 242 + kfree(clock); 269 243 return clk; 270 244 } 271 245 ··· 301 265 302 266 struct clk * __init rcar_gen3_cpg_clk_register(struct device *dev, 303 267 const struct cpg_core_clk *core, const struct cpg_mssr_info *info, 304 - struct clk **clks, void __iomem *base) 268 + struct clk **clks, void __iomem *base, 269 + struct raw_notifier_head *notifiers) 305 270 { 306 271 const struct clk *parent; 307 272 unsigned int mult = 1; ··· 368 331 break; 369 332 370 333 case CLK_TYPE_GEN3_SD: 371 - return cpg_sd_clk_register(core, base, __clk_get_name(parent)); 334 + return cpg_sd_clk_register(core, base, __clk_get_name(parent), 335 + notifiers); 372 336 373 337 case CLK_TYPE_GEN3_R: 374 338 if (cpg_quirks & RCKCR_CKSEL) { 339 + struct cpg_simple_notifier *csn; 340 + 341 + csn = kzalloc(sizeof(*csn), GFP_KERNEL); 342 + if (!csn) 343 + return ERR_PTR(-ENOMEM); 344 + 345 + csn->reg = base + CPG_RCKCR; 346 + 375 347 /* 376 348 * RINT is default. 377 349 * Only if EXTALR is populated, we switch to it. 378 350 */ 379 - value = readl(base + CPG_RCKCR) & 0x3f; 351 + value = readl(csn->reg) & 0x3f; 380 352 381 353 if (clk_get_rate(clks[cpg_clk_extalr])) { 382 354 parent = clks[cpg_clk_extalr]; 383 355 value |= BIT(15); 384 356 } 385 357 386 - writel(value, base + CPG_RCKCR); 358 + writel(value, csn->reg); 359 + cpg_simple_notifier_register(notifiers, csn); 387 360 break; 388 361 } 389 362
+2 -1
drivers/clk/renesas/rcar-gen3-cpg.h
··· 44 44 45 45 struct clk *rcar_gen3_cpg_clk_register(struct device *dev, 46 46 const struct cpg_core_clk *core, const struct cpg_mssr_info *info, 47 - struct clk **clks, void __iomem *base); 47 + struct clk **clks, void __iomem *base, 48 + struct raw_notifier_head *notifiers); 48 49 int rcar_gen3_cpg_init(const struct rcar_gen3_cpg_pll_config *config, 49 50 unsigned int clk_extalr, u32 mode); 50 51
+97 -2
drivers/clk/renesas/renesas-cpg-mssr.c
··· 26 26 #include <linux/platform_device.h> 27 27 #include <linux/pm_clock.h> 28 28 #include <linux/pm_domain.h> 29 + #include <linux/psci.h> 29 30 #include <linux/reset-controller.h> 30 31 #include <linux/slab.h> 31 32 ··· 107 106 * @num_core_clks: Number of Core Clocks in clks[] 108 107 * @num_mod_clks: Number of Module Clocks in clks[] 109 108 * @last_dt_core_clk: ID of the last Core Clock exported to DT 109 + * @notifiers: Notifier chain to save/restore clock state for system resume 110 + * @smstpcr_saved[].mask: Mask of SMSTPCR[] bits under our control 111 + * @smstpcr_saved[].val: Saved values of SMSTPCR[] 110 112 */ 111 113 struct cpg_mssr_priv { 112 114 #ifdef CONFIG_RESET_CONTROLLER ··· 123 119 unsigned int num_core_clks; 124 120 unsigned int num_mod_clks; 125 121 unsigned int last_dt_core_clk; 122 + 123 + struct raw_notifier_head notifiers; 124 + struct { 125 + u32 mask; 126 + u32 val; 127 + } smstpcr_saved[ARRAY_SIZE(smstpcr)]; 126 128 }; 127 129 128 130 ··· 303 293 304 294 if (core->type == CLK_TYPE_DIV6P1) { 305 295 clk = cpg_div6_register(core->name, 1, &parent_name, 306 - priv->base + core->offset); 296 + priv->base + core->offset, 297 + &priv->notifiers); 307 298 } else { 308 299 clk = clk_register_fixed_factor(NULL, core->name, 309 300 parent_name, 0, ··· 315 304 default: 316 305 if (info->cpg_clk_register) 317 306 clk = info->cpg_clk_register(dev, core, info, 318 - priv->clks, priv->base); 307 + priv->clks, priv->base, 308 + &priv->notifiers); 319 309 else 320 310 dev_err(dev, "%s has unsupported core clock type %u\n", 321 311 core->name, core->type); ··· 394 382 395 383 dev_dbg(dev, "Module clock %pC at %pCr Hz\n", clk, clk); 396 384 priv->clks[id] = clk; 385 + priv->smstpcr_saved[clock->index / 32].mask |= BIT(clock->index % 32); 397 386 return; 398 387 399 388 fail: ··· 713 700 of_clk_del_provider(data); 714 701 } 715 702 703 + #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_ARM_PSCI_FW) 704 + static int cpg_mssr_suspend_noirq(struct device *dev) 705 + { 706 + struct cpg_mssr_priv *priv = dev_get_drvdata(dev); 707 + unsigned int reg; 708 + 709 + /* This is the best we can do to check for the presence of PSCI */ 710 + if (!psci_ops.cpu_suspend) 711 + return 0; 712 + 713 + /* Save module registers with bits under our control */ 714 + for (reg = 0; reg < ARRAY_SIZE(priv->smstpcr_saved); reg++) { 715 + if (priv->smstpcr_saved[reg].mask) 716 + priv->smstpcr_saved[reg].val = 717 + readl(priv->base + SMSTPCR(reg)); 718 + } 719 + 720 + /* Save core clocks */ 721 + raw_notifier_call_chain(&priv->notifiers, PM_EVENT_SUSPEND, NULL); 722 + 723 + return 0; 724 + } 725 + 726 + static int cpg_mssr_resume_noirq(struct device *dev) 727 + { 728 + struct cpg_mssr_priv *priv = dev_get_drvdata(dev); 729 + unsigned int reg, i; 730 + u32 mask, oldval, newval; 731 + 732 + /* This is the best we can do to check for the presence of PSCI */ 733 + if (!psci_ops.cpu_suspend) 734 + return 0; 735 + 736 + /* Restore core clocks */ 737 + raw_notifier_call_chain(&priv->notifiers, PM_EVENT_RESUME, NULL); 738 + 739 + /* Restore module clocks */ 740 + for (reg = 0; reg < ARRAY_SIZE(priv->smstpcr_saved); reg++) { 741 + mask = priv->smstpcr_saved[reg].mask; 742 + if (!mask) 743 + continue; 744 + 745 + oldval = readl(priv->base + SMSTPCR(reg)); 746 + newval = oldval & ~mask; 747 + newval |= priv->smstpcr_saved[reg].val & mask; 748 + if (newval == oldval) 749 + continue; 750 + 751 + writel(newval, priv->base + SMSTPCR(reg)); 752 + 753 + /* Wait until enabled clocks are really enabled */ 754 + mask &= ~priv->smstpcr_saved[reg].val; 755 + if (!mask) 756 + continue; 757 + 758 + for (i = 1000; i > 0; --i) { 759 + oldval = readl(priv->base + MSTPSR(reg)); 760 + if (!(oldval & mask)) 761 + break; 762 + cpu_relax(); 763 + } 764 + 765 + if (!i) 766 + dev_warn(dev, "Failed to enable SMSTP %p[0x%x]\n", 767 + priv->base + SMSTPCR(reg), oldval & mask); 768 + } 769 + 770 + return 0; 771 + } 772 + 773 + static const struct dev_pm_ops cpg_mssr_pm = { 774 + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(cpg_mssr_suspend_noirq, 775 + cpg_mssr_resume_noirq) 776 + }; 777 + #define DEV_PM_OPS &cpg_mssr_pm 778 + #else 779 + #define DEV_PM_OPS NULL 780 + #endif /* CONFIG_PM_SLEEP && CONFIG_ARM_PSCI_FW */ 781 + 716 782 static int __init cpg_mssr_probe(struct platform_device *pdev) 717 783 { 718 784 struct device *dev = &pdev->dev; ··· 827 735 if (!clks) 828 736 return -ENOMEM; 829 737 738 + dev_set_drvdata(dev, priv); 830 739 priv->clks = clks; 831 740 priv->num_core_clks = info->num_total_core_clks; 832 741 priv->num_mod_clks = info->num_hw_mod_clks; 833 742 priv->last_dt_core_clk = info->last_dt_core_clk; 743 + RAW_INIT_NOTIFIER_HEAD(&priv->notifiers); 834 744 835 745 for (i = 0; i < nclks; i++) 836 746 clks[i] = ERR_PTR(-ENOENT); ··· 869 775 .driver = { 870 776 .name = "renesas-cpg-mssr", 871 777 .of_match_table = cpg_mssr_match, 778 + .pm = DEV_PM_OPS, 872 779 }, 873 780 }; 874 781
+2 -1
drivers/clk/renesas/renesas-cpg-mssr.h
··· 127 127 struct clk *(*cpg_clk_register)(struct device *dev, 128 128 const struct cpg_core_clk *core, 129 129 const struct cpg_mssr_info *info, 130 - struct clk **clks, void __iomem *base); 130 + struct clk **clks, void __iomem *base, 131 + struct raw_notifier_head *notifiers); 131 132 }; 132 133 133 134 extern const struct cpg_mssr_info r8a7743_cpg_mssr_info;