Merge branches 'clk-qcom-rpmh', 'clk-npcm7xx', 'clk-of-parent-count' and 'clk-qcom...
authorStephen Boyd <sboyd@kernel.org>
Mon, 4 Jun 2018 19:27:29 +0000 (12:27 -0700)
committerStephen Boyd <sboyd@kernel.org>
Mon, 4 Jun 2018 19:27:29 +0000 (12:27 -0700)
* clk-qcom-rpmh:
  dt-bindings: clock: Introduce QCOM RPMh clock bindings

* clk-npcm7xx:
  clk: npcm7xx: fix return value check in npcm7xx_clk_init()
  clk: npcm7xx: add clock controller
  dt-binding: clk: npcm750: Add binding for Nuvoton NPCM7XX Clock

* clk-of-parent-count:
  pinctrl: sunxi: Use of_clk_get_parent_count() instead of open coding
  soc/tegra: pmc: Use of_clk_get_parent_count() instead of open coding
  soc: rockchip: power-domain: Use of_clk_get_parent_count() instead of open coding
  ARM: timer-sp: Use of_clk_get_parent_count() instead of open coding
  clk: Extract OF clock helpers in <linux/of_clk.h>

* clk-qcom-rcg-fix:
  clk: qcom: Base rcg parent rate off plan frequency

1  2  3  4  5 
drivers/clk/Makefile
include/linux/clk-provider.h

diff --combined drivers/clk/Makefile
@@@@@@ -33,6 -33,6 -33,7 -33,6 -33,6 +33,7 @@@@@@ obj-$(CONFIG_CLK_HSDK)                        += clk-hsdk-pl
     obj-$(CONFIG_COMMON_CLK_MAX77686)  += clk-max77686.o
     obj-$(CONFIG_ARCH_MOXART)          += clk-moxart.o
     obj-$(CONFIG_ARCH_NOMADIK)         += clk-nomadik.o
++ ++obj-$(CONFIG_ARCH_NPCM7XX)         += clk-npcm7xx.o
     obj-$(CONFIG_ARCH_NSPIRE)          += clk-nspire.o
     obj-$(CONFIG_COMMON_CLK_OXNAS)             += clk-oxnas.o
     obj-$(CONFIG_COMMON_CLK_PALMAS)            += clk-palmas.o
@@@@@@ -41,15 -41,15 -42,12 -41,15 -41,15 +42,15 @@@@@@ obj-$(CONFIG_CLK_QORIQ)                 += clk-qoriq.
     obj-$(CONFIG_COMMON_CLK_RK808)             += clk-rk808.o
     obj-$(CONFIG_COMMON_CLK_HI655X)            += clk-hi655x.o
     obj-$(CONFIG_COMMON_CLK_S2MPS11)   += clk-s2mps11.o
  +  obj-$(CONFIG_COMMON_CLK_SCMI)           += clk-scmi.o
     obj-$(CONFIG_COMMON_CLK_SCPI)           += clk-scpi.o
     obj-$(CONFIG_COMMON_CLK_SI5351)            += clk-si5351.o
     obj-$(CONFIG_COMMON_CLK_SI514)             += clk-si514.o
  +  obj-$(CONFIG_COMMON_CLK_SI544)             += clk-si544.o
     obj-$(CONFIG_COMMON_CLK_SI570)             += clk-si570.o
  -  obj-$(CONFIG_ARCH_STM32)           += clk-stm32f4.o
  -  obj-$(CONFIG_ARCH_STM32)           += clk-stm32h7.o
  +  obj-$(CONFIG_COMMON_CLK_STM32F)            += clk-stm32f4.o
  +  obj-$(CONFIG_COMMON_CLK_STM32H7)   += clk-stm32h7.o
  +  obj-$(CONFIG_COMMON_CLK_STM32MP157)        += clk-stm32mp1.o
     obj-$(CONFIG_ARCH_TANGO)           += clk-tango4.o
     obj-$(CONFIG_CLK_TWL6040)          += clk-twl6040.o
     obj-$(CONFIG_ARCH_U300)                    += clk-u300.o
@@@@@@ -59,13 -59,12 -57,11 -59,12 -59,12 +60,13 @@@@@@ obj-$(CONFIG_COMMON_CLK_WM831X)         += clk
     obj-$(CONFIG_COMMON_CLK_XGENE)             += clk-xgene.o
     
     # please keep this section sorted lexicographically by directory path name
 ++++obj-y                                      += actions/
     obj-$(CONFIG_COMMON_CLK_AT91)              += at91/
     obj-$(CONFIG_ARCH_ARTPEC)          += axis/
     obj-$(CONFIG_ARC_PLAT_AXS10X)              += axs10x/
     obj-y                                      += bcm/
     obj-$(CONFIG_ARCH_BERLIN)          += berlin/
  +  obj-$(CONFIG_ARCH_DAVINCI)         += davinci/
     obj-$(CONFIG_H8300)                        += h8300/
     obj-$(CONFIG_ARCH_HISI)                    += hisilicon/
     obj-y                                      += imgtec/
@@@@@@ -93,7 -92,7 -89,6 -92,7 -92,7 +94,7 @@@@@@ obj-$(CONFIG_ARCH_SOCFPGA)            += socfpga
     obj-$(CONFIG_PLAT_SPEAR)           += spear/
     obj-$(CONFIG_ARCH_SPRD)                    += sprd/
     obj-$(CONFIG_ARCH_STI)                     += st/
  +  obj-$(CONFIG_ARCH_STRATIX10)               += socfpga/
     obj-$(CONFIG_ARCH_SUNXI)           += sunxi/
     obj-$(CONFIG_ARCH_SUNXI)           += sunxi-ng/
     obj-$(CONFIG_ARCH_TEGRA)           += tegra/
     
     #include <linux/io.h>
     #include <linux/of.h>
