Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v8 0/3] Add EcoNet EN7528 (and EN751221) PCIe support.
From: Caleb James DeLisle @ 2026-05-20 18:38 UTC (permalink / raw)
  To: linux-pci
  Cc: linux-mips, naseefkm, ryder.lee, helgaas, lpieralisi, kwilczynski,
	mani, robh, krzk+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno, ansuelsmth, linux-mediatek, devicetree,
	linux-kernel, Caleb James DeLisle

Tested on SmartFiber XP8421-B (EN751221)

Changes from v7:
* mtk_pcie_retrain retrain all root ports not just first
* Include fix from Manivannan Sadhasivam, wrong usage of virt_to_phys()

Changes from v6:
* s/reset/resets/ in .yaml
* s/re-train/retrain/g
* s/Root bridge/Root port/
* If module not builtin, log at mtk_pcie_startup_port_en7528()
* Do not fail if error in mtk_pcie_retrain()
* v6: https://lore.kernel.org/linux-mips/20260513191652.3200607-1-cjd@cjdns.fr

Changes from v5:
* s/errno-base.h/errno.h/
* Breakout mtk_pcie_retrain() into a function
* Use for_each_pci_bridge() to find root bridge
* v5: https://lore.kernel.org/linux-mips/20260413140339.16238-1-cjd@cjdns.fr/

Changes from v4:
* Fixed missing Acked-by
* Rebased to commit 66672af7a095 ("Add linux-next specific files for 20260410")
* v4: https://lore.kernel.org/linux-mips/20260404182854.2183651-1-cjd@cjdns.fr/

Changes from v3:
* s/initiallized/initialized/
* Use PCIE_T_PVPERL_MS for sleep time
* Use PCI_PM_D3COLD_WAIT for startup wait time
* Clarify comment "Activate INTx interrupts"
* Add MTK_PCIE_RETRAIN quirk for devices which require link re-train
* Do not retrain *all* bridges, only root bridge
* Better comments and logging in retraining logic
* v3: https://lore.kernel.org/linux-mips/20260320094212.696671-1-cjd@cjdns.fr/

Changes from v2:
* mediatek-pcie.yaml -> s/power-domain/power-domains/ and drop example
* Patch 3 dropped as it has been applied (Thanks!)
* v2: https://lore.kernel.org/linux-mips/20260316155157.679533-1-cjd@cjdns.fr/

Changes from v1:
* mediatek-pcie.yaml slot0 needs device-type = "pci", fix dt_binding_check
Link: https://lore.kernel.org/linux-mips/177334026016.3889069.9474337544951486443.robh@kernel.org
* v1: https://lore.kernel.org/linux-mips/20260312165332.569772-1-cjd@cjdns.fr/

This was split from a larger PCIe patchset which crossed multiple
subsystems. I'm not labeling this a v3 because it's a new patchset, but
I'm keeping the historical record anyway.

Changes from econet-pcie v2:
* mediatek-pcie.yaml add missing constraints to PCI node properties
* econet-pcie v2: https://lore.kernel.org/linux-mips/20260309131818.74467-1-cjd@cjdns.fr

Changes from econet-pcie v1:
* pcie-mediatek.c Exclude pcie_retrain_link() when building as a module
* econet-pcie v1: https://lore.kernel.org/linux-mips/20260303190948.694783-1-cjd@cjdns.fr/


Caleb James DeLisle (2):
  dt-bindings: PCI: mediatek: Add support for EcoNet EN7528
  PCI: mediatek: Add support for EcoNet EN7528 SoC

Manivannan Sadhasivam (1):
  PCI: mediatek: Use actual physical address instead of virt_to_phys()

 .../bindings/pci/mediatek-pcie.yaml           |  26 +++
 drivers/pci/controller/Kconfig                |   2 +-
 drivers/pci/controller/pcie-mediatek.c        | 168 +++++++++++++++++-
 3 files changed, 192 insertions(+), 4 deletions(-)


base-commit: 687da68900cd1a46549f7d9430c7d40346cb86a0
-- 
2.39.5



^ permalink raw reply

* Re: (subset) [PATCH v4 1/6] mfd: dt-bindings: mt6397: Add regulator supplies
From: Lee Jones @ 2026-05-20 16:19 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Chen-Yu Tsai
  Cc: linux-arm-kernel, linux-mediatek, devicetree, Krzysztof Kozlowski
In-Reply-To: <20260514091520.2718987-2-wenst@chromium.org>

On Thu, 14 May 2026 17:15:14 +0800, Chen-Yu Tsai wrote:
> On the MT6397 family each buck regulator has a separate supply. LDOs are
> split into various groups with independent supplies. There is also a
> supply for the regulator control logic.
> 
> Add descriptions for all of the supplies for the MT6359.
> 
> 
> [...]

Applied, thanks!

[1/6] mfd: dt-bindings: mt6397: Add regulator supplies
      commit: 4e01a05330d4366924e622467a6654d69a6555ec

--
Lee Jones [李琼斯]



^ permalink raw reply

* Re: [PATCH RFC 00/12] arm64: mediatek: Add M.2 E-key slot on Chromebooks
From: Bartosz Golaszewski @ 2026-05-20 16:01 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	linux-pm, linux-usb, devicetree, linux-mediatek, linux-arm-kernel,
	linux-kernel, Manivannan Sadhasivam
In-Reply-To: <20260515090149.3169406-1-wenst@chromium.org>

On Fri, May 15, 2026 at 11:02 AM Chen-Yu Tsai <wenst@chromium.org> wrote:
>
> Hi everyone,
>
> This series is my attempt at enabling power sequencing for USB to support
> the USB connection on M.2 E-key slots. M.2 E-key was enabled in v7.1-rc1
> with just PCIe and UART supported [1].
>
> Most of the series is based on next-20260508, while the DT changes also
> depend on some other DT cleanup patches I sent [2][3].
>
>
> Patch 1 reworks the power sequencing framework to allow matching against
> different USB ports. The consumer API gains an "index" parameter (which
> is the USB port number on the hub), while the provider API is reworked
> to pass the index to the matching function of the providing driver.
>

Sigh... I would really prefer to avoid going in this direction. IMO
it's not very clear what this index actually refers to in generic
terms, given that pwrseq is flexible on purpose and there's no
specific, well-defined DT property which could have an "index".

> Patch 2 implements the index matching in the pcie-m2 driver. Matching
> only happens when a valid (>= 0) index is given.
>
> Patch 3 reworks the power sequencing targets for the E-key connector in
> the pcie-m2 driver to add targets for USB and SDIO. The former is used
> later on in this series.
>
> Patch 4 reworks the USB hub driver to return the actual error code from
> hub_configure() in hub_probe(). This is needed in the next patch to
> correctly return -EPROBE_DEFER.
>
> Patch 5 lets the USB hub driver look for power sequencers for each port.
> Currently this only works for M.2 E-key connections, but it could be
> extended to cover other cases. It should also make port reset via turning
> off the port VBUS work, even when VBUS is not directly controlled by the
> hub.
>
> I expect some discussion on this patch, because a) it adds some
> OF-specific code into an otherwise generic (core) driver, and
> b) it doesn't yet handle USB 2.0 / 3.x shared ports; it ends up powering
> on the port twice, which negates the port reset part.
>

I understand that you do this because the port device has no OF node
assigned. If we wanted to call pwrseq_get() for the port device, is
there really no other way to associate it with the correct pwrseq
provider?

Does the child index in hub_configure() relate to the port index as
defined by the unit address of the port DT node? I'm talking about the
X in port@X?

> Patch 6 reverts an incorrectly modeled OF graph connection for the
> MediaTek XHCI controller.
>
> Patch 7 then adds a proper representation.
>
> Patches 8 through 12 enable the M.2 E-key slots (used for WiFi/BT) and
> USB type-A connectors found on MediaTek-based Chromebooks. These are
> provided in this series for reference. The USB type-A connector changes,
> while not directly related, have overlapping context, and was easier to
> include. They were also used to test some extra local changes I tried
> to convert the USB A connector from an onboard USB device to a power
> sequencing provider.
>
>
> As this series changes existing power sequencing API, and also uses the
> changed API in subsequent patches, I think the best way to merge this
> is for Bartosz to take the power sequencing patches and provide an
> immutable tag for Greg to merge and then merge the USB patches.
>
> The DT patches can go through the soc tree once all the driver and DT
> binding changes are merged.
>
>
> Thanks
> ChenYu
>
> P.S. I'll be at Embedded Recipes if anyone wants to discuss details.
>

I'll be there too! Or should i say "here"? I live here after all. :) Let's talk!

Bart


^ permalink raw reply

* [PATCH v2 2/2] ASoC: codecs: max98090: use component set_jack callback
From: Srinivas Kandagatla @ 2026-05-20 15:50 UTC (permalink / raw)
  To: broonie
  Cc: lgirdwood, perex, tiwai, matthias.bgg, angelogioacchino.delregno,
	sharq0406, kuninori.morimoto.gx, ckeepax, srinivas.kandagatla,
	linux-sound, linux-kernel, linux-arm-kernel, linux-mediatek
In-Reply-To: <20260520155002.145306-1-srinivas.kandagatla@oss.qualcomm.com>

The MAX98090 driver provides a custom max98090_mic_detect() helper for
machine drivers to register a jack.

This can be implemented using the standard component set_jack callback
instead. Doing so allows machine drivers to use
snd_soc_component_set_jack(), which is also the interface used by
machine drivers including Qualcomm ones.

Convert max98090_mic_detect() to a component set_jack callback and remove
the exported helper.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
---
 sound/soc/codecs/max98090.c | 10 +++++-----
 sound/soc/codecs/max98090.h |  3 ---
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 13a15459040f..bd3bfa1d3402 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2337,7 +2337,7 @@ static irqreturn_t max98090_interrupt(int irq, void *data)
 }
 
 /**
- * max98090_mic_detect - Enable microphone detection via the MAX98090 IRQ
+ * max98090_set_jack - Enable microphone detection via the MAX98090 IRQ
  *
  * @component:  MAX98090 component
  * @jack:   jack to report detection events on
@@ -2349,12 +2349,12 @@ static irqreturn_t max98090_interrupt(int irq, void *data)
  *
  * If no jack is supplied detection will be disabled.
  */
