Lines Matching +full:pwm +full:- +full:map
1 // SPDX-License-Identifier: GPL-2.0-only
2 /* Copyright (C) 2022 Hewlett-Packard Enterprise Development Company, L.P. */
28 val = readb(drvdata->plreg + OFS_FAN_INST); in fan_installed()
38 val = readb(drvdata->plreg + OFS_FAN_FAIL); in fan_failed()
50 * reported for the PWM will be incorrect. Report fan as in fan_enabled()
53 val = readl(drvdata->fn2 + OFS_SEVSTAT); in fan_enabled()
65 return -EINVAL; in gxp_pwm_write()
66 writeb(val, drvdata->base + channel); in gxp_pwm_write()
69 return -EOPNOTSUPP; in gxp_pwm_write()
80 return -EOPNOTSUPP; in gxp_fan_ctrl_write()
94 return -EOPNOTSUPP; in gxp_fan_read()
105 * the value reported for the PWM will be incorrect. In this case in gxp_pwm_read()
106 * report a PWM of zero. in gxp_pwm_read()
109 reg = readl(drvdata->fn2 + OFS_SEVSTAT); in gxp_pwm_read()
112 *val = fan_installed(dev, channel) ? readb(drvdata->base + channel) : 0; in gxp_pwm_read()
128 return -EOPNOTSUPP; in gxp_fan_ctrl_read()
181 HWMON_CHANNEL_INFO(pwm,
202 struct device *dev = &pdev->dev; in gxp_fan_ctrl_probe()
208 return -ENOMEM; in gxp_fan_ctrl_probe()
210 drvdata->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); in gxp_fan_ctrl_probe()
211 if (IS_ERR(drvdata->base)) in gxp_fan_ctrl_probe()
212 return dev_err_probe(dev, PTR_ERR(drvdata->base), in gxp_fan_ctrl_probe()
213 "failed to map base\n"); in gxp_fan_ctrl_probe()
215 drvdata->plreg = devm_platform_ioremap_resource_byname(pdev, in gxp_fan_ctrl_probe()
217 if (IS_ERR(drvdata->plreg)) in gxp_fan_ctrl_probe()
218 return dev_err_probe(dev, PTR_ERR(drvdata->plreg), in gxp_fan_ctrl_probe()
219 "failed to map plreg\n"); in gxp_fan_ctrl_probe()
221 drvdata->fn2 = devm_platform_ioremap_resource_byname(pdev, in gxp_fan_ctrl_probe()
223 if (IS_ERR(drvdata->fn2)) in gxp_fan_ctrl_probe()
224 return dev_err_probe(dev, PTR_ERR(drvdata->fn2), in gxp_fan_ctrl_probe()
225 "failed to map fn2\n"); in gxp_fan_ctrl_probe()
227 hwmon_dev = devm_hwmon_device_register_with_info(&pdev->dev, in gxp_fan_ctrl_probe()
237 { .compatible = "hpe,gxp-fan-ctrl", },
245 .name = "gxp-fan-ctrl",