Linux IIO development
 help / color / mirror / Atom feed
From: Antoniu Miclaus <antoniu.miclaus@analog.com>
To: <jic23@kernel.org>, <robh@kernel.org>, <conor+dt@kernel.org>,
	<linux-iio@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: Antoniu Miclaus <antoniu.miclaus@analog.com>
Subject: [PATCH 01/14] iio: backend: add support for filter config
Date: Thu, 20 Feb 2025 15:54:11 +0200	[thread overview]
Message-ID: <20250220135429.8615-2-antoniu.miclaus@analog.com> (raw)
In-Reply-To: <20250220135429.8615-1-antoniu.miclaus@analog.com>

Add backend support for filter enable/disable.
This setting can be adjusted within the IP cores interfacing devices.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
 drivers/iio/industrialio-backend.c | 26 ++++++++++++++++++++++++++
 include/linux/iio/backend.h        |  6 ++++++
 2 files changed, 32 insertions(+)

diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-backend.c
index d4ad36f54090..ffafe7c73508 100644
--- a/drivers/iio/industrialio-backend.c
+++ b/drivers/iio/industrialio-backend.c
@@ -778,6 +778,32 @@ static int __devm_iio_backend_get(struct device *dev, struct iio_backend *back)
 	return 0;
 }
 
+/**
+ * iio_backend_filter_enable - Enable filter
+ * @back: Backend device
+ *
+ * RETURNS:
+ * 0 on success, negative error number on failure.
+ */
+int iio_backend_filter_enable(struct iio_backend *back)
+{
+	return iio_backend_op_call(back, filter_enable);
+}
+EXPORT_SYMBOL_NS_GPL(iio_backend_filter_enable, "IIO_BACKEND");
+
+/**
+ * iio_backend_filter_disable - Disable filter
+ * @back: Backend device
+ *
+ * RETURNS:
+ * 0 on success, negative error number on failure.
+ */
+int iio_backend_filter_disable(struct iio_backend *back)
+{
+	return iio_backend_op_call(back, filter_disable);
+}
+EXPORT_SYMBOL_NS_GPL(iio_backend_filter_disable, "IIO_BACKEND");
+
 /**
  * iio_backend_ddr_enable - Enable interface DDR (Double Data Rate) mode
  * @back: Backend device
diff --git a/include/linux/iio/backend.h b/include/linux/iio/backend.h
index e45b7dfbec35..7987d9f1cdb3 100644
--- a/include/linux/iio/backend.h
+++ b/include/linux/iio/backend.h
@@ -100,6 +100,8 @@ enum iio_backend_interface_type {
  * @read_raw: Read a channel attribute from a backend device
  * @debugfs_print_chan_status: Print channel status into a buffer.
  * @debugfs_reg_access: Read or write register value of backend.
+ * @filter_enable: Enable filter.
+ * @filter_disable: Disable filter.
  * @ddr_enable: Enable interface DDR (Double Data Rate) mode.
  * @ddr_disable: Disable interface DDR (Double Data Rate) mode.
  * @data_stream_enable: Enable data stream.
@@ -150,6 +152,8 @@ struct iio_backend_ops {
 					 size_t len);
 	int (*debugfs_reg_access)(struct iio_backend *back, unsigned int reg,
 				  unsigned int writeval, unsigned int *readval);
+	int (*filter_enable)(struct iio_backend *back);
+	int (*filter_disable)(struct iio_backend *back);
 	int (*ddr_enable)(struct iio_backend *back);
 	int (*ddr_disable)(struct iio_backend *back);
 	int (*data_stream_enable)(struct iio_backend *back);
@@ -190,6 +194,8 @@ int iio_backend_data_sample_trigger(struct iio_backend *back,
 int devm_iio_backend_request_buffer(struct device *dev,
 				    struct iio_backend *back,
 				    struct iio_dev *indio_dev);
+int iio_backend_filter_enable(struct iio_backend *back);
+int iio_backend_filter_disable(struct iio_backend *back);
 int iio_backend_ddr_enable(struct iio_backend *back);
 int iio_backend_ddr_disable(struct iio_backend *back);
 int iio_backend_data_stream_enable(struct iio_backend *back);
-- 
2.48.1


  reply	other threads:[~2025-02-20 13:56 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-20 13:54 [PATCH 00/14] Add support for AD4080 ADC Antoniu Miclaus
2025-02-20 13:54 ` Antoniu Miclaus [this message]
2025-02-22 16:47   ` [PATCH 01/14] iio: backend: add support for filter config Jonathan Cameron
2025-02-20 13:54 ` [PATCH 02/14] iio: backend: add support for sync process Antoniu Miclaus
2025-02-22 16:49   ` Jonathan Cameron
2025-02-20 13:54 ` [PATCH 03/14] iio: backend: add support for self sync Antoniu Miclaus
2025-02-20 13:54 ` [PATCH 04/14] iio: backend: add support for sync status Antoniu Miclaus
2025-02-20 13:54 ` [PATCH 05/14] iio: backend: add support for number of lanes Antoniu Miclaus
2025-02-20 20:20   ` David Lechner
2025-02-21 15:59     ` Nuno Sá
2025-02-20 13:54 ` [PATCH 06/14] dt-bindings: iio: adc: add ad408x axi variant Antoniu Miclaus
2025-02-21 17:49   ` Conor Dooley
2025-02-20 13:54 ` [PATCH 07/14] iio: adc: adi-axi-adc: add filter enable/disable Antoniu Miclaus
2025-02-20 13:54 ` [PATCH 08/14] iio: adc: adi-axi-adc: add bitslip enable/disable Antoniu Miclaus
2025-02-20 13:54 ` [PATCH 09/14] iio: adc: adi-axi-adc: add self sync support Antoniu Miclaus
2025-02-20 13:54 ` [PATCH 10/14] iio: adc: adi-axi-adc: add sync status Antoniu Miclaus
2025-02-20 13:54 ` [PATCH 11/14] iio: adc: adi-axi-adc: add num lanes support Antoniu Miclaus
2025-02-20 13:54 ` [PATCH 12/14] dt-bindings: iio: adc: add ad4080 Antoniu Miclaus
2025-02-20 19:30   ` David Lechner
2025-02-21 17:51     ` Conor Dooley
2025-02-20 13:54 ` [PATCH 13/14] iio: adc: ad4080: add driver support Antoniu Miclaus
2025-02-20 15:21   ` Nuno Sá
2025-02-22 17:12   ` Jonathan Cameron
2025-02-20 13:54 ` [PATCH 14/14] Documentation: ABI: testing: ad4080 docs Antoniu Miclaus
2025-02-20 14:53   ` Nuno Sá
2025-02-20 18:27     ` David Lechner
2025-02-25  9:16       ` Nuno Sá
2025-02-25 15:26         ` David Lechner
2025-03-05 13:00           ` Jonathan Cameron
2025-02-20 20:12 ` [PATCH 00/14] Add support for AD4080 ADC David Lechner
2025-02-22 16:56   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250220135429.8615-2-antoniu.miclaus@analog.com \
    --to=antoniu.miclaus@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox