Re: [PATCH v2 2/9] iio: backend: extend features

From: Angelo Dureghello
Date: Mon Sep 09 2024 - 07:59:51 EST



On 08/09/24 2:38 PM, Jonathan Cameron wrote:
On Thu, 05 Sep 2024 17:17:32 +0200
Angelo Dureghello <adureghello@xxxxxxxxxxxx> wrote:

From: Angelo Dureghello <adureghello@xxxxxxxxxxxx>

Extend backend features with new calls needed later on this
patchset from axi version of ad3552r.

A bus type property has been added to the devicetree to
inform the backend about the type of bus (interface) in use
bu the IP.

The follwoing calls are added:

iio_backend_ext_sync_enable
enable synchronize channels on external trigger
iio_backend_ext_sync_disable
disable synchronize channels on external trigger
iio_backend_ddr_enable
enable ddr bus transfer
iio_backend_ddr_disable
disable ddr bus transfer
iio_backend_set_bus_mode
select the type of bus, so that specific read / write
operations are performed accordingly
iio_backend_buffer_enable
enable buffer
iio_backend_buffer_disable
disable buffer
iio_backend_data_transfer_addr
define the target register address where the DAC sample
will be written.
iio_backend_bus_reg_read
generic bus read, bus-type dependent
iio_backend_bus_read_write
generic bus write, bus-type dependent
The RAMP_16 definition doesn't seem immediately connected to the rest.
+ I'm not sure what it is from the name.

It's a 16bit ramp that the backend is able to generate internally,
can be used for testing.

I changed the name to

IIO_BACKEND_INTERNAL_RAMP_16BIT



Signed-off-by: Angelo Dureghello <adureghello@xxxxxxxxxxxx>
---
drivers/iio/industrialio-backend.c | 157 +++++++++++++++++++++++++++++++++++++
include/linux/iio/backend.h | 33 ++++++++
2 files changed, 190 insertions(+)

diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-backend.c
index 20b3b5212da7..231bef4b560e 100644
--- a/drivers/iio/industrialio-backend.c
+++ b/drivers/iio/industrialio-backend.c
@@ -718,6 +718,163 @@ static int __devm_iio_backend_get(struct device *dev, struct iio_backend *back)
return 0;
}
diff --git a/include/linux/iio/backend.h b/include/linux/iio/backend.h
index 37d56914d485..eb8c5bb74bb5 100644
--- a/include/linux/iio/backend.h
+++ b/include/linux/iio/backend.h
enum iio_backend_data_source {
IIO_BACKEND_INTERNAL_CONTINUOUS_WAVE,
IIO_BACKEND_EXTERNAL,
+ IIO_BACKEND_INTERNAL_RAMP_16,
Not obvious what this is so maybe this enum needs docs in general.

IIO_BACKEND_DATA_SOURCE_MAX
};

--
,,, Angelo Dureghello
:: :. BayLibre -runtime team- Developer
:`___:
`____: