Skip to content

Commit dba6f54

Browse files
author
Georgi Djakov
committed
Merge branch 'icc-mtk' into icc-next
This series is a combination of binding changes, driver cleanups and new driver code to enable the interconnect on the MediaTek MT8196 SoC. * icc-mtk dt-bindings: interconnect: mt8183-emi: Add support for MT8196 EMI interconnect: mediatek: Add support for MediaTek MT8196 EMI ICC interconnect: mediatek: Don't hijack parent device interconnect: mediatek: Aggregate bandwidth with saturating add Link: https://lore.kernel.org/r/20251124-mt8196-dvfsrc-v2-0-d9c1334db9f3@collabora.com Signed-off-by: Georgi Djakov <djakov@kernel.org>
2 parents 06ebbe7 + 6ffd02b commit dba6f54

6 files changed

Lines changed: 446 additions & 3 deletions

File tree

Documentation/devicetree/bindings/interconnect/mediatek,mt8183-emi.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ properties:
4040
enum:
4141
- mediatek,mt8183-emi
4242
- mediatek,mt8195-emi
43+
- mediatek,mt8196-emi
4344

4445
'#interconnect-cells':
4546
const: 1

drivers/interconnect/mediatek/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,10 @@ config INTERCONNECT_MTK_MT8195
2727
help
2828
This is a driver for the MediaTek bus interconnect on MT8195-based
2929
platforms.
30+
31+
config INTERCONNECT_MTK_MT8196
32+
tristate "MediaTek MT8196 interconnect driver"
33+
depends on INTERCONNECT_MTK_DVFSRC_EMI
34+
help
35+
This is a driver for the MediaTek bus interconnect on MT8196-based
36+
platforms.

drivers/interconnect/mediatek/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
obj-$(CONFIG_INTERCONNECT_MTK_DVFSRC_EMI) += icc-emi.o
44
obj-$(CONFIG_INTERCONNECT_MTK_MT8183) += mt8183.o
55
obj-$(CONFIG_INTERCONNECT_MTK_MT8195) += mt8195.o
6+
obj-$(CONFIG_INTERCONNECT_MTK_MT8195) += mt8196.o

drivers/interconnect/mediatek/icc-emi.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/module.h>
1313
#include <linux/of.h>
1414
#include <linux/of_platform.h>
15+
#include <linux/overflow.h>
1516
#include <linux/platform_device.h>
1617
#include <linux/soc/mediatek/dvfsrc.h>
1718

@@ -22,7 +23,9 @@ static int mtk_emi_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw,
2223
{
2324
struct mtk_icc_node *in = node->data;
2425

25-
*agg_avg += avg_bw;
26+
if (check_add_overflow(*agg_avg, avg_bw, agg_avg))
27+
*agg_avg = U32_MAX;
28+
2629
*agg_peak = max_t(u32, *agg_peak, peak_bw);
2730

2831
in->sum_avg = *agg_avg;
@@ -40,7 +43,7 @@ static int mtk_emi_icc_set(struct icc_node *src, struct icc_node *dst)
4043
if (unlikely(!src->provider))
4144
return -EINVAL;
4245

43-
dev = src->provider->dev;
46+
dev = src->provider->dev->parent;
4447

4548
switch (node->ep) {
4649
case 0:
@@ -97,7 +100,7 @@ int mtk_emi_icc_probe(struct platform_device *pdev)
97100
if (!data)
98101
return -ENOMEM;
99102

100-
provider->dev = pdev->dev.parent;
103+
provider->dev = dev;
101104
provider->set = mtk_emi_icc_set;
102105
provider->aggregate = mtk_emi_icc_aggregate;
103106
provider->xlate = of_icc_xlate_onecell;

0 commit comments

Comments
 (0)