[PATCH 03/12] power: domain: mediatek: remove enum scp_domain_type

David Lechner dlechner at baylibre.com
Wed Jul 8 23:00:23 CEST 2026


On 7/8/26 8:07 AM, Julien Stephan wrote:
> The driver mapped each compatible to an enum scp_domain_type via the
> match data, then used mtk_power_domain_hook() to switch on that enum
> and select the per-SoC domain table. This forces every new SoC to add
> an enum value and a switch case in shared code.
> 
> Store a pointer to the per-SoC table directly in the match data and
> drop the enum, the type field, and mtk_power_domain_hook(). This keeps
> per-SoC information in the match data where it belongs, making it
> possible to later split the SoC-specific tables into standalone drivers.
> 
> No functional change intended.
> 

...

> @@ -379,15 +349,15 @@ static int mtk_power_domain_probe(struct udevice *dev)
>  static const struct udevice_id mtk_power_domain_ids[] = {
>  	{
>  		.compatible = "mediatek,mt7622-scpsys",
> -		.data = SCPSYS_MT7622,
> +		.data = (ulong)&scp_domain_mt7629,
>  	},
>  	{
>  		.compatible = "mediatek,mt7623-scpsys",
> -		.data = SCPSYS_MT7623,
> +		.data = (ulong)&scp_domain_mt7623,
>  	},
>  	{
>  		.compatible = "mediatek,mt7629-scpsys",
> -		.data = SCPSYS_MT7629,
> +		.data = (ulong)&scp_domain_mt7629,
>  	},
>  	{ /* sentinel */ }
>  };
> 

In upstream DT bindings, "mediatek,mt7629-scpsys" has fallback to
"mediatek,mt7622-scpsys" compatible. So scp_domain_mt7629 should really
be named scp_domain_mt7622. And we can drop the last entry with
.compatible = "mediatek,mt7629-scpsys" and just let the fallback
be used.


More information about the U-Boot mailing list