Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1375306pxb; Fri, 20 Aug 2021 04:19:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgPHMCW9/ZQS0U5wKeiuO9Fbub/M7j/OfHNI+rCLRndgNoMXc/qnxzODErwYULiBJ0Q7Ik X-Received: by 2002:a5d:9bcf:: with SMTP id d15mr15408042ion.88.1629458346311; Fri, 20 Aug 2021 04:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629458346; cv=none; d=google.com; s=arc-20160816; b=kdLpDH/LTZXnYUuU6hY11B0aIsS0bD26hDywUwfDj2QpBMqN4bGMs5fyzDyJgto+xQ 1X6uWJ7jk44EUWahwLxI9Qn8MG+2b3/+/1LrUWnW8VN8PhNdy66GjJtDFzedOxUA8nAO u+w44WKKuSRlRTh8C7zQllUJ74lNwl5RiNtCBMfSgd7W8JMy0LJZsC5IHdSI2DMA8iDw CYEBy2adVdszgjmdbt+tDQmPmclU3l7OM3oTkUePa8apXt/oxi8c9Ou8x5CruKcw8s+P SsnXX/aL17+tLb7CEyvKtg8JxkysHUry/pDsqNUl4uFadu1Q2dWCFfouhosw8fgbsDks DALg== 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=+gLd26tP5qLSVxCpUoUpOJy44P9gnys6ykT8RE/lIEU=; b=Q3536hTeY9KIaBDPl+v/Tlk5QyYelgBniovWESy5c3s5EitG4jheiSJtGS5oiD04jc ytv9Rgh+NHhbyP2pYYnGLmzG4pm9vPRZDLGTsYG1rWPzJNUPtZod2nW4cxN6kCwzI5Jd xnJx4MH8yFXNf1TTHRofGOjYtDvwVR+E9XswW2E5RabU2qcdOrIOcShmMF4qImWhBpJG VKu3Cx4HLAm12imFHCimXER3a5HV9+hpKFxmkRdzBksljkAuiYaCEzI7i3ngRvNTwi1Z oMcM8ipBsfaGZy4j9fFBbrNbJ7beq2jNAL+aC5YyPkGAD/D+abZ3OschYOt2JP6Guupo 13eg== 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 p19si7733587iov.90.2021.08.20.04.18.55; Fri, 20 Aug 2021 04:19:06 -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 S239449AbhHTLS2 (ORCPT + 99 others); Fri, 20 Aug 2021 07:18:28 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:40798 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S237651AbhHTLSQ (ORCPT ); Fri, 20 Aug 2021 07:18:16 -0400 X-UUID: 2e28d6b359604502b5152977516d5658-20210820 X-UUID: 2e28d6b359604502b5152977516d5658-20210820 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 2145165344; Fri, 20 Aug 2021 19:17:34 +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; Fri, 20 Aug 2021 19:17: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; Fri, 20 Aug 2021 19:17:32 +0800 From: Chun-Jie Chen To: Matthias Brugger , Stephen Boyd , Nicolas Boichat , Rob Herring CC: , , , , , , , Chun-Jie Chen Subject: [v2 15/24] clk: mediatek: Add MT8195 scp adsp clock support Date: Fri, 20 Aug 2021 19:14:55 +0800 Message-ID: <20210820111504.350-16-chun-jie.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210820111504.350-1-chun-jie.chen@mediatek.com> References: <20210820111504.350-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 scp adsp clock controller which provides clock gate control for Audio DSP. Signed-off-by: Chun-Jie Chen --- drivers/clk/mediatek/Makefile | 2 +- drivers/clk/mediatek/clk-mt8195-scp_adsp.c | 47 ++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 drivers/clk/mediatek/clk-mt8195-scp_adsp.c diff --git a/drivers/clk/mediatek/Makefile b/drivers/clk/mediatek/Makefile index 042db433245a..472e5bc40fcb 100644 --- a/drivers/clk/mediatek/Makefile +++ b/drivers/clk/mediatek/Makefile @@ -81,6 +81,6 @@ obj-$(CONFIG_COMMON_CLK_MT8192_SCP_ADSP) += clk-mt8192-scp_adsp.o obj-$(CONFIG_COMMON_CLK_MT8192_VDECSYS) += clk-mt8192-vdec.o obj-$(CONFIG_COMMON_CLK_MT8192_VENCSYS) += clk-mt8192-venc.o obj-$(CONFIG_COMMON_CLK_MT8195) += clk-mt8195-apmixedsys.o clk-mt8195-topckgen.o clk-mt8195-peri_ao.o clk-mt8195-infra_ao.o clk-mt8195-cam.o \ - clk-mt8195-ccu.o clk-mt8195-img.o clk-mt8195-ipe.o clk-mt8195-mfg.o + clk-mt8195-ccu.o clk-mt8195-img.o clk-mt8195-ipe.o clk-mt8195-mfg.o clk-mt8195-scp_adsp.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-scp_adsp.c b/drivers/clk/mediatek/clk-mt8195-scp_adsp.c new file mode 100644 index 000000000000..cd0b9f0f0192 --- /dev/null +++ b/drivers/clk/mediatek/clk-mt8195-scp_adsp.c @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +// +// Copyright (c) 2021 MediaTek Inc. +// Author: Chun-Jie Chen + +#include "clk-gate.h" +#include "clk-mtk.h" + +#include +#include +#include + +static const struct mtk_gate_regs scp_adsp_cg_regs = { + .set_ofs = 0x180, + .clr_ofs = 0x180, + .sta_ofs = 0x180, +}; + +#define GATE_SCP_ADSP(_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &scp_adsp_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr) + +static const struct mtk_gate scp_adsp_clks[] = { + GATE_SCP_ADSP(CLK_SCP_ADSP_AUDIODSP, "scp_adsp_audiodsp", "top_adsp", 0), +}; + +static const struct mtk_clk_desc scp_adsp_desc = { + .clks = scp_adsp_clks, + .num_clks = ARRAY_SIZE(scp_adsp_clks), +}; + +static const struct of_device_id of_match_clk_mt8195_scp_adsp[] = { + { + .compatible = "mediatek,mt8195-scp_adsp", + .data = &scp_adsp_desc, + }, { + /* sentinel */ + } +}; + +static struct platform_driver clk_mt8195_scp_adsp_drv = { + .probe = mtk_clk_simple_probe, + .driver = { + .name = "clk-mt8195-scp_adsp", + .of_match_table = of_match_clk_mt8195_scp_adsp, + }, +}; +builtin_platform_driver(clk_mt8195_scp_adsp_drv); -- 2.18.0