History

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

Pull clk framework updates from Stephen Boyd: "We have a couple new features and changes in the core clk framework this time around because we've finally gotten around to fixing some long standing issues. There's still work to do though, so this pull request is largely laying down the foundation for all the driver changes to come in the next merge window. The first problem we're alleviating is how parents of clks are specified. With the new method, we should see lots of drivers migrate away from the current design of string comparisons on the entire clk tree to a more direct method where they can use clk_hw pointers or more localized names specified in DT or via clkdev. This should reduce our reliance on string comparisons for all the topology description logic that we've been using for years and hopefully speed some things up while avoiding problems we have with generating clk names. Beyond that we also got rid of the CLK_IS_BASIC flag because it wasn't really helping anyone and we introduced big-endian versions of the basic clk types so that we can get rid of clk_{readl,writel}(). Both of these are things that driver developers have tried to use over the years that I typically bat away during code reviews because they're not useful. It's great to see these two things go away so maintainers can save time not worrying about these things. On the driver side we got the usual collection of new SoC support and non-critical fixes and updates to existing code. The big topics that stand out are the new driver support for Mediatek MT8183 and MT8516 SoCs, Amlogic Meson8b and G12a SoCs, and the SiFive FU540 SoC. The other patches in the driver pile are mostly fixes for things that are being used for the first time or additions for clks that couldn't be tested before because there wasn't a consumer driver that exercised them. Details are below and also in the sub-maintainer tags. Core: - Remove clk_readl() and introduce BE versions of basic clk types - Rewrite how clk parents can be specified to allow DT/clkdev lookups - Removal of the CLK_IS_BASIC clk flag - Framework documentation updates and fixes New Drivers: - Support for STM32F769 - AT91 sam9x60 PMC support - SiFive FU540 PRCI and PLL support - Qualcomm QCS404 CDSP clk support - Qualcomm QCS404 Turing clk support - Mediatek MT8183 clock support - Mediatek MT8516 clock support - Milbeaut M10V clk controller support - Support for Cirrus Logic Lochnagar clks Updates: - Rework AT91 sckc DT bindings - Fix slow RC oscillator issue on sama5d3 - Mark UFS clk as critical on Hi-Silicon hi3660 SoCs - Various static analysis fixes/finds and const markings - Video Engine (ECLK) support on Aspeed SoCs - Xilinx ZynqMP Versal platform support - Convert Xilinx ZynqMP driver to be struct oriented - Fixes for Rockchip rk3328 and rk3288 SoCs - Sub-type for Rockchip SoCs where mux and divider aren't a single register - Remove SNVS clock from i.MX7UPL clock driver and bindings - Improve i.MX5 clock driver for i.MX50 support - Addition of ADC clock definition for Exynos 5410 SoC (Odroid XU) - Export a new clock for the MBUS controller on the A13 - Allwinner H6 fixes to support a finer clocking of the video and VPU engines - Add g12a support in the Amlogic axg audio clock controller - Add missing PCI USB clock on Rensas RZ/N1 - Add Z2 (Cortex-A53) clocks on Rensas R-Car E3 and RZ/G2E - A new helper DIV64_U64_ROUND_CLOSEST() in <linux/math64.h> - VPU and Video Decoder clocks on Amlogic Meson8b - Finally remove the wrong ABP Meson8b clock id - Add Video Decoder, PCIe PLL, and CPU Clocks on Amlogic G12A - Re-expose SAR_ADC_SEL and CTS_OSCIN on Amlogic G12A AO clock controller - Un-expose some Amlogic AXG-Audio input clocks IDs" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (172 commits) clk: Cache core in clk_fetch_parent_index() without names clk: imx: correct pfdv2 gate_bit/vld_bit operations clk: sifive: add a driver for the SiFive FU540 PRCI IP block clk: analogbits: add Wide-Range PLL library clk: imx: clk-pllv3: mark expected switch fall-throughs clk: imx8mq: Add dsi_ipg_div clk: imx: pllv4: add fractional-N pll support clk: sunxi-ng: Use the correct style for SPDX License Identifier clk: sprd: Use the correct style for SPDX License Identifier clk: renesas: Use the correct style for SPDX License Identifier clk: qcom: Use the correct style for SPDX License Identifier clk: davinci: Use the correct style for SPDX License Identifier clk: actions: Use the correct style for SPDX License Identifier clk: imx: keep uart clock on during system boot clk: imx: correct i.MX7D AV PLL num/denom offset dt-bindings: clk: add documentation for the SiFive PRCI driver clk: stm32mp1: Add ddrperfm clock clk: Remove CLK_IS_BASIC clk flag clock: milbeaut: Add Milbeaut M10V clock controller dt-bindings: clock: milbeaut: add Milbeaut clock description ...

