Skip to content

Commit

Permalink
Merge branches 'clk-starfive', 'clk-ti', 'clk-terminate' and 'clk-cle…
Browse files Browse the repository at this point in the history
…anup' into clk-next

 - Audio clks on StarFive JH7100 RISC-V SoC
 - Terminate arrays with sentinels and make that clearer
 - Cleanup SPDX tags
 - Fix typos in comments

* clk-starfive:
  clk: starfive: Add JH7100 audio clock driver
  clk: starfive: jh7100: Support more clock types
  clk: starfive: jh7100: Make hw clock implementation reusable
  dt-bindings: clock: Add starfive,jh7100-audclk bindings
  dt-bindings: clock: Add JH7100 audio clock definitions
  clk: starfive: jh7100: Handle audio_div clock properly
  clk: starfive: jh7100: Don't round divisor up twice

* clk-ti:
  clk: ti: Drop legacy compatibility clocks for dra7
  clk: ti: Drop legacy compatibility clocks for am4
  clk: ti: Drop legacy compatibility clocks for am3
  clk: ti: Update component clocks to use ti_dt_clk_name()
  clk: ti: Update pll and clockdomain clocks to use ti_dt_clk_name()
  clk: ti: Add ti_dt_clk_name() helper to use clock-output-names
  clk: ti: Use clock-output-names for clkctrl
  clk: ti: Add ti_find_clock_provider() to use clock-output-names
  clk: ti: Optionally parse IO address from parent clock node
  clk: ti: Preserve node in ti_dt_clocks_register()
  clk: ti: Constify clkctrl_name

* clk-terminate:
  clk: actions: Make sentinel elements more obvious
  clk: clps711x: Terminate clk_div_table with sentinel element
  clk: hisilicon: Terminate clk_div_table with sentinel element
  clk: loongson1: Terminate clk_div_table with sentinel element
  clk: actions: Terminate clk_div_table with sentinel element

* clk-cleanup:
  clk: zynq: Update the parameters to zynq_clk_register_periph_clk
  clk: zynq: trivial warning fix
  clk: qcom: sm6125-gcc: fix typos in comments
  clk: ti: clkctrl: fix typos in comments
  clk: COMMON_CLK_LAN966X should depend on SOC_LAN966
  clk: Use of_device_get_match_data()
  clk: bcm2835: Remove unused variable
  clk: tegra: tegra124-emc: Fix missing put_device() call in emc_ensure_emc_driver
  clk: cleanup comments
  clk: socfpga: cleanup spdx tags
  • Loading branch information
bebarino committed Mar 29, 2022
5 parents 9babf95 + 3028181 + 579cdf5 + 1fdfd51 + a6aa462 commit 4222744
Show file tree
Hide file tree
Showing 57 changed files with 700 additions and 1,851 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/starfive,jh7100-audclk.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: StarFive JH7100 Audio Clock Generator

maintainers:
- Emil Renner Berthing <[email protected]>

properties:
compatible:
const: starfive,jh7100-audclk

reg:
maxItems: 1

clocks:
items:
- description: Audio source clock
- description: External 12.288MHz clock
- description: Domain 7 AHB bus clock

clock-names:
items:
- const: audio_src
- const: audio_12288
- const: dom7ahb_bus

'#clock-cells':
const: 1
description:
See <dt-bindings/clock/starfive-jh7100-audio.h> for valid indices.

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

additionalProperties: false

examples:
- |
#include <dt-bindings/clock/starfive-jh7100.h>
clock-controller@10480000 {
compatible = "starfive,jh7100-audclk";
reg = <0x10480000 0x10000>;
clocks = <&clkgen JH7100_CLK_AUDIO_SRC>,
<&clkgen JH7100_CLK_AUDIO_12288>,
<&clkgen JH7100_CLK_DOM7AHB_BUS>;
clock-names = "audio_src", "audio_12288", "dom7ahb_bus";
#clock-cells = <1>;
};
8 changes: 4 additions & 4 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -18430,12 +18430,12 @@ M: Ion Badulescu <[email protected]>
S: Odd Fixes
F: drivers/net/ethernet/adaptec/starfire*

STARFIVE JH7100 CLOCK DRIVER
STARFIVE JH7100 CLOCK DRIVERS
M: Emil Renner Berthing <[email protected]>
S: Maintained
F: Documentation/devicetree/bindings/clock/starfive,jh7100-clkgen.yaml
F: drivers/clk/starfive/clk-starfive-jh7100.c
F: include/dt-bindings/clock/starfive-jh7100.h
F: Documentation/devicetree/bindings/clock/starfive,jh7100-*.yaml
F: drivers/clk/starfive/clk-starfive-jh7100*
F: include/dt-bindings/clock/starfive-jh7100*.h