-int max98090_mic_detect(struct snd_soc_component *component,
-	struct snd_soc_jack *jack)
+static int max98090_set_jack(struct snd_soc_component *component,
+			     struct snd_soc_jack *jack, void *data)
 {
 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
 
-	dev_dbg(component->dev, "max98090_mic_detect\n");
+	dev_dbg(component->dev, "%s\n", __func__);
 
 	max98090->jack = jack;
 	if (jack) {
@@ -2377,7 +2377,6 @@ int max98090_mic_detect(struct snd_soc_component *component,
 
 	return 0;
 }
-EXPORT_SYMBOL_GPL(max98090_mic_detect);
 
 #define MAX98090_RATES SNDRV_PCM_RATE_8000_96000
 #define MAX98090_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE)
@@ -2554,6 +2553,7 @@ static const struct snd_soc_component_driver soc_component_dev_max98090 = {
 	.remove			= max98090_remove,
 	.seq_notifier		= max98090_seq_notifier,
 	.set_bias_level		= max98090_set_bias_level,
+	.set_jack		= max98090_set_jack,
 	.idle_bias_on		= 1,
 	.use_pmdown_time	= 1,
 	.endianness		= 1,
diff --git a/sound/soc/codecs/max98090.h b/sound/soc/codecs/max98090.h
index 6ce8dd176e48..048af4a1376f 100644
--- a/sound/soc/codecs/max98090.h
+++ b/sound/soc/codecs/max98090.h
@@ -1543,7 +1543,4 @@ struct max98090_priv {
 	bool shdn_pending;
 };
 
-int max98090_mic_detect(struct snd_soc_component *component,
-	struct snd_soc_jack *jack);
-
 #endif
-- 
2.47.3



^ permalink raw reply related

* [PATCH v2 1/2] ASoC: mt8173-max98090: use standard callback to set jack
From: Srinivas Kandagatla @ 2026-05-20 15:50 UTC (permalink / raw)
  To: broonie
  Cc: lgirdwood, perex, tiwai, matthias.bgg, angelogioacchino.delregno,
	sharq0406, kuninori.morimoto.gx, ckeepax, srinivas.kandagatla,
	linux-sound, linux-kernel, linux-arm-kernel, linux-mediatek
In-Reply-To: <20260520155002.145306-1-srinivas.kandagatla@oss.qualcomm.com>

use snd_soc_component_set_jack() instead of custom callback to
max98090 codec.

This will help other drivers using the standard callback to exercise
the standard path instead of custom callback.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
---
 sound/soc/mediatek/mt8173/mt8173-max98090.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/mediatek/mt8173/mt8173-max98090.c b/sound/soc/mediatek/mt8173/mt8173-max98090.c
index 49ebb67c818a..7533c6e4955b 100644
--- a/sound/soc/mediatek/mt8173/mt8173-max98090.c
+++ b/sound/soc/mediatek/mt8173/mt8173-max98090.c
@@ -1,3 +1,4 @@
+
 // SPDX-License-Identifier: GPL-2.0
 /*
  * mt8173-max98090.c  --  MT8173 MAX98090 ALSA SoC machine driver
@@ -9,7 +10,6 @@
 #include <linux/module.h>
 #include <sound/soc.h>
 #include <sound/jack.h>
-#include "../../codecs/max98090.h"
 
 static struct snd_soc_jack mt8173_max98090_jack;
 
@@ -78,7 +78,7 @@ static int mt8173_max98090_init(struct snd_soc_pcm_runtime *runtime)
 		return ret;
 	}
 
-	return max98090_mic_detect(component, &mt8173_max98090_jack);
+	return snd_soc_component_set_jack(component, &mt8173_max98090_jack, NULL);
 }
 
 SND_SOC_DAILINK_DEFS(playback,
-- 
2.47.3



^ permalink raw reply related

* [PATCH v2 0/2] ASoC: codecs: max98090: switch to standard set_jack callback
From: Srinivas Kandagatla @ 2026-05-20 15:50 UTC (permalink / raw)
  To: broonie
  Cc: lgirdwood, perex, tiwai, matthias.bgg, angelogioacchino.delregno,
	sharq0406, kuninori.morimoto.gx, ckeepax, srinivas.kandagatla,
	linux-sound, linux-kernel, linux-arm-kernel, linux-mediatek

The MAX98090 codec driver currently exposes a custom
max98090_mic_detect() helper for machine drivers to register a headset
jack.

This series converts the driver to use the standard component
.set_jack callback and updates the mt8173-max98090 machine driver to use
snd_soc_component_set_jack() instead of the codec-specific helper.

Using the standard callback removes the need for a custom exported
symbol and allows machine drivers to use the common ASoC jack
registration interface. This also improves compatibility with machine
drivers, such as Qualcomm platforms, that already rely on
snd_soc_component_set_jack().


Changes since v1:
	- reordered patches for build failure fixes.
	- fixed typo on mt8173 patch.

Srinivas Kandagatla (2):
  ASoC: mt8173-max98090: use standard callback to set jack
  ASoC: codecs: max98090: use component set_jack callback

 sound/soc/codecs/max98090.c                 | 10 +++++-----
 sound/soc/codecs/max98090.h                 |  3 ---
 sound/soc/mediatek/mt8173/mt8173-max98090.c |  4 ++--
 3 files changed, 7 insertions(+), 10 deletions(-)

-- 
2.47.3



^ permalink raw reply

* Re: [PATCH v3 3/5] dt-bindings: i2c: mt7621: Document an7581 compatible
From: Conor Dooley @ 2026-05-20 15:49 UTC (permalink / raw)
  To: Christian Marangi
  Cc: Stefan Roese, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	linux-i2c, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek
In-Reply-To: <20260519223253.1093-4-ansuelsmth@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1463 bytes --]

On Wed, May 20, 2026 at 12:32:45AM +0200, Christian Marangi wrote:
> Airoha SoC implement the same Mediatek logic for I2C bus with the only
> difference of not having a dedicated reset line to reset it.
> 
> Add a dedicated compatible for the Airoha AN7581 SoC and reject the
> unsupported property.
> 
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
>  .../bindings/i2c/mediatek,mt7621-i2c.yaml          | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/i2c/mediatek,mt7621-i2c.yaml b/Documentation/devicetree/bindings/i2c/mediatek,mt7621-i2c.yaml
> index 118ec00fc190..8223fbc74f14 100644
> --- a/Documentation/devicetree/bindings/i2c/mediatek,mt7621-i2c.yaml
> +++ b/Documentation/devicetree/bindings/i2c/mediatek,mt7621-i2c.yaml
> @@ -14,7 +14,9 @@ allOf:
>  
>  properties:
>    compatible:
> -    const: mediatek,mt7621-i2c
> +    enum:
> +      - airoha,an7581-i2c
> +      - mediatek,mt7621-i2c
>  
>    reg:
>      maxItems: 1
> @@ -38,6 +40,16 @@ required:
>    - "#address-cells"
>    - "#size-cells"
>  
> +if:
> +  properties:
> +    compatible:
> +      contains:
> +        const: airoha,an7581-i2c
> +then:
> +  properties:
> +    resets: false
> +    reset-names: false

The sashiko report looks valid here.
pw-bot: changes-requested

> +
>  unevaluatedProperties: false
>  
>  examples:
> -- 
> 2.53.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply

* Re: [PATCH 2/2] ASoC: mt8173-max98090: use standard callback to set jack
From: Mark Brown @ 2026-05-20 15:41 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: lgirdwood, perex, tiwai, matthias.bgg, angelogioacchino.delregno,
	sharq0406, kuninori.morimoto.gx, ckeepax, linux-sound,
	linux-kernel, linux-arm-kernel, linux-mediatek
In-Reply-To: <81b15533-3258-48a8-8d5a-0dcec7027254@oss.qualcomm.com>

[-- Attachment #1: Type: text/plain, Size: 749 bytes --]

On Wed, May 20, 2026 at 03:34:59PM +0000, Srinivas Kandagatla wrote:
> On 5/20/26 1:42 PM, Mark Brown wrote:
> > On Wed, May 20, 2026 at 01:29:30PM +0000, Srinivas Kandagatla wrote:
> >> use snd_soc_component_set_jack() instead of custom callback to
> >> max98090 codec.

> > This needs to be squashed into the first commit, otherwise the first
> > commit will cause a build break.

> I had them in opposite order in my local setup, which is why it did not
> break the build for me, I can send out a squashed version.

Putting this first would also be fine from a build point of view so is
probably also OK, though there would be runtime breakage (which I
imagine is why you reordered).  I'm not sure anyone will notice the
runtime bisection issue.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply

* Re: [PATCH nf-next v2 0/6] Add IPv4 over IPv6 and SIT flowtable SW acceleration
From: Lorenzo Bianconi @ 2026-05-20 15:36 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Felix Fietkau, Matthias Brugger,
	AngeloGioacchino Del Regno, Simon Horman, David Ahern,
	Ido Schimmel, Pablo Neira Ayuso, Florian Westphal, Phil Sutter,
	Shuah Khan
  Cc: linux-arm-kernel, linux-mediatek, netdev, netfilter-devel,
	coreteam, linux-kselftest
In-Reply-To: <20260506-b4-flowtable-sw-accel-ip6ip-v2-0-439fd427726e@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 2088 bytes --]

> Similar to IPIP and IP6I6 tunnels, introduce sw acceleration for IPv4 over
> IPv6 and SIT tunnels in the netfilter flowtable infrastructure.
> 
> ---
> Changes in v2:
> - Fix MTU check in nf_flow_offload_forward() and in
>   nf_flow_offload_ipv6_forward()
> - Add SIT sw acceleration support
> - Link to v1: https://lore.kernel.org/r/20260505-b4-flowtable-sw-accel-ip6ip-v1-0-9ac39ccc9ea9@kernel.org

Hi Pablo and Florian,

Any update about this series? Thanks in advance.

Regards,
Lorenzo

> 
> ---
> Lorenzo Bianconi (6):
>       net: netfilter: Add ether_type to net_device_path_ctx
>       net: netfilter: Add encap_proto to flow_offload_tunnel
>       net: netfilter: Add IPv4 over IPv6 tunnel flowtable acceleration
>       selftests: netfilter: nft_flowtable.sh: Add IPv4 over IPv6 flowtable selftest
>       net: netfilter: Add SIT tunnel flowtable acceleration
>       selftests: netfilter: nft_flowtable.sh: Add SIT flowtable selftest
> 
>  drivers/net/ethernet/airoha/airoha_ppe.c           |  14 +-
>  drivers/net/ethernet/mediatek/mtk_ppe_offload.c    |  13 +-
>  include/linux/netdevice.h                          |   5 +-
>  include/net/netfilter/nf_flow_table.h              |   1 +
>  net/core/dev.c                                     |   6 +-
>  net/ipv4/ipip.c                                    |   1 +
>  net/ipv6/ip6_tunnel.c                              |   6 +-
>  net/ipv6/sit.c                                     |  26 ++
>  net/netfilter/nf_flow_table_core.c                 |  14 +-
>  net/netfilter/nf_flow_table_ip.c                   | 386 +++++++++++++--------
>  net/netfilter/nf_flow_table_path.c                 |  16 +-
>  tools/testing/selftests/net/netfilter/config       |   1 +
>  .../selftests/net/netfilter/nft_flowtable.sh       |  78 ++++-
>  13 files changed, 402 insertions(+), 165 deletions(-)
> ---
> base-commit: c1e5127b577c6b88fa48e532616932ae978528d5
> change-id: 20260505-b4-flowtable-sw-accel-ip6ip-7101034cd147
> 
> Best regards,
> -- 
> Lorenzo Bianconi <lorenzo@kernel.org>
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply

* Re: [PATCH 2/2] ASoC: mt8173-max98090: use standard callback to set jack
From: Srinivas Kandagatla @ 2026-05-20 15:34 UTC (permalink / raw)
  To: Mark Brown
  Cc: lgirdwood, perex, tiwai, matthias.bgg, angelogioacchino.delregno,
	sharq0406, kuninori.morimoto.gx, ckeepax, linux-sound,
	linux-kernel, linux-arm-kernel, linux-mediatek
In-Reply-To: <5990fbb1-286f-482d-b02a-d0637494f435@sirena.org.uk>

On 5/20/26 1:42 PM, Mark Brown wrote:
> On Wed, May 20, 2026 at 01:29:30PM +0000, Srinivas Kandagatla wrote:
>> use snd_soc_component_set_jack() instead of custom callback to
>> max98090 codec.
> 
> This needs to be squashed into the first commit, otherwise the first
> commit will cause a build break.
I had them in opposite order in my local setup, which is why it did not
break the build for me, I can send out a squashed version.

--Srini



^ permalink raw reply

* Re: [PATCH v5 5/9] mfd: mt6397: Add support for MT6392 PMIC
From: Lee Jones @ 2026-05-20 15:00 UTC (permalink / raw)
  To: Luca Leonardo Scorcia
  Cc: linux-mediatek, Fabien Parent, Val Packett,
	AngeloGioacchino Del Regno, Dmitry Torokhov, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sen Chu, Sean Wang,
	Macpaul Lin, Matthias Brugger, Linus Walleij, Liam Girdwood,
	Mark Brown, Gary Bisson, Louis-Alexis Eyraud, Julien Massot,
	Akari Tsuyukusa, Chen Zhong, linux-input, devicetree,
	linux-kernel, linux-pm, linux-arm-kernel, linux-gpio
In-Reply-To: <20260420213529.1645560-6-l.scorcia@gmail.com>

On Mon, 20 Apr 2026, Luca Leonardo Scorcia wrote:

> From: Fabien Parent <parent.f@gmail.com>
> 
> Align the MT6397 PMIC driver to other MFD drivers by passing only an
> identifier through mt6397_of_match[*].data and add support for the MT6392
> PMIC.
> 
> Signed-off-by: Fabien Parent <parent.f@gmail.com>
> Signed-off-by: Val Packett <val@packett.cool>
> Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail.com>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  drivers/mfd/mt6397-core.c            | 118 +++++--
>  drivers/mfd/mt6397-irq.c             |   8 +
>  include/linux/mfd/mt6392/core.h      |  42 +++
>  include/linux/mfd/mt6392/registers.h | 487 +++++++++++++++++++++++++++
>  include/linux/mfd/mt6397/core.h      |   1 +
>  5 files changed, 630 insertions(+), 26 deletions(-)
>  create mode 100644 include/linux/mfd/mt6392/core.h
>  create mode 100644 include/linux/mfd/mt6392/registers.h
> 
> diff --git "a/drivers/mfd/mt6397-core.c" "b/drivers/mfd/mt6397-core.c"
> index 1bdacda9a933..5c5c24517c00 100644
> --- "a/drivers/mfd/mt6397-core.c"
> +++ "b/drivers/mfd/mt6397-core.c"
> @@ -18,6 +18,7 @@
>  #include <linux/mfd/mt6357/core.h>
>  #include <linux/mfd/mt6358/core.h>
>  #include <linux/mfd/mt6359/core.h>
> +#include <linux/mfd/mt6392/core.h>
>  #include <linux/mfd/mt6397/core.h>
>  #include <linux/mfd/mt6323/registers.h>
>  #include <linux/mfd/mt6328/registers.h>
> @@ -25,8 +26,20 @@
>  #include <linux/mfd/mt6357/registers.h>
>  #include <linux/mfd/mt6358/registers.h>
>  #include <linux/mfd/mt6359/registers.h>
> +#include <linux/mfd/mt6392/registers.h>
>  #include <linux/mfd/mt6397/registers.h>
>  
> +enum mfd_match_data {
> +	MATCH_DATA_MT6323 = 23,
> +	MATCH_DATA_MT6328 = 28,
> +	MATCH_DATA_MT6331 = 31,
> +	MATCH_DATA_MT6357 = 57,
> +	MATCH_DATA_MT6358 = 58,
> +	MATCH_DATA_MT6359 = 59,
> +	MATCH_DATA_MT6392 = 92,
> +	MATCH_DATA_MT6397 = 97,
> +};
> +
>  #define MT6323_RTC_BASE		0x8000
>  #define MT6323_RTC_SIZE		0x40
>  
> @@ -39,6 +52,9 @@
>  #define MT6358_RTC_BASE		0x0588
>  #define MT6358_RTC_SIZE		0x3c
>  
> +#define MT6392_RTC_BASE		0x8000
> +#define MT6392_RTC_SIZE		0x3e
> +
>  #define MT6397_RTC_BASE		0xe000
>  #define MT6397_RTC_SIZE		0x3e
>  
> @@ -65,6 +81,11 @@ static const struct resource mt6358_rtc_resources[] = {
>  	DEFINE_RES_IRQ(MT6358_IRQ_RTC),
>  };
>  
> +static const struct resource mt6392_rtc_resources[] = {
> +	DEFINE_RES_MEM(MT6392_RTC_BASE, MT6392_RTC_SIZE),
> +	DEFINE_RES_IRQ(MT6392_IRQ_RTC),
> +};
> +
>  static const struct resource mt6397_rtc_resources[] = {
>  	DEFINE_RES_MEM(MT6397_RTC_BASE, MT6397_RTC_SIZE),
>  	DEFINE_RES_IRQ(MT6397_IRQ_RTC),
> @@ -114,6 +135,11 @@ static const struct resource mt6331_keys_resources[] = {
>  	DEFINE_RES_IRQ_NAMED(MT6331_IRQ_STATUS_HOMEKEY, "homekey"),
>  };
>  
> +static const struct resource mt6392_keys_resources[] = {
> +	DEFINE_RES_IRQ_NAMED(MT6392_IRQ_PWRKEY, "powerkey"),
> +	DEFINE_RES_IRQ_NAMED(MT6392_IRQ_FCHRKEY, "homekey"),

What does FCHRKEY mean?  Is that a datasheet name?

> +};
> +
>  static const struct resource mt6397_keys_resources[] = {
>  	DEFINE_RES_IRQ_NAMED(MT6397_IRQ_PWRKEY, "powerkey"),
>  	DEFINE_RES_IRQ_NAMED(MT6397_IRQ_HOMEKEY, "homekey"),
> @@ -253,6 +279,25 @@ static const struct mfd_cell mt6359_devs[] = {
>  	},
>  };
>  
> +static const struct mfd_cell mt6392_devs[] = {
> +	{
> +		.name = "mt6392-rtc",
> +		.num_resources = ARRAY_SIZE(mt6392_rtc_resources),
> +		.resources = mt6392_rtc_resources,
> +		.of_compatible = "mediatek,mt6392-rtc",
> +	}, {
> +		.name = "mt6392-regulator",
> +	}, {
> +		.name = "mt6392-pinctrl",
> +		.of_compatible = "mediatek,mt6392-pinctrl",
> +	}, {
> +		.name = "mt6392-keys",
> +		.num_resources = ARRAY_SIZE(mt6392_keys_resources),
> +		.resources = mt6392_keys_resources,
> +		.of_compatible = "mediatek,mt6392-keys"
> +	},

MFD_CELL_*() for each.

> +};
> +
>  static const struct mfd_cell mt6397_devs[] = {
>  	{
>  		.name = "mt6397-rtc",
> @@ -335,6 +380,14 @@ static const struct chip_data mt6359_core = {
>  	.irq_init = mt6358_irq_init,
>  };
>  
> +static const struct chip_data mt6392_core = {
> +	.cid_addr = MT6392_CID,
> +	.cid_shift = 0,
> +	.cells = mt6392_devs,
> +	.cell_size = ARRAY_SIZE(mt6392_devs),
> +	.irq_init = mt6397_irq_init,
> +};
> +
>  static const struct chip_data mt6397_core = {
>  	.cid_addr = MT6397_CID,
>  	.cid_shift = 0,
> @@ -349,6 +402,7 @@ static int mt6397_probe(struct platform_device *pdev)
>  	unsigned int id = 0;
>  	struct mt6397_chip *pmic;
>  	const struct chip_data *pmic_core;
> +	enum mfd_match_data device_data;
>  
>  	pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL);
>  	if (!pmic)
> @@ -364,9 +418,36 @@ static int mt6397_probe(struct platform_device *pdev)
>  	if (!pmic->regmap)
>  		return -ENODEV;
>  
> -	pmic_core = of_device_get_match_data(&pdev->dev);
> -	if (!pmic_core)
> +	device_data = (unsigned int)(uintptr_t)of_device_get_match_data(&pdev->dev);

We should be using generic match data variants now like device_get_match_data().

device_data should be chip_id or something.

> +	switch (device_data) {
> +	case MATCH_DATA_MT6323:

Pick some better nomenclature.

Ignore the fact that we're using these values in match data.

Do they have real differences, ideally ones which can be read from h/w?

> +		pmic_core = &mt6323_core;
> +		break;
> +	case MATCH_DATA_MT6328:
> +		pmic_core = &mt6328_core;
> +		break;
> +	case MATCH_DATA_MT6331:
> +		pmic_core = &mt6331_mt6332_core;
> +		break;
> +	case MATCH_DATA_MT6357:
> +		pmic_core = &mt6357_core;
> +		break;
> +	case MATCH_DATA_MT6358:
> +		pmic_core = &mt6358_core;
> +		break;
> +	case MATCH_DATA_MT6359:
> +		pmic_core = &mt6359_core;
> +		break;
> +	case MATCH_DATA_MT6392:
> +		pmic_core = &mt6392_core;
> +		break;
> +	case MATCH_DATA_MT6397:
> +		pmic_core = &mt6397_core;
> +		break;
> +	default:
> +		dev_err(&pdev->dev, "Unknown device match data %u\n", device_data);

The user doesn't care about your match data.

"Device not supported"

>  		return -ENODEV;
> +	}
>  
>  	ret = regmap_read(pmic->regmap, pmic_core->cid_addr, &id);
>  	if (ret) {
> @@ -398,30 +479,15 @@ static int mt6397_probe(struct platform_device *pdev)
>  }
>  
>  static const struct of_device_id mt6397_of_match[] = {
> -	{
> -		.compatible = "mediatek,mt6323",
> -		.data = &mt6323_core,
> -	}, {
> -		.compatible = "mediatek,mt6328",
> -		.data = &mt6328_core,
> -	}, {
> -		.compatible = "mediatek,mt6331",
> -		.data = &mt6331_mt6332_core,
> -	}, {
> -		.compatible = "mediatek,mt6357",
> -		.data = &mt6357_core,
> -	}, {
> -		.compatible = "mediatek,mt6358",
> -		.data = &mt6358_core,
> -	}, {
> -		.compatible = "mediatek,mt6359",
> -		.data = &mt6359_core,
> -	}, {
> -		.compatible = "mediatek,mt6397",
> -		.data = &mt6397_core,
> -	}, {
> -		/* sentinel */
> -	}
> +	{ .compatible = "mediatek,mt6323", .data = (void *)MATCH_DATA_MT6323, },
> +	{ .compatible = "mediatek,mt6328", .data = (void *)MATCH_DATA_MT6328, },
> +	{ .compatible = "mediatek,mt6331", .data = (void *)MATCH_DATA_MT6331, },
> +	{ .compatible = "mediatek,mt6357", .data = (void *)MATCH_DATA_MT6357, },
> +	{ .compatible = "mediatek,mt6358", .data = (void *)MATCH_DATA_MT6358, },
> +	{ .compatible = "mediatek,mt6359", .data = (void *)MATCH_DATA_MT6359, },
> +	{ .compatible = "mediatek,mt6392", .data = (void *)MATCH_DATA_MT6392, },
> +	{ .compatible = "mediatek,mt6397", .data = (void *)MATCH_DATA_MT6397, },

This is much better.

Maybe we can get rid of the bespoke 'struct chip_data' now?

> +	{ /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, mt6397_of_match);
>  
> diff --git "a/drivers/mfd/mt6397-irq.c" "b/drivers/mfd/mt6397-irq.c"
> index 5d2e5459f744..80ea5b92d232 100644
> --- "a/drivers/mfd/mt6397-irq.c"
> +++ "b/drivers/mfd/mt6397-irq.c"
> @@ -15,6 +15,8 @@
>  #include <linux/mfd/mt6328/registers.h>
>  #include <linux/mfd/mt6331/core.h>
>  #include <linux/mfd/mt6331/registers.h>
> +#include <linux/mfd/mt6392/core.h>
> +#include <linux/mfd/mt6392/registers.h>
>  #include <linux/mfd/mt6397/core.h>
>  #include <linux/mfd/mt6397/registers.h>
>  
> @@ -203,6 +205,12 @@ int mt6397_irq_init(struct mt6397_chip *chip)
>  		chip->int_status[0] = MT6397_INT_STATUS0;
>  		chip->int_status[1] = MT6397_INT_STATUS1;
>  		break;
> +	case MT6392_CHIP_ID:
> +		chip->int_con[0] = MT6392_INT_CON0;
> +		chip->int_con[1] = MT6392_INT_CON1;
> +		chip->int_status[0] = MT6392_INT_STATUS0;
> +		chip->int_status[1] = MT6392_INT_STATUS1;
> +		break;
>  
>  	default:
>  		dev_err(chip->dev, "unsupported chip: 0x%x\n", chip->chip_id);
> diff --git "a/include/linux/mfd/mt6392/core.h" "b/include/linux/mfd/mt6392/core.h"
> new file mode 100644
> index 000000000000..4780dab4da92
> --- /dev/null
> +++ "b/include/linux/mfd/mt6392/core.h"
> @@ -0,0 +1,42 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * Copyright (c) 2020 MediaTek Inc.

This needs an update.

> + * Author: Chen Zhong <chen.zhong@mediatek.com>
> + */
> +
> +#ifndef __MFD_MT6392_CORE_H__
> +#define __MFD_MT6392_CORE_H__
> +
> +enum mt6392_irq_numbers {
> +	MT6392_IRQ_SPKL_AB = 0,
> +	MT6392_IRQ_SPKL,
> +	MT6392_IRQ_BAT_L,
> +	MT6392_IRQ_BAT_H,
> +	MT6392_IRQ_WATCHDOG,
> +	MT6392_IRQ_PWRKEY,
> +	MT6392_IRQ_THR_L,
> +	MT6392_IRQ_THR_H,
> +	MT6392_IRQ_VBATON_UNDET,
> +	MT6392_IRQ_BVALID_DET,
> +	MT6392_IRQ_CHRDET,
> +	MT6392_IRQ_OV,
> +	MT6392_IRQ_LDO = 16,
> +	MT6392_IRQ_FCHRKEY,
> +	MT6392_IRQ_RELEASE_PWRKEY,
> +	MT6392_IRQ_RELEASE_FCHRKEY,
> +	MT6392_IRQ_RTC,
> +	MT6392_IRQ_VPROC,
> +	MT6392_IRQ_VSYS,
> +	MT6392_IRQ_VCORE,
> +	MT6392_IRQ_TYPE_C_CC,
> +	MT6392_IRQ_TYPEC_H_MAX,
> +	MT6392_IRQ_TYPEC_H_MIN,
> +	MT6392_IRQ_TYPEC_L_MAX,
> +	MT6392_IRQ_TYPEC_L_MIN,
> +	MT6392_IRQ_THR_MAX,
> +	MT6392_IRQ_THR_MIN,
> +	MT6392_IRQ_NAG_C_DLTV,
> +	MT6392_IRQ_NR,
> +};
> +
> +#endif /* __MFD_MT6392_CORE_H__ */
> diff --git "a/include/linux/mfd/mt6392/registers.h" "b/include/linux/mfd/mt6392/registers.h"
> new file mode 100644
> index 000000000000..4f3a6db830d1
> --- /dev/null
> +++ "b/include/linux/mfd/mt6392/registers.h"
> @@ -0,0 +1,487 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * Copyright (c) 2020 MediaTek Inc.

Same and throughout.

> + * Author: Chen Zhong <chen.zhong@mediatek.com>
> + */
> +
> +#ifndef __MFD_MT6392_REGISTERS_H__
> +#define __MFD_MT6392_REGISTERS_H__
> +
> +/* PMIC Registers */
> +#define MT6392_CHR_CON0                         0x0000
> +#define MT6392_CHR_CON1                         0x0002
> +#define MT6392_CHR_CON2                         0x0004
> +#define MT6392_CHR_CON3                         0x0006
> +#define MT6392_CHR_CON4                         0x0008
> +#define MT6392_CHR_CON5                         0x000A
> +#define MT6392_CHR_CON6                         0x000C
> +#define MT6392_CHR_CON7                         0x000E
> +#define MT6392_CHR_CON8                         0x0010
> +#define MT6392_CHR_CON9                         0x0012
> +#define MT6392_CHR_CON10                        0x0014
> +#define MT6392_CHR_CON11                        0x0016
> +#define MT6392_CHR_CON12                        0x0018
> +#define MT6392_CHR_CON13                        0x001A
> +#define MT6392_CHR_CON14                        0x001C
> +#define MT6392_CHR_CON15                        0x001E
> +#define MT6392_CHR_CON16                        0x0020
> +#define MT6392_CHR_CON17                        0x0022
> +#define MT6392_CHR_CON18                        0x0024
> +#define MT6392_CHR_CON19                        0x0026
> +#define MT6392_CHR_CON20                        0x0028
> +#define MT6392_CHR_CON21                        0x002A
> +#define MT6392_CHR_CON22                        0x002C
> +#define MT6392_CHR_CON23                        0x002E
> +#define MT6392_CHR_CON24                        0x0030
> +#define MT6392_CHR_CON25                        0x0032
> +#define MT6392_CHR_CON26                        0x0034
> +#define MT6392_CHR_CON27                        0x0036
> +#define MT6392_CHR_CON28                        0x0038
> +#define MT6392_CHR_CON29                        0x003A
> +#define MT6392_STRUP_CON0                       0x003C
> +#define MT6392_STRUP_CON2                       0x003E
> +#define MT6392_STRUP_CON3                       0x0040
> +#define MT6392_STRUP_CON4                       0x0042
> +#define MT6392_STRUP_CON5                       0x0044
> +#define MT6392_STRUP_CON6                       0x0046
> +#define MT6392_STRUP_CON7                       0x0048
> +#define MT6392_STRUP_CON8                       0x004A
> +#define MT6392_STRUP_CON9                       0x004C
> +#define MT6392_STRUP_CON10                      0x004E
> +#define MT6392_STRUP_CON11                      0x0050
> +#define MT6392_SPK_CON0                         0x0052
> +#define MT6392_SPK_CON1                         0x0054
> +#define MT6392_SPK_CON2                         0x0056
> +#define MT6392_SPK_CON6                         0x005E
> +#define MT6392_SPK_CON7                         0x0060
> +#define MT6392_SPK_CON8                         0x0062
> +#define MT6392_SPK_CON9                         0x0064
> +#define MT6392_SPK_CON10                        0x0066
> +#define MT6392_SPK_CON11                        0x0068
> +#define MT6392_SPK_CON12                        0x006A
> +#define MT6392_STRUP_CON12                      0x006E
> +#define MT6392_STRUP_CON13                      0x0070
> +#define MT6392_STRUP_CON14                      0x0072
> +#define MT6392_STRUP_CON15                      0x0074
> +#define MT6392_STRUP_CON16                      0x0076
> +#define MT6392_STRUP_CON17                      0x0078
> +#define MT6392_STRUP_CON18                      0x007A
> +#define MT6392_STRUP_CON19                      0x007C
> +#define MT6392_STRUP_CON20                      0x007E
> +#define MT6392_CID                              0x0100
> +#define MT6392_TOP_CKPDN0                       0x0102
> +#define MT6392_TOP_CKPDN0_SET                   0x0104
> +#define MT6392_TOP_CKPDN0_CLR                   0x0106
> +#define MT6392_TOP_CKPDN1                       0x0108
> +#define MT6392_TOP_CKPDN1_SET                   0x010A
> +#define MT6392_TOP_CKPDN1_CLR                   0x010C
> +#define MT6392_TOP_CKPDN2                       0x010E
> +#define MT6392_TOP_CKPDN2_SET                   0x0110
> +#define MT6392_TOP_CKPDN2_CLR                   0x0112
> +#define MT6392_TOP_RST_CON                      0x0114
> +#define MT6392_TOP_RST_CON_SET                  0x0116
> +#define MT6392_TOP_RST_CON_CLR                  0x0118
> +#define MT6392_TOP_RST_MISC                     0x011A
> +#define MT6392_TOP_RST_MISC_SET                 0x011C
> +#define MT6392_TOP_RST_MISC_CLR                 0x011E
> +#define MT6392_TOP_CKCON0                       0x0120
> +#define MT6392_TOP_CKCON0_SET                   0x0122
> +#define MT6392_TOP_CKCON0_CLR                   0x0124
> +#define MT6392_TOP_CKCON1                       0x0126
> +#define MT6392_TOP_CKCON1_SET                   0x0128
> +#define MT6392_TOP_CKCON1_CLR                   0x012A
> +#define MT6392_TOP_CKTST0                       0x012C
> +#define MT6392_TOP_CKTST1                       0x012E
> +#define MT6392_TOP_CKTST2                       0x0130
> +#define MT6392_TEST_OUT                         0x0132
> +#define MT6392_TEST_CON0                        0x0134
> +#define MT6392_TEST_CON1                        0x0136
> +#define MT6392_EN_STATUS0                       0x0138
> +#define MT6392_EN_STATUS1                       0x013A
> +#define MT6392_OCSTATUS0                        0x013C
> +#define MT6392_OCSTATUS1                        0x013E
> +#define MT6392_PGSTATUS                         0x0140
> +#define MT6392_CHRSTATUS                        0x0142
> +#define MT6392_TDSEL_CON                        0x0144
> +#define MT6392_RDSEL_CON                        0x0146
> +#define MT6392_SMT_CON0                         0x0148
> +#define MT6392_SMT_CON1                         0x014A
> +#define MT6392_DRV_CON0                         0x0152
> +#define MT6392_DRV_CON1                         0x0154
> +#define MT6392_INT_CON0                         0x0160
> +#define MT6392_INT_CON0_SET                     0x0162
> +#define MT6392_INT_CON0_CLR                     0x0164
> +#define MT6392_INT_CON1                         0x0166
> +#define MT6392_INT_CON1_SET                     0x0168
> +#define MT6392_INT_CON1_CLR                     0x016A
> +#define MT6392_INT_MISC_CON                     0x016C
> +#define MT6392_INT_MISC_CON_SET                 0x016E
> +#define MT6392_INT_MISC_CON_CLR                 0x0170
> +#define MT6392_INT_STATUS0                      0x0172
> +#define MT6392_INT_STATUS1                      0x0174
> +#define MT6392_OC_GEAR_0                        0x0176
> +#define MT6392_OC_GEAR_1                        0x0178
> +#define MT6392_OC_GEAR_2                        0x017A
> +#define MT6392_OC_CTL_VPROC                     0x017C
> +#define MT6392_OC_CTL_VSYS                      0x017E
> +#define MT6392_OC_CTL_VCORE                     0x0180
> +#define MT6392_FQMTR_CON0                       0x0182
> +#define MT6392_FQMTR_CON1                       0x0184
> +#define MT6392_FQMTR_CON2                       0x0186
> +#define MT6392_RG_SPI_CON                       0x0188
> +#define MT6392_DEW_DIO_EN                       0x018A
> +#define MT6392_DEW_READ_TEST                    0x018C
> +#define MT6392_DEW_WRITE_TEST                   0x018E
> +#define MT6392_DEW_CRC_SWRST                    0x0190
> +#define MT6392_DEW_CRC_EN                       0x0192
> +#define MT6392_DEW_CRC_VAL                      0x0194
> +#define MT6392_DEW_DBG_MON_SEL                  0x0196
> +#define MT6392_DEW_CIPHER_KEY_SEL               0x0198
> +#define MT6392_DEW_CIPHER_IV_SEL                0x019A
> +#define MT6392_DEW_CIPHER_EN                    0x019C
> +#define MT6392_DEW_CIPHER_RDY                   0x019E
> +#define MT6392_DEW_CIPHER_MODE                  0x01A0
> +#define MT6392_DEW_CIPHER_SWRST                 0x01A2
> +#define MT6392_DEW_RDDMY_NO                     0x01A4
> +#define MT6392_DEW_RDATA_DLY_SEL                0x01A6
> +#define MT6392_CLK_TRIM_CON0                    0x01A8
> +#define MT6392_BUCK_CON0                        0x0200
> +#define MT6392_BUCK_CON1                        0x0202
> +#define MT6392_BUCK_CON2                        0x0204
> +#define MT6392_BUCK_CON3                        0x0206
> +#define MT6392_BUCK_CON4                        0x0208
> +#define MT6392_BUCK_CON5                        0x020A
> +#define MT6392_VPROC_CON0                       0x020C
> +#define MT6392_VPROC_CON1                       0x020E
> +#define MT6392_VPROC_CON2                       0x0210
> +#define MT6392_VPROC_CON3                       0x0212
> +#define MT6392_VPROC_CON4                       0x0214
> +#define MT6392_VPROC_CON5                       0x0216
> +#define MT6392_VPROC_CON7                       0x021A
> +#define MT6392_VPROC_CON8                       0x021C
> +#define MT6392_VPROC_CON9                       0x021E
> +#define MT6392_VPROC_CON10                      0x0220
> +#define MT6392_VPROC_CON11                      0x0222
> +#define MT6392_VPROC_CON12                      0x0224
> +#define MT6392_VPROC_CON13                      0x0226
> +#define MT6392_VPROC_CON14                      0x0228
> +#define MT6392_VPROC_CON15                      0x022A
> +#define MT6392_VPROC_CON18                      0x0230
> +#define MT6392_VSYS_CON0                        0x0232
> +#define MT6392_VSYS_CON1                        0x0234
> +#define MT6392_VSYS_CON2                        0x0236
> +#define MT6392_VSYS_CON3                        0x0238
> +#define MT6392_VSYS_CON4                        0x023A
> +#define MT6392_VSYS_CON5                        0x023C
> +#define MT6392_VSYS_CON7                        0x0240
> +#define MT6392_VSYS_CON8                        0x0242
> +#define MT6392_VSYS_CON9                        0x0244
> +#define MT6392_VSYS_CON10                       0x0246
> +#define MT6392_VSYS_CON11                       0x0248
> +#define MT6392_VSYS_CON12                       0x024A
> +#define MT6392_VSYS_CON13                       0x024C
> +#define MT6392_VSYS_CON14                       0x024E
> +#define MT6392_VSYS_CON15                       0x0250
> +#define MT6392_VSYS_CON18                       0x0256
> +#define MT6392_BUCK_OC_CON0                     0x0258
> +#define MT6392_BUCK_OC_CON1                     0x025A
> +#define MT6392_BUCK_OC_CON2                     0x025C
> +#define MT6392_BUCK_OC_CON3                     0x025E
> +#define MT6392_BUCK_OC_CON4                     0x0260
> +#define MT6392_BUCK_OC_VPROC_CON0               0x0262
> +#define MT6392_BUCK_OC_VCORE_CON0               0x0264
> +#define MT6392_BUCK_OC_VSYS_CON0                0x0266
> +#define MT6392_BUCK_ANA_MON_CON0                0x0268
> +#define MT6392_BUCK_EFUSE_OC_CON0               0x026A
> +#define MT6392_VCORE_CON0                       0x0300
> +#define MT6392_VCORE_CON1                       0x0302
> +#define MT6392_VCORE_CON2                       0x0304
> +#define MT6392_VCORE_CON3                       0x0306
> +#define MT6392_VCORE_CON4                       0x0308
> +#define MT6392_VCORE_CON5                       0x030A
> +#define MT6392_VCORE_CON7                       0x030E
> +#define MT6392_VCORE_CON8                       0x0310
> +#define MT6392_VCORE_CON9                       0x0312
> +#define MT6392_VCORE_CON10                      0x0314
> +#define MT6392_VCORE_CON11                      0x0316
> +#define MT6392_VCORE_CON12                      0x0318
> +#define MT6392_VCORE_CON13                      0x031A
> +#define MT6392_VCORE_CON14                      0x031C
> +#define MT6392_VCORE_CON15                      0x031E
> +#define MT6392_VCORE_CON18                      0x0324
> +#define MT6392_BUCK_K_CON0                      0x032A
> +#define MT6392_BUCK_K_CON1                      0x032C
> +#define MT6392_BUCK_K_CON2                      0x032E
> +#define MT6392_ANALDO_CON0                      0x0400
> +#define MT6392_ANALDO_CON1                      0x0402
> +#define MT6392_ANALDO_CON2                      0x0404
> +#define MT6392_ANALDO_CON3                      0x0406
> +#define MT6392_ANALDO_CON4                      0x0408
> +#define MT6392_ANALDO_CON6                      0x040C
> +#define MT6392_ANALDO_CON7                      0x040E
> +#define MT6392_ANALDO_CON8                      0x0410
> +#define MT6392_ANALDO_CON10                     0x0412
> +#define MT6392_ANALDO_CON15                     0x0414
> +#define MT6392_ANALDO_CON16                     0x0416
> +#define MT6392_ANALDO_CON17                     0x0418
> +#define MT6392_ANALDO_CON21                     0x0420
> +#define MT6392_ANALDO_CON22                     0x0422
> +#define MT6392_ANALDO_CON23                     0x0424
> +#define MT6392_ANALDO_CON24                     0x0426
> +#define MT6392_ANALDO_CON25                     0x0428
> +#define MT6392_ANALDO_CON26                     0x042A
> +#define MT6392_ANALDO_CON27                     0x042C
> +#define MT6392_ANALDO_CON28                     0x042E
> +#define MT6392_ANALDO_CON29                     0x0430
> +#define MT6392_DIGLDO_CON0                      0x0500
> +#define MT6392_DIGLDO_CON2                      0x0502
> +#define MT6392_DIGLDO_CON3                      0x0504
> +#define MT6392_DIGLDO_CON5                      0x0506
> +#define MT6392_DIGLDO_CON6                      0x0508
> +#define MT6392_DIGLDO_CON7                      0x050A
> +#define MT6392_DIGLDO_CON8                      0x050C
> +#define MT6392_DIGLDO_CON10                     0x0510
> +#define MT6392_DIGLDO_CON11                     0x0512
> +#define MT6392_DIGLDO_CON12                     0x0514
> +#define MT6392_DIGLDO_CON15                     0x051A
> +#define MT6392_DIGLDO_CON20                     0x0524
> +#define MT6392_DIGLDO_CON21                     0x0526
> +#define MT6392_DIGLDO_CON23                     0x0528
> +#define MT6392_DIGLDO_CON24                     0x052A
> +#define MT6392_DIGLDO_CON26                     0x052C
> +#define MT6392_DIGLDO_CON27                     0x052E
> +#define MT6392_DIGLDO_CON28                     0x0530
> +#define MT6392_DIGLDO_CON29                     0x0532
> +#define MT6392_DIGLDO_CON30                     0x0534
> +#define MT6392_DIGLDO_CON31                     0x0536
> +#define MT6392_DIGLDO_CON32                     0x0538
> +#define MT6392_DIGLDO_CON33                     0x053A
> +#define MT6392_DIGLDO_CON36                     0x0540
> +#define MT6392_DIGLDO_CON41                     0x0546
> +#define MT6392_DIGLDO_CON44                     0x054C
> +#define MT6392_DIGLDO_CON47                     0x0552
> +#define MT6392_DIGLDO_CON48                     0x0554
> +#define MT6392_DIGLDO_CON49                     0x0556
> +#define MT6392_DIGLDO_CON50                     0x0558
> +#define MT6392_DIGLDO_CON51                     0x055A
> +#define MT6392_DIGLDO_CON52                     0x055C
> +#define MT6392_DIGLDO_CON53                     0x055E
> +#define MT6392_DIGLDO_CON54                     0x0560
> +#define MT6392_DIGLDO_CON55                     0x0562
> +#define MT6392_DIGLDO_CON56                     0x0564
> +#define MT6392_DIGLDO_CON57                     0x0566
> +#define MT6392_DIGLDO_CON58                     0x0568
> +#define MT6392_DIGLDO_CON59                     0x056A
> +#define MT6392_DIGLDO_CON60                     0x056C
> +#define MT6392_DIGLDO_CON61                     0x056E
> +#define MT6392_DIGLDO_CON62                     0x0570
> +#define MT6392_DIGLDO_CON63                     0x0572
> +#define MT6392_EFUSE_CON0                       0x0600
> +#define MT6392_EFUSE_CON1                       0x0602
> +#define MT6392_EFUSE_CON2                       0x0604
> +#define MT6392_EFUSE_CON3                       0x0606
> +#define MT6392_EFUSE_CON4                       0x0608
> +#define MT6392_EFUSE_CON5                       0x060A
> +#define MT6392_EFUSE_CON6                       0x060C
> +#define MT6392_EFUSE_VAL_0_15                   0x060E
> +#define MT6392_EFUSE_VAL_16_31                  0x0610
> +#define MT6392_EFUSE_VAL_32_47                  0x0612
> +#define MT6392_EFUSE_VAL_48_63                  0x0614
> +#define MT6392_EFUSE_VAL_64_79                  0x0616
> +#define MT6392_EFUSE_VAL_80_95                  0x0618
> +#define MT6392_EFUSE_VAL_96_111                 0x061A
> +#define MT6392_EFUSE_VAL_112_127                0x061C
> +#define MT6392_EFUSE_VAL_128_143                0x061E
> +#define MT6392_EFUSE_VAL_144_159                0x0620
> +#define MT6392_EFUSE_VAL_160_175                0x0622
> +#define MT6392_EFUSE_VAL_176_191                0x0624
> +#define MT6392_EFUSE_VAL_192_207                0x0626
> +#define MT6392_EFUSE_VAL_208_223                0x0628
> +#define MT6392_EFUSE_VAL_224_239                0x062A
> +#define MT6392_EFUSE_VAL_240_255                0x062C
> +#define MT6392_EFUSE_VAL_256_271                0x062E
> +#define MT6392_EFUSE_VAL_272_287                0x0630
> +#define MT6392_EFUSE_VAL_288_303                0x0632
> +#define MT6392_EFUSE_VAL_304_319                0x0634
> +#define MT6392_EFUSE_VAL_320_335                0x0636
> +#define MT6392_EFUSE_VAL_336_351                0x0638
> +#define MT6392_EFUSE_VAL_352_367                0x063A
> +#define MT6392_EFUSE_VAL_368_383                0x063C
> +#define MT6392_EFUSE_VAL_384_399                0x063E
> +#define MT6392_EFUSE_VAL_400_415                0x0640
> +#define MT6392_EFUSE_VAL_416_431                0x0642
> +#define MT6392_RTC_MIX_CON0                     0x0644
> +#define MT6392_RTC_MIX_CON1                     0x0646
> +#define MT6392_EFUSE_VAL_432_447                0x0648
> +#define MT6392_EFUSE_VAL_448_463                0x064A
> +#define MT6392_EFUSE_VAL_464_479                0x064C
> +#define MT6392_EFUSE_VAL_480_495                0x064E
> +#define MT6392_EFUSE_VAL_496_511                0x0650
> +#define MT6392_EFUSE_DOUT_0_15                  0x0652
> +#define MT6392_EFUSE_DOUT_16_31                 0x0654
> +#define MT6392_EFUSE_DOUT_32_47                 0x0656
> +#define MT6392_EFUSE_DOUT_48_63                 0x0658
> +#define MT6392_EFUSE_DOUT_64_79                 0x065A
> +#define MT6392_EFUSE_DOUT_80_95                 0x065C
> +#define MT6392_EFUSE_DOUT_96_111                0x065E
> +#define MT6392_EFUSE_DOUT_112_127               0x0660
> +#define MT6392_EFUSE_DOUT_128_143               0x0662
> +#define MT6392_EFUSE_DOUT_144_159               0x0664
> +#define MT6392_EFUSE_DOUT_160_175               0x0666
> +#define MT6392_EFUSE_DOUT_176_191               0x0668
> +#define MT6392_EFUSE_DOUT_192_207               0x066A
> +#define MT6392_EFUSE_DOUT_208_223               0x066C
> +#define MT6392_EFUSE_DOUT_224_239               0x066E
> +#define MT6392_EFUSE_DOUT_240_255               0x0670
> +#define MT6392_EFUSE_DOUT_256_271               0x0672
> +#define MT6392_EFUSE_DOUT_272_287               0x0674
> +#define MT6392_EFUSE_DOUT_288_303               0x0676
> +#define MT6392_EFUSE_DOUT_304_319               0x0678
> +#define MT6392_EFUSE_DOUT_320_335               0x067A
> +#define MT6392_EFUSE_DOUT_336_351               0x067C
> +#define MT6392_EFUSE_DOUT_352_367               0x067E
> +#define MT6392_EFUSE_DOUT_368_383               0x0680
> +#define MT6392_EFUSE_DOUT_384_399               0x0682
> +#define MT6392_EFUSE_DOUT_400_415               0x0684
> +#define MT6392_EFUSE_DOUT_416_431               0x0686
> +#define MT6392_EFUSE_DOUT_432_447               0x0688
> +#define MT6392_EFUSE_DOUT_448_463               0x068A
> +#define MT6392_EFUSE_DOUT_464_479               0x068C
> +#define MT6392_EFUSE_DOUT_480_495               0x068E
> +#define MT6392_EFUSE_DOUT_496_511               0x0690
> +#define MT6392_EFUSE_CON7                       0x0692
> +#define MT6392_EFUSE_CON8                       0x0694
> +#define MT6392_EFUSE_CON9                       0x0696
> +#define MT6392_AUXADC_ADC0                      0x0700
> +#define MT6392_AUXADC_ADC1                      0x0702
> +#define MT6392_AUXADC_ADC2                      0x0704
> +#define MT6392_AUXADC_ADC3                      0x0706
> +#define MT6392_AUXADC_ADC4                      0x0708
> +#define MT6392_AUXADC_ADC5                      0x070A
> +#define MT6392_AUXADC_ADC6                      0x070C
> +#define MT6392_AUXADC_ADC7                      0x070E
> +#define MT6392_AUXADC_ADC8                      0x0710
> +#define MT6392_AUXADC_ADC9                      0x0712
> +#define MT6392_AUXADC_ADC10                     0x0714
> +#define MT6392_AUXADC_ADC11                     0x0716
> +#define MT6392_AUXADC_ADC12                     0x0718
> +#define MT6392_AUXADC_ADC13                     0x071A
> +#define MT6392_AUXADC_ADC14                     0x071C
> +#define MT6392_AUXADC_ADC15                     0x071E
> +#define MT6392_AUXADC_ADC16                     0x0720
> +#define MT6392_AUXADC_ADC17                     0x0722
> +#define MT6392_AUXADC_ADC18                     0x0724
> +#define MT6392_AUXADC_ADC19                     0x0726
> +#define MT6392_AUXADC_ADC20                     0x0728
> +#define MT6392_AUXADC_ADC21                     0x072A
> +#define MT6392_AUXADC_ADC22                     0x072C
> +#define MT6392_AUXADC_STA0                      0x072E
> +#define MT6392_AUXADC_STA1                      0x0730
> +#define MT6392_AUXADC_RQST0                     0x0732
> +#define MT6392_AUXADC_RQST0_SET                 0x0734
> +#define MT6392_AUXADC_RQST0_CLR                 0x0736
> +#define MT6392_AUXADC_CON0                      0x0738
> +#define MT6392_AUXADC_CON0_SET                  0x073A
> +#define MT6392_AUXADC_CON0_CLR                  0x073C
> +#define MT6392_AUXADC_CON1                      0x073E
> +#define MT6392_AUXADC_CON2                      0x0740
> +#define MT6392_AUXADC_CON3                      0x0742
> +#define MT6392_AUXADC_CON4                      0x0744
> +#define MT6392_AUXADC_CON5                      0x0746
> +#define MT6392_AUXADC_CON6                      0x0748
> +#define MT6392_AUXADC_CON7                      0x074A
> +#define MT6392_AUXADC_CON8                      0x074C
> +#define MT6392_AUXADC_CON9                      0x074E
> +#define MT6392_AUXADC_CON10                     0x0750
> +#define MT6392_AUXADC_CON11                     0x0752
> +#define MT6392_AUXADC_CON12                     0x0754
> +#define MT6392_AUXADC_CON13                     0x0756
> +#define MT6392_AUXADC_CON14                     0x0758
> +#define MT6392_AUXADC_CON15                     0x075A
> +#define MT6392_AUXADC_CON16                     0x075C
> +#define MT6392_AUXADC_AUTORPT0                  0x075E
> +#define MT6392_AUXADC_LBAT0                     0x0760
> +#define MT6392_AUXADC_LBAT1                     0x0762
> +#define MT6392_AUXADC_LBAT2                     0x0764
> +#define MT6392_AUXADC_LBAT3                     0x0766
> +#define MT6392_AUXADC_LBAT4                     0x0768
> +#define MT6392_AUXADC_LBAT5                     0x076A
> +#define MT6392_AUXADC_LBAT6                     0x076C
> +#define MT6392_AUXADC_THR0                      0x076E
> +#define MT6392_AUXADC_THR1                      0x0770
> +#define MT6392_AUXADC_THR2                      0x0772
> +#define MT6392_AUXADC_THR3                      0x0774
> +#define MT6392_AUXADC_THR4                      0x0776
> +#define MT6392_AUXADC_THR5                      0x0778
> +#define MT6392_AUXADC_THR6                      0x077A
> +#define MT6392_AUXADC_EFUSE0                    0x077C
> +#define MT6392_AUXADC_EFUSE1                    0x077E
> +#define MT6392_AUXADC_EFUSE2                    0x0780
> +#define MT6392_AUXADC_EFUSE3                    0x0782
> +#define MT6392_AUXADC_EFUSE4                    0x0784
> +#define MT6392_AUXADC_EFUSE5                    0x0786
> +#define MT6392_AUXADC_NAG_0                     0x0788
> +#define MT6392_AUXADC_NAG_1                     0x078A
> +#define MT6392_AUXADC_NAG_2                     0x078C
> +#define MT6392_AUXADC_NAG_3                     0x078E
> +#define MT6392_AUXADC_NAG_4                     0x0790
> +#define MT6392_AUXADC_NAG_5                     0x0792
> +#define MT6392_AUXADC_NAG_6                     0x0794
> +#define MT6392_AUXADC_NAG_7                     0x0796
> +#define MT6392_AUXADC_NAG_8                     0x0798
> +#define MT6392_AUXADC_TYPEC_H_1                 0x079A
> +#define MT6392_AUXADC_TYPEC_H_2                 0x079C
> +#define MT6392_AUXADC_TYPEC_H_3                 0x079E
> +#define MT6392_AUXADC_TYPEC_H_4                 0x07A0
> +#define MT6392_AUXADC_TYPEC_H_5                 0x07A2
> +#define MT6392_AUXADC_TYPEC_H_6                 0x07A4
> +#define MT6392_AUXADC_TYPEC_H_7                 0x07A6
> +#define MT6392_AUXADC_TYPEC_L_1                 0x07A8
> +#define MT6392_AUXADC_TYPEC_L_2                 0x07AA
> +#define MT6392_AUXADC_TYPEC_L_3                 0x07AC
> +#define MT6392_AUXADC_TYPEC_L_4                 0x07AE
> +#define MT6392_AUXADC_TYPEC_L_5                 0x07B0
> +#define MT6392_AUXADC_TYPEC_L_6                 0x07B2
> +#define MT6392_AUXADC_TYPEC_L_7                 0x07B4
> +#define MT6392_AUXADC_NAG_9                     0x07B6
> +#define MT6392_TYPE_C_PHY_RG_0                  0x0800
> +#define MT6392_TYPE_C_PHY_RG_CC_RESERVE_CSR     0x0802
> +#define MT6392_TYPE_C_VCMP_CTRL                 0x0804
> +#define MT6392_TYPE_C_CTRL                      0x0806
> +#define MT6392_TYPE_C_CC_SW_CTRL                0x080a
> +#define MT6392_TYPE_C_CC_VOL_PERIODIC_MEAS_VAL  0x080c
> +#define MT6392_TYPE_C_CC_VOL_DEBOUNCE_CNT_VAL   0x080e
> +#define MT6392_TYPE_C_DRP_SRC_CNT_VAL_0         0x0810
> +#define MT6392_TYPE_C_DRP_SNK_CNT_VAL_0         0x0814
> +#define MT6392_TYPE_C_DRP_TRY_CNT_VAL_0         0x0818
> +#define MT6392_TYPE_C_CC_SRC_DEFAULT_DAC_VAL    0x0820
> +#define MT6392_TYPE_C_CC_SRC_15_DAC_VAL         0x0822
> +#define MT6392_TYPE_C_CC_SRC_30_DAC_VAL         0x0824
> +#define MT6392_TYPE_C_CC_SNK_DAC_VAL_0          0x0828
> +#define MT6392_TYPE_C_CC_SNK_DAC_VAL_1          0x082a
> +#define MT6392_TYPE_C_INTR_EN_0                 0x0830
> +#define MT6392_TYPE_C_INTR_EN_2                 0x0834
> +#define MT6392_TYPE_C_INTR_0                    0x0838
> +#define MT6392_TYPE_C_INTR_2                    0x083C
> +#define MT6392_TYPE_C_CC_STATUS                 0x0840
> +#define MT6392_TYPE_C_PWR_STATUS                0x0842
> +#define MT6392_TYPE_C_PHY_RG_CC1_RESISTENCE_0   0x0844
> +#define MT6392_TYPE_C_PHY_RG_CC1_RESISTENCE_1   0x0846
> +#define MT6392_TYPE_C_PHY_RG_CC2_RESISTENCE_0   0x0848
> +#define MT6392_TYPE_C_PHY_RG_CC2_RESISTENCE_1   0x084a
> +#define MT6392_TYPE_C_CC_SW_FORCE_MODE_ENABLE_0 0x0860
> +#define MT6392_TYPE_C_CC_SW_FORCE_MODE_VAL_0    0x0864
> +#define MT6392_TYPE_C_CC_SW_FORCE_MODE_VAL_1    0x0866
> +#define MT6392_TYPE_C_CC_SW_FORCE_MODE_ENABLE_1 0x0868
> +#define MT6392_TYPE_C_CC_SW_FORCE_MODE_VAL_2    0x086c
> +#define MT6392_TYPE_C_CC_DAC_CALI_CTRL          0x0870
> +#define MT6392_TYPE_C_CC_DAC_CALI_RESULT        0x0872
> +#define MT6392_TYPE_C_DEBUG_PORT_SELECT_0       0x0880
> +#define MT6392_TYPE_C_DEBUG_PORT_SELECT_1       0x0882
> +#define MT6392_TYPE_C_DEBUG_MODE_SELECT         0x0884
> +#define MT6392_TYPE_C_DEBUG_OUT_READ_0          0x0888
> +#define MT6392_TYPE_C_DEBUG_OUT_READ_1          0x088a
> +#define MT6392_TYPE_C_SW_DEBUG_PORT_0           0x088c
> +#define MT6392_TYPE_C_SW_DEBUG_PORT_1           0x088e
> +
> +#endif /* __MFD_MT6392_REGISTERS_H__ */
> diff --git "a/include/linux/mfd/mt6397/core.h" "b/include/linux/mfd/mt6397/core.h"
> index 340fc72e22aa..3729a6856c13 100644
> --- "a/include/linux/mfd/mt6397/core.h"
> +++ "b/include/linux/mfd/mt6397/core.h"
> @@ -20,6 +20,7 @@ enum chip_id {
>  	MT6359_CHIP_ID = 0x59,
>  	MT6366_CHIP_ID = 0x66,
>  	MT6391_CHIP_ID = 0x91,
> +	MT6392_CHIP_ID = 0x92,

This looks like a duplicated struct.

Can't we use this instead of the made-up 'mfd_match_data'?

>  	MT6397_CHIP_ID = 0x97,
>  };
>  
> -- 
> 2.43.0

-- 
Lee Jones


^ permalink raw reply

* Re: (subset) [PATCH 2/9] dt-bindings: mfd: mediatek: mt6397: Add MT6365 PMIC support
From: Lee Jones @ 2026-05-20 14:41 UTC (permalink / raw)
  To: Sen Chu, Sean Wang, Macpaul Lin, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Dmitry Torokhov, Chen Zhong,
	Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Louis-Alexis Eyraud
  Cc: kernel, linux-pm, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, linux-input, linux-iio
In-Reply-To: <20260429-mediatek-genio-mt6365-cleanup-v1-2-6f43838be92f@collabora.com>

On Wed, 29 Apr 2026 11:44:15 +0200, Louis-Alexis Eyraud wrote:
> MT6365 PMIC is compatible with MT6359, so add the compatible strings
> for the main and sub devices (regulator, rtc, audio codec).

Applied, thanks!

[2/9] dt-bindings: mfd: mediatek: mt6397: Add MT6365 PMIC support
      commit: 5a7c6466133eee4370995ad5ccf4c377011a381e

--
Lee Jones [李琼斯]



^ permalink raw reply

* Re: (subset) [PATCH 1/9] dt-bindings: mfd: mediatek: mt6397: Add rtc for MT6359
From: Lee Jones @ 2026-05-20 14:40 UTC (permalink / raw)
  To: Sen Chu, Sean Wang, Macpaul Lin, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Dmitry Torokhov, Chen Zhong,
	Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Louis-Alexis Eyraud
  Cc: kernel, linux-pm, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, linux-input, linux-iio
In-Reply-To: <20260429-mediatek-genio-mt6365-cleanup-v1-1-6f43838be92f@collabora.com>

On Wed, 29 Apr 2026 11:44:14 +0200, Louis-Alexis Eyraud wrote:
> The rtc block of MT6359 PMIC is compatible with the one found in MT6358
> but this compatibility was never expressed in the dt-bindings, so add
> the missing compatible string for the rtc subnode.

Applied, thanks!

[1/9] dt-bindings: mfd: mediatek: mt6397: Add rtc for MT6359
      commit: 4edf75f835bad0b7e7ac022594b129f9dbf8698c

--
Lee Jones [李琼斯]



^ permalink raw reply

* Re: [PATCH 2/2] ASoC: mt8173-max98090: use standard callback to set jack
From: Mark Brown @ 2026-05-20 13:42 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: lgirdwood, perex, tiwai, matthias.bgg, angelogioacchino.delregno,
	sharq0406, kuninori.morimoto.gx, ckeepax, linux-sound,
	linux-kernel, linux-arm-kernel, linux-mediatek
In-Reply-To: <20260520132930.54333-3-srinivas.kandagatla@oss.qualcomm.com>

[-- Attachment #1: Type: text/plain, Size: 255 bytes --]

On Wed, May 20, 2026 at 01:29:30PM +0000, Srinivas Kandagatla wrote:
> use snd_soc_component_set_jack() instead of custom callback to
> max98090 codec.

This needs to be squashed into the first commit, otherwise the first
commit will cause a build break.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply

* [PATCH 2/2] ASoC: mt8173-max98090: use standard callback to set jack
From: Srinivas Kandagatla @ 2026-05-20 13:29 UTC (permalink / raw)
  To: broonie
  Cc: lgirdwood, perex, tiwai, matthias.bgg, angelogioacchino.delregno,
	sharq0406, kuninori.morimoto.gx, ckeepax, srinivas.kandagatla,
	linux-sound, linux-kernel, linux-arm-kernel, linux-mediatek
In-Reply-To: <20260520132930.54333-1-srinivas.kandagatla@oss.qualcomm.com>

use snd_soc_component_set_jack() instead of custom callback to
max98090 codec.

This will help other drivers using the standard callback to exercise
the standard path instead of custom callback.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
---
 sound/soc/mediatek/mt8173/mt8173-max98090.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/mediatek/mt8173/mt8173-max98090.c b/sound/soc/mediatek/mt8173/mt8173-max98090.c
index 49ebb67c818a..236e1f8df45a 100644
--- a/sound/soc/mediatek/mt8173/mt8173-max98090.c
+++ b/sound/soc/mediatek/mt8173/mt8173-max98090.c
@@ -9,7 +9,6 @@
 #include <linux/module.h>
 #include <sound/soc.h>
 #include <sound/jack.h>
-#include "../../codecs/max98090.h"
 
 static struct snd_soc_jack mt8173_max98090_jack;
 
@@ -78,7 +77,7 @@ static int mt8173_max98090_init(struct snd_soc_pcm_runtime *runtime)
 		return ret;
 	}
 
-	return max98090_mic_detect(component, &mt8173_max98090_jack);
+	return snd_soc_component_set_jack(component, &mt8173_max98090_jack);
 }
 
 SND_SOC_DAILINK_DEFS(playback,
-- 
2.47.3



^ permalink raw reply related

* [PATCH 1/2] ASoC: codecs: max98090: use component set_jack callback
From: Srinivas Kandagatla @ 2026-05-20 13:29 UTC (permalink / raw)
  To: broonie
  Cc: lgirdwood, perex, tiwai, matthias.bgg, angelogioacchino.delregno,
	sharq0406, kuninori.morimoto.gx, ckeepax, srinivas.kandagatla,
	linux-sound, linux-kernel, linux-arm-kernel, linux-mediatek
In-Reply-To: <20260520132930.54333-1-srinivas.kandagatla@oss.qualcomm.com>

The MAX98090 driver provides a custom max98090_mic_detect() helper for
machine drivers to register a jack.

This can be implemented using the standard component set_jack callback
instead. Doing so allows machine drivers to use
snd_soc_component_set_jack(), which is also the interface used by
machine drivers including Qualcomm ones.

Convert max98090_mic_detect() to a component set_jack callback and remove
the exported helper.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
---
 sound/soc/codecs/max98090.c | 10 +++++-----
 sound/soc/codecs/max98090.h |  3 ---
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 13a15459040f..bd3bfa1d3402 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2337,7 +2337,7 @@ static irqreturn_t max98090_interrupt(int irq, void *data)
 }
 
 /**
- * max98090_mic_detect - Enable microphone detection via the MAX98090 IRQ
+ * max98090_set_jack - Enable microphone detection via the MAX98090 IRQ
  *
  * @component:  MAX98090 component
  * @jack:   jack to report detection events on
@@ -2349,12 +2349,12 @@ static irqreturn_t max98090_interrupt(int irq, void *data)
  *
  * If no jack is supplied detection will be disabled.
  */
-int max98090_mic_detect(struct snd_soc_component *component,
-	struct snd_soc_jack *jack)
+static int max98090_set_jack(struct snd_soc_component *component,
+			     struct snd_soc_jack *jack, void *data)
 {
 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
 
-	dev_dbg(component->dev, "max98090_mic_detect\n");
+	dev_dbg(component->dev, "%s\n", __func__);
 
 	max98090->jack = jack;
 	if (jack) {
@@ -2377,7 +2377,6 @@ int max98090_mic_detect(struct snd_soc_component *component,
 
 	return 0;
 }
-EXPORT_SYMBOL_GPL(max98090_mic_detect);
 
 #define MAX98090_RATES SNDRV_PCM_RATE_8000_96000
 #define MAX98090_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE)
@@ -2554,6 +2553,7 @@ static const struct snd_soc_component_driver soc_component_dev_max98090 = {
 	.remove			= max98090_remove,
 	.seq_notifier		= max98090_seq_notifier,
 	.set_bias_level		= max98090_set_bias_level,
+	.set_jack		= max98090_set_jack,
 	.idle_bias_on		= 1,
 	.use_pmdown_time	= 1,
 	.endianness		= 1,
diff --git a/sound/soc/codecs/max98090.h b/sound/soc/codecs/max98090.h
index 6ce8dd176e48..048af4a1376f 100644
--- a/sound/soc/codecs/max98090.h
+++ b/sound/soc/codecs/max98090.h
@@ -1543,7 +1543,4 @@ struct max98090_priv {
 	bool shdn_pending;
 };
 
-int max98090_mic_detect(struct snd_soc_component *component,
-	struct snd_soc_jack *jack);
-
 #endif
-- 
2.47.3



^ permalink raw reply related

* [PATCH 0/2] ASoC: codecs: max98090: switch to standard set_jack callback
From: Srinivas Kandagatla @ 2026-05-20 13:29 UTC (permalink / raw)
  To: broonie
  Cc: lgirdwood, perex, tiwai, matthias.bgg, angelogioacchino.delregno,
	sharq0406, kuninori.morimoto.gx, ckeepax, srinivas.kandagatla,
	linux-sound, linux-kernel, linux-arm-kernel, linux-mediatek

The MAX98090 codec driver currently exposes a custom
max98090_mic_detect() helper for machine drivers to register a headset
jack.

This series converts the driver to use the standard component
.set_jack callback and updates the mt8173-max98090 machine driver to use
snd_soc_component_set_jack() instead of the codec-specific helper.

Using the standard callback removes the need for a custom exported
symbol and allows machine drivers to use the common ASoC jack
registration interface. This also improves compatibility with machine
drivers, such as Qualcomm platforms, that already rely on
snd_soc_component_set_jack().


Srinivas Kandagatla (2):
  ASoC: codecs: max98090: use component set_jack callback
  ASoC: mt8173-max98090: use standard callback to set jack

 sound/soc/codecs/max98090.c                 | 10 +++++-----
 sound/soc/codecs/max98090.h                 |  3 ---
 sound/soc/mediatek/mt8173/mt8173-max98090.c |  3 +--
 3 files changed, 6 insertions(+), 10 deletions(-)

-- 
2.47.3



^ permalink raw reply

* [PATCH net] net: airoha: Disable GDM2 forwarding before configuring GDM2 loopback
From: Lorenzo Bianconi @ 2026-05-20 13:12 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: linux-arm-kernel, linux-mediatek, netdev, Madhur Agrawal,
	Lorenzo Bianconi

Hw design requires to disable GDM2 forwarding before configuring GDM2
loopback in airoha_set_gdm2_loopback routine.

Fixes: 9cd451d414f6e ("net: airoha: Add loopback support for GDM2")
Tested-by: Madhur Agrawal <madhur.agrawal@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/airoha/airoha_eth.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c
index d0c0c0ec8a80..cecd66251dba 100644
--- a/drivers/net/ethernet/airoha/airoha_eth.c
+++ b/drivers/net/ethernet/airoha/airoha_eth.c
@@ -1793,11 +1793,8 @@ static int airoha_set_gdm2_loopback(struct airoha_gdm_port *port)
 	u32 val, pse_port, chan;
 	int i, src_port;
 
-	/* Forward the traffic to the proper GDM port */
-	pse_port = port->id == AIROHA_GDM3_IDX ? FE_PSE_PORT_GDM3
-					       : FE_PSE_PORT_GDM4;
 	airoha_set_gdm_port_fwd_cfg(eth, REG_GDM_FWD_CFG(AIROHA_GDM2_IDX),
-				    pse_port);
+				    FE_PSE_PORT_DROP);
 	airoha_fe_clear(eth, REG_GDM_FWD_CFG(AIROHA_GDM2_IDX),
 			GDM_STRIP_CRC_MASK);
 
@@ -1815,6 +1812,11 @@ static int airoha_set_gdm2_loopback(struct airoha_gdm_port *port)
 		      GDM_SHORT_LEN_MASK | GDM_LONG_LEN_MASK,
 		      FIELD_PREP(GDM_SHORT_LEN_MASK, 60) |
 		      FIELD_PREP(GDM_LONG_LEN_MASK, AIROHA_MAX_MTU));
+	/* Forward the traffic to the proper GDM port */
+	pse_port = port->id == AIROHA_GDM3_IDX ? FE_PSE_PORT_GDM3
+					       : FE_PSE_PORT_GDM4;
+	airoha_set_gdm_port_fwd_cfg(eth, REG_GDM_FWD_CFG(AIROHA_GDM2_IDX),
+				    pse_port);
 
 	/* Disable VIP and IFC for GDM2 */
 	airoha_fe_clear(eth, REG_FE_VIP_PORT_EN, BIT(AIROHA_GDM2_IDX));

---
base-commit: dc416e32baaeb620b9809e9e25fc7b30889686e9
change-id: 20260520-airoha-disable-gdm2-fwd-cdf18f7d4f1f

Best regards,
-- 
Lorenzo Bianconi <lorenzo@kernel.org>



^ permalink raw reply related

* Re: [PATCH] ASoC: mediatek: mt2701: fix snprintf bounds
From: David Laight @ 2026-05-20 13:12 UTC (permalink / raw)
  To: Rosen Penev
  Cc: linux-sound, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Matthias Brugger, AngeloGioacchino Del Regno,
	open list:ARM/Mediatek SoC support,
	moderated list:ARM/Mediatek SoC support,
	moderated list:ARM/Mediatek SoC support
In-Reply-To: <20260519010440.629290-1-rosenp@gmail.com>

On Mon, 18 May 2026 18:04:40 -0700
Rosen Penev <rosenp@gmail.com> wrote:

> For whatever reason, GCC is unable to figure out that i2s_num is a
> single digit number, with MT2701_BASE_CLK_NUM being the maximum value it
> represents. Add a min() call to help it out and fix W=1 errors regarding
> snprintf bounds.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
>  sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c b/sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c
> index 5a2bcf027b4f..43157f218409 100644
> --- a/sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c
> +++ b/sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c
> @@ -25,6 +25,7 @@ static const char *const base_clks[] = {
>  int mt2701_init_clock(struct mtk_base_afe *afe)
>  {
>  	struct mt2701_afe_private *afe_priv = afe->platform_priv;
> +	int i2s_num;
>  	int i;
>  
>  	for (i = 0; i < MT2701_BASE_CLK_NUM; i++) {
> @@ -35,8 +36,9 @@ int mt2701_init_clock(struct mtk_base_afe *afe)
>  		}
>  	}
>  
> +	i2s_num = min(MT2701_BASE_CLK_NUM, afe_priv->soc->i2s_num);

To me that is backwards, like an 'if' put the variable before the limit.

>  	/* Get I2S related clocks */
> -	for (i = 0; i < afe_priv->soc->i2s_num; i++) {
> +	for (i = 0; i < i2s_num; i++) {

Caching the limit also stops the compiler having to read it every iteration.

-- David

>  		struct mt2701_i2s_path *i2s_path = &afe_priv->i2s_path[i];
>  		struct clk *i2s_ck;
>  		char name[13];



^ permalink raw reply

* Re: [PATCH] Bluetooth: btmtk: remove extra copy in cmd array init
From: Luiz Augusto von Dentz @ 2026-05-20 12:55 UTC (permalink / raw)
  To: Jiajia Liu
  Cc: Marcel Holtmann, Matthias Brugger, AngeloGioacchino Del Regno,
	linux-bluetooth, linux-kernel, linux-arm-kernel, linux-mediatek
In-Reply-To: <20260520021500.13504-1-liujiajia@kylinos.cn>

Hi Jiajia,

On Tue, May 19, 2026 at 10:15 PM Jiajia Liu <liujiajia@kylinos.cn> wrote:
>
> In btmtk_setup_firmware_79xx, the data length indicated by wmt_params.dlen
> in the cmd buffer is MTK_SEC_MAP_NEED_SEND_SIZE + 1. Except for the first
> byte, the remaining length is MTK_SEC_MAP_NEED_SEND_SIZE. memcpy copied one
> more byte to cmd + 1 than the remaining length. Align the length passed to
> memcpy to avoid exceeding current section map.
>
> Signed-off-by: Jiajia Liu <liujiajia@kylinos.cn>
> ---
>  drivers/bluetooth/btmtk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c
> index ea7a031000cd..53cba71cb07f 100644
> --- a/drivers/bluetooth/btmtk.c
> +++ b/drivers/bluetooth/btmtk.c
> @@ -188,7 +188,7 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,
>                                        MTK_FW_ROM_PATCH_GD_SIZE +
>                                        MTK_FW_ROM_PATCH_SEC_MAP_SIZE * i +
>                                        MTK_SEC_MAP_COMMON_SIZE,
> -                                      MTK_SEC_MAP_NEED_SEND_SIZE + 1);
> +                                      MTK_SEC_MAP_NEED_SEND_SIZE);
>
>                                 wmt_params.op = BTMTK_WMT_PATCH_DWNLD;
>                                 wmt_params.status = &status;
> --
> 2.53.0
>

Have you tested this on the actual hardware? If not we need a Tested-by.

-- 
Luiz Augusto von Dentz


^ permalink raw reply

* Re: [PATCH net-next v3 5/6] net: phy: Introduce Airoha AN8801/R Gigabit Ethernet PHY driver
From: Louis-Alexis Eyraud @ 2026-05-20 12:46 UTC (permalink / raw)
  To: Maxime Chevallier, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, AngeloGioacchino Del Regno, Andrew Lunn,
	Heiner Kallweit, Russell King
  Cc: kevin-kw.huang, macpaul.lin, matthias.bgg, kernel, netdev,
	devicetree, linux-arm-kernel, linux-mediatek, linux-kernel
In-Reply-To: <e77b4028-c201-4dd4-9214-721bdf67e976@bootlin.com>

Hi Maxime,

On Tue, 2026-05-12 at 12:06 +0200, Maxime Chevallier wrote:
> Hi :)
> 
> This looks good, I just have very minimal comments
> 
> On 5/12/26 06:33, Louis-Alexis Eyraud wrote:
> > From: AngeloGioacchino Del Regno
> > <angelogioacchino.delregno@collabora.com>
> > 
> > Introduce a driver for the Airoha AN8801R Series Gigabit Ethernet
> > PHY; this currently supports setting up PHY LEDs, 10/100M, 1000M
> > speeds, and Wake on LAN and PHY interrupts.
> > 
> > Signed-off-by: AngeloGioacchino Del Regno
> > <angelogioacchino.delregno@collabora.com>
> > Signed-off-by: Louis-Alexis Eyraud
> > <louisalexis.eyraud@collabora.com>
> 
> [...]
> 
> > +static u32 an8801r_led_blink_ms_to_hw(unsigned long req_ms)
> > +{
> > +	u32 req_ns, regval;
> > +
> > +	if (req_ms > AN8801_MAX_PERIOD_MS)
> > +		req_ms = AN8801_MAX_PERIOD_MS;
> > +
> > +	req_ns = req_ms * 1000000;
> 
> Use NSEC_PER_MSEC :)
I'll fix this in the next version.

> 
> > +
> > +	/* Round to the nearest period unit... */
> > +	regval = req_ns + (AN8801_PERIOD_UNIT / 2);
> > +
> > +	/* ...and now divide by the full period */
> > +	regval >>= AN8801_PERIOD_SHIFT;
> > +
> > +	return regval;
> > +}
> > +
> 
> [...]
> 
> > +static int an8801r_led_hw_control_set(struct phy_device *phydev,
> > u8 index,
> > +				      unsigned long rules)
> > +{
> > +	u16 on = 0, blink = 0;
> > +	int ret;
> > +
> > +	if (index >= AN8801R_NUM_LEDS)
> > +		return -EINVAL;
> > +
> > +	ret = an8801r_led_trig_to_hw(rules, &on, &blink);
> > +	if (ret)
> > +		return ret;
> > +
> > +	ret = phy_modify_mmd(phydev, MDIO_MMD_VEND2,
> > LED_ON_CTRL(index),
> > +			     LED_ON_EVT_MASK, on);
> > +	if (ret)
> > +		return ret;
> > +
> > +	ret = phy_modify_mmd(phydev, MDIO_MMD_VEND2,
> > LED_BLINK_CTRL(index),
> > +			     LED_BLINK_EVT_MASK, blink);
> > +
> > +	if (ret)
> > +		return ret;
> 
> Extra newline before the if()
I'll fix this in the next version too.

> 
> > +
> > +	return phy_modify_mmd(phydev, MDIO_MMD_VEND2,
> > LED_ON_CTRL(index),
> > +			      LED_ON_EN, on | blink ? LED_ON_EN :
> > 0);
> > +}
> > +
> 
> [...]
> 
> > +static int an8801r_rgmii_rxdelay(struct phy_device *phydev, bool
> > enable,
> > +				 u16 delay_steps)
> > +{
> > +	u32 reg_val;
> > +
> > +	if (delay_steps > RGMII_DELAY_STEP_MASK)
> > +		return -EINVAL;
> > +
> > +	if (enable) {
> > +		reg_val = delay_steps & RGMII_DELAY_STEP_MASK;
> > +
> > +		 /* Set align bit to add extra offset for RX delay
> > */
> > +		reg_val |= RGMII_RXDELAY_ALIGN;
> > +
> > +		 /* Set force mode bit to enable RX delay
> > insertion */
> > +		reg_val |= RGMII_RXDELAY_FORCE_MODE;
> > +	} else {
> > +		reg_val = 0;
> > +	}
> > +
> > +	return an8801_buckpbus_reg_write(phydev,
> > AN8801_BPBUS_REG_RXDLY_STEP,
> > +					 reg_val);
> > +}
> > +
> > +static int an8801r_rgmii_txdelay(struct phy_device *phydev, bool
> > enable,
> > +				 u16 delay_steps)
> > +{
> > +	u32 reg_val;
> > +
> > +	if (delay_steps > RGMII_DELAY_STEP_MASK)
> > +		return -EINVAL;
> > +
> > +	if (enable) {
> > +		reg_val = delay_steps & RGMII_DELAY_STEP_MASK;
> 
> Is this bitwise and needed, as you have the check above ?
Indeed, it is not needed, so I'll remove this masking operation here
and in an8801r_rgmii_rxdelay too.

> 
> > +
> > +		 /* Set force mode bit to enable TX delay
> > insertion */
> > +		reg_val |= RGMII_TXDELAY_FORCE_MODE;
> > +	} else {
> > +		reg_val = 0;
> > +	}
> > +
> > +	return an8801_buckpbus_reg_write(phydev,
> > AN8801_BPBUS_REG_TXDLY_STEP,
> > +					 reg_val);
> > +}
> > +
> > +static int an8801r_rgmii_delay_config(struct phy_device *phydev)
> > +{
> > +	bool enable_delay;
> > +	u16 delay_step;
> > +	int ret;
> > +
> > +	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
> > +	    phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) {
> > +		enable_delay = true;
> > +		delay_step = AN8801_RGMII_TXDELAY_DEFAULT;
> > +	} else {
> > +		enable_delay = false;
> > +		delay_step = RGMII_DELAY_NO_STEP;
> > +	}
> > +
> > +	ret = an8801r_rgmii_txdelay(phydev, enable_delay,
> > delay_step);
> > +	if (ret)
> > +		return ret;
> > +
> > +	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
> > +	    phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) {
> > +		enable_delay = true;
> > +		delay_step = AN8801_RGMII_RXDELAY_DEFAULT;
> 
> Is it correct that AN8801_RGMII_RXDELAY_DEFAULT expands to 
> RGMII_DELAY_NO_STEP ? feels strange, but it may simply be how the HW
> is 
> made :)
As I replied in an earlier comment ([1]), for the inserted RX delay,
when the RGMII_RXDELAY_ALIGN bit is set, the "no step" value is then
the closest setting to the 2ns value.

