aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-04-13 18:51:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-13 18:51:06 -0400
commitca4e7c51201fc47b2668d58faaa3b46a99d1a233 (patch)
tree06e0ece281eff94ff78c11e78e036d5b61ebbe60 /include/linux
parentdaf3ef6e965d1d51d6ec604a8fc9919b75d5ec3c (diff)
parentb44c4ddf4a15c42a91a88aaa32b7d53cf43391cb (diff)
Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
Pull clk updates from Stephen Boyd: "The large diff this time around is from the addition of a new clk driver for the TI Davinci family of SoCs. So far those clks have been supported with a custom implementation of the clk API in the arch port instead of in the CCF. With this driver merged we're one step closer to having a single clk API implementation. The other large diff is from the Amlogic clk driver that underwent some major surgery to use regmap. Beyond that, the biggest hitter is Samsung which needed some reworks to properly handle clk provider power domains and a bunch of PLL rate updates. The core framework was fairly quiet this round, just getting some cleanups and small fixes for some of the more esoteric features. And the usual set of driver non-critical fixes, cleanups, and minor additions are here as well. Core: - Rejig clk_ops::init() to be a little earlier for phase/accuracy ops - debugfs ops macroized to shave some lines of boilerplate code - Always calculate the phase instead of caching it in clk_get_phase() - More __must_check on bulk clk APIs New Drivers: - TI's Davinci family of SoCs - Intel's Stratix10 SoC - stm32mp157 SoC - Allwinner H6 CCU - Silicon Labs SI544 clock generator chip - Renesas R-Car M3-N and V3H SoCs - i.MX6SLL SoCs Removed Drivers: - ST-Ericsson AB8540/9540 Updates: - Mediatek MT2701 and MT7622 audsys support and MT2712 updates - STM32F469 DSI and STM32F769 sdmmc2 support - GPIO clks can sleep now - Spreadtrum SC9860 RTC clks - Nvidia Tegra MBIST workarounds and various minor fixes - Rockchip phase handling fixes and a memory leak plugged - Renesas drivers switch to readl/writel from clk_readl/clk_writel - Renesas gained CPU (Z/Z2) and watchdog support - Rockchip rk3328 display clks and rk3399 1.6GHz PLL support - Qualcomm PM8921 PMIC XO buffers - Amlogic migrates to regmap APIs - TI Keystone clk latching support - Allwinner H3 and H5 video clk fixes - Broadcom BCM2835 PLLs needed another bit to enable - i.MX6SX CKO mux fix and i.MX7D Video PLL divider fix - i.MX6UL/ULL epdc_podf support - Hi3798CV200 COMBPHY0 and USB2_OTG_UTMI and phase support for eMMC" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (233 commits) clk: davinci: add a reset lookup table for psc0 clk: imx: add clock driver for imx6sll dt-bindings: imx: update clock doc for imx6sll clk: imx: add new gate/gate2 wrapper funtion clk: imx: Add CLK_IS_CRITICAL flag for busy divider and busy mux clk: cs2000: set pm_ops in hibernate-compatible way clk: bcm2835: De-assert/assert PLL reset signal when appropriate clk: imx7d: Move clks_init_on before any clock operations clk: imx7d: Correct ahb clk parent select clk: imx7d: Correct dram pll type clk: imx7d: Add USB clock information clk: socfpga: stratix10: add clock driver for Stratix10 platform dt-bindings: documentation: add clock bindings information for Stratix10 clk: ti: fix flag space conflict with clkctrl clocks clk: uniphier: add additional ethernet clock lines for Pro4 clk: uniphier: add SATA clock control support clk: uniphier: add PCIe clock control support clk: Add driver for the si544 clock generator chip clk: davinci: Remove redundant dev_err calls clk: uniphier: add ethernet clock control support for PXs3 ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/clk-provider.h23
-rw-r--r--include/linux/clk.h16
-rw-r--r--include/linux/clk/tegra.h1
-rw-r--r--include/linux/clk/ti.h2
-rw-r--r--include/linux/platform_data/clk-da8xx-cfgchip.h21
-rw-r--r--include/linux/platform_data/clk-davinci-pll.h21
6 files changed, 75 insertions, 9 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index f711be6e8c44..210a890008f9 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -399,6 +399,7 @@ struct clk_divider {
399 spinlock_t *lock; 399 spinlock_t *lock;
400}; 400};
401 401
402#define clk_div_mask(width) ((1 << (width)) - 1)
402#define to_clk_divider(_hw) container_of(_hw, struct clk_divider, hw) 403#define to_clk_divider(_hw) container_of(_hw, struct clk_divider, hw)
403 404
404#define CLK_DIVIDER_ONE_BASED BIT(0) 405#define CLK_DIVIDER_ONE_BASED BIT(0)
@@ -419,6 +420,10 @@ long divider_round_rate_parent(struct clk_hw *hw, struct clk_hw *parent,
419 unsigned long rate, unsigned long *prate, 420 unsigned long rate, unsigned long *prate,
420 const struct clk_div_table *table, 421 const struct clk_div_table *table,
421 u8 width, unsigned long flags); 422 u8 width, unsigned long flags);
423long divider_ro_round_rate_parent(struct clk_hw *hw, struct clk_hw *parent,
424 unsigned long rate, unsigned long *prate,
425 const struct clk_div_table *table, u8 width,
426 unsigned long flags, unsigned int val);
422int divider_get_val(unsigned long rate, unsigned long parent_rate, 427int divider_get_val(unsigned long rate, unsigned long parent_rate,
423 const struct clk_div_table *table, u8 width, 428 const struct clk_div_table *table, u8 width,
424 unsigned long flags); 429 unsigned long flags);
@@ -449,8 +454,9 @@ void clk_hw_unregister_divider(struct clk_hw *hw);
449 * 454 *
450 * @hw: handle between common and hardware-specific interfaces 455 * @hw: handle between common and hardware-specific interfaces
451 * @reg: register controlling multiplexer 456 * @reg: register controlling multiplexer
457 * @table: array of register values corresponding to the parent index
452 * @shift: shift to multiplexer bit field 458 * @shift: shift to multiplexer bit field
453 * @width: width of mutliplexer bit field 459 * @mask: mask of mutliplexer bit field
454 * @flags: hardware-specific flags 460 * @flags: hardware-specific flags
455 * @lock: register lock 461 * @lock: register lock
456 * 462 *
@@ -510,6 +516,10 @@ struct clk_hw *clk_hw_register_mux_table(struct device *dev, const char *name,
510 void __iomem *reg, u8 shift, u32 mask, 516 void __iomem *reg, u8 shift, u32 mask,
511 u8 clk_mux_flags, u32 *table, spinlock_t *lock); 517 u8 clk_mux_flags, u32 *table, spinlock_t *lock);
512 518
519int clk_mux_val_to_index(struct clk_hw *hw, u32 *table, unsigned int flags,
520 unsigned int val);
521unsigned int clk_mux_index_to_val(u32 *table, unsigned int flags, u8 index);
522
513void clk_unregister_mux(struct clk *clk); 523void clk_unregister_mux(struct clk *clk);
514void clk_hw_unregister_mux(struct clk_hw *hw); 524void clk_hw_unregister_mux(struct clk_hw *hw);
515 525
@@ -774,6 +784,17 @@ static inline long divider_round_rate(struct clk_hw *hw, unsigned long rate,
774 rate, prate, table, width, flags); 784 rate, prate, table, width, flags);
775} 785}
776 786
787static inline long divider_ro_round_rate(struct clk_hw *hw, unsigned long rate,
788 unsigned long *prate,
789 const struct clk_div_table *table,
790 u8 width, unsigned long flags,
791 unsigned int val)
792{
793 return divider_ro_round_rate_parent(hw, clk_hw_get_parent(hw),
794 rate, prate, table, width, flags,
795 val);
796}
797
777/* 798/*
778 * FIXME clock api without lock protection 799 * FIXME clock api without lock protection
779 */ 800 */
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 4c4ef9f34db3..0dbd0885b2c2 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -209,7 +209,7 @@ static inline int clk_prepare(struct clk *clk)
209 return 0; 209 return 0;
210} 210}
211 211
212static inline int clk_bulk_prepare(int num_clks, struct clk_bulk_data *clks) 212static inline int __must_check clk_bulk_prepare(int num_clks, struct clk_bulk_data *clks)
213{ 213{
214 might_sleep(); 214 might_sleep();
215 return 0; 215 return 0;
@@ -603,8 +603,8 @@ static inline struct clk *clk_get(struct device *dev, const char *id)
603 return NULL; 603 return NULL;
604} 604}
605 605
606static inline int clk_bulk_get(struct device *dev, int num_clks, 606static inline int __must_check clk_bulk_get(struct device *dev, int num_clks,
607 struct clk_bulk_data *clks) 607 struct clk_bulk_data *clks)
608{ 608{
609 return 0; 609 return 0;
610} 610}
@@ -614,8 +614,8 @@ static inline struct clk *devm_clk_get(struct device *dev, const char *id)
614 return NULL; 614 return NULL;
615} 615}
616 616
617static inline int devm_clk_bulk_get(struct device *dev, int num_clks, 617static inline int __must_check devm_clk_bulk_get(struct device *dev, int num_clks,
618 struct clk_bulk_data *clks) 618 struct clk_bulk_data *clks)
619{ 619{
620 return 0; 620 return 0;
621} 621}
@@ -645,7 +645,7 @@ static inline int clk_enable(struct clk *clk)
645 return 0; 645 return 0;
646} 646}
647 647
648static inline int clk_bulk_enable(int num_clks, struct clk_bulk_data *clks) 648static inline int __must_check clk_bulk_enable(int num_clks, struct clk_bulk_data *clks)
649{ 649{
650 return 0; 650 return 0;
651} 651}
@@ -719,8 +719,8 @@ static inline void clk_disable_unprepare(struct clk *clk)
719 clk_unprepare(clk); 719 clk_unprepare(clk);
720} 720}
721 721
722static inline int clk_bulk_prepare_enable(int num_clks, 722static inline int __must_check clk_bulk_prepare_enable(int num_clks,
723 struct clk_bulk_data *clks) 723 struct clk_bulk_data *clks)
724{ 724{
725 int ret; 725 int ret;
726 726
diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h
index d23c9cf26993..afb9edfa5d58 100644
--- a/include/linux/clk/tegra.h
+++ b/include/linux/clk/tegra.h
@@ -128,5 +128,6 @@ extern void tegra210_sata_pll_hw_sequence_start(void);
128extern void tegra210_set_sata_pll_seq_sw(bool state); 128extern void tegra210_set_sata_pll_seq_sw(bool state);
129extern void tegra210_put_utmipll_in_iddq(void); 129extern void tegra210_put_utmipll_in_iddq(void);
130extern void tegra210_put_utmipll_out_iddq(void); 130extern void tegra210_put_utmipll_out_iddq(void);
131extern int tegra210_clk_handle_mbist_war(unsigned int id);
131 132
132#endif /* __LINUX_CLK_TEGRA_H_ */ 133#endif /* __LINUX_CLK_TEGRA_H_ */
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
index 7e3bceee3489..a8faa38b1ed6 100644
--- a/include/linux/clk/ti.h
+++ b/include/linux/clk/ti.h
@@ -212,6 +212,7 @@ enum {
212 * struct ti_clk_ll_ops - low-level ops for clocks 212 * struct ti_clk_ll_ops - low-level ops for clocks
213 * @clk_readl: pointer to register read function 213 * @clk_readl: pointer to register read function
214 * @clk_writel: pointer to register write function 214 * @clk_writel: pointer to register write function
215 * @clk_rmw: pointer to register read-modify-write function
215 * @clkdm_clk_enable: pointer to clockdomain enable function 216 * @clkdm_clk_enable: pointer to clockdomain enable function
216 * @clkdm_clk_disable: pointer to clockdomain disable function 217 * @clkdm_clk_disable: pointer to clockdomain disable function
217 * @clkdm_lookup: pointer to clockdomain lookup function 218 * @clkdm_lookup: pointer to clockdomain lookup function
@@ -227,6 +228,7 @@ enum {
227struct ti_clk_ll_ops { 228struct ti_clk_ll_ops {
228 u32 (*clk_readl)(const struct clk_omap_reg *reg); 229 u32 (*clk_readl)(const struct clk_omap_reg *reg);
229 void (*clk_writel)(u32 val, const struct clk_omap_reg *reg); 230 void (*clk_writel)(u32 val, const struct clk_omap_reg *reg);
231 void (*clk_rmw)(u32 val, u32 mask, const struct clk_omap_reg *reg);
230 int (*clkdm_clk_enable)(struct clockdomain *clkdm, struct clk *clk); 232 int (*clkdm_clk_enable)(struct clockdomain *clkdm, struct clk *clk);
231 int (*clkdm_clk_disable)(struct clockdomain *clkdm, 233 int (*clkdm_clk_disable)(struct clockdomain *clkdm,
232 struct clk *clk); 234 struct clk *clk);
diff --git a/include/linux/platform_data/clk-da8xx-cfgchip.h b/include/linux/platform_data/clk-da8xx-cfgchip.h
new file mode 100644
index 000000000000..de0f77d38669
--- /dev/null
+++ b/include/linux/platform_data/clk-da8xx-cfgchip.h
@@ -0,0 +1,21 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * clk-da8xx-cfgchip - TI DaVinci DA8xx CFGCHIP clock driver
4 *
5 * Copyright (C) 2018 David Lechner <david@lechnology.com>
6 */
7
8#ifndef __LINUX_PLATFORM_DATA_CLK_DA8XX_CFGCHIP_H__
9#define __LINUX_PLATFORM_DATA_CLK_DA8XX_CFGCHIP_H__
10
11#include <linux/regmap.h>
12
13/**
14 * da8xx_cfgchip_clk_platform_data
15 * @cfgchip: CFGCHIP syscon regmap
16 */
17struct da8xx_cfgchip_clk_platform_data {
18 struct regmap *cfgchip;
19};
20
21#endif /* __LINUX_PLATFORM_DATA_CLK_DA8XX_CFGCHIP_H__ */
diff --git a/include/linux/platform_data/clk-davinci-pll.h b/include/linux/platform_data/clk-davinci-pll.h
new file mode 100644
index 000000000000..e55dab1d578b
--- /dev/null
+++ b/include/linux/platform_data/clk-davinci-pll.h
@@ -0,0 +1,21 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * PLL clock driver for TI Davinci SoCs
4 *
5 * Copyright (C) 2018 David Lechner <david@lechnology.com>
6 */
7
8#ifndef __LINUX_PLATFORM_DATA_CLK_DAVINCI_PLL_H__
9#define __LINUX_PLATFORM_DATA_CLK_DAVINCI_PLL_H__
10
11#include <linux/regmap.h>
12
13/**
14 * davinci_pll_platform_data
15 * @cfgchip: CFGCHIP syscon regmap
16 */
17struct davinci_pll_platform_data {
18 struct regmap *cfgchip;
19};
20
21#endif /* __LINUX_PLATFORM_DATA_CLK_DAVINCI_PLL_H__ */