Skip to content

Commit

Permalink
Merge branches 'clk-mvebu', 'clk-const', 'clk-imx' and 'clk-rockchip'…
Browse files Browse the repository at this point in the history
… into clk-next

 - Mark mux table as const in clk-mux
 - Make the all_lists array const

* clk-mvebu:
  clk: mvebu: use time_is_before_eq_jiffies() instead of open coding it

* clk-const:
  clk: Mark clk_core_evict_parent_cache_subtree() 'target' const
  clk: Mark 'all_lists' as const
  clk: pistachio: Declare mux table as const u32[]
  clk: qcom: Declare mux table as const u32[]
  clk: mmp: Declare mux tables as const u32[]
  clk: hisilicon: Remove unnecessary cast of mux table to u32 *
  clk: mux: Declare u32 *table parameter as const
  clk: nxp: Declare mux table parameter as const u32 *
  clk: nxp: Remove unused variable

* clk-imx: (28 commits)
  dt-bindings: clock: drop useless consumer example
  clk: imx: Select MXC_CLK for i.MX93 clock driver
  clk: imx: remove redundant re-assignment of pll->base
  MAINTAINERS: clk: imx: add git tree and dt-bindings files
  clk: imx: pll14xx: Support dynamic rates
  clk: imx: pll14xx: Add pr_fmt
  clk: imx: pll14xx: explicitly return lowest rate
  clk: imx: pll14xx: name variables after usage
  clk: imx: pll14xx: consolidate rate calculation
  clk: imx: pll14xx: Use FIELD_GET/FIELD_PREP
  clk: imx: pll14xx: Drop wrong shifting
  clk: imx: pll14xx: Use register defines consistently
  clk: imx8mp: remove SYS PLL 1/2 clock gates
  clk: imx8mn: remove SYS PLL 1/2 clock gates
  clk: imx8mm: remove SYS PLL 1/2 clock gates
  clk: imx: add i.MX93 clk
  clk: imx: support fracn gppll
  clk: imx: add i.MX93 composite clk
  dt-bindings: clock: add i.MX93 clock definition
  dt-bindings: clock: Add imx93 clock support
  ...

* clk-rockchip:
  clk: rockchip: re-add rational best approximation algorithm to the fractional divider
  clk/rockchip: Use of_device_get_match_data()
  clk: rockchip: Add CLK_SET_RATE_PARENT to the HDMI reference clock on rk3568
  clk: rockchip: drop CLK_SET_RATE_PARENT from dclk_vop* on rk3568
  clk: rockchip: Add more PLL rates for rk3568
  • Loading branch information
Stephen Boyd committed Mar 29, 2022
5 parents f9fca89 + b191fe3 + 8df6418 + ec8b557 + 328212d commit 9babf95
Show file tree
Hide file tree
Showing 49 changed files with 1,724 additions and 362 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ This binding uses the common clock binding[1].

