Skip to content

Commit 5c4e0aa

Browse files
AngeloGioacchino Del RegnoMarc Zyngier
authored andcommitted
irqchip/irq-mtk-cirq: Add support for System CIRQ on MT8192
On some SoCs the System CIRQ register layout is slightly different, as there are more registers per function and in some cases other differences later in the layout: this is seen on at least MT8192, but it's also valid for some other "contemporary" SoCs both for Chromebooks and for smartphones. Add the new "v2" register layout and use it if the compatible "mediatek,mt8192-cirq" is found. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20221128092217.36552-5-angelogioacchino.delregno@collabora.com
1 parent 45ac019 commit 5c4e0aa

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

drivers/irqchip/irq-mtk-cirq.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ static const u32 mtk_cirq_regoffs_v1[] = {
3939
[CIRQ_CONTROL] = 0x300,
4040
};
4141

42+
static const u32 mtk_cirq_regoffs_v2[] = {
43+
[CIRQ_STA] = 0x0,
44+
[CIRQ_ACK] = 0x80,
45+
[CIRQ_MASK_SET] = 0x180,
46+
[CIRQ_MASK_CLR] = 0x200,
47+
[CIRQ_SENS_SET] = 0x300,
48+
[CIRQ_SENS_CLR] = 0x380,
49+
[CIRQ_POL_SET] = 0x480,
50+
[CIRQ_POL_CLR] = 0x500,
51+
[CIRQ_CONTROL] = 0x600,
52+
};
53+
4254
#define CIRQ_EN 0x1
4355
#define CIRQ_EDGE 0x2
4456
#define CIRQ_FLUSH 0x4
@@ -277,6 +289,7 @@ static const struct of_device_id mtk_cirq_of_match[] = {
277289
{ .compatible = "mediatek,mt2701-cirq", .data = &mtk_cirq_regoffs_v1 },
278290
{ .compatible = "mediatek,mt8135-cirq", .data = &mtk_cirq_regoffs_v1 },
279291
{ .compatible = "mediatek,mt8173-cirq", .data = &mtk_cirq_regoffs_v1 },
292+
{ .compatible = "mediatek,mt8192-cirq", .data = &mtk_cirq_regoffs_v2 },
280293
{ /* sentinel */ }
281294
};
282295

0 commit comments

Comments
 (0)