Skip to content

Commit 64c21f2

Browse files
committed
Merge branch 'clk-fixes' into clk-next
Resolve conflicts with i.MX95 changes 88768d6 ("clk: imx95-blk-ctl: Rename lvds and displaymix csr blk") in clk-imx and aacc875 ("clk: imx: Fix an out-of-bounds access in dispmix_csr_clk_dev_data") in clk-fixes. * clk-fixes: clk: sunxi-ng: v3s: Fix TCON clock parents clk: sunxi-ng: v3s: Fix CSI1 MCLK clock name clk: sunxi-ng: v3s: Fix CSI SCLK clock name dt-bindings: clock: mediatek: Add #reset-cells property for MT8188 clk: imx: Fix an out-of-bounds access in dispmix_csr_clk_dev_data clk: scmi: Handle case where child clocks are initialized before their parents clk: sunxi-ng: a523: Mark MBUS clock as critical
2 parents 3cf186e + e4b2a0c commit 64c21f2

File tree

9 files changed

+27
-21
lines changed

9 files changed

+27
-21
lines changed

Documentation/devicetree/bindings/clock/mediatek,mt8188-clock.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ properties:
5252
'#clock-cells':
5353
const: 1
5454

55+
'#reset-cells':
56+
const: 1
57+
5558
required:
5659
- compatible
5760
- reg

Documentation/devicetree/bindings/media/allwinner,sun6i-a31-csi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ examples:
110110
reg = <0x01cb4000 0x1000>;
111111
interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
112112
clocks = <&ccu CLK_BUS_CSI>,
113-
<&ccu CLK_CSI1_SCLK>,
113+
<&ccu CLK_CSI_SCLK>,
114114
<&ccu CLK_DRAM_CSI>;
115115
clock-names = "bus",
116116
"mod",

Documentation/devicetree/bindings/media/allwinner,sun6i-a31-isp.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ examples:
7979
reg = <0x01cb8000 0x1000>;
8080
interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
8181
clocks = <&ccu CLK_BUS_CSI>,
82-
<&ccu CLK_CSI1_SCLK>,
82+
<&ccu CLK_CSI_SCLK>,
8383
<&ccu CLK_DRAM_CSI>;
8484
clock-names = "bus", "mod", "ram";
8585
resets = <&ccu RST_BUS_CSI>;

Documentation/devicetree/bindings/media/allwinner,sun6i-a31-mipi-csi2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ examples:
103103
reg = <0x01cb1000 0x1000>;
104104
interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
105105
clocks = <&ccu CLK_BUS_CSI>,
106-
<&ccu CLK_CSI1_SCLK>;
106+
<&ccu CLK_CSI_SCLK>;
107107
clock-names = "bus", "mod";
108108
resets = <&ccu RST_BUS_CSI>;
109109

arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@
652652
reg = <0x01cb4000 0x3000>;
653653
interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
654654
clocks = <&ccu CLK_BUS_CSI>,
655-
<&ccu CLK_CSI1_SCLK>,
655+
<&ccu CLK_CSI_SCLK>,
656656
<&ccu CLK_DRAM_CSI>;
657657
clock-names = "bus", "mod", "ram";
658658
resets = <&ccu RST_BUS_CSI>;

drivers/clk/clk-scmi.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ static int scmi_clocks_probe(struct scmi_device *sdev)
404404
const struct scmi_handle *handle = sdev->handle;
405405
struct scmi_protocol_handle *ph;
406406
const struct clk_ops *scmi_clk_ops_db[SCMI_MAX_CLK_OPS] = {};
407+
struct scmi_clk *sclks;
407408

408409
if (!handle)
409410
return -ENODEV;
@@ -430,18 +431,21 @@ static int scmi_clocks_probe(struct scmi_device *sdev)
430431
transport_is_atomic = handle->is_transport_atomic(handle,
431432
&atomic_threshold_us);
432433

434+
sclks = devm_kcalloc(dev, count, sizeof(*sclks), GFP_KERNEL);
435+
if (!sclks)
436+
return -ENOMEM;
437+
438+
for (idx = 0; idx < count; idx++)
439+
hws[idx] = &sclks[idx].hw;
440+
433441
for (idx = 0; idx < count; idx++) {
434-
struct scmi_clk *sclk;
442+
struct scmi_clk *sclk = &sclks[idx];
435443
const struct clk_ops *scmi_ops;
436444

437-
sclk = devm_kzalloc(dev, sizeof(*sclk), GFP_KERNEL);
438-
if (!sclk)
439-
return -ENOMEM;
440-
441445
sclk->info = scmi_proto_clk_ops->info_get(ph, idx);
442446
if (!sclk->info) {
443447
dev_dbg(dev, "invalid clock info for idx %d\n", idx);
444-
devm_kfree(dev, sclk);
448+
hws[idx] = NULL;
445449
continue;
446450
}
447451

@@ -479,13 +483,11 @@ static int scmi_clocks_probe(struct scmi_device *sdev)
479483
if (err) {
480484
dev_err(dev, "failed to register clock %d\n", idx);
481485
devm_kfree(dev, sclk->parent_data);
482-
devm_kfree(dev, sclk);
483486
hws[idx] = NULL;
484487
} else {
485488
dev_dbg(dev, "Registered clock:%s%s\n",
486489
sclk->info->name,
487490
scmi_ops->enable ? " (atomic ops)" : "");
488-
hws[idx] = &sclk->hw;
489491
}
490492
}
491493