I'll improve the AN8801_RGMII_RXDELAY_DEFAULT comment to say that it
corresponds to the 1.992ns delay value when the align bit is set and -
0.008ns otherwise.

[1]:https://lore.kernel.org/linux-mediatek/199e674cfdbccad104db761964611b1d6352f9f3.camel@collabora.com/

Best regards,
Louis-Alexis
> 
> Thanks,
> 
> Maxime


^ permalink raw reply

* Re: [PATCH PARTIAL-RESEND v12 0/5] Add support MT6316/6363/MT6373 PMICs regulators and MFD
From: AngeloGioacchino Del Regno @ 2026-05-20 12:00 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-mediatek, lee, robh, krzk+dt, conor+dt, matthias.bgg,
	lgirdwood, devicetree, linux-kernel, linux-arm-kernel, kernel,
	wenst
In-Reply-To: <agKBkUBVM81Y6MUk@sirena.co.uk>

On 5/12/26 03:25, Mark Brown wrote:
> On Mon, May 11, 2026 at 12:13:50PM +0200, AngeloGioacchino Del Regno wrote:
>> Changes in v12:
>>   - This is a partial resend. MT6373 regulators and MFD patches were not picked.
>>   - Rebased over next-20260508
> 
> Is there a reason why this is a single patch series, are there any
> interdependencies here?

