Received: by 2002:a05:7412:8d08:b0:f9:2d0a:d759 with SMTP id bj8csp117891rdb; Sun, 17 Dec 2023 05:02:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IEaZJoQthwawcehcqwJjP7MTvK3/3sRUf0rVsy5KvkXDkQZQZW/OfoATzKdGJ7FzBx6t1MK X-Received: by 2002:a05:6214:c6d:b0:67f:2c13:3c81 with SMTP id t13-20020a0562140c6d00b0067f2c133c81mr2704190qvj.8.1702818159231; Sun, 17 Dec 2023 05:02:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702818159; cv=none; d=google.com; s=arc-20160816; b=fyOLHUDWnKmvHgPZDODtviyE6gHQEIDrVufJLkWjRym6ZxB9PVayRZyzzA08+c3Pq5 WsVNS0zizWoFsagksevK+qVb8U9ZTwsbfC4j9stS531kLHF0uc2T2KUW/hcyt8IuWVlF c2U4eIHIcdQ4i1vL7MgZXeKi8T/hcVlxYPsz8oou10ntOq17YUj28fByM0+s0xQumQ/p Ft5nEqQQbSR+1bzAoADw08Mb+ceJHl9uq7jnOqFrbgnnq0Fcit7hZ7GHeLhMD20vmW3u BfhwtAn/sZt9EAejvJUjd9wBgyPbDiZc1hPppKSf8AfKvBCplpmXNvlJRGM7lhzAX3Jt vZfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=TQTZLBSduQ8s6GQUSLhCBMEr/I2vUL4l7lt+FKMF6i0=; fh=ADbtrtwpaSZZeUjgYV6w1bn6c8itRLrDpWoY1/U+ByQ=; b=AE+gVY+8BFYVppqWKK2W4cD2yNrVuBV1jd/NYpwHZ/HwV5j4jmWBbon25hSGEaTiQC qeGcLrC1p2/iZsDpLwa9qGuqv+ktCAzrXLu7cRWUDeLiD/LPmhKMmjEWVOb7OXyzyNlt TDYipCK+JpdRghnvufW4wDpQOTw3wGhdqBEuhZZY4Y2diwBpHurhRHJ6JpcnWzPRbd4B NK7qSo6RSJjZWF71Jq0kMBJsMSk7pq+Bj6y2W0bme1kMXwPVjeBZSe4pMzUc87bdfv5Z 1Qa0+UWIa8GXbo+V+46G5VzbDXtPdVL+ju1P9mSOoKbDpSDYL963ah2wZFY149I6VDiF oPXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hIP8vS81; spf=pass (google.com: domain of linux-kernel+bounces-2586-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2586-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c3-20020a05620a268300b00767ccf42f41si23136170qkp.29.2023.12.17.05.02.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 05:02:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2586-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hIP8vS81; spf=pass (google.com: domain of linux-kernel+bounces-2586-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2586-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 021481C20FEE for ; Sun, 17 Dec 2023 13:02:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8065544363; Sun, 17 Dec 2023 13:02:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hIP8vS81" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A233C43147; Sun, 17 Dec 2023 13:02:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6A4DC433C7; Sun, 17 Dec 2023 13:02:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702818147; bh=totc3bhdIJhST4jH5HrKG/pFIPp32//1T4FxcfKMPPg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hIP8vS81QN8xQGOQeCV0N/GyEHaBWKyERYOmoJe64KTzsjv1E+PpSRvJPJ4/8mrNt qime86vnW6dQyV6RtIgscW3NhC6hgpEeUiriJxWnBy9zj9SoPso9BNuoLdcCWSSp9C VzqKYs29YIuknddmfyTfKVIfnvbNLAFdanhnD4Q9Rg8nfvy3D5enzAwBg3PXKixndO omRCnEfR1cbXWLcxLC+JMvYzD+I1YAq6rtQooiiOSRXgSJf4nerbTpZu2d+dqV53bH tRdFi+O127uMshEDgLW5hMAXgq9wk1EWVCltY4M5tYNtrAoUm3oKssGpdWqgEOxWWk 2lqQcCTlwC3NQ== Date: Sun, 17 Dec 2023 13:02:21 +0000 From: Simon Horman To: Luo Jie Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, hkallweit1@gmail.com, linux@armlinux.org.uk, corbet@lwn.net, p.zabel@pengutronix.de, f.fainelli@gmail.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v8 13/14] net: phy: at803x: configure qca8084 work mode Message-ID: <20231217130221.GZ6288@kernel.org> References: <20231215074005.26976-1-quic_luoj@quicinc.com> <20231215074005.26976-14-quic_luoj@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231215074005.26976-14-quic_luoj@quicinc.com> On Fri, Dec 15, 2023 at 03:40:03PM +0800, Luo Jie wrote: ... > @@ -1038,6 +1045,46 @@ static int qca8084_common_clock_init(struct phy_device *phydev) > return clk_prepare_enable(priv->clk[MDIO_MASTER_AHB_CLK]); > } > > +static int qca8084_parse_and_set_work_mode(struct phy_device *phydev) > +{ > + struct device_node *node; > + struct at803x_priv *priv; > + u32 value, work_mode; > + int ret; > + > + node = phydev->mdio.dev.of_node; > + priv = phydev->priv; Hi Luo Jie, a minor nit from my side: priv is set but otherwise unused in this function. > + > + /* The property "qcom,phy-work-mode" is only defined in one > + * PHY device tree node. > + */ > + ret = of_property_read_u32(node, "qcom,phy-work-mode", &value); > + if (ret) > + return ret == -EINVAL ? 0 : ret; > + > + switch (value) { > + case 0: > + work_mode = QCA8084_WORK_MODE_QXGMII; > + break; > + case 1: > + work_mode = QCA8084_WORK_MODE_QXGMII_PORT4_SGMII; > + break; > + case 2: > + work_mode = QCA8084_WORK_MODE_SWITCH; > + break; > + case 3: > + work_mode = QCA8084_WORK_MODE_SWITCH_PORT4_SGMII; > + break; > + default: > + phydev_err(phydev, "invalid qcom,phy-work-mode %d\n", value); > + return -EINVAL; > + } > + > + return qca8084_mii_modify(phydev, QCA8084_WORK_MODE_CFG, > + QCA8084_WORK_MODE_MASK, > + FIELD_PREP(QCA8084_WORK_MODE_MASK, work_mode)); > +} ...