Skip to content

Commit

Permalink
Merge branches 'clk-ti', 'clk-cleanup', 'clk-airoha', 'clk-i2c-simple…
Browse files Browse the repository at this point in the history
…' and 'clk-renesas' into clk-next

 - Airoha EN7523 SoC system clocks
 - Use i2c driver probe_new to avoid id scans

* clk-ti:
  clk: ti: clkctrl: replace usage of found with dedicated list iterator variable
  clk: ti: composite: Prefer kcalloc over open coded arithmetic
  clk: keystone: syscon-clk: Add support for AM62 epwm-tbclk
  dt-bindings: clock: ehrpwm: Add AM62 specific compatible

* clk-cleanup:
  clk: bcm: rpi: Use correct order for the parameters of devm_kcalloc()
  clk: fixed-rate: Remove redundant if statement
  clk: mux: remove redundant initialization of variable width
  clk: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
  clk: actions: remove redundant assignment after a mask operation

* clk-airoha:
  clk: en7523: fix wrong pointer check in en7523_clk_probe()
  clk: en7523: Add clock driver for Airoha EN7523 SoC
  dt-bindings: Add en7523-scu device tree binding documentation

* clk-i2c-simple:
  clk: renesas-pcie: use simple i2c probe function
  clk: si570: use i2c_match_id and simple i2c probe
  clk: si544: use i2c_match_id and simple i2c probe
  clk: si5351: use i2c_match_id and simple i2c probe
  clk: si5341: use simple i2c probe function
  clk: si514: use simple i2c probe function
  clk: max9485: use simple i2c probe function
  clk: cs2000-cp: use simple i2c probe function
  clk: cdce925: use i2c_match_id and simple i2c probe
  clk: cdce706: use simple i2c probe function

* clk-renesas: (48 commits)
  clk: renesas: r9a09g011: Add eth clock and reset entries
  clk: renesas: Add RZ/V2M support using the rzg2l driver
  clk: renesas: rzg2l: Add support for RZ/V2M reset monitor reg
  clk: renesas: rzg2l: Make use of CLK_MON registers optional
  clk: renesas: rzg2l: Set HIWORD mask for all mux and dividers
  clk: renesas: rzg2l: Add read only versions of the clk macros
  clk: renesas: rzg2l: Move the DEF_MUX array size calc into the macro
  dt-bindings: clock: renesas,rzg2l: Document RZ/V2M SoC
  clk: renesas: r9a07g044: Fix OSTM1 module clock name
  clk: renesas: r9a07g043: Add clock and reset entries for ADC
  clk: renesas: r9a07g043: Add TSU clock and reset entry
  clk: renesas: r9a07g043: Add RSPI clock and reset entries
  clk: renesas: r9a07g043: Add clock and reset entries for SPI Multi I/O Bus Controller
  clk: renesas: r9a07g044: Add DSI clock and reset entries
  clk: renesas: r9a07g044: Add LCDC clock and reset entries
  clk: renesas: r9a07g044: Add M4 Clock support
  clk: renesas: r9a07g044: Add M3 Clock support
  clk: renesas: r9a07g044: Add {M2, M2_DIV2} Clocks support
  clk: renesas: r9a07g044: Add M1 clock support
  clk: renesas: rzg2l: Add DSI divider clk support
  ...
  • Loading branch information
Stephen Boyd committed May 25, 2022
5 parents 560a316 + b7fa624 + c6b61d4 + 5baa12c + 13982e8 commit 2c29798
Show file tree
Hide file tree
Showing 52 changed files with 2,619 additions and 193 deletions.
58 changes: 58 additions & 0 deletions Documentation/devicetree/bindings/clock/airoha,en7523-scu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/airoha,en7523-scu.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: EN7523 Clock Device Tree Bindings

maintainers:
- Felix Fietkau <nbd@nbd.name>
- John Crispin <nbd@nbd.name>

description: |
This node defines the System Control Unit of the EN7523 SoC,
a collection of registers configuring many different aspects of the SoC.
The clock driver uses it to read and configure settings of the
PLL controller, which provides clocks for the CPU, the bus and
other SoC internal peripherals.
Each clock is assigned an identifier and client nodes use this identifier
to specify which clock they consume.
All these identifiers can be found in:
[1]: <include/dt-bindings/clock/en7523-clk.h>.
The clocks are provided inside a system controller node.
properties:
compatible:
items:
- const: airoha,en7523-scu

reg:
maxItems: 2

"#clock-cells":
description:
The first cell indicates the clock number, see [1] for available
clocks.
const: 1

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

