From nobody Sun Jun 14 01:35:13 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 D12892D8DDF; Mon, 4 May 2026 18:24:58 +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=1777919098; cv=none; b=l36fUHrlsVbJvNXlizi0oD1pIXBKY/gFsa7NmJxOa8PK6kdDxiTkHC/RGaqZjcS/hedmknxHpuWbCNjZq270y/f+zZp9jLR/emBbO4lAtOYHMrn483eVApbVQWa/PmTA/JgpUsDS+DF03DbBRv/H2T7R5XrsnaGdl55op24/Ysw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777919098; c=relaxed/simple; bh=dq0DlKHPTmE3lZvUM4sz1vUEKC1qT3yPMFbvdbPnpkQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D3S5NkJN94WGeCdR9J82mreh2BXZVmOK5zkVRdnHnGyAZRYQO1uvFvo6Iu9sOodqSww6avM9yJARvBJoHnM6/kXJXbVjIohbrCvMPOAH1lgbkIBJVl0dook1BFguMBcZpFLk+QGfwTdGBC25LBFEHIpwWefMXV6t52qZG/cmtk4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YXUe3lYn; 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="YXUe3lYn" Received: by smtp.kernel.org (Postfix) with ESMTPS id 8983FC2BCC4; Mon, 4 May 2026 18:24:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777919098; bh=dq0DlKHPTmE3lZvUM4sz1vUEKC1qT3yPMFbvdbPnpkQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=YXUe3lYnl48fmvg8/z9OuTgPeQ5Vg5FoZz9rCJcyzjHQxglBpc7GY0P+nReZmIkfm sY0si/UtxmWG8jNZP4waMxyLfeHjopPuiEh6ZDKgk1GZmhZ5ijiN5nD1QMkWEen6QS PrncMNMShnnpzU/1zHBl+IWFmEoWglwdnb34g5ODhFuYJANNW84OR9FVS4uOrZV1ca KeTdmL0Uleiadl7KjxkYZjDtnVsySQVLlDsJPoq7ebLA0iw3zYDjlyl5Z/9Ao/cvL6 CMYcHw9Y3W+Ftz8Ue85wuyBhTmk7STPsD7QJ1nvOK2qfBGJUKM/XnZvvr2TBS2OeBh KYB79dMaBRDLg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76741CD3427; Mon, 4 May 2026 18:24:58 +0000 (UTC) From: Roman Vivchar via B4 Relay Date: Mon, 04 May 2026 21:24:53 +0300 Subject: [PATCH 01/13] dt-bindings: iio: adc: add mt6323 PMIC AUXADC 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 Message-Id: <20260504-mt6323-v1-1-799b58b355ff@protonmail.com> References: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> In-Reply-To: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Srinivas Kandagatla , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Lee Jones Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, Ben Grisdale , Roman Vivchar X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777919095; l=2722; i=rva333@protonmail.com; s=20260325; h=from:subject:message-id; bh=XPIXRDZjIr1oHvzoo9sh4iZKYAKxVcZZDRCPHSoj0Zs=; b=6PgEHIy0LQy0rccGbN1mtBbpxZNOpoWD7AzrYh5pCwjNaWk8d5CeZXcYp9p+hWzjpttEQC1a4 n82lAnVqs97A8v9uCRo+z553P0v6pmYYduZNXxmLK1JJ5X3SUlPMaEW X-Developer-Key: i=rva333@protonmail.com; a=ed25519; pk=euuVBZGtA2Cqb8Dju84qpQPhvwxyUirJlXpqEPQWKBM= X-Endpoint-Received: by B4 Relay for rva333@protonmail.com/20260325 with auth_id=695 X-Original-From: Roman Vivchar Reply-To: rva333@protonmail.com From: Roman Vivchar The MediaTek mt6323 PMIC includes an AUXADC used for battery voltage, temperature, and other internal measurements. Add the devicetree binding documentation and the associated header file defining the ADC channel constants. Tested-by: Ben Grisdale # Amazon Echo Dot (2nd Ge= neration) Signed-off-by: Roman Vivchar --- .../bindings/iio/adc/mediatek,mt6323-auxadc.yaml | 39 ++++++++++++++++++= ++++ .../dt-bindings/iio/adc/mediatek,mt6323-auxadc.h | 16 +++++++++ 2 files changed, 55 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/adc/mediatek,mt6323-auxa= dc.yaml b/Documentation/devicetree/bindings/iio/adc/mediatek,mt6323-auxadc.= yaml new file mode 100644 index 000000000000..7dc1ac8bf253 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/mediatek,mt6323-auxadc.yaml @@ -0,0 +1,39 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/mediatek,mt6323-auxadc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek MT6323 PMIC AUXADC + +maintainers: + - Roman Vivchar + +description: > + The Auxiliary Analog/Digital Converter (AUXADC) is an ADC found + in the MediaTek MT6323 PMIC, performing various PMIC related measurements + such as battery and PMIC internal voltage regulators temperatures, + accessory detection resistance (usually, for a 3.5mm audio jack) + other than voltages for various PMIC internal components. + +properties: + compatible: + const: mediatek,mt6323-auxadc + + "#io-channel-cells": + const: 1 + +required: + - compatible + - "#io-channel-cells" + +additionalProperties: false + +examples: + - | + #include + + adc { + compatible =3D "mediatek,mt6323-auxadc"; + #io-channel-cells =3D <1>; + }; diff --git a/include/dt-bindings/iio/adc/mediatek,mt6323-auxadc.h b/include= /dt-bindings/iio/adc/mediatek,mt6323-auxadc.h new file mode 100644 index 000000000000..c12a21e7ddea --- /dev/null +++ b/include/dt-bindings/iio/adc/mediatek,mt6323-auxadc.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ + +#ifndef _DT_BINDINGS_MEDIATEK_MT6323_AUXADC_H +#define _DT_BINDINGS_MEDIATEK_MT6323_AUXADC_H + +#define MT6323_AUXADC_BATON2 0 +#define MT6323_AUXADC_CH6 1 +#define MT6323_AUXADC_BAT_TEMP 2 +#define MT6323_AUXADC_CHIP_TEMP 3 +#define MT6323_AUXADC_VCDT 4 +#define MT6323_AUXADC_BATON1 5 +#define MT6323_AUXADC_ISENSE 6 +#define MT6323_AUXADC_BATSNS 7 +#define MT6323_AUXADC_ACCDET 8 + +#endif --=20 2.53.0 From nobody Sun Jun 14 01:35:13 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 D14163E63A1; Mon, 4 May 2026 18:24:58 +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=1777919098; cv=none; b=A85tPRrkLQbej64riRdduggGZzACUjid88e5Lx+SGx7IdGfjGlHOnd97MjRK0zWNuxSf2ElxtRQomNDFlWlDS/dYI0y5SamANw9UrozWEoXJFFsr2fb7Hnt/AWVfI6dSkHs3DFmRxCoDGlAaoLFTqi7d+/321XxyD1c0Df12FUM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777919098; c=relaxed/simple; bh=W43pjjd8uh4BI2x+5IpU0y5Die/7tvfOKOBvAMHfunY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rmZnxyihuX8ErWJgj6xUCh29SYTzgLcWw9+mIy6JXYCeRsTInjKut5y/MUlb7fpV+uXGOOFZ/c8+ygdxVk9zRavF0jPPPFJpA6iqTXrFIdOJkiZSRkEHtw6DqnxFA95XS9I+nLvgTs7pxChymoBozi5c67qU4NBnZmqgXFZREZs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Rq098v9B; 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="Rq098v9B" Received: by smtp.kernel.org (Postfix) with ESMTPS id 99BB2C2BCF4; Mon, 4 May 2026 18:24:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777919098; bh=W43pjjd8uh4BI2x+5IpU0y5Die/7tvfOKOBvAMHfunY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Rq098v9BBFWBFErf3qi+SI7ApW+gj1W7Xv2V883I11+t/gvSdX7QG+7HbsbUreUWi U+6Wxw0lzw4VWMZL73kPt1ztOQ8hpjkh5LVLWe/f7y9TZ8pcMXj4qqx9n1Faa7t00m zoK4l5OfASOoLPzNI77r2yYrrmJUY9RtS4FyZw3P1fLetmyZoSOtNNKHaXeKHn0RoX hDj27HwPD/4S6wb7o1bEVtH9ALgbGMPQ+si+NKXNcT69fWm+zVHw4ih6uEdGwD0+lA MxuA2ucFiA0jNi2a5tVOcKHQpSeNVDADFenyFsqpT/32I2Ey2xkOz8BnhKUK2sk0cp 9g2IO9dhir4WA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87DA1CD3430; Mon, 4 May 2026 18:24:58 +0000 (UTC) From: Roman Vivchar via B4 Relay Date: Mon, 04 May 2026 21:24:54 +0300 Subject: [PATCH 02/13] dt-bindings: nvmem: add mt6323 PMIC EFUSE 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 Message-Id: <20260504-mt6323-v1-2-799b58b355ff@protonmail.com> References: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> In-Reply-To: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Srinivas Kandagatla , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Lee Jones Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, Ben Grisdale , Roman Vivchar X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777919095; l=1691; i=rva333@protonmail.com; s=20260325; h=from:subject:message-id; bh=TDwKTKu2cZc7u9klkOVCAaJXpSXuuDnK80oaDp3s4XA=; b=QyRCwIcC2yywc1uTzzTmOq3WgWRG+kGrwQhuXwmDoOFKdugyeRblC9dKhWN8q8RWrceuFq49w Grz9bOIPSeKDqHtlQqd4XA5nA/MyjxaIfEQNl7XerI3ta4FAhYIr4P3 X-Developer-Key: i=rva333@protonmail.com; a=ed25519; pk=euuVBZGtA2Cqb8Dju84qpQPhvwxyUirJlXpqEPQWKBM= X-Endpoint-Received: by B4 Relay for rva333@protonmail.com/20260325 with auth_id=695 X-Original-From: Roman Vivchar Reply-To: rva333@protonmail.com From: Roman Vivchar The MediaTek mt6323 PMIC includes an EFUSE used for storing calibration data. Add the device tree binding documentation for the MediaTek mt6323 EFUSE. Tested-by: Ben Grisdale # Amazon Echo Dot (2nd Ge= neration) Signed-off-by: Roman Vivchar --- .../bindings/nvmem/mediatek,mt6323-efuse.yaml | 42 ++++++++++++++++++= ++++ 1 file changed, 42 insertions(+) diff --git a/Documentation/devicetree/bindings/nvmem/mediatek,mt6323-efuse.= yaml b/Documentation/devicetree/bindings/nvmem/mediatek,mt6323-efuse.yaml new file mode 100644 index 000000000000..eb2437b0c1f0 --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/mediatek,mt6323-efuse.yaml @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/nvmem/mediatek,mt6323-efuse.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek MT6323 PMIC EFUSE + +description: | + MT6323 efuse is used for storing calibration data, such as thermal sensor + calibration. + +maintainers: + - Roman Vivchar + +allOf: + - $ref: nvmem.yaml# + +properties: + compatible: + const: mediatek,mt6323-efuse + +required: + - compatible + +unevaluatedProperties: false + +examples: + - | + mt6323_efuse: efuse { + compatible =3D "mediatek,mt6323-efuse"; + + nvmem-layout { + compatible =3D "fixed-layout"; + #address-cells =3D <1>; + #size-cells =3D <1>; + + mt6323_thermal_calibration_data: thermal-data@14 { + reg =3D <0x14 0x4>; + }; + }; + }; --=20 2.53.0 From nobody Sun Jun 14 01:35:13 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 DADA53E63A5; Mon, 4 May 2026 18:24:58 +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=1777919098; cv=none; b=GgWqhyKJl+sCetgNPiuGcgwLzumda9RUoIGHVaDMjqQ8lEe2PuPHvtNoy9SB0SxFPwB2dHV2D7ggsfs9zVtd6gQ0YVSQazcs0VVX4T8tvoXBzGFtRraCF43KoNEpwGc2eRz83Oj55FEJXBRiVQ/KGMKbBnWnRcys86OaGT2MDKg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777919098; c=relaxed/simple; bh=KLZKepons1ktWUi2cBQErmKekVgkW3Se0X3Vct8Tzv8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VmoBRfGt8MWD+iq0tFcKChoFrLEoLVaSz/tNwsh3QJ1kj2AnVigEr3Ne08kla1qNtsjA2sAOlaFP/SdUpyNOaQ6pr6SzRQVs/bIC9UJGNqhxT1+mIWBjn60euk5nAerlIxjg1Gx97iILrQabpQ3sjENjE8g6kC4uL4z7mlMjTHk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=B1mO8BP2; 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="B1mO8BP2" Received: by smtp.kernel.org (Postfix) with ESMTPS id A81A2C2BCF5; Mon, 4 May 2026 18:24:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777919098; bh=KLZKepons1ktWUi2cBQErmKekVgkW3Se0X3Vct8Tzv8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=B1mO8BP2bXa0mSeeC6gqwke9UdeoBN4BX+2IJ0Ya0DQQdDwzhTvNxMSxEcqmuShAA 7/gQmd3onHmtystCjQTzrBC5Wh84Y50FyLiMjuzDO0eza1GZkezcC6LNjR4gC0lI6v kttLs6lSd8EyfMWpQ9Lq06Um+fVa4/3Fo+i2Fj41I2/wKxyLBDlUtBkA/f6tJZWal2 jXJ5IuDxU3a7vax+fDKwFePN5W9ZalBC3MhIUENFxm2BopTB2YHqHVIPsKHoRj06MP 9PXZ8b32WDLBKsOifR5sd8yV2zZ95ICRc/MuxcHgaAAqBeV8atQ/sTwtdhOztO7McP 6WXhao6WeLE7A== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D107FF885A; Mon, 4 May 2026 18:24:58 +0000 (UTC) From: Roman Vivchar via B4 Relay Date: Mon, 04 May 2026 21:24:55 +0300 Subject: [PATCH 03/13] dt-bindings: thermal: add mt6323 PMIC thermal 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 Message-Id: <20260504-mt6323-v1-3-799b58b355ff@protonmail.com> References: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> In-Reply-To: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Srinivas Kandagatla , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Lee Jones Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, Ben Grisdale , Roman Vivchar X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777919095; l=2523; i=rva333@protonmail.com; s=20260325; h=from:subject:message-id; bh=Y0jGUqql3soeCei8ikkZ/UAUGnGbcX1Kt0zfmNLXZe4=; b=lQx9pnqPRHZhANCq6Fot6muIYsncfpNjwFildJFkPJyUUmvivT5WyxPskKeUZyyj05VzSA3s8 QsmJn2RmGknDE3xVFJJ7MX3q+cv0iIOMyuptPHzDdSNh8XjAkhcp4/S X-Developer-Key: i=rva333@protonmail.com; a=ed25519; pk=euuVBZGtA2Cqb8Dju84qpQPhvwxyUirJlXpqEPQWKBM= X-Endpoint-Received: by B4 Relay for rva333@protonmail.com/20260325 with auth_id=695 X-Original-From: Roman Vivchar Reply-To: rva333@protonmail.com From: Roman Vivchar The MediaTek mt6323 PMIC temperature can be read using AUXADC channel. Add the devicetree binding documentation for the MediaTek mt6323 thermal. Due similarities with newer PMICs like mt6358, which include more than one thermal sensor, the #thermal-sensor-cells should be set to 1, to avoid breaking devicetree ABI in future. Tested-by: Ben Grisdale # Amazon Echo Dot (2nd Ge= neration) Signed-off-by: Roman Vivchar --- .../bindings/thermal/mediatek,mt6323-thermal.yaml | 63 ++++++++++++++++++= ++++ 1 file changed, 63 insertions(+) diff --git a/Documentation/devicetree/bindings/thermal/mediatek,mt6323-ther= mal.yaml b/Documentation/devicetree/bindings/thermal/mediatek,mt6323-therma= l.yaml new file mode 100644 index 000000000000..1882816ba274 --- /dev/null +++ b/Documentation/devicetree/bindings/thermal/mediatek,mt6323-thermal.yaml @@ -0,0 +1,63 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/thermal/mediatek,mt6323-thermal.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek PMIC thermal + +maintainers: + - Roman Vivchar + +description: + The MediaTek PMIC thermal sensor uses an AUXADC channel to read raw + temperature data and applies calibration data from NVMEM. + +allOf: + - $ref: thermal-sensor.yaml# + +properties: + compatible: + const: mediatek,mt6323-thermal + + io-channels: + description: > + IIO channel for the AUXADC to read raw data from. + maxItems: 1 + + io-channel-names: + const: vts + + nvmem-cells: + description: > + NVMEM cell with phandle to the calibration data provided by the + NVMEM device. If unspecified default values will be used. + maxItems: 1 + + nvmem-cell-names: + const: calibration-data + + "#thermal-sensor-cells": + const: 1 + +required: + - compatible + - io-channels + - io-channel-names + - "#thermal-sensor-cells" + +unevaluatedProperties: false + +examples: + - | + #include + + mt6323_thermal: thermal { + compatible =3D "mediatek,mt6323-thermal"; + nvmem-cells =3D <&mt6323_thermal_calibration_data>; + nvmem-cell-names =3D "calibration-data"; + + io-channels =3D <&mt6323_adc MT6323_AUXADC_CHIP_TEMP>; + io-channel-names =3D "vts"; + #thermal-sensor-cells =3D <1>; + }; --=20 2.53.0 From nobody Sun Jun 14 01:35:13 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 0070D3E63B1; Mon, 4 May 2026 18:24:58 +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=1777919099; cv=none; b=NeTj17AteS17nKfDWziNso5XG8WxlJLJPN/hmd4IakBdYbAGHPa9+8EN0yn4+uYgeCKgCsNOmJZVzk7keK+Mc3BLro1gsDAWKIqyMyENJIOxRxO4uAdNc8PeDveuLxpCZJOqSRnEKYoQaEoRfK5eJMyxanjJ1JAiDMYCXFGaZG0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777919099; c=relaxed/simple; bh=jiEnga835ZWXljUXe/gp5QJ2hFyU8WTdUMfjkirRE5w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cbGehVAoIhXBevbKnS2Q6mRWvtCC26znL8w4BT8Y/gU7wtMF7tDDktWO6m+4BXtpWFAjeHrnOy5jSbXig7LgDM3iJ9BSJUUs7klksgYnvyrR6ejetlqrYBuh0uEn6+zCitcnUVwTn32kzlOgirUIeISLryG1UhSaN7nqIzb8VuI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bTRQjEB7; 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="bTRQjEB7" Received: by smtp.kernel.org (Postfix) with ESMTPS id BC6F8C2BCFA; Mon, 4 May 2026 18:24:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777919098; bh=jiEnga835ZWXljUXe/gp5QJ2hFyU8WTdUMfjkirRE5w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=bTRQjEB7bj0hUtK9nRed0VLss17YpaFzU6bQO/XFJdWEWDEUvsrxSO6WEOtP1nNEO rgbzU2mFHYWmKB77ycdA8+/lAuxFrTcYUfMNF9bresvUKjsX8Xh8cJSXmz+isZOs69 sQyKaw847kiAq/dCJImXt0lvAO5v3Hi8oBZTjvAKCCMICBSTYlzFKge0bQ01yImJOS gITDcIsj2rJ9Ad7mlGxxOcnjb7FlAzReSeNgI97fG9jqFmdfTshAYe4Izrn9IUUTeZ WfxQp67ItPV1wGfFb6wJN82icE3C4HkH67bIhsOQCwYBmoNGefcMyoTaaJzvxTS8fr 2Jt9A+/dQZeow== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B47CBCD3436; Mon, 4 May 2026 18:24:58 +0000 (UTC) From: Roman Vivchar via B4 Relay Date: Mon, 04 May 2026 21:24:56 +0300 Subject: [PATCH 04/13] iio: adc: mediatek: add mt6323 PMIC AUXADC driver 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 Message-Id: <20260504-mt6323-v1-4-799b58b355ff@protonmail.com> References: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> In-Reply-To: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Srinivas Kandagatla , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Lee Jones Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, Ben Grisdale , Roman Vivchar X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777919095; l=12347; i=rva333@protonmail.com; s=20260325; h=from:subject:message-id; bh=ntbXW4JgcRRKUQ/pbraWJLDHLEhabTwURPdUBQZOVzI=; b=xMJnNoS8/Lw4YMf50KV1e0r4lDkQSQ1sV5zI54Be7RLHVPZWuNA1bm+U0PAOi7XT89oUN0Oc9 945wYVty4spBfzm2htQ8dzpQgTqMKyf/hnOkqMKTXAzPWHYMQdU2jzY X-Developer-Key: i=rva333@protonmail.com; a=ed25519; pk=euuVBZGtA2Cqb8Dju84qpQPhvwxyUirJlXpqEPQWKBM= X-Endpoint-Received: by B4 Relay for rva333@protonmail.com/20260325 with auth_id=695 X-Original-From: Roman Vivchar Reply-To: rva333@protonmail.com From: Roman Vivchar The mt6323 AUXADC is a 15-bit ADC used for system monitoring. This driver provides support for reading various channels including battery and charger voltages, battery and chip temperature, current sensing and accessory detection. Add a driver for the AUXADC found in the MediaTek mt6323 PMIC. Tested-by: Ben Grisdale # Amazon Echo Dot (2nd Ge= neration) Signed-off-by: Roman Vivchar --- drivers/iio/adc/Kconfig | 11 ++ drivers/iio/adc/Makefile | 1 + drivers/iio/adc/mt6323-auxadc.c | 372 ++++++++++++++++++++++++++++++++++++= ++++ 3 files changed, 384 insertions(+) diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index 60038ae8dfc4..a03614b46041 100644 --- a/drivers/iio/adc/Kconfig +++ b/drivers/iio/adc/Kconfig @@ -1137,6 +1137,17 @@ config MCP3911 This driver can also be built as a module. If so, the module will be called mcp3911. =20 +config MEDIATEK_MT6323_AUXADC + tristate "MediaTek MT6323 PMIC AUXADC driver" + depends on MFD_MT6397 + help + Say yes here to enable support for MediaTek MT6323 PMIC Auxiliary ADC. + This driver provides multiple channels for system monitoring, + such as battery voltage, PMIC temperature, and others. + + This driver can also be built as a module. If so, the module will be + called mt6323-auxadc. + config MEDIATEK_MT6359_AUXADC tristate "MediaTek MT6359 PMIC AUXADC driver" depends on MFD_MT6397 diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile index c76550415ff1..58161750d6e3 100644 --- a/drivers/iio/adc/Makefile +++ b/drivers/iio/adc/Makefile @@ -99,6 +99,7 @@ obj-$(CONFIG_MCP320X) +=3D mcp320x.o obj-$(CONFIG_MCP3422) +=3D mcp3422.o obj-$(CONFIG_MCP3564) +=3D mcp3564.o obj-$(CONFIG_MCP3911) +=3D mcp3911.o +obj-$(CONFIG_MEDIATEK_MT6323_AUXADC) +=3D mt6323-auxadc.o obj-$(CONFIG_MEDIATEK_MT6359_AUXADC) +=3D mt6359-auxadc.o obj-$(CONFIG_MEDIATEK_MT6360_ADC) +=3D mt6360-adc.o obj-$(CONFIG_MEDIATEK_MT6370_ADC) +=3D mt6370-adc.o diff --git a/drivers/iio/adc/mt6323-auxadc.c b/drivers/iio/adc/mt6323-auxad= c.c new file mode 100644 index 000000000000..97b4ad4e7b47 --- /dev/null +++ b/drivers/iio/adc/mt6323-auxadc.c @@ -0,0 +1,372 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2026 Roman Vivchar + * + * Based on drivers/iio/adc/mt6359-auxadc.c + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#define AUXADC_RSTB_SEL BIT(7) +#define AUXADC_RSTB_SW BIT(5) + +#define AUXADC_CTL_CK BIT(5) + +#define AUXADC_TRIM_CH2 (3 << 10) +#define AUXADC_TRIM_CH4 (3 << 8) +#define AUXADC_TRIM_CH5 (3 << 4) +#define AUXADC_TRIM_CH6 (3 << 2) + +#define AUXADC_VREF18_ENB_MD BIT(15) +#define AUXADC_MD_STATUS BIT(0) + +#define AUXADC_GPS_STATUS BIT(1) + +#define AUXADC_VREF18_SELB BIT(1) +#define AUXADC_DECI_GDLY_SEL BIT(0) + +#define AUXADC_VBUF_EN BIT(4) + +#define AUXADC_DECI_GDLY_MASK GENMASK(15, 14) +#define AUXADC_ADC19_BUSY_MASK GENMASK(15, 0) +#define AUXADC_RDY_MASK BIT(15) +#define AUXADC_DATA_MASK GENMASK(14, 0) +#define AUXADC_OSR_MASK GENMASK(12, 10) +#define AUXADC_LOW_CHANNEL_MASK GENMASK(9, 0) +#define AUXADC_AUDIO_CHANNEL_MASK GENMASK(8, 0) + +#define MTK_PMIC_IIO_CHAN(_name, _idx, _ch_type) \ + { .type =3D _ch_type, \ + .indexed =3D 1, \ + .channel =3D _idx, \ + .address =3D _idx, \ + .datasheet_name =3D __stringify(_name), \ + .info_mask_separate =3D BIT(IIO_CHAN_INFO_RAW) | \ + BIT(IIO_CHAN_INFO_SCALE) } + +static const struct iio_chan_spec mt6323_auxadc_channels[] =3D { + MTK_PMIC_IIO_CHAN(baton2, MT6323_AUXADC_BATON2, IIO_VOLTAGE), + MTK_PMIC_IIO_CHAN(ch6, MT6323_AUXADC_CH6, IIO_VOLTAGE), + MTK_PMIC_IIO_CHAN(bat_temp, MT6323_AUXADC_BAT_TEMP, IIO_TEMP), + MTK_PMIC_IIO_CHAN(chip_temp, MT6323_AUXADC_CHIP_TEMP, IIO_TEMP), + MTK_PMIC_IIO_CHAN(vcdt, MT6323_AUXADC_VCDT, IIO_VOLTAGE), + MTK_PMIC_IIO_CHAN(baton1, MT6323_AUXADC_BATON1, IIO_VOLTAGE), + MTK_PMIC_IIO_CHAN(isense, MT6323_AUXADC_ISENSE, IIO_VOLTAGE), + MTK_PMIC_IIO_CHAN(batsns, MT6323_AUXADC_BATSNS, IIO_VOLTAGE), + MTK_PMIC_IIO_CHAN(accdet, MT6323_AUXADC_ACCDET, IIO_VOLTAGE), +}; + +/** + * struct mt6323_auxadc - Main driver structure + * @dev: Device pointer + * @regmap: Regmap from PWRAP + * @lock: Mutex to serialize AUXADC reading vs configuration + */ +struct mt6323_auxadc { + struct device *dev; + struct regmap *regmap; + struct mutex lock; +}; + +static u32 mt6323_auxadc_channel_to_reg(unsigned long channel) +{ + switch (channel) { + case 0: + return MT6323_AUXADC_ADC6; + case 1: + return MT6323_AUXADC_ADC11; + case 2: + return MT6323_AUXADC_ADC5; + case 3: + return MT6323_AUXADC_ADC4; + case 4: + return MT6323_AUXADC_ADC2; + case 5: + return MT6323_AUXADC_ADC3; + case 6: + return MT6323_AUXADC_ADC1; + case 7: + return MT6323_AUXADC_ADC0; + case 8: + return MT6323_AUXADC_ADC7; + default: + return MT6323_AUXADC_ADC17; + } +} + +static int mt6323_auxadc_check_if_stuck(struct mt6323_auxadc *auxadc) +{ + int i, ret; + u32 val; + + for (i =3D 0; i < 50; i++) { + ret =3D regmap_read(auxadc->regmap, MT6323_AUXADC_CON19, &val); + if (ret) + return ret; + + if (FIELD_GET(AUXADC_DECI_GDLY_MASK, val)) { + ret =3D regmap_read(auxadc->regmap, MT6323_AUXADC_ADC19, + &val); + if (ret) + return ret; + + if (!FIELD_GET(AUXADC_ADC19_BUSY_MASK, val)) { + ret =3D regmap_update_bits( + auxadc->regmap, MT6323_AUXADC_CON19, + FIELD_PREP(AUXADC_DECI_GDLY_MASK, 3), + 0x0); + if (ret) + return ret; + } + } else { + return 0; + } + + fsleep(10); + } + + return -ETIMEDOUT; +} + +static int mt6323_auxadc_request(struct mt6323_auxadc *auxadc, + unsigned long channel) +{ + int ret; + u32 pmic_val, adc_val; + + if (channel < 9) { + ret =3D regmap_update_bits(auxadc->regmap, MT6323_AUXADC_CON11, + AUXADC_VBUF_EN, AUXADC_VBUF_EN); + if (ret) + return ret; + + ret =3D regmap_read(auxadc->regmap, MT6323_AUXADC_CON22, + &pmic_val); + if (ret) + return ret; + + adc_val =3D FIELD_GET(AUXADC_LOW_CHANNEL_MASK, pmic_val); + adc_val &=3D ~BIT(channel); + + ret =3D regmap_update_bits(auxadc->regmap, MT6323_AUXADC_CON22, + AUXADC_LOW_CHANNEL_MASK, adc_val); + if (ret) + return ret; + + ret =3D regmap_read(auxadc->regmap, MT6323_AUXADC_CON22, + &pmic_val); + if (ret) + return ret; + + adc_val =3D FIELD_GET(AUXADC_LOW_CHANNEL_MASK, pmic_val); + adc_val |=3D BIT(channel); + + ret =3D regmap_update_bits(auxadc->regmap, MT6323_AUXADC_CON22, + AUXADC_LOW_CHANNEL_MASK, adc_val); + + } else { + ret =3D regmap_read(auxadc->regmap, MT6323_AUXADC_CON23, + &pmic_val); + if (ret) + return ret; + + adc_val =3D FIELD_GET(AUXADC_AUDIO_CHANNEL_MASK, pmic_val); + adc_val &=3D ~BIT(channel - 9); + + ret =3D regmap_update_bits(auxadc->regmap, MT6323_AUXADC_CON23, + AUXADC_AUDIO_CHANNEL_MASK, adc_val); + if (ret) + return ret; + + ret =3D regmap_read(auxadc->regmap, MT6323_AUXADC_CON23, + &pmic_val); + if (ret) + return ret; + + adc_val =3D FIELD_GET(AUXADC_AUDIO_CHANNEL_MASK, pmic_val); + adc_val |=3D BIT(channel - 9); + + ret =3D regmap_update_bits(auxadc->regmap, MT6323_AUXADC_CON23, + AUXADC_AUDIO_CHANNEL_MASK, adc_val); + } + + return ret; +} + +static int mt6323_auxadc_read(struct mt6323_auxadc *auxadc, + const struct iio_chan_spec *chan, int *out) +{ + int ret; + u32 reg =3D mt6323_auxadc_channel_to_reg(chan->address); + u32 val; + + ret =3D regmap_read_poll_timeout(auxadc->regmap, reg, val, + (val & AUXADC_RDY_MASK), 1000, 100000); + if (ret) + return ret; + + *out =3D FIELD_GET(AUXADC_DATA_MASK, val); + + return 0; +} + +static int mt6323_auxadc_read_raw(struct iio_dev *indio_dev, + const struct iio_chan_spec *chan, int *val, + int *val2, long mask) +{ + struct mt6323_auxadc *auxadc =3D iio_priv(indio_dev); + int ret, mult =3D 1; + + if (mask =3D=3D IIO_CHAN_INFO_RAW) { + scoped_guard(mutex, &auxadc->lock) + { + ret =3D mt6323_auxadc_check_if_stuck(auxadc); + if (ret) + return ret; + + ret =3D mt6323_auxadc_request(auxadc, chan->address); + if (ret) + return ret; + + usleep_range(300, 500); + + ret =3D mt6323_auxadc_read(auxadc, chan, val); + if (ret) + return ret; + return IIO_VAL_INT; + } + } else if (mask =3D=3D IIO_CHAN_INFO_SCALE) { + if (chan->channel =3D=3D MT6323_AUXADC_ISENSE || + chan->address =3D=3D MT6323_AUXADC_BATSNS) + mult =3D 4; + + *val =3D mult * 1800; + *val2 =3D 32768; + + return IIO_VAL_FRACTIONAL; + } else + return -EINVAL; +} + +static int mt6323_auxadc_init(struct mt6323_auxadc *auxadc) +{ + int ret; + + ret =3D regmap_update_bits(auxadc->regmap, MT6323_STRUP_CON10, + AUXADC_RSTB_SW | AUXADC_RSTB_SEL, + AUXADC_RSTB_SW | AUXADC_RSTB_SEL); + if (ret) + return ret; + + ret =3D regmap_update_bits(auxadc->regmap, MT6323_TOP_CKPDN2, + AUXADC_CTL_CK, AUXADC_CTL_CK); + if (ret) + return ret; + + ret =3D regmap_update_bits(auxadc->regmap, MT6323_AUXADC_CON10, + AUXADC_TRIM_CH2 | AUXADC_TRIM_CH4 | + AUXADC_TRIM_CH5 | AUXADC_TRIM_CH6, + AUXADC_TRIM_CH2 | AUXADC_TRIM_CH4 | + AUXADC_TRIM_CH5 | AUXADC_TRIM_CH6); + if (ret) + return ret; + + ret =3D regmap_update_bits(auxadc->regmap, MT6323_AUXADC_CON27, + AUXADC_VREF18_ENB_MD | AUXADC_MD_STATUS, + AUXADC_VREF18_ENB_MD | AUXADC_MD_STATUS); + if (ret) + return ret; + + ret =3D regmap_update_bits(auxadc->regmap, MT6323_AUXADC_CON19, + AUXADC_GPS_STATUS, AUXADC_GPS_STATUS); + if (ret) + return ret; + + ret =3D regmap_update_bits(auxadc->regmap, MT6323_AUXADC_CON26, + AUXADC_VREF18_SELB | AUXADC_DECI_GDLY_SEL, + AUXADC_VREF18_SELB | AUXADC_DECI_GDLY_SEL); + if (ret) + return ret; + + ret =3D regmap_update_bits(auxadc->regmap, MT6323_AUXADC_CON9, + AUXADC_OSR_MASK, + FIELD_PREP(AUXADC_OSR_MASK, 3)); + return ret; +} + +static const struct iio_info mt6323_auxadc_iio_info =3D { + .read_raw =3D mt6323_auxadc_read_raw, +}; + +static int mt6323_auxadc_probe(struct platform_device *pdev) +{ + struct device *dev =3D &pdev->dev; + struct mt6323_auxadc *auxadc; + struct iio_dev *iio; + struct regmap *regmap; + int ret; + + /* mfd->pwrap regmap */ + regmap =3D dev_get_regmap(dev->parent->parent, NULL); + if (!regmap) + return dev_err_probe(dev, -ENODEV, "failed to get regmap\n"); + + iio =3D devm_iio_device_alloc(dev, sizeof(*auxadc)); + if (!iio) + return -ENOMEM; + + auxadc =3D iio_priv(iio); + auxadc->regmap =3D regmap; + auxadc->dev =3D dev; + mutex_init(&auxadc->lock); + + ret =3D mt6323_auxadc_init(auxadc); + if (ret) + return dev_err_probe(dev, ret, "failed to initialize auxadc\n"); + + iio->name =3D "mt6323-auxadc"; + iio->info =3D &mt6323_auxadc_iio_info; + iio->modes =3D INDIO_DIRECT_MODE; + iio->channels =3D mt6323_auxadc_channels; + iio->num_channels =3D ARRAY_SIZE(mt6323_auxadc_channels); + + ret =3D devm_iio_device_register(dev, iio); + if (ret) + return dev_err_probe(dev, ret, + "failed to register iio device\n"); + + return 0; +} + +static const struct of_device_id mt6323_auxadc_of_match[] =3D { + { .compatible =3D "mediatek,mt6323-auxadc" }, + {} +}; +MODULE_DEVICE_TABLE(of, mt6323_auxadc_of_match); + +static struct platform_driver mt6323_auxadc_driver =3D { + .driver =3D { + .name =3D "mt6323-auxadc", + .of_match_table =3D mt6323_auxadc_of_match, + }, + .probe =3D mt6323_auxadc_probe, +}; +module_platform_driver(mt6323_auxadc_driver); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MediaTek MT6323 PMIC AUXADC Driver"); --=20 2.53.0 From nobody Sun Jun 14 01:35:13 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 303443E714A; Mon, 4 May 2026 18:24:59 +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=1777919099; cv=none; b=n2+8YMT97FRKcMiTewwOY9vP5od2KAmoMy2GrxEDQtZQ3LaFxWv7VXDZXUopLlUO8jgodOhCy9CJ9tgFfJO7ryTkrLqWXb7UhfTbWfwz57bcAVys4IJNinF8G0QN5s6cnyZl7xcRPe5yGvhVLVbgAEujYkaThlZL2wngbltOVms= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777919099; c=relaxed/simple; bh=SFyDTRyWZjDxmsFtAqwCPfeazjDIIWp9P+6ztku6jaM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=M2vo431KEZHPwijiGwT9e0lFyShE2JDNMm/UQVkCLvstU4HpiizqkOJY+lvYEkhh75+1ss/oMtqfoOsW4d0m4cy6IP3Xk5W+kEo9R1n6NqiuFAABi/rl6/ZdeRtLu4Ka60RyU9WGxaITarr+xSG+K1JM4sf2OEETtEVyfrYI90k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=s2UAt5ov; 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="s2UAt5ov" Received: by smtp.kernel.org (Postfix) with ESMTPS id D0621C2BCFF; Mon, 4 May 2026 18:24:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777919098; bh=SFyDTRyWZjDxmsFtAqwCPfeazjDIIWp9P+6ztku6jaM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=s2UAt5ovqGlDNFbvBTOq9Ul3dNhnc8+V4nJQ46Am+zdgmiXhdKT+g0jZ0Q8ix3IZj O2/VeKbMqjR3qc7N/pLMAiC2vLZfx7v8A1TDWEPO7mzEnMe6iuLR7Z4bt08xQVfoqx +g47+4YP6+SaIvYJik8QeCbV86R+KhJVsfZ3acj9IqauGEuo4Cay6pSTSurvHmG4B9 QQeAEpk0E8PmMKb919W7ExNurr5gq0+GVF3tu4NTCGHVbztRVypUfhSjcX5p9Ep2rv HV/8B4b4aqHbekZ7A70x8he6Tad6ccU5VeYc2vGLY+ywBYgrIP3JgX8TRtqqoz+iFt l14GrneLJz23A== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5DBDCD3427; Mon, 4 May 2026 18:24:58 +0000 (UTC) From: Roman Vivchar via B4 Relay Date: Mon, 04 May 2026 21:24:57 +0300 Subject: [PATCH 05/13] nvmem: add mt6323 PMIC EFUSE driver 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 Message-Id: <20260504-mt6323-v1-5-799b58b355ff@protonmail.com> References: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> In-Reply-To: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Srinivas Kandagatla , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Lee Jones Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, Ben Grisdale , Roman Vivchar X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777919095; l=4311; i=rva333@protonmail.com; s=20260325; h=from:subject:message-id; bh=1nnD8x2/YfoddlKavtCr39AhwjwKkPATibCGf0JcRFk=; b=CI5X+E7LWYk0XH+OzSwni+MoWgPTu5HtndpDXnOqF9faEAkuaULlKcmd0lygCathpvFdBASrg 4bDRnzyx1tNB1bkDi+UHEUCBKymKHiNPndUPXJqGBcyuGzcbcrQiVoC X-Developer-Key: i=rva333@protonmail.com; a=ed25519; pk=euuVBZGtA2Cqb8Dju84qpQPhvwxyUirJlXpqEPQWKBM= X-Endpoint-Received: by B4 Relay for rva333@protonmail.com/20260325 with auth_id=695 X-Original-From: Roman Vivchar Reply-To: rva333@protonmail.com From: Roman Vivchar Add support for the EFUSE controller found in the Mediatek MT6323 PMIC. The MT6323 EFUSE stores 24 bytes of hardware-related data, such as thermal sensor calibration values. Tested-by: Ben Grisdale # Amazon Echo Dot (2nd Ge= neration) Signed-off-by: Roman Vivchar --- drivers/nvmem/Kconfig | 11 ++++++ drivers/nvmem/Makefile | 2 ++ drivers/nvmem/mt6323-efuse.c | 86 ++++++++++++++++++++++++++++++++++++++++= ++++ 3 files changed, 99 insertions(+) diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig index 74ddbd0f79b0..db248a3c4e87 100644 --- a/drivers/nvmem/Kconfig +++ b/drivers/nvmem/Kconfig @@ -227,6 +227,17 @@ config NVMEM_MTK_EFUSE This driver can also be built as a module. If so, the module will be called efuse-mtk. =20 +config NVMEM_MT6323_EFUSE + tristate "Mediatek MT6323 PMIC EFUSE support" + depends on ARCH_MEDIATEK || COMPILE_TEST + depends on MFD_MT6397 + help + This is a driver to access hardware related data like sensor + calibration, etc. + + This driver can also be built as a module. If so, the module + will be called efuse-mt6323. + config NVMEM_MXS_OCOTP tristate "Freescale MXS On-Chip OTP Memory Support" depends on ARCH_MXS || COMPILE_TEST diff --git a/drivers/nvmem/Makefile b/drivers/nvmem/Makefile index 7252b8ec88d4..0e2b73f42b25 100644 --- a/drivers/nvmem/Makefile +++ b/drivers/nvmem/Makefile @@ -48,6 +48,8 @@ obj-$(CONFIG_NVMEM_MICROCHIP_OTPC) +=3D nvmem-microchip-o= tpc.o nvmem-microchip-otpc-y :=3D microchip-otpc.o obj-$(CONFIG_NVMEM_MTK_EFUSE) +=3D nvmem_mtk-efuse.o nvmem_mtk-efuse-y :=3D mtk-efuse.o +obj-$(CONFIG_NVMEM_MT6323_EFUSE) +=3D nvmem_mt6323-efuse.o +nvmem_mt6323-efuse-y :=3D mt6323-efuse.o obj-$(CONFIG_NVMEM_MXS_OCOTP) +=3D nvmem-mxs-ocotp.o nvmem-mxs-ocotp-y :=3D mxs-ocotp.o obj-$(CONFIG_NVMEM_NINTENDO_OTP) +=3D nvmem-nintendo-otp.o diff --git a/drivers/nvmem/mt6323-efuse.c b/drivers/nvmem/mt6323-efuse.c new file mode 100644 index 000000000000..0c1b405fbc89 --- /dev/null +++ b/drivers/nvmem/mt6323-efuse.c @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2026 Roman Vivchar + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MT6323_EFUSE_DOUT_BASE MT6323_EFUSE_DOUT_0_15 +#define MT6323_EFUSE_SIZE 24 + +struct mt6323_efuse { + struct regmap *regmap; +}; + +static int mt6323_efuse_read(void *context, unsigned int offset, void *val, + size_t bytes) +{ + struct mt6323_efuse *efuse =3D context; + u32 tmp; + u16 *buf =3D val; + int i, ret; + + for (i =3D 0; i < bytes; i +=3D 2) { + ret =3D regmap_read(efuse->regmap, + MT6323_EFUSE_DOUT_BASE + offset + i, &tmp); + if (ret) + return ret; + buf[i / 2] =3D tmp; + } + return 0; +} + +static int mt6323_efuse_probe(struct platform_device *pdev) +{ + struct device *dev =3D &pdev->dev; + struct mt6323_efuse *priv; + struct nvmem_config config =3D { + .name =3D "mt6323-efuse", + .stride =3D 2, + .word_size =3D 2, + .size =3D MT6323_EFUSE_SIZE, + .reg_read =3D mt6323_efuse_read, + }; + struct nvmem_device *nvmem; + + priv =3D devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + /* efuse -> mfd -> pwrap */ + priv->regmap =3D dev_get_regmap(dev->parent->parent, NULL); + if (!priv->regmap) + return -ENODEV; + + config.dev =3D dev; + config.priv =3D priv; + + nvmem =3D devm_nvmem_register(dev, &config); + return PTR_ERR_OR_ZERO(nvmem); +} + +static const struct of_device_id mt6323_efuse_of_match[] =3D { + { .compatible =3D "mediatek,mt6323-efuse" }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(of, mt6323_efuse_of_match); + +static struct platform_driver mt6323_efuse_driver =3D { + .probe =3D mt6323_efuse_probe, + .driver =3D { + .name =3D "mt6323-efuse", + .of_match_table =3D mt6323_efuse_of_match, + }, +}; +module_platform_driver(mt6323_efuse_driver); + +MODULE_DESCRIPTION("Mediatek MT6323 PMIC EFUSE driver"); +MODULE_LICENSE("GPL"); --=20 2.53.0 From nobody Sun Jun 14 01:35:13 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 3212C3E714C; Mon, 4 May 2026 18:24:59 +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=1777919099; cv=none; b=m1z+PHeP0NOEX5+GopQV93HHvyYOHyA0MCKwa2HPjeDASS3RiegLkI26qJK7msy8K+KHf4dRqqBOHYMPHdOhk1U6S+071ALhauMAm0ACFrH5enuZ3wUTrxciBhTDItFmjwvX/oUfqSaZ44jGouq1K/blDMcCWYKOOddIQYnmGWU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777919099; c=relaxed/simple; bh=roplHQL+mzNZNXWyR2ZxnPRzTcKtQ62wvrEUaeGypbo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Jj5X0O8/gePSU2VXOtefrTuP7yVd/zYAvRp8G3fw04e1+w76r6tNAO8Iju2X3pJbKX1WzyEkawVl8S4jaqHB0hGplchV+mzaqAmdHKLODMxA/dCTw5PxAh0zn5KrMvWmxDP2aitgfSmS1jTnSCforSx9Qb74SoZu4gMn6RCn6AU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KtHYrT0T; 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="KtHYrT0T" Received: by smtp.kernel.org (Postfix) with ESMTPS id E07EAC2BCF6; Mon, 4 May 2026 18:24:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777919098; bh=roplHQL+mzNZNXWyR2ZxnPRzTcKtQ62wvrEUaeGypbo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=KtHYrT0TbkzS1gcMfaadit4TgU5GNk2kk/hQbGbPLBOHZeFkE4JDwcI5pbXi3QHfQ N5EhoBmClAM4OyuDur01Niv9exQA6DVkcgDK09PduqS8QgN5BBQww7Fw7E7zB3Ukeb +8GbyXKVPI7VR43J45exgaVMf6hFSL5Su+GCYh5v+GbNt/w8wyBdXlER7Cli79UiqY LAaKT6vE7MaxecetHu9Kg44F1gTSD6Xs81+UOrJgO6xD+sC9IdJiOAd5wsr/nSPSbw VCHjpVwVCE4Bw+R2mjT+yfILi9a6qXX/nHKT8XB5sDBkBXF+B/APa0u3LDaiW1qNOy EdLSv2PkD5CGg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7171CD342F; Mon, 4 May 2026 18:24:58 +0000 (UTC) From: Roman Vivchar via B4 Relay Date: Mon, 04 May 2026 21:24:58 +0300 Subject: [PATCH 06/13] thermal: mediatek: add pmic thermal support 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 Message-Id: <20260504-mt6323-v1-6-799b58b355ff@protonmail.com> References: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> In-Reply-To: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Srinivas Kandagatla , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Lee Jones Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, Ben Grisdale , Roman Vivchar X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777919095; l=9247; i=rva333@protonmail.com; s=20260325; h=from:subject:message-id; bh=+z1fPADxDwcxEADv1H3y1Q2TiS13p9Uu+a5I0Q7eIOk=; b=EpoNV1dOvs0MavUph11WXvlVWBpmd6xjPWpBTmLi4qRrYaQYq708+u3aEdeypvELcCTvkPQMF ghMHThzYfbaD6HKQ2XrfrUbFvV0BIq1bhWV+7Srv57VInSgiReAhDbl X-Developer-Key: i=rva333@protonmail.com; a=ed25519; pk=euuVBZGtA2Cqb8Dju84qpQPhvwxyUirJlXpqEPQWKBM= X-Endpoint-Received: by B4 Relay for rva333@protonmail.com/20260325 with auth_id=695 X-Original-From: Roman Vivchar Reply-To: rva333@protonmail.com From: Roman Vivchar Add a new driver to support thermal monitoring on MediaTek PMICs. The driver retrieves calibration data from EFUSE, calculates the temperature using a linear interpolation, and registers the device with the thermal framework. Initial support is added for the mt6323 PMIC. Tested-by: Ben Grisdale # Amazon Echo Dot (2nd Ge= neration) Signed-off-by: Roman Vivchar --- drivers/thermal/mediatek/Kconfig | 9 ++ drivers/thermal/mediatek/Makefile | 1 + drivers/thermal/mediatek/pmic_thermal.c | 274 ++++++++++++++++++++++++++++= ++++ 3 files changed, 284 insertions(+) diff --git a/drivers/thermal/mediatek/Kconfig b/drivers/thermal/mediatek/Kc= onfig index d82c86d9be56..f2da7d14a01a 100644 --- a/drivers/thermal/mediatek/Kconfig +++ b/drivers/thermal/mediatek/Kconfig @@ -34,4 +34,13 @@ config MTK_LVTS_THERMAL_DEBUGFS help Enable this option to debug the internals of the device driver. =20 +config MTK_PMIC_THERMAL + tristate "AUXADC temperature sensor driver for MediaTek PMICs" + depends on MFD_MT6397 + help + Enable this option if you want to get PMIC temperature + information for MediaTek platforms. + This driver configures thermal controllers to collect + temperature via AUXADC interface. + endif diff --git a/drivers/thermal/mediatek/Makefile b/drivers/thermal/mediatek/M= akefile index 1c6daa1e644b..22fce58aafd2 100644 --- a/drivers/thermal/mediatek/Makefile +++ b/drivers/thermal/mediatek/Makefile @@ -1,2 +1,3 @@ obj-$(CONFIG_MTK_SOC_THERMAL) +=3D auxadc_thermal.o obj-$(CONFIG_MTK_LVTS_THERMAL) +=3D lvts_thermal.o +obj-$(CONFIG_MTK_PMIC_THERMAL) +=3D pmic_thermal.o diff --git a/drivers/thermal/mediatek/pmic_thermal.c b/drivers/thermal/medi= atek/pmic_thermal.c new file mode 100644 index 000000000000..1dce106a28c3 --- /dev/null +++ b/drivers/thermal/mediatek/pmic_thermal.c @@ -0,0 +1,274 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2026 Roman Vivchar + * + * Based on drivers/thermal/mediatek/auxadc_thermal.c + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define MAX_SENSORS 1 + +#define MT6323_TEMP_MIN -20000 +#define MT6323_TEMP_MAX 150000 + +/* Layout of the fuses providing the calibration data */ +#define CALIB_BUF0_VTS(x) (((x) >> 8) & 0xff) +#define CALIB_BUF0_DEGC_CALI(x) (((x) >> 2) & 0x3f) +#define CALIB_BUF0_ADC_CALI_EN(x) (((x) >> 1) & 0x1) + +#define CALIB_BUF1_ID_20(x) (((x) >> 14) & 0x1) +#define CALIB_BUF1_ID_10(x) (((x) >> 12) & 0x1) +#define CALIB_BUF1_O_SLOPE_20(x) (((((x) >> 11) & 0x7) << 3) + (((x) >> 6)= & 0x7)) +#define CALIB_BUF1_O_SLOPE_10(x) (((x) >> 6) & 0x3f) +#define CALIB_BUF1_O_SLOPE_SIGN(x) (((x) >> 5) & 0x1) +#define CALIB_BUF1_VTS(x) ((((x) >> 0) & 0x1f) << 8) + +#define MT6323_CALIBRATION 171 + +struct mtk_pmic_thermal; + +struct mtk_thermal_data { + const char *const *sensors; + s32 num_sensors; + const int cali_val; + + int (*extract_efuse)(struct mtk_pmic_thermal *mt, u16 *buf); + void (*precalc)(struct mtk_pmic_thermal *mt, s32 vts, s32 degc_cali, + s32 o_slope, s32 o_slope_sign); +}; + +struct mtk_pmic_sensor { + struct mtk_pmic_thermal *mt; + int id; + struct iio_channel *adc_channel; + struct thermal_zone_device *tzdev; +}; + +struct mtk_pmic_thermal { + struct device *dev; + struct regmap *regmap; + struct mtk_pmic_sensor sensors[MAX_SENSORS]; + + s32 t_slope1; + s32 t_slope2; + s32 t_intercept; + + const struct mtk_thermal_data *data; +}; + +static bool mtk_pmic_thermal_temp_is_valid(int temp) +{ + return (temp >=3D MT6323_TEMP_MIN) && (temp <=3D MT6323_TEMP_MAX); +} + +static int mtk_pmic_read_temp(struct thermal_zone_device *tz, int *tempera= ture) +{ + struct mtk_pmic_sensor *sensor =3D thermal_zone_device_priv(tz); + int ret, raw, temp; + + ret =3D iio_read_channel_processed(sensor->adc_channel, &raw); + if (ret < 0) { + dev_err(sensor->mt->dev, "failed to read iio channel: %d\n", + ret); + return ret; + } + + temp =3D sensor->mt->t_intercept + + ((sensor->mt->t_slope1 * raw) / sensor->mt->t_slope2); + + if (!mtk_pmic_thermal_temp_is_valid(temp)) + return -EINVAL; + + *temperature =3D temp; + return 0; +} + +static const struct thermal_zone_device_ops mtk_pmic_thermal_ops =3D { + .get_temp =3D mtk_pmic_read_temp, +}; + +static void mtk_pmic_thermal_precalc_mt6323(struct mtk_pmic_thermal *mt, + s32 vts, s32 degc_cali, s32 o_slope, + s32 o_slope_sign) +{ + s32 vbe_t; + + mt->t_slope1 =3D 100 * 1000; + + if (o_slope_sign =3D=3D 0) + mt->t_slope2 =3D -(mt->data->cali_val + o_slope); + else + mt->t_slope2 =3D -(mt->data->cali_val - o_slope); + + vbe_t =3D -1 * (((vts + 9102) * 1800) / 32768) * 1000; + + if (o_slope_sign =3D=3D 0) + mt->t_intercept =3D + (vbe_t * 100) / -(mt->data->cali_val + o_slope); + else + mt->t_intercept =3D + (vbe_t * 100) / -(mt->data->cali_val - o_slope); + + mt->t_intercept +=3D (degc_cali * (1000 / 2)); +} + +static int mtk_pmic_thermal_extract_efuse_mt6323(struct mtk_pmic_thermal *= mt, + u16 *buf) +{ + u32 reg; + s32 vts, degc_cali, o_slope, o_slope_sign, id; + int ret; + + if (!CALIB_BUF0_ADC_CALI_EN(buf[0])) + return -EINVAL; + + vts =3D CALIB_BUF1_VTS(buf[1]) + CALIB_BUF0_VTS(buf[0]); + degc_cali =3D CALIB_BUF0_DEGC_CALI(buf[0]); + o_slope_sign =3D CALIB_BUF1_O_SLOPE_SIGN(buf[1]); + + ret =3D regmap_read(mt->regmap, MT6323_CID, ®); + if (ret) { + dev_err(mt->dev, "failed to read chip id\n"); + return ret; + } + + if (reg =3D=3D 0x1023) { + o_slope =3D CALIB_BUF1_O_SLOPE_10(buf[1]); + id =3D CALIB_BUF1_ID_10(buf[1]); + } else if (reg =3D=3D 0x2023) { + o_slope =3D CALIB_BUF1_O_SLOPE_20(buf[1]); + id =3D CALIB_BUF1_ID_20(buf[1]); + } else { + dev_err(mt->dev, "invalid chip id: 0x%x\n", reg); + return -EINVAL; + } + + if (id =3D=3D 0) + o_slope =3D 0; + + mt->data->precalc(mt, vts, degc_cali, o_slope, o_slope_sign); + + return 0; +} + +static int mtk_pmic_thermal_get_calib_data(struct device *dev, + struct mtk_pmic_thermal *mt) +{ + struct nvmem_cell *cell; + void *buf; + size_t len; + int ret; + + cell =3D nvmem_cell_get(dev, "calibration-data"); + if (IS_ERR(cell)) + return PTR_ERR(cell); + + buf =3D nvmem_cell_read(cell, &len); + nvmem_cell_put(cell); + + if (IS_ERR(buf)) + return PTR_ERR(buf); + + if (len < 2 * sizeof(u16)) { + dev_warn(dev, "invalid calibration data length\n"); + ret =3D -EINVAL; + goto out; + } + + ret =3D mt->data->extract_efuse(mt, buf); + if (ret) { + dev_info(dev, "device not calibrated, using default values\n"); + mt->data->precalc(mt, 3698, 50, 0, 0); + ret =3D 0; + } + +out: + kfree(buf); + return ret; +} + +static int mtk_pmic_thermal_probe(struct platform_device *pdev) +{ + struct device *dev =3D &pdev->dev; + struct mtk_pmic_thermal *mt; + int i, ret; + + mt =3D devm_kzalloc(dev, sizeof(*mt), GFP_KERNEL); + if (!mt) + return -ENOMEM; + + mt->regmap =3D dev_get_regmap(dev->parent->parent, NULL); + if (!mt->regmap) + return dev_err_probe(dev, -ENODEV, "failed to get regmap"); + + mt->dev =3D dev; + mt->data =3D of_device_get_match_data(dev); + + ret =3D mtk_pmic_thermal_get_calib_data(dev, mt); + if (ret) + return ret; + + for (i =3D 0; i < mt->data->num_sensors; i++) { + struct mtk_pmic_sensor *sensor =3D &mt->sensors[i]; + + sensor->id =3D i; + sensor->mt =3D mt; + + sensor->adc_channel =3D + devm_iio_channel_get(dev, mt->data->sensors[i]); + if (IS_ERR(sensor->adc_channel)) + return dev_err_probe(dev, PTR_ERR(sensor->adc_channel), + "failed to get channel %s\n", + mt->data->sensors[i]); + + sensor->tzdev =3D devm_thermal_of_zone_register( + dev, i, sensor, &mtk_pmic_thermal_ops); + if (IS_ERR(sensor->tzdev)) + return dev_err_probe( + dev, PTR_ERR(sensor->tzdev), + "failed to register thermal zone %d\n", i); + } + + return 0; +} + +static const char *const mt6323_adc_channels[] =3D { "vts" }; + +static const struct mtk_thermal_data mt6323_thermal_data =3D { + .sensors =3D mt6323_adc_channels, + .num_sensors =3D ARRAY_SIZE(mt6323_adc_channels), + .cali_val =3D MT6323_CALIBRATION, + .extract_efuse =3D mtk_pmic_thermal_extract_efuse_mt6323, + .precalc =3D mtk_pmic_thermal_precalc_mt6323, +}; + +static const struct of_device_id mtk_pmic_thermal_of_match[] =3D { + { .compatible =3D "mediatek,mt6323-thermal", + .data =3D &mt6323_thermal_data }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(of, mtk_pmic_thermal_of_match); + +static struct platform_driver mtk_pmic_thermal_driver =3D { + .probe =3D mtk_pmic_thermal_probe, + .driver =3D { + .name =3D "mtk-pmic-thermal", + .of_match_table =3D mtk_pmic_thermal_of_match, + }, +}; +module_platform_driver(mtk_pmic_thermal_driver); + +MODULE_DESCRIPTION("MediaTek PMIC thermal driver"); +MODULE_LICENSE("GPL"); --=20 2.53.0 From nobody Sun Jun 14 01:35:13 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 35CDB3E7157; Mon, 4 May 2026 18:24:59 +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=1777919099; cv=none; b=WylCvKMpG9p3FaF6uXuizB/AWbN6eUl58h1VHRCEk0PXibtnyN0CaqkqksrpNMzcpqCX72oJwy7DqVUWwsR8Hoq1yWRk6SnU+VoiuFfV5oa+5GTphPnOdLi/qGZxK5ofm9KqGMDgi+B9nz+h5CIABydgfnZEAOgDs0Uv9Ipz1g0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777919099; c=relaxed/simple; bh=Y8RRnjbVWWfSsXubDmQ/aNyniPj2babVSWWeRmEkfu0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ckvJ5VZe8z7u/1YOAg3WsHDUrn5CHgNxfa/lRz2r5K8EVbsSsQYDFG+OQDZmAPEkUfv5E5IyzopMZGKRCZkt8251bE9mc/m8CA76I9suOuQB/Z+xSUxM5THTQ4qr4M/jTCVwLQZKayLNq107XMo39WusMV7dzLUFRkQ11LuHD80= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SZ3jF1kf; 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="SZ3jF1kf" Received: by smtp.kernel.org (Postfix) with ESMTPS id F3A09C2BCB8; Mon, 4 May 2026 18:24:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777919099; bh=Y8RRnjbVWWfSsXubDmQ/aNyniPj2babVSWWeRmEkfu0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=SZ3jF1kfZuCBardkWavGDmwyFuSNVduNsoUpHyt4hF/8upKNiXwIVrlQEcXqb3m5b ICqQqtswWQSSxqbTZ2flCjLjbmJi9Rd6+hskhqCcoBUL2T9iqB/XsSylL11pNaUAQ+ OB6pTkds35IQ8sYOgC34LZjOHPMwiXvQ3n4zoQWb/6jao9eUPCAcvhnpplHfFKohHU czKZa7OkKejnrxK120f3sXrHuXQl4fGzYAearhKUYHJPqE5JX1ndeyell+DXTkyq50 JR2v9x/lNc8qG34Z6EWpRrDX8TWy4j7rTUEHjDQIbFzY22qn+1RxDLJXWseWeUw+Ih sHrfLjD973gxQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E90EDFF885A; Mon, 4 May 2026 18:24:58 +0000 (UTC) From: Roman Vivchar via B4 Relay Date: Mon, 04 May 2026 21:24:59 +0300 Subject: [PATCH 07/13] mfd: mt6397-core: add mt6323 AUXADC support 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 Message-Id: <20260504-mt6323-v1-7-799b58b355ff@protonmail.com> References: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> In-Reply-To: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Srinivas Kandagatla , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Lee Jones Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, Ben Grisdale , Roman Vivchar X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777919095; l=903; i=rva333@protonmail.com; s=20260325; h=from:subject:message-id; bh=m2Pvxq9wuOJnH3Hy2q7BaiOyrPBWfmKBMng+ZyF1/H4=; b=cF+fbkqP4fxCJy3pxsjrD5kLR0K5h1iCbPckCnrGn5b76Od1nivY0wx0Gg+OxeKiELmdY2RFU TKlSLQ3DPU2CeTJLtANKr0pv7Tmabjmd6aCX32SBfVmYKD2SeQNjnfj X-Developer-Key: i=rva333@protonmail.com; a=ed25519; pk=euuVBZGtA2Cqb8Dju84qpQPhvwxyUirJlXpqEPQWKBM= X-Endpoint-Received: by B4 Relay for rva333@protonmail.com/20260325 with auth_id=695 X-Original-From: Roman Vivchar Reply-To: rva333@protonmail.com From: Roman Vivchar The mt6323 PMIC includes an AUXADC. Register the AUXADC in the mt6323 devices array to allow the corresponding driver to probe using compatible string. Tested-by: Ben Grisdale # Amazon Echo Dot (2nd Ge= neration) Signed-off-by: Roman Vivchar --- drivers/mfd/mt6397-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index 3e58d0764c7e..013b0857fb54 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -125,6 +125,9 @@ static const struct resource mt6323_pwrc_resources[] = =3D { =20 static const struct mfd_cell mt6323_devs[] =3D { { + .name =3D "mt6323-auxadc", + .of_compatible =3D "mediatek,mt6323-auxadc", + }, { .name =3D "mt6323-rtc", .num_resources =3D ARRAY_SIZE(mt6323_rtc_resources), .resources =3D mt6323_rtc_resources, --=20 2.53.0 From nobody Sun Jun 14 01:35:13 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 3CF3F3E8C78; Mon, 4 May 2026 18:24:59 +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=1777919099; cv=none; b=KkqlOzYzkW+ahEghFwwtaNlhiufYb9LQD8OoELA0g9BqS/34wIF727ZE+BfTq2XsdqeGlzuIGwdQe6CO3wfddKwku/+c/FfnmC6vmRw1RgGUN+4tvxoZLviNGitQoyRRjJRsoqGuXQHG1uL3x1JLjSJVjsTK6QkxMr7WYVDMIMQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777919099; c=relaxed/simple; bh=WDFhxjJb9z+ifSIY6a5Dfa4xTAgGcmZYrk7QDVq6rdw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hjp4iHCS94/NbjZm8kTt+j1L5VPx586jKIT13JclY8FzIMKRJiNP0Zi4y8EKWBvzfxzayMv7+ode/yJq5E1D/bHZPnDtNgci1l1k9V7fxGRNPjFtnFC793vP9KKRZC7mo8T3nvs6jlnls3OQMKqsZaBnry7B3i6WOfQYn1It2qE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iQ1yVBTX; 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="iQ1yVBTX" Received: by smtp.kernel.org (Postfix) with ESMTPS id 10564C2BCF5; Mon, 4 May 2026 18:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777919099; bh=WDFhxjJb9z+ifSIY6a5Dfa4xTAgGcmZYrk7QDVq6rdw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=iQ1yVBTXJiCZTxeXqFTfDys3JxsA1Pw59lZyiDiS5yQ71zemGW+Nk3GyMsfc8EOwu gfz9rZnZvJRb2BjwkkE9VQ9ebmxLkYgD/FLxqqpMYXChOQUqgcyZ9EnO5JvK2t+f8E dBtHg4/IbOEC8zWgvHXwfFf6mcnKbJhEFSoWkkYLTSqRePYSI8PTsui9PowoLX4JXk rbKEhmDTlUpZ58itFdV8uW8Td5pbXCiSCDu1DOmyH9Kyp7jhgxQJpOh/smehWmw2Hw TiKnXjfnbqgUHK3X75NTVpYbADsQZAwMrAFfK9oG6Yc1A3+Ug0v3v1xrsSFvSdq/31 llLaiNjmTPSZQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05D67CD3430; Mon, 4 May 2026 18:24:59 +0000 (UTC) From: Roman Vivchar via B4 Relay Date: Mon, 04 May 2026 21:25:00 +0300 Subject: [PATCH 08/13] mfd: mt6397-core: add support for mt6323 efuse 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 Message-Id: <20260504-mt6323-v1-8-799b58b355ff@protonmail.com> References: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> In-Reply-To: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Srinivas Kandagatla , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Lee Jones Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, Ben Grisdale , Roman Vivchar X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777919095; l=882; i=rva333@protonmail.com; s=20260325; h=from:subject:message-id; bh=KHZcH06TkyVO2TQwIZCbwT+DwvWV7qLrxAW86+Uky0E=; b=aHVrflr5+/NWv4HshdZg/E1DtkavRTPohIu568wUne7D2WRSQLE/Wpo2rHBief8PxE2fLxMSf 3r0EjqDGRw4AmxaZ/tU/z4ItF2gRc7OdTVaeoeyRS5blCnvcu5unomK X-Developer-Key: i=rva333@protonmail.com; a=ed25519; pk=euuVBZGtA2Cqb8Dju84qpQPhvwxyUirJlXpqEPQWKBM= X-Endpoint-Received: by B4 Relay for rva333@protonmail.com/20260325 with auth_id=695 X-Original-From: Roman Vivchar Reply-To: rva333@protonmail.com From: Roman Vivchar The mt6323 PMIC includes an EFUSE. Register the EFUSE in the mt6323 devices array to allow the corresponding driver to probe using compatible string. Tested-by: Ben Grisdale # Amazon Echo Dot (2nd Ge= neration) Signed-off-by: Roman Vivchar --- drivers/mfd/mt6397-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index 013b0857fb54..2d9419b80a5c 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -127,6 +127,9 @@ static const struct mfd_cell mt6323_devs[] =3D { { .name =3D "mt6323-auxadc", .of_compatible =3D "mediatek,mt6323-auxadc", + }, { + .name =3D "mt6323-efuse", + .of_compatible =3D "mediatek,mt6323-efuse", }, { .name =3D "mt6323-rtc", .num_resources =3D ARRAY_SIZE(mt6323_rtc_resources), --=20 2.53.0 From nobody Sun Jun 14 01:35:13 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 6C85E3E92BF; Mon, 4 May 2026 18:24:59 +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=1777919099; cv=none; b=DTZoa0HknDdSoK9NtXmZU+rpkCJREmeWIx/08Z6w3LaSz4IlBXlvkqmP39uR+FThLCNAaJ3wababHIZB9k7yEKg43Rf/SAYLPdRwlPzvNjsbr8Jt0ACf0ncXkZ0UkcLe4e/Zh0qfOmfChFwMwdDJr7Zl5a9Gu9WkUfs6sDjnJ/4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777919099; c=relaxed/simple; bh=wMsaPJTluTOvZFL0m5jH60KdVathnpyRBOWpiXT7BKk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NJpUMCEMnCmGpTO1sQrMU1KcxfJ8YsHDiJksw5ElLkwS4FC4ARN2sL93CdaNKzY1mDlMioOuF5y/pqE/hQNFaW+anF25whw6ck41axQ7V6Xds1Oir3sRs89YuI0TEKlainclJlsXeMyzhAhcihjAO/sQW4NS97bSFsgcTj5uKP8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QCnLNbmm; 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="QCnLNbmm" Received: by smtp.kernel.org (Postfix) with ESMTPS id 204ACC2BCC4; Mon, 4 May 2026 18:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777919099; bh=wMsaPJTluTOvZFL0m5jH60KdVathnpyRBOWpiXT7BKk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=QCnLNbmmWof8Rok38vimSq3yfhpYRhsZAPXK4G23WrDHwrY68/ebOnrMabSFzDzp3 TwwljkP+gXxfWiqepRdkBst5Bz4qom16o58qb+152eoRQtwGOsyWfo3WqALmO8mSvs G9kqgErY5FJmte1VBF3M+ObKj+NyulqOghKx8oSoSDyjpAOigJnQeiz70wPL+OxXVp 0hAwZeq7vzl7lXjGyh9haqdAjgG68dMJW0JDgOjirY/fnbnnmOegEXWiwvMprUb7RM 5ipOMAIPb0pfYdzJ+GsnVp94xH4NP7Z5/Tnde1wwA2XZ1yHCRb9MBQQGcOlmQWpePC /Q8llwSLUxRQw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 176F9CD3427; Mon, 4 May 2026 18:24:59 +0000 (UTC) From: Roman Vivchar via B4 Relay Date: Mon, 04 May 2026 21:25:01 +0300 Subject: [PATCH 09/13] mfd: mt6397-core: add support for mt6323 thermal 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 Message-Id: <20260504-mt6323-v1-9-799b58b355ff@protonmail.com> References: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> In-Reply-To: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Srinivas Kandagatla , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Lee Jones Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, Ben Grisdale , Roman Vivchar X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777919095; l=903; i=rva333@protonmail.com; s=20260325; h=from:subject:message-id; bh=1GBl1TpFBcVXYGizGdKi1F7hlRKLPxUy3Qzy4DpQjMM=; b=8nyO1z82QxMlj6H0WEVe86aCBbZcH4auRH3dTb7ryxt+R5BbJ1NJpZ0rlhv416KiWWfCYbyhM VaAhTEw+tP3ChoTAZAIFSwzFtWpJxazwDOCBgmDQ680MNhJw61JUEO0 X-Developer-Key: i=rva333@protonmail.com; a=ed25519; pk=euuVBZGtA2Cqb8Dju84qpQPhvwxyUirJlXpqEPQWKBM= X-Endpoint-Received: by B4 Relay for rva333@protonmail.com/20260325 with auth_id=695 X-Original-From: Roman Vivchar Reply-To: rva333@protonmail.com From: Roman Vivchar The mt6323 PMIC temperature can be measured using AUXADC channel. Register the thermal in the mt6323 devices array to allow the corresponding driver to probe using compatible string. Tested-by: Ben Grisdale # Amazon Echo Dot (2nd Ge= neration) Signed-off-by: Roman Vivchar --- drivers/mfd/mt6397-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index 2d9419b80a5c..061ac242f1f8 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -151,6 +151,9 @@ static const struct mfd_cell mt6323_devs[] =3D { .num_resources =3D ARRAY_SIZE(mt6323_pwrc_resources), .resources =3D mt6323_pwrc_resources, .of_compatible =3D "mediatek,mt6323-pwrc" + }, { + .name =3D "mt6323-thermal", + .of_compatible =3D "mediatek,mt6323-thermal", }, }; =20 --=20 2.53.0 From nobody Sun Jun 14 01:35:13 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 74D003E959A; Mon, 4 May 2026 18:24:59 +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=1777919099; cv=none; b=U6Xm9VqPCfKiVdbMZYCOjA6P4mqIjznZQmixPyZvgWCxeA751jdCqSkYfyMUn/YbGbLdei9/2XHB9vp4nI9MKd6uONAjnHlmag229IDmadgDS+z2OnqeX0BW5HZIhYj3HL5rGxnJx3zaorNg4uZDYZwSwt8Lpz4v9xTZZ5LOu+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777919099; c=relaxed/simple; bh=0fwwYNeYc3kr+antF5NrKzPSvQ6OoHbAnhgXEJEye30=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=R9I3swSO2ZNiGyo3XevgoQGZlEgfVBoLqILo5mFaqHPFX4H0M+KkicVFNV+N/sVIBecyde5v5FKkDTPPTL+JcCcB7u7BmUmu0WK0xblM4sQwQRXAuYRmxMNqdE1PEvcFO9xZPCVHcXbLljZXQEG3B39fyH1JRqWdqovwVa36Fzs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QkRYfLSp; 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="QkRYfLSp" Received: by smtp.kernel.org (Postfix) with ESMTPS id 3241EC2BCFA; Mon, 4 May 2026 18:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777919099; bh=0fwwYNeYc3kr+antF5NrKzPSvQ6OoHbAnhgXEJEye30=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=QkRYfLSpf98W7hQ4ObbEW1P7mNvxg0uTiNgwI3is1u4TqGRHjMiiCysDYbGlpvVH4 sE3NHndNy09z1N+ONPBEnxhlSFDQHCx2hVCFgyGf018Rv3mV8H6QAoqRQIsEr+Ta1b AiiSRl/+pU5ZcNP+mKWCz/TvUA85+fPnxqtnJ92I1xXYIpA/3laMq9HZ/FmtcoCsIv 8mo3+fmi2Naih0QAYTtXf4jCm1UbLooH6ylk3Dr35BH3Ro648LhDMyinsW5/4kfVyw GXckxmtOTkT+vdctqOR2lgqI7EMUB9zDpFB+vFEWuJDZN18q0LQ8UQHRzRuiakku5g a2V3dsFurWRsg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 286F0CD3436; Mon, 4 May 2026 18:24:59 +0000 (UTC) From: Roman Vivchar via B4 Relay Date: Mon, 04 May 2026 21:25:02 +0300 Subject: [PATCH 10/13] ARM: dts: mediatek: mt6323: add support for AUXADC 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 Message-Id: <20260504-mt6323-v1-10-799b58b355ff@protonmail.com> References: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> In-Reply-To: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Srinivas Kandagatla , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Lee Jones Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, Ben Grisdale , Roman Vivchar X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777919095; l=814; i=rva333@protonmail.com; s=20260325; h=from:subject:message-id; bh=La2MB3KRVqMYMwKFh7B+QquLap8lejJsUVONHZ0oCfM=; b=If4UY3kmkGiEJJtVFcFrKYvQsaQvfITJvuCaHU1csy8WFVf6gx+wsgv7vYyM5HTJ73TbQgOTx WkNqaEcst4fCb1ix8Y3iJ4sOMMXOH9KGgZQl8YBm0mb/AlQVmgIlyRm X-Developer-Key: i=rva333@protonmail.com; a=ed25519; pk=euuVBZGtA2Cqb8Dju84qpQPhvwxyUirJlXpqEPQWKBM= X-Endpoint-Received: by B4 Relay for rva333@protonmail.com/20260325 with auth_id=695 X-Original-From: Roman Vivchar Reply-To: rva333@protonmail.com From: Roman Vivchar Add the devicetree node for the mt6323 AUXADC. Tested-by: Ben Grisdale # Amazon Echo Dot (2nd Ge= neration) Signed-off-by: Roman Vivchar --- arch/arm/boot/dts/mediatek/mt6323.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/boot/dts/mediatek/mt6323.dtsi b/arch/arm/boot/dts/med= iatek/mt6323.dtsi index c230c865116d..c070f4b0936c 100644 --- a/arch/arm/boot/dts/mediatek/mt6323.dtsi +++ b/arch/arm/boot/dts/mediatek/mt6323.dtsi @@ -14,6 +14,11 @@ pmic: mt6323 { interrupt-controller; #interrupt-cells =3D <2>; =20 + mt6323_adc: adc { + compatible =3D "mediatek,mt6323-auxadc"; + #io-channel-cells =3D <1>; + }; + mt6323_leds: leds { compatible =3D "mediatek,mt6323-led"; #address-cells =3D <1>; --=20 2.53.0 From nobody Sun Jun 14 01:35:13 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 75B833E95A0; Mon, 4 May 2026 18:24:59 +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=1777919099; cv=none; b=SbWs/fv3y8HFBFl/pSkZyjZdr5zaQsw42righ0EeEmHUEP+tpN1HwUFECrZor60mG0PnESfj/hIh+/HcoSAiJQzrpZNthbYWcss47acFHOHvX7E5q06eOHjbuYWK9Hc4gkWDJqTNjp1K8YRFhCZLb0CFIN1B7icgyJ5ETA67qaw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777919099; c=relaxed/simple; bh=7Utam/boR1PWgSQoP1yDij+IYi+ZEoWdQq6cZLulu/A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=J7L5uaP8rIzcB3MGjCcSzy4YsvVYYc5ZWOkfVgkCmjcBL8K7eyPrBVbiRQ39WCE4QJnncHFax4u1M+/PNxn6pN2t/LXGAY5Va+BOR34qRfv+EdFkwwUnpwzRxhYZDG/FmyEn+8Bcv6c4YR5eDYM4QUW7b/fw6VGBO11D1Ul7dRk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=djskdR+k; 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="djskdR+k" Received: by smtp.kernel.org (Postfix) with ESMTPS id 41F15C2BCFB; Mon, 4 May 2026 18:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777919099; bh=7Utam/boR1PWgSQoP1yDij+IYi+ZEoWdQq6cZLulu/A=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=djskdR+kkHYOdurNWMbYbWTcYiLvOCdZy6W+eY9cUq1/jnk4RMCjFQQXhvUKNOUcS kbN/uXZdsJ9sOxzTa0HG/LaGvvukVOJQ8mVgSQSPd32/dIAoyp/gqql69V45iOTpDq HvNm93/EFwSTC2InyfFAui1a2R0t0IdgzQ3iIifkWQNTXpSTs+hRTFzU+b2ORFFkC6 VgQs+fSbusaYb1km5ndMLQlqCMHpjIfrqxEGNFW955MUpDrZdjYtgMd8wTfZMokAwb vd8DObyVXGPCEB6/xbLUZE30ePWu3vGJF2wCdG4Cd2R85Hv39MnSILRggE34w5lyvq kyyRV9ShQ1ngw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39D06CD342F; Mon, 4 May 2026 18:24:59 +0000 (UTC) From: Roman Vivchar via B4 Relay Date: Mon, 04 May 2026 21:25:03 +0300 Subject: [PATCH 11/13] ARM: dts: mediatek: mt6323: add support for EFUSE 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 Message-Id: <20260504-mt6323-v1-11-799b58b355ff@protonmail.com> References: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> In-Reply-To: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Srinivas Kandagatla , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Lee Jones Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, Ben Grisdale , Roman Vivchar X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777919095; l=819; i=rva333@protonmail.com; s=20260325; h=from:subject:message-id; bh=D++I3Bv55Tj53B0+HYj0FqRkAmuZ8JRO4SRqrQ1v3kE=; b=R3R3H7pkJl3SJUsgkp3G8bZc23LQ5YY0fHmstJk6moZH4EJsDmbtoGRjL08m4XlCYoOWSwz31 FlLs6lfwy17D4sKpkub4ktmaXHGzhwXdwRg7E6rcWqbUXkR1+orSxOX X-Developer-Key: i=rva333@protonmail.com; a=ed25519; pk=euuVBZGtA2Cqb8Dju84qpQPhvwxyUirJlXpqEPQWKBM= X-Endpoint-Received: by B4 Relay for rva333@protonmail.com/20260325 with auth_id=695 X-Original-From: Roman Vivchar Reply-To: rva333@protonmail.com From: Roman Vivchar Add the efuse node for the mt6323 efuse. Tested-by: Ben Grisdale # Amazon Echo Dot (2nd Ge= neration) Signed-off-by: Roman Vivchar --- arch/arm/boot/dts/mediatek/mt6323.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/boot/dts/mediatek/mt6323.dtsi b/arch/arm/boot/dts/med= iatek/mt6323.dtsi index c070f4b0936c..3fe6a5e35e70 100644 --- a/arch/arm/boot/dts/mediatek/mt6323.dtsi +++ b/arch/arm/boot/dts/mediatek/mt6323.dtsi @@ -19,6 +19,12 @@ mt6323_adc: adc { #io-channel-cells =3D <1>; }; =20 + mt6323_efuse: efuse { + compatible =3D "mediatek,mt6323-efuse"; + #address-cells =3D <1>; + #size-cells =3D <1>; + }; + mt6323_leds: leds { compatible =3D "mediatek,mt6323-led"; #address-cells =3D <1>; --=20 2.53.0 From nobody Sun Jun 14 01:35:13 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 7F1033E715F; Mon, 4 May 2026 18:24:59 +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=1777919099; cv=none; b=Z0bCHI7aWYUBEnmgFjTGLFyKqRKqGh8QkbyExiggVY4pEosP7w+19Q9fRr7qp3dR+u2YvSz7/ZvDyZy7Ih2jeyg8Y7CGjvtuBcDyTNLjfi3+M0jl0N+LvDv0E2imcVZMuJ2vXZ2Gklaq2EHZyYQkhmEbhKEf/jFdKljL2kbyOR0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777919099; c=relaxed/simple; bh=4qPDy49jygT3//9CQLjty/Jo02gzR1H6Rh0ksy7xUUU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LVYNZxkvDgbsZDIM3ehztN9jSz6EzbjJOEcwj8zu/ZsPeJ7MU1noSkzT7zMv+W+rqOJthVQ4UIvhUmKCvqxR34k57Y9NKBUh1BCzv1afBTSLdXpBVVw4xnX3EuUf+jRHUn79jJKPNSjn3u343d/+ZlbhhVj4GV/vCPCeZ8HUagI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fatflkky; 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="fatflkky" Received: by smtp.kernel.org (Postfix) with ESMTPS id 5C000C2BCB8; Mon, 4 May 2026 18:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777919099; bh=4qPDy49jygT3//9CQLjty/Jo02gzR1H6Rh0ksy7xUUU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=fatflkkyr4qCZ5LLVtK5tIbpgLFUIz7ELnQxINcEMqoRieia5+eZxVc3+0ehlKw1M 0LBKpHPx9GUo3ZhwBpZObj3UfGsKZbmPTzdRBCwBZnMtJXckdRp0ieiYAeXIbIOo9e ZqHWjqcPqfBrbmsBYBZk210Xk6dlzrXLAT4vfjyH6oKog44W40qFFAobQQujWH6NL6 rKyB/XPfDr8nBj8fKdfvyhN/4SlexammzTg9CVIiY0rybuVaxhWdcZ8SF5ZqiWn9Ev EOsojhVIotfAzxkvxlYO+HD0iBHR3DgHNnrE1IKqEWkm5Hiy2uYWzNSX/sO8peXecP DhLqPp3VvVHLw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AD26FF885A; Mon, 4 May 2026 18:24:59 +0000 (UTC) From: Roman Vivchar via B4 Relay Date: Mon, 04 May 2026 21:25:04 +0300 Subject: [PATCH 12/13] ARM: dts: mediatek: mt6323: add support for thermal 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 Message-Id: <20260504-mt6323-v1-12-799b58b355ff@protonmail.com> References: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> In-Reply-To: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Srinivas Kandagatla , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Lee Jones Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, Ben Grisdale , Roman Vivchar X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777919095; l=1739; i=rva333@protonmail.com; s=20260325; h=from:subject:message-id; bh=RnX15Bbq0POSOMld8rImsDthXoY2gvxd4clxXzA+bLs=; b=jW2y5q+4ec0II0RivLcNCB19jAdPdayHabag4j3LyuTqfh8CcsUQSchx+QYvx94osw2zOF/wY JeaBhZfg5ODAnnCm2PTOt7Ne47BabO61K4FNAWW8mMO1afuvQNniTBz X-Developer-Key: i=rva333@protonmail.com; a=ed25519; pk=euuVBZGtA2Cqb8Dju84qpQPhvwxyUirJlXpqEPQWKBM= X-Endpoint-Received: by B4 Relay for rva333@protonmail.com/20260325 with auth_id=695 X-Original-From: Roman Vivchar Reply-To: rva333@protonmail.com From: Roman Vivchar Add the devicetree node for the mt6323 thermal. Tested-by: Ben Grisdale # Amazon Echo Dot (2nd Ge= neration) Signed-off-by: Roman Vivchar --- arch/arm/boot/dts/mediatek/mt6323.dtsi | 35 ++++++++++++++++++++++++++++++= ++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/mediatek/mt6323.dtsi b/arch/arm/boot/dts/med= iatek/mt6323.dtsi index 3fe6a5e35e70..bdfa177aa1e3 100644 --- a/arch/arm/boot/dts/mediatek/mt6323.dtsi +++ b/arch/arm/boot/dts/mediatek/mt6323.dtsi @@ -6,6 +6,8 @@ * */ =20 +#include + &pwrap { pmic: mt6323 { compatible =3D "mediatek,mt6323"; @@ -21,8 +23,16 @@ mt6323_adc: adc { =20 mt6323_efuse: efuse { compatible =3D "mediatek,mt6323-efuse"; - #address-cells =3D <1>; - #size-cells =3D <1>; + + nvmem-layout { + compatible =3D "fixed-layout"; + #address-cells =3D <1>; + #size-cells =3D <1>; + + mt6323_thermal_calibration_data: thermal-data@14 { + reg =3D <0x14 0x4>; + }; + }; }; =20 mt6323_leds: leds { @@ -276,5 +286,26 @@ power-controller { rtc { compatible =3D "mediatek,mt6323-rtc"; }; + + mt6323_thermal: thermal { + compatible =3D "mediatek,mt6323-thermal"; + nvmem-cells =3D <&mt6323_thermal_calibration_data>; + nvmem-cell-names =3D "calibration-data"; + + io-channels =3D <&mt6323_adc MT6323_AUXADC_CHIP_TEMP>; + io-channel-names =3D "vts"; + #thermal-sensor-cells =3D <1>; + }; + }; +}; + +/ { + thermal-zones { + pmic_vts_thermal { + polling-delay-passive =3D <1000>; + polling-delay =3D <1000>; + + thermal-sensors =3D <&mt6323_thermal 0>; + }; }; }; --=20 2.53.0 From nobody Sun Jun 14 01:35:13 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 939333E9F96; Mon, 4 May 2026 18:24:59 +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=1777919099; cv=none; b=Fs1osqDclblC2/MtfFE2GWMzHHJdeEeQJDznxS292lmdHp5IgrNKBiyyHYhMYVDgWa8XSxOBxcdAAVTELpY7gJiCFK44dbEtB9qmMkMqbmiYrbHmaR6cKsFy8s4DA1drKfDD4ap2aePW21px2fXyNUasP6465Dbtwt4DdAI4iY4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777919099; c=relaxed/simple; bh=GU4QVvFihDtlJ6mm+kq5xGELKC7sNPpkFTI44o4I8MI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tg5vgugjjMu66J4gpRY3hKGDiqUDG8HamRwC0Bg7hdDbJ9tl3RoF1RzO6Q4Cgn/rGOLrzpcYruznC+ePgtJQxBQ4mnvaOyQIT3Df/ilkgz3UUTwdc/b7Hx2Q6nBVL0kO0Oe4NVAO5FuDdPF+YHvGhKd/lFFjxvT4fOe0oS1JqTE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=X9Ag+iZ6; 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="X9Ag+iZ6" Received: by smtp.kernel.org (Postfix) with ESMTPS id 68059C2BCF7; Mon, 4 May 2026 18:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777919099; bh=GU4QVvFihDtlJ6mm+kq5xGELKC7sNPpkFTI44o4I8MI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=X9Ag+iZ6EZ0Y9BhoLfKnpEnIALv2h9odzKx1MQa6gN3R4nPeT+Mg14hbROmo6pYpX 1D/rwHCrc6C3HDrW5T2Uy3rBEJV20kI/nGEzGDOEes1136K3j2CmnIoxmb8teJYgCU g5e09B5HRQTa/k4t/rT5faGXoxmrjN68/cuzWxk0V8e0YvWVPkfjJbXP9yuRfgVu7w 2opD4o562Jl+PugOLcz1xFjac8bFQZVNiayyEPWj+1GzL4M6MGDw3BD8fOmKDFVdvm x2bAriTyQYWJvKlNmU4bSg120cwOwYHVqVkuFR/Wtg+L61wSjRgZwugJGYgZbntZ5o 82ZsExigdrvIg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B48DCD343B; Mon, 4 May 2026 18:24:59 +0000 (UTC) From: Roman Vivchar via B4 Relay Date: Mon, 04 May 2026 21:25:05 +0300 Subject: [PATCH 13/13] MAINTAINERS: add mt6323 drivers maintainer 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 Message-Id: <20260504-mt6323-v1-13-799b58b355ff@protonmail.com> References: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> In-Reply-To: <20260504-mt6323-v1-0-799b58b355ff@protonmail.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Srinivas Kandagatla , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Lee Jones Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, Ben Grisdale , Roman Vivchar X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777919095; l=1438; i=rva333@protonmail.com; s=20260325; h=from:subject:message-id; bh=IVcMJZ09jRgz+N+6u0mZ3SGFnZp8AgopNcJEHOCTJNc=; b=sGOiE3hgm56BrjQDzKGAj+m/O2IVz15/wAVId3APq3ZRUTQQDfaPwGa8RgJBYGeN7nDaBwYvr f0PDwqQvQRvBN/Or0xUv3NBMufyq8nsAz59qQxiQOJSsQ4iB3uMLrae X-Developer-Key: i=rva333@protonmail.com; a=ed25519; pk=euuVBZGtA2Cqb8Dju84qpQPhvwxyUirJlXpqEPQWKBM= X-Endpoint-Received: by B4 Relay for rva333@protonmail.com/20260325 with auth_id=695 X-Original-From: Roman Vivchar Reply-To: rva333@protonmail.com From: Roman Vivchar Add myself as MediaTek mt6323 AUXADC, EFUSE and thermal driver maintainer. Signed-off-by: Roman Vivchar Tested-by: Ben Grisdale # Amazon Echo Dot (2nd Ge= neration) --- MAINTAINERS | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index d1cc0e12fe1f..53493a24d00a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -16337,6 +16337,18 @@ S: Orphan F: Documentation/devicetree/bindings/mtd/mediatek,mtk-nfc.yaml F: drivers/mtd/nand/raw/mtk_* =20 +MEDIATEK PMIC AUXADC DRIVER +M: Roman Vivchar +S: Maintained +F: Documentation/devicetree/bindings/iio/adc/mediatek,mt6323-auxadc.yaml +F: drivers/iio/adc/mt6323-auxadc.c + +MEDIATEK PMIC EFUSE DRIVER +M: Roman Vivchar +S: Maintained +F: Documentation/devicetree/bindings/nvmem/mediatek,mt6323-efuse.yaml +F: drivers/nvmem/mt6323-efuse.c + MEDIATEK PMIC LED DRIVER M: Sen Chu M: Sean Wang @@ -16345,6 +16357,12 @@ S: Maintained F: Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml F: drivers/leds/leds-mt6323.c =20 +MEDIATEK PMIC THERMAL DRIVER +M: Roman Vivchar +S: Maintained +F: Documentation/devicetree/bindings/thermal/mediatek,mt6323-thermal.yaml +F: drivers/thermal/mediatek/pmic_thermal.c + MEDIATEK RANDOM NUMBER GENERATOR SUPPORT M: Sean Wang S: Maintained --=20 2.53.0