+++ +#include <linux/of_clk.h>
     
     #ifdef CONFIG_COMMON_CLK
     
@@@@@@ -399,7 -399,7 -399,6 -400,7 -399,7 +400,7 @@@@@@ struct clk_divider 
        spinlock_t      *lock;
     };
     
  +  #define clk_div_mask(width)        ((1 << (width)) - 1)
     #define to_clk_divider(_hw) container_of(_hw, struct clk_divider, hw)
     
     #define CLK_DIVIDER_ONE_BASED              BIT(0)
@@@@@@ -420,10 -420,10 -419,6 -421,10 -420,10 +421,10 @@@@@@ long divider_round_rate_parent(struct c
                               unsigned long rate, unsigned long *prate,
                               const struct clk_div_table *table,
                               u8 width, unsigned long flags);
  +  long divider_ro_round_rate_parent(struct clk_hw *hw, struct clk_hw *parent,
  +                               unsigned long rate, unsigned long *prate,
  +                               const struct clk_div_table *table, u8 width,
  +                               unsigned long flags, unsigned int val);
     int divider_get_val(unsigned long rate, unsigned long parent_rate,
                const struct clk_div_table *table, u8 width,
                unsigned long flags);
@@@@@@ -454,9 -454,9 -449,8 -455,9 -454,9 +455,9 @@@@@@ void clk_hw_unregister_divider(struct c
      *
      * @hw:            handle between common and hardware-specific interfaces
      * @reg:   register controlling multiplexer
  +   * @table: array of register values corresponding to the parent index
      * @shift: shift to multiplexer bit field
  -   * @width: width of mutliplexer bit field
  +   * @mask:  mask of mutliplexer bit field
      * @flags: hardware-specific flags
      * @lock:  register lock
      *
@@@@@@ -516,10 -516,10 -510,6 -517,10 -516,10 +517,10 @@@@@@ struct clk_hw *clk_hw_register_mux_tabl
                void __iomem *reg, u8 shift, u32 mask,
                u8 clk_mux_flags, u32 *table, spinlock_t *lock);
     
  +  int clk_mux_val_to_index(struct clk_hw *hw, u32 *table, unsigned int flags,
  +                      unsigned int val);
  +  unsigned int clk_mux_index_to_val(u32 *table, unsigned int flags, u8 index);
  +  
     void clk_unregister_mux(struct clk *clk);
     void clk_hw_unregister_mux(struct clk_hw *hw);
     
@@@@@@ -784,17 -784,17 -774,6 -785,17 -784,17 +785,17 @@@@@@ static inline long divider_round_rate(s
                                         rate, prate, table, width, flags);
     }
     
  +  static inline long divider_ro_round_rate(struct clk_hw *hw, unsigned long rate,
  +                                      unsigned long *prate,
  +                                      const struct clk_div_table *table,
  +                                      u8 width, unsigned long flags,
  +                                      unsigned int val)
  +  {
  +     return divider_ro_round_rate_parent(hw, clk_hw_get_parent(hw),
  +                                         rate, prate, table, width, flags,
  +                                         val);
  +  }
  +  
     /*
      * FIXME clock api without lock protection
      */
@@@@@@ -802,6 -802,8 -781,8 -803,8 -802,8 +803,6 @@@@@@ unsigned long clk_hw_round_rate(struct 
     
     struct of_device_id;
     
 ----typedef void (*of_clk_init_cb_t)(struct device_node *);
 ----
     struct clk_onecell_data {
        struct clk **clks;
        unsigned int clk_num;
@@@@@@ -888,13 -890,13 -869,13 -891,10 -890,13 +889,10 @@@@@@ struct clk_hw *of_clk_hw_simple_get(str
     struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data);
     struct clk_hw *of_clk_hw_onecell_get(struct of_phandle_args *clkspec,
                                     void *data);
--- -unsigned int of_clk_get_parent_count(struct device_node *np);
     int of_clk_parent_fill(struct device_node *np, const char **parents,
                       unsigned int size);
--- -const char *of_clk_get_parent_name(struct device_node *np, int index);
     int of_clk_detect_critical(struct device_node *np, int index,
                            unsigned long *flags);
--- -void of_clk_init(const struct of_device_id *matches);
     
     #else /* !CONFIG_OF */
     
@@@@@@ -941,26 -943,26 -922,26 -941,16 -943,26 +939,16 @@@@@@ of_clk_hw_onecell_get(struct of_phandle
     {
        return ERR_PTR(-ENOENT);
     }
--- -static inline unsigned int of_clk_get_parent_count(struct device_node *np)
--- -{
--- -   return 0;
--- -}
     static inline int of_clk_parent_fill(struct device_node *np,
                                     const char **parents, unsigned int size)
     {
        return 0;
     }
--- -static inline const char *of_clk_get_parent_name(struct device_node *np,
--- -                                            int index)
--- -{
--- -   return NULL;
--- -}
     static inline int of_clk_detect_critical(struct device_node *np, int index,
                                          unsigned long *flags)
     {
        return 0;
     }
--- -static inline void of_clk_init(const struct of_device_id *matches) {}
     #endif /* CONFIG_OF */
     
     /*