From nobody Sat Feb 7 09:59:00 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 734D523F424; Fri, 23 Jan 2026 18:20:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192441; cv=none; b=bqJIInXv20RJSRbssQ6W5tk9/4GtYf6QzJHBybw88nnnLC8Fa10muwOYu0AhkynlttfF17weZF6JPwshCC867VAjaQ+o6186cEKqdOhYKRdkQ0n5F+SpzQNtpo/n8YOaG+gzB6F+Z9VBppmG1v3n1Pco3UjoDtwjSMHD/YxPgns= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192441; c=relaxed/simple; bh=ZYSm2/Keq/xZr342ARVhDfVvUCWn7TDSKJ0l+IFJlxE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=t2JwXMZlApHZxWY8ayOX45JL8xr/oN5xYVweiLlRcy4Ca0GYlR/t1pDMLDmFCIbsTOMJhEMFtObSmNc5HlHhEEHx942mYIGlegbWhtmWEpLF/0udVICM/pdIkZw0pOTT+iNighps3lTThyn5NLBpNGQFIE7CtmoARdrVUltozOE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BiWZF/ho; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BiWZF/ho" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15E62C116D0; Fri, 23 Jan 2026 18:20:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769192441; bh=ZYSm2/Keq/xZr342ARVhDfVvUCWn7TDSKJ0l+IFJlxE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BiWZF/hoAFSTUeRcQSo8r0NDoownP9t5QQflffB+tlDLAAtx/YrxNDyiXY4/Lhxi/ 8GhGtOfULS7QgRQbHUv0U3rhR04l9/sZeUBJeduLiSudCwplg8CVTtKTyW7cAWLqrt htUO/nIkmM2vZq8qvTFUWg5dHJy9Q+wGr5CrrworTsYBFwyri5ecihuB5V8vGwyTmE qdw+2OhBoTuiYmjIP/JAYb7aw8mehnSLitldEPsaUt2LYiOwk3B+SD30ldRpP9PGhp DRBXFRHKhquIMkgXZQeMcvaGj5CNhKAO8x2xXCokY2an0GFWO5kABEYMP1s12ksjHM WBbZHz0vPlyqw== From: Stephen Boyd To: Greg Kroah-Hartman Cc: AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org, patches@lists.linux.dev, "Rob Herring (Arm)" , =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= Subject: [PATCH 01/10] dt-bindings: spmi: Add MediaTek MT8196 SPMI 2 Arbiter/Controllers Date: Fri, 23 Jan 2026 10:20:29 -0800 Message-ID: <20260123182039.224314-2-sboyd@kernel.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20260123182039.224314-1-sboyd@kernel.org> References: <20260123182039.224314-1-sboyd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: AngeloGioacchino Del Regno Document the MT8196 SPMI 2.0 Controller with a new schema. This is a MIPI SPMI 2.0 compliant IP, composed of a main arbiter and two SPMI master controllers with Request Capable Slave (RCS) support. Reviewed-by: Rob Herring (Arm) Reviewed-by: N=C3=ADcolas F. R. A. Prado Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd --- .../bindings/spmi/mediatek,mt8196-spmi.yaml | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 Documentation/devicetree/bindings/spmi/mediatek,mt8196-= spmi.yaml diff --git a/Documentation/devicetree/bindings/spmi/mediatek,mt8196-spmi.ya= ml b/Documentation/devicetree/bindings/spmi/mediatek,mt8196-spmi.yaml new file mode 100644 index 000000000000..7a534f0a1d87 --- /dev/null +++ b/Documentation/devicetree/bindings/spmi/mediatek,mt8196-spmi.yaml @@ -0,0 +1,138 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spmi/mediatek,mt8196-spmi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek MT8196 SPMI 2.0 Controller + +maintainers: + - Hsin-Hsiung Wang + - AngeloGioacchino Del Regno + +description: + The MediaTek MT8196 SoC features a SPMI version 2.0 compliant controller, + with internal wrapping arbitration logic to allow for multiple on-chip + devices to control up to two SPMI buses. + The main arbiter also acts as an interrupt controller, arbitering also + the interrupts coming from SPMI-connected devices into each of the nested + interrupt controllers from any of the present SPMI buses. + +properties: + compatible: + oneOf: + - enum: + - mediatek,mt8196-spmi + - items: + - enum: + - mediatek,mt6991-spmi + - const: mediatek,mt8196-spmi + + ranges: true + + '#address-cells': + const: 1 + + '#size-cells': + const: 1 + +patternProperties: + "^spmi@[a-f0-9]+$": + type: object + $ref: /schemas/spmi/spmi.yaml + unevaluatedProperties: false + + properties: + reg: + items: + - description: controller interface registers + - description: spmi master controller registers + + reg-names: + items: + - const: pmif + - const: spmimst + + clocks: + items: + - description: controller interface system clock + - description: controller interface timer clock + - description: spmi controller master clock + + clock-names: + items: + - const: pmif_sys_ck + - const: pmif_tmr_ck + - const: spmimst_clk_mux + + interrupts: + maxItems: 1 + + interrupt-names: + const: rcs + + interrupt-controller: true + + "#interrupt-cells": + const: 3 + description: | + cell 1: slave ID for the requested interrupt (0-15) + cell 2: the requested peripheral interrupt (0-7) + cell 3: interrupt flags indicating level-sense information, + as defined in dt-bindings/interrupt-controller/irq.h + required: + - reg + - reg-names + - clocks + - clock-names + - interrupts + - interrupt-names + - interrupt-controller + - "#interrupt-cells" + +required: + - compatible + - ranges + - '#address-cells' + - '#size-cells' + +additionalProperties: false + +examples: + - | + #include + + soc { + #address-cells =3D <2>; + #size-cells =3D <2>; + + spmi-arbiter@1c018000 { + compatible =3D "mediatek,mt8196-spmi"; + ranges =3D <0 0 0x1c018000 0x4900>; + #address-cells =3D <1>; + #size-cells =3D <1>; + + spmi@0 { + reg =3D <0 0x900>, <0x4800 0x100>; + reg-names =3D "pmif", "spmimst"; + interrupts-extended =3D <&pio 292 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names =3D "rcs"; + interrupt-controller; + #interrupt-cells =3D <3>; + clocks =3D <&pmif_sys>, <&pmif_tmr>, <&spmi_mst>; + clock-names =3D "pmif_sys_ck", "pmif_tmr_ck", "spmimst_clk_mux"; + }; + + spmi@2000 { + reg =3D <0x2000 0x900>, <0x4000 0x100>; + reg-names =3D "pmif", "spmimst"; + interrupts-extended =3D <&pio 291 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names =3D "rcs"; + interrupt-controller; + #interrupt-cells =3D <3>; + clocks =3D <&pmif_sys>, <&pmif_tmr>, <&spmi_mst>; + clock-names =3D "pmif_sys_ck", "pmif_tmr_ck", "spmimst_clk_mux"; + }; + }; + }; +... --=20 https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git From nobody Sat Feb 7 09:59:00 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9456275B03; Fri, 23 Jan 2026 18:20:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192442; cv=none; b=gUfGe5cpX2Np6NPoxvJhPPT/d4imXE/VIPqyQIWD3DJxKORycPGgFPbdLWr9Oh0RgYbZN0eoKgHpkBVGxEvziNMtoow+Pw4bWsY5p+fnJ8IduZywfLyFmWJofngG/c570KpS7LCDTQQlTtmQb3oJoVgmInvHlbRAhbp8WT6/AIk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192442; c=relaxed/simple; bh=JEwO1AlCF8MZ/HMmu0wzb4IuQbLonyw5d7BMPs5n734=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GmNrC5iVzk7vvGi/SrMFybFUw+10l6g3OLNn6Cz/k5vlQKPB9XRq+gunymTYhAsp70BaKQVh8eNYWunVteALjMBOlvG2gzVMbsLQv+QEF5q0BlIusmAH5rYaTNI5s8OeeC5vxgOFgoG/608q+1g1GMUUC7lK3rkPC1Y88gakEOY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HLFSBRpH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HLFSBRpH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FB3BC4CEF1; Fri, 23 Jan 2026 18:20:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769192441; bh=JEwO1AlCF8MZ/HMmu0wzb4IuQbLonyw5d7BMPs5n734=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HLFSBRpH27I1ATLYz5ecMI3HoXDspM0BYDUk56Gvtos90aLnFn/2kYhGBexhiz2nV NWZlexwk0YAYcmWSqFZMqDfiQz6IF8C4ePlhjKGgdVirgGd605tRyr5RMO8y5ma1Gm 7F4Y/Yv17OLphtOT2JaxpfzDcMAewXr3TKHKQg0Ie75+eeoKR/TEXT2PnAlpTBrTF2 bX2tAXjbOPVXxcDDZDU5fOq+2Rluk1HezSVydmF0ZKlJJskjGe0nqzXZ5G+hJeSP9d 97Sbl1RL97YP+DeFcjIz9ZGWGcJOri2ils1bUk75iSvO9UiTxCa/2+Q6ygEGE6JOy6 Fcz7bSN0Onpvw== From: Stephen Boyd To: Greg Kroah-Hartman Cc: AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org, patches@lists.linux.dev, =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= Subject: [PATCH 02/10] spmi: mtk-pmif: Add multi-bus support for SPMI 2.0 Date: Fri, 23 Jan 2026 10:20:30 -0800 Message-ID: <20260123182039.224314-3-sboyd@kernel.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20260123182039.224314-1-sboyd@kernel.org> References: <20260123182039.224314-1-sboyd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: AngeloGioacchino Del Regno In preparation for adding support for MT8196/MT6991 SoCs having multiple SPMI busses, move the bus specific parameters into a new pmif_bus structure and keep the SoC-specific data in the already existing struct pmif, and add means to register multiple SPMI controllers. While this needs a different devicetree node structure, where each of the controllers are in subnodes of a main SPMI node, and where each has its own resources (iospaces and clocks), support for the legacy single-controller was retained and doesn't require any DT change in the currently supported SoCs. Reviewed-by: N=C3=ADcolas F. R. A. Prado Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd --- drivers/spmi/spmi-mtk-pmif.c | 235 +++++++++++++++++++++++------------ 1 file changed, 157 insertions(+), 78 deletions(-) diff --git a/drivers/spmi/spmi-mtk-pmif.c b/drivers/spmi/spmi-mtk-pmif.c index 160d36f7d238..68f458587c67 100644 --- a/drivers/spmi/spmi-mtk-pmif.c +++ b/drivers/spmi/spmi-mtk-pmif.c @@ -1,6 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 // // Copyright (c) 2021 MediaTek Inc. +// Copyright (c) 2025 Collabora Ltd +// AngeloGioacchino Del Regno =20 #include #include @@ -25,6 +27,7 @@ =20 #define PMIF_CHAN_OFFSET 0x5 =20 +#define PMIF_MAX_BUSES 2 #define PMIF_MAX_CLKS 3 =20 #define SPMI_OP_ST_BUSY 1 @@ -41,16 +44,22 @@ struct pmif_data { const u32 *regs; const u32 *spmimst_regs; u32 soc_chan; + u32 num_spmi_buses; }; =20 -struct pmif { +struct pmif_bus { void __iomem *base; void __iomem *spmimst_base; - struct ch_reg chan; + struct spmi_controller *ctrl; struct clk_bulk_data clks[PMIF_MAX_CLKS]; size_t nclks; + raw_spinlock_t lock; +}; + +struct pmif { + struct pmif_bus bus[PMIF_MAX_BUSES]; + struct ch_reg chan; const struct pmif_data *data; - raw_spinlock_t lock; }; =20 static const char * const pmif_clock_names[] =3D { @@ -262,33 +271,41 @@ static const u32 mt8195_spmi_regs[] =3D { [SPMI_MST_DBG] =3D 0x00FC, }; =20 -static u32 pmif_readl(struct pmif *arb, enum pmif_regs reg) +static inline struct pmif *to_mtk_pmif(struct spmi_controller *ctrl) +{ + return dev_get_drvdata(ctrl->dev.parent); +} + +static u32 pmif_readl(struct pmif *arb, struct pmif_bus *pbus, enum pmif_r= egs reg) { - return readl(arb->base + arb->data->regs[reg]); + return readl(pbus->base + arb->data->regs[reg]); } =20 -static void pmif_writel(struct pmif *arb, u32 val, enum pmif_regs reg) +static void pmif_writel(struct pmif *arb, struct pmif_bus *pbus, + u32 val, enum pmif_regs reg) { - writel(val, arb->base + arb->data->regs[reg]); + writel(val, pbus->base + arb->data->regs[reg]); } =20 -static void mtk_spmi_writel(struct pmif *arb, u32 val, enum spmi_regs reg) +static void mtk_spmi_writel(struct pmif *arb, struct pmif_bus *pbus, + u32 val, enum spmi_regs reg) { - writel(val, arb->spmimst_base + arb->data->spmimst_regs[reg]); + writel(val, pbus->spmimst_base + arb->data->spmimst_regs[reg]); } =20 -static bool pmif_is_fsm_vldclr(struct pmif *arb) +static bool pmif_is_fsm_vldclr(struct pmif *arb, struct pmif_bus *pbus) { u32 reg_rdata; =20 - reg_rdata =3D pmif_readl(arb, arb->chan.ch_sta); + reg_rdata =3D pmif_readl(arb, pbus, arb->chan.ch_sta); =20 return GET_SWINF(reg_rdata) =3D=3D SWINF_WFVLDCLR; } =20 static int pmif_arb_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid) { - struct pmif *arb =3D spmi_controller_get_drvdata(ctrl); + struct pmif_bus *pbus =3D spmi_controller_get_drvdata(ctrl); + struct pmif *arb =3D to_mtk_pmif(ctrl); u32 rdata, cmd; int ret; =20 @@ -298,8 +315,8 @@ static int pmif_arb_cmd(struct spmi_controller *ctrl, u= 8 opc, u8 sid) =20 cmd =3D opc - SPMI_CMD_RESET; =20 - mtk_spmi_writel(arb, (cmd << 0x4) | sid, SPMI_OP_ST_CTRL); - ret =3D readl_poll_timeout_atomic(arb->spmimst_base + arb->data->spmimst_= regs[SPMI_OP_ST_STA], + mtk_spmi_writel(arb, pbus, (cmd << 0x4) | sid, SPMI_OP_ST_CTRL); + ret =3D readl_poll_timeout_atomic(pbus->spmimst_base + arb->data->spmimst= _regs[SPMI_OP_ST_STA], rdata, (rdata & SPMI_OP_ST_BUSY) =3D=3D SPMI_OP_ST_BUSY, PMIF_DELAY_US, PMIF_TIMEOUT_US); if (ret < 0) @@ -311,7 +328,8 @@ static int pmif_arb_cmd(struct spmi_controller *ctrl, u= 8 opc, u8 sid) static int pmif_spmi_read_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid, u16 addr, u8 *buf, size_t len) { - struct pmif *arb =3D spmi_controller_get_drvdata(ctrl); + struct pmif_bus *pbus =3D spmi_controller_get_drvdata(ctrl); + struct pmif *arb =3D to_mtk_pmif(ctrl); struct ch_reg *inf_reg; int ret; u32 data, cmd; @@ -336,31 +354,31 @@ static int pmif_spmi_read_cmd(struct spmi_controller = *ctrl, u8 opc, u8 sid, else return -EINVAL; =20 - raw_spin_lock_irqsave(&arb->lock, flags); + raw_spin_lock_irqsave(&pbus->lock, flags); /* Wait for Software Interface FSM state to be IDLE. */ inf_reg =3D &arb->chan; - ret =3D readl_poll_timeout_atomic(arb->base + arb->data->regs[inf_reg->ch= _sta], + ret =3D readl_poll_timeout_atomic(pbus->base + arb->data->regs[inf_reg->c= h_sta], data, GET_SWINF(data) =3D=3D SWINF_IDLE, PMIF_DELAY_US, PMIF_TIMEOUT_US); if (ret < 0) { /* set channel ready if the data has transferred */ - if (pmif_is_fsm_vldclr(arb)) - pmif_writel(arb, 1, inf_reg->ch_rdy); - raw_spin_unlock_irqrestore(&arb->lock, flags); + if (pmif_is_fsm_vldclr(arb, pbus)) + pmif_writel(arb, pbus, 1, inf_reg->ch_rdy); + raw_spin_unlock_irqrestore(&pbus->lock, flags); dev_err(&ctrl->dev, "failed to wait for SWINF_IDLE\n"); return ret; } =20 /* Send the command. */ cmd =3D (opc << 30) | (sid << 24) | ((len - 1) << 16) | addr; - pmif_writel(arb, cmd, inf_reg->ch_send); - raw_spin_unlock_irqrestore(&arb->lock, flags); + pmif_writel(arb, pbus, cmd, inf_reg->ch_send); + raw_spin_unlock_irqrestore(&pbus->lock, flags); =20 /* * Wait for Software Interface FSM state to be WFVLDCLR, * read the data and clear the valid flag. */ - ret =3D readl_poll_timeout_atomic(arb->base + arb->data->regs[inf_reg->ch= _sta], + ret =3D readl_poll_timeout_atomic(pbus->base + arb->data->regs[inf_reg->c= h_sta], data, GET_SWINF(data) =3D=3D SWINF_WFVLDCLR, PMIF_DELAY_US, PMIF_TIMEOUT_US); if (ret < 0) { @@ -368,9 +386,9 @@ static int pmif_spmi_read_cmd(struct spmi_controller *c= trl, u8 opc, u8 sid, return ret; } =20 - data =3D pmif_readl(arb, inf_reg->rdata); + data =3D pmif_readl(arb, pbus, inf_reg->rdata); memcpy(buf, &data, len); - pmif_writel(arb, 1, inf_reg->ch_rdy); + pmif_writel(arb, pbus, 1, inf_reg->ch_rdy); =20 return 0; } @@ -378,7 +396,8 @@ static int pmif_spmi_read_cmd(struct spmi_controller *c= trl, u8 opc, u8 sid, static int pmif_spmi_write_cmd(struct spmi_controller *ctrl, u8 opc, u8 si= d, u16 addr, const u8 *buf, size_t len) { - struct pmif *arb =3D spmi_controller_get_drvdata(ctrl); + struct pmif_bus *pbus =3D spmi_controller_get_drvdata(ctrl); + struct pmif *arb =3D to_mtk_pmif(ctrl); struct ch_reg *inf_reg; int ret; u32 data, wdata, cmd; @@ -409,27 +428,27 @@ static int pmif_spmi_write_cmd(struct spmi_controller= *ctrl, u8 opc, u8 sid, /* Set the write data. */ memcpy(&wdata, buf, len); =20 - raw_spin_lock_irqsave(&arb->lock, flags); + raw_spin_lock_irqsave(&pbus->lock, flags); /* Wait for Software Interface FSM state to be IDLE. */ inf_reg =3D &arb->chan; - ret =3D readl_poll_timeout_atomic(arb->base + arb->data->regs[inf_reg->ch= _sta], + ret =3D readl_poll_timeout_atomic(pbus->base + arb->data->regs[inf_reg->c= h_sta], data, GET_SWINF(data) =3D=3D SWINF_IDLE, PMIF_DELAY_US, PMIF_TIMEOUT_US); if (ret < 0) { /* set channel ready if the data has transferred */ - if (pmif_is_fsm_vldclr(arb)) - pmif_writel(arb, 1, inf_reg->ch_rdy); - raw_spin_unlock_irqrestore(&arb->lock, flags); + if (pmif_is_fsm_vldclr(arb, pbus)) + pmif_writel(arb, pbus, 1, inf_reg->ch_rdy); + raw_spin_unlock_irqrestore(&pbus->lock, flags); dev_err(&ctrl->dev, "failed to wait for SWINF_IDLE\n"); return ret; } =20 - pmif_writel(arb, wdata, inf_reg->wdata); + pmif_writel(arb, pbus, wdata, inf_reg->wdata); =20 /* Send the command. */ cmd =3D (opc << 30) | BIT(29) | (sid << 24) | ((len - 1) << 16) | addr; - pmif_writel(arb, cmd, inf_reg->ch_send); - raw_spin_unlock_irqrestore(&arb->lock, flags); + pmif_writel(arb, pbus, cmd, inf_reg->ch_send); + raw_spin_unlock_irqrestore(&pbus->lock, flags); =20 return 0; } @@ -446,84 +465,143 @@ static const struct pmif_data mt8195_pmif_arb =3D { .soc_chan =3D 2, }; =20 -static int mtk_spmi_probe(struct platform_device *pdev) +static int mtk_spmi_bus_probe(struct platform_device *pdev, + struct device_node *node, + const struct pmif_data *pdata, + struct pmif_bus *pbus) { - struct pmif *arb; struct spmi_controller *ctrl; - int err, i; - u32 chan_offset; + int err, idx, bus_id, i; + + if (pdata->num_spmi_buses > 1) + bus_id =3D of_alias_get_id(node, "spmi"); + else + bus_id =3D 0; + + if (bus_id < 0) + return dev_err_probe(&pdev->dev, bus_id, + "Cannot find SPMI Bus alias ID\n"); =20 - ctrl =3D devm_spmi_controller_alloc(&pdev->dev, sizeof(*arb)); + ctrl =3D devm_spmi_controller_alloc(&pdev->dev, sizeof(*pbus)); if (IS_ERR(ctrl)) return PTR_ERR(ctrl); =20 - arb =3D spmi_controller_get_drvdata(ctrl); - arb->data =3D device_get_match_data(&pdev->dev); - if (!arb->data) { - dev_err(&pdev->dev, "Cannot get drv_data\n"); + pbus =3D spmi_controller_get_drvdata(ctrl); + pbus->ctrl =3D ctrl; + + idx =3D of_property_match_string(node, "reg-names", "pmif"); + if (idx < 0) return -EINVAL; - } =20 - arb->base =3D devm_platform_ioremap_resource_byname(pdev, "pmif"); - if (IS_ERR(arb->base)) - return PTR_ERR(arb->base); + pbus->base =3D devm_of_iomap(&pdev->dev, node, idx, NULL); + if (IS_ERR(pbus->base)) + return PTR_ERR(pbus->base); =20 - arb->spmimst_base =3D devm_platform_ioremap_resource_byname(pdev, "spmims= t"); - if (IS_ERR(arb->spmimst_base)) - return PTR_ERR(arb->spmimst_base); + idx =3D of_property_match_string(node, "reg-names", "spmimst"); + if (idx < 0) + return -EINVAL; =20 - arb->nclks =3D ARRAY_SIZE(pmif_clock_names); - for (i =3D 0; i < arb->nclks; i++) - arb->clks[i].id =3D pmif_clock_names[i]; + pbus->spmimst_base =3D devm_of_iomap(&pdev->dev, node, idx, NULL); + if (IS_ERR(pbus->spmimst_base)) + return PTR_ERR(pbus->spmimst_base); =20 - err =3D clk_bulk_get(&pdev->dev, arb->nclks, arb->clks); - if (err) { - dev_err(&pdev->dev, "Failed to get clocks: %d\n", err); - return err; + pbus->nclks =3D ARRAY_SIZE(pmif_clock_names); + for (i =3D 0; i < pbus->nclks; i++) { + pbus->clks[i].id =3D pmif_clock_names[i]; + pbus->clks[i].clk =3D of_clk_get_by_name(node, pbus->clks[i].id); + if (IS_ERR(pbus->clks[i].clk)) + return PTR_ERR(pbus->clks[i].clk); } =20 - err =3D clk_bulk_prepare_enable(arb->nclks, arb->clks); - if (err) { - dev_err(&pdev->dev, "Failed to enable clocks: %d\n", err); + err =3D clk_bulk_prepare_enable(pbus->nclks, pbus->clks); + if (err) goto err_put_clks; - } =20 ctrl->cmd =3D pmif_arb_cmd; ctrl->read_cmd =3D pmif_spmi_read_cmd; ctrl->write_cmd =3D pmif_spmi_write_cmd; + ctrl->dev.of_node =3D node; + dev_set_name(&ctrl->dev, "spmi-%d", bus_id); =20 - chan_offset =3D PMIF_CHAN_OFFSET * arb->data->soc_chan; - arb->chan.ch_sta =3D PMIF_SWINF_0_STA + chan_offset; - arb->chan.wdata =3D PMIF_SWINF_0_WDATA_31_0 + chan_offset; - arb->chan.rdata =3D PMIF_SWINF_0_RDATA_31_0 + chan_offset; - arb->chan.ch_send =3D PMIF_SWINF_0_ACC + chan_offset; - arb->chan.ch_rdy =3D PMIF_SWINF_0_VLD_CLR + chan_offset; - - raw_spin_lock_init(&arb->lock); - - platform_set_drvdata(pdev, ctrl); + raw_spin_lock_init(&pbus->lock); =20 err =3D spmi_controller_add(ctrl); if (err) goto err_domain_remove; =20 + pbus->ctrl =3D ctrl; + return 0; =20 err_domain_remove: - clk_bulk_disable_unprepare(arb->nclks, arb->clks); + clk_bulk_disable_unprepare(pbus->nclks, pbus->clks); err_put_clks: - clk_bulk_put(arb->nclks, arb->clks); + clk_bulk_put(pbus->nclks, pbus->clks); return err; } =20 +static int mtk_spmi_probe(struct platform_device *pdev) +{ + struct device_node *node =3D pdev->dev.of_node; + struct pmif *arb; + u32 chan_offset; + u8 cur_bus =3D 0; + int ret; + + arb =3D devm_kzalloc(&pdev->dev, sizeof(*arb), GFP_KERNEL); + if (!arb) + return -ENOMEM; + + arb->data =3D device_get_match_data(&pdev->dev); + if (!arb->data) { + dev_err(&pdev->dev, "Cannot get drv_data\n"); + return -EINVAL; + } + + platform_set_drvdata(pdev, arb); + + if (!arb->data->num_spmi_buses) { + ret =3D mtk_spmi_bus_probe(pdev, node, arb->data, &arb->bus[cur_bus]); + if (ret) + return ret; + } else { + for_each_available_child_of_node_scoped(node, child) { + if (!of_node_name_eq(child, "spmi")) + continue; + + ret =3D mtk_spmi_bus_probe(pdev, child, arb->data, + &arb->bus[cur_bus]); + if (ret) + return ret; + cur_bus++; + } + } + + chan_offset =3D PMIF_CHAN_OFFSET * arb->data->soc_chan; + arb->chan.ch_sta =3D PMIF_SWINF_0_STA + chan_offset; + arb->chan.wdata =3D PMIF_SWINF_0_WDATA_31_0 + chan_offset; + arb->chan.rdata =3D PMIF_SWINF_0_RDATA_31_0 + chan_offset; + arb->chan.ch_send =3D PMIF_SWINF_0_ACC + chan_offset; + arb->chan.ch_rdy =3D PMIF_SWINF_0_VLD_CLR + chan_offset; + + return 0; +} + static void mtk_spmi_remove(struct platform_device *pdev) { - struct spmi_controller *ctrl =3D platform_get_drvdata(pdev); - struct pmif *arb =3D spmi_controller_get_drvdata(ctrl); + struct pmif *arb =3D platform_get_drvdata(pdev); + int i; =20 - spmi_controller_remove(ctrl); - clk_bulk_disable_unprepare(arb->nclks, arb->clks); - clk_bulk_put(arb->nclks, arb->clks); + for (i =3D 0; i < PMIF_MAX_BUSES; i++) { + struct pmif_bus *pbus =3D &arb->bus[i]; + + if (!pbus->ctrl) + continue; + + spmi_controller_remove(pbus->ctrl); + clk_bulk_disable_unprepare(pbus->nclks, pbus->clks); + clk_bulk_put(pbus->nclks, pbus->clks); + } } =20 static const struct of_device_id mtk_spmi_match_table[] =3D { @@ -549,6 +627,7 @@ static struct platform_driver mtk_spmi_driver =3D { }; module_platform_driver(mtk_spmi_driver); =20 +MODULE_AUTHOR("AngeloGioacchino Del Regno "); MODULE_AUTHOR("Hsin-Hsiung Wang "); MODULE_DESCRIPTION("MediaTek SPMI Driver"); MODULE_LICENSE("GPL"); --=20 https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git From nobody Sat Feb 7 09:59:00 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A3CD284880; Fri, 23 Jan 2026 18:20:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192442; cv=none; b=RHjhuylfTqAbb+D+8XaWbiRaJu8vYWZJ4/i2mvhTQnD19THzRalEVTZE46UAmithmPAYg56tbDGwKgpLlJfpFxk38vE7dsYv+zOiUuT9D//XvrRZZvaWQDH0chUr1IMcyWWOzK4lCsy10fIXS9h64Ha2moUjw7Vq8F1opf2T+C0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192442; c=relaxed/simple; bh=CAUdVWighr0KoYqDOZXRB5L55TyWyaqrDVdLRpeXvX0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AuCVc1g3pTtQgqg79aSjYuJc0AEMFAXKPx46m9sZuh390XXcZqAiT57J5H1X9SR91rqQoEslUVltO7bDh1bNLei99ro0apCJvykm/Tt6gHk+FqIl775ycQb2ZHEdO0pgp6br6gFU/gYWMRMQ3B+pVIeUDugRLCh3E7+gx0f9Aik= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=h/6q/eN/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="h/6q/eN/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8813C116D0; Fri, 23 Jan 2026 18:20:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769192442; bh=CAUdVWighr0KoYqDOZXRB5L55TyWyaqrDVdLRpeXvX0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h/6q/eN/UcEozvC7dxiuplTFX1V6wepXZaqpFQEj4y9ogg5OYOqQ3H3vuxEJC33zd f3JccCnZ5YOczQ5mOl/K9DpvBFUfGR6cRtMyiOLzBeNwsKIM0C6rbyIlBm4+teDG20 hndZgVG1GrBnKpNEy1/M1/lTCQzJ865nJIMEBCas0lMNjYB00DHQk7lj3XhNIDNIxM oGx0hoo7gJASrEfYchd7H5T92/HGapLtqEqHUWnSklzupmzEHwyJAmjfIPpqvFX7hN +HountKdB3enW7eYQs+WoeRJo8rkInoKGuE8VfrwBquS//5u0AkXGhCqI0Smaso/vu vlgNGy9Ke2A9w== From: Stephen Boyd To: Greg Kroah-Hartman Cc: AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org, patches@lists.linux.dev, =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= , Chen-Yu Tsai Subject: [PATCH 03/10] spmi: mtk-pmif: Keep spinlock until read is fully done Date: Fri, 23 Jan 2026 10:20:31 -0800 Message-ID: <20260123182039.224314-4-sboyd@kernel.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20260123182039.224314-1-sboyd@kernel.org> References: <20260123182039.224314-1-sboyd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: AngeloGioacchino Del Regno Move the spin unlocking to after reading the contents of the PMIF_SWINF_(x)_RDATA_31_0 register in pmif_spmi_read_cmd(): since this is the only register that we can read to get the data from all of the arbitered busses, a concurrent request for reading (especially on a busy arbiter) will show a race condition and a unexpected or corrupted value may be read. Doing the entire read sequence while spin locked guarantees that concurrent access to the arbiter doesn't happen. Fixes: f200fff8d019 ("spmi: mtk-pmif: Serialize PMIF status check and comma= nd submission") Reviewed-by: N=C3=ADcolas F. R. A. Prado Reviewed-by: Chen-Yu Tsai Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd --- drivers/spmi/spmi-mtk-pmif.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/spmi/spmi-mtk-pmif.c b/drivers/spmi/spmi-mtk-pmif.c index 68f458587c67..9f416b231ab8 100644 --- a/drivers/spmi/spmi-mtk-pmif.c +++ b/drivers/spmi/spmi-mtk-pmif.c @@ -22,7 +22,7 @@ #define PMIF_CMD_EXT_REG 2 #define PMIF_CMD_EXT_REG_LONG 3 =20 -#define PMIF_DELAY_US 10 +#define PMIF_DELAY_US 2 #define PMIF_TIMEOUT_US (10 * 1000) =20 #define PMIF_CHAN_OFFSET 0x5 @@ -372,7 +372,6 @@ static int pmif_spmi_read_cmd(struct spmi_controller *c= trl, u8 opc, u8 sid, /* Send the command. */ cmd =3D (opc << 30) | (sid << 24) | ((len - 1) << 16) | addr; pmif_writel(arb, pbus, cmd, inf_reg->ch_send); - raw_spin_unlock_irqrestore(&pbus->lock, flags); =20 /* * Wait for Software Interface FSM state to be WFVLDCLR, @@ -382,13 +381,16 @@ static int pmif_spmi_read_cmd(struct spmi_controller = *ctrl, u8 opc, u8 sid, data, GET_SWINF(data) =3D=3D SWINF_WFVLDCLR, PMIF_DELAY_US, PMIF_TIMEOUT_US); if (ret < 0) { + raw_spin_unlock_irqrestore(&pbus->lock, flags); dev_err(&ctrl->dev, "failed to wait for SWINF_WFVLDCLR\n"); return ret; } =20 data =3D pmif_readl(arb, pbus, inf_reg->rdata); - memcpy(buf, &data, len); pmif_writel(arb, pbus, 1, inf_reg->ch_rdy); + raw_spin_unlock_irqrestore(&pbus->lock, flags); + + memcpy(buf, &data, len); =20 return 0; } --=20 https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git From nobody Sat Feb 7 09:59:00 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E962A299927; Fri, 23 Jan 2026 18:20:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192443; cv=none; b=cb7JAxAobZcxSo104UXhJFdCNI6chuZ6LhQzK/bJV5p59Vf6cbOAx2wmk5FC6E1+JssyWwO+GMj0wBOQhRsfZsK+t3V9V8hxwnLVCGXftgn7sCgijsN/KOHLwg0uwsBPljK8oBr42iBdcVKoXS46fufvSZcFRs68sL+0dj2ie8g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192443; c=relaxed/simple; bh=83eIvNUiWT8ns/OAK/Rxj5oGr8sNrYvQbRvCDOgB8Oo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qvggRnCKz0xAxl34fTeYeUeAjZj4a3vA6lI4vIKBnFIgp9KZ5xoz9SA+VV/Za2jabyUVXeiQFP95w5reOZbdPn8oT5dvgij5ncabDOLTpqXfQh1JuZiUZkkD7tVe+n2DsGRt6IyLOz9d1pF9fTsmlWhqxJdh1aBjH6hIvAP6G1s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HQr3TLu6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HQr3TLu6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66A43C19424; Fri, 23 Jan 2026 18:20:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769192442; bh=83eIvNUiWT8ns/OAK/Rxj5oGr8sNrYvQbRvCDOgB8Oo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HQr3TLu6liNt3odt/pwuaj7eYU+GfJhLh9hes84w1GqiUJvUtxkBifuaoWeWVUsrf 2nkAzn72zSyFbUXTmNccyntplfw/bVFBTYkfJfseh6yNsGLlsnTDBXsojHjM0cJX3k 7oZY9iWyHuIn27/+c4+6Jn/nyMA8fi9lURsQIXJpkUk96Km+qCBpxyjT6uodLhsl6E zWMKP5k7CifoDxrWJTjjguLU6M/Aw6R48RXuCOU7zU5AyPkrIZ58I2y24uZFsoX94G w5OSefZquaUvWUgXIpvIR/WfhD5yJyQvUCEED2KB7288hZoZyT2FVvlEEd8hsUGGFE 6DjH94McC8qPQ== From: Stephen Boyd To: Greg Kroah-Hartman Cc: AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org, patches@lists.linux.dev, =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= Subject: [PATCH 04/10] spmi: mtk-pmif: Implement Request Capable Slave (RCS) interrupt Date: Fri, 23 Jan 2026 10:20:32 -0800 Message-ID: <20260123182039.224314-5-sboyd@kernel.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20260123182039.224314-1-sboyd@kernel.org> References: <20260123182039.224314-1-sboyd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: AngeloGioacchino Del Regno Add support for the per-bus RCS interrupt by adding a new linear irqdomain and its irqchip. The SPMI controller will raise an interrupt when any of the SPMI connected devices' irq needs attention (whenever any interrupt fires on any SID) in one of four registers, where each register holds four sets of four bits of information about a SID interrupt. This controller's RCS interrupt status knowledge is limited to the address of the SID that raised an interrupt, but does not have any details about the devices irq numbers: as this may change with a future SPMI controller IP version, the devicetree is meant to hold three cells, where the first one is the SPMI SID interrupt number, the second one is a device interrupt number, and the third one is the irq sense type. Reviewed-by: N=C3=ADcolas F. R. A. Prado Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd --- drivers/spmi/spmi-mtk-pmif.c | 232 ++++++++++++++++++++++++++++++++++- 1 file changed, 226 insertions(+), 6 deletions(-) diff --git a/drivers/spmi/spmi-mtk-pmif.c b/drivers/spmi/spmi-mtk-pmif.c index 9f416b231ab8..624611dd4849 100644 --- a/drivers/spmi/spmi-mtk-pmif.c +++ b/drivers/spmi/spmi-mtk-pmif.c @@ -5,12 +5,17 @@ // AngeloGioacchino Del Regno =20 #include +#include #include +#include +#include #include #include +#include #include #include #include +#include =20 #define SWINF_IDLE 0x00 #define SWINF_WFVLDCLR 0x06 @@ -26,6 +31,7 @@ #define PMIF_TIMEOUT_US (10 * 1000) =20 #define PMIF_CHAN_OFFSET 0x5 +#define PMIF_RCS_IRQ_MASK GENMASK(7, 0) =20 #define PMIF_MAX_BUSES 2 #define PMIF_MAX_CLKS 3 @@ -44,6 +50,7 @@ struct pmif_data { const u32 *regs; const u32 *spmimst_regs; u32 soc_chan; + u8 spmi_ver; u32 num_spmi_buses; }; =20 @@ -51,8 +58,13 @@ struct pmif_bus { void __iomem *base; void __iomem *spmimst_base; struct spmi_controller *ctrl; + struct irq_domain *dom; + int irq; struct clk_bulk_data clks[PMIF_MAX_CLKS]; size_t nclks; + u8 irq_min_sid; + u8 irq_max_sid; + u16 irq_en; raw_spinlock_t lock; }; =20 @@ -287,6 +299,11 @@ static void pmif_writel(struct pmif *arb, struct pmif_= bus *pbus, writel(val, pbus->base + arb->data->regs[reg]); } =20 +static u32 mtk_spmi_readl(struct pmif *arb, struct pmif_bus *pbus, enum sp= mi_regs reg) +{ + return readl(pbus->spmimst_base + arb->data->spmimst_regs[reg]); +} + static void mtk_spmi_writel(struct pmif *arb, struct pmif_bus *pbus, u32 val, enum spmi_regs reg) { @@ -343,7 +360,6 @@ static int pmif_spmi_read_cmd(struct spmi_controller *c= trl, u8 opc, u8 sid, =20 if (len > 4) { dev_err(&ctrl->dev, "pmif supports 1..4 bytes per trans, but:%zu request= ed", len); - return -EINVAL; } =20 @@ -455,6 +471,159 @@ static int pmif_spmi_write_cmd(struct spmi_controller= *ctrl, u8 opc, u8 sid, return 0; } =20 +static void mtk_spmi_handle_chained_irq(struct irq_desc *desc) +{ + struct pmif_bus *pbus =3D irq_desc_get_handler_data(desc); + struct irq_chip *chip =3D irq_desc_get_chip(desc); + struct pmif *arb =3D to_mtk_pmif(pbus->ctrl); + u8 regidx_min, regidx_max; + bool irq_handled =3D false; + unsigned int i; + + regidx_min =3D pbus->irq_min_sid / 4; + regidx_min +=3D SPMI_SLV_3_0_EINT; + + regidx_max =3D pbus->irq_max_sid / 4; + regidx_max +=3D SPMI_SLV_3_0_EINT; + + chained_irq_enter(chip, desc); + + for (i =3D regidx_min; i <=3D regidx_max; i++) { + u32 val =3D mtk_spmi_readl(arb, pbus, i); + + while (val) { + u8 bit =3D __ffs(val); + u8 bank =3D bit / 7; + u8 sid =3D ((i - SPMI_SLV_3_0_EINT) * 4) + bank; + + val &=3D ~(PMIF_RCS_IRQ_MASK << (8 * bank)); + + /* Check if IRQs for this SID are enabled */ + if (!(pbus->irq_en & BIT(sid))) + continue; + + generic_handle_domain_irq_safe(pbus->dom, sid); + irq_handled =3D true; + } + } + + if (!irq_handled) + handle_bad_irq(desc); + + chained_irq_exit(chip, desc); +} + +static void mtk_spmi_rcs_irq_eoi(struct irq_data *d) +{ + struct pmif_bus *pbus =3D irq_data_get_irq_chip_data(d); + struct pmif *arb =3D to_mtk_pmif(pbus->ctrl); + irq_hw_number_t irq =3D irqd_to_hwirq(d); + unsigned int reg, shift; + + /* There are four interrupts (8 bits each) per register */ + reg =3D SPMI_SLV_3_0_EINT + d->hwirq / 4; + shift =3D (irq % 4) * 8; + + mtk_spmi_writel(arb, pbus, PMIF_RCS_IRQ_MASK << shift, reg); +} + +static void mtk_spmi_rcs_irq_enable(struct irq_data *d) +{ + struct pmif_bus *pbus =3D irq_data_get_irq_chip_data(d); + irq_hw_number_t irq =3D irqd_to_hwirq(d); + + pbus->irq_en |=3D BIT(irq); +} + +static void mtk_spmi_rcs_irq_disable(struct irq_data *d) +{ + struct pmif_bus *pbus =3D irq_data_get_irq_chip_data(d); + irq_hw_number_t irq =3D irqd_to_hwirq(d); + + pbus->irq_en &=3D ~BIT(irq); +} + +static int mtk_spmi_rcs_irq_set_wake(struct irq_data *d, unsigned int on) +{ + struct pmif_bus *pbus =3D irq_data_get_irq_chip_data(d); + + return irq_set_irq_wake(pbus->irq, on); +} + +static const struct irq_chip mtk_spmi_rcs_irq_chip =3D { + .name =3D "spmi_rcs", + .irq_eoi =3D mtk_spmi_rcs_irq_eoi, + .irq_enable =3D mtk_spmi_rcs_irq_enable, + .irq_disable =3D mtk_spmi_rcs_irq_disable, + .irq_set_wake =3D mtk_spmi_rcs_irq_set_wake, +}; + +static int mtk_spmi_rcs_irq_translate(struct irq_domain *d, struct irq_fws= pec *fwspec, + unsigned long *out_hwirq, unsigned int *out_type) +{ + struct pmif_bus *pbus =3D d->host_data; + struct device *dev =3D &pbus->ctrl->dev; + u32 *intspec =3D fwspec->param; + + if (intspec[0] > SPMI_MAX_SLAVE_ID) + return -EINVAL; + + /* + * The IRQ number in intspec[1] is ignored on purpose here! + * + * The controller only has knowledge of which SID raised an interrupt + * and the type of irq, but doesn't know about any device irq number, + * hence that must be read from the SPMI device's registers. + */ + *out_hwirq =3D intspec[0]; + *out_type =3D intspec[2] & IRQ_TYPE_SENSE_MASK; + + if (pbus->irq_min_sid > intspec[0]) + pbus->irq_min_sid =3D intspec[0]; + + if (pbus->irq_max_sid < intspec[0]) + pbus->irq_max_sid =3D intspec[0]; + + dev_dbg(dev, "Found SPMI IRQ %u (map: 0x%lx)\n", intspec[0], *out_hwirq); + + return 0; +} + +static struct lock_class_key mtk_spmi_rcs_irqlock_class, mtk_spmi_rcs_irqr= eq_class; + +static int mtk_spmi_rcs_irq_alloc(struct irq_domain *d, unsigned int virq, + unsigned int nr_irqs, void *data) +{ + struct pmif_bus *pbus =3D d->host_data; + struct device *dev =3D &pbus->ctrl->dev; + struct irq_fwspec *fwspec =3D data; + irq_hw_number_t hwirq; + unsigned int irqtype; + int i, ret; + + ret =3D mtk_spmi_rcs_irq_translate(d, fwspec, &hwirq, &irqtype); + if (ret) + return ret; + + for (i =3D 0; i < nr_irqs; i++) { + dev_dbg(dev, "Mapping IRQ%u (hwirq %lu) with type %u\n", + virq, hwirq, irqtype); + + irq_set_lockdep_class(virq, &mtk_spmi_rcs_irqlock_class, + &mtk_spmi_rcs_irqreq_class); + irq_domain_set_info(d, virq, hwirq, &mtk_spmi_rcs_irq_chip, + pbus, handle_level_irq, NULL, NULL); + } + + return 0; +} + +static const struct irq_domain_ops mtk_spmi_rcs_irq_domain_ops =3D { + .alloc =3D mtk_spmi_rcs_irq_alloc, + .free =3D irq_domain_free_irqs_common, + .translate =3D mtk_spmi_rcs_irq_translate, +}; + static const struct pmif_data mt6873_pmif_arb =3D { .regs =3D mt6873_regs, .spmimst_regs =3D mt6873_spmi_regs, @@ -467,6 +636,44 @@ static const struct pmif_data mt8195_pmif_arb =3D { .soc_chan =3D 2, }; =20 +static int mtk_spmi_irq_init(struct device_node *node, + const struct pmif_data *pdata, + struct pmif_bus *pbus) +{ + struct pmif *arb =3D to_mtk_pmif(pbus->ctrl); + unsigned int i; + + /* No interrupts required for SPMI 1.x controller */ + if (pdata->spmi_ver < 2) { + pbus->dom =3D NULL; + return 0; + } + + pbus->irq =3D of_irq_get_byname(node, "rcs"); + if (pbus->irq <=3D 0) + return pbus->irq ? : -ENXIO; + + pbus->dom =3D irq_domain_create_tree(of_fwnode_handle(node), + &mtk_spmi_rcs_irq_domain_ops, pbus); + if (!pbus->dom) + return -ENOMEM; + + /* Clear possible unhandled interrupts coming from bootloader SPMI init */ + for (i =3D SPMI_SLV_3_0_EINT; i <=3D SPMI_SLV_F_C_EINT; i++) + mtk_spmi_writel(arb, pbus, GENMASK(31, 0), i); + + return 0; +} + +static void mtk_spmi_irq_remove(struct pmif_bus *pbus) +{ + if (!pbus->dom) + return; + + irq_set_chained_handler_and_data(pbus->irq, NULL, NULL); + irq_domain_remove(pbus->dom); +} + static int mtk_spmi_bus_probe(struct platform_device *pdev, struct device_node *node, const struct pmif_data *pdata, @@ -512,12 +719,21 @@ static int mtk_spmi_bus_probe(struct platform_device = *pdev, pbus->clks[i].id =3D pmif_clock_names[i]; pbus->clks[i].clk =3D of_clk_get_by_name(node, pbus->clks[i].id); if (IS_ERR(pbus->clks[i].clk)) - return PTR_ERR(pbus->clks[i].clk); + return dev_err_probe(&pdev->dev, PTR_ERR(pbus->clks[i].clk), + "Failed to get clocks\n"); } =20 err =3D clk_bulk_prepare_enable(pbus->nclks, pbus->clks); - if (err) + if (err) { + dev_err_probe(&pdev->dev, err, "Failed to enable clocks\n"); goto err_put_clks; + } + + err =3D mtk_spmi_irq_init(node, pdata, pbus); + if (err) { + dev_err_probe(&pdev->dev, err, "Cannot initialize SPMI IRQs\n"); + goto err_disable_clks; + } =20 ctrl->cmd =3D pmif_arb_cmd; ctrl->read_cmd =3D pmif_spmi_read_cmd; @@ -529,13 +745,16 @@ static int mtk_spmi_bus_probe(struct platform_device = *pdev, =20 err =3D spmi_controller_add(ctrl); if (err) - goto err_domain_remove; + goto err_remove_irq; =20 - pbus->ctrl =3D ctrl; + if (pbus->dom) + irq_set_chained_handler_and_data(pbus->irq, mtk_spmi_handle_chained_irq,= pbus); =20 return 0; =20 -err_domain_remove: +err_remove_irq: + mtk_spmi_irq_remove(pbus); +err_disable_clks: clk_bulk_disable_unprepare(pbus->nclks, pbus->clks); err_put_clks: clk_bulk_put(pbus->nclks, pbus->clks); @@ -600,6 +819,7 @@ static void mtk_spmi_remove(struct platform_device *pde= v) if (!pbus->ctrl) continue; =20 + mtk_spmi_irq_remove(pbus); spmi_controller_remove(pbus->ctrl); clk_bulk_disable_unprepare(pbus->nclks, pbus->clks); clk_bulk_put(pbus->nclks, pbus->clks); --=20 https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git From nobody Sat Feb 7 09:59:00 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3645A29D28F; Fri, 23 Jan 2026 18:20:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192443; cv=none; b=uIVipCP3mnW+jVPyfBjeCXuFsSGElPm2d9loTRVPhDbdxdIsH3FyszdpGUIZ2Ztyr0doK5SwlDd1Vg5i4HOVhvhDReLlmhObA5psNWBqCkeWeBlomFQvafIt2KqkOjbFkH3QB62cePjzRyEA+2CnWzEhrDjLh2XbqRYHcZSdAWA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192443; c=relaxed/simple; bh=cdSJ0d0jGsz67FUmn0GDLjca8jr8Uhj3PHIoyx1a8OA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WKOYnD+FSqMssgqCAc4lMnq4r2UmqjmhUD/6jIb0sntFbKubPBEq15frcB4Nm1dgyT923hrYeXsB7iKIhQB/bsev1Msrvjw1e8kWRHkZGGKgOTqzBQ1XXBL+aSlpI11xvQdZlObfW4JdMuyLbQco1U9qtiW12pkxRD/4rtWkAVc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IUi6T+RO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IUi6T+RO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD49BC19423; Fri, 23 Jan 2026 18:20:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769192443; bh=cdSJ0d0jGsz67FUmn0GDLjca8jr8Uhj3PHIoyx1a8OA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IUi6T+ROVWZsA7PFugl4Cr44lS2ybCZiEEer5AwDOPjHZWrn+T1/4aSODJfC6sXje fkgAQ3VRJGAtfNvYUjdrMdKMGfNpPK4NmyeWEwFPrBg4v7yCyjGJlnZW3LetDJ6KTI RMHxr4rtQX5j/aN6KtZ6WdDGJZ8/0hKpA7ye/LzKXX/haBXP4uuEtsP7JzGGP59M1p 25eixTowWjU+mRMPa9x4QAF6Qubuhg3yjEWJEspML+YIf+SBb1JSk2CGWXt1Rkszug WqCP0dg5TSu100dc6KLj9/fFVLB4NRH3pRVykdJgWEcSMNuhHQ6NJAFW1OtqdZPFcG SGLyHf+xzZ6LQ== From: Stephen Boyd To: Greg Kroah-Hartman Cc: AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org, patches@lists.linux.dev, =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= Subject: [PATCH 05/10] spmi: mtk-pmif: Add support for MT8196 SPMI Controller Date: Fri, 23 Jan 2026 10:20:33 -0800 Message-ID: <20260123182039.224314-6-sboyd@kernel.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20260123182039.224314-1-sboyd@kernel.org> References: <20260123182039.224314-1-sboyd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: AngeloGioacchino Del Regno Add support for the SPMI controller found in the MT8196 SoC: this supports SPMI 2.0 and features two SPMI buses. Reviewed-by: N=C3=ADcolas F. R. A. Prado Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd --- drivers/spmi/spmi-mtk-pmif.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/spmi/spmi-mtk-pmif.c b/drivers/spmi/spmi-mtk-pmif.c index 624611dd4849..1048420b5afb 100644 --- a/drivers/spmi/spmi-mtk-pmif.c +++ b/drivers/spmi/spmi-mtk-pmif.c @@ -636,6 +636,14 @@ static const struct pmif_data mt8195_pmif_arb =3D { .soc_chan =3D 2, }; =20 +static const struct pmif_data mt8196_pmif_arb =3D { + .regs =3D mt8195_regs, + .spmimst_regs =3D mt8195_spmi_regs, + .soc_chan =3D 2, + .spmi_ver =3D 2, + .num_spmi_buses =3D 2, +}; + static int mtk_spmi_irq_init(struct device_node *node, const struct pmif_data *pdata, struct pmif_bus *pbus) @@ -833,6 +841,9 @@ static const struct of_device_id mtk_spmi_match_table[]= =3D { }, { .compatible =3D "mediatek,mt8195-spmi", .data =3D &mt8195_pmif_arb, + }, { + .compatible =3D "mediatek,mt8196-spmi", + .data =3D &mt8196_pmif_arb, }, { /* sentinel */ }, --=20 https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git From nobody Sat Feb 7 09:59:00 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8C4C2BE03D; Fri, 23 Jan 2026 18:20:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192443; cv=none; b=qCpr3GhwVhiOZmyAMJfVPEXVdRLYgDAglWtlzBm5tAvT8UgYkJoQwyn/7Zpux5ddYPWtxb/DEkzsFdUzP6JkExu+xKbjs/NHTiesc3T78HvfwfHCbsUEG/ftUZ+Mx56l02ZISvWrqV536rok7MIi43SFqhE+ImjelCuhtiDYd5U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192443; c=relaxed/simple; bh=18xLU7cFZwgMxh6+rQ9VFg6Y240mlvTsBUNqFwNX7qg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=peEehd+Dyi1IhmtjitSd9248SoeoAmq5Fqym9NVq4nz7tBwvLcinWRbHHUjI/vxW2wV8AP8EgflTGNcg6Hw3oSmO1EA/dgF+ljQ97MJArGSE02oE9X78j9poLPN8giyO8UKC7rRXoi+Fi8h5ofWNIIcB6ZNvTYuVXwvs29aRbQo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JRs7bElL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JRs7bElL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AE21C19424; Fri, 23 Jan 2026 18:20:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769192443; bh=18xLU7cFZwgMxh6+rQ9VFg6Y240mlvTsBUNqFwNX7qg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JRs7bElLik2suTbKMtcTvvhZ6A6hTHTY/+xL1A4mdwIbwPsAJXMtOkca66mkXD9J2 bjVZjJiuR4gST49AS3Db8YF69IgenwbrfYMD0JZDlHoJ7leAg6NMQJ4s+3Kan/bz+J pyl+6YmO8BP9eSY3FYuC8mS3cLB6ItfIrjxD9ba7nRsfaDAdkKpbChGV3Aiu0M5/P8 4mrOGWaDadWAV0jRlYhwPjSri8I1VItbH+9Br4dTF7ahhCILA7V1WjFne3a0u67m+m qkOkVZ5dZjIyCqrFKGJm0r15pnVW3X7lfVI6VJSlFJfowEgitxhxdOI0yiquJM82rr t/vAF4LYTl+iQ== From: Stephen Boyd To: Greg Kroah-Hartman Cc: Janne Grunau , linux-kernel@vger.kernel.org, patches@lists.linux.dev, stable@vger.kernel.org, Neal Gompa Subject: [PATCH 06/10] spmi: apple: Add "apple,t8103-spmi" compatible Date: Fri, 23 Jan 2026 10:20:34 -0800 Message-ID: <20260123182039.224314-7-sboyd@kernel.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20260123182039.224314-1-sboyd@kernel.org> References: <20260123182039.224314-1-sboyd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Janne Grunau After discussion with the devicetree maintainers we agreed to not extend lists with the generic compatible "apple,spmi" anymore [1]. Use "apple,t8103-spmi" as base compatible as it is the SoC the driver and bindings were written for. [1]: https://lore.kernel.org/asahi/12ab93b7-1fc2-4ce0-926e-c8141cfe81bf@ker= nel.org/ Fixes: 77ca75e80c71 ("spmi: add a spmi driver for Apple SoC") Cc: stable@vger.kernel.org Reviewed-by: Neal Gompa Signed-off-by: Janne Grunau Signed-off-by: Stephen Boyd --- drivers/spmi/spmi-apple-controller.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spmi/spmi-apple-controller.c b/drivers/spmi/spmi-apple= -controller.c index 697b3e8bb023..87e3ee9d4f2a 100644 --- a/drivers/spmi/spmi-apple-controller.c +++ b/drivers/spmi/spmi-apple-controller.c @@ -149,6 +149,7 @@ static int apple_spmi_probe(struct platform_device *pde= v) } =20 static const struct of_device_id apple_spmi_match_table[] =3D { + { .compatible =3D "apple,t8103-spmi", }, { .compatible =3D "apple,spmi", }, {} }; --=20 https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git From nobody Sat Feb 7 09:59:00 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 270C62C08AB; Fri, 23 Jan 2026 18:20:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192444; cv=none; b=HR/fC3i0FDymxIMFW+bOEdQ1fbwj3rrQ7Y8BWRC9H2h5QQ5LMKWj868Tqgerbd7z9kPQx3SzJqh/CJS1RkZegBXfvUGF+rghPSdRzmSw8nNygd4XEI55ePCon29kbM/EF4mk/n9eec2EL88D5EEexKKOwKngbNZwiQaN6aTPr1w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192444; c=relaxed/simple; bh=uyJGViFNnTrqV/0+XtxMOgU872S4kW0SndMvdMXhrTs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O+pr/vAetQ0zty3xzlGpi6BS0C/fHDD0dndYm1rgRroRtkN3sCopSmYH016ikORfRo9rhKvtT6Yr+amQg5U25h+bBsYWsOkLW4FFBS0TyhB7/sib6SUyT5Ym1smp1ayix6BHvOtb58pr7WFBSdpM2vOBAABSEYD3FHmkqTJ1ZcI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AqYXFY7L; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AqYXFY7L" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6B9CC19423; Fri, 23 Jan 2026 18:20:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769192443; bh=uyJGViFNnTrqV/0+XtxMOgU872S4kW0SndMvdMXhrTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AqYXFY7Lu9Z3VoFW5V3fFHKvdCsk2zlSyMopwDXK6fs7YVGZ+C55jXidB3Eb0qs34 2CobhJ31jc/zTPtc/05aZ08tnxruHSDMa6SUUsgXO2G9BhnCUnbB8ElOHnlTtneuix IhEo8X0PQl4wMUCI5pdR6n2Ih29mxBAm8QTM6uY9vqqEpKyS5uDDXSU65NaST3sP1a 0QrtqpuhyA2qtoMa58EL/1rl9yIN1ykKs351uOuOoNUsBePMwBoUWnvRtkPLTU34gT M0reACU+270c0zZfHeOHn6flkVAk/FMZsvzbHiVJkD4R8Tbv2REQFHvVbkmpMx/8Mr 0+SiRojKuKyhw== From: Stephen Boyd To: Greg Kroah-Hartman Cc: Jishnu Prakash , linux-kernel@vger.kernel.org, patches@lists.linux.dev, "Rob Herring (Arm)" Subject: [PATCH 07/10] dt-bindings: spmi: split out common QCOM SPMI PMIC arbiter properties Date: Fri, 23 Jan 2026 10:20:35 -0800 Message-ID: <20260123182039.224314-8-sboyd@kernel.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20260123182039.224314-1-sboyd@kernel.org> References: <20260123182039.224314-1-sboyd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jishnu Prakash Split out the common SPMI PMIC arbiter properties for QCOM devices into a separate file so that it can be included as a reference for devices using them. This will be needed for the upcoming PMIC v8 arbiter support patch, as the v8 arbiter also uses these common properties. Reviewed-by: Rob Herring (Arm) Signed-off-by: Jishnu Prakash Signed-off-by: Stephen Boyd --- .../spmi/qcom,spmi-pmic-arb-common.yaml | 35 +++++++++++++++++++ .../bindings/spmi/qcom,spmi-pmic-arb.yaml | 17 +-------- .../spmi/qcom,x1e80100-spmi-pmic-arb.yaml | 21 +++-------- 3 files changed, 40 insertions(+), 33 deletions(-) create mode 100644 Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-a= rb-common.yaml diff --git a/Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb-comm= on.yaml b/Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb-common.= yaml new file mode 100644 index 000000000000..8c38ed145e74 --- /dev/null +++ b/Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb-common.yaml @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spmi/qcom,spmi-pmic-arb-common.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Technologies, Inc. SPMI Controller (common) + +maintainers: + - David Collins + +description: | + This defines some common properties used to define Qualcomm SPMI control= lers + for PMIC arbiter. + +properties: + qcom,ee: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 5 + description: + indicates the active Execution Environment identifier + + qcom,channel: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 5 + description: + which of the PMIC Arb provided channels to use for accesses + +required: + - qcom,ee + - qcom,channel + +additionalProperties: true diff --git a/Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.yaml= b/Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.yaml index 51daf1b847a9..d0c683dd5284 100644 --- a/Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.yaml +++ b/Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.yaml @@ -19,6 +19,7 @@ description: | =20 allOf: - $ref: spmi.yaml + - $ref: qcom,spmi-pmic-arb-common.yaml =20 properties: compatible: @@ -71,20 +72,6 @@ properties: =20 '#size-cells': true =20 - qcom,ee: - $ref: /schemas/types.yaml#/definitions/uint32 - minimum: 0 - maximum: 5 - description: > - indicates the active Execution Environment identifier - - qcom,channel: - $ref: /schemas/types.yaml#/definitions/uint32 - minimum: 0 - maximum: 5 - description: > - which of the PMIC Arb provided channels to use for accesses - qcom,bus-id: $ref: /schemas/types.yaml#/definitions/uint32 minimum: 0 @@ -97,8 +84,6 @@ properties: required: - compatible - reg-names - - qcom,ee - - qcom,channel =20 unevaluatedProperties: false =20 diff --git a/Documentation/devicetree/bindings/spmi/qcom,x1e80100-spmi-pmic= -arb.yaml b/Documentation/devicetree/bindings/spmi/qcom,x1e80100-spmi-pmic-= arb.yaml index 7c3cc20a80d6..08369fdd2161 100644 --- a/Documentation/devicetree/bindings/spmi/qcom,x1e80100-spmi-pmic-arb.ya= ml +++ b/Documentation/devicetree/bindings/spmi/qcom,x1e80100-spmi-pmic-arb.ya= ml @@ -17,6 +17,9 @@ description: | The PMIC Arbiter can also act as an interrupt controller, providing inte= rrupts to slave devices. =20 +allOf: + - $ref: qcom,spmi-pmic-arb-common.yaml + properties: compatible: oneOf: @@ -45,20 +48,6 @@ properties: '#size-cells': const: 2 =20 - qcom,ee: - $ref: /schemas/types.yaml#/definitions/uint32 - minimum: 0 - maximum: 5 - description: > - indicates the active Execution Environment identifier - - qcom,channel: - $ref: /schemas/types.yaml#/definitions/uint32 - minimum: 0 - maximum: 5 - description: > - which of the PMIC Arb provided channels to use for accesses - patternProperties: "^spmi@[a-f0-9]+$": type: object @@ -96,10 +85,8 @@ patternProperties: required: - compatible - reg-names - - qcom,ee - - qcom,channel =20 -additionalProperties: false +unevaluatedProperties: false =20 examples: - | --=20 https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git From nobody Sat Feb 7 09:59:00 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FD6D2C21C4; Fri, 23 Jan 2026 18:20:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192444; cv=none; b=ukw2Ykkdlk/RnwePFOENLrKquLkf37g1wVDCef89Z5vDUQIQr3cnjljlpCZEr4EQ7NDStVJukbNctp+rqA1SYyIdk1kQJsmz7Opy10Q4By1a8SaeWx9iQiU7JwcwzMiSvN/pKKRCtZ/twuHdbeO4WcBQOZqYrkPyfQSMNLUAS1Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192444; c=relaxed/simple; bh=C1HrRs33eYxwgMfsTwS8l4kxnuIa+/Yx9xWlRmLSqbY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jP1wJO179GE+sWlddvGqOWdgXmyDrIztFqjURQKZcoLoUzOJPXitPIqtl13o8CMsunr/r18asbEnWADlmjG1KDfnIOb/q2V3tVRA3Xw4MlM1tW0wuQRcJqhtYxdl62S8MJvYdi3MgQxxwV2vrkvlVXh/PDa/7ncJGXHo7TGK+qA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iYbaShbb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iYbaShbb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27855C4CEF1; Fri, 23 Jan 2026 18:20:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769192444; bh=C1HrRs33eYxwgMfsTwS8l4kxnuIa+/Yx9xWlRmLSqbY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iYbaShbbFzj4+TJQrT4UFlsd/KuYnqX1C+LEWHSC3DhQehxvSqczGE80PxlpqryBZ EvmEj4vlp3d0DC5yZ2mzpBxBHD9N9/2Yi9PWJvVED9M+N2cNhl1dei8M3cWZ5yQbFR Gg2V6BN/V6tzZCfjqRJ4Q9hHd7bmnKzTlWejKlPyY+zWgF6hM0HQ1H1aNm/gFVEPFz tYtHCndnFI5++6TX9xFzzKt24vsrERqyANrnGORFezvGSBSDPh89Ibbr3d2H4Ab/pN Yn3Dbu/FolhV1WHYq510RPKp1cq2ZxCHppLdvxwxQAtD/11BMaqSSyUNSzGbaHzcdZ EHvJhNisf94IQ== From: Stephen Boyd To: Greg Kroah-Hartman Cc: Jishnu Prakash , linux-kernel@vger.kernel.org, patches@lists.linux.dev, David Collins , Pankaj Patil , Kamal Wadhwa , Jingyi Wang , "Rob Herring (Arm)" Subject: [PATCH 08/10] dt-bindings: spmi: add support for glymur-spmi-pmic-arb (arbiter v8) Date: Fri, 23 Jan 2026 10:20:36 -0800 Message-ID: <20260123182039.224314-9-sboyd@kernel.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20260123182039.224314-1-sboyd@kernel.org> References: <20260123182039.224314-1-sboyd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jishnu Prakash SPMI PMIC Arbiter version 8 builds upon version 7 with support for up to four SPMI buses. To achieve this, the register map was slightly rearranged. Add a new binding file and compatible string for version 8 using the name 'glymur' as the Qualcomm Technologies, Inc. Glymur SoC is the first one to use PMIC arbiter version 8. This specifies the new register ranges needed only for version 8. Also document SPMI PMIC Arbiter for Qualcomm Kaanapali SoC, by adding fallback to Glymur compatible string, as it too has version 8 functionality. Signed-off-by: David Collins Signed-off-by: Pankaj Patil Signed-off-by: Kamal Wadhwa Signed-off-by: Jingyi Wang Reviewed-by: Rob Herring (Arm) Signed-off-by: Jishnu Prakash Signed-off-by: Stephen Boyd --- .../spmi/qcom,glymur-spmi-pmic-arb.yaml | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 Documentation/devicetree/bindings/spmi/qcom,glymur-spmi= -pmic-arb.yaml diff --git a/Documentation/devicetree/bindings/spmi/qcom,glymur-spmi-pmic-a= rb.yaml b/Documentation/devicetree/bindings/spmi/qcom,glymur-spmi-pmic-arb.= yaml new file mode 100644 index 000000000000..3b5005b96c6d --- /dev/null +++ b/Documentation/devicetree/bindings/spmi/qcom,glymur-spmi-pmic-arb.yaml @@ -0,0 +1,150 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spmi/qcom,glymur-spmi-pmic-arb.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Technologies, Inc. Glymur SPMI Controller (PMIC Arbiter v8) + +maintainers: + - David Collins + +description: | + The Glymur SPMI PMIC Arbiter implements HW version 8 and it's an SPMI + controller with wrapping arbitration logic to allow for multiple on-chip + devices to control up to 4 SPMI separate buses. + + The PMIC Arbiter can also act as an interrupt controller, providing inte= rrupts + to slave devices. + +allOf: + - $ref: /schemas/spmi/qcom,spmi-pmic-arb-common.yaml + +properties: + compatible: + oneOf: + - items: + - enum: + - qcom,kaanapali-spmi-pmic-arb + - const: qcom,glymur-spmi-pmic-arb + - enum: + - qcom,glymur-spmi-pmic-arb + + reg: + items: + - description: core registers + - description: tx-channel per virtual slave registers + - description: rx-channel (called observer) per virtual slave regist= ers + - description: channel to PMIC peripheral mapping registers + + reg-names: + items: + - const: core + - const: chnls + - const: obsrvr + - const: chnl_map + + ranges: true + + '#address-cells': + const: 2 + + '#size-cells': + const: 2 + +patternProperties: + "^spmi@[a-f0-9]+$": + type: object + $ref: /schemas/spmi/spmi.yaml + unevaluatedProperties: false + + properties: + reg: + items: + - description: configuration registers + - description: interrupt controller registers + - description: channel owner EE mapping registers + + reg-names: + items: + - const: cnfg + - const: intr + - const: chnl_owner + + interrupts: + maxItems: 1 + + interrupt-names: + const: periph_irq + + interrupt-controller: true + + '#interrupt-cells': + const: 4 + description: | + cell 1: slave ID for the requested interrupt (0-15) + cell 2: peripheral ID for requested interrupt (0-255) + cell 3: the requested peripheral interrupt (0-7) + cell 4: interrupt flags indicating level-sense information, + as defined in dt-bindings/interrupt-controller/irq.h + +required: + - compatible + - reg-names + +unevaluatedProperties: false + +examples: + - | + #include + + soc { + #address-cells =3D <2>; + #size-cells =3D <2>; + + arbiter@c400000 { + compatible =3D "qcom,glymur-spmi-pmic-arb"; + reg =3D <0x0 0xc400000 0x0 0x3000>, + <0x0 0xc900000 0x0 0x400000>, + <0x0 0xc4c0000 0x0 0x400000>, + <0x0 0xc403000 0x0 0x8000>; + reg-names =3D "core", "chnls", "obsrvr", "chnl_map"; + + qcom,ee =3D <0>; + qcom,channel =3D <0>; + + #address-cells =3D <2>; + #size-cells =3D <2>; + ranges; + + spmi@c426000 { + reg =3D <0x0 0xc426000 0x0 0x4000>, + <0x0 0xc8c0000 0x0 0x10000>, + <0x0 0xc42a000 0x0 0x8000>; + reg-names =3D "cnfg", "intr", "chnl_owner"; + + interrupts-extended =3D <&pdc 1 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names =3D "periph_irq"; + interrupt-controller; + #interrupt-cells =3D <4>; + + #address-cells =3D <2>; + #size-cells =3D <0>; + }; + + spmi@c437000 { + reg =3D <0x0 0xc437000 0x0 0x4000>, + <0x0 0xc8d0000 0x0 0x10000>, + <0x0 0xc43b000 0x0 0x8000>; + reg-names =3D "cnfg", "intr", "chnl_owner"; + + interrupts-extended =3D <&pdc 3 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names =3D "periph_irq"; + interrupt-controller; + #interrupt-cells =3D <4>; + + #address-cells =3D <2>; + #size-cells =3D <0>; + }; + }; + }; --=20 https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git From nobody Sat Feb 7 09:59:00 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 412342D6E5C; Fri, 23 Jan 2026 18:20:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192445; cv=none; b=lGO0RJsYvvJ5W0CBxD6r6mE+NNY3Hu8/sok2Rs/dzQJNkAmZNQTjx6E618F+cxR2evk1tvPif8EAil7K2H6tiYxKMYbb8nrY2wKAEBlfyf9n0dhrvb0KbTAqhxUi15fHECBvGxHqbfvIIAh1Xaqswf9SquWWZeqfAq2I4XLmAaM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192445; c=relaxed/simple; bh=I66E/zZiHA6FOcCAlffXQhFB9fSE9Y79UmI2dtkyj4M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bQ/i0nfKCsGUMgAfSfm2JaLvD54MND/dYeb+F2u2DuKdPijQ8ueMM2+yXIXatOLQ/HDk5JwZaaEgiyHpdj68xFdu6OZqOCaaqDuo2DSzxLn5rfYDlnJ9MdABExkzvowFjk4V5EvQd3pB+jMYllOpeMX94QyIra1FxYNqMjShVZw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CiNzQxHl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CiNzQxHl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8142C19423; Fri, 23 Jan 2026 18:20:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769192445; bh=I66E/zZiHA6FOcCAlffXQhFB9fSE9Y79UmI2dtkyj4M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CiNzQxHlf3kw1mSEMVK315XTHVbSrcp8ViwsGNSO+RBKAAh54jo/9xZOSdzGTmFYr Rrzpw/JhAslJff5tenp5WvCbitDh9zGHuuUoaX1z3ujrUgLaIUvM10TnoVZ71O73TD k/ngori8QGDFWlRQrhj96tIHgFVyzM0bMj9HI8gzI0Bbza8nysyKCW/GcCkw057JMb ZpSBHKbibxagBATUni59MN+N5vr/92totG01pymIDwV3kfQ/iAnM1guemq3e6o9uAA Rs2dVeyhF0XX9dhHvCKAnwOZYJhTffU00k2NOCDXHyACqwZlVbFrQAnwVY/267Uf0B UM6PYhmL89wAA== From: Stephen Boyd To: Greg Kroah-Hartman Cc: David Collins , linux-kernel@vger.kernel.org, patches@lists.linux.dev, Kamal Wadhwa , Jishnu Prakash , Konrad Dybcio Subject: [PATCH 09/10] spmi: spmi-pmic-arb: add support for PMIC arbiter v8 Date: Fri, 23 Jan 2026 10:20:37 -0800 Message-ID: <20260123182039.224314-10-sboyd@kernel.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20260123182039.224314-1-sboyd@kernel.org> References: <20260123182039.224314-1-sboyd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: David Collins PMIC arbiter v8 supports up to 4 SPMI buses and up to 8192 PMIC peripherals. Its register map differs from v7 as several fields increased in size. Add support for PMIC arbiter version 8. Signed-off-by: David Collins Signed-off-by: Kamal Wadhwa Signed-off-by: Jishnu Prakash Reviewed-by: Konrad Dybcio Signed-off-by: Stephen Boyd --- drivers/spmi/spmi-pmic-arb.c | 304 +++++++++++++++++++++++++++++------ 1 file changed, 255 insertions(+), 49 deletions(-) diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c index 91581974ef84..69f8d456324a 100644 --- a/drivers/spmi/spmi-pmic-arb.c +++ b/drivers/spmi/spmi-pmic-arb.c @@ -2,6 +2,8 @@ /* * Copyright (c) 2012-2015, 2017, 2021, The Linux Foundation. All rights r= eserved. */ + +#include #include #include #include @@ -25,12 +27,12 @@ #define PMIC_ARB_VERSION_V3_MIN 0x30000000 #define PMIC_ARB_VERSION_V5_MIN 0x50000000 #define PMIC_ARB_VERSION_V7_MIN 0x70000000 +#define PMIC_ARB_VERSION_V8_MIN 0x80000000 #define PMIC_ARB_INT_EN 0x0004 =20 #define PMIC_ARB_FEATURES 0x0004 #define PMIC_ARB_FEATURES_PERIPH_MASK GENMASK(10, 0) - -#define PMIC_ARB_FEATURES1 0x0008 +#define PMIC_ARB_FEATURES_V8_PERIPH_MASK GENMASK(12, 0) =20 /* PMIC Arbiter channel registers offsets */ #define PMIC_ARB_CMD 0x00 @@ -50,9 +52,11 @@ #define SPMI_MAPPING_BIT_IS_1_RESULT(X) (((X) >> 0) & 0xFF) =20 #define SPMI_MAPPING_TABLE_TREE_DEPTH 16 /* Maximum of 16-bits */ -#define PMIC_ARB_MAX_PPID BIT(12) /* PPID is 12bit */ +#define PMIC_ARB_MAX_PPID BIT(13) #define PMIC_ARB_APID_VALID BIT(15) -#define PMIC_ARB_CHAN_IS_IRQ_OWNER(reg) ((reg) & BIT(24)) +#define PMIC_ARB_CHAN_IS_IRQ_OWNER_MASK BIT(24) +#define PMIC_ARB_V8_CHAN_IS_IRQ_OWNER_MASK BIT(31) + #define INVALID_EE 0xFF =20 /* Ownership Table */ @@ -96,30 +100,37 @@ enum pmic_arb_channel { PMIC_ARB_CHANNEL_OBS, }; =20 -#define PMIC_ARB_MAX_BUSES 2 +#define PMIC_ARB_MAX_BUSES 4 =20 /* Maximum number of support PMIC peripherals */ #define PMIC_ARB_MAX_PERIPHS 512 #define PMIC_ARB_MAX_PERIPHS_V7 1024 +#define PMIC_ARB_MAX_PERIPHS_V8 8192 #define PMIC_ARB_TIMEOUT_US 1000 #define PMIC_ARB_MAX_TRANS_BYTES (8) =20 #define PMIC_ARB_APID_MASK 0xFF -#define PMIC_ARB_PPID_MASK 0xFFF +#define PMIC_ARB_PPID_MASK GENMASK(11, 0) +#define PMIC_ARB_V8_PPID_MASK GENMASK(12, 0) =20 /* interrupt enable bit */ #define SPMI_PIC_ACC_ENABLE_BIT BIT(0) =20 +#define HWIRQ_SID_MASK GENMASK(28, 24) +#define HWIRQ_PID_MASK GENMASK(23, 16) +#define HWIRQ_IRQID_MASK GENMASK(15, 13) +#define HWIRQ_APID_MASK GENMASK(12, 0) + #define spec_to_hwirq(slave_id, periph_id, irq_id, apid) \ - ((((slave_id) & 0xF) << 28) | \ - (((periph_id) & 0xFF) << 20) | \ - (((irq_id) & 0x7) << 16) | \ - (((apid) & 0x3FF) << 0)) + (FIELD_PREP(HWIRQ_SID_MASK, (slave_id)) | \ + FIELD_PREP(HWIRQ_PID_MASK, (periph_id)) | \ + FIELD_PREP(HWIRQ_IRQID_MASK, (irq_id)) | \ + FIELD_PREP(HWIRQ_APID_MASK, (apid))) =20 -#define hwirq_to_sid(hwirq) (((hwirq) >> 28) & 0xF) -#define hwirq_to_per(hwirq) (((hwirq) >> 20) & 0xFF) -#define hwirq_to_irq(hwirq) (((hwirq) >> 16) & 0x7) -#define hwirq_to_apid(hwirq) (((hwirq) >> 0) & 0x3FF) +#define hwirq_to_sid(hwirq) FIELD_GET(HWIRQ_SID_MASK, (hwirq)) +#define hwirq_to_per(hwirq) FIELD_GET(HWIRQ_PID_MASK, (hwirq)) +#define hwirq_to_irq(hwirq) FIELD_GET(HWIRQ_IRQID_MASK, (hwirq)) +#define hwirq_to_apid(hwirq) FIELD_GET(HWIRQ_APID_MASK, (hwirq)) =20 struct pmic_arb_ver_ops; =20 @@ -138,11 +149,12 @@ struct spmi_pmic_arb; * @domain: irq domain object for PMIC IRQ domain * @intr: address of the SPMI interrupt control registers. * @cnfg: address of the PMIC Arbiter configuration registers. + * @apid_owner: on v8: address of APID owner mapping table registers * @spmic: spmi controller registered for this bus * @lock: lock to synchronize accesses. - * @base_apid: on v7: minimum APID associated with the particular SPMI - * bus instance - * @apid_count: on v5 and v7: number of APIDs associated with the + * @base_apid: on v7 and v8: minimum APID associated with the + * particular SPMI bus instance + * @apid_count: on v5, v7 and v8: number of APIDs associated with the * particular SPMI bus instance * @mapping_table: in-memory copy of PPID -> APID mapping table. * @mapping_table_valid:bitmap containing valid-only periphs @@ -159,6 +171,7 @@ struct spmi_pmic_arb_bus { struct irq_domain *domain; void __iomem *intr; void __iomem *cnfg; + void __iomem *apid_owner; struct spmi_controller *spmic; raw_spinlock_t lock; u16 base_apid; @@ -181,6 +194,7 @@ struct spmi_pmic_arb_bus { * @wr_base: on v1 "core", on v2 "chnls" register base off DT. * @core: core register base for v2 and above only (see above) * @core_size: core register base size + * @apid_map: on v8, APID mapping table register base * @channel: execution environment channel to use for accesses. * @ee: the current Execution Environment * @ver_ops: version dependent operations. @@ -193,6 +207,7 @@ struct spmi_pmic_arb { void __iomem *wr_base; void __iomem *core; resource_size_t core_size; + void __iomem *apid_map; u8 channel; u8 ee; const struct pmic_arb_ver_ops *ver_ops; @@ -206,6 +221,7 @@ struct spmi_pmic_arb { * * @ver_str: version string. * @get_core_resources: initializes the core, observer and channels + * @get_bus_resources: requests per-SPMI bus register resources * @init_apid: finds the apid base and count * @ppid_to_apid: finds the apid for a given ppid. * @non_data_cmd: on v1 issues an spmi non-data command. @@ -227,6 +243,9 @@ struct spmi_pmic_arb { struct pmic_arb_ver_ops { const char *ver_str; int (*get_core_resources)(struct platform_device *pdev, void __iomem *cor= e); + int (*get_bus_resources)(struct platform_device *pdev, + struct device_node *node, + struct spmi_pmic_arb_bus *bus); int (*init_apid)(struct spmi_pmic_arb_bus *bus, int index); int (*ppid_to_apid)(struct spmi_pmic_arb_bus *bus, u16 ppid); /* spmi commands (read_cmd, write_cmd, cmd) functionality */ @@ -656,7 +675,7 @@ static int periph_interrupt(struct spmi_pmic_arb_bus *b= us, u16 apid) unsigned int irq; u32 status, id; int handled =3D 0; - u8 sid =3D (bus->apid_data[apid].ppid >> 8) & 0xF; + u8 sid =3D (bus->apid_data[apid].ppid >> 8) & 0x1F; u8 per =3D bus->apid_data[apid].ppid & 0xFF; =20 status =3D readl_relaxed(pmic_arb->ver_ops->irq_status(bus, apid)); @@ -686,7 +705,7 @@ static void pmic_arb_chained_irq(struct irq_desc *desc) int last =3D bus->max_apid; /* * acc_offset will be non-zero for the secondary SPMI bus instance on - * v7 controllers. + * v7 and v8 controllers. */ int acc_offset =3D bus->base_apid >> 5; u8 ee =3D pmic_arb->ee; @@ -913,7 +932,8 @@ static int qpnpint_irq_domain_translate(struct irq_doma= in *d, return -EINVAL; if (fwspec->param_count !=3D 4) return -EINVAL; - if (intspec[0] > 0xF || intspec[1] > 0xFF || intspec[2] > 0x7) + if (intspec[0] > FIELD_MAX(HWIRQ_SID_MASK) || intspec[1] > FIELD_MAX(HWIR= Q_PID_MASK) || + intspec[2] > FIELD_MAX(HWIRQ_IRQID_MASK)) return -EINVAL; =20 ppid =3D intspec[0] << 8 | intspec[1]; @@ -1160,7 +1180,9 @@ static int pmic_arb_ppid_to_apid_v2(struct spmi_pmic_= arb_bus *bus, u16 ppid) return apid_valid & ~PMIC_ARB_APID_VALID; } =20 -static int pmic_arb_read_apid_map_v5(struct spmi_pmic_arb_bus *bus) +static int _pmic_arb_read_apid_map(struct spmi_pmic_arb_bus *bus, + void __iomem *ppid_base, unsigned long ppid_mask, + u8 ppid_shift, unsigned long irq_owner_mask) { struct spmi_pmic_arb *pmic_arb =3D bus->pmic_arb; struct apid_data *apidd; @@ -1171,7 +1193,7 @@ static int pmic_arb_read_apid_map_v5(struct spmi_pmic= _arb_bus *bus) =20 /* * In order to allow multiple EEs to write to a single PPID in arbiter - * version 5 and 7, there is more than one APID mapped to each PPID. + * version 5,7 and 8, there can be more than one APID mapped to each PPID. * The owner field for each of these mappings specifies the EE which is * allowed to write to the APID. The owner of the last (highest) APID * which has the IRQ owner bit set for a given PPID will receive @@ -1183,19 +1205,30 @@ static int pmic_arb_read_apid_map_v5(struct spmi_pm= ic_arb_bus *bus) * APID =3D N to N+M-1 are assigned to the secondary bus * where N =3D number of APIDs supported by the primary bus and * M =3D number of APIDs supported by the secondary bus + * + * In arbiter version 8, the APID numbering space is divided between + * the SPMI buses according to this mapping: + * APID =3D 0 to N-1 --> bus 0 + * APID =3D N to N+M-1 --> bus 1 + * APID =3D N+M to N+M+P-1 --> bus 2 + * APID =3D N+M+P to N+M+P+Q-1 --> bus 3 + * where N =3D number of APIDs supported by bus 0 + * M =3D number of APIDs supported by bus 1 + * P =3D number of APIDs supported by bus 2 + * Q =3D number of APIDs supported by bus 3 */ + apidd =3D &bus->apid_data[bus->base_apid]; apid_max =3D bus->base_apid + bus->apid_count; for (i =3D bus->base_apid; i < apid_max; i++, apidd++) { offset =3D pmic_arb->ver_ops->apid_map_offset(i); if (offset >=3D pmic_arb->core_size) break; - - regval =3D readl_relaxed(pmic_arb->core + offset); + regval =3D readl_relaxed(ppid_base + offset); if (!regval) continue; - ppid =3D (regval >> 8) & PMIC_ARB_PPID_MASK; - is_irq_ee =3D PMIC_ARB_CHAN_IS_IRQ_OWNER(regval); + ppid =3D (regval >> ppid_shift) & ppid_mask; + is_irq_ee =3D regval & irq_owner_mask; =20 regval =3D readl_relaxed(pmic_arb->ver_ops->apid_owner(bus, i)); apidd->write_ee =3D SPMI_OWNERSHIP_PERIPH2OWNER(regval); @@ -1237,6 +1270,12 @@ static int pmic_arb_read_apid_map_v5(struct spmi_pmi= c_arb_bus *bus) return 0; } =20 +static int pmic_arb_read_apid_map_v5(struct spmi_pmic_arb_bus *bus) +{ + return _pmic_arb_read_apid_map(bus, bus->pmic_arb->core, PMIC_ARB_PPID_MA= SK, + 8, PMIC_ARB_CHAN_IS_IRQ_OWNER_MASK); +} + static int pmic_arb_ppid_to_apid_v5(struct spmi_pmic_arb_bus *bus, u16 ppi= d) { if (!(bus->ppid_to_apid[ppid] & PMIC_ARB_APID_VALID)) @@ -1345,37 +1384,46 @@ static int pmic_arb_get_core_resources_v7(struct pl= atform_device *pdev, return pmic_arb_get_obsrvr_chnls_v2(pdev); } =20 -/* - * Only v7 supports 2 buses. Each bus will get a different apid count, read - * from different registers. - */ -static int pmic_arb_init_apid_v7(struct spmi_pmic_arb_bus *bus, int index) +static int _pmic_arb_init_apid_v7(struct spmi_pmic_arb_bus *bus, int index, + int max_buses, unsigned long periph_mask) { struct spmi_pmic_arb *pmic_arb =3D bus->pmic_arb; - int ret; + int i; =20 - if (index =3D=3D 0) { - bus->base_apid =3D 0; - bus->apid_count =3D readl_relaxed(pmic_arb->core + PMIC_ARB_FEATURES) & - PMIC_ARB_FEATURES_PERIPH_MASK; - } else if (index =3D=3D 1) { - bus->base_apid =3D readl_relaxed(pmic_arb->core + PMIC_ARB_FEATURES) & - PMIC_ARB_FEATURES_PERIPH_MASK; - bus->apid_count =3D readl_relaxed(pmic_arb->core + PMIC_ARB_FEATURES1) & - PMIC_ARB_FEATURES_PERIPH_MASK; - } else { - dev_err(&bus->spmic->dev, "Unsupported buses count %d detected\n", - bus->id); + if (index < 0 || index >=3D max_buses) { + dev_err(&bus->spmic->dev, "Unsupported bus index %d detected\n", + index); return -EINVAL; } =20 - if (bus->base_apid + bus->apid_count > pmic_arb->max_periphs) { - dev_err(&bus->spmic->dev, "Unsupported APID count %d detected\n", + bus->base_apid =3D 0; + bus->apid_count =3D 0; + for (i =3D 0; i <=3D index; i++) { + bus->base_apid +=3D bus->apid_count; + bus->apid_count =3D readl_relaxed(pmic_arb->core + + PMIC_ARB_FEATURES + i * 4) & + periph_mask; + } + + if (bus->apid_count =3D=3D 0) { + dev_err(&bus->spmic->dev, "Bus %d not implemented\n", index); + return -EINVAL; + } else if (bus->base_apid + bus->apid_count > pmic_arb->max_periphs) { + dev_err(&bus->spmic->dev, "Unsupported max APID %d detected\n", bus->base_apid + bus->apid_count); return -EINVAL; } =20 - ret =3D pmic_arb_init_apid_min_max(bus); + return pmic_arb_init_apid_min_max(bus); +} + +/* + * Arbiter v7 supports 2 buses. Each bus will get a different apid count, = read + * from different registers. + */ +static int pmic_arb_init_apid_v7(struct spmi_pmic_arb_bus *bus, int index) +{ + int ret =3D _pmic_arb_init_apid_v7(bus, index, 2, PMIC_ARB_FEATURES_PERIP= H_MASK); if (ret) return ret; =20 @@ -1424,6 +1472,102 @@ static int pmic_arb_offset_v7(struct spmi_pmic_arb_= bus *bus, u8 sid, u16 addr, return offset; } =20 +static int pmic_arb_get_core_resources_v8(struct platform_device *pdev, + void __iomem *core) +{ + struct spmi_pmic_arb *pmic_arb =3D platform_get_drvdata(pdev); + + pmic_arb->apid_map =3D devm_platform_ioremap_resource_byname(pdev, "chnl_= map"); + if (IS_ERR(pmic_arb->apid_map)) + return PTR_ERR(pmic_arb->apid_map); + + pmic_arb->core =3D core; + + pmic_arb->max_periphs =3D PMIC_ARB_MAX_PERIPHS_V8; + + return pmic_arb_get_obsrvr_chnls_v2(pdev); +} + +static int pmic_arb_get_bus_resources_v8(struct platform_device *pdev, + struct device_node *node, + struct spmi_pmic_arb_bus *bus) +{ + int index; + + index =3D of_property_match_string(node, "reg-names", "chnl_owner"); + if (index < 0) { + dev_err(&pdev->dev, "chnl_owner reg region missing\n"); + return -EINVAL; + } + + bus->apid_owner =3D devm_of_iomap(&pdev->dev, node, index, NULL); + + return PTR_ERR_OR_ZERO(bus->apid_owner); +} + +static int pmic_arb_read_apid_map_v8(struct spmi_pmic_arb_bus *bus) +{ + return _pmic_arb_read_apid_map(bus, bus->pmic_arb->apid_map, + PMIC_ARB_V8_PPID_MASK, 0, + PMIC_ARB_V8_CHAN_IS_IRQ_OWNER_MASK); +} + +/* + * Arbiter v8 supports up to 4 buses. Each bus will get a different apid c= ount, read + * from different registers. + */ +static int pmic_arb_init_apid_v8(struct spmi_pmic_arb_bus *bus, int index) +{ + int ret =3D _pmic_arb_init_apid_v7(bus, index, 4, + PMIC_ARB_FEATURES_V8_PERIPH_MASK); + if (ret) + return ret; + + ret =3D pmic_arb_read_apid_map_v8(bus); + if (ret) { + dev_err(&bus->spmic->dev, "could not read APID->PPID mapping table, rc= =3D %d\n", + ret); + return ret; + } + + return 0; +} + +/* + * v8 offset per ee and per apid for observer channels and per apid for + * read/write channels. + */ +static int pmic_arb_offset_v8(struct spmi_pmic_arb_bus *bus, u8 sid, u16 a= ddr, + enum pmic_arb_channel ch_type) +{ + struct spmi_pmic_arb *pmic_arb =3D bus->pmic_arb; + u16 apid; + int rc; + u32 offset =3D 0; + u16 ppid =3D (sid << 8) | (addr >> 8); + + rc =3D pmic_arb->ver_ops->ppid_to_apid(bus, ppid); + if (rc < 0) + return rc; + + apid =3D rc; + switch (ch_type) { + case PMIC_ARB_CHANNEL_OBS: + offset =3D 0x40000 * pmic_arb->ee + 0x20 * apid; + break; + case PMIC_ARB_CHANNEL_RW: + if (bus->apid_data[apid].write_ee !=3D pmic_arb->ee) { + dev_err(&bus->spmic->dev, "disallowed SPMI write to sid=3D%u, addr=3D0x= %04X\n", + sid, addr); + return -EPERM; + } + offset =3D 0x200 * apid; + break; + } + + return offset; +} + static u32 pmic_arb_fmt_cmd_v1(u8 opc, u8 sid, u16 addr, u8 bc) { return (opc << 27) | ((sid & 0xf) << 20) | (addr << 4) | (bc & 0x7); @@ -1490,6 +1634,14 @@ pmic_arb_acc_enable_v7(struct spmi_pmic_arb_bus *bus= , u16 n) return pmic_arb->wr_base + 0x100 + 0x1000 * n; } =20 +static void __iomem * +pmic_arb_acc_enable_v8(struct spmi_pmic_arb_bus *bus, u16 n) +{ + struct spmi_pmic_arb *pmic_arb =3D bus->pmic_arb; + + return pmic_arb->wr_base + 0x100 + 0x200 * n; +} + static void __iomem * pmic_arb_irq_status_v1(struct spmi_pmic_arb_bus *bus, u16 n) { @@ -1516,6 +1668,14 @@ pmic_arb_irq_status_v7(struct spmi_pmic_arb_bus *bus= , u16 n) return pmic_arb->wr_base + 0x104 + 0x1000 * n; } =20 +static void __iomem * +pmic_arb_irq_status_v8(struct spmi_pmic_arb_bus *bus, u16 n) +{ + struct spmi_pmic_arb *pmic_arb =3D bus->pmic_arb; + + return pmic_arb->wr_base + 0x104 + 0x200 * n; +} + static void __iomem * pmic_arb_irq_clear_v1(struct spmi_pmic_arb_bus *bus, u16 n) { @@ -1542,6 +1702,14 @@ pmic_arb_irq_clear_v7(struct spmi_pmic_arb_bus *bus,= u16 n) return pmic_arb->wr_base + 0x108 + 0x1000 * n; } =20 +static void __iomem * +pmic_arb_irq_clear_v8(struct spmi_pmic_arb_bus *bus, u16 n) +{ + struct spmi_pmic_arb *pmic_arb =3D bus->pmic_arb; + + return pmic_arb->wr_base + 0x108 + 0x200 * n; +} + static u32 pmic_arb_apid_map_offset_v2(u16 n) { return 0x800 + 0x4 * n; @@ -1557,6 +1725,12 @@ static u32 pmic_arb_apid_map_offset_v7(u16 n) return 0x2000 + 0x4 * n; } =20 +static u32 pmic_arb_apid_map_offset_v8(u16 n) +{ + /* For v8, offset is from "chnl_map" base register, not "core". */ + return 0x4 * n; +} + static void __iomem * pmic_arb_apid_owner_v2(struct spmi_pmic_arb_bus *bus, u16 n) { @@ -1564,7 +1738,7 @@ pmic_arb_apid_owner_v2(struct spmi_pmic_arb_bus *bus,= u16 n) } =20 /* - * For arbiter version 7, APID ownership table registers have independent + * For arbiter version 7 and 8, APID ownership table registers have indepe= ndent * numbering space for each SPMI bus instance, so each is indexed starting= from * 0. */ @@ -1574,6 +1748,12 @@ pmic_arb_apid_owner_v7(struct spmi_pmic_arb_bus *bus= , u16 n) return bus->cnfg + 0x4 * (n - bus->base_apid); } =20 +static void __iomem * +pmic_arb_apid_owner_v8(struct spmi_pmic_arb_bus *bus, u16 n) +{ + return bus->apid_owner + 0x4 * (n - bus->base_apid); +} + static const struct pmic_arb_ver_ops pmic_arb_v1 =3D { .ver_str =3D "v1", .get_core_resources =3D pmic_arb_get_core_resources_v1, @@ -1654,6 +1834,23 @@ static const struct pmic_arb_ver_ops pmic_arb_v7 =3D= { .apid_owner =3D pmic_arb_apid_owner_v7, }; =20 +static const struct pmic_arb_ver_ops pmic_arb_v8 =3D { + .ver_str =3D "v8", + .get_core_resources =3D pmic_arb_get_core_resources_v8, + .get_bus_resources =3D pmic_arb_get_bus_resources_v8, + .init_apid =3D pmic_arb_init_apid_v8, + .ppid_to_apid =3D pmic_arb_ppid_to_apid_v5, + .non_data_cmd =3D pmic_arb_non_data_cmd_v2, + .offset =3D pmic_arb_offset_v8, + .fmt_cmd =3D pmic_arb_fmt_cmd_v2, + .owner_acc_status =3D pmic_arb_owner_acc_status_v7, + .acc_enable =3D pmic_arb_acc_enable_v8, + .irq_status =3D pmic_arb_irq_status_v8, + .irq_clear =3D pmic_arb_irq_clear_v8, + .apid_map_offset =3D pmic_arb_apid_map_offset_v8, + .apid_owner =3D pmic_arb_apid_owner_v8, +}; + static const struct irq_domain_ops pmic_arb_irq_domain_ops =3D { .activate =3D qpnpint_irq_domain_activate, .alloc =3D qpnpint_irq_domain_alloc, @@ -1731,6 +1928,12 @@ static int spmi_pmic_arb_bus_init(struct platform_de= vice *pdev, bus->spmic =3D ctrl; bus->id =3D bus_index; =20 + if (pmic_arb->ver_ops->get_bus_resources) { + ret =3D pmic_arb->ver_ops->get_bus_resources(pdev, node, bus); + if (ret) + return ret; + } + ret =3D pmic_arb->ver_ops->init_apid(bus, bus_index); if (ret) return ret; @@ -1825,8 +2028,10 @@ static int spmi_pmic_arb_probe(struct platform_devic= e *pdev) pmic_arb->ver_ops =3D &pmic_arb_v3; else if (hw_ver < PMIC_ARB_VERSION_V7_MIN) pmic_arb->ver_ops =3D &pmic_arb_v5; - else + else if (hw_ver < PMIC_ARB_VERSION_V8_MIN) pmic_arb->ver_ops =3D &pmic_arb_v7; + else + pmic_arb->ver_ops =3D &pmic_arb_v8; =20 err =3D pmic_arb->ver_ops->get_core_resources(pdev, core); if (err) @@ -1875,6 +2080,7 @@ static void spmi_pmic_arb_remove(struct platform_devi= ce *pdev) static const struct of_device_id spmi_pmic_arb_match_table[] =3D { { .compatible =3D "qcom,spmi-pmic-arb", }, { .compatible =3D "qcom,x1e80100-spmi-pmic-arb", }, + { .compatible =3D "qcom,glymur-spmi-pmic-arb", }, {}, }; MODULE_DEVICE_TABLE(of, spmi_pmic_arb_match_table); --=20 https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git From nobody Sat Feb 7 09:59:00 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 97CBD296BBB; Fri, 23 Jan 2026 18:20:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192445; cv=none; b=Ch+5nzT7nv6ko3d9DiY3ptXDRLQK9D9Pfn4L6G2YFaiXjtzfSEw8Cyc1vTOsxNUDjb7mnuzt1ISFHucjS2QgFm1I9mfzg3Gey61VAxv4LYDdrwsTyn3wQwTTpae5+Z/9YymOPEEor084eDJDB/dmCnIbV/QAIKUJWiMoBfGkhfk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769192445; c=relaxed/simple; bh=dHX8y3FqAr3oZW2LJ+xZJXB1vnxS35Mbou7CqzWgRCQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HMeEeVmjUjInP8n9KvoMm7qo3pEiOYKy2TMRQrXp1oJo4mbnExkeVKPh1C4lG/hq7d1PA5DvkUiGzQwmTlKh6qJfNMVlGKp7x4i/hFgvTEyPVRnysVo18w7QphQhZDjd21GXIJO82+Rm7isBWZC4KJKzPu7NDi9QDWKf8G3iqJg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kfJMLekW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kfJMLekW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D684C4CEF1; Fri, 23 Jan 2026 18:20:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769192445; bh=dHX8y3FqAr3oZW2LJ+xZJXB1vnxS35Mbou7CqzWgRCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kfJMLekW/tHE/D8V+0TV9MLrUhnuiF2QLTeDQqRBZYZSaIpxFtTmWpYAHWeglsEo3 +JBRCRH83vZ91kmTz7j90a9zyEWbq/CKZJ4HCxDYveLvnIRZ9ZVCH1ZTy49icexeZt UbaxbPvAQRR/UqnNjcsI8x6cL3Wd55D4l0bU6f6OOGD5drLiMT0g1HJzRrVLfuU1wa S4NS3bjK9t+yrYvt6prK0nKoNxEIR04hSfUkQY/F87naULYVU9Jb4+bE9gnu+HzdLr fffKCeDDvyuIcCPJrDfvCSehwl4wNJkmxSxKNfIUSzOgHUexj0NBVv0xTXRFf62eC3 IS0Cqil4m5Dcw== From: Stephen Boyd To: Greg Kroah-Hartman Cc: Louis-Alexis Eyraud , linux-kernel@vger.kernel.org, patches@lists.linux.dev, Conor Dooley , AngeloGioacchino Del Regno Subject: [PATCH 10/10] dt-bindings: spmi: spmi-mtk-pmif: Add compatible for MT8189 SoC Date: Fri, 23 Jan 2026 10:20:38 -0800 Message-ID: <20260123182039.224314-11-sboyd@kernel.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20260123182039.224314-1-sboyd@kernel.org> References: <20260123182039.224314-1-sboyd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Louis-Alexis Eyraud Add compatible string for the SPMI block on MT8189 SoC, which is compatible with the one used on MT8195. Signed-off-by: Louis-Alexis Eyraud Acked-by: Conor Dooley Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd --- Documentation/devicetree/bindings/spmi/mtk,spmi-mtk-pmif.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/spmi/mtk,spmi-mtk-pmif.yaml = b/Documentation/devicetree/bindings/spmi/mtk,spmi-mtk-pmif.yaml index 7f0be0ac644a..dc61d88008a9 100644 --- a/Documentation/devicetree/bindings/spmi/mtk,spmi-mtk-pmif.yaml +++ b/Documentation/devicetree/bindings/spmi/mtk,spmi-mtk-pmif.yaml @@ -26,6 +26,7 @@ properties: - enum: - mediatek,mt8186-spmi - mediatek,mt8188-spmi + - mediatek,mt8189-spmi - const: mediatek,mt8195-spmi =20 reg: --=20 https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git