Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4182695pxj; Tue, 15 Jun 2021 17:41:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyj3ZXquAVPkkhsU5sISgE7mbyRuqIcHW0BIqsHKZJTD7juIsSo+IUIlXmvrwFkXbSavoR9 X-Received: by 2002:a92:da4f:: with SMTP id p15mr1594070ilq.200.1623804092913; Tue, 15 Jun 2021 17:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623804092; cv=none; d=google.com; s=arc-20160816; b=EQUIy29UTVv5gJsAC+Ooio7bXN1pk+7tY7a6UFKPTJ6bBe5fKNY2bPQB2gDNZk7naN 7w77EfzNsflZmMHyeeoHKoKf4AEBMYsriIT5SKyNEPAJ/X2YiOCrIuJsPAcnjOeTkZeE 94Sg+Zza7W9l7bcxhbcLhjB3KR+hOZfVzjW1JJeSb/KCBq34sTrKrTFU3Sz9Ggsdp6V1 CawwmI2PiUsBnwBocWgqxCARcDHF3O+aEXl8BppSdu4n2sZnzmugePaNBMNntAMqVC4O xD8S+X+EflX625j79W4V+INdcEKrNmxCDYivRp3/3gHiUPX5XGCUaIcS1DPldVU3pNmy JftA== 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=rMMxD4FBCDlhawLhX2W9ayny7xFXjHgDQmc8wKVAWJ/9GuCwm3ZX9QDoTVsulGRym7 /FDSZIWUfM1Q5D45k5J3orxMKRMRk3sOhp2aH+elb/Fw5dv3Yy033sMoG1dUN1PZzkm2 0koXbXU3/93TSvF69aylMFwqp1D2RxOY1xQrwejp23+d/zYKtlbT1YGjUkybAtKQjlj2 5jXjfHLPYWIfTK5Nm1aG+Yy/AL7xQspOIncO0D50Mm0nju8ttThrqI2MlOsY/XS2PtlF f4PnIslmrptBxvwEQnSAm+APDVwyX8p7Z/BWYOXOUuDAZrbJSeIWH/lrM+8elzoYnrk/ o6NQ== 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 b11si670560ilv.25.2021.06.15.17.41.21; Tue, 15 Jun 2021 17:41:32 -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 S231886AbhFPAla (ORCPT + 99 others); Tue, 15 Jun 2021 20:41:30 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:54922 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S231754AbhFPAla (ORCPT ); Tue, 15 Jun 2021 20:41:30 -0400 X-UUID: 310e31df042946688fbf7b7162ec1492-20210616 X-UUID: 310e31df042946688fbf7b7162ec1492-20210616 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 627663931; Wed, 16 Jun 2021 08:39:20 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 16 Jun 2021 08:39:19 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 16 Jun 2021 08:39:19 +0800 From: Chun-Jie Chen To: Matthias Brugger , Stephen Boyd , Nicolas Boichat , Rob Herring CC: , , , , , , , Weiyi Lu , Chun-Jie Chen Subject: [PATCH v10 14/19] clk: mediatek: Add MT8192 mfgcfg clock support Date: Wed, 16 Jun 2021 08:36:38 +0800 Message-ID: <20210616003643.28648-15-chun-jie.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210616003643.28648-1-chun-jie.chen@mediatek.com> References: <20210616003643.28648-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