Skip to content

Commit 53c9c27

Browse files
committed
Merge branch 'clk-fixes' into clk-next
* clk-fixes: clk: clk-loongson2: Fix the number count of clk provider clk: mmp2: call pm_genpd_init() only after genpd.name is set clk: sunxi-ng: a100: enable MMC clock reparenting clk: clk-imx8mp-audiomix: fix function signature clk: thead: Fix TH1520 emmc and shdci clock rate
2 parents 1d2da92 + 5fb33b6 commit 53c9c27

File tree

5 files changed

+22
-7
lines changed

5 files changed

+22
-7
lines changed

drivers/clk/clk-loongson2.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ static int loongson2_clk_probe(struct platform_device *pdev)
294294
return -EINVAL;
295295

296296
for (p = data; p->name; p++)
297-
clks_num++;
297+
clks_num = max(clks_num, p->id + 1);
298298

299299
clp = devm_kzalloc(dev, struct_size(clp, clk_data.hws, clks_num),
300300
GFP_KERNEL);
@@ -309,6 +309,9 @@ static int loongson2_clk_probe(struct platform_device *pdev)
309309
clp->clk_data.num = clks_num;
310310
clp->dev = dev;
311311

312+
/* Avoid returning NULL for unused id */
313+
memset_p((void **)clp->clk_data.hws, ERR_PTR(-ENOENT), clks_num);
314+
312315
for (i = 0; i < clks_num; i++) {
313316
p = &data[i];
314317
switch (p->type) {

drivers/clk/imx/clk-imx8mp-audiomix.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ static int clk_imx8mp_audiomix_reset_controller_register(struct device *dev,
278278

279279
#else /* !CONFIG_RESET_CONTROLLER */
280280

281-
static int clk_imx8mp_audiomix_reset_controller_register(struct clk_imx8mp_audiomix_priv *priv)
281+
static int clk_imx8mp_audiomix_reset_controller_register(struct device *dev,
282+
struct clk_imx8mp_audiomix_priv *priv)
282283
{
283284
return 0;
284285
}

drivers/clk/mmp/pwr-island.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ struct generic_pm_domain *mmp_pm_domain_register(const char *name,
106106
pm_domain->flags = flags;
107107
pm_domain->lock = lock;
108108

109-
pm_genpd_init(&pm_domain->genpd, NULL, true);
110109
pm_domain->genpd.name = name;
111110
pm_domain->genpd.power_on = mmp_pm_domain_power_on;
112111
pm_domain->genpd.power_off = mmp_pm_domain_power_off;
112+
pm_genpd_init(&pm_domain->genpd, NULL, true);
113113

114114
return &pm_domain->genpd;
115115
}

drivers/clk/sunxi-ng/ccu-sun50i-a100.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,23 +436,23 @@ static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc0_clk, "mmc0", mmc_parents, 0x830,
436436
24, 2, /* mux */
437437
BIT(31), /* gate */
438438
2, /* post-div */
439-
CLK_SET_RATE_NO_REPARENT);
439+
0);
440440

441441
static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc1_clk, "mmc1", mmc_parents, 0x834,
442442
0, 4, /* M */
443443
8, 2, /* P */
444444
24, 2, /* mux */
445445
BIT(31), /* gate */
446446
2, /* post-div */
447-
CLK_SET_RATE_NO_REPARENT);
447+
0);
448448

449449
static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc2_clk, "mmc2", mmc_parents, 0x838,
450450
0, 4, /* M */
451451
8, 2, /* P */
452452
24, 2, /* mux */
453453
BIT(31), /* gate */
454454
2, /* post-div */
455-
CLK_SET_RATE_NO_REPARENT);
455+
0);
456456

457457
static SUNXI_CCU_GATE(bus_mmc0_clk, "bus-mmc0", "ahb3", 0x84c, BIT(0), 0);
458458
static SUNXI_CCU_GATE(bus_mmc1_clk, "bus-mmc1", "ahb3", 0x84c, BIT(1), 0);

drivers/clk/thead/clk-th1520-ap.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,13 @@ static struct ccu_div dpu1_clk = {
779779
},
780780
};
781781

782+
static CLK_FIXED_FACTOR_HW(emmc_sdio_ref_clk, "emmc-sdio-ref",
783+
&video_pll_clk.common.hw, 4, 1, 0);
784+
785+
static const struct clk_parent_data emmc_sdio_ref_clk_pd[] = {
786+
{ .hw = &emmc_sdio_ref_clk.hw },
787+
};
788+
782789
static CCU_GATE(CLK_BROM, brom_clk, "brom", ahb2_cpusys_hclk_pd, 0x100, BIT(4), 0);
783790
static CCU_GATE(CLK_BMU, bmu_clk, "bmu", axi4_cpusys2_aclk_pd, 0x100, BIT(5), 0);
784791
static CCU_GATE(CLK_AON2CPU_A2X, aon2cpu_a2x_clk, "aon2cpu-a2x", axi4_cpusys2_aclk_pd,
@@ -798,7 +805,7 @@ static CCU_GATE(CLK_PERISYS_APB4_HCLK, perisys_apb4_hclk, "perisys-apb4-hclk", p
798805
0x150, BIT(12), 0);
799806
static CCU_GATE(CLK_NPU_AXI, npu_axi_clk, "npu-axi", axi_aclk_pd, 0x1c8, BIT(5), 0);
800807
static CCU_GATE(CLK_CPU2VP, cpu2vp_clk, "cpu2vp", axi_aclk_pd, 0x1e0, BIT(13), 0);
801-
static CCU_GATE(CLK_EMMC_SDIO, emmc_sdio_clk, "emmc-sdio", video_pll_clk_pd, 0x204, BIT(30), 0);
808+
static CCU_GATE(CLK_EMMC_SDIO, emmc_sdio_clk, "emmc-sdio", emmc_sdio_ref_clk_pd, 0x204, BIT(30), 0);
802809
static CCU_GATE(CLK_GMAC1, gmac1_clk, "gmac1", gmac_pll_clk_pd, 0x204, BIT(26), 0);
803810
static CCU_GATE(CLK_PADCTRL1, padctrl1_clk, "padctrl1", perisys_apb_pclk_pd, 0x204, BIT(24), 0);
804811
static CCU_GATE(CLK_DSMART, dsmart_clk, "dsmart", perisys_apb_pclk_pd, 0x204, BIT(23), 0);
@@ -1060,6 +1067,10 @@ static int th1520_clk_probe(struct platform_device *pdev)
10601067
return ret;
10611068
priv->hws[CLK_PLL_GMAC_100M] = &gmac_pll_clk_100m.hw;
10621069

1070+
ret = devm_clk_hw_register(dev, &emmc_sdio_ref_clk.hw);
1071+
if (ret)
1072+
return ret;
1073+
10631074
ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, priv);
10641075
if (ret)
10651076
return ret;

0 commit comments

Comments
 (0)