STARFIVE JH7100 PINCTRL DRIVER
M: Emil Renner Berthing <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions drivers/clk/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ config COMMON_CLK_GEMINI

config COMMON_CLK_LAN966X
bool "Generic Clock Controller driver for LAN966X SoC"
depends on SOC_LAN966 || COMPILE_TEST
help
This driver provides support for Generic Clock Controller(GCK) on
LAN966X SoC. GCK generates and supplies clock to various peripherals
Expand Down
16 changes: 8 additions & 8 deletions drivers/clk/actions/owl-s500.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@

static const struct clk_pll_table clk_audio_pll_table[] = {
{ 0, 45158400 }, { 1, 49152000 },
{ 0, 0 },
{ /* sentinel */ }
};

/* pll clocks */
Expand Down Expand Up @@ -138,46 +138,46 @@ static struct clk_factor_table sd_factor_table[] = {
{ 272, 1, 17 * 128 }, { 273, 1, 18 * 128 }, { 274, 1, 19 * 128 }, { 275, 1, 20 * 128 },
{ 276, 1, 21 * 128 }, { 277, 1, 22 * 128 }, { 278, 1, 23 * 128 }, { 279, 1, 24 * 128 },
{ 280, 1, 25 * 128 },
{ 0, 0, 0 },
{ /* sentinel */ }
};

static struct clk_factor_table de_factor_table[] = {
{ 0, 1, 1 }, { 1, 2, 3 }, { 2, 1, 2 }, { 3, 2, 5 },
{ 4, 1, 3 }, { 5, 1, 4 }, { 6, 1, 6 }, { 7, 1, 8 },
{ 8, 1, 12 },
{ 0, 0, 0 },
{ /* sentinel */ }
};

static struct clk_factor_table hde_factor_table[] = {
{ 0, 1, 1 }, { 1, 2, 3 }, { 2, 1, 2 }, { 3, 2, 5 },
{ 4, 1, 3 }, { 5, 1, 4 }, { 6, 1, 6 }, { 7, 1, 8 },
{ 0, 0, 0 },
{ /* sentinel */ }
};

static struct clk_div_table rmii_ref_div_table[] = {
{ 0, 4 }, { 1, 10 },
{ 0, 0 },
{ /* sentinel */ }
};

static struct clk_div_table std12rate_div_table[] = {
{ 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 },
{ 4, 5 }, { 5, 6 }, { 6, 7 }, { 7, 8 },
{ 8, 9 }, { 9, 10 }, { 10, 11 }, { 11, 12 },
{ 0, 0 },
{ /* sentinel */ }
};

static struct clk_div_table i2s_div_table[] = {
{ 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 },
{ 4, 6 }, { 5, 8 }, { 6, 12 }, { 7, 16 },
{ 8, 24 },
{ 0, 0 },
{ /* sentinel */ }
};

static struct clk_div_table nand_div_table[] = {
{ 0, 1 }, { 1, 2 }, { 2, 4 }, { 3, 6 },
{ 4, 8 }, { 5, 10 }, { 6, 12 }, { 7, 14 },
{ 8, 16 }, { 9, 18 }, { 10, 20 }, { 11, 22 },
{ 0, 0 },
{ /* sentinel */ }
};

/* mux clock */
Expand Down
17 changes: 10 additions & 7 deletions drivers/clk/actions/owl-s700.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

static struct clk_pll_table clk_audio_pll_table[] = {
{0, 45158400}, {1, 49152000},
{0, 0},
{ /* sentinel */ }
};