Required properties:
- compatible: Should be one of:
"fsl,imx8dxl-clk"
"fsl,imx8qm-clk"
"fsl,imx8qxp-clk"
followed by "fsl,scu-clk"
Expand Down
12 changes: 0 additions & 12 deletions Documentation/devicetree/bindings/clock/bitmain,bm1880-clk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,4 @@ examples:
#clock-cells = <1>;
};
# Example UART controller node that consumes clock generated by the clock controller:
- |
uart0: serial@58018000 {
compatible = "snps,dw-apb-uart";
reg = <0x58018000 0x2000>;
clocks = <&clk 45>, <&clk 46>;
clock-names = "baudclk", "apb_pclk";
interrupts = <0 9 4>;
reg-shift = <2>;
reg-io-width = <4>;
};
...
7 changes: 0 additions & 7 deletions Documentation/devicetree/bindings/clock/idt,versaclock5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,4 @@ examples:
};
};
/* Consumer referencing the 5P49V5923 pin OUT1 */
consumer {
/* ... */
clocks = <&vc5 1>;
/* ... */
};
...
9 changes: 0 additions & 9 deletions Documentation/devicetree/bindings/clock/imx1-clock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,3 @@ examples:
compatible = "fsl,imx1-ccm";
reg = <0x0021b000 0x1000>;
};
pwm@208000 {
#pwm-cells = <2>;
compatible = "fsl,imx1-pwm";
reg = <0x00208000 0x1000>;
interrupts = <34>;
clocks = <&clks IMX1_CLK_DUMMY>, <&clks IMX1_CLK_PER1>;
clock-names = "ipg", "per";
};
9 changes: 0 additions & 9 deletions Documentation/devicetree/bindings/clock/imx21-clock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,3 @@ examples:
reg = <0x10027000 0x800>;
#clock-cells = <1>;
};
serial@1000a000 {
compatible = "fsl,imx21-uart";
reg = <0x1000a000 0x1000>;
interrupts = <20>;
clocks = <&clks IMX21_CLK_UART1_IPG_GATE>,
<&clks IMX21_CLK_PER1>;
clock-names = "ipg", "per";
};
9 changes: 0 additions & 9 deletions Documentation/devicetree/bindings/clock/imx23-clock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,3 @@ examples:
reg = <0x80040000 0x2000>;
#clock-cells = <1>;
};
serial@8006c000 {
compatible = "fsl,imx23-auart";
reg = <0x8006c000 0x2000>;
interrupts = <24>;
clocks = <&clks 32>;
dmas = <&dma_apbx 6>, <&dma_apbx 7>;
dma-names = "rx", "tx";
};
8 changes: 0 additions & 8 deletions Documentation/devicetree/bindings/clock/imx25-clock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,3 @@ examples:
interrupts = <31>;
#clock-cells = <1>;
};
serial@43f90000 {
compatible = "fsl,imx25-uart", "fsl,imx21-uart";
reg = <0x43f90000 0x4000>;
interrupts = <45>;
clocks = <&clks 79>, <&clks 50>;
clock-names = "ipg", "per";
};
9 changes: 0 additions & 9 deletions Documentation/devicetree/bindings/clock/imx27-clock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,3 @@ examples:
interrupts = <31>;
#clock-cells = <1>;
};
serial@1000a000 {
compatible = "fsl,imx27-uart", "fsl,imx21-uart";
reg = <0x1000a000 0x1000>;
interrupts = <20>;
clocks = <&clks IMX27_CLK_UART1_IPG_GATE>,
<&clks IMX27_CLK_PER1_GATE>;
clock-names = "ipg", "per";
};
9 changes: 0 additions & 9 deletions Documentation/devicetree/bindings/clock/imx28-clock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,3 @@ examples:
reg = <0x80040000 0x2000>;
#clock-cells = <1>;
};
serial@8006a000 {
compatible = "fsl,imx28-auart";
reg = <0x8006a000 0x2000>;
interrupts = <112>;
dmas = <&dma_apbx 8>, <&dma_apbx 9>;
dma-names = "rx", "tx";
clocks = <&clks 45>;
};
8 changes: 0 additions & 8 deletions Documentation/devicetree/bindings/clock/imx31-clock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,3 @@ examples:
interrupts = <31>, <53>;
#clock-cells = <1>;
};
serial@43f90000 {
compatible = "fsl,imx31-uart", "fsl,imx21-uart";
reg = <0x43f90000 0x4000>;
interrupts = <45>;
clocks = <&clks 10>, <&clks 30>;
clock-names = "ipg", "per";
};
8 changes: 0 additions & 8 deletions Documentation/devicetree/bindings/clock/imx35-clock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,3 @@ examples:
interrupts = <31>;
#clock-cells = <1>;
};
mmc@53fb4000 {
compatible = "fsl,imx35-esdhc";
reg = <0x53fb4000 0x4000>;
interrupts = <7>;
clocks = <&clks 9>, <&clks 8>, <&clks 43>;
clock-names = "ipg", "ahb", "per";
};
11 changes: 0 additions & 11 deletions Documentation/devicetree/bindings/clock/imx7ulp-pcc-clock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,3 @@ examples:
"upll", "sosc_bus_clk", "firc_bus_clk",
"rosc", "spll_bus_clk";
};
mmc@40380000 {
compatible = "fsl,imx7ulp-usdhc";
reg = <0x40380000 0x10000>;
interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&scg1 IMX7ULP_CLK_NIC1_BUS_DIV>,
<&scg1 IMX7ULP_CLK_NIC1_DIV>,
<&pcc2 IMX7ULP_CLK_USDHC1>;
clock-names ="ipg", "ahb", "per";
bus-width = <4>;
};
11 changes: 0 additions & 11 deletions Documentation/devicetree/bindings/clock/imx7ulp-scg-clock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,3 @@ examples:
"firc", "upll";
#clock-cells = <1>;
};
mmc@40380000 {
compatible = "fsl,imx7ulp-usdhc";
reg = <0x40380000 0x10000>;
interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&scg1 IMX7ULP_CLK_NIC1_BUS_DIV>,
<&scg1 IMX7ULP_CLK_NIC1_DIV>,
<&pcc2 IMX7ULP_CLK_USDHC1>;
clock-names ="ipg", "ahb", "per";
bus-width = <4>;
};
11 changes: 0 additions & 11 deletions Documentation/devicetree/bindings/clock/imx8qxp-lpcg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,3 @@ examples:
"sdhc0_lpcg_ahb_clk";
power-domains = <&pd IMX_SC_R_SDHC_0>;
};
mmc@5b010000 {
compatible = "fsl,imx8qxp-usdhc", "fsl,imx7d-usdhc";
interrupts = <GIC_SPI 232 IRQ_TYPE_LEVEL_HIGH>;
reg = <0x5b010000 0x10000>;
clocks = <&sdhc0_lpcg IMX_LPCG_CLK_4>,
<&sdhc0_lpcg IMX_LPCG_CLK_5>,
<&sdhc0_lpcg IMX_LPCG_CLK_0>;
clock-names = "ipg", "ahb", "per";
power-domains = <&pd IMX_SC_R_SDHC_0>;
};
62 changes: 62 additions & 0 deletions Documentation/devicetree/bindings/clock/imx93-clock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/imx93-clock.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: NXP i.MX93 Clock Control Module Binding

