Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp672457lqb; Wed, 17 Apr 2024 07:44:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU4M0x5K2/B2OuC3/AGLBKNYb7cDAAnjfpyJc4VexTbAiSxJolLlaB//H5hv1/hgNVqdgWS9oGVeGaY3cyifZARxjyJBjG2/a25v4GleQ== X-Google-Smtp-Source: AGHT+IHBbvDOCzh97khcDTm2UMDIFCUn1RxCfyvP1FVWnSyB/zguFfkVh4hE+Va+ejDbiYBszJ66 X-Received: by 2002:a17:902:fc48:b0:1e4:9bce:9d75 with SMTP id me8-20020a170902fc4800b001e49bce9d75mr23779826plb.65.1713365098659; Wed, 17 Apr 2024 07:44:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713365098; cv=pass; d=google.com; s=arc-20160816; b=GZf9hMiHqh59p4v6acGlYGwryqE+eBL5cuUC5PsE9k0Ad4rHG64enMitZEXzIgTRbh hYRR9Q78dRT1ONqlAGuXG8ALaBYGTU/wfPV9joLIrHegXb7lpU5ynNA47I+Pgc65OACk /3nVFbHhqkKt7027ohNpffGdS0Twke2L6e39S5o6wCPWWORoVOXZ5GWxXORS0D4DWJ4a sBqkgAVBphI+t6L4yGgNs9CxEsxxfQp5Pxy7EeQDz+KG9Sf1ja2KLGqbceHkIXnNUDc6 UkpWAzxyZxfDJzalxAlUGO/vll60Zt7teuC5dduPTXqeZuDLDDYJ6Z27ZWBdB84A3k9g UuCA== 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=cECuaur6xBkX8FAIGxDkH2vewSpAArLyAPPvhCHjvWo=; fh=57ylmEJf4L+ab5JW9VDoPKBjQbUSU1WR6XAwF32mgs8=; b=NaUXYwzGh6C8SPGbp/E653InkMjmBEbZ6r9KHDQ6p+RRI19tiUJNhTcuDc6CqJhmmY XiaPdxLDE+Lz5LOfvHmdukDxlHeZfcxWQ1n4gvhV6sbpuYFKdZfCPJuDSrWOp0JyaivJ qhY0efJJl93WrR1zc4HB7NnG9wiK79MTZfypbAyc8jZu72slyYV2HKtmoZ8nrajC0Sbi ZYfzkmVp9VF2UKKt7EziWSmib/YUT553vOoGIfAJu2z96fjPq+MJWj+ddnryQRj5rpp5 E3QM9HX6QRbaCuHFTqpAJzv47AedODwXSJrz6t0wDus0wRiZ1pIglGDsBJkzQeRDMfFl p/AQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=l0rP7Vk5; 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-148700-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148700-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k5-20020a170902ce0500b001e54f494020si11732239plg.604.2024.04.17.07.44.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 07:44:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148700-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=l0rP7Vk5; 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-148700-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148700-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 523E9283AA9 for ; Wed, 17 Apr 2024 14:44:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E76B01465A7; Wed, 17 Apr 2024 14:41:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="l0rP7Vk5" Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (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 DB8C6146592; Wed, 17 Apr 2024 14:41:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713364902; cv=none; b=VMqv3wttpqickOwXpOwlfyIFfwndinNKllOuIPmIA9X+nXOWAf5B+uxNXlQi3FkhDeiqxntMAkNsv9k8goFQjI0MWshnVmvO4uOjtx1wvruiolC7xtcpUa+BuEGkbsjV/8MjbTbSTlNF9nujScotZCroNeOBFii0j4+VrXr+Vn8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713364902; c=relaxed/simple; bh=u2ZvkyyevjkvJ/3k9nSvtC4QezO8DURb/I514Z0BxbY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S+1006QPk3mTCJ+BjlVauM+0ojy/3/i5dDUsNOgKmYEI4hCXo4BkDeENTIVjK289RIA4aijJmnkv8J4mwrs3Mr8i7ko77jHNTGQP1P/PhrZzYQtDINaXihu/QzBjHmDcVF1stQdFowQiWqtZTQbYUS+0cs6NRGxakE+CJnrnyRo= 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=l0rP7Vk5; arc=none smtp.client-ip=217.70.183.201 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 A610F1BF20A; Wed, 17 Apr 2024 14:41:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713364898; 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=cECuaur6xBkX8FAIGxDkH2vewSpAArLyAPPvhCHjvWo=; b=l0rP7Vk5lpGF2u1P3T+skPwXDF9h+ZPv339naJAFc5p5UDHkirL3yXwezTqWr6OwNStV0o x1EskmeOq4bWrrptWWdhsYFs6PLJWdG15hsZtpK+RqMW8QtzZbrGTF42jSi6ryvdSksnQA LZ0W4VGSnz9vexAYqtZpju2irFNqwpqddTWBBy0DfgUQo0q5npDNr/OmIVGHzFrIg81ViC /82C0ufrdqietFJHgZMKKS+SqBEj3V4Fr3UyNwBeBocQRfzHYTAQMCCfkVA1UtNCsS8UvD qgGW68PHd2KVbL4+TEd/H2hzai3inN68kRtAjvnJHuOLAKXWg+X3iOV6mpT0hw== From: Kory Maincent Date: Wed, 17 Apr 2024 16:39:57 +0200 Subject: [PATCH net-next v9 09/14] 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: <20240417-feature_poe-v9-9-242293fd1900@bootlin.com> References: <20240417-feature_poe-v9-0-242293fd1900@bootlin.com> In-Reply-To: <20240417-feature_poe-v9-0-242293fd1900@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 ca5ced8e0d8a..a7ff7676ab77 100644 --- a/drivers/net/pse-pd/pse_core.c +++ b/drivers/net/pse-pd/pse_core.c @@ -223,6 +223,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