static struct clk_pll_table clk_cvbs_pll_table[] = {
Expand All @@ -82,7 +82,8 @@ static struct clk_pll_table clk_cvbs_pll_table[] = {
{33, 35 * 12000000}, {34, 36 * 12000000}, {35, 37 * 12000000},
{36, 38 * 12000000}, {37, 39 * 12000000}, {38, 40 * 12000000},
{39, 41 * 12000000}, {40, 42 * 12000000}, {41, 43 * 12000000},
{42, 44 * 12000000}, {43, 45 * 12000000}, {0, 0},
{42, 44 * 12000000}, {43, 45 * 12000000},
{ /* sentinel */ }
};

/* pll clocks */
Expand Down Expand Up @@ -137,7 +138,7 @@ static struct clk_factor_table sd_factor_table[] = {
{276, 1, 21 * 128}, {277, 1, 22 * 128}, {278, 1, 23 * 128}, {279, 1, 24 * 128},
{280, 1, 25 * 128}, {281, 1, 26 * 128},

{0, 0},
{ /* sentinel */ }
};

static struct clk_factor_table lcd_factor_table[] = {
Expand All @@ -150,18 +151,19 @@ static struct clk_factor_table lcd_factor_table[] = {
{256, 1, 1 * 7}, {257, 1, 2 * 7}, {258, 1, 3 * 7}, {259, 1, 4 * 7},
{260, 1, 5 * 7}, {261, 1, 6 * 7}, {262, 1, 7 * 7}, {263, 1, 8 * 7},
{264, 1, 9 * 7}, {265, 1, 10 * 7}, {266, 1, 11 * 7}, {267, 1, 12 * 7},
{0, 0},
{ /* sentinel */ }
};

static struct clk_div_table hdmia_div_table[] = {
{0, 1}, {1, 2}, {2, 3}, {3, 4},
{4, 6}, {5, 8}, {6, 12}, {7, 16},
{8, 24},
{0, 0},
{ /* sentinel */ }
};

static struct clk_div_table rmii_div_table[] = {
{0, 4}, {1, 10},
{ /* sentinel */ }
};

/* divider clocks */
Expand All @@ -178,13 +180,14 @@ static OWL_DIVIDER(clk_rmii_ref, "rmii_ref", "ethernet_pll", CMU_ETHERNETPLL, 2,
static struct clk_factor_table de_factor_table[] = {
{0, 1, 1}, {1, 2, 3}, {2, 1, 2}, {3, 2, 5},
{4, 1, 3}, {5, 1, 4}, {6, 1, 6}, {7, 1, 8},
{8, 1, 12}, {0, 0, 0},
{8, 1, 12},
{ /* sentinel */ }
};

static struct clk_factor_table hde_factor_table[] = {
{0, 1, 1}, {1, 2, 3}, {2, 1, 2}, {3, 2, 5},
{4, 1, 3}, {5, 1, 4}, {6, 1, 6}, {7, 1, 8},
{0, 0, 0},
{ /* sentinel */ }
};

/* gate clocks */
Expand Down
26 changes: 13 additions & 13 deletions drivers/clk/actions/owl-s900.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@

static struct clk_pll_table clk_audio_pll_table[] = {
{ 0, 45158400 }, { 1, 49152000 },
{ 0, 0 },
{ /* sentinel */ }
};

static struct clk_pll_table clk_edp_pll_table[] = {
{ 0, 810000000 }, { 1, 135000000 }, { 2, 270000000 },
{ 0, 0 },
{ /* sentinel */ }
};

/* pll clocks */
Expand Down Expand Up @@ -120,41 +120,41 @@ static struct clk_div_table nand_div_table[] = {
{ 4, 8 }, { 5, 10 }, { 6, 12 }, { 7, 14 },
{ 8, 16 }, { 9, 18 }, { 10, 20 }, { 11, 22 },
{ 12, 24 }, { 13, 26 }, { 14, 28 }, { 15, 30 },
{ 0, 0 },
{ /* sentinel */ }
};

static struct clk_div_table apb_div_table[] = {
{ 1, 2 }, { 2, 3 }, { 3, 4 },
{ 0, 0 },
{ /* sentinel */ }
};

static struct clk_div_table eth_mac_div_table[] = {
{ 0, 2 }, { 1, 4 },
{ 0, 0 },
{ /* sentinel */ }
};

static struct clk_div_table rmii_ref_div_table[] = {
{ 0, 4 }, { 1, 10 },
{ 0, 0 },
{ /* sentinel */ }
};

static struct clk_div_table usb3_mac_div_table[] = {
{ 1, 2 }, { 2, 3 }, { 3, 4 },
{ 0, 8 },
{ /* sentinel */ }
};

static struct clk_div_table i2s_div_table[] = {
{ 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 },
{ 4, 6 }, { 5, 8 }, { 6, 12 }, { 7, 16 },
{ 8, 24 },
{ 0, 0 },
{ /* sentinel */ }
};

static struct clk_div_table hdmia_div_table[] = {
{ 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 },
{ 4, 6 }, { 5, 8 }, { 6, 12 }, { 7, 16 },
{ 8, 24 },
{ 0, 0 },
{ /* sentinel */ }
};

/* divider clocks */
Expand Down Expand Up @@ -185,24 +185,24 @@ static struct clk_factor_table sd_factor_table[] = {
{ 280, 1, 25 * 128 }, { 281, 1, 26 * 128 }, { 282, 1, 27 * 128 }, { 283, 1, 28 * 128 },
{ 284, 1, 29 * 128 }, { 285, 1, 30 * 128 }, { 286, 1, 31 * 128 }, { 287, 1, 32 * 128 },

{ 0, 0 },
{ /* sentinel */ }
};

static struct clk_factor_table dmm_factor_table[] = {
{ 0, 1, 1 }, { 1, 2, 3 }, { 2, 1, 2 }, { 3, 1, 3 },
{ 4, 1, 4 },
{ 0, 0, 0 },
{ /* sentinel */ }
};

static struct clk_factor_table noc_factor_table[] = {
{ 0, 1, 1 }, { 1, 2, 3 }, { 2, 1, 2 }, { 3, 1, 3 }, { 4, 1, 4 },
{ 0, 0, 0 },
{ /* sentinel */ }
};

static struct clk_factor_table bisp_factor_table[] = {
{ 0, 1, 1 }, { 1, 2, 3 }, { 2, 1, 2 }, { 3, 2, 5 },
{ 4, 1, 3 }, { 5, 1, 4 }, { 6, 1, 6 }, { 7, 1, 8 },
{ 0, 0, 0 },
{ /* sentinel */ }
};

/* factor clocks */
Expand Down
2 changes: 1 addition & 1 deletion drivers/clk/at91/sckc.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ static int clk_sama5d4_slow_osc_prepare(struct clk_hw *hw)

/*
* Assume that if it has already been selected (for example by the
* bootloader), enough time has aready passed.
* bootloader), enough time has already passed.
*/
if ((readl(osc->sckcr) & osc->bits->cr_oscsel)) {
osc->prepared = true;
Expand Down
2 changes: 1 addition & 1 deletion drivers/clk/axis/clk-artpec6.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* ARTPEC-6 clock initialization
*
* Copyright 2015-2016 Axis Comunications AB.
* Copyright 2015-2016 Axis Communications AB.
*/

#include <linux/clk-provider.h>
Expand Down
2 changes: 0 additions & 2 deletions drivers/clk/bcm/clk-bcm2835.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,10 +939,8 @@ static u32 bcm2835_clock_choose_div(struct clk_hw *hw,
u32 unused_frac_mask =
GENMASK(CM_DIV_FRAC_BITS - data->frac_bits, 0) >> 1;
u64 temp = (u64)parent_rate << CM_DIV_FRAC_BITS;
u64 rem;
u32 div, mindiv, maxdiv;

rem = do_div(temp, rate);
div = temp;
div &= ~unused_frac_mask;

Expand Down
2 changes: 1 addition & 1 deletion drivers/clk/bcm/clk-iproc.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
* Parameters for VCO frequency configuration
*
* VCO frequency =
* ((ndiv_int + ndiv_frac / 2^20) * (ref freqeuncy / pdiv)
* ((ndiv_int + ndiv_frac / 2^20) * (ref frequency / pdiv)
*/
struct iproc_pll_vco_param {
unsigned long rate;
Expand Down
2 changes: 1 addition & 1 deletion drivers/clk/bcm/clk-kona-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ static bool kona_clk_valid(struct kona_clk *bcm_clk)
* placeholders for non-supported clocks. Keep track of the
* position of each clock name in the original array.
*
* Allocates an array of pointers to to hold the names of all
* Allocates an array of pointers to hold the names of all
* non-null entries in the original array, and returns a pointer to
* that array in *names. This will be used for registering the
* clock with the common clock code. On successful return,
Expand Down
2 changes: 2 additions & 0 deletions drivers/clk/clk-clps711x.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ static const struct clk_div_table spi_div_table[] = {
{ .val = 1, .div = 8, },
{ .val = 2, .div = 2, },
{ .val = 3, .div = 1, },
{ /* sentinel */ }
};

static const struct clk_div_table timer_div_table[] = {
{ .val = 0, .div = 256, },
{ .val = 1, .div = 1, },
{ /* sentinel */ }
};

struct clps711x_clk {
Expand Down
2 changes: 1 addition & 1 deletion drivers/clk/clk-fractional-divider.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* and assume that the IP, that needs m and n, has also its own
* prescaler, which is capable to divide by 2^scale. In this way
* we get the denominator to satisfy the desired range (2) and
* at the same time much much better result of m and n than simple
* at the same time a much better result of m and n than simple
* saturated values.
*/

Expand Down
6 changes: 1 addition & 5 deletions drivers/clk/clk-oxnas.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,11 @@ static int oxnas_stdclk_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
const struct oxnas_stdclk_data *data;
const struct of_device_id *id;
struct regmap *regmap;
int ret;
int i;

id = of_match_device(oxnas_stdclk_dt_ids, &pdev->dev);
if (!id)
return -ENODEV;
data = id->data;
data = of_device_get_match_data(&pdev->dev);

regmap = syscon_node_to_regmap(of_get_parent(np));
if (IS_ERR(regmap)) {
Expand Down
Loading

0 comments on commit 4222744

Please sign in to comment.