additionalProperties: false

examples:
- |
#include <dt-bindings/clock/en7523-clk.h>
scu: system-controller@1fa20000 {
compatible = "airoha,en7523-scu";
reg = <0x1fa20000 0x400>,
<0x1fb00000 0x1000>;
#clock-cells = <1>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ properties:
- renesas,r8a77995-cpg-mssr # R-Car D3
- renesas,r8a779a0-cpg-mssr # R-Car V3U
- renesas,r8a779f0-cpg-mssr # R-Car S4-8
- renesas,r8a779g0-cpg-mssr # R-Car V4H

reg:
maxItems: 1
Expand Down
20 changes: 12 additions & 8 deletions Documentation/devicetree/bindings/clock/renesas,rzg2l-cpg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
$id: "http://devicetree.org/schemas/clock/renesas,rzg2l-cpg.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"

title: Renesas RZ/{G2L,V2L} Clock Pulse Generator / Module Standby Mode
title: Renesas RZ/{G2L,V2L,V2M} Clock Pulse Generator / Module Standby Mode

maintainers:
- Geert Uytterhoeven <geert+renesas@glider.be>

description: |
On Renesas RZ/{G2L,V2L} SoC, the CPG (Clock Pulse Generator) and Module
Standby Mode share the same register block.
On Renesas RZ/{G2L,V2L}-alike SoC's, the CPG (Clock Pulse Generator) and Module
Standby Mode share the same register block. On RZ/V2M, the functionality is
similar, but does not have Clock Monitor Registers.
They provide the following functionalities:
- The CPG block generates various core clocks,
Expand All @@ -23,8 +24,10 @@ description: |
properties:
compatible:
enum:
- renesas,r9a07g044-cpg # RZ/G2{L,LC}
- renesas,r9a07g054-cpg # RZ/V2L
- renesas,r9a07g043-cpg # RZ/G2UL{Type-1,Type-2}
- renesas,r9a07g044-cpg # RZ/G2{L,LC}
- renesas,r9a07g054-cpg # RZ/V2L
- renesas,r9a09g011-cpg # RZ/V2M

reg:
maxItems: 1
Expand All @@ -42,9 +45,10 @@ properties:
description: |
- For CPG core clocks, the two clock specifier cells must be "CPG_CORE"
and a core clock reference, as defined in
<dt-bindings/clock/r9a07g*-cpg.h>
<dt-bindings/clock/r9a0*-cpg.h>
- For module clocks, the two clock specifier cells must be "CPG_MOD" and
a module number, as defined in the <dt-bindings/clock/r9a07g0*-cpg.h>.
a module number, as defined in the <dt-bindings/clock/r9a07g0*-cpg.h> or
<dt-bindings/clock/r9a09g011-cpg.h>.
const: 2

'#power-domain-cells':
Expand All @@ -58,7 +62,7 @@ properties:
'#reset-cells':
description:
The single reset specifier cell must be the module number, as defined in
the <dt-bindings/clock/r9a07g0*-cpg.h>.
the <dt-bindings/clock/r9a07g0*-cpg.h> or <dt-bindings/clock/r9a09g011-cpg.h>.
const: 1

required:
Expand Down
9 changes: 9 additions & 0 deletions drivers/clk/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@ config COMMON_CLK_CS2000_CP
help
If you say yes here you get support for the CS2000 clock multiplier.

config COMMON_CLK_EN7523
bool "Clock driver for Airoha EN7523 SoC system clocks"
depends on OF
depends on ARCH_AIROHA || COMPILE_TEST
default ARCH_AIROHA
help
This driver provides the fixed clocks and gates present on Airoha
ARM silicon.

config COMMON_CLK_FSL_FLEXSPI
tristate "Clock driver for FlexSPI on Layerscape SoCs"
depends on ARCH_LAYERSCAPE || COMPILE_TEST
Expand Down
1 change: 1 addition & 0 deletions drivers/clk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ obj-$(CONFIG_COMMON_CLK_CDCE925) += clk-cdce925.o
obj-$(CONFIG_ARCH_CLPS711X) += clk-clps711x.o
obj-$(CONFIG_COMMON_CLK_CS2000_CP) += clk-cs2000-cp.o
obj-$(CONFIG_ARCH_SPARX5) += clk-sparx5.o
obj-$(CONFIG_COMMON_CLK_EN7523) += clk-en7523.o
obj-$(CONFIG_COMMON_CLK_FIXED_MMIO) += clk-fixed-mmio.o
obj-$(CONFIG_COMMON_CLK_FSL_FLEXSPI) += clk-fsl-flexspi.o
obj-$(CONFIG_COMMON_CLK_FSL_SAI) += clk-fsl-sai.o
Expand Down
2 changes: 1 addition & 1 deletion drivers/clk/actions/owl-pll.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static u32 owl_pll_calculate_mul(struct owl_pll_hw *pll_hw, unsigned long rate)
else if (mul > pll_hw->max_mul)
mul = pll_hw->max_mul;

return mul &= mul_mask(pll_hw);
return mul & mul_mask(pll_hw);
}

