From patchwork Thu Nov 10 12:22:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 18105 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp112565wru; Thu, 10 Nov 2022 04:25:34 -0800 (PST) X-Google-Smtp-Source: AMsMyM65rZhiVgIjqnUYokKsUJxJJ71XpmbO9FfTYFao/Sz+OJUdwB9QRk76TivJ9jkQ2J1qYjQh X-Received: by 2002:a17:902:d2cf:b0:187:1327:58af with SMTP id n15-20020a170902d2cf00b00187132758afmr59828002plc.88.1668083134562; Thu, 10 Nov 2022 04:25:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668083134; cv=none; d=google.com; s=arc-20160816; b=ntIy982v24amtLjC8e8lFKy2HktzSI19zgn2m3ICYkUF8Wm/u/Ln9lodPu6BzZ3xuQ B+24B3gIbwogVr3bLwK1iwZw2p64yV3WTPAbsMMi7MhoQHsIrJlsdtgtpj2Oo8wSDo2e 3Virvexr5RVNabGlKss+i0ZdpKTw2ZM6e1O4VT9ckwbBOEdzlTSygvQRHax09FfL48zA PaDkMR7QtdnePJumJMm+QhIhj8fbBkLXl0Vo+dEC7fK11ojQ4eXEHVCYz+CLTr3WOshK nzhxrZK4dyN72dDqHHqpqiFdQA2IuIVZIc/TQZtPlxnRveTriR/D0/LgYCRqM4DmnH/c PQpA== 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=cvW51Zop8fCxYwApz907tWJmw9359FNi7XPZG8bxk14=; b=FEUM8hq/Nn8etm2l1ltk+jdStWTWiD4chyBYYO0fa3p6g7J83A7NaHsYxgHBKVQPOW /+t0R9qEIge6mEdZ/sakpiwOe1nnkgZWXZw4QkTEDS+FJTFfALjAo4JF27yOEM/TBC3U cbfvJ9tPjOIuQcixR3XeC+FpWzRf9OaWUSaHsQZ00TmKh/DT1Hv2OJ8YE6pwuTciXme9 PwZ8gNs5WinjXIKuF/zBNokjH918LgMyxUup37nFwUDhZrN9khZIqrGqtnzfRSqw/d9l hvJjRtA6mDjW3q4FkYsbjgWQIKlVKc1+RKYha2Qzl2hp8Ocn0HpMPQWQoiYvj6uDg4n/ p/Cg== 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 h8-20020a170902ac8800b001783df7f2e9si12542324plr.166.2022.11.10.04.25.20; Thu, 10 Nov 2022 04:25:34 -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 S230371AbiKJMYN (ORCPT + 99 others); Thu, 10 Nov 2022 07:24:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbiKJMXm (ORCPT ); Thu, 10 Nov 2022 07:23:42 -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 CFC277832F for ; Thu, 10 Nov 2022 04:22:50 -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 1ot6Zh-0000GT-Aj; Thu, 10 Nov 2022 13:22:29 +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 1ot6Zd-003RqI-SH; Thu, 10 Nov 2022 13:22:26 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1ot6Ze-005NtU-3e; Thu, 10 Nov 2022 13:22:26 +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 v4 3/4] net: dsa: microchip: add ksz_rmw8() function Date: Thu, 10 Nov 2022 13:22:24 +0100 Message-Id: <20221110122225.1283326-4-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221110122225.1283326-1-o.rempel@pengutronix.de> References: <20221110122225.1283326-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?1749111940870637112?= X-GMAIL-MSGID: =?utf-8?q?1749111940870637112?= Add ksz_rmw8(), it will be used in the next patch. Signed-off-by: Oleksij Rempel Acked-by: Arun Ramadoss Reviewed-by: Florian Fainelli --- 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 61228be299f9..5f404a444ce1 100644 --- a/drivers/net/dsa/microchip/ksz_common.h +++ b/drivers/net/dsa/microchip/ksz_common.h @@ -454,6 +454,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) {