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>
32 ret = regulator_enable(priv->ps); in pse_reg_pi_enable()
36 priv->admin_state = ETHTOOL_PODL_PSE_ADMIN_STATE_ENABLED; in pse_reg_pi_enable()
46 ret = regulator_disable(priv->ps); in pse_reg_pi_disable()
50 priv->admin_state = ETHTOOL_PODL_PSE_ADMIN_STATE_DISABLED; in pse_reg_pi_disable()
59 return regulator_is_enabled(priv->ps); in pse_reg_pi_is_enabled()
70 ret = regulator_is_enabled(priv->ps); in pse_reg_ethtool_get_status()
75 status->podl_pw_status = ETHTOOL_PODL_PSE_PW_D_STATUS_DISABLED; in pse_reg_ethtool_get_status()
77 status->podl_pw_status = in pse_reg_ethtool_get_status()
80 status->podl_admin_state = priv->admin_state; in pse_reg_ethtool_get_status()
95 struct device *dev = &pdev->dev; in pse_reg_probe()
99 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); in pse_reg_probe()
101 return -ENOMEM; in pse_reg_probe()
103 if (!pdev->dev.of_node) in pse_reg_probe()
104 return -ENOENT; in pse_reg_probe()
106 priv->ps = devm_regulator_get_exclusive(dev, "pse"); in pse_reg_probe()
107 if (IS_ERR(priv->ps)) in pse_reg_probe()
108 return dev_err_probe(dev, PTR_ERR(priv->ps), in pse_reg_probe()
109 "failed to get PSE regulator.\n"); in pse_reg_probe()
113 ret = regulator_is_enabled(priv->ps); in pse_reg_probe()
118 priv->admin_state = ETHTOOL_PODL_PSE_ADMIN_STATE_ENABLED; in pse_reg_probe()
120 priv->admin_state = ETHTOOL_PODL_PSE_ADMIN_STATE_DISABLED; in pse_reg_probe()
122 priv->pcdev.owner = THIS_MODULE; in pse_reg_probe()
123 priv->pcdev.ops = &pse_reg_ops; in pse_reg_probe()
124 priv->pcdev.dev = dev; in pse_reg_probe()
125 priv->pcdev.types = ETHTOOL_PSE_PODL; in pse_reg_probe()
126 ret = devm_pse_controller_register(dev, &priv->pcdev); in pse_reg_probe()
128 dev_err(dev, "failed to register PSE controller (%pe)\n", in pse_reg_probe()
137 { .compatible = "podl-pse-regulator", },
145 .name = "PSE regulator",
152 MODULE_DESCRIPTION("regulator based Ethernet Power Sourcing Equipment");
154 MODULE_ALIAS("platform:pse-regulator");