Re: [PATCH v2 37/47] clk: mediatek: Split MT8195 clock drivers and allow module build

From: Chen-Yu Tsai
Date: Thu Feb 16 2023 - 23:31:41 EST


On Tue, Feb 14, 2023 at 9:42 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@xxxxxxxxxxxxx> wrote:
>
> MT8195 clock drivers were encapsulated in one single (and big) Kconfig
> option: there's no reason to do that, as it is totally unnecessary to
> build in all or none of them.
>
> Split them out: keep boot-critical clocks as bool and allow choosing
> non critical clocks as tristate.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
> ---
> drivers/clk/mediatek/Kconfig | 86 +++++++++++++++++++++++++++++++++++
> drivers/clk/mediatek/Makefile | 20 +++++---
> 2 files changed, 99 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig
> index 45b7aea7648d..88937d111e98 100644
> --- a/drivers/clk/mediatek/Kconfig
> +++ b/drivers/clk/mediatek/Kconfig
> @@ -692,6 +692,92 @@ config COMMON_CLK_MT8195
> help
> This driver supports MediaTek MT8195 clocks.
>
> +config COMMON_CLK_MT8195_APUSYS
> + tristate "Clock driver for MediaTek MT8195 apusys"
> + depends on COMMON_CLK_MT8195

Would something like

default COMMON_CLK_MT8195

help with the transition?

Otherwise we'd need to add a whole lot more stuff to arm64's defconfig,
and anyone running `make olddefconfig` would have many of their clock
drivers no longer available.

Same applies to the MT8186 split.

Seems like not all MediaTek SoCs apply this pattern, but at least MT7986,
MT8167, MT8173, MT8183 do this.

ChenYu