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 7F785ECAAD8 for ; Thu, 22 Sep 2022 02:36:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230307AbiIVCg3 (ORCPT ); Wed, 21 Sep 2022 22:36:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230161AbiIVCg1 (ORCPT ); Wed, 21 Sep 2022 22:36:27 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3667AC243 for ; Wed, 21 Sep 2022 19:36:25 -0700 (PDT) X-UUID: 2d4f77de57904dadb515626b63d2e0ac-20220922 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=FjK3+xpCe9u1MNFb+0HGnTV+whYp7DGiShsoGVeYjKA=; b=cQNCiX/l0pmhvRPC7YkptnRyY+0hmrp62MXb6jHRBOBh1nH/dpVH8Gpq41xAW3SWV65rBm9GoBgrEJnIkizmkHD163oonOvwuDnV4Ok3rfCbyU8K8EJAF1xF8yCENtzwt3ivQzVRACW4+yYflf6wAB27SreCfOqtDTYOMXm8i3M=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.11,REQID:67e78b02-ecc9-424f-8d89-f0c9ca927c99,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:39a5ff1,CLOUDID:fa0fc7af-12a8-4d8e-859c-1b6ce09c0eab,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 2d4f77de57904dadb515626b63d2e0ac-20220922 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1808761196; Thu, 22 Sep 2022 10:36:19 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Thu, 22 Sep 2022 10:36:17 +0800 Received: from mhfsdcap04 (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Thu, 22 Sep 2022 10:36:17 +0800 Message-ID: Subject: Re: [PATCH 01/18] phy: mediatek: add a new helper to update bitfield From: Chunfeng Yun To: AngeloGioacchino Del Regno , Chun-Kuang Hu , Vinod Koul CC: Philipp Zabel , Kishon Vijay Abraham I , Matthias Brugger , , , , , , Jitao Shi , "Stanley Chu" Date: Thu, 22 Sep 2022 10:36:17 +0800 In-Reply-To: <2d13b383-7d25-240b-bdbb-e53848df4d47@collabora.com> References: <20220920090038.15133-1-chunfeng.yun@mediatek.com> <20220920090038.15133-2-chunfeng.yun@mediatek.com> <2d13b383-7d25-240b-bdbb-e53848df4d47@collabora.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2022-09-21 at 10:15 +0200, AngeloGioacchino Del Regno wrote: > Il 20/09/22 11:00, Chunfeng Yun ha scritto: > > Due to FIELD_PREP() macro can be used to prepare a bitfield value, > > local ones can be remove; add the new helper to make bitfield > > update > > easier. > > > > Signed-off-by: Chunfeng Yun > > --- > > drivers/phy/mediatek/phy-mtk-io.h | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/drivers/phy/mediatek/phy-mtk-io.h > > b/drivers/phy/mediatek/phy-mtk-io.h > > index 500fcdab165d..a723d4afc9b4 100644 > > --- a/drivers/phy/mediatek/phy-mtk-io.h > > +++ b/drivers/phy/mediatek/phy-mtk-io.h > > @@ -8,6 +8,7 @@ > > #ifndef __PHY_MTK_H__ > > #define __PHY_MTK_H__ > > > > +#include > > #include > > > > static inline void mtk_phy_clear_bits(void __iomem *reg, u32 > > bits) > > @@ -35,4 +36,10 @@ static inline void mtk_phy_update_bits(void > > __iomem *reg, u32 mask, u32 val) > > writel(tmp, reg); > > } > > > > +/* field @mask should be constant and continuous */ > > "Field @mask shall be [...]" > ^^^^^ Ok, will modify it > > > +static inline void mtk_phy_update_field(void __iomem *reg, u32 > > mask, u32 val) > > ...so, (void __iomem *reg, const u32 mask, u32 val) Maybe no need const, @mask will be checked it in compile time when use FIELD_PREP(), means @mask is a constant value, but not a variable. Thanks > > > +{ > > + mtk_phy_update_bits(reg, mask, FIELD_PREP(mask, val)); > > +} > > + > > #endif > > 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 D053AC32771 for ; Thu, 22 Sep 2022 02:36:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A5D3610EA3E; Thu, 22 Sep 2022 02:36:29 +0000 (UTC) Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by gabe.freedesktop.org (Postfix) with ESMTPS id A1C8410EA3E for ; Thu, 22 Sep 2022 02:36:26 +0000 (UTC) X-UUID: 2d4f77de57904dadb515626b63d2e0ac-20220922 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=FjK3+xpCe9u1MNFb+0HGnTV+whYp7DGiShsoGVeYjKA=; b=cQNCiX/l0pmhvRPC7YkptnRyY+0hmrp62MXb6jHRBOBh1nH/dpVH8Gpq41xAW3SWV65rBm9GoBgrEJnIkizmkHD163oonOvwuDnV4Ok3rfCbyU8K8EJAF1xF8yCENtzwt3ivQzVRACW4+yYflf6wAB27SreCfOqtDTYOMXm8i3M=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.11, REQID:67e78b02-ecc9-424f-8d89-f0c9ca927c99, IP:0, U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:39a5ff1, CLOUDID:fa0fc7af-12a8-4d8e-859c-1b6ce09c0eab, B ulkID:nil,BulkQuantity:0,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 2d4f77de57904dadb515626b63d2e0ac-20220922 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1808761196; Thu, 22 Sep 2022 10:36:19 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Thu, 22 Sep 2022 10:36:17 +0800 Received: from mhfsdcap04 (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Thu, 22 Sep 2022 10:36:17 +0800 Message-ID: Subject: Re: [PATCH 01/18] phy: mediatek: add a new helper to update bitfield From: Chunfeng Yun To: AngeloGioacchino Del Regno , Chun-Kuang Hu , Vinod Koul Date: Thu, 22 Sep 2022 10:36:17 +0800 In-Reply-To: <2d13b383-7d25-240b-bdbb-e53848df4d47@collabora.com> References: <20220920090038.15133-1-chunfeng.yun@mediatek.com> <20220920090038.15133-2-chunfeng.yun@mediatek.com> <2d13b383-7d25-240b-bdbb-e53848df4d47@collabora.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jitao Shi , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Kishon Vijay Abraham I , linux-phy@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , Stanley Chu , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed, 2022-09-21 at 10:15 +0200, AngeloGioacchino Del Regno wrote: > Il 20/09/22 11:00, Chunfeng Yun ha scritto: > > Due to FIELD_PREP() macro can be used to prepare a bitfield value, > > local ones can be remove; add the new helper to make bitfield > > update > > easier. > > > > Signed-off-by: Chunfeng Yun > > --- > > drivers/phy/mediatek/phy-mtk-io.h | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/drivers/phy/mediatek/phy-mtk-io.h > > b/drivers/phy/mediatek/phy-mtk-io.h > > index 500fcdab165d..a723d4afc9b4 100644 > > --- a/drivers/phy/mediatek/phy-mtk-io.h > > +++ b/drivers/phy/mediatek/phy-mtk-io.h > > @@ -8,6 +8,7 @@ > > #ifndef __PHY_MTK_H__ > > #define __PHY_MTK_H__ > > > > +#include > > #include > > > > static inline void mtk_phy_clear_bits(void __iomem *reg, u32 > > bits) > > @@ -35,4 +36,10 @@ static inline void mtk_phy_update_bits(void > > __iomem *reg, u32 mask, u32 val) > > writel(tmp, reg); > > } > > > > +/* field @mask should be constant and continuous */ > > "Field @mask shall be [...]" > ^^^^^ Ok, will modify it > > > +static inline void mtk_phy_update_field(void __iomem *reg, u32 > > mask, u32 val) > > ...so, (void __iomem *reg, const u32 mask, u32 val) Maybe no need const, @mask will be checked it in compile time when use FIELD_PREP(), means @mask is a constant value, but not a variable. Thanks > > > +{ > > + mtk_phy_update_bits(reg, mask, FIELD_PREP(mask, val)); > > +} > > + > > #endif > > 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 396B7ECAAD8 for ; Thu, 22 Sep 2022 02:47:37 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:CC:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3mmIjDVLVhflGMpr12XFkrvWAUOxLZhM9r7qbDP0Qlw=; b=N48NpvCnZBFiXq UtRbIfjjHotF0y8vlZZFyZarUwiWM84CUGPOETwWHzxSGMYsAe7CzpB7Z42Omtgz9DRl/4uBvBmaW 4QQvBFTc/FDcX/F8Cg131xcN7dfwOdh0wfoU/fNCYhHSosfjGC6aAmZcRa/wpmgTd1bKv/fBbyT1Z ZwT1+UlgTyJXqZqtzeAvHJYJKNYPgx35EDJR1/qp+QHv6rDdIOZbJmpP/RHgrimakSZMaimXaVhEh w8l6lnq1ioPM19QnzDj6WiyD6TXmQWUqD8Onwf+eyyyyYrNFL7zwgvD7qJOXfBvXbdiNBUhHOvZXJ JKXxKzSHsOwWnC58RdEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1obCFU-00DBHX-LE; Thu, 22 Sep 2022 02:47:36 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1obCFR-00DBGw-TH; Thu, 22 Sep 2022 02:47:35 +0000 X-UUID: f4b226194853444598910141fda3b2f4-20220921 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=FjK3+xpCe9u1MNFb+0HGnTV+whYp7DGiShsoGVeYjKA=; b=cQNCiX/l0pmhvRPC7YkptnRyY+0hmrp62MXb6jHRBOBh1nH/dpVH8Gpq41xAW3SWV65rBm9GoBgrEJnIkizmkHD163oonOvwuDnV4Ok3rfCbyU8K8EJAF1xF8yCENtzwt3ivQzVRACW4+yYflf6wAB27SreCfOqtDTYOMXm8i3M=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.11,REQID:81a1b118-93e5-4b9d-977d-9fcfa6810efe,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:39a5ff1,CLOUDID:5f833af7-6e85-48d9-afd8-0504bbfe04cb,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: f4b226194853444598910141fda3b2f4-20220921 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1234755833; Wed, 21 Sep 2022 19:36:52 -0700 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Thu, 22 Sep 2022 10:36:17 +0800 Received: from mhfsdcap04 (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Thu, 22 Sep 2022 10:36:17 +0800 Message-ID: Subject: Re: [PATCH 01/18] phy: mediatek: add a new helper to update bitfield From: Chunfeng Yun To: AngeloGioacchino Del Regno , Chun-Kuang Hu , Vinod Koul CC: Philipp Zabel , Kishon Vijay Abraham I , Matthias Brugger , , , , , , Jitao Shi , "Stanley Chu" Date: Thu, 22 Sep 2022 10:36:17 +0800 In-Reply-To: <2d13b383-7d25-240b-bdbb-e53848df4d47@collabora.com> References: <20220920090038.15133-1-chunfeng.yun@mediatek.com> <20220920090038.15133-2-chunfeng.yun@mediatek.com> <2d13b383-7d25-240b-bdbb-e53848df4d47@collabora.com> X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220921_194733_964593_ADCC394B X-CRM114-Status: GOOD ( 18.15 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On Wed, 2022-09-21 at 10:15 +0200, AngeloGioacchino Del Regno wrote: > Il 20/09/22 11:00, Chunfeng Yun ha scritto: > > Due to FIELD_PREP() macro can be used to prepare a bitfield value, > > local ones can be remove; add the new helper to make bitfield > > update > > easier. > > > > Signed-off-by: Chunfeng Yun > > --- > > drivers/phy/mediatek/phy-mtk-io.h | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/drivers/phy/mediatek/phy-mtk-io.h > > b/drivers/phy/mediatek/phy-mtk-io.h > > index 500fcdab165d..a723d4afc9b4 100644 > > --- a/drivers/phy/mediatek/phy-mtk-io.h > > +++ b/drivers/phy/mediatek/phy-mtk-io.h > > @@ -8,6 +8,7 @@ > > #ifndef __PHY_MTK_H__ > > #define __PHY_MTK_H__ > > > > +#include > > #include > > > > static inline void mtk_phy_clear_bits(void __iomem *reg, u32 > > bits) > > @@ -35,4 +36,10 @@ static inline void mtk_phy_update_bits(void > > __iomem *reg, u32 mask, u32 val) > > writel(tmp, reg); > > } > > > > +/* field @mask should be constant and continuous */ > > "Field @mask shall be [...]" > ^^^^^ Ok, will modify it > > > +static inline void mtk_phy_update_field(void __iomem *reg, u32 > > mask, u32 val) > > ...so, (void __iomem *reg, const u32 mask, u32 val) Maybe no need const, @mask will be checked it in compile time when use FIELD_PREP(), means @mask is a constant value, but not a variable. Thanks > > > +{ > > + mtk_phy_update_bits(reg, mask, FIELD_PREP(mask, val)); > > +} > > + > > #endif > > -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy 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 C44F7ECAAD8 for ; Thu, 22 Sep 2022 02:48:56 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:CC:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=R2QAtLzNnr9scb5BklISSgyEzd/1XUnktNDJZg1OzpQ=; b=fNpFSPXMJev+rV WBEZqH0L6R5+5bmwFZl1KP4OdBbDtyAgZXhX/hkY3nLk7uuAEX0r4bt4saIu3lkCUlrizHsiTCwXx EvfRR/4NdzbDXP462rAUyqPG8cBDbJW9n4IdqIEmqE2fO0Q+njc++a8Rkhou0x2iCjmnKkmnGzk9d ZCNyLxU0lqLdZtguirTcTNexI7AX9NFPE9DjBH4ZMtnYQFsrzls7IAUjswg6ul9fBkW7uKnia0uhM wTKD7axtzwjY74j5Y2epDemjBhon6k3+o5sAoFiA8fsNK89LP05j8gEISE8pnXxbBXIz85DY+vcbP INkhj9w7XUXwiGs0Z8Lg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1obCFV-00DBHf-3A; Thu, 22 Sep 2022 02:47:37 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1obCFR-00DBGw-TH; Thu, 22 Sep 2022 02:47:35 +0000 X-UUID: f4b226194853444598910141fda3b2f4-20220921 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=FjK3+xpCe9u1MNFb+0HGnTV+whYp7DGiShsoGVeYjKA=; b=cQNCiX/l0pmhvRPC7YkptnRyY+0hmrp62MXb6jHRBOBh1nH/dpVH8Gpq41xAW3SWV65rBm9GoBgrEJnIkizmkHD163oonOvwuDnV4Ok3rfCbyU8K8EJAF1xF8yCENtzwt3ivQzVRACW4+yYflf6wAB27SreCfOqtDTYOMXm8i3M=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.11,REQID:81a1b118-93e5-4b9d-977d-9fcfa6810efe,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:39a5ff1,CLOUDID:5f833af7-6e85-48d9-afd8-0504bbfe04cb,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: f4b226194853444598910141fda3b2f4-20220921 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1234755833; Wed, 21 Sep 2022 19:36:52 -0700 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Thu, 22 Sep 2022 10:36:17 +0800 Received: from mhfsdcap04 (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Thu, 22 Sep 2022 10:36:17 +0800 Message-ID: Subject: Re: [PATCH 01/18] phy: mediatek: add a new helper to update bitfield From: Chunfeng Yun To: AngeloGioacchino Del Regno , Chun-Kuang Hu , Vinod Koul CC: Philipp Zabel , Kishon Vijay Abraham I , Matthias Brugger , , , , , , Jitao Shi , "Stanley Chu" Date: Thu, 22 Sep 2022 10:36:17 +0800 In-Reply-To: <2d13b383-7d25-240b-bdbb-e53848df4d47@collabora.com> References: <20220920090038.15133-1-chunfeng.yun@mediatek.com> <20220920090038.15133-2-chunfeng.yun@mediatek.com> <2d13b383-7d25-240b-bdbb-e53848df4d47@collabora.com> X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220921_194733_964593_ADCC394B X-CRM114-Status: GOOD ( 18.15 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 2022-09-21 at 10:15 +0200, AngeloGioacchino Del Regno wrote: > Il 20/09/22 11:00, Chunfeng Yun ha scritto: > > Due to FIELD_PREP() macro can be used to prepare a bitfield value, > > local ones can be remove; add the new helper to make bitfield > > update > > easier. > > > > Signed-off-by: Chunfeng Yun > > --- > > drivers/phy/mediatek/phy-mtk-io.h | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/drivers/phy/mediatek/phy-mtk-io.h > > b/drivers/phy/mediatek/phy-mtk-io.h > > index 500fcdab165d..a723d4afc9b4 100644 > > --- a/drivers/phy/mediatek/phy-mtk-io.h > > +++ b/drivers/phy/mediatek/phy-mtk-io.h > > @@ -8,6 +8,7 @@ > > #ifndef __PHY_MTK_H__ > > #define __PHY_MTK_H__ > > > > +#include > > #include > > > > static inline void mtk_phy_clear_bits(void __iomem *reg, u32 > > bits) > > @@ -35,4 +36,10 @@ static inline void mtk_phy_update_bits(void > > __iomem *reg, u32 mask, u32 val) > > writel(tmp, reg); > > } > > > > +/* field @mask should be constant and continuous */ > > "Field @mask shall be [...]" > ^^^^^ Ok, will modify it > > > +static inline void mtk_phy_update_field(void __iomem *reg, u32 > > mask, u32 val) > > ...so, (void __iomem *reg, const u32 mask, u32 val) Maybe no need const, @mask will be checked it in compile time when use FIELD_PREP(), means @mask is a constant value, but not a variable. Thanks > > > +{ > > + mtk_phy_update_bits(reg, mask, FIELD_PREP(mask, val)); > > +} > > + > > #endif > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel