Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1049426rdg; Fri, 13 Oct 2023 08:47:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE7p1Eykc6BOvGk4SzXQ+U/pi+7HtChQSoo8lfwxeYflJQ3CrrfR843dfD1B4RpTd+0zG3R X-Received: by 2002:a17:902:e887:b0:1c7:36ff:1feb with SMTP id w7-20020a170902e88700b001c736ff1febmr667794plg.17.1697212058571; Fri, 13 Oct 2023 08:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697212058; cv=none; d=google.com; s=arc-20160816; b=vxWWQ2hRv+HWWPAW1yQn5+PS+eD0KfUuBLt9i+ONUV6tS4npHAQdalWnxBm43UJuis FW02/KhvqWp0nwUXCbLVA/F6UXTcO/qmGA1P+tNsQFAmXB05cze7Q+13efaMd4f7CS68 7N/m4iZ33/ddIkwLQHGXZVv45gWOjUj/U1BwcbNU/Ugo6x8Ai5kW4mDzzhZmJoeimZfn Nyx9sWnSX/eohb/99HaEdSVzQtxqTeUPWm4CRnoIEdchOVBbaUIoaFebZA5ecwkPMr+h rDkKcVLRcb+TkprLqyS6lSvEwAoL70IXJpV/lccp1VX+F93I4BqkQy4Dye9b6zY5eEfZ /Atw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5j6k0u2Eava/0Qlobg6vWw5aQner76j2PihLdKgd/5o=; fh=P2qovqNuC/PWky+IwRC+Tf8EWQo7eFBqbiQ/DvqZUyU=; b=zasCfuy3qSXmb9PMWivK4aze9Iz4dvPZdOnX1sMpqPiVAHDenqhX90ZTP8nXRl+iJX EDeE6R2mSe1ZV3bTX8rMSKTt+FlkR7u5dJCCFmTLpnHrA9oAzXsROHLDRb3+o1lIZmc9 b4wkVJrrr5eE16r6q9NSu1UbmxKVRUWOEdhyqSLa10KQajfqQKJq5KFztbqOVBykRGp1 gNcGAccACu4pCVK7+2GV3hScnz9otFCcw/sceUFcyOgtahCklkvLO+LbI1BF3HiDqgKr VHDDrNzaX07mHvwmO3diWXFz8pNMNnXsAsFStRZFm+EMJNUykXKulLPnL3+v7tAljQI1 nbDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BFivpRx1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id d8-20020a170902b70800b001c76b4c349esi4527073pls.218.2023.10.13.08.47.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 08:47:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BFivpRx1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id C3F1F82069F2; Fri, 13 Oct 2023 08:47:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232434AbjJMPrY (ORCPT + 99 others); Fri, 13 Oct 2023 11:47:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232421AbjJMPrW (ORCPT ); Fri, 13 Oct 2023 11:47:22 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A5AFBB for ; Fri, 13 Oct 2023 08:47:21 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EB7EC433C8; Fri, 13 Oct 2023 15:47:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697212041; bh=hzaje4tewvJblbKIeWkc4poyyNgRKrYbqer1VgiOEI0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BFivpRx1m0ZUojigVPR8yTCubmHLbXYy3v62x2m2/oZ1XfefSvPZ8L6LsgZqQWoHx C+dVmwnJ2iq3oMhuC/mAP0ireYp20avytsaiS3onJqKxQMVJwVt59t8OEI3HVSAwUK 1p1lff2gla4hM+jduYwa6jDYOPZ4Q5yuSFIRQoS6zQMari6eL09MdCeCPu/IR/Mf4n CFGpumfFcNYIQXKA+cgVIbS6jGzY/TRgC092YEvlRl9Mp1ddjFj0Oxh/ngCSdbG6vv Ui0oC0IBMOfBuiP0PBKia8smQQCJsDaQpo+nwjqAj0FfYx5OAsUwz7MSTqf4HM3iH+ Fu2hEtXyDMcJA== Date: Fri, 13 Oct 2023 17:47:16 +0200 From: Simon Horman To: Oleksij Rempel Cc: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Heiner Kallweit , kernel@pengutronix.de, linux-kernel@vger.kernel.org, Russell King , netdev@vger.kernel.org Subject: Re: [PATCH net-next v1 2/3] net: dsa: microchip: ksz8: Enable MIIM PHY Control reg access Message-ID: <20231013154716.GP29570@kernel.org> References: <20231011123856.1443308-1-o.rempel@pengutronix.de> <20231011123856.1443308-2-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231011123856.1443308-2-o.rempel@pengutronix.de> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 13 Oct 2023 08:47:36 -0700 (PDT) On Wed, Oct 11, 2023 at 02:38:55PM +0200, Oleksij Rempel wrote: > Provide access to MIIM PHY Control register (Reg. 31) through > ksz8_r_phy_ctrl() and ksz8_w_phy_ctrl() functions. Necessary for > upcoming micrel.c patch to address forced link mode configuration. > > Signed-off-by: Oleksij Rempel > --- > drivers/net/dsa/microchip/ksz8795.c | 81 +++++++++++++++++++++++++++-- > 1 file changed, 78 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c > index 91aba470fb2f..11cb054cb54f 100644 > --- a/drivers/net/dsa/microchip/ksz8795.c > +++ b/drivers/net/dsa/microchip/ksz8795.c > @@ -632,6 +632,47 @@ static void ksz8_w_vlan_table(struct ksz_device *dev, u16 vid, u16 vlan) > ksz8_w_table(dev, TABLE_VLAN, addr, buf); > } > > +/** > + * ksz8_r_phy_ctrl - Translates and reads from the SMI interface to a MIIM PHY > + * Control register (Reg. 31). > + * @dev: The KSZ device instance. > + * @port: The port number to be read. nit: please include an entry for @val here > + * > + * This function reads the SMI interface and translates the hardware register > + * bit values into their corresponding control settings for a MIIM PHY Control > + * register. > + */ > +static int ksz8_r_phy_ctrl(struct ksz_device *dev, int port, u16 *val) ...