From fe9be814ec1c884d9794c02918f5ad1bf289ba1e Mon Sep 17 00:00:00 2001 From: Antoniu Miclaus Date: Fri, 22 Nov 2024 13:50:51 +0200 Subject: [PATCH] adi: adf4371: add debugfs support Add support for direct register access within the adf4371 pyadi implementation. Signed-off-by: Antoniu Miclaus --- adi/adf4371.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/adi/adf4371.py b/adi/adf4371.py index 916bf81a1..da19bb48e 100644 --- a/adi/adf4371.py +++ b/adi/adf4371.py @@ -148,3 +148,12 @@ def rf32_frequency(self, value): def temperature(self): """Get the temperature reading""" return self._get_iio_attr("temp0", "input", False) + + def reg_read(self, reg): + """Direct Register Access via debugfs""" + self._set_iio_debug_attr_str("direct_reg_access", reg, self._ctrl) + return self._get_iio_debug_attr_str("direct_reg_access", self._ctrl) + + def reg_write(self, reg, value): + """Direct Register Access via debugfs""" + self._set_iio_debug_attr_str("direct_reg_access", f"{reg} {value}", self._ctrl)