diff options
author | Kory Maincent (Dent Project) <kory.maincent@bootlin.com> | 2024-04-17 16:39:50 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-04-19 03:27:01 +0200 |
commit | 47e0dd53c5eb9dab66689592523f31ea39fc32fa (patch) | |
tree | 28a3c319823cddebdbdec9f6aad26b0958eaeb87 /drivers/net/pse-pd | |
parent | ethtool: Expand Ethernet Power Equipment with c33 (PoE) alongside PoDL (diff) | |
download | linux-47e0dd53c5eb9dab66689592523f31ea39fc32fa.tar.xz linux-47e0dd53c5eb9dab66689592523f31ea39fc32fa.zip |
net: pse-pd: Introduce PSE types enumeration
Introduce an enumeration to define PSE types (C33 or PoDL),
utilizing a bitfield for potential future support of both types.
Include 'pse_get_types' helper for external access to PSE type info.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://lore.kernel.org/r/20240417-feature_poe-v9-2-242293fd1900@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/pse-pd')
-rw-r--r-- | drivers/net/pse-pd/pse_core.c | 12 | ||||
-rw-r--r-- | drivers/net/pse-pd/pse_regulator.c | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/pse-pd/pse_core.c b/drivers/net/pse-pd/pse_core.c index 146b81f08a89..fed006cbc185 100644 --- a/drivers/net/pse-pd/pse_core.c +++ b/drivers/net/pse-pd/pse_core.c @@ -312,3 +312,15 @@ int pse_ethtool_set_config(struct pse_control *psec, return err; } EXPORT_SYMBOL_GPL(pse_ethtool_set_config); + +bool pse_has_podl(struct pse_control *psec) +{ + return psec->pcdev->types & ETHTOOL_PSE_PODL; +} +EXPORT_SYMBOL_GPL(pse_has_podl); + +bool pse_has_c33(struct pse_control *psec) +{ + return psec->pcdev->types & ETHTOOL_PSE_C33; +} +EXPORT_SYMBOL_GPL(pse_has_c33); diff --git a/drivers/net/pse-pd/pse_regulator.c b/drivers/net/pse-pd/pse_regulator.c index 1dedf4de296e..547af384764b 100644 --- a/drivers/net/pse-pd/pse_regulator.c +++ b/drivers/net/pse-pd/pse_regulator.c @@ -116,6 +116,7 @@ pse_reg_probe(struct platform_device *pdev) priv->pcdev.owner = THIS_MODULE; priv->pcdev.ops = &pse_reg_ops; priv->pcdev.dev = dev; + priv->pcdev.types = ETHTOOL_PSE_PODL; ret = devm_pse_controller_register(dev, &priv->pcdev); if (ret) { dev_err(dev, "failed to register PSE controller (%pe)\n", |