From patchwork Sun Apr 14 14:22:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kory Maincent X-Patchwork-Id: 13629012 X-Patchwork-Delegate: kuba@kernel.org 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 216F75A105; Sun, 14 Apr 2024 14:23:56 +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=1713104639; cv=none; b=AXHaAeOAdi2GIO2VlFa3TAfee5cZTZBgiWoS+gLGjAFU5OLAXOwzxImj9PtbPuwM8WhTgkBVHiTmN55Humn5zsI8txT2EoOGttRzRoTY02fKyzZbBFbDH8ojnshL3fbj/eJi8UjgXe69Ohx7ThxOx/r5KwOebkZByIXlWTmUl0s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713104639; c=relaxed/simple; bh=L1+ZRTZG1Nh0vlJyMlEqVeY2W2ashlYErOetxusNu6o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XOSWExcFoGKsOpIfmVqLx9Cru2sJxWtTxyBOloLRwsncQkhjIH5tR3y10NIVrT/vmZv1SvuwrkqB3MAkpmYOcZ6HIHnSFOFT+GZ8zEjjlF4pUFpWixbUj9ThB/K5UHhWFBkn7tI0WYM2VcFMAI+pRwgv2eXUZzw1EtaRy2TfwDY= 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=NsbPqUMm; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="NsbPqUMm" Received: by mail.gandi.net (Postfix) with ESMTPSA id BE19BC0003; Sun, 14 Apr 2024 14:23:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713104635; 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=NsbPqUMmP/L7byImU7dqmDMeH+avlr+3omcCGTAtasR0QkhwLnndFyBcSXLaozK2s++qly 5zqhQegCySL8ur8vHtjXi9T8XLM4RiBK6lZXIOnKagG3L+JB1I6PZCq7mevVXtVQpzEq8E TPyop9B9A3Z/dq7r1raWOBqZo5l1uDljc7qSnZ/jKaXlZRk7aPxJPmVjElp8uKxCUQBasU HETlugCcNuQjdBfakB+xBZJNNy0OzViTsdAJsRP8oxQbl+oWB9oitG8AzSyIgdbjgnTvq6 vo0Zz7sbmu2L8QHNcybINQKCqcWTtFw/r8CvtmTjVmKBN54aY3E3aJ/k1/PpKQ== From: Kory Maincent Date: Sun, 14 Apr 2024 16:22:01 +0200 Subject: [PATCH net-next v8 12/17] net: pse-pd: Add support for setup_pi_matrix callback Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240414-feature_poe-v8-12-e4bf1e860da5@bootlin.com> References: <20240414-feature_poe-v8-0-e4bf1e860da5@bootlin.com> In-Reply-To: <20240414-feature_poe-v8-0-e4bf1e860da5@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 X-Patchwork-Delegate: kuba@kernel.org 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;