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

Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux

Pull clk fixes from Stephen Boyd:
"A semi-large pile of clk driver fixes this time around.

Nothing is touching the core so these fixes are fairly well contained
to specific devices that use these clk drivers.

- Some Allwinner SoC fixes to gracefully handle errors and mark an
RTC clk as critical so that the RTC keeps ticking.

- Fix AXI bus clks and RTC clk design for Microchip PolarFire SoC
driver introduced this cycle. This has some devicetree bits acked
by riscv maintainers. We're fixing it now so that the prior
bindings aren't released in a major kernel version.

- Remove a reset on Microchip PolarFire SoCs that broke when enabling
CONFIG_PM.

- Set a min/max for the Qualcomm graphics clk. This got broken by the
clk rate range patches introduced this cycle"

* tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
clk: sunxi: sun9i-mmc: check return value after calling platform_get_resource()
clk: sunxi-ng: sun6i-rtc: Mark rtc-32k as critical
riscv: dts: microchip: reparent mpfs clocks
clk: microchip: mpfs: add RTCREF clock control
clk: microchip: mpfs: re-parent the configurable clocks
dt-bindings: rtc: add refclk to mpfs-rtc
dt-bindings: clk: mpfs: add defines for two new clocks
dt-bindings: clk: mpfs document msspll dri registers
riscv: dts: microchip: fix usage of fic clocks on mpfs
clk: microchip: mpfs: mark CLK_ATHENA as critical
clk: microchip: mpfs: fix parents for FIC clocks
clk: qcom: clk-rcg2: fix gfx3d frequency calculation
clk: microchip: mpfs: don't reset disabled peripherals
clk: sunxi-ng: fix not NULL terminated coccicheck error

