summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorOlivier Moysan <olivier.moysan@foss.st.com>2024-07-30 11:46:32 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-08-10 13:17:34 +0300
commit2530d7d44ca6dc0c1c059f143cdcb2be8600c59a (patch)
tree533dbb8c550b4f106b3ed5c76954bd088887a381 /drivers/iio
parent0737158aabc278526c784f63b8dd8963cdc558a9 (diff)
downloadlinux-2530d7d44ca6dc0c1c059f143cdcb2be8600c59a.tar.xz
iio: add enable and disable services to iio backend framework
Add iio_backend_disable() and iio_backend_enable() APIs to allow IIO backend consumer to request backend disabling and enabling. Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240730084640.1307938-3-olivier.moysan@foss.st.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/industrialio-backend.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-backend.c
index dfaa5f34a7a5..8a7ff783ae29 100644
--- a/drivers/iio/industrialio-backend.c
+++ b/drivers/iio/industrialio-backend.c
@@ -292,6 +292,29 @@ static void __iio_backend_disable(void *back)
}
/**
+ * iio_backend_disable - Backend disable
+ * @back: Backend device
+ */
+void iio_backend_disable(struct iio_backend *back)
+{
+ __iio_backend_disable(back);
+}
+EXPORT_SYMBOL_NS_GPL(iio_backend_disable, IIO_BACKEND);
+
+/**
+ * iio_backend_enable - Backend enable
+ * @back: Backend device
+ *
+ * RETURNS:
+ * 0 on success, negative error number on failure.
+ */
+int iio_backend_enable(struct iio_backend *back)
+{
+ return iio_backend_op_call(back, enable);
+}
+EXPORT_SYMBOL_NS_GPL(iio_backend_enable, IIO_BACKEND);
+
+/**
* devm_iio_backend_enable - Device managed backend enable
* @dev: Consumer device for the backend
* @back: Backend device
@@ -303,7 +326,7 @@ int devm_iio_backend_enable(struct device *dev, struct iio_backend *back)
{
int ret;
- ret = iio_backend_op_call(back, enable);
+ ret = iio_backend_enable(back);
if (ret)
return ret;