Lines Matching +full:ethernet +full:- +full:pse
1 // SPDX-License-Identifier: GPL-2.0-only
3 // Driver for the regulator based Ethernet Power Sourcing Equipment, without
12 #include <linux/pse-pd/pse.h>
34 if (priv->admin_state == config->admin_cotrol) in pse_reg_ethtool_set_config()
37 switch (config->admin_cotrol) { in pse_reg_ethtool_set_config()
39 ret = regulator_enable(priv->ps); in pse_reg_ethtool_set_config()
42 ret = regulator_disable(priv->ps); in pse_reg_ethtool_set_config()
45 dev_err(pcdev->dev, "Unknown admin state %i\n", in pse_reg_ethtool_set_config()
46 config->admin_cotrol); in pse_reg_ethtool_set_config()
47 ret = -ENOTSUPP; in pse_reg_ethtool_set_config()
53 priv->admin_state = config->admin_cotrol; in pse_reg_ethtool_set_config()
66 ret = regulator_is_enabled(priv->ps); in pse_reg_ethtool_get_status()
71 status->podl_pw_status = ETHTOOL_PODL_PSE_PW_D_STATUS_DISABLED; in pse_reg_ethtool_get_status()
73 status->podl_pw_status = in pse_reg_ethtool_get_status()
76 status->podl_admin_state = priv->admin_state; in pse_reg_ethtool_get_status()
89 struct device *dev = &pdev->dev; in pse_reg_probe()
93 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); in pse_reg_probe()
95 return -ENOMEM; in pse_reg_probe()
97 if (!pdev->dev.of_node) in pse_reg_probe()
98 return -ENOENT; in pse_reg_probe()
100 priv->ps = devm_regulator_get_exclusive(dev, "pse"); in pse_reg_probe()
101 if (IS_ERR(priv->ps)) in pse_reg_probe()
102 return dev_err_probe(dev, PTR_ERR(priv->ps), in pse_reg_probe()
103 "failed to get PSE regulator.\n"); in pse_reg_probe()
107 ret = regulator_is_enabled(priv->ps); in pse_reg_probe()
112 priv->admin_state = ETHTOOL_PODL_PSE_ADMIN_STATE_ENABLED; in pse_reg_probe()
114 priv->admin_state = ETHTOOL_PODL_PSE_ADMIN_STATE_DISABLED; in pse_reg_probe()
116 priv->pcdev.owner = THIS_MODULE; in pse_reg_probe()
117 priv->pcdev.ops = &pse_reg_ops; in pse_reg_probe()
118 priv->pcdev.dev = dev; in pse_reg_probe()
119 ret = devm_pse_controller_register(dev, &priv->pcdev); in pse_reg_probe()
121 dev_err(dev, "failed to register PSE controller (%pe)\n", in pse_reg_probe()
130 { .compatible = "podl-pse-regulator", },
138 .name = "PSE regulator",
145 MODULE_DESCRIPTION("regulator based Ethernet Power Sourcing Equipment");
147 MODULE_ALIAS("platform:pse-regulator");