+216 -46
+11 -2
Documentation/devicetree/bindings/clock/microchip,mpfs.yaml
··· 22 22 const: microchip,mpfs-clkcfg 23 23 24 24 reg: 25 - maxItems: 1 25 + items: 26 + - description: | 27 + clock config registers: 28 + These registers contain enable, reset & divider tables for the, cpu, 29 + axi, ahb and rtc/mtimer reference clocks as well as enable and reset 30 + for the peripheral clocks. 31 + - description: | 32 + mss pll dri registers: 33 + Block of registers responsible for dynamic reconfiguration of the mss 34 + pll 26 35 27 36 clocks: 28 37 maxItems: 1 ··· 60 51 #size-cells = <2>; 61 52 clkcfg: clock-controller@20002000 { 62 53 compatible = "microchip,mpfs-clkcfg"; 63 - reg = <0x0 0x20002000 0x0 0x1000>; 54 + reg = <0x0 0x20002000 0x0 0x1000>, <0x0 0x3E001000 0x0 0x1000>; 64 55 clocks = <&ref>; 65 56 #clock-cells = <1>; 66 57 };
+12 -3
Documentation/devicetree/bindings/rtc/microchip,mfps-rtc.yaml
··· 31 31 to that of the RTC's count register. 32 32 33 33 clocks: 34 - maxItems: 1 34 + items: 35 + - description: | 36 + AHB clock 37 + - description: | 38 + Reference clock: divided by the prescaler to create a time-based 39 + strobe (typically 1 Hz) for the calendar counter. By default, the rtc 40 + on the PolarFire SoC shares it's reference with MTIMER so this will 41 + be a 1 MHz clock. 35 42 36 43 clock-names: 37 44 items: 38 45 - const: rtc 46 + - const: rtcref 39 47 40 48 required: 41 49 - compatible ··· 56 48 57 49 examples: 58 50 - | 51 + #include "dt-bindings/clock/microchip,mpfs-clock.h" 59 52 rtc@20124000 { 60 53 compatible = "microchip,mpfs-rtc"; 61 54 reg = <0x20124000 0x1000>; 62 - clocks = <&clkcfg 21>; 63 - clock-names = "rtc"; 55 + clocks = <&clkcfg CLK_RTC>, <&clkcfg CLK_RTCREF>; 56 + clock-names = "rtc", "rtcref"; 64 57 interrupts = <80>, <81>; 65 58 }; 66 59 ...
+14 -2
arch/riscv/boot/dts/microchip/microchip-mpfs-fabric.dtsi
··· 7 7 reg = <0x0 0x41000000 0x0 0xF0>; 8 8 microchip,sync-update-mask = /bits/ 32 <0>; 9 9 #pwm-cells = <2>; 10 - clocks = <&clkcfg CLK_FIC3>; 10 + clocks = <&fabric_clk3>; 11 11 status = "disabled"; 12 12 }; 13 13 ··· 16 16 reg = <0x0 0x44000000 0x0 0x1000>; 17 17 #address-cells = <1>; 18 18 #size-cells = <0>; 19 - clocks = <&clkcfg CLK_FIC3>; 19 + clocks = <&fabric_clk3>; 20 20 interrupt-parent = <&plic>; 21 21 interrupts = <122>; 22 22 clock-frequency = <100000>; 23 23 status = "disabled"; 24 + }; 25 + 26 + fabric_clk3: fabric-clk3 { 27 + compatible = "fixed-clock"; 28 + #clock-cells = <0>; 29 + clock-frequency = <62500000>; 30 + }; 31 + 32 + fabric_clk1: fabric-clk1 { 33 + compatible = "fixed-clock"; 34 + #clock-cells = <0>; 35 + clock-frequency = <125000000>; 24 36 }; 25 37 };
+1 -1
arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dts
··· 45 45 }; 46 46 47 47 &refclk { 48 - clock-frequency = <600000000>; 48 + clock-frequency = <125000000>; 49 49 }; 50 50 51 51 &mmuart1 {
+5 -5
arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi
··· 141 141 }; 142 142 }; 143 143 144 - refclk: msspllclk { 144 + refclk: mssrefclk { 145 145 compatible = "fixed-clock"; 146 146 #clock-cells = <0>; 147 147 }; ··· 190 190 191 191 clkcfg: clkcfg@20002000 { 192 192 compatible = "microchip,mpfs-clkcfg"; 193 - reg = <0x0 0x20002000 0x0 0x1000>; 193 + reg = <0x0 0x20002000 0x0 0x1000>, <0x0 0x3E001000 0x0 0x1000>; 194 194 clocks = <&refclk>; 195 195 #clock-cells = <1>; 196 196 }; ··· 393 393 reg = <0x0 0x20124000 0x0 0x1000>; 394 394 interrupt-parent = <&plic>; 395 395 interrupts = <80>, <81>; 396 - clocks = <&clkcfg CLK_RTC>; 397 - clock-names = "rtc"; 396 + clocks = <&clkcfg CLK_RTC>, <&clkcfg CLK_RTCREF>; 397 + clock-names = "rtc", "rtcref"; 398 398 status = "disabled"; 399 399 }; 400 400 ··· 424 424 <0 0 0 3 &pcie_intc 2>, 425 425 <0 0 0 4 &pcie_intc 3>; 426 426 interrupt-map-mask = <0 0 0 7>; 427 - clocks = <&clkcfg CLK_FIC0>, <&clkcfg CLK_FIC1>, <&clkcfg CLK_FIC3>; 427 + clocks = <&fabric_clk1>, <&fabric_clk1>, <&fabric_clk3>; 428 428 clock-names = "fic0", "fic1", "fic3"; 429 429 ranges = <0x3000000 0x0 0x8000000 0x20 0x8000000 0x0 0x80000000>; 430 430 msi-parent = <&pcie>;
+164 -31
drivers/clk/microchip/clk-mpfs.c
··· 11 11 #include <dt-bindings/clock/microchip,mpfs-clock.h> 12 12 13 13 /* address offset of control registers */ 14 + #define REG_MSSPLL_REF_CR 0x08u 15 + #define REG_MSSPLL_POSTDIV_CR 0x10u 16 + #define REG_MSSPLL_SSCG_2_CR 0x2Cu 14 17 #define REG_CLOCK_CONFIG_CR 0x08u 18 + #define REG_RTC_CLOCK_CR 0x0Cu 15 19 #define REG_SUBBLK_CLOCK_CR 0x84u 16 20 #define REG_SUBBLK_RESET_CR 0x88u 17 21 22 + #define MSSPLL_FBDIV_SHIFT 0x00u 23 + #define MSSPLL_FBDIV_WIDTH 0x0Cu 24 + #define MSSPLL_REFDIV_SHIFT 0x08u 25 + #define MSSPLL_REFDIV_WIDTH 0x06u 26 + #define MSSPLL_POSTDIV_SHIFT 0x08u 27 + #define MSSPLL_POSTDIV_WIDTH 0x07u 28 + #define MSSPLL_FIXED_DIV 4u 29 + 18 30 struct mpfs_clock_data { 19 31 void __iomem *base; 32 + void __iomem *msspll_base; 20 33 struct clk_hw_onecell_data hw_data; 21 34 }; 35 + 36 + struct mpfs_msspll_hw_clock { 37 + void __iomem *base; 38 + unsigned int id; 39 + u32 reg_offset; 40 + u32 shift; 41 + u32 width; 42 + u32 flags; 43 + struct clk_hw hw; 44 + struct clk_init_data init; 45 + }; 46 + 47 + #define to_mpfs_msspll_clk(_hw) container_of(_hw, struct mpfs_msspll_hw_clock, hw) 22 48 23 49 struct mpfs_cfg_clock { 24 50 const struct clk_div_table *table; 25 51 unsigned int id; 52 + u32 reg_offset; 26 53 u8 shift; 27 54 u8 width; 55 + u8 flags; 28 56 }; 29 57 30 58 struct mpfs_cfg_hw_clock { ··· 83 55 */ 84 56 static DEFINE_SPINLOCK(mpfs_clk_lock); 85 57 86 - static const struct clk_parent_data mpfs_cfg_parent[] = { 58 + static const struct clk_parent_data mpfs_ext_ref[] = { 87 59 { .index = 0 }, 88 60 }; 89 61 ··· 97 69 { 0, 0 } 98 70 }; 99 71 72 + /* 73 + * The only two supported reference clock frequencies for the PolarFire SoC are 74 + * 100 and 125 MHz, as the rtc reference is required to be 1 MHz. 75 + * It therefore only needs to have divider table entries corresponding to 76 + * divide by 100 and 125. 77 + */ 78 + static const struct clk_div_table mpfs_div_rtcref_table[] = { 79 + { 100, 100 }, { 125, 125 }, 80 + { 0, 0 } 81 + }; 82 + 83 + static unsigned long mpfs_clk_msspll_recalc_rate(struct clk_hw *hw, unsigned long prate) 84 + { 85 + struct mpfs_msspll_hw_clock *msspll_hw = to_mpfs_msspll_clk(hw); 86 + void __iomem *mult_addr = msspll_hw->base + msspll_hw->reg_offset; 87 + void __iomem *ref_div_addr = msspll_hw->base + REG_MSSPLL_REF_CR; 88 + void __iomem *postdiv_addr = msspll_hw->base + REG_MSSPLL_POSTDIV_CR; 89 + u32 mult, ref_div, postdiv; 90 + 91 + mult = readl_relaxed(mult_addr) >> MSSPLL_FBDIV_SHIFT; 92 + mult &= clk_div_mask(MSSPLL_FBDIV_WIDTH); 93 + ref_div = readl_relaxed(ref_div_addr) >> MSSPLL_REFDIV_SHIFT; 94 + ref_div &= clk_div_mask(MSSPLL_REFDIV_WIDTH); 95 + postdiv = readl_relaxed(postdiv_addr) >> MSSPLL_POSTDIV_SHIFT; 96 + postdiv &= clk_div_mask(MSSPLL_POSTDIV_WIDTH); 97 + 98 + return prate * mult / (ref_div * MSSPLL_FIXED_DIV * postdiv); 99 + } 100 + 101 + static const struct clk_ops mpfs_clk_msspll_ops = { 102 + .recalc_rate = mpfs_clk_msspll_recalc_rate, 103 + }; 104 + 105 + #define CLK_PLL(_id, _name, _parent, _shift, _width, _flags, _offset) { \ 106 + .id = _id, \ 107 + .shift = _shift, \ 108 + .width = _width, \ 109 + .reg_offset = _offset, \ 110 + .flags = _flags, \ 111 + .hw.init = CLK_HW_INIT_PARENTS_DATA(_name, _parent, &mpfs_clk_msspll_ops, 0), \ 112 + } 113 + 114 + static struct mpfs_msspll_hw_clock mpfs_msspll_clks[] = { 115 + CLK_PLL(CLK_MSSPLL, "clk_msspll", mpfs_ext_ref, MSSPLL_FBDIV_SHIFT, 116 + MSSPLL_FBDIV_WIDTH, 0, REG_MSSPLL_SSCG_2_CR), 117 + }; 118 + 119 + static int mpfs_clk_register_msspll(struct device *dev, struct mpfs_msspll_hw_clock *msspll_hw, 120 + void __iomem *base) 121 + { 122 + msspll_hw->base = base; 123 + 124 + return devm_clk_hw_register(dev, &msspll_hw->hw); 125 + } 126 + 127 + static int mpfs_clk_register_mssplls(struct device *dev, struct mpfs_msspll_hw_clock *msspll_hws, 128 + unsigned int num_clks, struct mpfs_clock_data *data) 129 + { 130 + void __iomem *base = data->msspll_base; 131 + unsigned int i; 132 + int ret; 133 + 134 + for (i = 0; i < num_clks; i++) { 135 + struct mpfs_msspll_hw_clock *msspll_hw = &msspll_hws[i]; 136 + 137 + ret = mpfs_clk_register_msspll(dev, msspll_hw, base); 138 + if (ret) 139 + return dev_err_probe(dev, ret, "failed to register msspll id: %d\n", 140 + CLK_MSSPLL); 141 + 142 + data->hw_data.hws[msspll_hw->id] = &msspll_hw->hw; 143 + } 144 + 145 + return 0; 146 + } 147 + 148 + /* 149 + * "CFG" clocks 150 + */ 151 + 100 152 static unsigned long mpfs_cfg_clk_recalc_rate(struct clk_hw *hw, unsigned long prate) 101 153 { 102 154 struct mpfs_cfg_hw_clock *cfg_hw = to_mpfs_cfg_clk(hw); ··· 184 76 void __iomem *base_addr = cfg_hw->sys_base; 185 77 u32 val; 186 78 187 - val = readl_relaxed(base_addr + REG_CLOCK_CONFIG_CR) >> cfg->shift; 79 + val = readl_relaxed(base_addr + cfg->reg_offset) >> cfg->shift; 188 80 val &= clk_div_mask(cfg->width); 189 81 190 - return prate / (1u << val); 82 + return divider_recalc_rate(hw, prate, val, cfg->table, cfg->flags, cfg->width); 191 83 } 192 84 193 85 static long mpfs_cfg_clk_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *prate) ··· 213 105 return divider_setting; 214 106 215 107 spin_lock_irqsave(&mpfs_clk_lock, flags); 216 - 217 - val = readl_relaxed(base_addr + REG_CLOCK_CONFIG_CR); 108 + val = readl_relaxed(base_addr + cfg->reg_offset); 218 109 val &= ~(clk_div_mask(cfg->width) << cfg_hw->cfg.shift); 219 110 val |= divider_setting << cfg->shift; 220 - writel_relaxed(val, base_addr + REG_CLOCK_CONFIG_CR); 111 + writel_relaxed(val, base_addr + cfg->reg_offset); 221 112 222 113 spin_unlock_irqrestore(&mpfs_clk_lock, flags); 223 114 ··· 229 122 .set_rate = mpfs_cfg_clk_set_rate, 230 123 }; 231 124 232 - #define CLK_CFG(_id, _name, _parent, _shift, _width, _table, _flags) { \ 233 - .cfg.id = _id, \ 234 - .cfg.shift = _shift, \ 235 - .cfg.width = _width, \ 236 - .cfg.table = _table, \ 237 - .hw.init = CLK_HW_INIT_PARENTS_DATA(_name, _parent, &mpfs_clk_cfg_ops, \ 238 - _flags), \ 125 + #define CLK_CFG(_id, _name, _parent, _shift, _width, _table, _flags, _offset) { \ 126 + .cfg.id = _id, \ 127 + .cfg.shift = _shift, \ 128 + .cfg.width = _width, \ 129 + .cfg.table = _table, \ 130 + .cfg.reg_offset = _offset, \ 131 + .cfg.flags = _flags, \ 132 + .hw.init = CLK_HW_INIT(_name, _parent, &mpfs_clk_cfg_ops, 0), \ 239 133 } 240 134 241 135 static struct mpfs_cfg_hw_clock mpfs_cfg_clks[] = { 242 - CLK_CFG(CLK_CPU, "clk_cpu", mpfs_cfg_parent, 0, 2, mpfs_div_cpu_axi_table, 0), 243 - CLK_CFG(CLK_AXI, "clk_axi", mpfs_cfg_parent, 2, 2, mpfs_div_cpu_axi_table, 0), 244 - CLK_CFG(CLK_AHB, "clk_ahb", mpfs_cfg_parent, 4, 2, mpfs_div_ahb_table, 0), 136 + CLK_CFG(CLK_CPU, "clk_cpu", "clk_msspll", 0, 2, mpfs_div_cpu_axi_table, 0, 137 + REG_CLOCK_CONFIG_CR), 138 + CLK_CFG(CLK_AXI, "clk_axi", "clk_msspll", 2, 2, mpfs_div_cpu_axi_table, 0, 139 + REG_CLOCK_CONFIG_CR), 140 + CLK_CFG(CLK_AHB, "clk_ahb", "clk_msspll", 4, 2, mpfs_div_ahb_table, 0, 141 + REG_CLOCK_CONFIG_CR), 142 + { 143 + .cfg.id = CLK_RTCREF, 144 + .cfg.shift = 0, 145 + .cfg.width = 12, 146 + .cfg.table = mpfs_div_rtcref_table, 147 + .cfg.reg_offset = REG_RTC_CLOCK_CR, 148 + .cfg.flags = CLK_DIVIDER_ONE_BASED, 149 + .hw.init = 150 + CLK_HW_INIT_PARENTS_DATA("clk_rtcref", mpfs_ext_ref, &mpfs_clk_cfg_ops, 0), 151 + } 245 152 }; 246 153 247 154 static int mpfs_clk_register_cfg(struct device *dev, struct mpfs_cfg_hw_clock *cfg_hw, ··· 281 160 return dev_err_probe(dev, ret, "failed to register clock id: %d\n", 282 161 cfg_hw->cfg.id); 283 162 284 - id = cfg_hws[i].cfg.id; 163 + id = cfg_hw->cfg.id; 285 164 data->hw_data.hws[id] = &cfg_hw->hw; 286 165 } 287 166 288 167 return 0; 289 168 } 169 + 170 + /* 171 + * peripheral clocks - devices connected to axi or ahb buses. 172 + */ 290 173 291 174 static int mpfs_periph_clk_enable(struct clk_hw *hw) 292 175 { ··· 324 199 unsigned long flags; 325 200 326 201 spin_lock_irqsave(&mpfs_clk_lock, flags); 327 - 328 - reg = readl_relaxed(base_addr + REG_SUBBLK_RESET_CR); 329 - val = reg | (1u << periph->shift); 330 - writel_relaxed(val, base_addr + REG_SUBBLK_RESET_CR); 331 202 332 203 reg = readl_relaxed(base_addr + REG_SUBBLK_CLOCK_CR); 333 204 val = reg & ~(1u << periph->shift); ··· 370 249 * trap handler 371 250 * - CLK_MMUART0: reserved by the hss 372 251 * - CLK_DDRC: provides clock to the ddr subsystem 373 - * - CLK_FICx: these provide clocks for sections of the fpga fabric, disabling them would 374 - * cause the fabric to go into reset 252 + * - CLK_FICx: these provide the processor side clocks to the "FIC" (Fabric InterConnect) 253 + * clock domain crossers which provide the interface to the FPGA fabric. Disabling them 254 + * causes the FPGA fabric to go into reset. 255 + * - CLK_ATHENA: The athena clock is FIC4, which is reserved for the Athena TeraFire. 375 256 */ 376 257 377 258 static struct mpfs_periph_hw_clock mpfs_periph_clks[] = { ··· 381 258 CLK_PERIPH(CLK_MAC0, "clk_periph_mac0", PARENT_CLK(AHB), 1, 0), 382 259 CLK_PERIPH(CLK_MAC1, "clk_periph_mac1", PARENT_CLK(AHB), 2, 0), 383 260 CLK_PERIPH(CLK_MMC, "clk_periph_mmc", PARENT_CLK(AHB), 3, 0), 384 - CLK_PERIPH(CLK_TIMER, "clk_periph_timer", PARENT_CLK(AHB), 4, 0), 261 + CLK_PERIPH(CLK_TIMER, "clk_periph_timer", PARENT_CLK(RTCREF), 4, 0), 385 262 CLK_PERIPH(CLK_MMUART0, "clk_periph_mmuart0", PARENT_CLK(AHB), 5, CLK_IS_CRITICAL), 386 263 CLK_PERIPH(CLK_MMUART1, "clk_periph_mmuart1", PARENT_CLK(AHB), 6, 0), 387 264 CLK_PERIPH(CLK_MMUART2, "clk_periph_mmuart2", PARENT_CLK(AHB), 7, 0), ··· 400 277 CLK_PERIPH(CLK_GPIO1, "clk_periph_gpio1", PARENT_CLK(AHB), 21, 0), 401 278 CLK_PERIPH(CLK_GPIO2, "clk_periph_gpio2", PARENT_CLK(AHB), 22, 0), 402 279 CLK_PERIPH(CLK_DDRC, "clk_periph_ddrc", PARENT_CLK(AHB), 23, CLK_IS_CRITICAL), 403 - CLK_PERIPH(CLK_FIC0, "clk_periph_fic0", PARENT_CLK(AHB), 24, CLK_IS_CRITICAL), 404 - CLK_PERIPH(CLK_FIC1, "clk_periph_fic1", PARENT_CLK(AHB), 25, CLK_IS_CRITICAL), 405 - CLK_PERIPH(CLK_FIC2, "clk_periph_fic2", PARENT_CLK(AHB), 26, CLK_IS_CRITICAL), 406 - CLK_PERIPH(CLK_FIC3, "clk_periph_fic3", PARENT_CLK(AHB), 27, CLK_IS_CRITICAL), 407 - CLK_PERIPH(CLK_ATHENA, "clk_periph_athena", PARENT_CLK(AHB), 28, 0), 280 + CLK_PERIPH(CLK_FIC0, "clk_periph_fic0", PARENT_CLK(AXI), 24, CLK_IS_CRITICAL), 281 + CLK_PERIPH(CLK_FIC1, "clk_periph_fic1", PARENT_CLK(AXI), 25, CLK_IS_CRITICAL), 282 + CLK_PERIPH(CLK_FIC2, "clk_periph_fic2", PARENT_CLK(AXI), 26, CLK_IS_CRITICAL), 283 + CLK_PERIPH(CLK_FIC3, "clk_periph_fic3", PARENT_CLK(AXI), 27, CLK_IS_CRITICAL), 284 + CLK_PERIPH(CLK_ATHENA, "clk_periph_athena", PARENT_CLK(AXI), 28, CLK_IS_CRITICAL), 408 285 CLK_PERIPH(CLK_CFM, "clk_periph_cfm", PARENT_CLK(AHB), 29, 0), 409 286 }; 410 287 ··· 445 322 unsigned int num_clks; 446 323 int ret; 447 324 448 - /* CLK_RESERVED is not part of cfg_clks nor periph_clks, so add 1 */ 449 - num_clks = ARRAY_SIZE(mpfs_cfg_clks) + ARRAY_SIZE(mpfs_periph_clks) + 1; 325 + /* CLK_RESERVED is not part of clock arrays, so add 1 */ 326 + num_clks = ARRAY_SIZE(mpfs_msspll_clks) + ARRAY_SIZE(mpfs_cfg_clks) 327 + + ARRAY_SIZE(mpfs_periph_clks) + 1; 450 328 451 329 clk_data = devm_kzalloc(dev, struct_size(clk_data, hw_data.hws, num_clks), GFP_KERNEL); 452 330 if (!clk_data) ··· 457 333 if (IS_ERR(clk_data->base)) 458 334 return PTR_ERR(clk_data->base); 459 335 336 + clk_data->msspll_base = devm_platform_ioremap_resource(pdev, 1); 337 + if (IS_ERR(clk_data->msspll_base)) 338 + return PTR_ERR(clk_data->msspll_base); 339 + 460 340 clk_data->hw_data.num = num_clks; 341 + 342 + ret = mpfs_clk_register_mssplls(dev, mpfs_msspll_clks, ARRAY_SIZE(mpfs_msspll_clks), 343 + clk_data); 344 + if (ret) 345 + return ret; 461 346 462 347 ret = mpfs_clk_register_cfgs(dev, mpfs_cfg_clks, ARRAY_SIZE(mpfs_cfg_clks), clk_data); 463 348 if (ret)
+1 -1
drivers/clk/qcom/clk-rcg2.c
··· 818 818 static int clk_gfx3d_determine_rate(struct clk_hw *hw, 819 819 struct clk_rate_request *req) 820 820 { 821 - struct clk_rate_request parent_req = { }; 821 + struct clk_rate_request parent_req = { .min_rate = 0, .max_rate = ULONG_MAX }; 822 822 struct clk_rcg2_gfx3d *cgfx = to_clk_rcg2_gfx3d(hw); 823 823 struct clk_hw *xo, *p0, *p1, *p2; 824 824 unsigned long p0_rate;
+2
drivers/clk/sunxi-ng/ccu-sun6i-rtc.c
··· 241 241 .ops = &ccu_mux_ops, 242 242 .parent_hws = rtc_32k_parents, 243 243 .num_parents = ARRAY_SIZE(rtc_32k_parents), /* updated during probe */ 244 + .flags = CLK_IS_CRITICAL, 244 245 }; 245 246 246 247 static struct ccu_mux rtc_32k_clk = { ··· 347 346 .compatible = "allwinner,sun50i-r329-rtc", 348 347 .data = &sun50i_r329_rtc_ccu_data, 349 348 }, 349 + {}, 350 350 }; 351 351 352 352 int sun6i_rtc_ccu_probe(struct device *dev, void __iomem *reg)
+2
drivers/clk/sunxi/clk-sun9i-mmc.c
··· 109 109 spin_lock_init(&data->lock); 110 110 111 111 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 112 + if (!r) 113 + return -EINVAL; 112 114 /* one clock/reset pair per word */ 113 115 count = DIV_ROUND_UP((resource_size(r)), SUN9I_MMC_WIDTH); 114 116 data->membase = devm_ioremap_resource(&pdev->dev, r);
+4 -1
include/dt-bindings/clock/microchip,mpfs-clock.h
··· 1 1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 2 /* 3 3 * Daire McNamara,<daire.mcnamara@microchip.com> 4 - * Copyright (C) 2020 Microchip Technology Inc. All rights reserved. 4 + * Copyright (C) 2020-2022 Microchip Technology Inc. All rights reserved. 5 5 */ 6 6 7 7 #ifndef _DT_BINDINGS_CLK_MICROCHIP_MPFS_H_ ··· 41 41 #define CLK_FIC3 30 42 42 #define CLK_ATHENA 31 43 43 #define CLK_CFM 32 44 + 45 + #define CLK_RTCREF 33 46 + #define CLK_MSSPLL 34 44 47 45 48 #endif /* _DT_BINDINGS_CLK_MICROCHIP_MPFS_H_ */