Linus Torvalds committed 7 years ago

Commit ea5aee62 parents 8e4ff71 c1157f6214 files · +11543 −1465Browse files

Showing the changes to include/linux (6 of 214 files). Show all

Unified · Split

6 files
  1. include/linux/clk-provider.h +53 −59
  2. include/linux/clk/analogbits-wrpll-cln28hpc.h +79 −0
  3. include/linux/clk/at91_pmc.h +3 −9
  4. include/linux/clk/ti.h +2 −0
  5. include/linux/device.h +1 −1
  6. include/linux/math64.h +13 −0
include/linux/clk-provider.h+53−59
@@ -24,7 +24,7 @@ · 23 unmodified lines
24#define CLK_SET_RATE_PARENT BIT(2) /* propagate rate change up one level */24#define CLK_SET_RATE_PARENT BIT(2) /* propagate rate change up one level */
25#define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */25#define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */
26 /* unused */26 /* unused */
27#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */27 /* unused */
28#define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */28#define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */
29#define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate change */29#define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate change */
30#define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */30#define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */
@@ -250,6 +250,20 @@ struct clk_ops { · 219 unmodified lines
250 void (*debug_init)(struct clk_hw *hw, struct dentry *dentry);250 void (*debug_init)(struct clk_hw *hw, struct dentry *dentry);
251};251};
252 252
253/**
254 * struct clk_parent_data - clk parent information
255 * @hw: parent clk_hw pointer (used for clk providers with internal clks)
256 * @fw_name: parent name local to provider registering clk
257 * @name: globally unique parent name (used as a fallback)
258 * @index: parent index local to provider registering clk (if @fw_name absent)
259 */
260struct clk_parent_data {
261 const struct clk_hw *hw;
262 const char *fw_name;
263 const char *name;
264 int index;
265};
266
253/**267/**
254 * struct clk_init_data - holds init data that's common to all clocks and is268 * struct clk_init_data - holds init data that's common to all clocks and is
255 * shared between the clock provider and the common clock framework.269 * shared between the clock provider and the common clock framework.
@@ -257,13 +271,20 @@ struct clk_ops { · 1 unmodified line
257 * @name: clock name271 * @name: clock name
258 * @ops: operations this clock supports272 * @ops: operations this clock supports
259 * @parent_names: array of string names for all possible parents273 * @parent_names: array of string names for all possible parents
274 * @parent_data: array of parent data for all possible parents (when some
275 * parents are external to the clk controller)
276 * @parent_hws: array of pointers to all possible parents (when all parents
277 * are internal to the clk controller)
260 * @num_parents: number of possible parents278 * @num_parents: number of possible parents
261 * @flags: framework-level hints and quirks279 * @flags: framework-level hints and quirks
262 */280 */
263struct clk_init_data {281struct clk_init_data {
264 const char *name;282 const char *name;
265 const struct clk_ops *ops;283 const struct clk_ops *ops;
284 /* Only one of the following three should be assigned */
266 const char * const *parent_names;285 const char * const *parent_names;
286 const struct clk_parent_data *parent_data;
287 const struct clk_hw **parent_hws;
267 u8 num_parents;288 u8 num_parents;
268 unsigned long flags;289 unsigned long flags;
269};290};
@@ -307,7 +328,6 @@ struct clk_fixed_rate { · 37 unmodified lines
307 struct clk_hw hw;328 struct clk_hw hw;
308 unsigned long fixed_rate;329 unsigned long fixed_rate;
309 unsigned long fixed_accuracy;330 unsigned long fixed_accuracy;
310 u8 flags;
311};331};
312 332
313#define to_clk_fixed_rate(_hw) container_of(_hw, struct clk_fixed_rate, hw)333#define to_clk_fixed_rate(_hw) container_of(_hw, struct clk_fixed_rate, hw)
@@ -349,6 +369,9 @@ void of_fixed_clk_setup(struct device_node *np); · 35 unmodified lines
349 * of this register, and mask of gate bits are in higher 16-bit of this369 * of this register, and mask of gate bits are in higher 16-bit of this
350 * register. While setting the gate bits, higher 16-bit should also be370 * register. While setting the gate bits, higher 16-bit should also be
351 * updated to indicate changing gate bits.371 * updated to indicate changing gate bits.
372 * CLK_GATE_BIG_ENDIAN - by default little endian register accesses are used for
373 * the gate register. Setting this flag makes the register accesses big
374 * endian.
352 */375 */
353struct clk_gate {376struct clk_gate {
354 struct clk_hw hw;377 struct clk_hw hw;
@@ -362,6 +385,7 @@ struct clk_gate { · 7 unmodified lines
362 385
363#define CLK_GATE_SET_TO_DISABLE BIT(0)386#define CLK_GATE_SET_TO_DISABLE BIT(0)
364#define CLK_GATE_HIWORD_MASK BIT(1)387#define CLK_GATE_HIWORD_MASK BIT(1)
388#define CLK_GATE_BIG_ENDIAN BIT(2)
365 389
366extern const struct clk_ops clk_gate_ops;390extern const struct clk_ops clk_gate_ops;
367struct clk *clk_register_gate(struct device *dev, const char *name,391struct clk *clk_register_gate(struct device *dev, const char *name,
@@ -417,6 +441,9 @@ struct clk_div_table { · 49 unmodified lines
417 * CLK_DIVIDER_MAX_AT_ZERO - For dividers which are like CLK_DIVIDER_ONE_BASED441 * CLK_DIVIDER_MAX_AT_ZERO - For dividers which are like CLK_DIVIDER_ONE_BASED
418 * except when the value read from the register is zero, the divisor is442 * except when the value read from the register is zero, the divisor is
419 * 2^width of the field.443 * 2^width of the field.
444 * CLK_DIVIDER_BIG_ENDIAN - By default little endian register accesses are used
445 * for the divider register. Setting this flag makes the register accesses
446 * big endian.
420 */447 */
421struct clk_divider {448struct clk_divider {
422 struct clk_hw hw;449 struct clk_hw hw;
@@ -438,6 +465,7 @@ struct clk_divider { · 15 unmodified lines
438#define CLK_DIVIDER_ROUND_CLOSEST BIT(4)465#define CLK_DIVIDER_ROUND_CLOSEST BIT(4)
439#define CLK_DIVIDER_READ_ONLY BIT(5)466#define CLK_DIVIDER_READ_ONLY BIT(5)
440#define CLK_DIVIDER_MAX_AT_ZERO BIT(6)467#define CLK_DIVIDER_MAX_AT_ZERO BIT(6)
468#define CLK_DIVIDER_BIG_ENDIAN BIT(7)
441 469
442extern const struct clk_ops clk_divider_ops;470extern const struct clk_ops clk_divider_ops;
443extern const struct clk_ops clk_divider_ro_ops;471extern const struct clk_ops clk_divider_ro_ops;
@@ -499,8 +527,13 @@ void clk_hw_unregister_divider(struct clk_hw *hw); · 55 unmodified lines
499 * register, and mask of mux bits are in higher 16-bit of this register.527 * register, and mask of mux bits are in higher 16-bit of this register.
500 * While setting the mux bits, higher 16-bit should also be updated to528 * While setting the mux bits, higher 16-bit should also be updated to
501 * indicate changing mux bits.529 * indicate changing mux bits.
530 * CLK_MUX_READ_ONLY - The mux registers can't be written, only read in the
531 * .get_parent clk_op.
502 * CLK_MUX_ROUND_CLOSEST - Use the parent rate that is closest to the desired532 * CLK_MUX_ROUND_CLOSEST - Use the parent rate that is closest to the desired
503 * frequency.533 * frequency.
534 * CLK_MUX_BIG_ENDIAN - By default little endian register accesses are used for
535 * the mux register. Setting this flag makes the register accesses big
536 * endian.
504 */537 */
505struct clk_mux {538struct clk_mux {
506 struct clk_hw hw;539 struct clk_hw hw;
@@ -519,6 +552,7 @@ struct clk_mux { · 12 unmodified lines
519#define CLK_MUX_HIWORD_MASK BIT(2)552#define CLK_MUX_HIWORD_MASK BIT(2)
520#define CLK_MUX_READ_ONLY BIT(3) /* mux can't be changed */553#define CLK_MUX_READ_ONLY BIT(3) /* mux can't be changed */
521#define CLK_MUX_ROUND_CLOSEST BIT(4)554#define CLK_MUX_ROUND_CLOSEST BIT(4)
555#define CLK_MUX_BIG_ENDIAN BIT(5)
522 556
523extern const struct clk_ops clk_mux_ops;557extern const struct clk_ops clk_mux_ops;
524extern const struct clk_ops clk_mux_ro_ops;558extern const struct clk_ops clk_mux_ro_ops;
@@ -602,6 +636,9 @@ void clk_hw_unregister_fixed_factor(struct clk_hw *hw); · 77 unmodified lines
602 * is the value read from the register. If CLK_FRAC_DIVIDER_ZERO_BASED636 * is the value read from the register. If CLK_FRAC_DIVIDER_ZERO_BASED
603 * is set then the numerator and denominator are both the value read637 * is set then the numerator and denominator are both the value read
604 * plus one.638 * plus one.
639 * CLK_FRAC_DIVIDER_BIG_ENDIAN - By default little endian register accesses are
640 * used for the divider register. Setting this flag makes the register
641 * accesses big endian.
605 */642 */
606struct clk_fractional_divider {643struct clk_fractional_divider {
607 struct clk_hw hw;644 struct clk_hw hw;
@@ -622,6 +659,7 @@ struct clk_fractional_divider { · 14 unmodified lines
622#define to_clk_fd(_hw) container_of(_hw, struct clk_fractional_divider, hw)659#define to_clk_fd(_hw) container_of(_hw, struct clk_fractional_divider, hw)
623 660
624#define CLK_FRAC_DIVIDER_ZERO_BASED BIT(0)661#define CLK_FRAC_DIVIDER_ZERO_BASED BIT(0)
662#define CLK_FRAC_DIVIDER_BIG_ENDIAN BIT(1)
625 663
626extern const struct clk_ops clk_fractional_divider_ops;664extern const struct clk_ops clk_fractional_divider_ops;
627struct clk *clk_register_fractional_divider(struct device *dev,665struct clk *clk_register_fractional_divider(struct device *dev,
@@ -654,6 +692,9 @@ void clk_hw_unregister_fractional_divider(struct clk_hw *hw); · 26 unmodified lines
654 * leaving the parent rate unmodified.692 * leaving the parent rate unmodified.
655 * CLK_MULTIPLIER_ROUND_CLOSEST - Makes the best calculated divider to be693 * CLK_MULTIPLIER_ROUND_CLOSEST - Makes the best calculated divider to be
656 * rounded to the closest integer instead of the down one.694 * rounded to the closest integer instead of the down one.
695 * CLK_MULTIPLIER_BIG_ENDIAN - By default little endian register accesses are
696 * used for the multiplier register. Setting this flag makes the register
697 * accesses big endian.
657 */698 */
658struct clk_multiplier {699struct clk_multiplier {
659 struct clk_hw hw;700 struct clk_hw hw;
@@ -668,6 +709,7 @@ struct clk_multiplier { · 8 unmodified lines
668 709
669#define CLK_MULTIPLIER_ZERO_BYPASS BIT(0)710#define CLK_MULTIPLIER_ZERO_BYPASS BIT(0)
670#define CLK_MULTIPLIER_ROUND_CLOSEST BIT(1)711#define CLK_MULTIPLIER_ROUND_CLOSEST BIT(1)
712#define CLK_MULTIPLIER_BIG_ENDIAN BIT(2)
671 713
672extern const struct clk_ops clk_multiplier_ops;714extern const struct clk_ops clk_multiplier_ops;
673 715
@@ -712,16 +754,19 @@ struct clk_hw *clk_hw_register_composite(struct device *dev, const char *name, · 38 unmodified lines
712 unsigned long flags);754 unsigned long flags);
713void clk_hw_unregister_composite(struct clk_hw *hw);755void clk_hw_unregister_composite(struct clk_hw *hw);
714 756
715/***757/**
716 * struct clk_gpio_gate - gpio gated clock758 * struct clk_gpio - gpio gated clock
717 *759 *
718 * @hw: handle between common and hardware-specific interfaces760 * @hw: handle between common and hardware-specific interfaces
719 * @gpiod: gpio descriptor761 * @gpiod: gpio descriptor
720 *762 *
721 * Clock with a gpio control for enabling and disabling the parent clock.763 * Clock with a gpio control for enabling and disabling the parent clock
722 * Implements .enable, .disable and .is_enabled764 * or switching between two parents by asserting or deasserting the gpio.
765 *
766 * Implements .enable, .disable and .is_enabled or
767 * .get_parent, .set_parent and .determine_rate depending on which clk_ops
768 * is used.
723 */769 */
724
725struct clk_gpio {770struct clk_gpio {
726 struct clk_hw hw;771 struct clk_hw hw;
727 struct gpio_desc *gpiod;772 struct gpio_desc *gpiod;
@@ -738,16 +783,6 @@ struct clk_hw *clk_hw_register_gpio_gate(struct device *dev, const char *name, · 10 unmodified lines
738 unsigned long flags);783 unsigned long flags);
739void clk_hw_unregister_gpio_gate(struct clk_hw *hw);784void clk_hw_unregister_gpio_gate(struct clk_hw *hw);
740 785
741/**
742 * struct clk_gpio_mux - gpio controlled clock multiplexer
743 *
744 * @hw: see struct clk_gpio
745 * @gpiod: gpio descriptor to select the parent of this clock multiplexer
746 *
747 * Clock with a gpio control for selecting the parent clock.
748 * Implements .get_parent, .set_parent and .determine_rate
749 */
750
751extern const struct clk_ops clk_gpio_mux_ops;786extern const struct clk_ops clk_gpio_mux_ops;
752struct clk *clk_register_gpio_mux(struct device *dev, const char *name,787struct clk *clk_register_gpio_mux(struct device *dev, const char *name,
753 const char * const *parent_names, u8 num_parents, struct gpio_desc *gpiod,788 const char * const *parent_names, u8 num_parents, struct gpio_desc *gpiod,
@@ -757,22 +792,12 @@ struct clk_hw *clk_hw_register_gpio_mux(struct device *dev, const char *name, · 3 unmodified lines
757 unsigned long flags);792 unsigned long flags);
758void clk_hw_unregister_gpio_mux(struct clk_hw *hw);793void clk_hw_unregister_gpio_mux(struct clk_hw *hw);
759 794
760/**
761 * clk_register - allocate a new clock, register it and return an opaque cookie
762 * @dev: device that is registering this clock
763 * @hw: link to hardware-specific clock data
764 *
765 * clk_register is the primary interface for populating the clock tree with new
766 * clock nodes. It returns a pointer to the newly allocated struct clk which
767 * cannot be dereferenced by driver code but may be used in conjuction with the
768 * rest of the clock API. In the event of an error clk_register will return an
769 * error code; drivers must test for an error code after calling clk_register.
770 */
771struct clk *clk_register(struct device *dev, struct clk_hw *hw);795struct clk *clk_register(struct device *dev, struct clk_hw *hw);
772struct clk *devm_clk_register(struct device *dev, struct clk_hw *hw);796struct clk *devm_clk_register(struct device *dev, struct clk_hw *hw);
773 797
774int __must_check clk_hw_register(struct device *dev, struct clk_hw *hw);798int __must_check clk_hw_register(struct device *dev, struct clk_hw *hw);
775int __must_check devm_clk_hw_register(struct device *dev, struct clk_hw *hw);799int __must_check devm_clk_hw_register(struct device *dev, struct clk_hw *hw);
800int __must_check of_clk_hw_register(struct device_node *node, struct clk_hw *hw);
776 801
777void clk_unregister(struct clk *clk);802void clk_unregister(struct clk *clk);
778void devm_clk_unregister(struct device *dev, struct clk *clk);803void devm_clk_unregister(struct device *dev, struct clk *clk);
@@ -993,37 +1018,6 @@ static inline int of_clk_detect_critical(struct device_node *np, int index, · 214 unmodified lines
993}1018}
994#endif /* CONFIG_OF */1019#endif /* CONFIG_OF */
995 1020
996/*
997 * wrap access to peripherals in accessor routines
998 * for improved portability across platforms
999 */
1000
1001#if IS_ENABLED(CONFIG_PPC)
1002
1003static inline u32 clk_readl(u32 __iomem *reg)
1004{
1005 return ioread32be(reg);
1006}
1007
1008static inline void clk_writel(u32 val, u32 __iomem *reg)
1009{
1010 iowrite32be(val, reg);
1011}
1012
1013#else /* platform dependent I/O accessors */
1014
1015static inline u32 clk_readl(u32 __iomem *reg)
1016{
1017 return readl(reg);
1018}
1019
1020static inline void clk_writel(u32 val, u32 __iomem *reg)
1021{
1022 writel(val, reg);
1023}
1024
1025#endif /* platform dependent I/O accessors */
1026
1027void clk_gate_restore_context(struct clk_hw *hw);1021void clk_gate_restore_context(struct clk_hw *hw);
1028 1022
1029#endif /* CONFIG_COMMON_CLK */1023#endif /* CONFIG_COMMON_CLK */
include/linux/clk/analogbits-wrpll-cln28hpc.h+79−0
@@ -0,0 +1,79 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 2018-2019 SiFive, Inc.
4 * Wesley Terpstra
5 * Paul Walmsley
6 */
7
8#ifndef __LINUX_CLK_ANALOGBITS_WRPLL_CLN28HPC_H
9#define __LINUX_CLK_ANALOGBITS_WRPLL_CLN28HPC_H
10
11#include <linux/types.h>
12
13/* DIVQ_VALUES: number of valid DIVQ values */
14#define DIVQ_VALUES 6
15
16/*
17 * Bit definitions for struct wrpll_cfg.flags
18 *
19 * WRPLL_FLAGS_BYPASS_FLAG: if set, the PLL is either in bypass, or should be
20 * programmed to enter bypass
21 * WRPLL_FLAGS_RESET_FLAG: if set, the PLL is in reset
22 * WRPLL_FLAGS_INT_FEEDBACK_FLAG: if set, the PLL is configured for internal
23 * feedback mode
24 * WRPLL_FLAGS_EXT_FEEDBACK_FLAG: if set, the PLL is configured for external
25 * feedback mode (not yet supported by this driver)
26 */
27#define WRPLL_FLAGS_BYPASS_SHIFT 0
28#define WRPLL_FLAGS_BYPASS_MASK BIT(WRPLL_FLAGS_BYPASS_SHIFT)
29#define WRPLL_FLAGS_RESET_SHIFT 1
30#define WRPLL_FLAGS_RESET_MASK BIT(WRPLL_FLAGS_RESET_SHIFT)
31#define WRPLL_FLAGS_INT_FEEDBACK_SHIFT 2
32#define WRPLL_FLAGS_INT_FEEDBACK_MASK BIT(WRPLL_FLAGS_INT_FEEDBACK_SHIFT)
33#define WRPLL_FLAGS_EXT_FEEDBACK_SHIFT 3
34#define WRPLL_FLAGS_EXT_FEEDBACK_MASK BIT(WRPLL_FLAGS_EXT_FEEDBACK_SHIFT)
35
36/**
37 * struct wrpll_cfg - WRPLL configuration values
38 * @divr: reference divider value (6 bits), as presented to the PLL signals
39 * @divf: feedback divider value (9 bits), as presented to the PLL signals
40 * @divq: output divider value (3 bits), as presented to the PLL signals
41 * @flags: PLL configuration flags. See above for more information
42 * @range: PLL loop filter range. See below for more information
43 * @output_rate_cache: cached output rates, swept across DIVQ
44 * @parent_rate: PLL refclk rate for which values are valid
45 * @max_r: maximum possible R divider value, given @parent_rate
46 * @init_r: initial R divider value to start the search from
47 *
48 * @divr, @divq, @divq, @range represent what the PLL expects to see
49 * on its input signals. Thus @divr and @divf are the actual divisors
50 * minus one. @divq is a power-of-two divider; for example, 1 =
51 * divide-by-2 and 6 = divide-by-64. 0 is an invalid @divq value.
52 *
53 * When initially passing a struct wrpll_cfg record, the
54 * record should be zero-initialized with the exception of the @flags
55 * field. The only flag bits that need to be set are either
56 * WRPLL_FLAGS_INT_FEEDBACK or WRPLL_FLAGS_EXT_FEEDBACK.
57 */
58struct wrpll_cfg {
59 u8 divr;
60 u8 divq;
61 u8 range;
62 u8 flags;
63 u16 divf;
64/* private: */
65 u32 output_rate_cache[DIVQ_VALUES];
66 unsigned long parent_rate;
67 u8 max_r;
68 u8 init_r;
69};
70
71int wrpll_configure_for_rate(struct wrpll_cfg *c, u32 target_rate,
72 unsigned long parent_rate);
73
74unsigned int wrpll_calc_max_lock_us(const struct wrpll_cfg *c);
75
76unsigned long wrpll_calc_output_rate(const struct wrpll_cfg *c,
77 unsigned long parent_rate);
78
79#endif /* __LINUX_CLK_ANALOGBITS_WRPLL_CLN28HPC_H */
include/linux/clk/at91_pmc.h+3−9
@@ -74,6 +74,8 @@ · 73 unmodified lines
74#define AT91_PMC_USBDIV_4 (2 << 28)74#define AT91_PMC_USBDIV_4 (2 << 28)
75#define AT91_PMC_USB96M (1 << 28) /* Divider by 2 Enable (PLLB only) */75#define AT91_PMC_USB96M (1 << 28) /* Divider by 2 Enable (PLLB only) */
76 76
77#define AT91_PMC_CPU_CKR 0x28 /* CPU Clock Register */
78
77#define AT91_PMC_MCKR 0x30 /* Master Clock Register */79#define AT91_PMC_MCKR 0x30 /* Master Clock Register */
78#define AT91_PMC_CSS (3 << 0) /* Master Clock Selection */80#define AT91_PMC_CSS (3 << 0) /* Master Clock Selection */
79#define AT91_PMC_CSS_SLOW (0 << 0)81#define AT91_PMC_CSS_SLOW (0 << 0)
@@ -187,16 +189,8 @@ · 107 unmodified lines
187 189
188#define AT91_PMC_PCR 0x10c /* Peripheral Control Register [some SAM9 and SAMA5] */190#define AT91_PMC_PCR 0x10c /* Peripheral Control Register [some SAM9 and SAMA5] */
189#define AT91_PMC_PCR_PID_MASK 0x3f191#define AT91_PMC_PCR_PID_MASK 0x3f
190#define AT91_PMC_PCR_GCKCSS_OFFSET 8
191#define AT91_PMC_PCR_GCKCSS_MASK (0x7 << AT91_PMC_PCR_GCKCSS_OFFSET)
192#define AT91_PMC_PCR_GCKCSS(n) ((n) << AT91_PMC_PCR_GCKCSS_OFFSET) /* GCK Clock Source Selection */
193#define AT91_PMC_PCR_CMD (0x1 << 12) /* Command (read=0, write=1) */192#define AT91_PMC_PCR_CMD (0x1 << 12) /* Command (read=0, write=1) */
194#define AT91_PMC_PCR_DIV_OFFSET 16193#define AT91_PMC_PCR_GCKDIV_MASK GENMASK(27, 20)
195#define AT91_PMC_PCR_DIV_MASK (0x3 << AT91_PMC_PCR_DIV_OFFSET)
196#define AT91_PMC_PCR_DIV(n) ((n) << AT91_PMC_PCR_DIV_OFFSET) /* Divisor Value */
197#define AT91_PMC_PCR_GCKDIV_OFFSET 20
198#define AT91_PMC_PCR_GCKDIV_MASK (0xff << AT91_PMC_PCR_GCKDIV_OFFSET)
199#define AT91_PMC_PCR_GCKDIV(n) ((n) << AT91_PMC_PCR_GCKDIV_OFFSET) /* Generated Clock Divisor Value */
200#define AT91_PMC_PCR_EN (0x1 << 28) /* Enable */194#define AT91_PMC_PCR_EN (0x1 << 28) /* Enable */
201#define AT91_PMC_PCR_GCKEN (0x1 << 29) /* GCK Enable */195#define AT91_PMC_PCR_GCKEN (0x1 << 29) /* GCK Enable */
202 196
include/linux/clk/ti.h+2−0
@@ -243,6 +243,7 @@ struct ti_clk_ll_ops { · 242 unmodified lines
243 243
244#define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw)244#define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw)
245 245
246bool omap2_clk_is_hw_omap(struct clk_hw *hw);
246int omap2_clk_disable_autoidle_all(void);247int omap2_clk_disable_autoidle_all(void);
247int omap2_clk_enable_autoidle_all(void);248int omap2_clk_enable_autoidle_all(void);
248int omap2_clk_allow_idle(struct clk *clk);249int omap2_clk_allow_idle(struct clk *clk);
@@ -293,6 +294,7 @@ struct ti_clk_features { · 44 unmodified lines
293#define TI_CLK_DISABLE_CLKDM_CONTROL BIT(2)294#define TI_CLK_DISABLE_CLKDM_CONTROL BIT(2)
294#define TI_CLK_ERRATA_I810 BIT(3)295#define TI_CLK_ERRATA_I810 BIT(3)
295#define TI_CLK_CLKCTRL_COMPAT BIT(4)296#define TI_CLK_CLKCTRL_COMPAT BIT(4)
297#define TI_CLK_DEVICE_TYPE_GP BIT(5)
296 298
297void ti_clk_setup_features(struct ti_clk_features *features);299void ti_clk_setup_features(struct ti_clk_features *features);
298const struct ti_clk_features *ti_clk_get_features(void);300const struct ti_clk_features *ti_clk_get_features(void);
include/linux/device.h+1−1
@@ -1229,7 +1229,7 @@ static inline void device_lock_assert(struct device *dev) · 1228 unmodified lines
1229 1229
1230static inline struct device_node *dev_of_node(struct device *dev)1230static inline struct device_node *dev_of_node(struct device *dev)
1231{1231{
1232 if (!IS_ENABLED(CONFIG_OF))1232 if (!IS_ENABLED(CONFIG_OF) || !dev)
1233 return NULL;1233 return NULL;
1234 return dev->of_node;1234 return dev->of_node;
1235}1235}
include/linux/math64.h+13−0
@@ -284,4 +284,17 @@ static inline u64 mul_u64_u32_div(u64 a, u32 mul, u32 divisor) · 283 unmodified lines
284#define DIV64_U64_ROUND_UP(ll, d) \284#define DIV64_U64_ROUND_UP(ll, d) \
285 ({ u64 _tmp = (d); div64_u64((ll) + _tmp - 1, _tmp); })285 ({ u64 _tmp = (d); div64_u64((ll) + _tmp - 1, _tmp); })
286 286
287/**
288 * DIV64_U64_ROUND_CLOSEST - unsigned 64bit divide with 64bit divisor rounded to nearest integer
289 * @dividend: unsigned 64bit dividend
290 * @divisor: unsigned 64bit divisor
291 *
292 * Divide unsigned 64bit dividend by unsigned 64bit divisor
293 * and round to closest integer.
294 *
295 * Return: dividend / divisor rounded to nearest integer
296 */
297#define DIV64_U64_ROUND_CLOSEST(dividend, divisor) \
298 ({ u64 _tmp = (divisor); div64_u64((dividend) + _tmp / 2, _tmp); })
299
287#endif /* _LINUX_MATH64_H */300#endif /* _LINUX_MATH64_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t