Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp2061825lqe; Tue, 9 Apr 2024 08:30:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUbYwsSKfP6pGe71HNpkLNPfVVftZpYkLnQC3vqDl/hncJa89C3cbl3QJ/6bXxki1AgNgbcL8bT2EgPSXWhAJLmohu6o5QUZTQF+o2H7w== X-Google-Smtp-Source: AGHT+IEGvRy3+bNKlavkEaI78VSd685BcYXVsQhuz6ahy8gP4IpxkGzTrPCdJR2UsRcJs7uyPg/i X-Received: by 2002:a50:c016:0:b0:56d:f637:4513 with SMTP id r22-20020a50c016000000b0056df6374513mr8316439edb.26.1712676645926; Tue, 09 Apr 2024 08:30:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712676645; cv=pass; d=google.com; s=arc-20160816; b=wkzRv7auuPcpFVJ2TA3TuVGHimfyicHWOpqhh+8xhkeJdsshQmlAoRnL5rFr9Js1Tf 7rdDyj2jAgJJ+aQ0dG9vWs4Lj6uX6Z8zT7/jvUn/sSMB0cgKnAQxFBfGpb2p7hKFCNSJ ds2oGLkxLjZK4HyLitLRz3+SRMOLoyq9V4u3RbT3/AJ+w0qn0oqCn9/jqjPV3CTrwO8J yf9WiixJWO6ETaYZTmbuApXoTUuRLO0eJfUOK3QmJuspT7Nd9rrVloOPKPhsWyXq1Rkw tyfr2Ij/mkSNgj6N1a9DKYThMavtabBA2GPXHmgxwxXD/u5vYxzgF2oryERi1eofHhig de7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=95nZiajAyZr8E8J//x4ErRR6+h/m4huNZxtlkMrs7o4=; fh=57ylmEJf4L+ab5JW9VDoPKBjQbUSU1WR6XAwF32mgs8=; b=ax+CRdhqtvgJz6y1NRao2yomKBXDlWMNzjTb0IurRrQJvpVVgS8M/DRGpcLbGIEQ2M ZIbBwMMblW6hrNmDWzWYp5hj2jM/r9iZ3VOPWp68mVk6+zHrxZ2xEzNVOJyxRU5ZxWNn Ar80nBFMGyTNpdIbPqnFsxuh9Pcqx3wjdDIvBwOGf2LFLvE5m4QZgVU8LJvbmA61qV46 ljDJ1NqFijbkDF2jhX6pntqrqwa8w7tqpbBuzSXV67NSzZPklPqWwo/c6Bhjk1tcWqwM hgYEXk5+XileCwNdUJC6ZO0WMQ4LOIYtS3RxPoEWURQkFId2o2FYdXRnhVaKqJ2VrhjN GY4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cdJHnYja; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-137169-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137169-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q13-20020a056402518d00b0056e7751ae4fsi469917edd.264.2024.04.09.08.30.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 08:30:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137169-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cdJHnYja; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-137169-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137169-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 EBAD31F29C9B for ; Tue, 9 Apr 2024 15:08:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E6C5139D02; Tue, 9 Apr 2024 15:04:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="cdJHnYja" Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (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 33EB31384A9; Tue, 9 Apr 2024 15:04:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712675078; cv=none; b=MzzpS/TzfqbNHZGawtE7HIhLMSPu5/9Q+Qb3xu5riqUjjQQuWNTl1+wuKaGtLDkdA1VTxFEriXLwWWCBlzlHH8K8hDj4bv41Y1jjuH+tOUrJnYaBj/cZ461PnWTHgPHrb/AEwzu/9dl6i8vV2BZIKPL0VM9gKZLilSLCdpCEK3U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712675078; c=relaxed/simple; bh=L1+ZRTZG1Nh0vlJyMlEqVeY2W2ashlYErOetxusNu6o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=h054IQro3JbDNbh2DNyt4XDsepYScVdbr4VtFaQaeAKNJDmtjWt9WIhNfBn6sJQvdYqiTDv7LJEwEKfZcUfnJ75AD/cnaFBbM27611uWULIxBnVbLe2zaRgyEqkDUDA3gvZx/MrNL1r7ycLVk3stBUiEVtjwHA3dLb+ObL5S+x4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=cdJHnYja; arc=none smtp.client-ip=217.70.183.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 35310C0015; Tue, 9 Apr 2024 15:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1712675073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=95nZiajAyZr8E8J//x4ErRR6+h/m4huNZxtlkMrs7o4=; b=cdJHnYja5/LOxkxJN7va1bIIKPVhvooJAxue14WXOM4tZeUEqggsvNtQhY+xoqMZecvLEf Hy+G66GyvmItqXn5IIN1SSYYYmHYk4/jtqYE8sFJ/oluxGELAIYpRty162wrAM1B0Wmf1f u4MMjseoAYLz7fgLtXRKRAVEPI4KwwgfddiyTXiq4+0dWdhr5ZjBWrt/qkLrTDFQSB3f7Y GEXakF4v6WoehbAz0116IJFfew8fHEgK4lheNu74FiS0kHBaeq0Umi05yRBMNoTmaOk1Hi cyNxL/v5T/FiBjyUR/vS9tYaF2pUXLlwds0vxs0Zi/WP6pLZXaTA/OwkcVagHw== From: Kory Maincent Date: Tue, 09 Apr 2024 17:04:02 +0200 Subject: [PATCH net-next v7 12/17] net: pse-pd: Add support for setup_pi_matrix callback Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240409-feature_poe-v7-12-11e38efd4dee@bootlin.com> References: <20240409-feature_poe-v7-0-11e38efd4dee@bootlin.com> In-Reply-To: <20240409-feature_poe-v7-0-11e38efd4dee@bootlin.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Luis Chamberlain , Russ Weight , Greg Kroah-Hartman , "Rafael J. Wysocki" , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Oleksij Rempel , Mark Brown , Frank Rowand , Andrew Lunn , Heiner Kallweit , Russell King Cc: Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, Dent Project , kernel@pengutronix.de, Maxime Chevallier , Kory Maincent X-Mailer: b4 0.14-dev X-GND-Sasl: kory.maincent@bootlin.com From: Kory Maincent (Dent Project) Implement setup_pi_matrix callback to configure the PSE PI matrix. This functionality is invoked before registering the PSE and following the core parsing of the pse_pis devicetree subnode. Signed-off-by: Kory Maincent Reviewed-by: Andrew Lunn --- Changes in v3: - New patch --- drivers/net/pse-pd/pse_core.c | 6 ++++++ include/linux/pse-pd/pse.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/pse-pd/pse_core.c b/drivers/net/pse-pd/pse_core.c index 25558158048e..28d1c4f08ffd 100644 --- a/drivers/net/pse-pd/pse_core.c +++ b/drivers/net/pse-pd/pse_core.c @@ -217,6 +217,12 @@ int pse_controller_register(struct pse_controller_dev *pcdev) if (ret) return ret; + if (pcdev->ops->setup_pi_matrix) { + ret = pcdev->ops->setup_pi_matrix(pcdev); + if (ret) + return ret; + } + mutex_lock(&pse_list_mutex); list_add(&pcdev->list, &pse_controller_list); mutex_unlock(&pse_list_mutex); diff --git a/include/linux/pse-pd/pse.h b/include/linux/pse-pd/pse.h index e19d58b5e777..fa0c73da0cf1 100644 --- a/include/linux/pse-pd/pse.h +++ b/include/linux/pse-pd/pse.h @@ -49,6 +49,7 @@ struct pse_control_status { * * @ethtool_get_status: get PSE control status for ethtool interface * @ethtool_set_config: set PSE control configuration over ethtool interface + * @setup_pi_matrix: setup PI matrix of the PSE controller */ struct pse_controller_ops { int (*ethtool_get_status)(struct pse_controller_dev *pcdev, @@ -57,6 +58,7 @@ struct pse_controller_ops { int (*ethtool_set_config)(struct pse_controller_dev *pcdev, unsigned long id, struct netlink_ext_ack *extack, const struct pse_control_config *config); + int (*setup_pi_matrix)(struct pse_controller_dev *pcdev); }; struct module; -- 2.34.1