Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp545068rdb; Sat, 17 Feb 2024 23:59:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWmte6QCZ4SrQ1cNaC6HIB3lGwfTi2YSARVNv6TlTN2yXe0Eum5G0fJN0voF0a0jdY6r7BaeBrfPKlqkrM5t2Hvya0aXxQRuDa2F43FoQ== X-Google-Smtp-Source: AGHT+IF0GR/w7WuFFE4OXE/ot1eQcgin/PjAoSNA1KhX4kCJZg0q13t1ax73sMa3dPNwB+rsuUfv X-Received: by 2002:a05:620a:c16:b0:785:8fc5:3f83 with SMTP id l22-20020a05620a0c1600b007858fc53f83mr9792606qki.72.1708243195856; Sat, 17 Feb 2024 23:59:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708243195; cv=pass; d=google.com; s=arc-20160816; b=B34lsxZUi9DsoinnRFRSgqTIj1bfdZ0Rx2KiN6GHULzHlLIpPirZtaY8YJkawBBXkz lJmCvVg+zbtjgLMf1CNhUZumqKsX11ogoUv3XloZ4inurMOcUiD0vWxoLVXmNL9d4UWg eOnFyXvaIbEjciL71FduWkDOLq9CE3EHrPcYfRXVUODzzBKLwjTAHn16kZ3ZY+YzWefy GKCBx4By+kdk+IHs92fir5i69sDMpTK7RdGdLpOYm6RLYERnyZPkFgUSPSjNlzv+g6me 0QXFbwIri8KowhxfKxIHf2GxTc4RhdNj430R7FlfwxoRYP3raZWm2gClrhQi1+tYbUz7 NWiw== 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=eD7gFs/MfFg+oZI213lei6UQoGm5vpKrM53YVqbAyqU=; b=GLg9RvnqCsUlX2y0IRmEWxoba1YATxlBZFAFtIFwL7KvFT3h1kg+BthwT6NJ2TTGki XCsg9tX/bb1K2rZJ6t3Z6FfEhX2mMhnPrfd95jxTSEMhNdnSI7ZuG+3dblcR0SZafz91 vEg39pDEXOgxqvCfQQD1GHHVugkTDfR1R21dfx9RPZj3+t0c6ipq2U/2NyuPgkA9ocfC OG09jZFHDiAZzaecWFKn4p4Mg7X0zOYDVfv1ITlWOo7GI+2Y4qn/qgpjrtuHIEHdWFhr eX/O40bAXYnRkSwbQZnBu0VOdF8+sRuQFAchoITt2tmrGiq13n1N01cu0Zho5pLCZBQ0 A3Og==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UF+J06eR; 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-70265-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70265-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 a26-20020a05620a16da00b00787221ef564si3674239qkn.731.2024.02.17.23.59.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 23:59:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70265-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=@gmail.com header.s=20230601 header.b=UF+J06eR; 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-70265-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70265-linux.lists.archive=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 9A1E31C21389 for ; Sun, 18 Feb 2024 07:59:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 49FD51F95A; Sun, 18 Feb 2024 07:58:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UF+J06eR" Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (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 3E829F9F0; Sun, 18 Feb 2024 07:58:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708243102; cv=none; b=TfzoCs8D1HxfXDt5iQtL7dp8+sInSUXtgwIsXx0qZE0+tz58rD8gLu71prO1C2B24uaxjKsoVezFhmV6zkMyyjLsXnX3NCbSoq9zPy7FA240QWO2rnx4VFpO4QE5lIojA9udpY7nmqGFQJFczaCSWWm9T5lUpcER/GD6TA2UXBE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708243102; c=relaxed/simple; bh=gF3/8s9rdHbLqFLOpYOvq2ihfs6x9vepRDOvp4fgqQw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AWxrtK8q0NUtqSQp4jkQxUgPJw5JfbU76qnt4L8yiX+KnQ+IgTWvWWKQEP490/mAy70nkQy6cNWR6v9wyUmGS9rc0g7g/+v4ZRwrqNkNdAVN1T4YXw3KrKiacPhFmryhwq3ub6h+F3hjvGN8wTSRkGvK35ZACwNxl+pQ6hdnhts= 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=UF+J06eR; arc=none smtp.client-ip=209.85.218.47 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-f47.google.com with SMTP id a640c23a62f3a-a3e706f50beso21174466b.0; Sat, 17 Feb 2024 23:58:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708243098; x=1708847898; 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=UF+J06eRuTKEybgI3F7Q6T0axVSufvnzJRa66G4WNugpSHoo+6tT8FAKniDhsMC7Jr MnS3MqrtkAoEmAeCXKFccW7sxSnkbjB6hLWZUTO8B5KqX1qbkI3Hy1kQ32YGIxjIYXow Xmynojjjrbh4hBJGjWshUZ+px7aFlhhKxFMcEFi4pzgvSAXHcGydT4tWZqPujYzAkzr5 ScSbpZ86yNPuI4z3Dm6wKjP3ykMbL9+X2jX3ld0Oo+awtWb2N3OqyPWaYFDHFgCCSakJ svOHM2FE04aZSjq+EAIB75MXtg4Gw1qTbglQbTg3kZnNiPeOUO8oJsAXN3GS33kCEGZj LMgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708243098; x=1708847898; 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=ag5tKA7+i0fl2PMkWs9knMwKGPn1HTCRvjc8qB9V0nKobo+Ioxb/wi3AZllTZ3dP99 HWgXoMI9R/61Ll+6Cy9aihs1cdoF5av9WrTS3Lwe3BO5nRZrXEyJhvqApsYAZ2uH94tp VuT7Op1A6knBWjECxhNVxGic7/bTt/Kby3pxLsKrCo2d32ecY/PC6zy3ObstQJmbo6RW izEU97JOHTH0qRt2ztPh/k7H2g2dm0/tENhF+g6ZEG4D95dgqBiHC1kfc7e7IEawfRv8 ye0pWvbcaTRm++xMNjuO/jo5rCdO238gMORtbCa+huYc/cHUkORijj0FPBVhptaHHp/U zPMQ== X-Forwarded-Encrypted: i=1; AJvYcCWLqwBM/UzSinJbgB6nntMu45wsHX8tFks/DjiuP22XMdjO66+eiIBvP/leCXviaJrTMZIy0GyhjSbPpgid9SRwANxWVAgwfJ+UkFRxqGWzpzea2+OReGsEYw9cs8uLOkdzcPJX X-Gm-Message-State: AOJu0Yw3OVlFyu8dGAQgCmWQe2EgEhfn/vEyE7qVGV8QhgDAesGD6Byy iTWne7nqnKoyBbGct70y+UhNsf5yktTNdV1w1fNoIhRzw04g21+A X-Received: by 2002:a17:906:3786:b0:a3e:3bc2:bdf with SMTP id n6-20020a170906378600b00a3e3bc20bdfmr1391538ejc.60.1708243098705; Sat, 17 Feb 2024 23:58:18 -0800 (PST) Received: from debian.fritz.box ([93.184.186.109]) by smtp.gmail.com with ESMTPSA id jj12-20020a170907984c00b00a3e64bcd2c1sm458732ejc.142.2024.02.17.23.58.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 23:58:18 -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 v7 net-next 07/14] net: phy: marvell-88q2xxx: add suspend / resume ops Date: Sun, 18 Feb 2024 08:57:44 +0100 Message-Id: <20240218075753.18067-8-dima.fedrau@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240218075753.18067-1-dima.fedrau@gmail.com> References: <20240218075753.18067-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 Content-Transfer-Encoding: 8bit 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, }, }; -- 2.39.2