static unsigned long _get_table_rate(const struct clk_pll_table *table,
Expand Down
2 changes: 1 addition & 1 deletion drivers/clk/bcm/clk-raspberrypi.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi,
int ret;

clks = devm_kcalloc(rpi->dev,
sizeof(*clks), RPI_FIRMWARE_NUM_CLK_ID,
RPI_FIRMWARE_NUM_CLK_ID, sizeof(*clks),
GFP_KERNEL);
if (!clks)
return -ENOMEM;
Expand Down
5 changes: 2 additions & 3 deletions drivers/clk/clk-cdce706.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,7 @@ of_clk_cdce_get(struct of_phandle_args *clkspec, void *data)
return &cdce->clkout[idx].hw;
}

static int cdce706_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int cdce706_probe(struct i2c_client *client)
{
struct i2c_adapter *adapter = client->adapter;
struct cdce706_dev_data *cdce;
Expand Down Expand Up @@ -692,7 +691,7 @@ static struct i2c_driver cdce706_i2c_driver = {
.name = "cdce706",
.of_match_table = of_match_ptr(cdce706_dt_match),
},
.probe = cdce706_probe,
.probe_new = cdce706_probe,
.remove = cdce706_remove,
.id_table = cdce706_id,
};
Expand Down
24 changes: 12 additions & 12 deletions drivers/clk/clk-cdce925.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,11 +634,20 @@ static struct regmap_bus regmap_cdce925_bus = {
.read = cdce925_regmap_i2c_read,
};

static int cdce925_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static const struct i2c_device_id cdce925_id[] = {
{ "cdce913", CDCE913 },
{ "cdce925", CDCE925 },
{ "cdce937", CDCE937 },
{ "cdce949", CDCE949 },
{ }
};
MODULE_DEVICE_TABLE(i2c, cdce925_id);

static int cdce925_probe(struct i2c_client *client)
{
struct clk_cdce925_chip *data;
struct device_node *node = client->dev.of_node;
const struct i2c_device_id *id = i2c_match_id(cdce925_id, client);
const char *parent_name;
const char *pll_clk_name[MAX_NUMBER_OF_PLLS] = {NULL,};
struct clk_init_data init;
Expand Down Expand Up @@ -814,15 +823,6 @@ static int cdce925_probe(struct i2c_client *client,
return err;
}

static const struct i2c_device_id cdce925_id[] = {
{ "cdce913", CDCE913 },
{ "cdce925", CDCE925 },
{ "cdce937", CDCE937 },
{ "cdce949", CDCE949 },
{ }
};
MODULE_DEVICE_TABLE(i2c, cdce925_id);

static const struct of_device_id clk_cdce925_of_match[] = {
{ .compatible = "ti,cdce913" },
{ .compatible = "ti,cdce925" },
Expand All @@ -837,7 +837,7 @@ static struct i2c_driver cdce925_driver = {
.name = "cdce925",
.of_match_table = of_match_ptr(clk_cdce925_of_match),
},
.probe = cdce925_probe,
.probe_new = cdce925_probe,
.id_table = cdce925_id,
};
module_i2c_driver(cdce925_driver);
Expand Down
5 changes: 2 additions & 3 deletions drivers/clk/clk-cs2000-cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,7 @@ static int cs2000_remove(struct i2c_client *client)
return 0;
}

static int cs2000_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int cs2000_probe(struct i2c_client *client)
{
struct cs2000_priv *priv;
struct device *dev = &client->dev;
Expand Down Expand Up @@ -625,7 +624,7 @@ static struct i2c_driver cs2000_driver = {
.pm = &cs2000_pm_ops,
.of_match_table = cs2000_of_match,
},
.probe = cs2000_probe,
.probe_new = cs2000_probe,
.remove = cs2000_remove,
.id_table = cs2000_id,
};
Expand Down
Loading

0 comments on commit 2c29798

Please sign in to comment.