Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp34503pxj; Wed, 16 Jun 2021 19:31:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIOoXqz78lJoUsn/LdOgZOI4k6Z9LZB6N322jBIyOmAu4BSWqb9jTdEFulQqj7XAjJ8D5v X-Received: by 2002:a02:9109:: with SMTP id a9mr2252027jag.93.1623897109271; Wed, 16 Jun 2021 19:31:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623897109; cv=none; d=google.com; s=arc-20160816; b=pT4aKq5ssqW8oD39V+hQshG3+rkEDKOOL1NipNCMylOnwDwEsm+RSm/vKMxBS84B1W tFRKWjfrLqeWh6N6/iOveQC4xJX/De9dlUNAXdIpCQ1aaC7TPtnhbhg4ezmkx+jS1MFw R4pksUtWBhhhtce7pLt2l10dVqBjuWo3YgPZ5dB8Ozq3rPLdDzg35SuP53Z1dupVKdaD 9fhXBZEHZ5rq2o0qhHProFjEvSO9rkuKB/qBurUW5ZvCJyUp5tNtd61wqNBOfMeJy3Sx zTQH9UV9rq8x+PWguM455C8gDOgHuDk9Sb73iOB3t4aWKxUVadoBYWFdaepyEm1SDfN1 BLyg== 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=2yhsjHwmR0epj5lR5xjOjVxWzbt+o7SUrr7b8B6Vvd0=; b=vAsvIUV/G6PTY747xk7/N/Q8F1JCTi7u5Q9w0R4Cbqtde2noPzZx1c84p99XM6mCm6 fm5bnmZzBh7Vf98XkCT8RDdqofB/T8VCnq9DYpJ1FyTSZYI2Znxn2WhisR9iaZ1zMYTB LMWsZ4xx3zEFmtjZ4g8YGnpTzZFN4aADqmQonPdM/05eOpRFcSIG4HJgzvBO7CJnEVaX yh+/lDnwoom8uE9/5j6F+P7J3wFUlH+o4C/gkLyBg7gDvn3Fqklfuw2jfUUPCr1grxt0 H7TCMbFL5ztIQAFjlq3ZhPlcitQwWkKscIdQbfsQ6qRs9QGN7sEZGm0AWkn0FUfFzFph /pCg== 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 q4si4506192jas.57.2021.06.16.19.31.37; Wed, 16 Jun 2021 19:31:49 -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 S234334AbhFPWwI (ORCPT + 99 others); Wed, 16 Jun 2021 18:52:08 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:51927 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S234323AbhFPWwG (ORCPT ); Wed, 16 Jun 2021 18:52:06 -0400 X-UUID: d68062027c904beb959d769a2dda99bb-20210617 X-UUID: d68062027c904beb959d769a2dda99bb-20210617 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1614609257; Thu, 17 Jun 2021 06:49:55 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 17 Jun 2021 06:49:54 +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; Thu, 17 Jun 2021 06:49:54 +0800 From: Chun-Jie Chen To: Matthias Brugger , Stephen Boyd , Nicolas Boichat , Rob Herring CC: , , , , , , , Chun-Jie Chen Subject: [PATCH 10/22] clk: mediatek: Add MT8195 ipesys clock support Date: Thu, 17 Jun 2021 06:47:31 +0800 Message-ID: <20210616224743.5109-11-chun-jie.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210616224743.5109-1-chun-jie.chen@mediatek.com> References: <20210616224743.5109-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 MT8195 ipesys clock provider Signed-off-by: Chun-Jie Chen --- drivers/clk/mediatek/Kconfig | 6 +++ drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8195-ipe.c | 53 +++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8195-ipe.c diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig index f92d0b6b7eec..ef7d4b433eee 100644 --- a/drivers/clk/mediatek/Kconfig +++ b/drivers/clk/mediatek/Kconfig @@ -618,6 +618,12 @@ config COMMON_CLK_MT8195_IMGSYS help This driver supports MediaTek MT8195 imgsys clocks. +config COMMON_CLK_MT8195_IPESYS + bool "Clock driver for MediaTek MT8195 ipesys" + depends on COMMON_CLK_MT8195 + help + This driver supports MediaTek MT8195 ipesys 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 1768eda917c2..991a9be7ac46 100644 --- a/drivers/clk/mediatek/Makefile +++ b/drivers/clk/mediatek/Makefile @@ -86,5 +86,6 @@ obj-$(CONFIG_COMMON_CLK_MT8195_AUDSYS_SRC) += clk-mt8195-aud_src.o obj-$(CONFIG_COMMON_CLK_MT8195_CAMSYS) += clk-mt8195-cam.o obj-$(CONFIG_COMMON_CLK_MT8195_CCUSYS) += clk-mt8195-ccu.o obj-$(CONFIG_COMMON_CLK_MT8195_IMGSYS) += clk-mt8195-img.o +obj-$(CONFIG_COMMON_CLK_MT8195_IPESYS) += clk-mt8195-ipe.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-mt8195-ipe.c b/drivers/clk/mediatek/clk-mt8195-ipe.c new file mode 100644 index 000000000000..d63d7448591a --- /dev/null +++ b/drivers/clk/mediatek/clk-mt8195-ipe.c @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0-only +// +// Copyright (c) 2021 MediaTek Inc. +// Author: Chun-Jie Chen + +#include +#include + +#include "clk-mtk.h" +#include "clk-gate.h" + +#include + +static const struct mtk_gate_regs ipe_cg_regs = { + .set_ofs = 0x0, + .clr_ofs = 0x0, + .sta_ofs = 0x0, +}; + +#define GATE_IPE(_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &ipe_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr) + +static const struct mtk_gate ipe_clks[] = { + GATE_IPE(CLK_IPE_DPE, "ipe_dpe", "ipe_sel", 0), + GATE_IPE(CLK_IPE_FDVT, "ipe_fdvt", "ipe_sel", 1), + GATE_IPE(CLK_IPE_ME, "ipe_me", "ipe_sel", 2), + GATE_IPE(CLK_IPE_TOP, "ipe_top", "ipe_sel", 3), + GATE_IPE(CLK_IPE_SMI_LARB12, "ipe_smi_larb12", "ipe_sel", 4), +}; + +static const struct mtk_clk_desc ipe_desc = { + .clks = ipe_clks, + .num_clks = ARRAY_SIZE(ipe_clks), +}; + +static const struct of_device_id of_match_clk_mt8195_ipe[] = { + { + .compatible = "mediatek,mt8195-ipesys", + .data = &ipe_desc, + }, { + /* sentinel */ + } +}; + +static struct platform_driver clk_mt8195_ipe_drv = { + .probe = mtk_clk_simple_probe, + .driver = { + .name = "clk-mt8195-ipe", + .of_match_table = of_match_clk_mt8195_ipe, + }, +}; + +builtin_platform_driver(clk_mt8195_ipe_drv); -- 2.18.0