Just showing the full picture. Nothing else.

Btw, seen your feedback on the other patches, will fix as soon as I can - thanks!

Cheers,
Angelo


^ permalink raw reply

* Re: [PATCH PARTIAL-RESEND v12 0/5] Add support MT6316/6363/MT6373 PMICs regulators and MFD
From: AngeloGioacchino Del Regno @ 2026-05-20 12:00 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-mediatek, lee, robh, krzk+dt, conor+dt, matthias.bgg,
	lgirdwood, devicetree, linux-kernel, linux-arm-kernel, kernel,
	wenst
In-Reply-To: <agKBkUBVM81Y6MUk@sirena.co.uk>

On 5/12/26 03:25, Mark Brown wrote:
> On Mon, May 11, 2026 at 12:13:50PM +0200, AngeloGioacchino Del Regno wrote:
>> Changes in v12:
>>   - This is a partial resend. MT6373 regulators and MFD patches were not picked.
>>   - Rebased over next-20260508
> 
> Is there a reason why this is a single patch series, are there any
> interdependencies here?

Just showing the full picture. Nothing else.

Btw, seen your feedback on the other patches, will fix as soon as I can - thanks!

Cheers,
Angelo


^ permalink raw reply

* [PATCH v4 1/1] dt-bindings: remoteproc: mtk,scp: Allow multiple memory regions for MT8188
From: Arnab Layek @ 2026-05-20 11:26 UTC (permalink / raw)
  To: devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: robh, krzk+dt, conor+dt, matthias.bgg, angelogioacchino.delregno,
	andersson, mathieu.poirier, linux-remoteproc,
	Project_Global_Chrome_Upstream_Group, Arnab Layek