drivers/clk/sunxi-ng/ccu-sun55i-a523.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,8 @@ static SUNXI_CCU_MP_DATA_WITH_MUX_GATE_FEAT(mbus_clk, "mbus", mbus_parents,
385385
0, 0, /* no P */
386386
24, 3, /* mux */
387387
BIT(31), /* gate */
388-
0, CCU_FEATURE_UPDATE_BIT);
388+
CLK_IS_CRITICAL,
389+
CCU_FEATURE_UPDATE_BIT);
389390

390391
static const struct clk_hw *mbus_hws[] = { &mbus_clk.common.hw };
391392

drivers/clk/sunxi-ng/ccu-sun8i-v3s.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ static SUNXI_CCU_M_WITH_MUX_GATE(de_clk, "de", de_parents,
350350
0x104, 0, 4, 24, 3, BIT(31),
351351
CLK_SET_RATE_NO_REPARENT);
352352

353-
static const char * const tcon_parents[] = { "pll-video" };
353+
static const char * const tcon_parents[] = { "pll-video", "pll-periph0" };
354354
static SUNXI_CCU_M_WITH_MUX_GATE(tcon_clk, "tcon", tcon_parents,
355355
0x118, 0, 4, 24, 3, BIT(31),
356356
CLK_SET_RATE_NO_REPARENT);
@@ -363,11 +363,11 @@ static const char * const csi_mclk_parents[] = { "osc24M", "pll-video",
363363
static SUNXI_CCU_M_WITH_MUX_GATE(csi0_mclk_clk, "csi0-mclk", csi_mclk_parents,
364364
0x130, 0, 5, 8, 3, BIT(15), 0);
365365

366-
static const char * const csi1_sclk_parents[] = { "pll-video", "pll-isp" };
367-
static SUNXI_CCU_M_WITH_MUX_GATE(csi1_sclk_clk, "csi-sclk", csi1_sclk_parents,
366+
static const char * const csi_sclk_parents[] = { "pll-video", "pll-isp" };
367+
static SUNXI_CCU_M_WITH_MUX_GATE(csi_sclk_clk, "csi-sclk", csi_sclk_parents,
368368
0x134, 16, 4, 24, 3, BIT(31), 0);
369369

370-
static SUNXI_CCU_M_WITH_MUX_GATE(csi1_mclk_clk, "csi-mclk", csi_mclk_parents,
370+
static SUNXI_CCU_M_WITH_MUX_GATE(csi1_mclk_clk, "csi1-mclk", csi_mclk_parents,
371371
0x134, 0, 5, 8, 3, BIT(15), 0);
372372

373373
static SUNXI_CCU_M_WITH_GATE(ve_clk, "ve", "pll-ve",
@@ -453,7 +453,7 @@ static struct ccu_common *sun8i_v3s_ccu_clks[] = {
453453
&tcon_clk.common,
454454
&csi_misc_clk.common,
455455
&csi0_mclk_clk.common,
456-
&csi1_sclk_clk.common,
456+
&csi_sclk_clk.common,
457457
&csi1_mclk_clk.common,
458458
&ve_clk.common,
459459
&ac_dig_clk.common,
@@ -552,7 +552,7 @@ static struct clk_hw_onecell_data sun8i_v3s_hw_clks = {
552552
[CLK_TCON0] = &tcon_clk.common.hw,
553553
[CLK_CSI_MISC] = &csi_misc_clk.common.hw,
554554
[CLK_CSI0_MCLK] = &csi0_mclk_clk.common.hw,
555-
[CLK_CSI1_SCLK] = &csi1_sclk_clk.common.hw,
555+
[CLK_CSI_SCLK] = &csi_sclk_clk.common.hw,
556556
[CLK_CSI1_MCLK] = &csi1_mclk_clk.common.hw,
557557
[CLK_VE] = &ve_clk.common.hw,
558558
[CLK_AC_DIG] = &ac_dig_clk.common.hw,
@@ -634,7 +634,7 @@ static struct clk_hw_onecell_data sun8i_v3_hw_clks = {
634634
[CLK_TCON0] = &tcon_clk.common.hw,
635635
[CLK_CSI_MISC] = &csi_misc_clk.common.hw,
636636
[CLK_CSI0_MCLK] = &csi0_mclk_clk.common.hw,
637-
[CLK_CSI1_SCLK] = &csi1_sclk_clk.common.hw,
637+
[CLK_CSI_SCLK] = &csi_sclk_clk.common.hw,
638638
[CLK_CSI1_MCLK] = &csi1_mclk_clk.common.hw,
639639
[CLK_VE] = &ve_clk.common.hw,
640640
[CLK_AC_DIG] = &ac_dig_clk.common.hw,

include/dt-bindings/clock/sun8i-v3s-ccu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
#define CLK_TCON0 64
9797
#define CLK_CSI_MISC 65
9898
#define CLK_CSI0_MCLK 66
99-
#define CLK_CSI1_SCLK 67
99+
#define CLK_CSI_SCLK 67
100100
#define CLK_CSI1_MCLK 68
101101
#define CLK_VE 69
102102
#define CLK_AC_DIG 70

0 commit comments

Comments
 (0)