Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27413877rwd; Tue, 4 Jul 2023 02:35:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlH0N+SchGm76pOoQJGSdLaXkWMPg8sW23Z58MaPBFA6a46Fq0/feAvTmR+6xHezu0e1KIn0 X-Received: by 2002:a17:902:a606:b0:1b8:a936:1905 with SMTP id u6-20020a170902a60600b001b8a9361905mr178961plq.38.1688463354034; Tue, 04 Jul 2023 02:35:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688463354; cv=none; d=google.com; s=arc-20160816; b=DZ3Y6L3puqHYKLKhMRX9mgjMXsHWg73OpsJ0qLcGGtg/NF4tN624R/i1CfmNfeZIR8 EHg0IM20y/YoKOBCslBJvvZS1E+JtsmxvRxhkMhejE85qXRY/Sh2qDu3X+9J9JgveN/w MHObY81QL04LGIoyfQL95LI9Wjehu1ka3SUzMaK7JQGwu755taG76UTEmaic9heSi0AL Hp7egK53wVNNcvTD/U3N6Qf6ord2eFw62wNm6klZJbcvKgzNpbwNhSJdt7xEDVUhVZ8G UvQNGv7lFSNY54oO1XumUdxGubrrFvRMiHWEvYUciLirk5pRj5zQvcMPoc5ZMaDG3t75 DUUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=FGaQkTb7NVL71r3VqkfBk/1SCRC9sQdqYnOL9DOZuBk=; fh=Aqt4GsHbshkKbWCIhQmmENz7ZSLeFY3v1LXQwWVRGHk=; b=cb/U6nCAmRh6Df5OVXeaNXM5YC6kf9HUmvnUptO4gkQuTjecFoyQy5rtmDZbV/Kwh9 LLyzRCOVgVzArQpghWCnrA3AlD/onyOu9BBzPHONNaKd/8yYBEAMGE2OEsgSNzbYEDhD 73Q9fv301N7bRLhqWdSPEoTE+3lYhsNl/8NqlcFTP8YgJRAj0OoVKXbjPOdAxhLmRupS eTwUyKFNJPX6pTGOJZmRhB2xdyYpzeaH/n/CgNZn9UFsWPOab2EKh0FLEd53QINF7KaL lTWX6d2kIRMZ1caTG/G9iLraym5ExlyXOwbDGO0On5XM9ndw7sHKOkrHriQaWbFpaTII SDIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=O2D7hTO3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u9-20020a17090341c900b001b86ddfd49bsi9838337ple.6.2023.07.04.02.35.41; Tue, 04 Jul 2023 02:35:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=O2D7hTO3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231710AbjGDJBW (ORCPT + 99 others); Tue, 4 Jul 2023 05:01:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231330AbjGDJBU (ORCPT ); Tue, 4 Jul 2023 05:01:20 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 682461AD; Tue, 4 Jul 2023 02:01:14 -0700 (PDT) Received: from [IPV6:2001:b07:2ed:14ed:c5f8:7372:f042:90a2] (unknown [IPv6:2001:b07:2ed:14ed:c5f8:7372:f042:90a2]) (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 E5D856606ED1; Tue, 4 Jul 2023 10:01:11 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1688461272; bh=Sc7fq+rTOlTB0mP3kaMF9Dy8NIoMJX8FCQ4muEAYp6A=; h=Date:Subject:To:References:From:In-Reply-To:From; b=O2D7hTO3dCooM7TV2L607b3CAeHCPy9CXrnmemtTqdcNVqW3OaHCRHR7Xei0SA5X1 vR/6dkqKCAqnF1iRFd2yFrNM+f0POcDBln/YzdOD1ymssEJMSXIcUgLELMu/sLZEeY n4zoBbPJpqXb6euNRgMglQZzpvMxg21TtOct7VM2CnY94lp7H+Vbob7KG1rg1EGRpG 9WfDXiRGDAc56LsxFAjplAI1ZXwOXwvFq38TS1FF5ClTKSIRaiwKJl2ftQ2qvmPGW6 oYmxqDzfh34SUJECqwaNwfc5Bgat0skEr9UrvPg6b38fUwaS3HauJbn4ExwnCMPnkG l0WxMXD+1tSRg== Message-ID: Date: Tue, 4 Jul 2023 11:01:09 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2 1/7] ASoC: mediatek: mt7986: add common header Content-Language: en-US To: Maso Huang , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , Jaroslav Kysela , Takashi Iwai , Trevor Wu , Jiaxin Yu , Ren Zhijie , Allen-KH Cheng , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20230626023501.11120-1-maso.huang@mediatek.com> <20230626023501.11120-2-maso.huang@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20230626023501.11120-2-maso.huang@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 26/06/23 04:34, Maso Huang ha scritto: > Add header files for register definition and structure. > > Signed-off-by: Maso Huang > --- > sound/soc/mediatek/mt7986/mt7986-afe-common.h | 51 +++++ > sound/soc/mediatek/mt7986/mt7986-reg.h | 206 ++++++++++++++++++ > 2 files changed, 257 insertions(+) > create mode 100644 sound/soc/mediatek/mt7986/mt7986-afe-common.h > create mode 100644 sound/soc/mediatek/mt7986/mt7986-reg.h > > diff --git a/sound/soc/mediatek/mt7986/mt7986-afe-common.h b/sound/soc/mediatek/mt7986/mt7986-afe-common.h > new file mode 100644 > index 000000000000..646e1be4fdce > --- /dev/null > +++ b/sound/soc/mediatek/mt7986/mt7986-afe-common.h > @@ -0,0 +1,51 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * mt7986-afe-common.h -- MediaTek 7986 audio driver definitions > + * > + * Copyright (c) 2021 MediaTek Inc. > + * Author: Vic Wu > + * Maso Huang > + */ > + > +#ifndef _MT_7986_AFE_COMMON_H_ > +#define _MT_7986_AFE_COMMON_H_ > + > +#include > +#include > +#include > +#include > +#include "../common/mtk-base-afe.h" > + > +enum { > + MT7986_MEMIF_DL1, > + MT7986_MEMIF_VUL12, > + MT7986_MEMIF_NUM, > + MT7986_DAI_ETDM = MT7986_MEMIF_NUM, > + MT7986_DAI_NUM, > +}; > + > +enum { > + MT7986_IRQ_0, > + MT7986_IRQ_1, > + MT7986_IRQ_2, > + MT7986_IRQ_NUM, > +}; > + > +struct clk; > + > +struct mt7986_afe_private { > + struct clk_bulk_data *clks; > + int num_clks; > + > + int pm_runtime_bypass_reg_ctl; > + > + /* dai */ > + void *dai_priv[MT7986_DAI_NUM]; > +}; > + > +unsigned int mt7986_afe_rate_transform(struct device *dev, > + unsigned int rate); > + > +/* dai register */ > +int mt7986_dai_etdm_register(struct mtk_base_afe *afe); > +#endif > diff --git a/sound/soc/mediatek/mt7986/mt7986-reg.h b/sound/soc/mediatek/mt7986/mt7986-reg.h > new file mode 100644 > index 000000000000..6433cdf3da92 > --- /dev/null > +++ b/sound/soc/mediatek/mt7986/mt7986-reg.h > @@ -0,0 +1,206 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * mt7986-reg.h -- MediaTek 7986 audio driver reg definition > + * > + * Copyright (c) 2021 MediaTek Inc. > + * Author: Vic Wu > + * Maso Huang > + */ > + > +#ifndef _MT7986_REG_H_ > +#define _MT7986_REG_H_ ..snip.. > +/* ETDM_OUT5_CON4 */ > +#define OUT_RELATCH(x) ((x) << 24) > +#define OUT_RELATCH_SFT 24 > +#define OUT_RELATCH_MASK GENMASK(28, 24) > +#define OUT_CLK_SRC(x) ((x) << 6) > +#define OUT_CLK_SRC_SFT 6 > +#define OUT_CLK_SRC_MASK GENMASK(8, 6) > +#define OUT_SEL_FS(x) ((x) << 0) A number shifted by zero bits is equal to itself, so, this statement doesn't make sense. I understand why you want a OUT_SEL_FS(x) definition though, so you could do it like: #define OUT_SEL_FS(x) (x) After which, Reviewed-by: AngeloGioacchino Del Regno Regards, Angelo