maintainers:
- Peng Fan <peng.fan@nxp.com>

description: |
i.MX93 clock control module is an integrated clock controller, which
includes clock generator, clock gate and supplies to all modules.
properties:
compatible:
enum:
- fsl,imx93-ccm

reg:
maxItems: 1

clocks:
description:
specify the external clocks used by the CCM module.
items:
- description: 32k osc
- description: 24m osc
- description: ext1 clock input

clock-names:
description:
specify the external clocks names used by the CCM module.
items:
- const: osc_32k
- const: osc_24m
- const: clk_ext1

'#clock-cells':
const: 1
description:
See include/dt-bindings/clock/imx93-clock.h for the full list of
i.MX93 clock IDs.

required:
- compatible
- reg
- '#clock-cells'

additionalProperties: false

examples:
# Clock Control Module node:
- |
clock-controller@44450000 {
compatible = "fsl,imx93-ccm";
reg = <0x44450000 0x10000>;
#clock-cells = <1>;
};
...
59 changes: 59 additions & 0 deletions Documentation/devicetree/bindings/clock/imxrt1050-clock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/imxrt1050-clock.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Clock bindings for Freescale i.MXRT

maintainers:
- Giulio Benetti <giulio.benetti@benettiengineering.com>
- Jesse Taube <Mr.Bossman075@gmail.com>

description: |
The clock consumer should specify the desired clock by having the clock
ID in its "clocks" phandle cell. See include/dt-bindings/clock/imxrt*-clock.h
for the full list of i.MXRT clock IDs.
properties:
compatible:
const: fsl,imxrt1050-ccm

reg:
maxItems: 1

interrupts:
maxItems: 2

clocks:
description: 24m osc
maxItems: 1

clock-names:
const: osc

'#clock-cells':
const: 1

required:
- compatible
- reg
- interrupts
- clocks
- clock-names
- '#clock-cells'

additionalProperties: false

examples:
- |
#include <dt-bindings/clock/imxrt1050-clock.h>
clks: clock-controller@400fc000 {
compatible = "fsl,imxrt1050-ccm";
reg = <0x400fc000 0x4000>;
interrupts = <95>, <96>;
clocks = <&osc>;
clock-names = "osc";
#clock-cells = <1>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,3 @@ examples:
#clock-cells = <1>;
#reset-cells = <1>;
};
usb-controller@c5004000 {
compatible = "nvidia,tegra20-ehci";
reg = <0xc5004000 0x4000>;
clocks = <&car TEGRA124_CLK_USB2>;
resets = <&car TEGRA124_CLK_USB2>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,3 @@ examples:
power-domains = <&domain>;
};
};
usb-controller@c5004000 {
compatible = "nvidia,tegra20-ehci";
reg = <0xc5004000 0x4000>;
clocks = <&car TEGRA20_CLK_USB2>;
resets = <&car TEGRA20_CLK_USB2>;
};
3 changes: 3 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -13840,7 +13840,10 @@ M: Abel Vesa <abel.vesa@nxp.com>
L: linux-clk@vger.kernel.org
L: linux-imx@nxp.com
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux.git clk/imx
F: Documentation/devicetree/bindings/clock/imx*
F: drivers/clk/imx/
F: include/dt-bindings/clock/imx*

NXP i.MX 8MQ DCSS DRIVER
M: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Expand Down
10 changes: 5 additions & 5 deletions drivers/clk/clk-mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static inline void clk_mux_writel(struct clk_mux *mux, u32 val)
writel(val, mux->reg);
}

int clk_mux_val_to_index(struct clk_hw *hw, u32 *table, unsigned int flags,
int clk_mux_val_to_index(struct clk_hw *hw, const u32 *table, unsigned int flags,
unsigned int val)
{
int num_parents = clk_hw_get_num_parents(hw);
Expand All @@ -67,7 +67,7 @@ int clk_mux_val_to_index(struct clk_hw *hw, u32 *table, unsigned int flags,
}
EXPORT_SYMBOL_GPL(clk_mux_val_to_index);

unsigned int clk_mux_index_to_val(u32 *table, unsigned int flags, u8 index)
unsigned int clk_mux_index_to_val(const u32 *table, unsigned int flags, u8 index)
{
unsigned int val = index;

Expand Down Expand Up @@ -152,7 +152,7 @@ struct clk_hw *__clk_hw_register_mux(struct device *dev, struct device_node *np,
const struct clk_hw **parent_hws,
const struct clk_parent_data *parent_data,
unsigned long flags, void __iomem *reg, u8 shift, u32 mask,
u8 clk_mux_flags, u32 *table, spinlock_t *lock)
u8 clk_mux_flags, const u32 *table, spinlock_t *lock)
{
struct clk_mux *mux;
struct clk_hw *hw;
Expand Down Expand Up @@ -218,7 +218,7 @@ struct clk_hw *__devm_clk_hw_register_mux(struct device *dev, struct device_node
const struct clk_hw **parent_hws,
const struct clk_parent_data *parent_data,
unsigned long flags, void __iomem *reg, u8 shift, u32 mask,
u8 clk_mux_flags, u32 *table, spinlock_t *lock)
u8 clk_mux_flags, const u32 *table, spinlock_t *lock)
{
struct clk_hw **ptr, *hw;

Expand All @@ -244,7 +244,7 @@ EXPORT_SYMBOL_GPL(__devm_clk_hw_register_mux);
struct clk *clk_register_mux_table(struct device *dev, const char *name,
const char * const *parent_names, u8 num_parents,
unsigned long flags, void __iomem *reg, u8 shift, u32 mask,
u8 clk_mux_flags, u32 *table, spinlock_t *lock)
u8 clk_mux_flags, const u32 *table, spinlock_t *lock)
{
struct clk_hw *hw;

Expand Down
Loading

0 comments on commit 9babf95

Please sign in to comment.