Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6506444rdb; Thu, 14 Dec 2023 23:44:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGLxRNZVwOLgqc9LMQmGoqlUFoYQqHzsVVd8XJFhwHaP8L2+pDYUdb7T4KTs3TIAMvsPiF9 X-Received: by 2002:a05:620a:2451:b0:77d:c7f2:f48a with SMTP id h17-20020a05620a245100b0077dc7f2f48amr16350060qkn.18.1702626257130; Thu, 14 Dec 2023 23:44:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702626257; cv=none; d=google.com; s=arc-20160816; b=i9eJEJKcJ4dqnDDjn5yY+tzJbXSCtkH7MnJw9xwO6DYARYdY9xN/BkOsf9Z6ImNgIc k7q3mOt9aFDcj41cEOz9CNxd8e4qe8vuG9YZEEtQvD1siBFh39r5QjcvW+veC16gFFO5 Qdz0ndnnQnRvndjuadAOdF+edhquZ8iPLSUkysT/2fgIIQAJ9LvH/gHslbv4RhLc4Hx/ ofC7EXFPmqazgws4XeDX9dDAnF1/2tTJQAUPN8b/G6YfskmHLJk3/DX1+iGfPQLYslzN O+a9ZZokRqGtrI2OZO2qJ9u1yyxCGKnC8lfGsGvQfv/fSUMrOJ3LYwAFabgLZ3AoHxYF g6pw== ARC-Message-Signature: i=1; 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=dJ5kQvuoEbVrG4WmjFAM8eSccltqgqQY4QEeEFSI+gk=; fh=/GuWXIFJTb2Z3LVYajHwooJWphp6NrpriHhj5GHcik0=; b=ZwTDR5SWJg8BHalECkWM57OZ9do22bCsKxVeLvJ5FRNhM9JzQRLo+p1I4nJfO+5x9P tIY/ifp8iOqpqWTfd2ppPdWLDN7Q6pM307QmgYRv7D++KWWKAOin8PklLny1ItKV+37n jmBfSGphsyR0Tum1m9l5lNDjh9DlRupt2sb5/a2WSrDZPog9QanIg8KSat4B7UidavX9 G7kBvsc30VNX4niiJM7TDNNl20gyY4vMVblHcgLqbqbyYcw5zwV66oRBk+bkePB2dWW2 11BXl6mpodpcImWH8+hjsgG2eyK0IW2S0HfAv/h1Jak5dfVN+/u5/8HcuVtGB59WHbSR wHOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=HlI6XGqb; spf=pass (google.com: domain of linux-kernel+bounces-548-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-548-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o20-20020ac85a54000000b00426055863a5si2539687qta.683.2023.12.14.23.44.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 23:44:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-548-linux.lists.archive=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=@quicinc.com header.s=qcppdkim1 header.b=HlI6XGqb; spf=pass (google.com: domain of linux-kernel+bounces-548-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-548-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.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 C1CBE1C224F2 for ; Fri, 15 Dec 2023 07:44:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED07E1EB5F; Fri, 15 Dec 2023 07:41:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="HlI6XGqb" X-Original-To: linux-kernel@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 714681947C; Fri, 15 Dec 2023 07:41:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BF4o2O0022299; Fri, 15 Dec 2023 07:40:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=dJ5kQvuoEbVrG4WmjFAM8eSccltqgqQY4QEeEFSI+gk=; b=Hl I6XGqb3okTHmJAtVktLZ/3egBSh309JPdCBGLNWklZlBe6SvWdoX32SpYE3Ulnq5 QBXoDTKOdPc6o4SiOyxl4WxPE4pWMaZb5qPzjq3wHAYnj0HgPt7g2ksmfVQjDvfj 1106D0VZINS4K8f5IlttrXqeXD1adMr1qJAE2XYAUI7OCL1F/JPX/BWT159rDxU8 yTR7owizsmZqDbxiVvJ54slzsLpSRXqbakmejYc5W663wVfl/UzifM4RFaeLW2Ra aQkLYj2qZQW8+ySVAmlsPZqIp5McAmmDqHcMm1nG6koR/FnkRZ8yIxRyYuJ7EBj4 fkT/udd3GkHlc9zUJ73g== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v07c6286b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 07:40:58 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BF7ev71021940 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 07:40:57 GMT Received: from akronite-sh-dev02.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 14 Dec 2023 23:40:53 -0800 From: Luo Jie To: , , , , , , , , , , , , CC: , , , Subject: [PATCH v8 07/14] net: phy: at803x: add the possible_interfaces Date: Fri, 15 Dec 2023 15:39:57 +0800 Message-ID: <20231215074005.26976-8-quic_luoj@quicinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231215074005.26976-1-quic_luoj@quicinc.com> References: <20231215074005.26976-1-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-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 9Z0uW0s37wvLdjGJ4fJsZZfAowzMiEOz X-Proofpoint-ORIG-GUID: 9Z0uW0s37wvLdjGJ4fJsZZfAowzMiEOz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxlogscore=954 mlxscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 bulkscore=0 spamscore=0 phishscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312150047 When qca808x works on the interface mode sgmii or 2500base-x, the interface mode can be switched according to the PHY link speed. Signed-off-by: Luo Jie --- drivers/net/phy/at803x.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index bb382089ab77..cd1bdb61d122 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -2179,10 +2179,22 @@ static void qca808x_link_change_notify(struct phy_device *phydev) QCA8081_PHY_FIFO_RSTN, phydev->link ? QCA8081_PHY_FIFO_RSTN : 0); } +static void qca808x_fill_possible_interfaces(struct phy_device *phydev) +{ + unsigned long *possible = phydev->possible_interfaces; + + if (phydev->interface != PHY_INTERFACE_MODE_10G_QXGMII) { + __set_bit(PHY_INTERFACE_MODE_2500BASEX, possible); + __set_bit(PHY_INTERFACE_MODE_SGMII, possible); + } +} + static int qca8084_config_init(struct phy_device *phydev) { int ret; + qca808x_fill_possible_interfaces(phydev); + /* Invert ADC clock edge */ ret = at803x_debug_reg_mask(phydev, QCA8084_ADC_CLK_SEL, QCA8084_ADC_CLK_SEL_ACLK, -- 2.42.0