From patchwork Tue Nov 8 05:43:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 16877 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2504716wru; Mon, 7 Nov 2022 21:52:18 -0800 (PST) X-Google-Smtp-Source: AMsMyM559RS7rBw557+JBsjD0CIXi8vgdBKnD5sjx4oNgMIOell5ntNqwxDW4fp4ekx7IFN42qtU X-Received: by 2002:a17:907:a4a:b0:77b:c1b2:479a with SMTP id be10-20020a1709070a4a00b0077bc1b2479amr19384856ejc.109.1667886738391; Mon, 07 Nov 2022 21:52:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667886738; cv=none; d=google.com; s=arc-20160816; b=PqdeUG83sj7P2fU2HoM/AM58XEEeVDAyB4wiTZ1/0VU/+UmQVS/Hu/7YcrBF94zOFL pSA2wGz169GOQNYyJ0uzBklBSW+017u4jlFJ0xMbO5ZV854flVvLtA4UWlIvFneGVidN 4oPuRbHqE8yOKWdKapyxHeYR0A+fsiQPJA9GZvd24meC7xQyxvgdizJQ/NTGhD/fdfKH 7hI+FAhcZiKPQwm5j3gYecE3KY1J0WojvUbeWYF4tHahhrxcCbxAz/AIQxxDymDBcZ6G 2cpQInt4nnYc5boj07AZVX+Wm3tZmFI/lnK+mkxR1PKlcLfzvWlsHCf8sGxOyhq3IjDj 5NPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=DPP9+BGUh82m6FdIE0wgzf4WWmrqnOV4ZfT5z9RDIic=; b=i1n1+WfEJ3RoHcOV+aYHNlQ5jal+GMNQGi3YTlxT4sy55gpCnKy8Fx818AFdVTKbdn p15onEyxd0rBoN3zmvQm/zToKTzgY8qpSsAzp//49vHGG+w9vQkgVG5Ih3jcbt11aYVD eaZDi+Vtb+HZf9sIV6IHpgjBtP3tU6kCKqnBNq8RksK5z0CebhgZ+0hDUDX5BvxHtQsU fIGe/pIPVE74Z7BeTcbNVervTO2ySAyOElJg0LO4K4cvupZEmtnhy2iCYxhiOk7COKkz bEItWsGO4plZyaWkQ1H0C+5Y9NZ9SABQhrcngabDXUc+gWg0jJ7dkFdw2Y12sIH0qlO4 2Hjw== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb30-20020a1709071c9e00b007a7d37e4684si13003533ejc.803.2022.11.07.21.51.54; Mon, 07 Nov 2022 21:52:18 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233253AbiKHFn4 (ORCPT + 99 others); Tue, 8 Nov 2022 00:43:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233092AbiKHFnv (ORCPT ); Tue, 8 Nov 2022 00:43:51 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 164D120348 for ; Mon, 7 Nov 2022 21:43:51 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1osHOf-000572-5C; Tue, 08 Nov 2022 06:43:41 +0100 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1osHOc-002zmp-4v; Tue, 08 Nov 2022 06:43:39 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1osHOb-00HTlf-UK; Tue, 08 Nov 2022 06:43:37 +0100 From: Oleksij Rempel To: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Oleksij Rempel , Arun Ramadoss , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Arun.Ramadoss@microchip.com Subject: [PATCH net-next v3 2/3] net: dsa: microchip: add ksz_rmw8() function Date: Tue, 8 Nov 2022 06:43:35 +0100 Message-Id: <20221108054336.4165931-3-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221108054336.4165931-1-o.rempel@pengutronix.de> References: <20221108054336.4165931-1-o.rempel@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748906004232756580?= X-GMAIL-MSGID: =?utf-8?q?1748906004232756580?= Add ksz_rmw8(), it will be used in the next patch. Signed-off-by: Oleksij Rempel Acked-by: Arun Ramadoss --- drivers/net/dsa/microchip/ksz_common.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h index 7de5070637ec..85ce6ec573ba 100644 --- a/drivers/net/dsa/microchip/ksz_common.h +++ b/drivers/net/dsa/microchip/ksz_common.h @@ -453,6 +453,11 @@ static inline int ksz_write64(struct ksz_device *dev, u32 reg, u64 value) return regmap_bulk_write(dev->regmap[2], reg, val, 2); } +static inline int ksz_rmw8(struct ksz_device *dev, int offset, u8 mask, u8 val) +{ + return regmap_update_bits(dev->regmap[0], offset, mask, val); +} + static inline int ksz_pread8(struct ksz_device *dev, int port, int offset, u8 *data) {