Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6507227rdb; Thu, 14 Dec 2023 23:46:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVp60RSDely/gUmjtZGbIME8zhPn6/MEPLJ1oFgEUWyW2CY3qLVsB2Bh2xKCeJ7VZoKAEI X-Received: by 2002:aa7:874f:0:b0:6d0:dff4:11c4 with SMTP id g15-20020aa7874f000000b006d0dff411c4mr1489283pfo.60.1702626400390; Thu, 14 Dec 2023 23:46:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702626400; cv=none; d=google.com; s=arc-20160816; b=F1fGn4kL5dJdB1bqHKGmOshDO6OyWy1St38R4WECdKRvKEsvoWrRY7Yq6aFfzwHJPQ XUkYDXFd9h9XUevbf/4svIu7av/GBg9KY3TPgtO9ooqZDGJWvlOVklei9pS+ZUqPBm9X eT8tbO17xwGxsOlTiaEi+E2kDaAo5S6afqTv4Yr0RW0Ed+4Z1aT8MpO5aU6pkw4Up14w ObO8wJSkrzvM6qL4mHtu8y4Yz1tGbGbaWia34tJN0yHw20FAb1GpugJfZdfk5CAJt4ss 2CIGRhwPXRPcMazwXoA0DOkp9NiVsCdRw76JLboCD/IIyFQczGRsOcPiKsi22xjUMnVc tjHA== 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=COfUyW12yKbUJKTrvajK+hp9Yxx6QQ5yu09VqYHfOPo=; fh=/GuWXIFJTb2Z3LVYajHwooJWphp6NrpriHhj5GHcik0=; b=nYSTffSM6bl91pwTugwpEAk4Ge2R7IFe6nWUc4VIhzLM5Qd2YpyfRt4axquGNqEt2X McvWfeTI5ZCimwZJOuA5HJoUyRXY9HG/yW+4/wt2mJTMQZ2yFS0HwoLZenCMBlnxgWpI Xg/AkO1mtoZE4qlEsIymDgEgwRqGqgwYbk99kdmxp1d2x4SwHvn3LNsu/Ozn8TGtlKEP vV7vrfO6MO7GGH96SMPPu0yMyBe5+txftpYT4Pyc4vDUUMW/pCwUPLHVqx/p7PZKSzZP USOkgc94SNJhLomp3spOsph83OlC1zrtOnutbHiqbSkXPnPYp964A27F5fYxRmFLyeXt LHrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=AvK0MXAZ; spf=pass (google.com: domain of linux-kernel+bounces-546-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-546-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t3-20020a62d143000000b006ce9e6c0ebbsi12579316pfl.361.2023.12.14.23.46.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 23:46:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-546-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=AvK0MXAZ; spf=pass (google.com: domain of linux-kernel+bounces-546-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-546-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 1E355B21967 for ; Fri, 15 Dec 2023 07:43:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0667519BDF; Fri, 15 Dec 2023 07:41:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="AvK0MXAZ" X-Original-To: linux-kernel@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 582D6199A9; Fri, 15 Dec 2023 07:41:07 +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 (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BF31Wfh007822; Fri, 15 Dec 2023 07:40:45 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=COfUyW12yKbUJKTrvajK+hp9Yxx6QQ5yu09VqYHfOPo=; b=Av K0MXAZFib8WMT0h7RqNfr7fY5UNhCDTWYHn/tRuxlw884wBBwe4364oqdNnF6YSx r6C7SYAyKRpTI2VPTO906qo6AEPULDZoxm8F3a0jIEekyye4rQwReH0kYEU6i8un XZ3V8Tz2jv1JQRrqgf2GdDniWy00XmYDtIfMaMaXFvwJ+yG/9a+DdbdCs2KzSLfy KNe4GVzINvNBo2cpMcjz2JhPNxR8bZG7JzWZ6UFr+z1j/vysI5pGnVhhDchJ+P1P jQjvqHC+eDREonfcZE+YQsyU+i4Ul5av1sSYNp84M6zC5dx/5vVeOavYLdghx9dk h14pIcvfvxXSge0DWDdA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v081t187b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 07:40:45 +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 3BF7eiUX021364 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 07:40:44 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:40 -0800 From: Luo Jie To: , , , , , , , , , , , , CC: , , , Subject: [PATCH v8 04/14] net: phy: at803x: add the function phydev_id_is_qca808x Date: Fri, 15 Dec 2023 15:39:54 +0800 Message-ID: <20231215074005.26976-5-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-ORIG-GUID: vkpgm86QGS0hbMM7UgUen8kf5lIeZtyh X-Proofpoint-GUID: vkpgm86QGS0hbMM7UgUen8kf5lIeZtyh 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_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 impostorscore=0 adultscore=0 malwarescore=0 suspectscore=0 spamscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312150047 The function phydev_id_is_qca808x is applicable to the PHY qca8081 and qca8084. Signed-off-by: Luo Jie --- drivers/net/phy/at803x.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index eacde4fa5d6c..1030896dd546 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -922,6 +922,12 @@ static void at803x_link_change_notify(struct phy_device *phydev) } } +static bool phydev_id_is_qca808x(struct phy_device *phydev) +{ + return phydev_id_compare(phydev, QCA8081_PHY_ID) || + phydev_id_compare(phydev, QCA8084_PHY_ID); +} + static int at803x_read_specific_status(struct phy_device *phydev) { int ss; @@ -941,8 +947,8 @@ static int at803x_read_specific_status(struct phy_device *phydev) if (sfc < 0) return sfc; - /* qca8081 takes the different bits for speed value from at803x */ - if (phydev->drv->phy_id == QCA8081_PHY_ID) + /* qca808x takes the different bits for speed value from at803x */ + if (phydev_id_is_qca808x(phydev)) speed = FIELD_GET(QCA808X_SS_SPEED_MASK, ss); else speed = FIELD_GET(AT803X_SS_SPEED_MASK, ss); @@ -1073,7 +1079,7 @@ static int at803x_config_aneg(struct phy_device *phydev) */ ret = 0; - if (phydev->drv->phy_id == QCA8081_PHY_ID) { + if (phydev_id_is_qca808x(phydev)) { int phy_ctrl = 0; /* The reg MII_BMCR also needs to be configured for force mode, the -- 2.42.0