From patchwork Tue Feb 13 21:39:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitri Fedrau X-Patchwork-Id: 200667 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp824499dyb; Tue, 13 Feb 2024 13:44:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVJaJx/y4Bu7boSEhJnqyjMSuZlX5m0DlQ5ChnTA627Xtk8B5BYgnFEAoUQfMzhGW8+/GUXzl9SC8kOrD05jQ5tjUIhwQ== X-Google-Smtp-Source: AGHT+IHeE7nYz1Je+2MF7T/bzpsVFhJ8BQn92qPXz0MJK1CWpKPqshtPgEuOqkKWbvjfJwj92if4 X-Received: by 2002:a2e:b603:0:b0:2d0:9a5c:622f with SMTP id r3-20020a2eb603000000b002d09a5c622fmr539692ljn.15.1707860650259; Tue, 13 Feb 2024 13:44:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707860650; cv=pass; d=google.com; s=arc-20160816; b=MTzkZr2jBrUbW2A3xz3zZVRTRTHMWCUzJnC++kf8UF3S4kj013LXrtZMzRO33QJRTW 6gtJ46gGCiLPXCImanfgdAlh7eKjo6CsQZTkFM7Weg9eJJhk0mgSYZMGfTMqN6Wx2SHT MnrLrh6C/pFluPjh9DIFfT8D2y09az6GnwzPQ7VzuRPXji44LBHIjP2ihVG8NQKXJOfq WW0Ko35HiJRbcyMxjd4+iXlMTebAGrgpaP4ClazBRe5kOiYXDZqDKqRAKDPOasyt8sSS ump+UN9294GHlsKSRJYIrm5mCS2WofMmzUX7naEwlzJ9gXAgXhXsIv/8Zydp6/1zlMLI +Yyw== 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=zhBVbpbbNuAZsJD1zsfWWGeNA5wuPbJ+/FGELo9o7pw=; fh=Fpj0URBn5aDgt6DIhZuPkvIbvfzh8x2vCDnsb1CcK/4=; b=yf4GN+S3bvdy1PkeaGT8fIO+y0DtYOzWXKQYB+OSensNiybxcGYGsDRJVNF1eDdntz xCJGq1Fbpt7s3aX+PVxWOOFHFN5t6KvXZ7uzwCtx1Ssrg6y9uoVBExOsrzs5EReLYlFc jRD2RDOoIFvTpmG1T5glmHRzmrF6672I0PV0ILGdkMk2UeKv9gBKcO/OLwCd6utaqC9P pTsd08eHotavVo5TuFDAMe/iq2r1ZyuxQizaU59r8+i6vpKsEufBan+b8gXwQk75OUuH F4pj6n/1oMbCJLU3box3YEveEXADdxyYrySFWJZrZ2KAKN9lfU1OtdKLJVJJcI1u5qF7 YG8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=a7Q9Vabi; 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-64359-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64359-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCUQ+JBPmkK533AHP1WEBoUK73EYet6J3ZpSlclIsbx0R/HpvuP+8j8A34CwvTRhkSyQcaFGf6fqyNZqOuVhQoMAqBPR4A== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z17-20020a05640235d100b005610bb92e81si4388776edc.637.2024.02.13.13.44.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:44:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64359-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=a7Q9Vabi; 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-64359-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64359-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 am.mirrors.kernel.org (Postfix) with ESMTPS id D71591F21898 for ; Tue, 13 Feb 2024 21:44:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B999C63511; Tue, 13 Feb 2024 21:40:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="a7Q9Vabi" Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 4110963405; Tue, 13 Feb 2024 21:40:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707860435; cv=none; b=u6vpkYuf2Sh8qSHlaNETos6n4HDiZs47FyR+FOewikKUA/U8bjG0FKZx3QN+im3d05lHCvzky7YHlWVpg0alXNsM/HxsEZDaJg4jlJxu+hWAV4b0ASwwG+2fbtXgR+Tz6MG9dmgE8opA1R+45LvENygyU5ujMfF30t4fqvi0mtI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707860435; c=relaxed/simple; bh=gF3/8s9rdHbLqFLOpYOvq2ihfs6x9vepRDOvp4fgqQw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PApg1x0XdD5n9pE/YI/YaumCMv1+IXibBEEv9Py0BtOUGRUp0j7/jTGhFlreb0GaDYh0miy8M6y8x5LYysiphHVg4B119Hy7ssnpL6OPy9WwEzCfv3OCVor2rp6TmhfSBmuR7yBrkF80HvD+d+v7ycbUKSdGgD2qYWhiHjHxgQ0= 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=a7Q9Vabi; arc=none smtp.client-ip=209.85.208.46 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-f46.google.com with SMTP id 4fb4d7f45d1cf-562092d8135so1109671a12.3; Tue, 13 Feb 2024 13:40:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707860431; x=1708465231; 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=zhBVbpbbNuAZsJD1zsfWWGeNA5wuPbJ+/FGELo9o7pw=; b=a7Q9VabitixcH+zk4fDn9LsKDHooTy4AYI6Fh2AQF05wI65gGDz0P78s6mvCmkw3Dk YIELNJevD/NxRjDwPLQrXZMpDFwbaIloexm09+XDu+rdJbDC49XX09IKX7rKS0/r3bso ob4X3JWV+BAcycXSYkFGMQFXsclGN2b1zzh6MMaS0f6J9XMZGoO0A7esjwVLQrKqluwa DkRClwkMI5TXN7i2NCGH6nliFsQI/UwPlziGOPt+RMyHcjg7niy+QXX9By1sYGC8Vnh4 x2cOus+2aL00uuTB6XeEpi1X2SySff4zy9uLRFZqKvpN9RuYsIchLyNPNzMY3UqYVM4v 4a7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707860431; x=1708465231; 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=zhBVbpbbNuAZsJD1zsfWWGeNA5wuPbJ+/FGELo9o7pw=; b=o1X6buqKvmXLjf6sfMKuovj6HFfxW+DJEo8+K+67QiTG0QQSG3UJTUSMNnEkZwebMX R0MIR875eR228JaAa1OQDJzLCV2cKy0i6ir+SxJQbdWhMb/xsmeAcPNki40hooVdmd5z juocjrN/KDZCzV+/nPCWtZnNgcwnXADSyj/iAhtgMfiYORxRvJTIZYjyd9bWE1uH9Nss be7QdHYaO++vjFnuz95NmPrhuXtRlrHwEVGE1lhIYW9xpcUdrb3jzZjGJ/hwbLlGWTd/ ZU+Y05LgxdexXF+LF1hIHRoDTXkIRc0E1K7/us7mtRlHsnpY+u1dNbxI71qEOCVi9a6H C6aQ== X-Forwarded-Encrypted: i=1; AJvYcCX3GIetEPbe6ps5ACpADNcv9obDfMy4/0mzFLCUd73a/RzgqabKetOK0IhkVk1ghY3YiJGThxFQW8UT2sw8wVe1x9oWJR8rp5G97UoeQC1Avip6YO30+pT7qiZVd+CRTHAeiCCY X-Gm-Message-State: AOJu0Yx/t5v3ozirJy8HBXXWjDqiX6omnwhaziktsGWazasBRd3Cj2Lf jsxTWVQohKtaH8uuA+bEVJPaMO0wOsvtZFuxOfXMssLvfHS/rBKR X-Received: by 2002:aa7:d40f:0:b0:561:347f:ec5e with SMTP id z15-20020aa7d40f000000b00561347fec5emr658984edq.32.1707860431349; Tue, 13 Feb 2024 13:40:31 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV14mgLi7UAldNfOM7ldyU+z5AKMxT9vIVRrtCfdDFhRce6x/g8zjelO2mDlObMgoiw2QVv0jLgEDSRUaBnRR3oarP/ik89IPGODjEg9L1HliXXwcIe9Ney9T6Jd7DNVDaVgxpFgntrAOtXUkt9n6vwQdRLA/rgRLywrM1muX3te+s45fBqjyrHJG4I/eJrobXpYbeQFHf2xDr7b4HOrvJ8V35dzkFyFeYcUHn49YjLougZpBjLZN1Lr6iWTwxNYLlP3dyxiCOzTN9cw+h//FemK+uPhR05mSYv4kX1z66ddbmKdtOCBhl4GCZMLs+vmDUDJr7co25b8O1LJz61mHFDkAk= Received: from debian.fritz.box ([93.184.186.109]) by smtp.gmail.com with ESMTPSA id k23-20020a05640212d700b005612987a525sm4003913edx.89.2024.02.13.13.40.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:40:31 -0800 (PST) From: Dimitri Fedrau To: Cc: Dimitri Fedrau , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Stefan Eichenberger , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 net-next 07/14] net: phy: marvell-88q2xxx: add suspend / resume ops Date: Tue, 13 Feb 2024 22:39:46 +0100 Message-Id: <20240213213955.178762-8-dima.fedrau@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240213213955.178762-1-dima.fedrau@gmail.com> References: <20240213213955.178762-1-dima.fedrau@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: 1790821689120640368 X-GMAIL-MSGID: 1790821689120640368 Add suspend/resume ops for Marvell 88Q2xxx devices. Reviewed-by: Andrew Lunn Signed-off-by: Dimitri Fedrau --- drivers/net/phy/marvell-88q2xxx.c | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/drivers/net/phy/marvell-88q2xxx.c b/drivers/net/phy/marvell-88q2xxx.c index 7c7517af346b..8b8275552014 100644 --- a/drivers/net/phy/marvell-88q2xxx.c +++ b/drivers/net/phy/marvell-88q2xxx.c @@ -461,6 +461,38 @@ static irqreturn_t mv88q2xxx_handle_interrupt(struct phy_device *phydev) return IRQ_HANDLED; } +static int mv88q2xxx_suspend(struct phy_device *phydev) +{ + int ret; + + /* Disable PHY interrupts */ + if (phy_interrupt_is_valid(phydev)) { + phydev->interrupts = PHY_INTERRUPT_DISABLED; + ret = mv88q2xxx_config_intr(phydev); + if (ret) + return ret; + } + + return phy_set_bits_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL1, + MDIO_CTRL1_LPOWER); +} + +static int mv88q2xxx_resume(struct phy_device *phydev) +{ + int ret; + + /* Enable PHY interrupts */ + if (phy_interrupt_is_valid(phydev)) { + phydev->interrupts = PHY_INTERRUPT_ENABLED; + ret = mv88q2xxx_config_intr(phydev); + if (ret) + return ret; + } + + return phy_clear_bits_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL1, + MDIO_CTRL1_LPOWER); +} + static int mv88q222x_soft_reset(struct phy_device *phydev) { int ret; @@ -566,6 +598,8 @@ static struct phy_driver mv88q2xxx_driver[] = { .set_loopback = genphy_c45_loopback, .get_sqi = mv88q2xxx_get_sqi, .get_sqi_max = mv88q2xxx_get_sqi_max, + .suspend = mv88q2xxx_suspend, + .resume = mv88q2xxx_resume, }, }; From patchwork Tue Feb 13 21:39:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitri Fedrau X-Patchwork-Id: 200669 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp826839dyb; Tue, 13 Feb 2024 13:50:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUds/98isCSIxUF17bqkFrU8ojWgCsPtZItiLxA2wrKyv1CvEJXk44kpZKlTCGmZ9r1TUmpqKdI8q9vYrXSQZgJnAclvQ== X-Google-Smtp-Source: AGHT+IH2EKALPxLRBpniCwCC9B8VKY8BM4ZIArSxXHY2ipVO9uiy/1NxRgwCdVEaVrgHmRmTZ74K X-Received: by 2002:a17:902:ea10:b0:1d9:74ba:d670 with SMTP id s16-20020a170902ea1000b001d974bad670mr947836plg.52.1707861031581; Tue, 13 Feb 2024 13:50:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707861031; cv=pass; d=google.com; s=arc-20160816; b=fs6sen8+WugJL7q12WK9WgdLoMAZ9XXvjwbn3NKDlMcXmUnVY/tU9/+rp+0ZboGHMt c2IWuy+Ll0yyiIs/7MptLz2zFKS3CFO+wlZmkNtkGtVA/1P7IfdxNyP4WZkvwzUuDSkD WFoBX/ONYN3iDqCmF2GEflPrlpTyEKHO5yJCroozLTW4o8KpLpHQXe6XOMsRxfBrpr/P 1XzU1qgLamGuSv76jnSE4r2vtHRe1alOMsOmM4fDSMu1+07LHlWv9JDH0i81C55vHf8T zs4dIl/9y+j7LzpnBBsoa902WjJhjyhCfN1OyPV/GpRgbxhdN2SU3GuECrADbXCulqcd OJmg== 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=bcJJ3FGefuRL57N+0mLK5i+7gqMGAlu+qKUm/Y2d5zY=; fh=wUOyjcxSxCB82VAQWm8rPsjo4uOMsnosA/slB6JQFO0=; b=BJJUfKa1JLfiDxg9gEo9VIp0NYTeBgbxDdYP1do3sV3kOZ4Y6TV3MFhm42fyATg93a Wlvbculwcp3DkfYZJ6S0n2cO23BA6VWAsJNUTh7/ksYRBGS7JsEwa8tI4m9LrsY0o7UX ILEEn/OImWO3o47ejhP4+g1qcyw8CPCf9JljiBdNolBF97g1sflkgG77StvER2YL/34/ WKaXbfBRIj6Hs+w1ZG41YIPNvms1Sue//TTccze0/ytbFU4LK4XwtLytsiNwbQVN7gep 8NPQ6BhK6HJkLVTRWw4Dvb7mHVItoxYpfv89vYPrcgOZqUv4gbnxh+XUpWAo3XJHwhF9 jsyw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MvMwDxk0; 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-64366-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64366-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCX9wM+wtKb7lQpuBSU69XC3dEzRGwSuBaexr+kHQgFgyt/USdKfsGMpZT6QkVb33dG0GwevcHoiAWoD9RgFfZ1BpI1abQ== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id im16-20020a170902bb1000b001db579a9fbfsi109691plb.140.2024.02.13.13.50.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:50:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64366-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MvMwDxk0; 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-64366-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64366-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E01B928BFD3 for ; Tue, 13 Feb 2024 21:46:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 36B896216B; Tue, 13 Feb 2024 21:40:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MvMwDxk0" Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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 1625869979; Tue, 13 Feb 2024 21:40:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707860455; cv=none; b=i9QCrGMpveJ7RAAK/qycygXIOsbVTygIGwPjggzO8u+mqsa3+e4dKmkWuNcAS+bZD8yJYmI8w08N6os4XMrah+C3N8dvi5Zg6ThTY0swEzEiEqoFuDouZ7n0wGL+LiHm7jzlGVgC4BblCSkmnWh4ciofCz7pNPrj8Opmz0PfGpA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707860455; c=relaxed/simple; bh=buFz+dlNRbQQ6/K1paWq40VmJqIW++d4iyTR0Ulizao=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=T7T0Lg1Zjev4FV6sP3JbUsx/HQhRAxxA2V9zwsHtdDu7Nbfo7R/lr9hXYbjzoea8M+r4dLs2OavrtwZiKVt6N+PhVOBBcsT+QFRu0C70B6MrSeFSsfRnztkIUGyzgjKx8ckbqfVtYzoQS9a7ke7h4msHBu/pXIQ1RUltKzqiG9E= 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=MvMwDxk0; arc=none smtp.client-ip=209.85.208.43 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-f43.google.com with SMTP id 4fb4d7f45d1cf-5620f15c3e5so970677a12.2; Tue, 13 Feb 2024 13:40:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707860452; x=1708465252; 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=bcJJ3FGefuRL57N+0mLK5i+7gqMGAlu+qKUm/Y2d5zY=; b=MvMwDxk0btZ8FTwJfft4m8T0BTMX4wMc0/w3Pvc4HES0ichGvDOPF3CqsOa3IgC+Ud MyC3gdJHJTGwgYICMXR/qT7DKEjOoBO8MaKhd6MfiuTSMQ4YeCNtcqZmlcV52MK9pOzn hEIjDHBYluUtL9XHGySqTmTzwz5JmowxEiX0emkSgQ1Le4TvD6pdFBv0E+BjRpIKa231 TcERe+msg8VHGHFYGHzTJEzmZSvZpRh2A7HoRjFOBfEc/1FDp5oPDoy4QulizcSyKCtH oVX5Yh3b84n6rvk0IhvJsWE76hy0LH0lXlD1PhdyuZt2/q1YJD6WDqIhsfoYvCbQbG/U gkdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707860452; x=1708465252; 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=bcJJ3FGefuRL57N+0mLK5i+7gqMGAlu+qKUm/Y2d5zY=; b=sMJBLqlWroWu4y5lq9goS3KfmJWqlGJ2TZuv9xWgAJwds2s3/4+zh8E3FFFt8/NoXR +h4Yr5ikH/congVPIjyHTGq71VY8MduX7qZL2e0q21EtGc6aiUkwYKP1MesNYb35gitn 7y2tkKlwn8hZqxJUCvNWsWIN//eeKj+aNRzl0jr7prYOSqeaGO4EPlRTHfrLQx4X/CRZ ogM+MTu/BDreBOYSXcJlHWcCQ4v8gOF98EMP+9wvAut4TZo14mS3amDka1gBWVsDEIpk QwYth6RS9QSZjDrnJFC02AOGGM3EBQczJTHvNNWbFdBnM07chWZob+x6bAca0UFJfWXn a0zw== X-Forwarded-Encrypted: i=1; AJvYcCUIfQpSAodEq6tt/RWdmZA0CRdhT+WEI8MtjuuKGnXD2vwdrRMDH1saRiKvdL4BRkFH+SCx2PjD2RwyGoJUDoXBdn7IgPNIA5tIahtQzCAhnF4mT1jwAa4Rrq4+cyYYpD1bZ9rz X-Gm-Message-State: AOJu0Yw0dUVSmSPnd01nkJoekM36I0/dHJqq5VlyNr9GN+KgWM2umCzP ETIOUgT/BKZKtTfj2CUNoSPot31bnjPcwHjoJ1laxiUay0z3YbSM X-Received: by 2002:a05:6402:134f:b0:561:fd3f:d75a with SMTP id y15-20020a056402134f00b00561fd3fd75amr641329edw.28.1707860452326; Tue, 13 Feb 2024 13:40:52 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXV/RznNTpxucTM+oOK+M7Sxp5FheVEFgEBH3Q6MaRjMwlvSU49z/MGADjbpmuhXhckQSQNMjjhW+ZHQje3tAbjZhwqiB+XQJHZXEpIfTfboXNAApacb6isA2aNOd46LAyBAfLrKcGIBnEuPfzBDkYE4ykQk3TMYBr9dCDRQqpB0SUjUm9KdncNDh79oynVPdI9cPWvCN2LF22YBX7Ex0C3mJ7EjJRHW4QkUIuMTSs4GTHgGGcN/7b+pOvGwtF2ShKljJqMRR1J4bCFoXWVH97jlpzlpfi6OpIygB4YcaNAtFHzsA8oOxrldIXjX/IHN/E2ES8zkpUFsy//eA2JYQXR/Aw= Received: from debian.fritz.box ([93.184.186.109]) by smtp.gmail.com with ESMTPSA id k23-20020a05640212d700b005612987a525sm4003913edx.89.2024.02.13.13.40.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:40:51 -0800 (PST) From: Dimitri Fedrau To: Cc: Dimitri Fedrau , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Stefan Eichenberger , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 net-next 14/14] net: phy: marvell-88q2xxx: move interrupt configuration Date: Tue, 13 Feb 2024 22:39:53 +0100 Message-Id: <20240213213955.178762-15-dima.fedrau@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240213213955.178762-1-dima.fedrau@gmail.com> References: <20240213213955.178762-1-dima.fedrau@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: 1790822089148028026 X-GMAIL-MSGID: 1790822089148028026 Move interrupt configuration from mv88q222x_revb0_config_init to mv88q2xxx_config_init. Same register and bits are used for the 88q2xxx devices. Signed-off-by: Dimitri Fedrau Reviewed-by: Stefan Eichenberger Reviewed-by: Andrew Lunn --- drivers/net/phy/marvell-88q2xxx.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/phy/marvell-88q2xxx.c b/drivers/net/phy/marvell-88q2xxx.c index 7afaa693316f..dc0f150826f0 100644 --- a/drivers/net/phy/marvell-88q2xxx.c +++ b/drivers/net/phy/marvell-88q2xxx.c @@ -375,6 +375,14 @@ static int mv88q2xxx_config_init(struct phy_device *phydev) */ phydev->pma_extable = MDIO_PMA_EXTABLE_BT1; + /* Configure interrupt with default settings, output is driven low for + * active interrupt and high for inactive. + */ + if (phy_interrupt_is_valid(phydev)) + return phy_set_bits_mmd(phydev, MDIO_MMD_PCS, + MDIO_MMD_PCS_MV_GPIO_INT_CTRL, + MDIO_MMD_PCS_MV_GPIO_INT_CTRL_TRI_DIS); + return 0; } @@ -700,14 +708,6 @@ static int mv88q222x_revb0_config_init(struct phy_device *phydev) return ret; } - /* Configure interrupt with default settings, output is driven low for - * active interrupt and high for inactive. - */ - if (phy_interrupt_is_valid(phydev)) - return phy_set_bits_mmd(phydev, MDIO_MMD_PCS, - MDIO_MMD_PCS_MV_GPIO_INT_CTRL, - MDIO_MMD_PCS_MV_GPIO_INT_CTRL_TRI_DIS); - return mv88q2xxx_config_init(phydev); }