In-Reply-To: <20260520112629.3420612-1-arnab.layek@mediatek.com>

The MT8188 SCP can use either one or two reserved memory regions:
- Required: Main SCP SRAM memory region (mandatory for SCP operation)
- Optional: SCP L1TCM memory region (Level 1 Tightly Coupled Memory,
  used for performance optimization when available, but not required
  for basic SCP functionality)

Other MediaTek SoCs (MT8183, MT8186, MT8192, MT8195) use only a single
memory region and must remain restricted to one region for backward
compatibility.

Update the base schema to allow 1-2 memory regions (minItems: 1,
maxItems: 2), following the pattern used by other MediaTek dt-bindings
like mediatek,vcodec-encoder.yaml where the base property defines a
permissive range accommodating all device variants.

Add two conditionals:
1. Explicitly restrict non-MT8188 devices to maxItems: 1
2. Document MT8188's two regions with descriptions (minItems: 1 makes
   the L1TCM region optional, allowing boards to specify 1-2 regions
   based on hardware configuration)

This approach maintains backward compatibility while enabling MT8188 to
specify 1-2 memory regions depending on board design and performance
requirements.

Signed-off-by: Arnab Layek <arnab.layek@mediatek.com>
---
 .../bindings/remoteproc/mtk,scp.yaml          | 45 ++++++++++++++++++-
 1 file changed, 43 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml b/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml
