Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp324068pxv; Wed, 30 Jun 2021 06:32:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPpsKuxnfjStPdCy5RyyYX+KjT2/ei9Tn8gDTZQQq/MfJWC/irw65tELeLAka71QyvSBGn X-Received: by 2002:a05:6602:188:: with SMTP id m8mr7729106ioo.201.1625059942600; Wed, 30 Jun 2021 06:32:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625059942; cv=none; d=google.com; s=arc-20160816; b=ocsQpnWV28qH343pR7AtFa3MFWwBxhneoHCG9hsrkb7Dhp8wm8NaDQ74lm8u7YArFL EmheH4pMQXQEoJVUU0wtN4ym8gHY7aaR9/0oSE0EOLT1bhoE/mLZFzNj/Vbmqg69SGTY QGyi8wkPlYXHDOmPNZOxtNVhrQ9wI9oW6DQh6IDawFK5J10tOUdskAZkl6CFSGYB0cE3 wXYwt9/LtuRchLNallJ3e97Za6clz/JjVXRsBrb7aGfTmoLfk9NYvAyg4L+X0DwAzZSV 11v/BjaCWqwNoDGVj2zG/8Iz2UXsqqzO7/VSQuuT9vQ9nd/zFfIL2vfdRMVASh1mcl9S CI+g== 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=C6ahjArHAjIhEc+vrotE4EemTxQLtfv6PVXyb7OkB+H67ft/qaskzu4pGHZrapibpa xXsepPrqOjuk3yEKKx6+9Ph2/DgHpNlKpbZU3StRrc/sNw5blSGMp2ejQtlo2O1FpWa6 2b/mcc48ytU1rFYskyLTVgwZWrN1rvPtD0cgKbPC7Ryjw7agc9PItBbk9RpKVxQ15/KX nTK+cjKdIsXkNQx3WSuIuWdeq1StPoOLi92JAwj0ij/YB3j1r4u7g4eOPnVKqe7i7xPk yKa6ObseVWuoOFklQahDB9/IgnEHYh8+iP39ck9O2rIf4nimvPLLvnJz6dcV6oiMhyvk obBg== 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 m25si23543108ioo.79.2021.06.30.06.32.10; Wed, 30 Jun 2021 06:32:22 -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 S235082AbhF3NdM (ORCPT + 99 others); Wed, 30 Jun 2021 09:33:12 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:56118 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S235088AbhF3NdH (ORCPT ); Wed, 30 Jun 2021 09:33:07 -0400 X-UUID: a633b6302cb14860a140f77d7646db33-20210630 X-UUID: a633b6302cb14860a140f77d7646db33-20210630 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 273443525; Wed, 30 Jun 2021 21:30:35 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 30 Jun 2021 21:30:33 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 30 Jun 2021 21:30:33 +0800 From: Chun-Jie Chen To: Matthias Brugger , Stephen Boyd , Nicolas Boichat , Rob Herring CC: , , , , , , , Weiyi Lu , Chun-Jie Chen Subject: [v11 14/19] clk: mediatek: Add MT8192 mfgcfg clock support Date: Wed, 30 Jun 2021 21:27:59 +0800 Message-ID: <20210630132804.20436-15-chun-jie.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210630132804.20436-1-chun-jie.chen@mediatek.com> References: <20210630132804.20436-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