Lines Matching +full:sd +full:- +full:modulator
1 // SPDX-License-Identifier: GPL-2.0
3 * Generic sigma delta modulator driver
5 * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
39 if (priv->vref) in iio_sd_mod_enable()
40 return regulator_enable(priv->vref); in iio_sd_mod_enable()
49 if (priv->vref) in iio_sd_mod_disable()
50 regulator_disable(priv->vref); in iio_sd_mod_disable()
60 *val = priv->vref_mv; in iio_sd_mod_read()
68 return -EOPNOTSUPP; in iio_sd_mod_read()
78 .name = "sd-modulator",
84 struct device *dev = &pdev->dev; in iio_sd_mod_register()
89 return -ENOMEM; in iio_sd_mod_register()
91 iio->name = dev_name(dev); in iio_sd_mod_register()
92 iio->info = &iio_sd_mod_iio_info; in iio_sd_mod_register()
93 iio->modes = INDIO_BUFFER_HARDWARE; in iio_sd_mod_register()
95 iio->num_channels = 1; in iio_sd_mod_register()
96 iio->channels = &iio_sd_mod_ch; in iio_sd_mod_register()
100 return devm_iio_device_register(&pdev->dev, iio); in iio_sd_mod_register()
105 struct device *dev = &pdev->dev; in iio_sd_mod_probe()
110 /* If sd modulator is not defined as an IIO backend device, fallback to legacy */ in iio_sd_mod_probe()
111 if (!device_property_present(dev, "#io-backend-cells")) in iio_sd_mod_probe()
116 return -ENOMEM; in iio_sd_mod_probe()
124 if (PTR_ERR(vref) != -ENODEV) in iio_sd_mod_probe()
135 priv->vref = vref; in iio_sd_mod_probe()
136 priv->vref_mv = ret / 1000; in iio_sd_mod_probe()
139 return devm_iio_backend_register(&pdev->dev, &sd_backend_info, priv); in iio_sd_mod_probe()
143 { .compatible = "sd-modulator" },
159 MODULE_DESCRIPTION("Basic sigma delta modulator");