index bdbb12118da4..fca9b0675eae 100644
--- a/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml
@@ -55,7 +55,8 @@ properties:
       initializing SCP.
 
   memory-region:
-    maxItems: 1
+    minItems: 1
+    maxItems: 2
 
   cros-ec-rpmsg:
     $ref: /schemas/embedded-controller/google,cros-ec.yaml
@@ -123,7 +124,8 @@ patternProperties:
           initializing sub cores of multi-core SCP.
 
       memory-region:
-        maxItems: 1
+        minItems: 1
+        maxItems: 2
 
       cros-ec-rpmsg:
         $ref: /schemas/embedded-controller/google,cros-ec.yaml
@@ -205,6 +207,45 @@ allOf:
           items:
             - const: cfg
             - const: l1tcm
+  - if:
+      properties:
+        compatible:
+          enum:
+            - mediatek,mt8183-scp
+            - mediatek,mt8186-scp
+            - mediatek,mt8192-scp
+            - mediatek,mt8195-scp
+            - mediatek,mt8195-scp-dual
+    then:
+      properties:
+        memory-region:
+          maxItems: 1
+      patternProperties:
+        "^scp@[a-f0-9]+$":
+          properties:
+            memory-region:
+              maxItems: 1
+  - if:
+      properties:
+        compatible:
+          enum:
+            - mediatek,mt8188-scp
+            - mediatek,mt8188-scp-dual
+    then:
+      properties:
+        memory-region:
+          minItems: 1
+          items:
+            - description: Main SCP SRAM memory region
+            - description: Optional SCP L1TCM memory region
+      patternProperties:
+        "^scp@[a-f0-9]+$":
+          properties:
+            memory-region:
+              minItems: 1
+              items:
+                - description: Main SCP SRAM memory region
+                - description: Optional SCP L1TCM memory region
 
 additionalProperties: false
 
