From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2636BC433FE for ; Fri, 21 Oct 2022 08:41:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230262AbiJUIlf (ORCPT ); Fri, 21 Oct 2022 04:41:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230026AbiJUIl2 (ORCPT ); Fri, 21 Oct 2022 04:41:28 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C894E24E3AC; Fri, 21 Oct 2022 01:41:25 -0700 (PDT) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 0650C6602532; Fri, 21 Oct 2022 09:41:22 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1666341684; bh=ixtnbYZsDUAjtbOO7dcijDfW674zD9cWoD0xTEe/SQM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=kc/Lz34lDvuXmaLXjA3lWGJ1XXjh4KahLHgw6Qg/eLQirT6/VFA4+qENEKQ7CzHy+ DmXe8REyjQXW/J/shRxV7ntpiMvf40yTWmDvhOGP49l07EVv1V9xVbD5CtvC4Fr+8+ j+SY7b+/ASlzPr5OeyBZQnj8sPNUS9MSJi01jQ9e/w16v8iwmh7qPFcxuuBmmW6rH6 Dez4lLPN8acWboG/QPuQEWT6bdT7nf+CLJqeMTR3bXacgU/Ce6+GVT5g82xjebCRwM Ko7r8wwIxC82TrWt2nu1N+IdE5ecKXmGIrF9h8gWae4RRf5v2w0VmUsW+3DqQtGvFH eiCJl0ACY4RFw== Message-ID: Date: Fri, 21 Oct 2022 10:41:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v2 03/12] ASoC: mediatek: mt8188: support audsys clock Content-Language: en-US To: Trevor Wu , broonie@kernel.org, tiwai@suse.com, robh+dt@kernel.org, matthias.bgg@gmail.com, p.zabel@pengutronix.de Cc: Project_Global_Chrome_Upstream_Group@mediatek.com, alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20221021082719.18325-1-trevor.wu@mediatek.com> <20221021082719.18325-4-trevor.wu@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20221021082719.18325-4-trevor.wu@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 21/10/22 10:27, Trevor Wu ha scritto: > Add mt8188 audio cg clock control. Audio clock gates are registered to CCF > for reference count and clock parent management. > > Signed-off-by: Trevor Wu > --- > sound/soc/mediatek/mt8188/mt8188-audsys-clk.c | 206 ++++++++++++++++++ > sound/soc/mediatek/mt8188/mt8188-audsys-clk.h | 15 ++ > .../soc/mediatek/mt8188/mt8188-audsys-clkid.h | 83 +++++++ > 3 files changed, 304 insertions(+) > create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clk.c > create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clk.h > create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clkid.h > > diff --git a/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c b/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c > new file mode 100644 > index 000000000000..1f294231d4c2 > --- /dev/null > +++ b/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c > @@ -0,0 +1,206 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * mt8188-audsys-clk.c -- MediaTek 8188 audsys clock control > + * > + * Copyright (c) 2022 MediaTek Inc. > + * Author: Chun-Chia Chiu > + */ > + > +#include > +#include > +#include > +#include "mt8188-afe-common.h" > +#include "mt8188-audsys-clk.h" > +#include "mt8188-audsys-clkid.h" > +#include "mt8188-reg.h" > + > +struct afe_gate { > + int id; > + const char *name; > + const char *parent_name; > + int reg; > + u8 bit; > + const struct clk_ops *ops; > + unsigned long flags; > + u8 cg_flags; > +}; > + > +#define GATE_AFE_FLAGS(_id, _name, _parent, _reg, _bit, _flags, _cgflags) {\ > + .id = _id, \ > + .name = _name, \ > + .parent_name = _parent, \ > + .reg = _reg, \ > + .bit = _bit, \ > + .flags = _flags, \ > + .cg_flags = _cgflags, \ > + } > + > +#define GATE_AFE(_id, _name, _parent, _reg, _bit) \ > + GATE_AFE_FLAGS(_id, _name, _parent, _reg, _bit, \ > + CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, CLK_GATE_SET_TO_DISABLE) Can you please explain what's the reason for CLK_IGNORE_UNUSED here? Maybe we can solve some issue that you're facing in a cleaner way. Regards, Angelo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 36B39C433FE for ; Fri, 21 Oct 2022 08:43:12 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4126C2F56; Fri, 21 Oct 2022 10:42:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4126C2F56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1666341790; bh=ixtnbYZsDUAjtbOO7dcijDfW674zD9cWoD0xTEe/SQM=; h=Date:Subject:To:References:From:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Wluycn+PSvIp+sVWrUNPV11eCGDC+UfxsYdGlGz+MMPAPHP1PorMlNciD91f4UQMM 1M1YXcv7dgDVxgtf269KkBBjUYmq5IUdB7Plkj8rnefJHy5ppFkwysWCqL0OYipKTR sKsi5Q2lZu7aRKwYV7CrSs7MzPWB8CYT1qE+F7F0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4115FF80527; Fri, 21 Oct 2022 10:41:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E32F9F80256; Fri, 21 Oct 2022 10:41:32 +0200 (CEST) Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 75B2DF80256 for ; Fri, 21 Oct 2022 10:41:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 75B2DF80256 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="kc/Lz34l" Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 0650C6602532; Fri, 21 Oct 2022 09:41:22 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1666341684; bh=ixtnbYZsDUAjtbOO7dcijDfW674zD9cWoD0xTEe/SQM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=kc/Lz34lDvuXmaLXjA3lWGJ1XXjh4KahLHgw6Qg/eLQirT6/VFA4+qENEKQ7CzHy+ DmXe8REyjQXW/J/shRxV7ntpiMvf40yTWmDvhOGP49l07EVv1V9xVbD5CtvC4Fr+8+ j+SY7b+/ASlzPr5OeyBZQnj8sPNUS9MSJi01jQ9e/w16v8iwmh7qPFcxuuBmmW6rH6 Dez4lLPN8acWboG/QPuQEWT6bdT7nf+CLJqeMTR3bXacgU/Ce6+GVT5g82xjebCRwM Ko7r8wwIxC82TrWt2nu1N+IdE5ecKXmGIrF9h8gWae4RRf5v2w0VmUsW+3DqQtGvFH eiCJl0ACY4RFw== Message-ID: Date: Fri, 21 Oct 2022 10:41:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v2 03/12] ASoC: mediatek: mt8188: support audsys clock Content-Language: en-US To: Trevor Wu , broonie@kernel.org, tiwai@suse.com, robh+dt@kernel.org, matthias.bgg@gmail.com, p.zabel@pengutronix.de References: <20221021082719.18325-1-trevor.wu@mediatek.com> <20221021082719.18325-4-trevor.wu@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20221021082719.18325-4-trevor.wu@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Project_Global_Chrome_Upstream_Group@mediatek.com, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Il 21/10/22 10:27, Trevor Wu ha scritto: > Add mt8188 audio cg clock control. Audio clock gates are registered to CCF > for reference count and clock parent management. > > Signed-off-by: Trevor Wu > --- > sound/soc/mediatek/mt8188/mt8188-audsys-clk.c | 206 ++++++++++++++++++ > sound/soc/mediatek/mt8188/mt8188-audsys-clk.h | 15 ++ > .../soc/mediatek/mt8188/mt8188-audsys-clkid.h | 83 +++++++ > 3 files changed, 304 insertions(+) > create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clk.c > create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clk.h > create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clkid.h > > diff --git a/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c b/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c > new file mode 100644 > index 000000000000..1f294231d4c2 > --- /dev/null > +++ b/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c > @@ -0,0 +1,206 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * mt8188-audsys-clk.c -- MediaTek 8188 audsys clock control > + * > + * Copyright (c) 2022 MediaTek Inc. > + * Author: Chun-Chia Chiu > + */ > + > +#include > +#include > +#include > +#include "mt8188-afe-common.h" > +#include "mt8188-audsys-clk.h" > +#include "mt8188-audsys-clkid.h" > +#include "mt8188-reg.h" > + > +struct afe_gate { > + int id; > + const char *name; > + const char *parent_name; > + int reg; > + u8 bit; > + const struct clk_ops *ops; > + unsigned long flags; > + u8 cg_flags; > +}; > + > +#define GATE_AFE_FLAGS(_id, _name, _parent, _reg, _bit, _flags, _cgflags) {\ > + .id = _id, \ > + .name = _name, \ > + .parent_name = _parent, \ > + .reg = _reg, \ > + .bit = _bit, \ > + .flags = _flags, \ > + .cg_flags = _cgflags, \ > + } > + > +#define GATE_AFE(_id, _name, _parent, _reg, _bit) \ > + GATE_AFE_FLAGS(_id, _name, _parent, _reg, _bit, \ > + CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, CLK_GATE_SET_TO_DISABLE) Can you please explain what's the reason for CLK_IGNORE_UNUSED here? Maybe we can solve some issue that you're facing in a cleaner way. Regards, Angelo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13D99C4332F for ; Fri, 21 Oct 2022 08:43:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=F+dZ41/QTMf+rUw/pe0CdSSrL+dV6fOtQQov5kXtbY8=; b=wJhKPaaA/emai0 WDsI6AusXxBVamaTG+EXnDV+SjqOfRvYymEcPcFrwV5ekBu6e/t0iMBIuM5SMdRZAVQY2u0n1H8Hv nAZbhTvDvD5qyzc1HG2hXhBAwpQyRjo4eVkyMZC6WGpPKE3efQbXA2+0Zy+HMqZZLLEjGoz4sB237 /puMbZliQuu4MQUGxeIvPSlGg5d/AdWlRDZqnKer010ZzeUNdoZD13nm33WjhK4M+9tf1mYE4mswx 2M6+W2raFeYDLPZ9j6vYbSePGbLNq4HBxbPlZq4jtphGqze+nkIXz7mB7eJe1Nsrw2fwSqAT0tmdd m09KSprTUOGiYlSyLUXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1olnbX-006SCX-5d; Fri, 21 Oct 2022 08:42:11 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1olnan-006Rs6-6r; Fri, 21 Oct 2022 08:41:28 +0000 Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 0650C6602532; Fri, 21 Oct 2022 09:41:22 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1666341684; bh=ixtnbYZsDUAjtbOO7dcijDfW674zD9cWoD0xTEe/SQM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=kc/Lz34lDvuXmaLXjA3lWGJ1XXjh4KahLHgw6Qg/eLQirT6/VFA4+qENEKQ7CzHy+ DmXe8REyjQXW/J/shRxV7ntpiMvf40yTWmDvhOGP49l07EVv1V9xVbD5CtvC4Fr+8+ j+SY7b+/ASlzPr5OeyBZQnj8sPNUS9MSJi01jQ9e/w16v8iwmh7qPFcxuuBmmW6rH6 Dez4lLPN8acWboG/QPuQEWT6bdT7nf+CLJqeMTR3bXacgU/Ce6+GVT5g82xjebCRwM Ko7r8wwIxC82TrWt2nu1N+IdE5ecKXmGIrF9h8gWae4RRf5v2w0VmUsW+3DqQtGvFH eiCJl0ACY4RFw== Message-ID: Date: Fri, 21 Oct 2022 10:41:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v2 03/12] ASoC: mediatek: mt8188: support audsys clock Content-Language: en-US To: Trevor Wu , broonie@kernel.org, tiwai@suse.com, robh+dt@kernel.org, matthias.bgg@gmail.com, p.zabel@pengutronix.de Cc: Project_Global_Chrome_Upstream_Group@mediatek.com, alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20221021082719.18325-1-trevor.wu@mediatek.com> <20221021082719.18325-4-trevor.wu@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20221021082719.18325-4-trevor.wu@mediatek.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221021_014125_458331_6FAA38EA X-CRM114-Status: GOOD ( 16.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Il 21/10/22 10:27, Trevor Wu ha scritto: > Add mt8188 audio cg clock control. Audio clock gates are registered to CCF > for reference count and clock parent management. > > Signed-off-by: Trevor Wu > --- > sound/soc/mediatek/mt8188/mt8188-audsys-clk.c | 206 ++++++++++++++++++ > sound/soc/mediatek/mt8188/mt8188-audsys-clk.h | 15 ++ > .../soc/mediatek/mt8188/mt8188-audsys-clkid.h | 83 +++++++ > 3 files changed, 304 insertions(+) > create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clk.c > create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clk.h > create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clkid.h > > diff --git a/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c b/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c > new file mode 100644 > index 000000000000..1f294231d4c2 > --- /dev/null > +++ b/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c > @@ -0,0 +1,206 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * mt8188-audsys-clk.c -- MediaTek 8188 audsys clock control > + * > + * Copyright (c) 2022 MediaTek Inc. > + * Author: Chun-Chia Chiu > + */ > + > +#include > +#include > +#include > +#include "mt8188-afe-common.h" > +#include "mt8188-audsys-clk.h" > +#include "mt8188-audsys-clkid.h" > +#include "mt8188-reg.h" > + > +struct afe_gate { > + int id; > + const char *name; > + const char *parent_name; > + int reg; > + u8 bit; > + const struct clk_ops *ops; > + unsigned long flags; > + u8 cg_flags; > +}; > + > +#define GATE_AFE_FLAGS(_id, _name, _parent, _reg, _bit, _flags, _cgflags) {\ > + .id = _id, \ > + .name = _name, \ > + .parent_name = _parent, \ > + .reg = _reg, \ > + .bit = _bit, \ > + .flags = _flags, \ > + .cg_flags = _cgflags, \ > + } > + > +#define GATE_AFE(_id, _name, _parent, _reg, _bit) \ > + GATE_AFE_FLAGS(_id, _name, _parent, _reg, _bit, \ > + CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, CLK_GATE_SET_TO_DISABLE) Can you please explain what's the reason for CLK_IGNORE_UNUSED here? Maybe we can solve some issue that you're facing in a cleaner way. Regards, Angelo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel