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
2424 #define CLK_SET_RATE_PARENT BIT(2) /* propagate rate change up one level */
2525 #define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */
2626 /* unused */
27−#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */
27+ /* unused */
2828 #define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */
2929 #define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate change */
3030 #define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */
@@ -250,6 +250,20 @@ struct clk_ops { · 219 unmodified lines
250250 void (*debug_init)(struct clk_hw *hw, struct dentry *dentry);
251251 };
252252
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+ */
260+struct clk_parent_data {
261+ const struct clk_hw *hw;
262+ const char *fw_name;
263+ const char *name;
264+ int index;
265+};
266+
253267 /**
254268 * struct clk_init_data - holds init data that's common to all clocks and is
255269 * shared between the clock provider and the common clock framework.
@@ -257,13 +271,20 @@ struct clk_ops { · 1 unmodified line
257271 * @name: clock name
258272 * @ops: operations this clock supports
259273 * @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)
260278 * @num_parents: number of possible parents
261279 * @flags: framework-level hints and quirks
262280 */
263281 struct clk_init_data {
264282 const char *name;
265283 const struct clk_ops *ops;
284+ /* Only one of the following three should be assigned */
266285 const char * const *parent_names;
286+ const struct clk_parent_data *parent_data;
287+ const struct clk_hw **parent_hws;
267288 u8 num_parents;
268289 unsigned long flags;
269290 };
@@ -307,7 +328,6 @@ struct clk_fixed_rate { · 37 unmodified lines
307328 struct clk_hw hw;
308329 unsigned long fixed_rate;
309330 unsigned long fixed_accuracy;
310− u8 flags;
311331 };
312332
313333 #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
349369 * of this register, and mask of gate bits are in higher 16-bit of this
350370 * register. While setting the gate bits, higher 16-bit should also be
351371 * 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.
352375 */
353376 struct clk_gate {
354377 struct clk_hw hw;
@@ -362,6 +385,7 @@ struct clk_gate { · 7 unmodified lines
362385
363386 #define CLK_GATE_SET_TO_DISABLE BIT(0)
364387 #define CLK_GATE_HIWORD_MASK BIT(1)
388+#define CLK_GATE_BIG_ENDIAN BIT(2)
365389
366390 extern const struct clk_ops clk_gate_ops;
367391 struct clk *clk_register_gate(struct device *dev, const char *name,
@@ -417,6 +441,9 @@ struct clk_div_table { · 49 unmodified lines
417441 * CLK_DIVIDER_MAX_AT_ZERO - For dividers which are like CLK_DIVIDER_ONE_BASED
418442 * except when the value read from the register is zero, the divisor is
419443 * 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.
420447 */
421448 struct clk_divider {
422449 struct clk_hw hw;
@@ -438,6 +465,7 @@ struct clk_divider { · 15 unmodified lines
438465 #define CLK_DIVIDER_ROUND_CLOSEST BIT(4)
439466 #define CLK_DIVIDER_READ_ONLY BIT(5)
440467 #define CLK_DIVIDER_MAX_AT_ZERO BIT(6)
468+#define CLK_DIVIDER_BIG_ENDIAN BIT(7)
441469
442470 extern const struct clk_ops clk_divider_ops;
443471 extern const struct clk_ops clk_divider_ro_ops;
@@ -499,8 +527,13 @@ void clk_hw_unregister_divider(struct clk_hw *hw); · 55 unmodified lines
499527 * register, and mask of mux bits are in higher 16-bit of this register.
500528 * While setting the mux bits, higher 16-bit should also be updated to
501529 * 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.
502532 * CLK_MUX_ROUND_CLOSEST - Use the parent rate that is closest to the desired
503533 * 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.
504537 */
505538 struct clk_mux {
506539 struct clk_hw hw;
@@ -519,6 +552,7 @@ struct clk_mux { · 12 unmodified lines
519552 #define CLK_MUX_HIWORD_MASK BIT(2)
520553 #define CLK_MUX_READ_ONLY BIT(3) /* mux can't be changed */
521554 #define CLK_MUX_ROUND_CLOSEST BIT(4)
555+#define CLK_MUX_BIG_ENDIAN BIT(5)
522556
523557 extern const struct clk_ops clk_mux_ops;
524558 extern 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
602636 * is the value read from the register. If CLK_FRAC_DIVIDER_ZERO_BASED
603637 * is set then the numerator and denominator are both the value read
604638 * 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.
605642 */
606643 struct clk_fractional_divider {
607644 struct clk_hw hw;
@@ -622,6 +659,7 @@ struct clk_fractional_divider { · 14 unmodified lines
622659 #define to_clk_fd(_hw) container_of(_hw, struct clk_fractional_divider, hw)
623660
624661 #define CLK_FRAC_DIVIDER_ZERO_BASED BIT(0)
662+#define CLK_FRAC_DIVIDER_BIG_ENDIAN BIT(1)
625663
626664 extern const struct clk_ops clk_fractional_divider_ops;
627665 struct 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
654692 * leaving the parent rate unmodified.
655693 * CLK_MULTIPLIER_ROUND_CLOSEST - Makes the best calculated divider to be
656694 * 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.
657698 */
658699 struct clk_multiplier {
659700 struct clk_hw hw;
@@ -668,6 +709,7 @@ struct clk_multiplier { · 8 unmodified lines
668709
669710 #define CLK_MULTIPLIER_ZERO_BYPASS BIT(0)
670711 #define CLK_MULTIPLIER_ROUND_CLOSEST BIT(1)
712+#define CLK_MULTIPLIER_BIG_ENDIAN BIT(2)
671713
672714 extern const struct clk_ops clk_multiplier_ops;
673715
@@ -712,16 +754,19 @@ struct clk_hw *clk_hw_register_composite(struct device *dev, const char *name, · 38 unmodified lines
712754 unsigned long flags);
713755 void clk_hw_unregister_composite(struct clk_hw *hw);
714756
715−/***
716− * struct clk_gpio_gate - gpio gated clock
757+/**
758+ * struct clk_gpio - gpio gated clock
717759 *
718760 * @hw: handle between common and hardware-specific interfaces
719761 * @gpiod: gpio descriptor
720762 *
721− * Clock with a gpio control for enabling and disabling the parent clock.
722− * Implements .enable, .disable and .is_enabled
763+ * Clock with a gpio control for enabling and disabling the parent clock
764+ * 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.
723769 */
724−
725770 struct clk_gpio {
726771 struct clk_hw hw;
727772 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
738783 unsigned long flags);
739784 void clk_hw_unregister_gpio_gate(struct clk_hw *hw);
740785
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−
751786 extern const struct clk_ops clk_gpio_mux_ops;
752787 struct clk *clk_register_gpio_mux(struct device *dev, const char *name,
753788 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
757792 unsigned long flags);
758793 void clk_hw_unregister_gpio_mux(struct clk_hw *hw);
759794
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− */
771795 struct clk *clk_register(struct device *dev, struct clk_hw *hw);
772796 struct clk *devm_clk_register(struct device *dev, struct clk_hw *hw);
773797
774798 int __must_check clk_hw_register(struct device *dev, struct clk_hw *hw);
775799 int __must_check devm_clk_hw_register(struct device *dev, struct clk_hw *hw);
800+int __must_check of_clk_hw_register(struct device_node *node, struct clk_hw *hw);
776801
777802 void clk_unregister(struct clk *clk);
778803 void 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
9931018 }
9941019 #endif /* CONFIG_OF */
9951020
996−/*
997− * wrap access to peripherals in accessor routines
998− * for improved portability across platforms
999− */
1000−
1001−#if IS_ENABLED(CONFIG_PPC)
1002−
1003−static inline u32 clk_readl(u32 __iomem *reg)
1004−{
1005− return ioread32be(reg);
1006−}
1007−
1008−static inline void clk_writel(u32 val, u32 __iomem *reg)
1009−{
1010− iowrite32be(val, reg);
1011−}
1012−
1013−#else /* platform dependent I/O accessors */
1014−
1015−static inline u32 clk_readl(u32 __iomem *reg)
1016−{
1017− return readl(reg);
1018−}
1019−
1020−static inline void clk_writel(u32 val, u32 __iomem *reg)
1021−{
1022− writel(val, reg);
1023−}
1024−
1025−#endif /* platform dependent I/O accessors */
1026−
10271021 void clk_gate_restore_context(struct clk_hw *hw);
10281022
10291023 #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+ */
58+struct 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+
71+int wrpll_configure_for_rate(struct wrpll_cfg *c, u32 target_rate,
72+ unsigned long parent_rate);
73+
74+unsigned int wrpll_calc_max_lock_us(const struct wrpll_cfg *c);
75+
76+unsigned 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
7474 #define AT91_PMC_USBDIV_4 (2 << 28)
7575 #define AT91_PMC_USB96M (1 << 28) /* Divider by 2 Enable (PLLB only) */
7676
77+#define AT91_PMC_CPU_CKR 0x28 /* CPU Clock Register */
78+
7779 #define AT91_PMC_MCKR 0x30 /* Master Clock Register */
7880 #define AT91_PMC_CSS (3 << 0) /* Master Clock Selection */
7981 #define AT91_PMC_CSS_SLOW (0 << 0)
@@ -187,16 +189,8 @@ · 107 unmodified lines
187189
188190 #define AT91_PMC_PCR 0x10c /* Peripheral Control Register [some SAM9 and SAMA5] */
189191 #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 */
193192 #define AT91_PMC_PCR_CMD (0x1 << 12) /* Command (read=0, write=1) */
194−#define AT91_PMC_PCR_DIV_OFFSET 16
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 */
193+#define AT91_PMC_PCR_GCKDIV_MASK GENMASK(27, 20)
200194 #define AT91_PMC_PCR_EN (0x1 << 28) /* Enable */
201195 #define AT91_PMC_PCR_GCKEN (0x1 << 29) /* GCK Enable */
202196
include/linux/clk/ti.h+2−0
@@ -243,6 +243,7 @@ struct ti_clk_ll_ops { · 242 unmodified lines
243243
244244 #define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw)
245245
246+bool omap2_clk_is_hw_omap(struct clk_hw *hw);
246247 int omap2_clk_disable_autoidle_all(void);
247248 int omap2_clk_enable_autoidle_all(void);
248249 int omap2_clk_allow_idle(struct clk *clk);
@@ -293,6 +294,7 @@ struct ti_clk_features { · 44 unmodified lines
293294 #define TI_CLK_DISABLE_CLKDM_CONTROL BIT(2)
294295 #define TI_CLK_ERRATA_I810 BIT(3)
295296 #define TI_CLK_CLKCTRL_COMPAT BIT(4)
297+#define TI_CLK_DEVICE_TYPE_GP BIT(5)
296298
297299 void ti_clk_setup_features(struct ti_clk_features *features);
298300 const 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
12291229
12301230 static inline struct device_node *dev_of_node(struct device *dev)
12311231 {
1232− if (!IS_ENABLED(CONFIG_OF))
1232+ if (!IS_ENABLED(CONFIG_OF) || !dev)
12331233 return NULL;
12341234 return dev->of_node;
12351235 }
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
284284 #define DIV64_U64_ROUND_UP(ll, d) \
285285 ({ u64 _tmp = (d); div64_u64((ll) + _tmp - 1, _tmp); })
286286
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+
287300 #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