-- 
2.45.2


^ permalink raw reply related

* [PATCH v4 0/1] dt-bindings: remoteproc: mtk,scp: Allow multiple memory regions for MT8188
From: Arnab Layek @ 2026-05-20 11:26 UTC (permalink / raw)
  To: devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: robh, krzk+dt, conor+dt, matthias.bgg, angelogioacchino.delregno,
	andersson, mathieu.poirier, linux-remoteproc,
	Project_Global_Chrome_Upstream_Group, Arnab Layek

This patch updates the mtk,scp dt-binding schema to support MT8188's
requirement for 1-2 memory regions while maintaining strict backward
compatibility for other MediaTek SoCs.

The MT8188 SCP requires a main SRAM region and optionally supports an
L1TCM (Level 1 Tightly Coupled Memory) region for performance
optimization. L1TCM is optional because basic SCP functionality works
with only SRAM, but L1TCM provides faster memory access when the board
hardware configuration includes it.

The base schema uses minItems: 1, maxItems: 2 (permissive range),
following the pattern established in other MediaTek dt-bindings like
mediatek,vcodec-encoder.yaml where the base accommodates all variants.
Conditionals then narrow the constraints per device.

Changes in v4:
- Improved commit message clarity per kernel submission guidelines:
  * Added bullet-point explanation of the two memory regions
  * Explained WHY L1TCM is optional (performance optimization, not
    required for basic functionality)
  * Explicitly listed which SoCs remain single-region
  * Clarified the two-conditional approach
  * Explained how minItems: 1 allows board-specific configuration
- Cover letter updated to explain L1TCM optional reasoning

Changes in v3:
- Removed "Tested on..." line (bindings cannot be tested)
- Added minItems: 1 to MT8188 conditional to make L1TCM truly optional
- Referenced mediatek,vcodec-encoder.yaml iommus pattern explicitly
- Base schema: minItems: 1, maxItems: 2 (permissive range)
- Non-MT8188: explicitly restricted to maxItems: 1
- MT8188: documented with item descriptions for both regions

Changes in v2:
- Added conditional schema for MT8188 to allow 1-2 memory regions
- Added descriptions for each memory region
- Did not work: base maxItems: 1 conflicted with conditional

Arnab Layek (1):
  dt-bindings: remoteproc: mtk,scp: Allow multiple memory regions for
    MT8188

 .../bindings/remoteproc/mtk,scp.yaml          | 45 ++++++++++++++++++-
 1 file changed, 43 insertions(+), 2 deletions(-)

-- 
2.45.2


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox