Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3473762pxv; Sun, 4 Jul 2021 20:44:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJp3LpUjIM22c2055xUeVPiWTfgqTXyyAwQ37NqhFEoQwmxfTsNrQsjbdCurcqeBCnmYJG X-Received: by 2002:a17:906:179b:: with SMTP id t27mr11193941eje.70.1625456663327; Sun, 04 Jul 2021 20:44:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625456663; cv=none; d=google.com; s=arc-20160816; b=BRUpuk71tPD/pAydPjNtkTfvLE7HuJCk7D/3bMz16uhrhYGmQzeUzozglXiNYTGTwn lSFlRPGlQFnTzUTUsu3K3JS4jpuGkru0pHwThEwWJyaE0sxD6MrgLxBlZZm7MNknrkkW zZh2eMkDW0XbTburl8E85svTQ6F/+3M1QFPuB7+VLJOylYqtClMrqug+nIumyrbL8T3K 0Zafb3ixMBSz5J3SkJftelhqHT8QvJ7guUWJcg37y/fRPZZtAqWhBBsU1fL4sDKfsjbR F5iOvZyXeTNFqY7ENhOprQ1uWNUk4Wfy6/sh7Wzuy1bwQQMOZw/4QTmaF6KbVIt5l8gB QBJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=AGESLfBfmbJI1tFX1IHqVLOytcITdUOBZCuI4DiYhAw=; b=Hwyd58IHvHAOBLNw3QsS9NCmxJpDymHbZilYM9fgowE32Aie/dfRXvJKiCIn9z4V7m //UNJQb595w8YkA2kWRoWAuV9aXWfbr1qm9eD8cg/lLlpp7uscPyVZa/jJxvS+zkbkCU VxSDnJbsYpX5u4pe9WI5DUI4ncCFjzXzo3AcsJgKXGdYn4MITJCAlcMHjX/IRm0ymtbq okGKaoaEoQ+xcXINiZ606K3IwPXRldk/PreNXLAj1Dkr2livhDNpcb6D/y0ojSUlsWsp yJ96Hnl6dcGKu8NtSGSoUiUvImoJd96sygTTb8CzmsoLWTm7IUSi14XrnJd/07vdLF4T hGwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d10si10584182ejl.468.2021.07.04.20.44.01; Sun, 04 Jul 2021 20:44:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229770AbhGEDov (ORCPT + 99 others); Sun, 4 Jul 2021 23:44:51 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:47683 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S230106AbhGEDot (ORCPT ); Sun, 4 Jul 2021 23:44:49 -0400 X-UUID: 406cb5585223402abdfa53873e597510-20210705 X-UUID: 406cb5585223402abdfa53873e597510-20210705 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1453046887; Mon, 05 Jul 2021 11:42:09 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 5 Jul 2021 11:42:07 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 5 Jul 2021 11:42:07 +0800 From: Chun-Jie Chen To: Matthias Brugger , Stephen Boyd , Nicolas Boichat , Rob Herring CC: , , , , , , , Weiyi Lu , Chun-Jie Chen Subject: [v12 15/20] clk: mediatek: Add MT8192 mfgcfg clock support Date: Mon, 5 Jul 2021 11:38:19 +0800 Message-ID: <20210705033824.1934-16-chun-jie.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210705033824.1934-1-chun-jie.chen@mediatek.com> References: <20210705033824.1934-1-chun-jie.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add MT8192 mfgcfg clock provider Signed-off-by: Weiyi Lu Signed-off-by: Chun-Jie Chen --- drivers/clk/mediatek/Kconfig | 6 ++++ drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192-mfg.c | 50 +++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192-mfg.c diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig index 59104b8cd7dc..e212f3416855 100644 --- a/drivers/clk/mediatek/Kconfig +++ b/drivers/clk/mediatek/Kconfig @@ -544,6 +544,12 @@ config COMMON_CLK_MT8192_MDPSYS help This driver supports MediaTek MT8192 mdpsys clocks. +config COMMON_CLK_MT8192_MFGCFG + bool "Clock driver for MediaTek MT8192 mfgcfg" + depends on COMMON_CLK_MT8192 + help + This driver supports MediaTek MT8192 mfgcfg clocks. + config COMMON_CLK_MT8516 bool "Clock driver for MediaTek MT8516" depends on ARCH_MEDIATEK || COMPILE_TEST diff --git a/drivers/clk/mediatek/Makefile b/drivers/clk/mediatek/Makefile index 7b258cb1f914..024841a79f1c 100644 --- a/drivers/clk/mediatek/Makefile +++ b/drivers/clk/mediatek/Makefile @@ -74,5 +74,6 @@ obj-$(CONFIG_COMMON_CLK_MT8192_IMGSYS) += clk-mt8192-img.o obj-$(CONFIG_COMMON_CLK_MT8192_IMP_IIC_WRAP) += clk-mt8192-imp_iic_wrap.o obj-$(CONFIG_COMMON_CLK_MT8192_IPESYS) += clk-mt8192-ipe.o obj-$(CONFIG_COMMON_CLK_MT8192_MDPSYS) += clk-mt8192-mdp.o +obj-$(CONFIG_COMMON_CLK_MT8192_MFGCFG) += clk-mt8192-mfg.o obj-$(CONFIG_COMMON_CLK_MT8516) += clk-mt8516.o obj-$(CONFIG_COMMON_CLK_MT8516_AUDSYS) += clk-mt8516-aud.o diff --git a/drivers/clk/mediatek/clk-mt8192-mfg.c b/drivers/clk/mediatek/clk-mt8192-mfg.c new file mode 100644 index 000000000000..3bbc7469f0e4 --- /dev/null +++ b/drivers/clk/mediatek/clk-mt8192-mfg.c @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: GPL-2.0-only +// +// Copyright (c) 2021 MediaTek Inc. +// Author: Chun-Jie Chen + +#include +#include +#include + +#include "clk-mtk.h" +#include "clk-gate.h" + +#include + +static const struct mtk_gate_regs mfg_cg_regs = { + .set_ofs = 0x4, + .clr_ofs = 0x8, + .sta_ofs = 0x0, +}; + +#define GATE_MFG(_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &mfg_cg_regs, _shift, &mtk_clk_gate_ops_setclr) + +static const struct mtk_gate mfg_clks[] = { + GATE_MFG(CLK_MFG_BG3D, "mfg_bg3d", "mfg_pll_sel", 0), +}; + +static const struct mtk_clk_desc mfg_desc = { + .clks = mfg_clks, + .num_clks = ARRAY_SIZE(mfg_clks), +}; + +static const struct of_device_id of_match_clk_mt8192_mfg[] = { + { + .compatible = "mediatek,mt8192-mfgcfg", + .data = &mfg_desc, + }, { + /* sentinel */ + } +}; + +static struct platform_driver clk_mt8192_mfg_drv = { + .probe = mtk_clk_simple_probe, + .driver = { + .name = "clk-mt8192-mfg", + .of_match_table = of_match_clk_mt8192_mfg, + }, +}; + +builtin_platform_driver(clk_mt8192_mfg_drv); -- 2.18.0