From patchwork Wed Feb 28 17:24:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 207936 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3505626dyb; Wed, 28 Feb 2024 09:47:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXIMu/LLq9sLkowP21hJhx/ijuuvv9MBkWB3NBAeFXIPVrHnK59o464++IN/gpJhG3Ejrjyh90PO0sNL1hva67sxnvyqQ== X-Google-Smtp-Source: AGHT+IGox5FqzDZXMbZT9HyXSqXDdX3ufPW3DLWCHo9R0TcMwZ1SNQHlMp8sOIrYFZnZMxrMMxP1 X-Received: by 2002:a05:6a20:2d2b:b0:1a1:186e:69e5 with SMTP id g43-20020a056a202d2b00b001a1186e69e5mr3983103pzl.38.1709142468508; Wed, 28 Feb 2024 09:47:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709142468; cv=pass; d=google.com; s=arc-20160816; b=zdU/gHP1fD7Plfig+f3en5+zSDnQraTnOmRbHU4sT9IU1pmcLkUAP9ihiSLKkPJ+JC vz2rfTKdsV0kSqzAbWIVEF1ZHO4UYcDv5gpngcaJRzOQQRJycrttX6jj4fh8/7Q7bVr4 g4cCLSBssKpNDZ8nDXOJzKdWNHjkzieo6kNTQEZ6cRsyh6CehVfd2MBBYD9Ak6UqQFvp 6CjUwTVqPNhkVYPmEFwa+6939kNwCIqZS2ldpsd+OUufTXTLmB22iTEhDPoGMPnXOYaB YqvKFD8OT9Zedp7hPByqJyLV6sF/IlFgIa98jv5Ww8yMfpYupUiRN3GBIo/ee1JxCCIP N25w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=gWoavvnvgfbtqyMWs0zbwswYMb/yIFlUZfju4MgDQEE=; fh=6Oa7XGXKO2LKt8VYIE87LRpnwWkzqyasaA89Rw83UuU=; b=C5+p6F2bB2gT4qHy289sZsEsp5EXaeU9FvbRb6MDArPNG5tK4S2tsKeHoVT29ChVmf 6MoOfwX0mEi5mkTo5pOIQU+vCyOria7qbS/EoOZ0FcxV/VgRrRuJP5ycvwHBhJKrmkZW G9CYJzEQG3Bp3a0klAatoKhwlvEX7J2ay03LiYrUj9GYvBroV0m7tLEclQguCzFbd/G2 Q+cHsf1/6ijdoSQ+ZVVp1Jaxw4ezAZs9+ACgmLfvGbOtSPNbsanTS1IvwgqM8/U2aSZy F77RGcL2MAjGE4pgwSC+IlK3SStWM7HKbeppLsmTyZ9QGicD+zJ+ANUyZ5T0AyKlOt7I LodA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fhZDjZE5; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-85434-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85434-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id r9-20020a63fc49000000b005dcd29510e5si7729238pgk.349.2024.02.28.09.47.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 09:47:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85434-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fhZDjZE5; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-85434-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85434-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C9518B25AFB for ; Wed, 28 Feb 2024 17:26:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8AE815E5CB; Wed, 28 Feb 2024 17:25:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fhZDjZE5" Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48C493FBB8; Wed, 28 Feb 2024 17:25:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709141102; cv=none; b=Lc96hPzwqpKeP51jMI/iXIUBFBX1yneEB43eO0qwKmd+D4PRZit0i9WuozlEsUj/qcWwWTyEiWrisYXc2gSnEAjz/GF+g0//EEHtfqy/2u8vf3TTFRwMgpaWWulA4g2gXvqbKKRZfjf7alL+U9xC79MO4oXYXnWdo7t2sXu0aXE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709141102; c=relaxed/simple; bh=SerkEEOhFHgQhL6B5KOfbJy7Xh/5sx5fpYi4n8/GJlY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YjCZWulMun5CDX07qFfrkFw3A2sxSNj+4NtaL9tOyX/N4JsTrLNCS5MqmTC9pBOzk7tT6WKkhiJHDo2c7y6PNEkbamHAfc6G2HKPFbKh7SgBzMOHg2lfOgscC7+9g4TwzK8wbItquRW+4tdF79johZf90sEGiyQ+93+AgP+O15I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fhZDjZE5; arc=none smtp.client-ip=209.85.208.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-565c6cf4819so1900156a12.1; Wed, 28 Feb 2024 09:24:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709141098; x=1709745898; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gWoavvnvgfbtqyMWs0zbwswYMb/yIFlUZfju4MgDQEE=; b=fhZDjZE5mZD1pZ2w994xTSmV5XG3RVbuVNKIiHpbUrAM7RG1sCyg3qjADT50buVWW1 b4sI2w2juJVKoMFeHYb1QZXcFwNw5JNOXJf9mkKJvM71SWLSDZkOVTAa9zt2BcmnLqLb 4n1fD04TFAGrAjyTe8dUaGvwI1LzmhOwvE9wkaqqU9HSXaOcsn5m3ZNB018NfbDYkjJV 3lL9JA3AT32+ZcvNql3qgQxUjVAHTWJnye6I6tjXOEvENQXYooxkE1+aHClZ47mjxsBn yl+9x2jY1Jne09isjnUDLcbpJEhHoZiYlgxXrIW5LiO543ttDqk4HMDWTNUCGVhZN/I4 z0NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709141098; x=1709745898; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gWoavvnvgfbtqyMWs0zbwswYMb/yIFlUZfju4MgDQEE=; b=qtUlVZRWibP2mIEBR2BDb1xnMwemKng1aGSJiHDEbLpytsJUYdaHBLcRmOeMI2t1S4 GGi+FUpg2hsTOYK1ZLD0C9hNoT7Q1WRjZy8qDDzR0ziBaPdm+BGJ3heGkRznco3suf2X FlXtQbMNsVUIYvxt1LMgtBYQBgKC28d4ttgJUSloZkE8Feff8kXGaqeXeiBhFbGqR+rd +dO/2pQqwJp4w7E1PFNyxrgZN2tmMKmX+MyjXzdCsvBJG5dE+rhg6dSoqLAK4VUyrIeO nzv1G9Ekz6cY1z7qO+Ok9BNUr4YgBNnm+DojvtRO4v8UEYwwESDE6qbVMMsxs/KcBREA 3E7g== X-Forwarded-Encrypted: i=1; AJvYcCUodvC5a0d+UAJrRftQPR4XId7TY0ObZB/F7BEq02ZTM4nViAHXvtgdhskcH+LT185SG5962P/zy2HnsgjIoHCd+cohV3Pmz/obTYMuQMvSDdenIZI9zn1GKg/4TBYpxzxqkJ4B+xxMVRrM02VMJ/4M+zc9fuN0ONidX5UiBCa5yefilA== X-Gm-Message-State: AOJu0YxgL9xUXux59ifYpqJfvJsmiZvc3mvESG561AhAKpvZTzMwldJj 28Uz7EW5/Mhc+M1g19KpEWRDaa5+Fio4YiUGxNZSnfHxQdXeQcI6 X-Received: by 2002:a17:906:a399:b0:a3e:5ebf:345c with SMTP id k25-20020a170906a39900b00a3e5ebf345cmr76475ejz.21.1709141098459; Wed, 28 Feb 2024 09:24:58 -0800 (PST) Received: from fedora.. (cpe-109-60-83-139.zg3.cable.xnet.hr. [109.60.83.139]) by smtp.googlemail.com with ESMTPSA id ts7-20020a170907c5c700b00a43f4722eaesm926910ejc.103.2024.02.28.09.24.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 09:24:57 -0800 (PST) From: Robert Marko To: andersson@kernel.org, konrad.dybcio@linaro.org, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Robert Marko Subject: [PATCH net-next v2 1/2] net: phy: qcom: qca808x: add helper for checking for 1G only model Date: Wed, 28 Feb 2024 18:24:09 +0100 Message-ID: <20240228172452.2456842-2-robimarko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240228172452.2456842-1-robimarko@gmail.com> References: <20240228172452.2456842-1-robimarko@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792165772943527278 X-GMAIL-MSGID: 1792165772943527278 There are 2 versions of QCA808x, one 2.5G capable and one 1G capable. Currently, this matter only in the .get_features call however, it will be required for filling supported interface modes so lets add a helper that can be reused. Signed-off-by: Robert Marko --- Changes in v2: * Get rid of the if/else by Russels suggestion drivers/net/phy/qcom/qca808x.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/net/phy/qcom/qca808x.c b/drivers/net/phy/qcom/qca808x.c index 2acf852fb4de..a4c61a8e07c3 100644 --- a/drivers/net/phy/qcom/qca808x.c +++ b/drivers/net/phy/qcom/qca808x.c @@ -156,6 +156,17 @@ static bool qca808x_has_fast_retrain_or_slave_seed(struct phy_device *phydev) return linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, phydev->supported); } +static bool qca808x_is_1g_only(struct phy_device *phydev) +{ + int ret; + + ret = phy_read_mmd(phydev, MDIO_MMD_AN, QCA808X_PHY_MMD7_CHIP_TYPE); + if (ret < 0) + return true; + + return !!(QCA808X_PHY_CHIP_TYPE_1G & ret); +} + static int qca808x_probe(struct phy_device *phydev) { struct device *dev = &phydev->mdio.dev; @@ -350,11 +361,7 @@ static int qca808x_get_features(struct phy_device *phydev) * existed in the bit0 of MMD1.21, we need to remove it manually if * it is the qca8081 1G chip according to the bit0 of MMD7.0x901d. */ - ret = phy_read_mmd(phydev, MDIO_MMD_AN, QCA808X_PHY_MMD7_CHIP_TYPE); - if (ret < 0) - return ret; - - if (QCA808X_PHY_CHIP_TYPE_1G & ret) + if (qca808x_is_1g_only(phydev)) linkmode_clear_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, phydev->supported); return 0; From patchwork Wed Feb 28 17:24:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 207931 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3493776dyb; Wed, 28 Feb 2024 09:26:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVe8LXvRvK4M1OCYrX48MZg7CV9/5+27xptO3qOEDVoS+Yk74VwbLQNJy88b3FX9HNBsvLIQHEFrPnbKy9c3N4HicodLQ== X-Google-Smtp-Source: AGHT+IHPt+VYxKamNIcRSPd0zY9uiCJYjxJmH5lu8HRboeJHjPnXqTSPZsz0tvqAwA6b3A0Doj17 X-Received: by 2002:ad4:5d42:0:b0:68f:f74f:50fd with SMTP id jk2-20020ad45d42000000b0068ff74f50fdmr8663510qvb.18.1709141175456; Wed, 28 Feb 2024 09:26:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709141175; cv=pass; d=google.com; s=arc-20160816; b=EPMXQCe4dzs10n53ELUPLOyC7K+7QPnpD8e6SZPrGVJlyMtPJRuwCYkziDLK4wYhFz l6LREh/Co8fS8wBPlckaevFO8dqF4co0wr1EDXcrAlQFaI8J1tyTnLDDLurVQ5zMquLQ wjnvMlCX5sMmKavBOLmJT1z0qAVBv+DOhMN/6k+pP5FHrA2BtS7rF3HeZHmPQnZhbsoE xVkVKvERxGI4FhUAOPaTlpPmdWpsfgfdItUVst03edVuURX8DFwsC5Udx/18Jn3pb5MG YgSAzxGgWJR+MfFGZeQg433OpfYAKJkUP3bBOtWatbg14BbUtHO9D5cl1KqKkcysr1zB 0Yhg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=jytqVH/5UszT5WvJsP0t7KjpRUDElZgmVoiNlcchCAc=; fh=MhW0SEl3AOg8/+/GRk57vF8bOmeYZYevkxyLScjFTTU=; b=FPMKlHLA4Yom0WT6yCjPucbgW7JlmvUoFJoBG/cJfFmVpc8/dicM99e8CvWQQ/SlWq xuai9ewM0VNczAU1UepadRfI0YjaaJ8Lr/RNOSnqNblTaCnS+N+q9kmVjXPEmP1BF6l8 jGv+23OPmFHNENoGuQpAAkOe1SgqXvsG+BuCwrYoaH/phzcHX6pyoTzuFXFy5AZ7LDeV NCXforxNfj2vs24vVyqDFJsZ0+TewdJKx037Wj7lDVAa1hOPLGxQYH0MvPLqTEomGebY Vk/U8QubLdBn281SNzTI+GytOF8mIgV9zBHzkd7ypGtCau/t04N+a8NsYf1z8wWCTMvr tbnA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=DYh4+uVL; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-85435-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85435-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z22-20020a056214041600b006901a0cf9cesi5048594qvx.565.2024.02.28.09.26.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 09:26:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85435-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=DYh4+uVL; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-85435-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85435-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 41D401C2031C for ; Wed, 28 Feb 2024 17:26:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 45AB3159573; Wed, 28 Feb 2024 17:25:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DYh4+uVL" Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED73B15D5B7; Wed, 28 Feb 2024 17:25:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709141103; cv=none; b=cpNaA5XJl2yuFni1jFjKCxEDJQhAur0DBrhIeLR3rS4SSDVa0pkCbqvOhXycRF1khuEbEdN+oP13jPeXc6U5rR9qX1l8cTL98BpJkgjW2JEml+ONYZOlnwMCGw4KeF3qEXfCTGPvEaamTJ0RYC5o8i4Q3FiGQ5SqD0nlw1hAYg4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709141103; c=relaxed/simple; bh=frA2gI+sHqG83yObCUgFM4FLAm6X5cpJvaIjmG41mD0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HljeB/rX871J5/tWloa5cMdtzFXWuHk2PvuW2gKSEJ9/mHlb+iQ48LdcVg4ARYXmRn0/PSe/afAgwt2ohJDNPA+1MdhkGo2942ueqw58nklmR2sMJuZZYAGD3lx5yfxxLG7BeBdEOYWb3R+rLDbfa7OIs3yzVAH1O/dJgO+kCEg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DYh4+uVL; arc=none smtp.client-ip=209.85.218.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a43fc42e697so2519366b.1; Wed, 28 Feb 2024 09:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709141100; x=1709745900; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jytqVH/5UszT5WvJsP0t7KjpRUDElZgmVoiNlcchCAc=; b=DYh4+uVLktIjWyG03M4FRlULwFcJUf+ZRTPu0L3d7LPcfBzRjjg432VlK//hRSIZec Rbg+z+CuOMKDIxLyFm6VJAhx2QYOJQC6e3bpKRGHiWPU8atSGiWJDPoW39mxSbk6c1eD D/maVzTIzF1MsX17QCVzQyqm7nulq6UWY/LVZjf9u4p9GDfYS3I/JfCqVqEZsdtlFcdr CpiKj0YLzP//obAPnXazSzCAZJfayfPYRthUKNvUZQImlWCJnXdj4HBAdG60K2msIZIV myXaBH8XAoH8xuI8MMOCIwe6HpzEzqIDZvjcsW+ni7BVv+gCrsF5tF2qq3FzCUCOoGps GTDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709141100; x=1709745900; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jytqVH/5UszT5WvJsP0t7KjpRUDElZgmVoiNlcchCAc=; b=AqJoiB4sYfCupu/1/xLLKcywSYC88sgkJIEgONBtUkTXNJu2wczG3T2jtVseCljqsW MnAXaxw+R8ext68ZnG1jD+xvxvutTJkrtmy7aAw4IWPjF51ocs6uc7gq6CnU2xub549X RfQpaE6hHcjd50a5v+JVDKRZDU5a+Befk8tp2uwnvi8ExkhObtN+U9stDzmhwF1cSLT6 xc0HeU7q+IT++0Ck/Tm37EWKAcMBlNWujSVci1IhMt/kvmjQ8Hi8+NlVAHOD8ycNzWjo SrGFJZxtn+uZgQ8kOCv1DVJetVjZT24SneqFHTKWULmbBlxZFs9lFEORXaLkXSxa1/bm 1l/A== X-Forwarded-Encrypted: i=1; AJvYcCUjgD0NYYv6OF/i6EIgva6p7Lob1Sw1vwN8HjXLCD3nRzfI0RD4Cx3MXJlfggZqfIZD++g6/Aoku4jY+jwQ7vmZHVCAAOwJc080jhXZ4ZAYzs5z3dUkDAZJZUgIhlIluD342SWXRKJAsAkbd4rEcwP2lU6Zm1UPd2XNcjQHZWskS5BmGg== X-Gm-Message-State: AOJu0YybdR5991fpWFs2M3Atl81kCxXsyFauYoa2rNTvfWCTryS1+kEw wchhJ0Vu2IXFQ/XlFNszUxP3G7BftGXFfgI6wsK6qVjYHmdsuCyX X-Received: by 2002:a17:906:454:b0:a3f:6466:bbcd with SMTP id e20-20020a170906045400b00a3f6466bbcdmr212959eja.69.1709141100124; Wed, 28 Feb 2024 09:25:00 -0800 (PST) Received: from fedora.. (cpe-109-60-83-139.zg3.cable.xnet.hr. [109.60.83.139]) by smtp.googlemail.com with ESMTPSA id ts7-20020a170907c5c700b00a43f4722eaesm926910ejc.103.2024.02.28.09.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 09:24:59 -0800 (PST) From: Robert Marko To: andersson@kernel.org, konrad.dybcio@linaro.org, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Robert Marko Subject: [PATCH net-next v2 2/2] net: phy: qcom: qca808x: fill in possible_interfaces Date: Wed, 28 Feb 2024 18:24:10 +0100 Message-ID: <20240228172452.2456842-3-robimarko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240228172452.2456842-1-robimarko@gmail.com> References: <20240228172452.2456842-1-robimarko@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792164383954510978 X-GMAIL-MSGID: 1792164417474981127 Currently QCA808x driver does not fill the possible_interfaces. 2.5G QCA808x support SGMII and 2500Base-X while 1G model only supports SGMII, so fill the possible_interfaces accordingly. Signed-off-by: Robert Marko Reviewed-by: Russell King (Oracle) --- drivers/net/phy/qcom/qca808x.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/phy/qcom/qca808x.c b/drivers/net/phy/qcom/qca808x.c index a4c61a8e07c3..5048304ccc9e 100644 --- a/drivers/net/phy/qcom/qca808x.c +++ b/drivers/net/phy/qcom/qca808x.c @@ -167,6 +167,16 @@ static bool qca808x_is_1g_only(struct phy_device *phydev) return !!(QCA808X_PHY_CHIP_TYPE_1G & ret); } +static void qca808x_fill_possible_interfaces(struct phy_device *phydev) +{ + unsigned long *possible = phydev->possible_interfaces; + + __set_bit(PHY_INTERFACE_MODE_SGMII, possible); + + if (!qca808x_is_1g_only(phydev)) + __set_bit(PHY_INTERFACE_MODE_2500BASEX, possible); +} + static int qca808x_probe(struct phy_device *phydev) { struct device *dev = &phydev->mdio.dev; @@ -231,6 +241,8 @@ static int qca808x_config_init(struct phy_device *phydev) } } + qca808x_fill_possible_interfaces(phydev); + /* Configure adc threshold as 100mv for the link 10M */ return at803x_debug_reg_mask(phydev, QCA808X_PHY_DEBUG_ADC_THRESHOLD, QCA808X_ADC_THRESHOLD_MASK,